parse 6.1.0-alpha.3 → 6.1.0-alpha.5
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.
- package/dist/parse.js +28 -38
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +28 -38
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/Parse.js +14 -14
- package/lib/browser/ParseObject.js +2 -1
- package/lib/browser/ParseOp.js +1 -1
- package/lib/browser/ParseQuery.js +8 -20
- package/lib/browser/TaskQueue.js +1 -0
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/Parse.js +14 -14
- package/lib/node/ParseObject.js +2 -1
- package/lib/node/ParseOp.js +1 -1
- package/lib/node/ParseQuery.js +8 -20
- package/lib/node/TaskQueue.js +1 -0
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/ObjectStateMutations.js +13 -13
- package/lib/react-native/ParseACL.js +7 -7
- package/lib/react-native/ParseCLP.js +15 -15
- package/lib/react-native/ParseObject.js +9 -9
- package/lib/react-native/ParseQuery.js +8 -16
- package/lib/react-native/ParseUser.js +15 -15
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/Parse.js +14 -14
- package/lib/weapp/ParseObject.js +2 -1
- package/lib/weapp/ParseOp.js +1 -1
- package/lib/weapp/ParseQuery.js +8 -20
- package/lib/weapp/TaskQueue.js +1 -0
- package/package.json +8 -8
- package/types/Analytics.d.ts +1 -3
- package/types/CoreManager.d.ts +56 -62
- package/types/LocalDatastore.d.ts +3 -3
- package/types/LocalDatastoreController.default.d.ts +1 -1
- package/types/LocalDatastoreController.react-native.d.ts +1 -1
- package/types/ObjectStateMutations.d.ts +12 -18
- package/types/Parse.d.ts +63 -324
- package/types/ParseACL.d.ts +2 -6
- package/types/ParseCLP.d.ts +2 -6
- package/types/ParseConfig.d.ts +3 -11
- package/types/ParseFile.d.ts +8 -12
- package/types/ParseInstallation.d.ts +4 -4
- package/types/ParseObject.d.ts +24 -26
- package/types/ParseOp.d.ts +13 -15
- package/types/ParsePolygon.d.ts +3 -3
- package/types/ParseQuery.d.ts +39 -55
- package/types/ParseSchema.d.ts +12 -28
- package/types/ParseUser.d.ts +8 -14
- package/types/Push.d.ts +2 -2
- package/types/RESTController.d.ts +4 -4
- package/types/SingleInstanceStateController.d.ts +1 -1
- package/types/Storage.d.ts +2 -2
- package/types/StorageController.react-native.d.ts +2 -2
- package/types/TaskQueue.d.ts +3 -3
- package/types/UniqueInstanceStateController.d.ts +1 -1
- package/types/arrayContainsObject.d.ts +1 -1
- package/types/encode.d.ts +1 -1
- package/types/eslint.config.mjs +30 -0
- package/types/unique.d.ts +1 -1
- package/types/unsavedChildren.d.ts +1 -1
package/types/ParseConfig.d.ts
CHANGED
|
@@ -6,12 +6,8 @@ import type { RequestOptions } from './RESTController';
|
|
|
6
6
|
* @alias Parse.Config
|
|
7
7
|
*/
|
|
8
8
|
declare class ParseConfig {
|
|
9
|
-
attributes:
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
_escapedAttributes: {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
9
|
+
attributes: Record<string, any>;
|
|
10
|
+
_escapedAttributes: Record<string, any>;
|
|
15
11
|
constructor();
|
|
16
12
|
/**
|
|
17
13
|
* Gets the value of an attribute.
|
|
@@ -62,11 +58,7 @@ declare class ParseConfig {
|
|
|
62
58
|
* @returns {Promise} A promise that is resolved with a newly-created
|
|
63
59
|
* configuration object or with the current with the update.
|
|
64
60
|
*/
|
|
65
|
-
static save(attrs:
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
}, masterKeyOnlyFlags: {
|
|
68
|
-
[key: string]: any;
|
|
69
|
-
}): Promise<ParseConfig>;
|
|
61
|
+
static save(attrs: Record<string, any>, masterKeyOnlyFlags: Record<string, any>): Promise<ParseConfig>;
|
|
70
62
|
/**
|
|
71
63
|
* Used for testing
|
|
72
64
|
*
|
package/types/ParseFile.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import type { FullOptions } from './RESTController';
|
|
2
|
-
|
|
2
|
+
interface Base64 {
|
|
3
3
|
base64: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
interface Uri {
|
|
6
6
|
uri: string;
|
|
7
|
-
}
|
|
8
|
-
type FileData =
|
|
7
|
+
}
|
|
8
|
+
type FileData = number[] | Base64 | Blob | Uri;
|
|
9
9
|
export type FileSaveOptions = FullOptions & {
|
|
10
|
-
metadata?:
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
tags?: {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
};
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
tags?: Record<string, any>;
|
|
16
12
|
};
|
|
17
13
|
export type FileSource = {
|
|
18
14
|
format: 'file';
|
|
@@ -187,6 +183,6 @@ declare class ParseFile {
|
|
|
187
183
|
*/
|
|
188
184
|
addTag(key: string, value: string): void;
|
|
189
185
|
static fromJSON(obj: any): ParseFile;
|
|
190
|
-
static encodeBase64(bytes:
|
|
186
|
+
static encodeBase64(bytes: number[] | Uint8Array): string;
|
|
191
187
|
}
|
|
192
188
|
export default ParseFile;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import ParseObject, { Attributes } from './ParseObject';
|
|
2
|
-
|
|
2
|
+
interface DeviceInterface {
|
|
3
3
|
IOS: string;
|
|
4
4
|
MACOS: string;
|
|
5
5
|
TVOS: string;
|
|
6
6
|
FCM: string;
|
|
7
7
|
ANDROID: string;
|
|
8
8
|
WEB: string;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
/**
|
|
11
11
|
* Parse.Installation is a local representation of installation data that can be saved and retrieved from the Parse cloud.
|
|
12
12
|
* This class is a subclass of a Parse.Object, and retains the same functionality of a Parse.Object, but also extends it with installation-specific features.
|
|
@@ -153,7 +153,7 @@ declare class ParseInstallation<T extends Attributes = Attributes> extends Parse
|
|
|
153
153
|
* @param {...any} args
|
|
154
154
|
* @returns {Promise}
|
|
155
155
|
*/
|
|
156
|
-
fetch(...args:
|
|
156
|
+
fetch(...args: any[]): Promise<this>;
|
|
157
157
|
/**
|
|
158
158
|
* Wrap the default save behavior with functionality to update the local storage.
|
|
159
159
|
* If the installation is deleted on the server, retry saving a new installation.
|
|
@@ -161,7 +161,7 @@ declare class ParseInstallation<T extends Attributes = Attributes> extends Parse
|
|
|
161
161
|
* @param {...any} args
|
|
162
162
|
* @returns {Promise}
|
|
163
163
|
*/
|
|
164
|
-
save(...args:
|
|
164
|
+
save(...args: any[]): Promise<this>;
|
|
165
165
|
_markAllFieldsDirty(): void;
|
|
166
166
|
/**
|
|
167
167
|
* Get the current Parse.Installation from disk. If doesn't exists, create an new installation.
|
package/types/ParseObject.d.ts
CHANGED
|
@@ -7,37 +7,35 @@ import type { AttributeMap, OpsMap } from './ObjectStateMutations';
|
|
|
7
7
|
import type { RequestOptions, FullOptions } from './RESTController';
|
|
8
8
|
import type ParseGeoPoint from './ParseGeoPoint';
|
|
9
9
|
import type ParsePolygon from './ParsePolygon';
|
|
10
|
-
export
|
|
10
|
+
export interface Pointer {
|
|
11
11
|
__type: string;
|
|
12
12
|
className: string;
|
|
13
13
|
objectId?: string;
|
|
14
14
|
_localId?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
15
|
+
}
|
|
16
|
+
interface SaveParams {
|
|
17
17
|
method: string;
|
|
18
18
|
path: string;
|
|
19
19
|
body: AttributeMap;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
export type SaveOptions = FullOptions & {
|
|
22
22
|
cascadeSave?: boolean;
|
|
23
23
|
context?: AttributeMap;
|
|
24
24
|
batchSize?: number;
|
|
25
25
|
transaction?: boolean;
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
interface FetchOptions {
|
|
28
28
|
useMasterKey?: boolean;
|
|
29
29
|
sessionToken?: string;
|
|
30
30
|
include?: string | string[];
|
|
31
31
|
context?: AttributeMap;
|
|
32
|
-
}
|
|
33
|
-
export
|
|
32
|
+
}
|
|
33
|
+
export interface SetOptions {
|
|
34
34
|
ignoreValidation?: boolean;
|
|
35
35
|
unset?: boolean;
|
|
36
|
-
};
|
|
37
|
-
export type AttributeKey<T> = Extract<keyof T, string>;
|
|
38
|
-
export interface Attributes {
|
|
39
|
-
[key: string]: any;
|
|
40
36
|
}
|
|
37
|
+
export type AttributeKey<T> = Extract<keyof T, string>;
|
|
38
|
+
export type Attributes = Record<string, any>;
|
|
41
39
|
interface JSONBaseAttributes {
|
|
42
40
|
objectId: string;
|
|
43
41
|
createdAt: string;
|
|
@@ -52,7 +50,7 @@ type AtomicKey<T> = {
|
|
|
52
50
|
type Encode<T> = T extends ParseObject ? ReturnType<T['toJSON']> | Pointer : T extends ParseACL | ParseGeoPoint | ParsePolygon | ParseRelation | ParseFile ? ReturnType<T['toJSON']> : T extends Date ? {
|
|
53
51
|
__type: 'Date';
|
|
54
52
|
iso: string;
|
|
55
|
-
} : T extends RegExp ? string : T extends
|
|
53
|
+
} : T extends RegExp ? string : T extends (infer R)[] ? Encode<R>[] : T extends object ? ToJSON<T> : T;
|
|
56
54
|
type ToJSON<T> = {
|
|
57
55
|
[K in keyof T]: Encode<T[K]>;
|
|
58
56
|
};
|
|
@@ -126,14 +124,14 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
126
124
|
};
|
|
127
125
|
_getServerData(): Attributes;
|
|
128
126
|
_clearServerData(): void;
|
|
129
|
-
_getPendingOps():
|
|
127
|
+
_getPendingOps(): OpsMap[];
|
|
130
128
|
/**
|
|
131
129
|
* @param {Array<string>} [keysToClear] - if specified, only ops matching
|
|
132
130
|
* these fields will be cleared
|
|
133
131
|
*/
|
|
134
|
-
_clearPendingOps(keysToClear?:
|
|
132
|
+
_clearPendingOps(keysToClear?: string[]): void;
|
|
135
133
|
_getDirtyObjectAttributes(): Attributes;
|
|
136
|
-
_toFullJSON(seen?:
|
|
134
|
+
_toFullJSON(seen?: any[], offline?: boolean): Attributes;
|
|
137
135
|
_getSaveJSON(): Attributes;
|
|
138
136
|
_getSaveParams(): SaveParams;
|
|
139
137
|
_finishFetch(serverData: Attributes): void;
|
|
@@ -155,7 +153,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
155
153
|
* @param offline
|
|
156
154
|
* @returns {object}
|
|
157
155
|
*/
|
|
158
|
-
toJSON(seen
|
|
156
|
+
toJSON(seen?: any[], offline?: boolean): ToJSON<T> & JSONBaseAttributes;
|
|
159
157
|
/**
|
|
160
158
|
* Determines whether this ParseObject is equal to another ParseObject
|
|
161
159
|
*
|
|
@@ -426,7 +424,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
426
424
|
*
|
|
427
425
|
* @param {string} [keys] - specify which fields to revert
|
|
428
426
|
*/
|
|
429
|
-
revert(...keys:
|
|
427
|
+
revert(...keys: Extract<keyof (T & CommonAttributes), string>[]): void;
|
|
430
428
|
/**
|
|
431
429
|
* Clears all attributes on a model
|
|
432
430
|
*
|
|
@@ -469,7 +467,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
469
467
|
* @returns {Promise} A promise that is fulfilled when the fetch
|
|
470
468
|
* completes.
|
|
471
469
|
*/
|
|
472
|
-
fetchWithInclude(keys: string |
|
|
470
|
+
fetchWithInclude(keys: string | (string | string[])[], options?: RequestOptions): Promise<this>;
|
|
473
471
|
/**
|
|
474
472
|
* Saves this object to the server at some unspecified time in the future,
|
|
475
473
|
* even if Parse is currently inaccessible.
|
|
@@ -596,7 +594,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
596
594
|
* @returns {Promise} A promise that is fulfilled when the destroy
|
|
597
595
|
* completes.
|
|
598
596
|
*/
|
|
599
|
-
destroy(options?: RequestOptions): Promise<
|
|
597
|
+
destroy(options?: RequestOptions): Promise<ParseObject | undefined>;
|
|
600
598
|
/**
|
|
601
599
|
* Asynchronously stores the object and every object it points to in the local datastore,
|
|
602
600
|
* recursively, using a default pin name: _default.
|
|
@@ -733,7 +731,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
733
731
|
* @static
|
|
734
732
|
* @returns {Parse.Object[]}
|
|
735
733
|
*/
|
|
736
|
-
static fetchAllWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] |
|
|
734
|
+
static fetchAllWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise<T[]>;
|
|
737
735
|
/**
|
|
738
736
|
* Fetches the given list of Parse.Object if needed.
|
|
739
737
|
* If any error is encountered, stops and calls the error handler.
|
|
@@ -764,7 +762,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
764
762
|
* @static
|
|
765
763
|
* @returns {Parse.Object[]}
|
|
766
764
|
*/
|
|
767
|
-
static fetchAllIfNeededWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] |
|
|
765
|
+
static fetchAllIfNeededWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise<T[]>;
|
|
768
766
|
/**
|
|
769
767
|
* Fetches the given list of Parse.Object if needed.
|
|
770
768
|
* If any error is encountered, stops and calls the error handler.
|
|
@@ -851,7 +849,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
851
849
|
* @returns {Promise} A promise that is fulfilled when the destroyAll
|
|
852
850
|
* completes.
|
|
853
851
|
*/
|
|
854
|
-
static destroyAll(list:
|
|
852
|
+
static destroyAll(list: ParseObject[], options?: SaveOptions): Promise<ParseObject<Attributes> | ParseObject<Attributes>[]>;
|
|
855
853
|
/**
|
|
856
854
|
* Saves the given list of Parse.Object.
|
|
857
855
|
* If any error is encountered, stops and calls the error handler.
|
|
@@ -998,7 +996,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
998
996
|
* @returns {Promise} A promise that is fulfilled when the pin completes.
|
|
999
997
|
* @static
|
|
1000
998
|
*/
|
|
1001
|
-
static pinAll(objects:
|
|
999
|
+
static pinAll(objects: ParseObject[]): Promise<void>;
|
|
1002
1000
|
/**
|
|
1003
1001
|
* Asynchronously stores the objects and every object they point to in the local datastore, recursively.
|
|
1004
1002
|
*
|
|
@@ -1017,7 +1015,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
1017
1015
|
* @returns {Promise} A promise that is fulfilled when the pin completes.
|
|
1018
1016
|
* @static
|
|
1019
1017
|
*/
|
|
1020
|
-
static pinAllWithName(name: string, objects:
|
|
1018
|
+
static pinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
|
|
1021
1019
|
/**
|
|
1022
1020
|
* Asynchronously removes the objects and every object they point to in the local datastore,
|
|
1023
1021
|
* recursively, using a default pin name: _default.
|
|
@@ -1030,7 +1028,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
1030
1028
|
* @returns {Promise} A promise that is fulfilled when the unPin completes.
|
|
1031
1029
|
* @static
|
|
1032
1030
|
*/
|
|
1033
|
-
static unPinAll(objects:
|
|
1031
|
+
static unPinAll(objects: ParseObject[]): Promise<void>;
|
|
1034
1032
|
/**
|
|
1035
1033
|
* Asynchronously removes the objects and every object they point to in the local datastore, recursively.
|
|
1036
1034
|
*
|
|
@@ -1043,7 +1041,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
|
|
|
1043
1041
|
* @returns {Promise} A promise that is fulfilled when the unPin completes.
|
|
1044
1042
|
* @static
|
|
1045
1043
|
*/
|
|
1046
|
-
static unPinAllWithName(name: string, objects:
|
|
1044
|
+
static unPinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
|
|
1047
1045
|
/**
|
|
1048
1046
|
* Asynchronously removes all objects in the local datastore using a default pin name: _default.
|
|
1049
1047
|
*
|
package/types/ParseOp.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type ParseObject from './ParseObject';
|
|
2
2
|
import ParseRelation from './ParseRelation';
|
|
3
|
-
export declare function opFromJSON(json:
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}): Op | null;
|
|
3
|
+
export declare function opFromJSON(json: Record<string, any>): Op | null;
|
|
6
4
|
export declare class Op {
|
|
7
5
|
applyTo(value: any): any;
|
|
8
6
|
mergeWith(previous: Op): Op | void;
|
|
@@ -33,9 +31,9 @@ export declare class IncrementOp extends Op {
|
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
export declare class AddOp extends Op {
|
|
36
|
-
_value:
|
|
37
|
-
constructor(value: any |
|
|
38
|
-
applyTo(value: any):
|
|
34
|
+
_value: any[];
|
|
35
|
+
constructor(value: any | any[]);
|
|
36
|
+
applyTo(value: any): any[];
|
|
39
37
|
mergeWith(previous: Op): Op;
|
|
40
38
|
toJSON(): {
|
|
41
39
|
__op: string;
|
|
@@ -43,9 +41,9 @@ export declare class AddOp extends Op {
|
|
|
43
41
|
};
|
|
44
42
|
}
|
|
45
43
|
export declare class AddUniqueOp extends Op {
|
|
46
|
-
_value:
|
|
47
|
-
constructor(value: any |
|
|
48
|
-
applyTo(value: any |
|
|
44
|
+
_value: any[];
|
|
45
|
+
constructor(value: any | any[]);
|
|
46
|
+
applyTo(value: any | any[]): any[];
|
|
49
47
|
mergeWith(previous: Op): Op;
|
|
50
48
|
toJSON(): {
|
|
51
49
|
__op: string;
|
|
@@ -53,9 +51,9 @@ export declare class AddUniqueOp extends Op {
|
|
|
53
51
|
};
|
|
54
52
|
}
|
|
55
53
|
export declare class RemoveOp extends Op {
|
|
56
|
-
_value:
|
|
57
|
-
constructor(value: any |
|
|
58
|
-
applyTo(value: any |
|
|
54
|
+
_value: any[];
|
|
55
|
+
constructor(value: any | any[]);
|
|
56
|
+
applyTo(value: any | any[]): any[];
|
|
59
57
|
mergeWith(previous: Op): Op;
|
|
60
58
|
toJSON(): {
|
|
61
59
|
__op: string;
|
|
@@ -64,9 +62,9 @@ export declare class RemoveOp extends Op {
|
|
|
64
62
|
}
|
|
65
63
|
export declare class RelationOp extends Op {
|
|
66
64
|
_targetClassName: string | null;
|
|
67
|
-
relationsToAdd:
|
|
68
|
-
relationsToRemove:
|
|
69
|
-
constructor(adds:
|
|
65
|
+
relationsToAdd: string[];
|
|
66
|
+
relationsToRemove: string[];
|
|
67
|
+
constructor(adds: (ParseObject | string)[], removes: (ParseObject | string)[]);
|
|
70
68
|
_extractId(obj: string | ParseObject): string;
|
|
71
69
|
applyTo(value: any, parent?: ParseObject, key?: string): ParseRelation;
|
|
72
70
|
mergeWith(previous: Op): Op;
|
package/types/ParsePolygon.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare class ParsePolygon {
|
|
|
25
25
|
/**
|
|
26
26
|
* @param {(Coordinates | Parse.GeoPoint[])} coordinates An Array of coordinate pairs
|
|
27
27
|
*/
|
|
28
|
-
constructor(coordinates: Coordinates |
|
|
28
|
+
constructor(coordinates: Coordinates | ParseGeoPoint[]);
|
|
29
29
|
/**
|
|
30
30
|
* Coordinates value for this Polygon.
|
|
31
31
|
* Throws an exception if not valid type.
|
|
@@ -34,7 +34,7 @@ declare class ParsePolygon {
|
|
|
34
34
|
* @returns {Coordinates}
|
|
35
35
|
*/
|
|
36
36
|
get coordinates(): Coordinates;
|
|
37
|
-
set coordinates(coords: Coordinates |
|
|
37
|
+
set coordinates(coords: Coordinates | ParseGeoPoint[]);
|
|
38
38
|
/**
|
|
39
39
|
* Returns a JSON representation of the Polygon, suitable for Parse.
|
|
40
40
|
*
|
|
@@ -64,6 +64,6 @@ declare class ParsePolygon {
|
|
|
64
64
|
* @throws {TypeError}
|
|
65
65
|
* @returns {number[][]} Array of coordinates if validated.
|
|
66
66
|
*/
|
|
67
|
-
static _validate(coords: Coordinates |
|
|
67
|
+
static _validate(coords: Coordinates | ParseGeoPoint[]): Coordinates;
|
|
68
68
|
}
|
|
69
69
|
export default ParsePolygon;
|
package/types/ParseQuery.d.ts
CHANGED
|
@@ -8,28 +8,22 @@ type BatchOptions = FullOptions & {
|
|
|
8
8
|
useMasterKey?: boolean;
|
|
9
9
|
useMaintenanceKey?: boolean;
|
|
10
10
|
sessionToken?: string;
|
|
11
|
-
context?:
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
11
|
+
context?: Record<string, any>;
|
|
14
12
|
json?: boolean;
|
|
15
13
|
};
|
|
16
|
-
export type WhereClause =
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
type QueryOptions = {
|
|
14
|
+
export type WhereClause = Record<string, any>;
|
|
15
|
+
interface QueryOptions {
|
|
20
16
|
useMasterKey?: boolean;
|
|
21
17
|
sessionToken?: string;
|
|
22
|
-
context?:
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
};
|
|
18
|
+
context?: Record<string, any>;
|
|
25
19
|
json?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
20
|
+
}
|
|
21
|
+
interface FullTextQueryOptions {
|
|
28
22
|
language?: string;
|
|
29
23
|
caseSensitive?: boolean;
|
|
30
24
|
diacriticSensitive?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
25
|
+
}
|
|
26
|
+
export interface QueryJSON {
|
|
33
27
|
where: WhereClause;
|
|
34
28
|
watch?: string;
|
|
35
29
|
include?: string;
|
|
@@ -46,7 +40,7 @@ export type QueryJSON = {
|
|
|
46
40
|
includeReadPreference?: string;
|
|
47
41
|
subqueryReadPreference?: string;
|
|
48
42
|
comment?: string;
|
|
49
|
-
}
|
|
43
|
+
}
|
|
50
44
|
interface BaseAttributes {
|
|
51
45
|
createdAt: Date;
|
|
52
46
|
objectId: string;
|
|
@@ -101,22 +95,20 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
101
95
|
*/
|
|
102
96
|
className: string;
|
|
103
97
|
_where: any;
|
|
104
|
-
_watch:
|
|
105
|
-
_include:
|
|
106
|
-
_exclude:
|
|
107
|
-
_select:
|
|
98
|
+
_watch: string[];
|
|
99
|
+
_include: string[];
|
|
100
|
+
_exclude: string[];
|
|
101
|
+
_select: string[];
|
|
108
102
|
_limit: number;
|
|
109
103
|
_skip: number;
|
|
110
104
|
_count: boolean;
|
|
111
|
-
_order:
|
|
105
|
+
_order: string[];
|
|
112
106
|
_readPreference: string | null;
|
|
113
107
|
_includeReadPreference: string | null;
|
|
114
108
|
_subqueryReadPreference: string | null;
|
|
115
109
|
_queriesLocalDatastore: boolean;
|
|
116
110
|
_localDatastorePinName: any;
|
|
117
|
-
_extraOptions:
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
};
|
|
111
|
+
_extraOptions: Record<string, any>;
|
|
120
112
|
_hint: any;
|
|
121
113
|
_explain: boolean;
|
|
122
114
|
_xhrRequest: any;
|
|
@@ -131,21 +123,21 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
131
123
|
* @param {Array} queries
|
|
132
124
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
133
125
|
*/
|
|
134
|
-
_orQuery(queries:
|
|
126
|
+
_orQuery(queries: ParseQuery[]): this;
|
|
135
127
|
/**
|
|
136
128
|
* Adds constraint that all of the passed in queries match.
|
|
137
129
|
*
|
|
138
130
|
* @param {Array} queries
|
|
139
131
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
140
132
|
*/
|
|
141
|
-
_andQuery(queries:
|
|
133
|
+
_andQuery(queries: ParseQuery[]): this;
|
|
142
134
|
/**
|
|
143
135
|
* Adds constraint that none of the passed in queries match.
|
|
144
136
|
*
|
|
145
137
|
* @param {Array} queries
|
|
146
138
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
147
139
|
*/
|
|
148
|
-
_norQuery(queries:
|
|
140
|
+
_norQuery(queries: ParseQuery[]): this;
|
|
149
141
|
/**
|
|
150
142
|
* Helper for condition queries
|
|
151
143
|
*
|
|
@@ -273,24 +265,16 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
273
265
|
* Executes a distinct query and returns unique values
|
|
274
266
|
*
|
|
275
267
|
* @param {string} key A field to find distinct values
|
|
276
|
-
* @param {object} options
|
|
277
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
278
268
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
279
269
|
*/
|
|
280
|
-
distinct<K extends keyof T['attributes'], V = T['attributes'][K]>(key: K
|
|
281
|
-
sessionToken?: string;
|
|
282
|
-
}): Promise<V[]>;
|
|
270
|
+
distinct<K extends keyof T['attributes'], V = T['attributes'][K]>(key: K): Promise<V[]>;
|
|
283
271
|
/**
|
|
284
272
|
* Executes an aggregate query and returns aggregate results
|
|
285
273
|
*
|
|
286
274
|
* @param {(Array|object)} pipeline Array or Object of stages to process query
|
|
287
|
-
* @param {object} options
|
|
288
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
289
275
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
290
276
|
*/
|
|
291
|
-
aggregate(pipeline: any
|
|
292
|
-
sessionToken?: string;
|
|
293
|
-
}): Promise<Array<any>>;
|
|
277
|
+
aggregate(pipeline: any): Promise<any[]>;
|
|
294
278
|
/**
|
|
295
279
|
* Retrieves at most one Parse.Object that satisfies this query.
|
|
296
280
|
*
|
|
@@ -387,7 +371,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
387
371
|
* @returns {Promise} A promise that will be fulfilled once the
|
|
388
372
|
* iteration has completed.
|
|
389
373
|
*/
|
|
390
|
-
map(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions): Promise<
|
|
374
|
+
map(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions): Promise<any[]>;
|
|
391
375
|
/**
|
|
392
376
|
* Iterates over each result of a query, calling a callback for each one. If
|
|
393
377
|
* the callback returns a promise, the iteration will not continue until
|
|
@@ -411,7 +395,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
411
395
|
* @returns {Promise} A promise that will be fulfilled once the
|
|
412
396
|
* iteration has completed.
|
|
413
397
|
*/
|
|
414
|
-
reduce(callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions): Promise<
|
|
398
|
+
reduce(callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions): Promise<any[]>;
|
|
415
399
|
/**
|
|
416
400
|
* Iterates over each result of a query, calling a callback for each one. If
|
|
417
401
|
* the callback returns a promise, the iteration will not continue until
|
|
@@ -434,7 +418,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
434
418
|
* @returns {Promise} A promise that will be fulfilled once the
|
|
435
419
|
* iteration has completed.
|
|
436
420
|
*/
|
|
437
|
-
filter(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions): Promise<
|
|
421
|
+
filter(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions): Promise<ParseObject[]>;
|
|
438
422
|
/**
|
|
439
423
|
* Adds a constraint to the query that requires a particular key's value to
|
|
440
424
|
* be equal to the provided value.
|
|
@@ -443,7 +427,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
443
427
|
* @param value The value that the Parse.Object must contain.
|
|
444
428
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
445
429
|
*/
|
|
446
|
-
equalTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends
|
|
430
|
+
equalTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends (infer E)[] ? E : never)): this;
|
|
447
431
|
/**
|
|
448
432
|
* Adds a constraint to the query that requires a particular key's value to
|
|
449
433
|
* be not equal to the provided value.
|
|
@@ -452,7 +436,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
452
436
|
* @param value The value that must not be equalled.
|
|
453
437
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
454
438
|
*/
|
|
455
|
-
notEqualTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends
|
|
439
|
+
notEqualTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends (infer E)[] ? E : never)): this;
|
|
456
440
|
/**
|
|
457
441
|
* Adds a constraint to the query that requires a particular key's value to
|
|
458
442
|
* be less than the provided value.
|
|
@@ -497,7 +481,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
497
481
|
* @param {Array<*>} values The values that will match.
|
|
498
482
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
499
483
|
*/
|
|
500
|
-
containedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values:
|
|
484
|
+
containedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this;
|
|
501
485
|
/**
|
|
502
486
|
* Adds a constraint to the query that requires a particular key's value to
|
|
503
487
|
* not be contained in the provided list of values.
|
|
@@ -506,7 +490,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
506
490
|
* @param {Array<*>} values The values that will not match.
|
|
507
491
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
508
492
|
*/
|
|
509
|
-
notContainedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values:
|
|
493
|
+
notContainedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: T['attributes'][K][]): this;
|
|
510
494
|
/**
|
|
511
495
|
* Adds a constraint to the query that requires a particular key's value to
|
|
512
496
|
* be contained by the provided list of values. Get objects where all array elements match.
|
|
@@ -515,7 +499,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
515
499
|
* @param {Array} values The values that will match.
|
|
516
500
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
517
501
|
*/
|
|
518
|
-
containedBy<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values:
|
|
502
|
+
containedBy<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this;
|
|
519
503
|
/**
|
|
520
504
|
* Adds a constraint to the query that requires a particular key's value to
|
|
521
505
|
* contain each one of the provided list of values.
|
|
@@ -760,7 +744,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
760
744
|
* string of comma separated values, or an Array of keys, or multiple keys.
|
|
761
745
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
762
746
|
*/
|
|
763
|
-
ascending(...keys:
|
|
747
|
+
ascending(...keys: string[]): this;
|
|
764
748
|
/**
|
|
765
749
|
* Sorts the results in ascending order by the given key,
|
|
766
750
|
* but can also add secondary sort descriptors without overwriting _order.
|
|
@@ -769,7 +753,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
769
753
|
* string of comma separated values, or an Array of keys, or multiple keys.
|
|
770
754
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
771
755
|
*/
|
|
772
|
-
addAscending(...keys:
|
|
756
|
+
addAscending(...keys: string[]): this;
|
|
773
757
|
/**
|
|
774
758
|
* Sorts the results in descending order by the given key.
|
|
775
759
|
*
|
|
@@ -777,7 +761,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
777
761
|
* string of comma separated values, or an Array of keys, or multiple keys.
|
|
778
762
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
779
763
|
*/
|
|
780
|
-
descending(...keys:
|
|
764
|
+
descending(...keys: string[]): this;
|
|
781
765
|
/**
|
|
782
766
|
* Sorts the results in descending order by the given key,
|
|
783
767
|
* but can also add secondary sort descriptors without overwriting _order.
|
|
@@ -786,7 +770,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
786
770
|
* string of comma separated values, or an Array of keys, or multiple keys.
|
|
787
771
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
788
772
|
*/
|
|
789
|
-
addDescending(...keys:
|
|
773
|
+
addDescending(...keys: string[]): this;
|
|
790
774
|
/**
|
|
791
775
|
* Sets the number of results to skip before returning any results.
|
|
792
776
|
* This is useful for pagination.
|
|
@@ -824,7 +808,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
824
808
|
* @param {...string|Array<string>} keys The name(s) of the key(s) to include.
|
|
825
809
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
826
810
|
*/
|
|
827
|
-
include<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys:
|
|
811
|
+
include<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
|
|
828
812
|
/**
|
|
829
813
|
* Includes all nested Parse.Objects one level deep.
|
|
830
814
|
*
|
|
@@ -841,7 +825,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
841
825
|
* @param {...string|Array<string>} keys The name(s) of the key(s) to include.
|
|
842
826
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
843
827
|
*/
|
|
844
|
-
select<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys:
|
|
828
|
+
select<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
|
|
845
829
|
/**
|
|
846
830
|
* Restricts the fields of the returned Parse.Objects to all keys except the
|
|
847
831
|
* provided keys. Exclude takes precedence over select and include.
|
|
@@ -851,7 +835,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
851
835
|
* @param {...string|Array<string>} keys The name(s) of the key(s) to exclude.
|
|
852
836
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
853
837
|
*/
|
|
854
|
-
exclude<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys:
|
|
838
|
+
exclude<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
|
|
855
839
|
/**
|
|
856
840
|
* Restricts live query to trigger only for watched fields.
|
|
857
841
|
*
|
|
@@ -860,7 +844,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
860
844
|
* @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
|
|
861
845
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
862
846
|
*/
|
|
863
|
-
watch<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys:
|
|
847
|
+
watch<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
|
|
864
848
|
/**
|
|
865
849
|
* Changes the read preference that the backend will use when performing the query to the database.
|
|
866
850
|
*
|
|
@@ -890,7 +874,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
890
874
|
* @static
|
|
891
875
|
* @returns {Parse.Query} The query that is the OR of the passed in queries.
|
|
892
876
|
*/
|
|
893
|
-
static or(...queries:
|
|
877
|
+
static or(...queries: ParseQuery[]): ParseQuery;
|
|
894
878
|
/**
|
|
895
879
|
* Constructs a Parse.Query that is the AND of the passed in queries. For
|
|
896
880
|
* example:
|
|
@@ -903,7 +887,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
903
887
|
* @static
|
|
904
888
|
* @returns {Parse.Query} The query that is the AND of the passed in queries.
|
|
905
889
|
*/
|
|
906
|
-
static and(...queries:
|
|
890
|
+
static and(...queries: ParseQuery[]): ParseQuery;
|
|
907
891
|
/**
|
|
908
892
|
* Constructs a Parse.Query that is the NOR of the passed in queries. For
|
|
909
893
|
* example:
|
|
@@ -916,7 +900,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
916
900
|
* @static
|
|
917
901
|
* @returns {Parse.Query} The query that is the NOR of the passed in queries.
|
|
918
902
|
*/
|
|
919
|
-
static nor(...queries:
|
|
903
|
+
static nor(...queries: ParseQuery[]): ParseQuery;
|
|
920
904
|
/**
|
|
921
905
|
* Change the source of this query to the server.
|
|
922
906
|
*
|