parse 6.1.0-alpha.2 → 6.1.0-alpha.4

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 (186) hide show
  1. package/README.md +0 -8
  2. package/dist/parse.js +31 -49
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +31 -49
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/CoreManager.js +1 -2
  7. package/lib/browser/CryptoController.js +0 -1
  8. package/lib/browser/EventEmitter.js +0 -1
  9. package/lib/browser/EventuallyQueue.js +0 -1
  10. package/lib/browser/IndexedDBStorageController.js +0 -1
  11. package/lib/browser/InstallationController.js +0 -1
  12. package/lib/browser/LocalDatastore.js +0 -1
  13. package/lib/browser/LocalDatastoreController.default.js +0 -1
  14. package/lib/browser/LocalDatastoreController.js +0 -1
  15. package/lib/browser/LocalDatastoreController.react-native.js +0 -1
  16. package/lib/browser/OfflineQuery.js +0 -1
  17. package/lib/browser/ParseInstallation.js +0 -1
  18. package/lib/browser/ParseObject.js +2 -1
  19. package/lib/browser/ParseOp.js +1 -1
  20. package/lib/browser/ParseQuery.js +19 -17
  21. package/lib/browser/RESTController.js +4 -3
  22. package/lib/browser/Socket.weapp.js +0 -1
  23. package/lib/browser/Storage.js +0 -1
  24. package/lib/browser/StorageController.browser.js +0 -1
  25. package/lib/browser/StorageController.default.js +0 -1
  26. package/lib/browser/StorageController.js +0 -1
  27. package/lib/browser/StorageController.react-native.js +0 -1
  28. package/lib/browser/StorageController.weapp.js +0 -1
  29. package/lib/browser/TaskQueue.js +1 -1
  30. package/lib/browser/WebSocketController.js +0 -1
  31. package/lib/browser/Xhr.weapp.js +0 -1
  32. package/lib/browser/uuid.js +0 -1
  33. package/lib/node/CoreManager.js +1 -2
  34. package/lib/node/CryptoController.js +0 -1
  35. package/lib/node/EventEmitter.js +0 -1
  36. package/lib/node/EventuallyQueue.js +0 -1
  37. package/lib/node/IndexedDBStorageController.js +0 -1
  38. package/lib/node/InstallationController.js +0 -1
  39. package/lib/node/LocalDatastore.js +0 -1
  40. package/lib/node/LocalDatastoreController.default.js +0 -1
  41. package/lib/node/LocalDatastoreController.js +0 -1
  42. package/lib/node/LocalDatastoreController.react-native.js +0 -1
  43. package/lib/node/OfflineQuery.js +0 -1
  44. package/lib/node/ParseInstallation.js +0 -1
  45. package/lib/node/ParseObject.js +2 -1
  46. package/lib/node/ParseOp.js +1 -1
  47. package/lib/node/RESTController.js +0 -1
  48. package/lib/node/Socket.weapp.js +0 -1
  49. package/lib/node/Storage.js +0 -1
  50. package/lib/node/StorageController.browser.js +0 -1
  51. package/lib/node/StorageController.default.js +0 -1
  52. package/lib/node/StorageController.js +0 -1
  53. package/lib/node/StorageController.react-native.js +0 -1
  54. package/lib/node/StorageController.weapp.js +0 -1
  55. package/lib/node/TaskQueue.js +1 -1
  56. package/lib/node/WebSocketController.js +0 -1
  57. package/lib/node/Xhr.weapp.js +0 -1
  58. package/lib/node/uuid.js +0 -1
  59. package/lib/react-native/CoreManager.js +1 -2
  60. package/lib/react-native/CryptoController.js +0 -1
  61. package/lib/react-native/EventEmitter.js +0 -1
  62. package/lib/react-native/EventuallyQueue.js +0 -1
  63. package/lib/react-native/IndexedDBStorageController.js +0 -1
  64. package/lib/react-native/InstallationController.js +0 -1
  65. package/lib/react-native/LocalDatastore.js +0 -1
  66. package/lib/react-native/LocalDatastoreController.default.js +0 -1
  67. package/lib/react-native/LocalDatastoreController.js +0 -1
  68. package/lib/react-native/LocalDatastoreController.react-native.js +0 -1
  69. package/lib/react-native/ObjectStateMutations.js +13 -13
  70. package/lib/react-native/OfflineQuery.js +0 -1
  71. package/lib/react-native/ParseACL.js +7 -7
  72. package/lib/react-native/ParseCLP.js +15 -15
  73. package/lib/react-native/ParseInstallation.js +0 -1
  74. package/lib/react-native/ParseObject.js +9 -9
  75. package/lib/react-native/ParseUser.js +15 -15
  76. package/lib/react-native/RESTController.js +0 -1
  77. package/lib/react-native/Socket.weapp.js +0 -1
  78. package/lib/react-native/Storage.js +0 -1
  79. package/lib/react-native/StorageController.browser.js +0 -1
  80. package/lib/react-native/StorageController.default.js +0 -1
  81. package/lib/react-native/StorageController.js +0 -1
  82. package/lib/react-native/StorageController.react-native.js +0 -1
  83. package/lib/react-native/StorageController.weapp.js +0 -1
  84. package/lib/react-native/TaskQueue.js +0 -1
  85. package/lib/react-native/WebSocketController.js +0 -1
  86. package/lib/react-native/Xhr.weapp.js +0 -1
  87. package/lib/react-native/uuid.js +0 -1
  88. package/lib/weapp/CoreManager.js +1 -2
  89. package/lib/weapp/CryptoController.js +0 -1
  90. package/lib/weapp/EventEmitter.js +0 -1
  91. package/lib/weapp/EventuallyQueue.js +0 -1
  92. package/lib/weapp/IndexedDBStorageController.js +0 -1
  93. package/lib/weapp/InstallationController.js +0 -1
  94. package/lib/weapp/LocalDatastore.js +0 -1
  95. package/lib/weapp/LocalDatastoreController.default.js +0 -1
  96. package/lib/weapp/LocalDatastoreController.js +0 -1
  97. package/lib/weapp/LocalDatastoreController.react-native.js +0 -1
  98. package/lib/weapp/OfflineQuery.js +0 -1
  99. package/lib/weapp/ParseInstallation.js +0 -1
  100. package/lib/weapp/ParseObject.js +2 -1
  101. package/lib/weapp/ParseOp.js +1 -1
  102. package/lib/weapp/ParseQuery.js +19 -17
  103. package/lib/weapp/RESTController.js +4 -3
  104. package/lib/weapp/Socket.weapp.js +0 -1
  105. package/lib/weapp/Storage.js +0 -1
  106. package/lib/weapp/StorageController.browser.js +0 -1
  107. package/lib/weapp/StorageController.default.js +0 -1
  108. package/lib/weapp/StorageController.js +0 -1
  109. package/lib/weapp/StorageController.react-native.js +0 -1
  110. package/lib/weapp/StorageController.weapp.js +0 -1
  111. package/lib/weapp/TaskQueue.js +1 -1
  112. package/lib/weapp/WebSocketController.js +0 -1
  113. package/lib/weapp/Xhr.weapp.js +0 -1
  114. package/lib/weapp/uuid.js +0 -1
  115. package/package.json +14 -12
  116. package/types/Analytics.d.ts +40 -0
  117. package/types/AnonymousUtils.d.ts +84 -0
  118. package/types/Cloud.d.ts +65 -0
  119. package/types/CloudCode.d.ts +307 -0
  120. package/types/CoreManager.d.ts +319 -0
  121. package/types/CryptoController.d.ts +5 -0
  122. package/types/EventEmitter.d.ts +5 -0
  123. package/types/EventuallyQueue.d.ts +168 -0
  124. package/types/FacebookUtils.d.ts +107 -0
  125. package/types/IndexedDBStorageController.d.ts +2 -0
  126. package/types/InstallationController.d.ts +10 -0
  127. package/types/LiveQueryClient.d.ts +128 -0
  128. package/types/LiveQuerySubscription.d.ts +103 -0
  129. package/types/LocalDatastore.d.ts +56 -0
  130. package/types/LocalDatastoreController.d.ts +2 -0
  131. package/types/LocalDatastoreController.default.d.ts +9 -0
  132. package/types/LocalDatastoreController.react-native.d.ts +9 -0
  133. package/types/LocalDatastoreUtils.d.ts +5 -0
  134. package/types/ObjectStateMutations.d.ts +22 -0
  135. package/types/OfflineQuery.d.ts +20 -0
  136. package/types/Parse.d.ts +372 -0
  137. package/types/ParseACL.d.ts +137 -0
  138. package/types/ParseCLP.d.ts +289 -0
  139. package/types/ParseConfig.d.ts +69 -0
  140. package/types/ParseError.d.ts +476 -0
  141. package/types/ParseFile.d.ts +188 -0
  142. package/types/ParseGeoPoint.d.ts +104 -0
  143. package/types/ParseHooks.d.ts +27 -0
  144. package/types/ParseInstallation.d.ts +179 -0
  145. package/types/ParseLiveQuery.d.ts +48 -0
  146. package/types/ParseObject.d.ts +1070 -0
  147. package/types/ParseOp.d.ts +76 -0
  148. package/types/ParsePolygon.d.ts +69 -0
  149. package/types/ParseQuery.d.ts +953 -0
  150. package/types/ParseRelation.d.ts +56 -0
  151. package/types/ParseRole.d.ts +79 -0
  152. package/types/ParseSchema.d.ts +270 -0
  153. package/types/ParseSession.d.ts +45 -0
  154. package/types/ParseUser.d.ts +511 -0
  155. package/types/Push.d.ts +62 -0
  156. package/types/RESTController.d.ts +35 -0
  157. package/types/SingleInstanceStateController.d.ts +24 -0
  158. package/types/Socket.weapp.d.ts +10 -0
  159. package/types/Storage.d.ts +14 -0
  160. package/types/StorageController.browser.d.ts +9 -0
  161. package/types/StorageController.d.ts +2 -0
  162. package/types/StorageController.default.d.ts +9 -0
  163. package/types/StorageController.react-native.d.ts +11 -0
  164. package/types/StorageController.weapp.d.ts +9 -0
  165. package/types/TaskQueue.d.ts +11 -0
  166. package/types/UniqueInstanceStateController.d.ts +20 -0
  167. package/types/WebSocketController.d.ts +2 -0
  168. package/types/Xhr.weapp.d.ts +29 -0
  169. package/types/arrayContainsObject.d.ts +2 -0
  170. package/types/canBeSerialized.d.ts +2 -0
  171. package/types/decode.d.ts +1 -0
  172. package/types/encode.d.ts +1 -0
  173. package/types/equals.d.ts +1 -0
  174. package/types/escape.d.ts +1 -0
  175. package/types/eslint.config.mjs +30 -0
  176. package/types/index.d.ts +66 -0
  177. package/types/isRevocableSession.d.ts +1 -0
  178. package/types/node.d.ts +3 -0
  179. package/types/parseDate.d.ts +1 -0
  180. package/types/promiseUtils.d.ts +9 -0
  181. package/types/react-native.d.ts +3 -0
  182. package/types/tests.ts +2256 -0
  183. package/types/tsconfig.json +25 -0
  184. package/types/unique.d.ts +1 -0
  185. package/types/unsavedChildren.d.ts +11 -0
  186. package/types/uuid.d.ts +2 -0
@@ -0,0 +1,511 @@
1
+ import ParseObject, { Attributes } from './ParseObject';
2
+ import type { RequestOptions, FullOptions } from './RESTController';
3
+ export type AuthData = Record<string, any>;
4
+ export interface AuthProvider {
5
+ authenticate?(options: {
6
+ error?: (provider: AuthProvider, error: string | any) => void;
7
+ success?: (provider: AuthProvider, result: AuthData) => void;
8
+ }): void;
9
+ restoreAuthentication(authData: any): boolean;
10
+ getAuthType(): string;
11
+ deauthenticate?(): void;
12
+ }
13
+ /**
14
+ * <p>A Parse.User object is a local representation of a user persisted to the
15
+ * Parse cloud. This class is a subclass of a Parse.Object, and retains the
16
+ * same functionality of a Parse.Object, but also extends it with various
17
+ * user specific methods, like authentication, signing up, and validation of
18
+ * uniqueness.</p>
19
+ *
20
+ * @alias Parse.User
21
+ * @augments Parse.Object
22
+ */
23
+ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T> {
24
+ /**
25
+ * @param {object} attributes The initial set of data to store in the user.
26
+ */
27
+ constructor(attributes?: T);
28
+ /**
29
+ * Request a revocable session token to replace the older style of token.
30
+ *
31
+ * @param {object} options
32
+ * Valid options are:<ul>
33
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
34
+ * be used for this request.
35
+ * </ul>
36
+ * @returns {Promise} A promise that is resolved when the replacement
37
+ * token has been fetched.
38
+ */
39
+ _upgradeToRevocableSession(options?: RequestOptions): Promise<void>;
40
+ /**
41
+ * Parse allows you to link your users with {@link https://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication 3rd party authentication}, enabling
42
+ * your users to sign up or log into your application using their existing identities.
43
+ * Since 2.9.0
44
+ *
45
+ * @see {@link https://docs.parseplatform.org/js/guide/#linking-users Linking Users}
46
+ * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider}
47
+ * @param {object} options
48
+ * @param {object} [options.authData] AuthData to link with
49
+ * <ul>
50
+ * <li>If provider is string, options is {@link http://docs.parseplatform.org/parse-server/guide/#supported-3rd-party-authentications authData}
51
+ * <li>If provider is AuthProvider, options is saveOpts
52
+ * </ul>
53
+ * @param {object} saveOpts useMasterKey / sessionToken
54
+ * @returns {Promise} A promise that is fulfilled with the user is linked
55
+ */
56
+ linkWith(provider: string | AuthProvider, options: {
57
+ authData?: AuthData;
58
+ }, saveOpts?: FullOptions): Promise<ParseUser>;
59
+ /**
60
+ * @param provider
61
+ * @param options
62
+ * @param {object} [options.authData]
63
+ * @param saveOpts
64
+ * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith}
65
+ * @returns {Promise}
66
+ */
67
+ _linkWith(provider: any, options: {
68
+ authData?: AuthData;
69
+ }, saveOpts?: FullOptions): Promise<ParseUser>;
70
+ /**
71
+ * Synchronizes auth data for a provider (e.g. puts the access token in the
72
+ * right place to be used by the Facebook SDK).
73
+ *
74
+ * @param provider
75
+ */
76
+ _synchronizeAuthData(provider: string | AuthProvider): void;
77
+ /**
78
+ * Synchronizes authData for all providers.
79
+ */
80
+ _synchronizeAllAuthData(): void;
81
+ /**
82
+ * Removes null values from authData (which exist temporarily for unlinking)
83
+ */
84
+ _cleanupAuthData(): void;
85
+ /**
86
+ * Unlinks a user from a service.
87
+ *
88
+ * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider}
89
+ * @param {object} options MasterKey / SessionToken
90
+ * @returns {Promise} A promise that is fulfilled when the unlinking
91
+ * finishes.
92
+ */
93
+ _unlinkFrom(provider: any, options?: FullOptions): Promise<ParseUser>;
94
+ /**
95
+ * Checks whether a user is linked to a service.
96
+ *
97
+ * @param {object} provider service to link to
98
+ * @returns {boolean} true if link was successful
99
+ */
100
+ _isLinked(provider: any): boolean;
101
+ /**
102
+ * Deauthenticates all providers.
103
+ */
104
+ _logOutWithAll(): void;
105
+ /**
106
+ * Deauthenticates a single provider (e.g. removing access tokens from the
107
+ * Facebook SDK).
108
+ *
109
+ * @param {object} provider service to logout of
110
+ */
111
+ _logOutWith(provider: any): void;
112
+ /**
113
+ * Class instance method used to maintain specific keys when a fetch occurs.
114
+ * Used to ensure that the session token is not lost.
115
+ *
116
+ * @returns {object} sessionToken
117
+ */
118
+ _preserveFieldsOnFetch(): Attributes;
119
+ /**
120
+ * Returns true if <code>current</code> would return this user.
121
+ *
122
+ * @returns {boolean} true if user is cached on disk
123
+ */
124
+ isCurrent(): boolean;
125
+ /**
126
+ * Returns true if <code>current</code> would return this user.
127
+ *
128
+ * @returns {Promise<boolean>} true if user is cached on disk
129
+ */
130
+ isCurrentAsync(): Promise<boolean>;
131
+ stripAnonymity(): void;
132
+ restoreAnonimity(anonymousData: any): void;
133
+ /**
134
+ * Returns get("username").
135
+ *
136
+ * @returns {string}
137
+ */
138
+ getUsername(): string | null;
139
+ /**
140
+ * Calls set("username", username, options) and returns the result.
141
+ *
142
+ * @param {string} username
143
+ */
144
+ setUsername(username: string): void;
145
+ /**
146
+ * Calls set("password", password, options) and returns the result.
147
+ *
148
+ * @param {string} password User's Password
149
+ */
150
+ setPassword(password: string): void;
151
+ /**
152
+ * Returns get("email").
153
+ *
154
+ * @returns {string} User's Email
155
+ */
156
+ getEmail(): string | null;
157
+ /**
158
+ * Calls set("email", email) and returns the result.
159
+ *
160
+ * @param {string} email
161
+ * @returns {boolean}
162
+ */
163
+ setEmail(email: string): this;
164
+ /**
165
+ * Returns the session token for this user, if the user has been logged in,
166
+ * or if it is the result of a query with the master key. Otherwise, returns
167
+ * undefined.
168
+ *
169
+ * @returns {string} the session token, or undefined
170
+ */
171
+ getSessionToken(): string | null;
172
+ /**
173
+ * Checks whether this user is the current user and has been authenticated.
174
+ *
175
+ * @returns {boolean} whether this user is the current user and is logged in.
176
+ */
177
+ authenticated(): boolean;
178
+ /**
179
+ * Signs up a new user. You should call this instead of save for
180
+ * new Parse.Users. This will create a new Parse.User on the server, and
181
+ * also persist the session on disk so that you can access the user using
182
+ * <code>current</code>.
183
+ *
184
+ * <p>A username and password must be set before calling signUp.</p>
185
+ *
186
+ * @param {object} attrs Extra fields to set on the new user, or null.
187
+ * @param {object} options
188
+ * Valid options are:<ul>
189
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
190
+ * be used for this request.
191
+ * <li>installationId: the installationId which made the request
192
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeLogin` and `afterLogin` triggers.
193
+ * </ul>
194
+ * @returns {Promise} A promise that is fulfilled when the signup
195
+ * finishes.
196
+ */
197
+ signUp(attrs?: Attributes | null, options?: FullOptions & {
198
+ context?: Attributes;
199
+ }): Promise<ParseUser>;
200
+ /**
201
+ * Logs in a Parse.User. On success, this saves the session to disk,
202
+ * so you can retrieve the currently logged in user using
203
+ * <code>current</code>.
204
+ *
205
+ * <p>A username and password must be set before calling logIn.</p>
206
+ *
207
+ * @param {object} options
208
+ * Valid options are:<ul>
209
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
210
+ * be used for this request.
211
+ * <li>usePost: Use POST method to make the request (default: true)
212
+ * <li>installationId: the installationId which made the request
213
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeLogin` and `afterLogin` triggers.
214
+ * </ul>
215
+ * @returns {Promise} A promise that is fulfilled with the user when
216
+ * the login is complete.
217
+ */
218
+ logIn(options?: FullOptions & {
219
+ context?: Attributes;
220
+ }): Promise<ParseUser>;
221
+ /**
222
+ * Wrap the default save behavior with functionality to save to local
223
+ * storage if this is current user.
224
+ *
225
+ * @param {...any} args
226
+ * @returns {Promise}
227
+ */
228
+ save(...args: any[]): Promise<this>;
229
+ /**
230
+ * Wrap the default destroy behavior with functionality that logs out
231
+ * the current user when it is destroyed
232
+ *
233
+ * @param {...any} args
234
+ * @returns {Parse.User}
235
+ */
236
+ destroy(...args: any[]): Promise<this>;
237
+ /**
238
+ * Wrap the default fetch behavior with functionality to save to local
239
+ * storage if this is current user.
240
+ *
241
+ * @param {...any} args
242
+ * @returns {Parse.User}
243
+ */
244
+ fetch(...args: any[]): Promise<this>;
245
+ /**
246
+ * Wrap the default fetchWithInclude behavior with functionality to save to local
247
+ * storage if this is current user.
248
+ *
249
+ * @param {...any} args
250
+ * @returns {Parse.User}
251
+ */
252
+ fetchWithInclude(...args: any[]): Promise<this>;
253
+ /**
254
+ * Verify whether a given password is the password of the current user.
255
+ *
256
+ * @param {string} password The password to be verified.
257
+ * @param {object} options The options.
258
+ * @param {boolean} [options.ignoreEmailVerification] Set to `true` to bypass email verification and verify
259
+ * the password regardless of whether the email has been verified. This requires the master key.
260
+ * @returns {Promise} A promise that is fulfilled with a user when the password is correct.
261
+ */
262
+ verifyPassword(password: string, options?: RequestOptions): Promise<ParseUser>;
263
+ static readOnlyAttributes(): string[];
264
+ /**
265
+ * Adds functionality to the existing Parse.User class.
266
+ *
267
+ * @param {object} protoProps A set of properties to add to the prototype
268
+ * @param {object} classProps A set of static properties to add to the class
269
+ * @static
270
+ * @returns {Parse.User} The newly extended Parse.User class
271
+ */
272
+ static extend(protoProps: Record<string, any>, classProps: Record<string, any>): typeof ParseUser;
273
+ /**
274
+ * Retrieves the currently logged in ParseUser with a valid session,
275
+ * either from memory or localStorage, if necessary.
276
+ *
277
+ * @static
278
+ * @returns {Parse.User} The currently logged in Parse.User.
279
+ */
280
+ static current<T extends ParseUser>(): T | null;
281
+ /**
282
+ * Retrieves the currently logged in ParseUser from asynchronous Storage.
283
+ *
284
+ * @static
285
+ * @returns {Promise} A Promise that is resolved with the currently
286
+ * logged in Parse User
287
+ */
288
+ static currentAsync<T extends ParseUser>(): Promise<T | null>;
289
+ /**
290
+ * Signs up a new user with a username (or email) and password.
291
+ * This will create a new Parse.User on the server, and also persist the
292
+ * session in localStorage so that you can access the user using
293
+ * {@link #current}.
294
+ *
295
+ * @param {string} username The username (or email) to sign up with.
296
+ * @param {string} password The password to sign up with.
297
+ * @param {object} attrs Extra fields to set on the new user.
298
+ * @param {object} options
299
+ * @static
300
+ * @returns {Promise} A promise that is fulfilled with the user when
301
+ * the signup completes.
302
+ */
303
+ static signUp<T extends ParseUser>(username: string, password: string, attrs: Attributes, options?: FullOptions): Promise<T>;
304
+ /**
305
+ * Logs in a user with a username (or email) and password. On success, this
306
+ * saves the session to disk, so you can retrieve the currently logged in
307
+ * user using <code>current</code>.
308
+ *
309
+ * @param {string} username The username (or email) to log in with.
310
+ * @param {string} password The password to log in with.
311
+ * @param {object} options
312
+ * @static
313
+ * @returns {Promise} A promise that is fulfilled with the user when
314
+ * the login completes.
315
+ */
316
+ static logIn<T extends ParseUser>(username: string, password: string, options?: FullOptions): Promise<T>;
317
+ /**
318
+ * Logs in a user with a username (or email) and password, and authData. On success, this
319
+ * saves the session to disk, so you can retrieve the currently logged in
320
+ * user using <code>current</code>.
321
+ *
322
+ * @param {string} username The username (or email) to log in with.
323
+ * @param {string} password The password to log in with.
324
+ * @param {object} authData The authData to log in with.
325
+ * @param {object} options
326
+ * @static
327
+ * @returns {Promise} A promise that is fulfilled with the user when
328
+ * the login completes.
329
+ */
330
+ static logInWithAdditionalAuth<T extends ParseUser>(username: string, password: string, authData: AuthData, options?: FullOptions): Promise<T>;
331
+ /**
332
+ * Logs in a user with an objectId. On success, this saves the session
333
+ * to disk, so you can retrieve the currently logged in user using
334
+ * <code>current</code>.
335
+ *
336
+ * @param {string} userId The objectId for the user.
337
+ * @static
338
+ * @returns {Promise} A promise that is fulfilled with the user when
339
+ * the login completes.
340
+ */
341
+ static loginAs<T extends ParseUser>(userId: string): Promise<T>;
342
+ /**
343
+ * Logs in a user with a session token. On success, this saves the session
344
+ * to disk, so you can retrieve the currently logged in user using
345
+ * <code>current</code>.
346
+ *
347
+ * @param {string} sessionToken The sessionToken to log in with.
348
+ * @param {object} options
349
+ * @param {boolean} [options.useMasterKey]
350
+ * @static
351
+ * @returns {Promise} A promise that is fulfilled with the user when
352
+ * the login completes.
353
+ */
354
+ static become<T extends ParseUser>(sessionToken: string, options?: RequestOptions): Promise<T>;
355
+ /**
356
+ * Retrieves a user with a session token.
357
+ *
358
+ * @param {string} sessionToken The sessionToken to get user with.
359
+ * @param {object} options
360
+ * @param {boolean} [options.useMasterKey]
361
+ * @static
362
+ * @returns {Promise} A promise that is fulfilled with the user is fetched.
363
+ */
364
+ static me<T extends ParseUser>(sessionToken: string, options?: RequestOptions): Promise<T>;
365
+ /**
366
+ * Logs in a user with a session token. On success, this saves the session
367
+ * to disk, so you can retrieve the currently logged in user using
368
+ * <code>current</code>. If there is no session token the user will not logged in.
369
+ *
370
+ * @param {object} userJSON The JSON map of the User's data
371
+ * @static
372
+ * @returns {Promise} A promise that is fulfilled with the user when
373
+ * the login completes.
374
+ */
375
+ static hydrate<T extends ParseUser>(userJSON: Attributes): Promise<T>;
376
+ /**
377
+ * Static version of {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith}
378
+ *
379
+ * @param provider
380
+ * @param options
381
+ * @param {object} [options.authData]
382
+ * @param saveOpts
383
+ * @static
384
+ * @returns {Promise}
385
+ */
386
+ static logInWith<T extends ParseUser>(provider: string | AuthProvider, options: {
387
+ authData?: AuthData;
388
+ }, saveOpts?: FullOptions): Promise<T>;
389
+ /**
390
+ * Logs out the currently logged in user session. This will remove the
391
+ * session from disk, log out of linked services, and future calls to
392
+ * <code>current</code> will return <code>null</code>.
393
+ *
394
+ * @param {object} options
395
+ * @static
396
+ * @returns {Promise} A promise that is resolved when the session is
397
+ * destroyed on the server.
398
+ */
399
+ static logOut(options?: RequestOptions): Promise<void>;
400
+ /**
401
+ * Requests a password reset email to be sent to the specified email address
402
+ * associated with the user account. This email allows the user to securely
403
+ * reset their password on the Parse site.
404
+ *
405
+ * @param {string} email The email address associated with the user that
406
+ * forgot their password.
407
+ * @param {object} options
408
+ * Valid options are:<ul>
409
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
410
+ * be used for this request.
411
+ * </ul>
412
+ * @static
413
+ * @returns {Promise}
414
+ */
415
+ static requestPasswordReset(email: string, options?: RequestOptions): Promise<void>;
416
+ /**
417
+ * Request an email verification.
418
+ *
419
+ * @param {string} email The email address associated with the user that
420
+ * needs to verify their email.
421
+ * @param {object} options
422
+ * Valid options are:<ul>
423
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
424
+ * be used for this request.
425
+ * </ul>
426
+ * @static
427
+ * @returns {Promise}
428
+ */
429
+ static requestEmailVerification(email: string, options?: RequestOptions): Promise<void>;
430
+ /**
431
+ * Verify whether a given password is the password of the current user.
432
+ * @static
433
+ *
434
+ * @param {string} username The username of the user whose password should be verified.
435
+ * @param {string} password The password to be verified.
436
+ * @param {object} options The options.
437
+ * @param {boolean} [options.ignoreEmailVerification] Set to `true` to bypass email verification and verify
438
+ * the password regardless of whether the email has been verified. This requires the master key.
439
+ * @returns {Promise} A promise that is fulfilled with a user when the password is correct.
440
+ */
441
+ static verifyPassword<T extends ParseUser>(username: string, password: string, options?: RequestOptions): Promise<T>;
442
+ /**
443
+ * Allow someone to define a custom User class without className
444
+ * being rewritten to _User. The default behavior is to rewrite
445
+ * User to _User for legacy reasons. This allows developers to
446
+ * override that behavior.
447
+ *
448
+ * @param {boolean} isAllowed Whether or not to allow custom User class
449
+ * @static
450
+ */
451
+ static allowCustomUserClass(isAllowed: boolean): void;
452
+ /**
453
+ * Allows a legacy application to start using revocable sessions. If the
454
+ * current session token is not revocable, a request will be made for a new,
455
+ * revocable session.
456
+ * It is not necessary to call this method from cloud code unless you are
457
+ * handling user signup or login from the server side. In a cloud code call,
458
+ * this function will not attempt to upgrade the current token.
459
+ *
460
+ * @param {object} options
461
+ * @static
462
+ * @returns {Promise} A promise that is resolved when the process has
463
+ * completed. If a replacement session token is requested, the promise
464
+ * will be resolved after a new token has been fetched.
465
+ */
466
+ static enableRevocableSession(options?: RequestOptions): Promise<void>;
467
+ /**
468
+ * Enables the use of become or the current user in a server
469
+ * environment. These features are disabled by default, since they depend on
470
+ * global objects that are not memory-safe for most servers.
471
+ *
472
+ * @static
473
+ */
474
+ static enableUnsafeCurrentUser(): void;
475
+ /**
476
+ * Disables the use of become or the current user in any environment.
477
+ * These features are disabled on servers by default, since they depend on
478
+ * global objects that are not memory-safe for most servers.
479
+ *
480
+ * @static
481
+ */
482
+ static disableUnsafeCurrentUser(): void;
483
+ /**
484
+ * When registering users with {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} a basic auth provider
485
+ * is automatically created for you.
486
+ *
487
+ * For advanced authentication, you can register an Auth provider to
488
+ * implement custom authentication, deauthentication.
489
+ *
490
+ * @param provider
491
+ * @see {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider}
492
+ * @see {@link https://docs.parseplatform.org/js/guide/#custom-authentication-module Custom Authentication Module}
493
+ * @static
494
+ */
495
+ static _registerAuthenticationProvider(provider: any): void;
496
+ /**
497
+ * @param provider
498
+ * @param options
499
+ * @param {object} [options.authData]
500
+ * @param saveOpts
501
+ * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#logInWith logInWith}
502
+ * @static
503
+ * @returns {Promise}
504
+ */
505
+ static _logInWith(provider: any, options: {
506
+ authData?: AuthData;
507
+ }, saveOpts?: FullOptions): Promise<ParseUser<Attributes>>;
508
+ static _clearCache(): void;
509
+ static _setCurrentUserCache(user: ParseUser): void;
510
+ }
511
+ export default ParseUser;
@@ -0,0 +1,62 @@
1
+ import ParseQuery from './ParseQuery';
2
+ import type ParseObject from './ParseObject';
3
+ import type { WhereClause } from './ParseQuery';
4
+ import type { FullOptions } from './RESTController';
5
+ export interface PushData {
6
+ where?: WhereClause | ParseQuery;
7
+ push_time?: Date | string;
8
+ expiration_time?: Date | string;
9
+ expiration_interval?: number;
10
+ data?: any;
11
+ channels?: string[];
12
+ }
13
+ /**
14
+ * Contains functions to deal with Push in Parse.
15
+ *
16
+ * @class Parse.Push
17
+ * @static
18
+ * @hideconstructor
19
+ */
20
+ /**
21
+ * Sends a push notification.
22
+ * **Available in Cloud Code only.**
23
+ *
24
+ * See {@link https://docs.parseplatform.org/js/guide/#push-notifications Push Notification Guide}
25
+ *
26
+ * @function send
27
+ * @name Parse.Push.send
28
+ * @param {object} data - The data of the push notification. Valid fields
29
+ * are:
30
+ * <ol>
31
+ * <li>channels - An Array of channels to push to.</li>
32
+ * <li>push_time - A Date object for when to send the push.</li>
33
+ * <li>expiration_time - A Date object for when to expire
34
+ * the push.</li>
35
+ * <li>expiration_interval - The seconds from now to expire the push.</li>
36
+ * <li>where - A Parse.Query over Parse.Installation that is used to match
37
+ * a set of installations to push to.</li>
38
+ * <li>data - The data to send as part of the push.</li>
39
+ * <ol>
40
+ * @param {object} options Valid options
41
+ * are:<ul>
42
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
43
+ * be used for this request.
44
+ * </ul>
45
+ * @returns {Promise} A promise that is fulfilled when the push request
46
+ * completes and returns `pushStatusId`.
47
+ */
48
+ export declare function send(data: PushData, options?: FullOptions): Promise<string>;
49
+ /**
50
+ * Gets push status by Id
51
+ *
52
+ * @function getPushStatus
53
+ * @name Parse.Push.getPushStatus
54
+ * @param {string} pushStatusId The Id of Push Status.
55
+ * @param {object} options Valid options
56
+ * are:<ul>
57
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
58
+ * be used for this request.
59
+ * </ul>
60
+ * @returns {Parse.Object} Status of Push.
61
+ */
62
+ export declare function getPushStatus(pushStatusId: string, options?: FullOptions): Promise<ParseObject>;
@@ -0,0 +1,35 @@
1
+ export interface RequestOptions {
2
+ useMasterKey?: boolean;
3
+ useMaintenanceKey?: boolean;
4
+ sessionToken?: string;
5
+ installationId?: string;
6
+ returnStatus?: boolean;
7
+ batchSize?: number;
8
+ include?: any;
9
+ progress?: any;
10
+ context?: any;
11
+ usePost?: boolean;
12
+ ignoreEmailVerification?: boolean;
13
+ transaction?: boolean;
14
+ }
15
+ export interface FullOptions {
16
+ success?: any;
17
+ error?: any;
18
+ useMasterKey?: boolean;
19
+ useMaintenanceKey?: boolean;
20
+ sessionToken?: string;
21
+ installationId?: string;
22
+ progress?: any;
23
+ usePost?: boolean;
24
+ }
25
+ declare const RESTController: {
26
+ ajax(method: string, url: string, data: any, headers?: any, options?: FullOptions): (Promise<any> & {
27
+ resolve: (res: any) => void;
28
+ reject: (err: any) => void;
29
+ }) | Promise<unknown>;
30
+ request(method: string, path: string, data: any, options?: RequestOptions): Promise<any>;
31
+ handleError(response: any): Promise<never>;
32
+ _setXHR(xhr: any): void;
33
+ _getXHR(): any;
34
+ };
35
+ export default RESTController;
@@ -0,0 +1,24 @@
1
+ import type { Op } from './ParseOp';
2
+ import type ParseObject from './ParseObject';
3
+ import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';
4
+ export declare function getState(obj: ParseObject): State | null;
5
+ export declare function initializeState(obj: ParseObject, initial?: State): State;
6
+ export declare function removeState(obj: ParseObject): State | null;
7
+ export declare function getServerData(obj: ParseObject): AttributeMap;
8
+ export declare function setServerData(obj: ParseObject, attributes: AttributeMap): void;
9
+ export declare function getPendingOps(obj: ParseObject): OpsMap[];
10
+ export declare function setPendingOp(obj: ParseObject, attr: string, op?: Op): void;
11
+ export declare function pushPendingState(obj: ParseObject): void;
12
+ export declare function popPendingState(obj: ParseObject): OpsMap;
13
+ export declare function mergeFirstPendingState(obj: ParseObject): void;
14
+ export declare function getObjectCache(obj: ParseObject): ObjectCache;
15
+ export declare function estimateAttribute(obj: ParseObject, attr: string): any;
16
+ export declare function estimateAttributes(obj: ParseObject): AttributeMap;
17
+ export declare function commitServerChanges(obj: ParseObject, changes: AttributeMap): void;
18
+ export declare function enqueueTask(obj: ParseObject, task: () => Promise<any>): Promise<void>;
19
+ export declare function clearAllState(): void;
20
+ export declare function duplicateState(source: {
21
+ id: string;
22
+ }, dest: {
23
+ id: string;
24
+ }): void;
@@ -0,0 +1,10 @@
1
+ declare class SocketWeapp {
2
+ onopen: () => void;
3
+ onmessage: () => void;
4
+ onclose: () => void;
5
+ onerror: () => void;
6
+ constructor(serverURL: any);
7
+ send(data: any): void;
8
+ close(): void;
9
+ }
10
+ export default SocketWeapp;
@@ -0,0 +1,14 @@
1
+ declare const Storage: {
2
+ async(): boolean;
3
+ getItem(path: string): string | null;
4
+ getItemAsync(path: string): Promise<string | null>;
5
+ setItem(path: string, value: string): void;
6
+ setItemAsync(path: string, value: string): Promise<void>;
7
+ removeItem(path: string): void;
8
+ removeItemAsync(path: string): Promise<void>;
9
+ getAllKeys(): string[];
10
+ getAllKeysAsync(): Promise<string[]>;
11
+ generatePath(path: string): string;
12
+ _clear(): void;
13
+ };
14
+ export default Storage;
@@ -0,0 +1,9 @@
1
+ declare const StorageController: {
2
+ async: number;
3
+ getItem(path: string): string | null;
4
+ setItem(path: string, value: string): void;
5
+ removeItem(path: string): void;
6
+ getAllKeys(): string[];
7
+ clear(): void;
8
+ };
9
+ export default StorageController;
@@ -0,0 +1,2 @@
1
+ declare let StorageController: any;
2
+ export default StorageController;
@@ -0,0 +1,9 @@
1
+ declare const StorageController: {
2
+ async: number;
3
+ getItem(path: string): string | null;
4
+ setItem(path: string, value: string): void;
5
+ removeItem(path: string): void;
6
+ getAllKeys(): string[];
7
+ clear(): void;
8
+ };
9
+ export default StorageController;