parse 6.1.0 → 6.2.0-alpha.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 (68) hide show
  1. package/dist/parse.js +32 -42
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +32 -42
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/CoreManager.js +1 -1
  6. package/lib/browser/Parse.js +14 -14
  7. package/lib/browser/ParseFile.js +2 -2
  8. package/lib/browser/ParseObject.js +3 -2
  9. package/lib/browser/ParseOp.js +1 -1
  10. package/lib/browser/ParseQuery.js +8 -20
  11. package/lib/browser/TaskQueue.js +1 -0
  12. package/lib/browser/equals.js +1 -1
  13. package/lib/node/CoreManager.js +1 -1
  14. package/lib/node/Parse.js +14 -14
  15. package/lib/node/ParseFile.js +2 -2
  16. package/lib/node/ParseObject.js +3 -2
  17. package/lib/node/ParseOp.js +1 -1
  18. package/lib/node/ParseQuery.js +8 -20
  19. package/lib/node/TaskQueue.js +1 -0
  20. package/lib/node/equals.js +1 -1
  21. package/lib/react-native/CoreManager.js +1 -1
  22. package/lib/react-native/ObjectStateMutations.js +13 -13
  23. package/lib/react-native/ParseACL.js +7 -7
  24. package/lib/react-native/ParseCLP.js +15 -15
  25. package/lib/react-native/ParseFile.js +1 -1
  26. package/lib/react-native/ParseObject.js +10 -10
  27. package/lib/react-native/ParseQuery.js +8 -16
  28. package/lib/react-native/ParseUser.js +15 -15
  29. package/lib/react-native/equals.js +1 -1
  30. package/lib/weapp/CoreManager.js +1 -1
  31. package/lib/weapp/Parse.js +14 -14
  32. package/lib/weapp/ParseFile.js +2 -2
  33. package/lib/weapp/ParseObject.js +3 -2
  34. package/lib/weapp/ParseOp.js +1 -1
  35. package/lib/weapp/ParseQuery.js +8 -20
  36. package/lib/weapp/TaskQueue.js +1 -0
  37. package/lib/weapp/equals.js +1 -1
  38. package/package.json +13 -24
  39. package/types/Analytics.d.ts +1 -3
  40. package/types/CoreManager.d.ts +56 -62
  41. package/types/LocalDatastore.d.ts +3 -3
  42. package/types/LocalDatastoreController.default.d.ts +1 -1
  43. package/types/LocalDatastoreController.react-native.d.ts +1 -1
  44. package/types/ObjectStateMutations.d.ts +12 -18
  45. package/types/Parse.d.ts +63 -324
  46. package/types/ParseACL.d.ts +2 -6
  47. package/types/ParseCLP.d.ts +2 -6
  48. package/types/ParseConfig.d.ts +3 -11
  49. package/types/ParseFile.d.ts +9 -13
  50. package/types/ParseInstallation.d.ts +4 -4
  51. package/types/ParseObject.d.ts +24 -26
  52. package/types/ParseOp.d.ts +13 -15
  53. package/types/ParsePolygon.d.ts +3 -3
  54. package/types/ParseQuery.d.ts +39 -55
  55. package/types/ParseSchema.d.ts +12 -28
  56. package/types/ParseUser.d.ts +8 -14
  57. package/types/Push.d.ts +2 -2
  58. package/types/RESTController.d.ts +4 -4
  59. package/types/SingleInstanceStateController.d.ts +1 -1
  60. package/types/Storage.d.ts +2 -2
  61. package/types/StorageController.react-native.d.ts +2 -2
  62. package/types/TaskQueue.d.ts +3 -3
  63. package/types/UniqueInstanceStateController.d.ts +1 -1
  64. package/types/arrayContainsObject.d.ts +1 -1
  65. package/types/encode.d.ts +1 -1
  66. package/types/eslint.config.mjs +30 -0
  67. package/types/unique.d.ts +1 -1
  68. package/types/unsavedChildren.d.ts +1 -1
@@ -1,9 +1,7 @@
1
1
  import ParseObject, { Attributes } from './ParseObject';
2
2
  import type { RequestOptions, FullOptions } from './RESTController';
3
- export type AuthData = {
4
- [key: string]: any;
5
- };
6
- export type AuthProvider = {
3
+ export type AuthData = Record<string, any>;
4
+ export interface AuthProvider {
7
5
  authenticate?(options: {
8
6
  error?: (provider: AuthProvider, error: string | any) => void;
9
7
  success?: (provider: AuthProvider, result: AuthData) => void;
@@ -11,7 +9,7 @@ export type AuthProvider = {
11
9
  restoreAuthentication(authData: any): boolean;
12
10
  getAuthType(): string;
13
11
  deauthenticate?(): void;
14
- };
12
+ }
15
13
  /**
16
14
  * <p>A Parse.User object is a local representation of a user persisted to the
17
15
  * Parse cloud. This class is a subclass of a Parse.Object, and retains the
@@ -227,7 +225,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
227
225
  * @param {...any} args
228
226
  * @returns {Promise}
229
227
  */
230
- save(...args: Array<any>): Promise<this>;
228
+ save(...args: any[]): Promise<this>;
231
229
  /**
232
230
  * Wrap the default destroy behavior with functionality that logs out
233
231
  * the current user when it is destroyed
@@ -235,7 +233,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
235
233
  * @param {...any} args
236
234
  * @returns {Parse.User}
237
235
  */
238
- destroy(...args: Array<any>): Promise<ParseUser | void>;
236
+ destroy(...args: any[]): Promise<this>;
239
237
  /**
240
238
  * Wrap the default fetch behavior with functionality to save to local
241
239
  * storage if this is current user.
@@ -243,7 +241,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
243
241
  * @param {...any} args
244
242
  * @returns {Parse.User}
245
243
  */
246
- fetch(...args: Array<any>): Promise<this>;
244
+ fetch(...args: any[]): Promise<this>;
247
245
  /**
248
246
  * Wrap the default fetchWithInclude behavior with functionality to save to local
249
247
  * storage if this is current user.
@@ -251,7 +249,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
251
249
  * @param {...any} args
252
250
  * @returns {Parse.User}
253
251
  */
254
- fetchWithInclude(...args: Array<any>): Promise<this>;
252
+ fetchWithInclude(...args: any[]): Promise<this>;
255
253
  /**
256
254
  * Verify whether a given password is the password of the current user.
257
255
  *
@@ -271,11 +269,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
271
269
  * @static
272
270
  * @returns {Parse.User} The newly extended Parse.User class
273
271
  */
274
- static extend(protoProps: {
275
- [prop: string]: any;
276
- }, classProps: {
277
- [prop: string]: any;
278
- }): typeof ParseUser;
272
+ static extend(protoProps: Record<string, any>, classProps: Record<string, any>): typeof ParseUser;
279
273
  /**
280
274
  * Retrieves the currently logged in ParseUser with a valid session,
281
275
  * either from memory or localStorage, if necessary.
package/types/Push.d.ts CHANGED
@@ -2,14 +2,14 @@ import ParseQuery from './ParseQuery';
2
2
  import type ParseObject from './ParseObject';
3
3
  import type { WhereClause } from './ParseQuery';
4
4
  import type { FullOptions } from './RESTController';
5
- export type PushData = {
5
+ export interface PushData {
6
6
  where?: WhereClause | ParseQuery;
7
7
  push_time?: Date | string;
8
8
  expiration_time?: Date | string;
9
9
  expiration_interval?: number;
10
10
  data?: any;
11
11
  channels?: string[];
12
- };
12
+ }
13
13
  /**
14
14
  * Contains functions to deal with Push in Parse.
15
15
  *
@@ -1,4 +1,4 @@
1
- export type RequestOptions = {
1
+ export interface RequestOptions {
2
2
  useMasterKey?: boolean;
3
3
  useMaintenanceKey?: boolean;
4
4
  sessionToken?: string;
@@ -11,8 +11,8 @@ export type RequestOptions = {
11
11
  usePost?: boolean;
12
12
  ignoreEmailVerification?: boolean;
13
13
  transaction?: boolean;
14
- };
15
- export type FullOptions = {
14
+ }
15
+ export interface FullOptions {
16
16
  success?: any;
17
17
  error?: any;
18
18
  useMasterKey?: boolean;
@@ -21,7 +21,7 @@ export type FullOptions = {
21
21
  installationId?: string;
22
22
  progress?: any;
23
23
  usePost?: boolean;
24
- };
24
+ }
25
25
  declare const RESTController: {
26
26
  ajax(method: string, url: string, data: any, headers?: any, options?: FullOptions): (Promise<any> & {
27
27
  resolve: (res: any) => void;
@@ -6,7 +6,7 @@ export declare function initializeState(obj: ParseObject, initial?: State): Stat
6
6
  export declare function removeState(obj: ParseObject): State | null;
7
7
  export declare function getServerData(obj: ParseObject): AttributeMap;
8
8
  export declare function setServerData(obj: ParseObject, attributes: AttributeMap): void;
9
- export declare function getPendingOps(obj: ParseObject): Array<OpsMap>;
9
+ export declare function getPendingOps(obj: ParseObject): OpsMap[];
10
10
  export declare function setPendingOp(obj: ParseObject, attr: string, op?: Op): void;
11
11
  export declare function pushPendingState(obj: ParseObject): void;
12
12
  export declare function popPendingState(obj: ParseObject): OpsMap;
@@ -6,8 +6,8 @@ declare const Storage: {
6
6
  setItemAsync(path: string, value: string): Promise<void>;
7
7
  removeItem(path: string): void;
8
8
  removeItemAsync(path: string): Promise<void>;
9
- getAllKeys(): Array<string>;
10
- getAllKeysAsync(): Promise<Array<string>>;
9
+ getAllKeys(): string[];
10
+ getAllKeysAsync(): Promise<string[]>;
11
11
  generatePath(path: string): string;
12
12
  _clear(): void;
13
13
  };
@@ -4,8 +4,8 @@ declare const StorageController: {
4
4
  setItemAsync(path: string, value: string): Promise<void>;
5
5
  removeItemAsync(path: string): Promise<void>;
6
6
  getAllKeysAsync(): Promise<readonly string[]>;
7
- multiGet(keys: Array<string>): Promise<readonly [string, string | null][] | null>;
8
- multiRemove(keys: Array<string>): Promise<Array<string>>;
7
+ multiGet(keys: string[]): Promise<readonly [string, string | null][] | null>;
8
+ multiRemove(keys: string[]): Promise<string[]>;
9
9
  clear(): Promise<void>;
10
10
  };
11
11
  export default StorageController;
@@ -1,9 +1,9 @@
1
- type Task = {
1
+ interface Task {
2
2
  task: () => Promise<void>;
3
3
  _completion: any;
4
- };
4
+ }
5
5
  declare class TaskQueue {
6
- queue: Array<Task>;
6
+ queue: Task[];
7
7
  constructor();
8
8
  enqueue(task: () => Promise<void>): Promise<void>;
9
9
  _dequeue(): void;
@@ -6,7 +6,7 @@ export declare function initializeState(obj: ParseObject, initial?: State): Stat
6
6
  export declare function removeState(obj: ParseObject): State | null;
7
7
  export declare function getServerData(obj: ParseObject): AttributeMap;
8
8
  export declare function setServerData(obj: ParseObject, attributes: AttributeMap): void;
9
- export declare function getPendingOps(obj: ParseObject): Array<OpsMap>;
9
+ export declare function getPendingOps(obj: ParseObject): OpsMap[];
10
10
  export declare function setPendingOp(obj: ParseObject, attr: string, op?: Op): void;
11
11
  export declare function pushPendingState(obj: ParseObject): void;
12
12
  export declare function popPendingState(obj: ParseObject): OpsMap;
@@ -1,2 +1,2 @@
1
1
  import type ParseObject from './ParseObject';
2
- export default function arrayContainsObject(array: Array<any>, object: ParseObject): boolean;
2
+ export default function arrayContainsObject(array: any[], object: ParseObject): boolean;
package/types/encode.d.ts CHANGED
@@ -1 +1 @@
1
- export default function (value: any, disallowObjects?: boolean, forcePointers?: boolean, seen?: Array<any>, offline?: boolean): any;
1
+ export default function (value: any, disallowObjects?: boolean, forcePointers?: boolean, seen?: any[], offline?: boolean): any;
@@ -0,0 +1,30 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import expectType from 'eslint-plugin-expect-type/configs/recommended';
4
+
5
+ export default tseslint.config({
6
+ files: ['**/*.js', '**/*.ts'],
7
+ extends: [
8
+ expectType,
9
+ eslint.configs.recommended,
10
+ ...tseslint.configs.recommended,
11
+ ...tseslint.configs.recommendedTypeChecked,
12
+ ],
13
+ plugins: {
14
+ '@typescript-eslint': tseslint.plugin,
15
+ },
16
+ rules: {
17
+ '@typescript-eslint/no-unused-vars': 'off',
18
+ '@typescript-eslint/no-unused-expressions': 'off',
19
+ '@typescript-eslint/no-unsafe-call': 'off',
20
+ "@typescript-eslint/no-explicit-any": "off",
21
+ "@typescript-eslint/no-unsafe-return": "off",
22
+ },
23
+ languageOptions: {
24
+ parser: tseslint.parser,
25
+ parserOptions: {
26
+ projectService: true,
27
+ tsconfigRootDir: import.meta.dirname,
28
+ },
29
+ },
30
+ });
package/types/unique.d.ts CHANGED
@@ -1 +1 @@
1
- export default function unique<T>(arr: Array<T>): Array<T>;
1
+ export default function unique<T>(arr: T[]): T[];
@@ -8,4 +8,4 @@ import type ParseObject from './ParseObject';
8
8
  * @param {boolean} allowDeepUnsaved
9
9
  * @returns {Array}
10
10
  */
11
- export default function unsavedChildren(obj: ParseObject, allowDeepUnsaved?: boolean): Array<ParseFile | ParseObject>;
11
+ export default function unsavedChildren(obj: ParseObject, allowDeepUnsaved?: boolean): (ParseFile | ParseObject)[];