@vizmo/parse-server 9.10.0-1 → 9.11.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +9 -1
  2. package/lib/Adapters/Auth/AuthAdapter.js +3 -3
  3. package/lib/Adapters/Auth/index.js +83 -23
  4. package/lib/Adapters/Auth/ldap.js +13 -2
  5. package/lib/Adapters/Auth/mfa.js +4 -3
  6. package/lib/Adapters/Cache/LRUCache.js +26 -2
  7. package/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js +16 -3
  8. package/lib/Adapters/Storage/Mongo/MongoTransform.js +6 -3
  9. package/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js +7 -5
  10. package/lib/Adapters/Storage/StorageAdapter.js +1 -1
  11. package/lib/Auth.js +16 -7
  12. package/lib/Config.js +14 -5
  13. package/lib/Controllers/DatabaseController.js +76 -23
  14. package/lib/Controllers/FilesController.js +28 -24
  15. package/lib/Controllers/SchemaController.js +66 -18
  16. package/lib/Controllers/UserController.js +52 -37
  17. package/lib/Deprecator/Deprecations.js +5 -1
  18. package/lib/GraphQL/ParseGraphQLSchema.js +4 -4
  19. package/lib/GraphQL/ParseGraphQLServer.js +83 -22
  20. package/lib/LiveQuery/ParseLiveQueryServer.js +388 -146
  21. package/lib/LiveQuery/ParseWebSocketServer.js +41 -5
  22. package/lib/LiveQuery/QueryTools.js +31 -60
  23. package/lib/Options/Definitions.js +19 -9
  24. package/lib/Options/docs.js +11 -9
  25. package/lib/Options/index.js +1 -1
  26. package/lib/PromiseRouter.js +2 -19
  27. package/lib/RestQuery.js +28 -5
  28. package/lib/RestWrite.js +676 -70
  29. package/lib/Routers/SessionsRouter.js +5 -1
  30. package/lib/Routers/UsersRouter.js +9 -2
  31. package/lib/SchemaMigrations/DefinedSchemas.js +7 -3
  32. package/lib/SharedRest.js +7 -1
  33. package/lib/Utils.js +17 -1
  34. package/lib/batch.js +3 -2
  35. package/lib/cloud-code/Parse.Cloud.js +8 -2
  36. package/lib/middlewares.js +20 -3
  37. package/lib/triggers.js +7 -7
  38. package/package.json +21 -34
  39. package/types/LiveQuery/ParseLiveQueryServer.d.ts +25 -2
  40. package/types/Options/index.d.ts +21 -0
  41. package/types/ParseServer.d.ts +2 -1
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vizmo/parse-server",
3
- "version": "9.10.0-1",
3
+ "version": "9.11.0-1",
4
4
  "description": "An express module providing a Parse-compatible API server",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/parse-community/parse-server"
8
+ "url": "git+https://github.com/parse-community/parse-server.git"
9
9
  },
10
10
  "files": [
11
11
  "bin/",
@@ -25,16 +25,16 @@
25
25
  "@fastify/busboy": "3.2.0",
26
26
  "@graphql-tools/merge": "9.1.7",
27
27
  "@graphql-tools/schema": "10.0.31",
28
- "@graphql-tools/utils": "11.0.0",
28
+ "@graphql-tools/utils": "11.2.2",
29
29
  "@parse/fs-files-adapter": "3.0.0",
30
- "@parse/push-adapter": "8.4.0",
30
+ "@parse/push-adapter": "8.6.0",
31
31
  "bcryptjs": "3.0.3",
32
32
  "commander": "14.0.3",
33
33
  "cors": "2.8.6",
34
34
  "express": "5.2.1",
35
- "express-rate-limit": "8.3.1",
36
- "follow-redirects": "1.15.11",
37
- "graphql": "16.13.2",
35
+ "express-rate-limit": "8.7.0",
36
+ "follow-redirects": "1.16.0",
37
+ "graphql": "16.14.2",
38
38
  "graphql-list-fields": "2.0.4",
39
39
  "graphql-relay": "0.10.2",
40
40
  "graphql-upload": "15.0.2",
@@ -43,7 +43,7 @@
43
43
  "jwks-rsa": "3.2.0",
44
44
  "ldapjs": "3.0.7",
45
45
  "lodash": "4.18.1",
46
- "lru-cache": "11.2.7",
46
+ "lru-cache": "11.5.2",
47
47
  "mime": "4.1.0",
48
48
  "mongodb": "7.1.0",
49
49
  "mustache": "4.2.0",
@@ -60,17 +60,17 @@
60
60
  "tv4": "1.3.0",
61
61
  "winston": "3.19.0",
62
62
  "winston-daily-rotate-file": "5.0.0",
63
- "ws": "8.20.0"
63
+ "ws": "8.21.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@actions/core": "3.0.0",
66
+ "@actions/core": "3.0.1",
67
67
  "@apollo/client": "3.13.8",
68
68
  "@babel/cli": "7.28.6",
69
- "@babel/core": "7.29.0",
70
- "@babel/eslint-parser": "7.28.6",
69
+ "@babel/core": "7.29.7",
70
+ "@babel/eslint-parser": "7.29.9",
71
71
  "@babel/plugin-proposal-object-rest-spread": "7.20.7",
72
72
  "@babel/plugin-transform-flow-strip-types": "7.27.1",
73
- "@babel/preset-env": "7.29.2",
73
+ "@babel/preset-env": "7.29.7",
74
74
  "@babel/preset-typescript": "7.27.1",
75
75
  "@saithodev/semantic-release-backmerge": "4.0.1",
76
76
  "@semantic-release/changelog": "6.0.3",
@@ -78,36 +78,35 @@
78
78
  "@semantic-release/git": "10.0.1",
79
79
  "@semantic-release/github": "12.0.6",
80
80
  "@semantic-release/npm": "13.0.0",
81
- "@semantic-release/release-notes-generator": "14.1.0",
81
+ "@semantic-release/release-notes-generator": "14.1.1",
82
82
  "all-node-versions": "13.0.1",
83
83
  "apollo-upload-client": "18.0.1",
84
84
  "clean-jsdoc-theme": "4.3.0",
85
- "cross-env": "7.0.3",
85
+ "cross-env": "10.1.0",
86
86
  "deep-diff": "1.0.2",
87
87
  "eslint": "9.27.0",
88
- "eslint-plugin-expect-type": "0.6.2",
88
+ "eslint-plugin-expect-type": "0.7.0",
89
89
  "eslint-plugin-unused-imports": "4.4.1",
90
- "form-data": "4.0.5",
90
+ "form-data": "4.0.6",
91
91
  "globals": "17.3.0",
92
92
  "graphql-tag": "2.12.6",
93
93
  "jasmine": "6.1.0",
94
94
  "jasmine-spec-reporter": "7.0.0",
95
95
  "jsdoc": "4.0.5",
96
96
  "jsdoc-babel": "0.5.0",
97
- "lint-staged": "16.4.0",
98
97
  "m": "1.10.0",
99
98
  "madge": "8.0.0",
100
99
  "mock-files-adapter": "file:spec/dependencies/mock-files-adapter",
101
100
  "mock-mail-adapter": "file:spec/dependencies/mock-mail-adapter",
102
- "mongodb-runner": "5.9.3",
101
+ "mongodb-runner": "6.8.3",
103
102
  "node-abort-controller": "3.1.1",
104
103
  "node-fetch": "3.3.2",
105
104
  "nyc": "17.1.0",
106
105
  "prettier": "3.8.1",
107
106
  "semantic-release": "25.0.3",
108
107
  "typescript": "5.9.3",
109
- "typescript-eslint": "8.58.0",
110
- "yaml": "2.8.3"
108
+ "typescript-eslint": "8.59.1",
109
+ "yaml": "2.9.1"
111
110
  },
112
111
  "scripts": {
113
112
  "ci:check": "node ./ci/ciCheck.js",
@@ -133,7 +132,7 @@
133
132
  "prettier": "prettier --write {src,spec}/{**/*,*}.js",
134
133
  "prepare": "npm run build",
135
134
  "postinstall": "node -p 'require(\"./postinstall.js\")()'",
136
- "madge:circular": "node_modules/.bin/madge ./src --circular",
135
+ "madge:circular": "madge ./src --circular",
137
136
  "benchmark": "cross-env MONGODB_VERSION=8.0.4 MONGODB_TOPOLOGY=standalone mongodb-runner exec -t standalone --version 8.0.4 -- --port 27017 -- npm run benchmark:only",
138
137
  "benchmark:only": "node --expose-gc --max-old-space-size=1024 benchmark/performance.js",
139
138
  "benchmark:quick": "cross-env BENCHMARK_ITERATIONS=10 npm run benchmark:only"
@@ -156,17 +155,5 @@
156
155
  "funding": {
157
156
  "type": "opencollective",
158
157
  "url": "https://opencollective.com/parse-server"
159
- },
160
- "husky": {
161
- "hooks": {
162
- "pre-commit": "lint-staged"
163
- }
164
- },
165
- "lint-staged": {
166
- "{src,spec}/{**/*,*}.js": [
167
- "prettier --write",
168
- "eslint --fix --cache",
169
- "git add"
170
- ]
171
158
  }
172
159
  }
@@ -1,4 +1,18 @@
1
1
  import { Auth } from '../Auth';
2
+ type SubscriptionRemovalReason = 'client_unsubscribe' | 'query_update' | 'socket_close' | 'socket_error' | 'pong_timeout' | 'server_shutdown' | 'subscribe_rollback';
3
+ type SubscriptionLifecycleEvent = {
4
+ event: 'subscribe' | 'unsubscribe';
5
+ className: string;
6
+ clientId: string;
7
+ requestId: number;
8
+ installationId?: string;
9
+ query?: {
10
+ where: any;
11
+ };
12
+ reason?: SubscriptionRemovalReason;
13
+ useMasterKey: boolean;
14
+ userId?: string;
15
+ };
2
16
  declare class ParseLiveQueryServer {
3
17
  server: any;
4
18
  config: any;
@@ -17,6 +31,9 @@ declare class ParseLiveQueryServer {
17
31
  _onAfterDelete(message: any): Promise<void>;
18
32
  _onAfterSave(message: any): Promise<void>;
19
33
  _onConnect(parseWebsocket: any): void;
34
+ _handleDisconnect(parseWebsocket: any, reason?: SubscriptionRemovalReason): Promise<void>;
35
+ _validateQueryConstraints(where: any): void;
36
+ _isActiveClient(parseWebsocket: any, client: any): boolean;
20
37
  _matchesSubscription(parseObject: any, subscription: any): boolean;
21
38
  _clearCachedRoles(userId: string): Promise<void>;
22
39
  getAuthForSessionToken(sessionToken?: string): Promise<{
@@ -24,6 +41,8 @@ declare class ParseLiveQueryServer {
24
41
  userId?: string;
25
42
  }>;
26
43
  _matchesCLP(classLevelPermissions?: any, object?: any, client?: any, requestId?: number, op?: string): Promise<any>;
44
+ _loadRolesForProtectedFields(classLevelPermissions?: any, clientAuth?: any): Promise<void>;
45
+ _rolesForCLPOperation(classLevelPermissions?: any, clientAuth?: any, op?: string, appConfig?: any): Promise<string[]>;
27
46
  _filterSensitiveData(classLevelPermissions?: any, res?: any, client?: any, requestId?: number, op?: string, query?: any): Promise<void>;
28
47
  _getCLPOperation(query: any): "get" | "find";
29
48
  _verifyACL(acl: any, token: string): Promise<boolean>;
@@ -33,8 +52,12 @@ declare class ParseLiveQueryServer {
33
52
  _handleConnect(parseWebsocket: any, request: any): Promise<any>;
34
53
  _hasMasterKey(request: any, validKeyPairs: any): boolean;
35
54
  _validateKeys(request: any, validKeyPairs: any): boolean;
55
+ _getSubscriptionLifecycleUserId(client: any, subscriptionInfo: any): Promise<string | void>;
56
+ _getSubscriptionLifecycleEvent(event: 'subscribe' | 'unsubscribe', client: any, clientId: string, requestId: number, subscriptionInfo: any, reason?: SubscriptionRemovalReason): Promise<SubscriptionLifecycleEvent>;
57
+ _runSubscriptionHandler(event: 'subscribe' | 'unsubscribe', client: any, clientId: string, requestId: number, subscriptionInfo: any, reason?: SubscriptionRemovalReason): Promise<void>;
58
+ _removeSubscription(client: any, clientId: string, requestId: number, reason: SubscriptionRemovalReason, notifyClient?: boolean, emitEvents?: boolean): Promise<boolean>;
36
59
  _handleSubscribe(parseWebsocket: any, request: any): Promise<any>;
37
- _handleUpdateSubscription(parseWebsocket: any, request: any): any;
38
- _handleUnsubscribe(parseWebsocket: any, request: any, notifyClient?: boolean): any;
60
+ _handleUpdateSubscription(parseWebsocket: any, request: any): Promise<any>;
61
+ _handleUnsubscribe(parseWebsocket: any, request: any, notifyClient?: boolean, reason?: SubscriptionRemovalReason): Promise<any>;
39
62
  }
40
63
  export { ParseLiveQueryServer };
@@ -137,6 +137,7 @@ export interface ParseServerOptions {
137
137
  security?: SecurityOptions;
138
138
  enforcePrivateUsers?: boolean;
139
139
  allowExpiredAuthDataToken?: boolean;
140
+ enableLiveQueryClassLevelPermissionRoles?: boolean;
140
141
  requestKeywordDenylist?: (RequestKeywordDenylist[]);
141
142
  rateLimit?: (RateLimitOptions[]);
142
143
  verifyServerUrl?: boolean;
@@ -202,6 +203,25 @@ export interface LiveQueryOptions {
202
203
  pubSubAdapter?: Adapter<PubSubAdapter>;
203
204
  wssAdapter?: Adapter<WSSAdapter>;
204
205
  }
206
+ export type LiveQuerySubscriptionEvent = {
207
+ event: 'subscribe' | 'unsubscribe';
208
+ className: string;
209
+ clientId: string;
210
+ requestId: number;
211
+ installationId?: string;
212
+ query?: {
213
+ where: any;
214
+ };
215
+ reason?: 'client_unsubscribe' | 'query_update' | 'socket_close' | 'socket_error' | 'pong_timeout' | 'server_shutdown';
216
+ useMasterKey: boolean;
217
+ userId?: string;
218
+ };
219
+ export type LiveQuerySubscriptionHandlers = {
220
+ [className: string]: {
221
+ onSubscribe?: (event: LiveQuerySubscriptionEvent) => void | Promise<void>;
222
+ onUnsubscribe?: (event: LiveQuerySubscriptionEvent) => void | Promise<void>;
223
+ };
224
+ };
205
225
  export interface LiveQueryServerOptions {
206
226
  appId?: string;
207
227
  masterKey?: string;
@@ -215,6 +235,7 @@ export interface LiveQueryServerOptions {
215
235
  redisURL?: string;
216
236
  pubSubAdapter?: Adapter<PubSubAdapter>;
217
237
  wssAdapter?: Adapter<WSSAdapter>;
238
+ subscriptionHandlers?: LiveQuerySubscriptionHandlers;
218
239
  }
219
240
  export interface IdempotencyOptions {
220
241
  paths?: (string[]);
@@ -36,8 +36,9 @@ declare class ParseServer {
36
36
  * Create an express app for the parse server
37
37
  * @param {Object} options let you specify the maxUploadSize when creating the express app */
38
38
  static app(options: any): any;
39
- static promiseRouter({ appId }: {
39
+ static promiseRouter({ appId, options }: {
40
40
  appId: any;
41
+ options: any;
41
42
  }): any;
42
43
  /**
43
44
  * starts the parse server's express app