Skip to content

Commit a226b20

Browse files
authored
Merge branch 'alpha' into flaky-dist-test
2 parents 525d106 + 1fa1337 commit a226b20

File tree

8 files changed

+1314
-1735
lines changed

8 files changed

+1314
-1735
lines changed

package-lock.json

Lines changed: 1236 additions & 1720 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,35 @@
3131
"react-native": false
3232
},
3333
"dependencies": {
34-
"@babel/runtime-corejs3": "7.27.0",
34+
"@babel/runtime-corejs3": "7.27.1",
3535
"idb-keyval": "6.2.1",
3636
"react-native-crypto-js": "1.0.0",
3737
"uuid": "10.0.0",
38-
"ws": "8.18.1"
38+
"ws": "8.18.2"
3939
},
4040
"devDependencies": {
41-
"@babel/core": "7.26.10",
41+
"@babel/core": "7.27.1",
4242
"@babel/plugin-proposal-class-properties": "7.18.6",
43-
"@babel/plugin-transform-runtime": "7.26.10",
43+
"@babel/plugin-transform-runtime": "7.27.1",
4444
"@babel/preset-env": "7.26.9",
45-
"@babel/preset-react": "7.26.3",
46-
"@babel/preset-typescript": "7.27.0",
47-
"@eslint/js": "9.25.1",
45+
"@babel/preset-react": "7.27.1",
46+
"@babel/preset-typescript": "7.27.1",
47+
"@eslint/js": "9.26.0",
4848
"@parse/minami": "git+https://github.com/parse-community/minami#main",
4949
"@rollup/plugin-terser": "0.4.4",
5050
"@saithodev/semantic-release-backmerge": "4.0.1",
5151
"@semantic-release/changelog": "6.0.3",
5252
"@semantic-release/commit-analyzer": "13.0.1",
5353
"@semantic-release/git": "10.0.1",
54-
"@semantic-release/github": "11.0.1",
54+
"@semantic-release/github": "11.0.2",
5555
"@semantic-release/npm": "12.0.1",
5656
"@semantic-release/release-notes-generator": "14.0.3",
5757
"@types/facebook-js-sdk": "3.3.11",
5858
"babel-jest": "29.5.0",
5959
"babel-plugin-minify-dead-code-elimination": "0.5.2",
6060
"babel-plugin-transform-inline-environment-variables": "0.4.4",
6161
"codecov": "3.8.3",
62-
"core-js": "3.41.0",
62+
"core-js": "3.42.0",
6363
"cross-env": "7.0.2",
6464
"eslint": "9.25.1",
6565
"eslint-plugin-expect-type": "0.6.2",
@@ -68,7 +68,7 @@
6868
"gulp": "5.0.0",
6969
"gulp-babel": "8.0.0",
7070
"gulp-watch": "5.0.1",
71-
"jasmine": "5.6.0",
71+
"jasmine": "5.7.1",
7272
"jasmine-reporters": "2.5.2",
7373
"jasmine-spec-reporter": "7.0.0",
7474
"jest": "29.7.0",
@@ -78,13 +78,13 @@
7878
"lint-staged": "15.5.1",
7979
"madge": "8.0.0",
8080
"metro-react-native-babel-preset": "0.77.0",
81-
"mongodb-runner": "5.8.2",
82-
"parse-server": "8.1.0",
83-
"puppeteer": "24.6.1",
81+
"mongodb-runner": "5.8.3",
82+
"parse-server": "8.2.0",
83+
"puppeteer": "24.8.0",
8484
"regenerator-runtime": "0.14.1",
8585
"semantic-release": "24.2.3",
86-
"typescript-eslint": "8.31.0",
87-
"vite": "6.3.3",
86+
"typescript-eslint": "8.31.1",
87+
"vite": "6.3.4",
8888
"vite-plugin-commonjs": "0.10.4",
8989
"vite-plugin-node-polyfills": "0.23.0"
9090
},

src/CoreManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ const config: Config & Record<string, any> = {
355355
IDEMPOTENCY: false,
356356
ALLOW_CUSTOM_OBJECT_ID: false,
357357
PARSE_ERRORS: [],
358+
NODE_LOGGING: false,
358359
};
359360

360361
function requireMethods(name: string, methods: string[], controller: any) {

src/Parse.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,28 @@ const Parse = {
314314
return CoreManager.get('ALLOW_CUSTOM_OBJECT_ID');
315315
},
316316

317+
/**
318+
* Setting this property to `true` enables enhanced logging for `Parse.Object`
319+
* in Node.js environments. Specifically, it will log:
320+
*
321+
* ```
322+
* ParseObject: className: <CLASS_NAME>, id: <OBJECT_ID>
323+
* Attributes: <OBJECT_ATTRIBUTES>
324+
* ```
325+
*
326+
* @warning This should not be enabled in production environments as this may
327+
* expose sensitive information in server logs.
328+
*
329+
* @property {boolean} Parse.nodeLogging
330+
* @static
331+
*/
332+
set nodeLogging(value) {
333+
CoreManager.set('NODE_LOGGING', value);
334+
},
335+
get nodeLogging() {
336+
return CoreManager.get('NODE_LOGGING');
337+
},
338+
317339
_request(...args) {
318340
return CoreManager.getRESTController().request.apply(null, args);
319341
},

src/ParseObject.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ class ParseObject<T extends Attributes = Attributes> {
186186
throw new Error("Can't create an invalid Parse Object");
187187
}
188188
}
189+
if (CoreManager.get('NODE_LOGGING')) {
190+
this[Symbol.for('nodejs.util.inspect.custom')] = function () {
191+
return `ParseObject: className: ${this.className}, id: ${
192+
this.id
193+
}\nAttributes: ${JSON.stringify(this.attributes, null, 2)}`;
194+
};
195+
}
189196
}
190197

191198
/**

src/__tests__/Parse-test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ describe('Parse module', () => {
206206
Parse.allowCustomObjectId = false;
207207
});
208208

209+
it('can set nodeLogging', () => {
210+
expect(Parse.nodeLogging).toBe(false);
211+
Parse.nodeLogging = true;
212+
expect(CoreManager.get('NODE_LOGGING')).toBe(true);
213+
Parse.nodeLogging = false;
214+
});
215+
209216
it('getServerHealth', () => {
210217
const controller = {
211218
request: jest.fn(),

src/__tests__/ParseObject-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3532,4 +3532,14 @@ describe('ParseObject pin', () => {
35323532
});
35333533
CoreManager.set('ALLOW_CUSTOM_OBJECT_ID', false);
35343534
});
3535+
3536+
it('can log an object', () => {
3537+
CoreManager.set('NODE_LOGGING', true);
3538+
const o = new ParseObject('Person', { foo: 'bar' });
3539+
const symbol = Symbol.for('nodejs.util.inspect.custom');
3540+
expect(o[symbol]()).toBe(
3541+
`ParseObject: className: Person, id: undefined\nAttributes: {\n \"foo\": \"bar\"\n}`
3542+
);
3543+
CoreManager.set('NODE_LOGGING', false);
3544+
});
35353545
});

types/Parse.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,22 @@ declare const Parse: {
322322
* @static
323323
*/
324324
allowCustomObjectId: any;
325+
/**
326+
* Setting this property to `true` enables enhanced logging for `Parse.Object`
327+
* in Node.js environments. Specifically, it will log:
328+
*
329+
* ```
330+
* ParseObject: className: <CLASS_NAME>, id: <OBJECT_ID>
331+
* Attributes: <OBJECT_ATTRIBUTES>
332+
* ```
333+
*
334+
* @warning This should not be enabled in production environments as this may
335+
* expose sensitive information in server logs.
336+
*
337+
* @property {boolean} Parse.nodeLogging
338+
* @static
339+
*/
340+
nodeLogging: any;
325341
_request(...args: any[]): any;
326342
_ajax(...args: any[]): any;
327343
_decode(_: any, value: any): any;

0 commit comments

Comments
 (0)