parse 6.1.0-alpha.1 → 6.1.0-alpha.3

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 (213) hide show
  1. package/README.md +0 -8
  2. package/dist/parse.js +93 -105
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +93 -105
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/Cloud.js +1 -0
  7. package/lib/browser/CoreManager.js +2 -2
  8. package/lib/browser/CryptoController.js +0 -1
  9. package/lib/browser/EventEmitter.js +0 -1
  10. package/lib/browser/EventuallyQueue.js +6 -10
  11. package/lib/browser/IndexedDBStorageController.js +0 -1
  12. package/lib/browser/InstallationController.js +0 -1
  13. package/lib/browser/LiveQuerySubscription.js +4 -4
  14. package/lib/browser/LocalDatastore.js +0 -1
  15. package/lib/browser/LocalDatastoreController.default.js +0 -1
  16. package/lib/browser/LocalDatastoreController.js +0 -1
  17. package/lib/browser/LocalDatastoreController.react-native.js +0 -1
  18. package/lib/browser/OfflineQuery.js +0 -1
  19. package/lib/browser/Parse.js +12 -1
  20. package/lib/browser/ParseACL.js +1 -1
  21. package/lib/browser/ParseConfig.js +2 -4
  22. package/lib/browser/ParseInstallation.js +0 -1
  23. package/lib/browser/ParseLiveQuery.js +2 -2
  24. package/lib/browser/ParseObject.js +10 -10
  25. package/lib/browser/ParseQuery.js +26 -25
  26. package/lib/browser/ParseRole.js +1 -1
  27. package/lib/browser/ParseSchema.js +6 -6
  28. package/lib/browser/ParseUser.js +10 -12
  29. package/lib/browser/RESTController.js +7 -3
  30. package/lib/browser/Socket.weapp.js +0 -1
  31. package/lib/browser/Storage.js +0 -1
  32. package/lib/browser/StorageController.browser.js +0 -1
  33. package/lib/browser/StorageController.default.js +0 -1
  34. package/lib/browser/StorageController.js +0 -1
  35. package/lib/browser/StorageController.react-native.js +0 -1
  36. package/lib/browser/StorageController.weapp.js +0 -1
  37. package/lib/browser/TaskQueue.js +0 -1
  38. package/lib/browser/WebSocketController.js +0 -1
  39. package/lib/browser/Xhr.weapp.js +0 -1
  40. package/lib/browser/uuid.js +0 -1
  41. package/lib/node/Cloud.js +1 -0
  42. package/lib/node/CoreManager.js +2 -2
  43. package/lib/node/CryptoController.js +0 -1
  44. package/lib/node/EventEmitter.js +0 -1
  45. package/lib/node/EventuallyQueue.js +6 -7
  46. package/lib/node/IndexedDBStorageController.js +0 -1
  47. package/lib/node/InstallationController.js +0 -1
  48. package/lib/node/LiveQuerySubscription.js +4 -4
  49. package/lib/node/LocalDatastore.js +0 -1
  50. package/lib/node/LocalDatastoreController.default.js +0 -1
  51. package/lib/node/LocalDatastoreController.js +0 -1
  52. package/lib/node/LocalDatastoreController.react-native.js +0 -1
  53. package/lib/node/OfflineQuery.js +0 -1
  54. package/lib/node/Parse.js +12 -1
  55. package/lib/node/ParseACL.js +1 -1
  56. package/lib/node/ParseConfig.js +2 -2
  57. package/lib/node/ParseInstallation.js +0 -1
  58. package/lib/node/ParseLiveQuery.js +2 -2
  59. package/lib/node/ParseObject.js +10 -7
  60. package/lib/node/ParseQuery.js +7 -7
  61. package/lib/node/ParseRole.js +1 -1
  62. package/lib/node/ParseSchema.js +6 -4
  63. package/lib/node/ParseUser.js +10 -10
  64. package/lib/node/RESTController.js +3 -1
  65. package/lib/node/Socket.weapp.js +0 -1
  66. package/lib/node/Storage.js +0 -1
  67. package/lib/node/StorageController.browser.js +0 -1
  68. package/lib/node/StorageController.default.js +0 -1
  69. package/lib/node/StorageController.js +0 -1
  70. package/lib/node/StorageController.react-native.js +0 -1
  71. package/lib/node/StorageController.weapp.js +0 -1
  72. package/lib/node/TaskQueue.js +0 -1
  73. package/lib/node/WebSocketController.js +0 -1
  74. package/lib/node/Xhr.weapp.js +0 -1
  75. package/lib/node/uuid.js +0 -1
  76. package/lib/react-native/CoreManager.js +2 -2
  77. package/lib/react-native/CryptoController.js +0 -1
  78. package/lib/react-native/EventEmitter.js +0 -1
  79. package/lib/react-native/EventuallyQueue.js +5 -9
  80. package/lib/react-native/IndexedDBStorageController.js +0 -1
  81. package/lib/react-native/InstallationController.js +0 -1
  82. package/lib/react-native/LiveQuerySubscription.js +7 -7
  83. package/lib/react-native/LocalDatastore.js +0 -1
  84. package/lib/react-native/LocalDatastoreController.default.js +0 -1
  85. package/lib/react-native/LocalDatastoreController.js +0 -1
  86. package/lib/react-native/LocalDatastoreController.react-native.js +0 -1
  87. package/lib/react-native/OfflineQuery.js +0 -1
  88. package/lib/react-native/Parse.js +8 -1
  89. package/lib/react-native/ParseConfig.js +2 -4
  90. package/lib/react-native/ParseInstallation.js +0 -1
  91. package/lib/react-native/ParseLiveQuery.js +2 -2
  92. package/lib/react-native/ParseObject.js +16 -18
  93. package/lib/react-native/ParseQuery.js +5 -6
  94. package/lib/react-native/ParseSchema.js +5 -6
  95. package/lib/react-native/ParseUser.js +3 -5
  96. package/lib/react-native/RESTController.js +3 -1
  97. package/lib/react-native/Socket.weapp.js +0 -1
  98. package/lib/react-native/Storage.js +0 -1
  99. package/lib/react-native/StorageController.browser.js +0 -1
  100. package/lib/react-native/StorageController.default.js +0 -1
  101. package/lib/react-native/StorageController.js +0 -1
  102. package/lib/react-native/StorageController.react-native.js +0 -1
  103. package/lib/react-native/StorageController.weapp.js +0 -1
  104. package/lib/react-native/TaskQueue.js +0 -1
  105. package/lib/react-native/WebSocketController.js +0 -1
  106. package/lib/react-native/Xhr.weapp.js +0 -1
  107. package/lib/react-native/uuid.js +0 -1
  108. package/lib/weapp/Cloud.js +1 -0
  109. package/lib/weapp/CoreManager.js +2 -2
  110. package/lib/weapp/CryptoController.js +0 -1
  111. package/lib/weapp/EventEmitter.js +0 -1
  112. package/lib/weapp/EventuallyQueue.js +6 -10
  113. package/lib/weapp/IndexedDBStorageController.js +0 -1
  114. package/lib/weapp/InstallationController.js +0 -1
  115. package/lib/weapp/LiveQuerySubscription.js +4 -4
  116. package/lib/weapp/LocalDatastore.js +0 -1
  117. package/lib/weapp/LocalDatastoreController.default.js +0 -1
  118. package/lib/weapp/LocalDatastoreController.js +0 -1
  119. package/lib/weapp/LocalDatastoreController.react-native.js +0 -1
  120. package/lib/weapp/OfflineQuery.js +0 -1
  121. package/lib/weapp/Parse.js +12 -1
  122. package/lib/weapp/ParseACL.js +1 -1
  123. package/lib/weapp/ParseConfig.js +2 -4
  124. package/lib/weapp/ParseInstallation.js +0 -1
  125. package/lib/weapp/ParseLiveQuery.js +2 -2
  126. package/lib/weapp/ParseObject.js +10 -10
  127. package/lib/weapp/ParseQuery.js +26 -25
  128. package/lib/weapp/ParseRole.js +1 -1
  129. package/lib/weapp/ParseSchema.js +6 -6
  130. package/lib/weapp/ParseUser.js +10 -12
  131. package/lib/weapp/RESTController.js +7 -3
  132. package/lib/weapp/Socket.weapp.js +0 -1
  133. package/lib/weapp/Storage.js +0 -1
  134. package/lib/weapp/StorageController.browser.js +0 -1
  135. package/lib/weapp/StorageController.default.js +0 -1
  136. package/lib/weapp/StorageController.js +0 -1
  137. package/lib/weapp/StorageController.react-native.js +0 -1
  138. package/lib/weapp/StorageController.weapp.js +0 -1
  139. package/lib/weapp/TaskQueue.js +0 -1
  140. package/lib/weapp/WebSocketController.js +0 -1
  141. package/lib/weapp/Xhr.weapp.js +0 -1
  142. package/lib/weapp/uuid.js +0 -1
  143. package/package.json +15 -12
  144. package/types/Analytics.d.ts +42 -0
  145. package/types/AnonymousUtils.d.ts +84 -0
  146. package/types/Cloud.d.ts +65 -0
  147. package/types/CloudCode.d.ts +307 -0
  148. package/types/CoreManager.d.ts +325 -0
  149. package/types/CryptoController.d.ts +5 -0
  150. package/types/EventEmitter.d.ts +5 -0
  151. package/types/EventuallyQueue.d.ts +168 -0
  152. package/types/FacebookUtils.d.ts +107 -0
  153. package/types/IndexedDBStorageController.d.ts +2 -0
  154. package/types/InstallationController.d.ts +10 -0
  155. package/types/LiveQueryClient.d.ts +128 -0
  156. package/types/LiveQuerySubscription.d.ts +103 -0
  157. package/types/LocalDatastore.d.ts +56 -0
  158. package/types/LocalDatastoreController.d.ts +2 -0
  159. package/types/LocalDatastoreController.default.d.ts +9 -0
  160. package/types/LocalDatastoreController.react-native.d.ts +9 -0
  161. package/types/LocalDatastoreUtils.d.ts +5 -0
  162. package/types/ObjectStateMutations.d.ts +28 -0
  163. package/types/OfflineQuery.d.ts +20 -0
  164. package/types/Parse.d.ts +633 -0
  165. package/types/ParseACL.d.ts +141 -0
  166. package/types/ParseCLP.d.ts +293 -0
  167. package/types/ParseConfig.d.ts +77 -0
  168. package/types/ParseError.d.ts +476 -0
  169. package/types/ParseFile.d.ts +192 -0
  170. package/types/ParseGeoPoint.d.ts +104 -0
  171. package/types/ParseHooks.d.ts +27 -0
  172. package/types/ParseInstallation.d.ts +179 -0
  173. package/types/ParseLiveQuery.d.ts +48 -0
  174. package/types/ParseObject.d.ts +1072 -0
  175. package/types/ParseOp.d.ts +78 -0
  176. package/types/ParsePolygon.d.ts +69 -0
  177. package/types/ParseQuery.d.ts +961 -0
  178. package/types/ParseRelation.d.ts +56 -0
  179. package/types/ParseRole.d.ts +79 -0
  180. package/types/ParseSchema.d.ts +286 -0
  181. package/types/ParseSession.d.ts +45 -0
  182. package/types/ParseUser.d.ts +517 -0
  183. package/types/Push.d.ts +62 -0
  184. package/types/RESTController.d.ts +35 -0
  185. package/types/SingleInstanceStateController.d.ts +24 -0
  186. package/types/Socket.weapp.d.ts +10 -0
  187. package/types/Storage.d.ts +14 -0
  188. package/types/StorageController.browser.d.ts +9 -0
  189. package/types/StorageController.d.ts +2 -0
  190. package/types/StorageController.default.d.ts +9 -0
  191. package/types/StorageController.react-native.d.ts +11 -0
  192. package/types/StorageController.weapp.d.ts +9 -0
  193. package/types/TaskQueue.d.ts +11 -0
  194. package/types/UniqueInstanceStateController.d.ts +20 -0
  195. package/types/WebSocketController.d.ts +2 -0
  196. package/types/Xhr.weapp.d.ts +29 -0
  197. package/types/arrayContainsObject.d.ts +2 -0
  198. package/types/canBeSerialized.d.ts +2 -0
  199. package/types/decode.d.ts +1 -0
  200. package/types/encode.d.ts +1 -0
  201. package/types/equals.d.ts +1 -0
  202. package/types/escape.d.ts +1 -0
  203. package/types/index.d.ts +66 -0
  204. package/types/isRevocableSession.d.ts +1 -0
  205. package/types/node.d.ts +3 -0
  206. package/types/parseDate.d.ts +1 -0
  207. package/types/promiseUtils.d.ts +9 -0
  208. package/types/react-native.d.ts +3 -0
  209. package/types/tests.ts +2256 -0
  210. package/types/tsconfig.json +25 -0
  211. package/types/unique.d.ts +1 -0
  212. package/types/unsavedChildren.d.ts +11 -0
  213. package/types/uuid.d.ts +2 -0
@@ -0,0 +1,56 @@
1
+ import type ParseObject from './ParseObject';
2
+ import type ParseQuery from './ParseQuery';
3
+ /**
4
+ * Creates a new Relation for the given parent object and key. This
5
+ * constructor should rarely be used directly, but rather created by
6
+ * Parse.Object.relation.
7
+ *
8
+ * <p>
9
+ * A class that is used to access all of the children of a many-to-many
10
+ * relationship. Each instance of Parse.Relation is associated with a
11
+ * particular parent object and key.
12
+ * </p>
13
+ *
14
+ * @alias Parse.Relation
15
+ */
16
+ declare class ParseRelation<S extends ParseObject = ParseObject, T extends ParseObject = ParseObject> {
17
+ parent?: S;
18
+ key?: string;
19
+ targetClassName?: string | null;
20
+ /**
21
+ * @param {Parse.Object} parent The parent of this relation.
22
+ * @param {string} key The key for this relation on the parent.
23
+ */
24
+ constructor(parent?: S, key?: string);
25
+ _ensureParentAndKey(parent: S, key: string): void;
26
+ /**
27
+ * Adds a Parse.Object or an array of Parse.Objects to the relation.
28
+ *
29
+ * @param {(Parse.Object|Array)} objects The item or items to add.
30
+ * @returns {Parse.Object} The parent of the relation.
31
+ */
32
+ add(objects: T | T[]): S;
33
+ /**
34
+ * Removes a Parse.Object or an array of Parse.Objects from this relation.
35
+ *
36
+ * @param {(Parse.Object|Array)} objects The item or items to remove.
37
+ */
38
+ remove(objects: T | T[]): void;
39
+ /**
40
+ * Returns a JSON version of the object suitable for saving to disk.
41
+ *
42
+ * @returns {object} JSON representation of Relation
43
+ */
44
+ toJSON(): {
45
+ __type: 'Relation';
46
+ className: string | null;
47
+ };
48
+ /**
49
+ * Returns a Parse.Query that is limited to objects in this
50
+ * relation.
51
+ *
52
+ * @returns {Parse.Query} Relation Query
53
+ */
54
+ query(): ParseQuery<T>;
55
+ }
56
+ export default ParseRelation;
@@ -0,0 +1,79 @@
1
+ import ParseACL from './ParseACL';
2
+ import ParseError from './ParseError';
3
+ import ParseObject, { Attributes, SetOptions } from './ParseObject';
4
+ import type { AttributeMap } from './ObjectStateMutations';
5
+ import type ParseRelation from './ParseRelation';
6
+ import type ParseUser from './ParseUser';
7
+ /**
8
+ * Represents a Role on the Parse server. Roles represent groupings of
9
+ * Users for the purposes of granting permissions (e.g. specifying an ACL
10
+ * for an Object). Roles are specified by their sets of child users and
11
+ * child roles, all of which are granted any permissions that the parent
12
+ * role has.
13
+ *
14
+ * <p>Roles must have a name (which cannot be changed after creation of the
15
+ * role), and must specify an ACL.</p>
16
+ *
17
+ * @alias Parse.Role
18
+ * @augments Parse.Object
19
+ */
20
+ declare class ParseRole<T extends Attributes = Attributes> extends ParseObject<T> {
21
+ /**
22
+ * @param {string} name The name of the Role to create.
23
+ * @param {Parse.ACL} acl The ACL for this role. Roles must have an ACL.
24
+ * A Parse.Role is a local representation of a role persisted to the Parse
25
+ * cloud.
26
+ */
27
+ constructor(name: string, acl: ParseACL);
28
+ /**
29
+ * Gets the name of the role. You can alternatively call role.get("name")
30
+ *
31
+ * @returns {string} the name of the role.
32
+ */
33
+ getName(): string | null;
34
+ /**
35
+ * Sets the name for a role. This value must be set before the role has
36
+ * been saved to the server, and cannot be set once the role has been
37
+ * saved.
38
+ *
39
+ * <p>
40
+ * A role's name can only contain alphanumeric characters, _, -, and
41
+ * spaces.
42
+ * </p>
43
+ *
44
+ * <p>This is equivalent to calling role.set("name", name)</p>
45
+ *
46
+ * @param {string} name The name of the role.
47
+ * @param {object} options Standard options object with success and error
48
+ * callbacks.
49
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
50
+ */
51
+ setName(name: string, options?: SetOptions): this;
52
+ /**
53
+ * Gets the Parse.Relation for the Parse.Users that are direct
54
+ * children of this role. These users are granted any privileges that this
55
+ * role has been granted (e.g. read or write access through ACLs). You can
56
+ * add or remove users from the role through this relation.
57
+ *
58
+ * <p>This is equivalent to calling role.relation("users")</p>
59
+ *
60
+ * @returns {Parse.Relation} the relation for the users belonging to this
61
+ * role.
62
+ */
63
+ getUsers<U extends ParseUser>(): ParseRelation<ParseRole, U>;
64
+ /**
65
+ * Gets the Parse.Relation for the Parse.Roles that are direct
66
+ * children of this role. These roles' users are granted any privileges that
67
+ * this role has been granted (e.g. read or write access through ACLs). You
68
+ * can add or remove child roles from this role through this relation.
69
+ *
70
+ * <p>This is equivalent to calling role.relation("roles")</p>
71
+ *
72
+ * @returns {Parse.Relation} the relation for the roles belonging to this
73
+ * role.
74
+ */
75
+ getRoles(): ParseRelation<ParseRole, ParseRole>;
76
+ _validateName(newName: any): void;
77
+ validate(attrs: AttributeMap, options?: any): ParseError | boolean;
78
+ }
79
+ export default ParseRole;
@@ -0,0 +1,286 @@
1
+ import ParseObject from './ParseObject';
2
+ import ParseCLP from './ParseCLP';
3
+ import type ParseGeoPoint from './ParseGeoPoint';
4
+ import type ParseFile from './ParseFile';
5
+ import type ParsePolygon from './ParsePolygon';
6
+ import type ParseRelation from './ParseRelation';
7
+ import type { PermissionsMap } from './ParseCLP';
8
+ import type { Pointer } from './ParseObject';
9
+ type Bytes = string;
10
+ type TYPE = 'String' | 'Number' | 'Bytes' | 'Boolean' | 'Date' | 'File' | 'GeoPoint' | 'Polygon' | 'Array' | 'Object' | 'Pointer' | 'Relation';
11
+ type AttrType<T extends ParseObject, V> = Extract<{
12
+ [K in keyof T['attributes']]: T['attributes'][K] extends V ? K : never;
13
+ }[keyof T['attributes']], string>;
14
+ interface FieldOptions<T extends string | number | boolean | Bytes | Date | ParseFile | ParseGeoPoint | ParsePolygon | any[] | object | Pointer | ParseRelation = any> {
15
+ required?: boolean | undefined;
16
+ defaultValue?: T | undefined;
17
+ targetClass?: string | undefined;
18
+ }
19
+ interface Index {
20
+ [fieldName: string]: number | string;
21
+ }
22
+ interface CLPField {
23
+ '*'?: boolean | undefined;
24
+ requiresAuthentication?: boolean | undefined;
25
+ [userIdOrRoleName: string]: boolean | undefined;
26
+ }
27
+ interface CLP {
28
+ find?: CLPField | undefined;
29
+ get?: CLPField | undefined;
30
+ count?: CLPField | undefined;
31
+ create?: CLPField | undefined;
32
+ update?: CLPField | undefined;
33
+ delete?: CLPField | undefined;
34
+ addField?: CLPField | undefined;
35
+ readUserFields?: string[] | undefined;
36
+ writeUserFields?: string[] | undefined;
37
+ protectedFields?: {
38
+ [userIdOrRoleName: string]: string[];
39
+ };
40
+ }
41
+ interface RestSchema {
42
+ className: string;
43
+ fields: {
44
+ [key: string]: {
45
+ type: string;
46
+ targetClass?: string;
47
+ required?: boolean;
48
+ defaultValue?: string;
49
+ };
50
+ };
51
+ classLevelPermissions: CLP;
52
+ indexes?: {
53
+ [key: string]: {
54
+ [key: string]: any;
55
+ };
56
+ };
57
+ }
58
+ /**
59
+ * A Parse.Schema object is for handling schema data from Parse.
60
+ * <p>All the schemas methods require MasterKey.
61
+ *
62
+ * When adding fields, you may set required and default values. (Requires Parse Server 3.7.0+)
63
+ *
64
+ * <pre>
65
+ * const options = { required: true, defaultValue: 'hello world' };
66
+ * const schema = new Parse.Schema('MyClass');
67
+ * schema.addString('field', options);
68
+ * schema.addIndex('index_name', { 'field': 1 });
69
+ * schema.save();
70
+ * </pre>
71
+ * </p>
72
+ *
73
+ * @alias Parse.Schema
74
+ */
75
+ declare class ParseSchema<T extends ParseObject = any> {
76
+ className: string;
77
+ _fields: {
78
+ [key: string]: any;
79
+ };
80
+ _indexes: {
81
+ [key: string]: any;
82
+ };
83
+ _clp: {
84
+ [key: string]: any;
85
+ };
86
+ /**
87
+ * @param {string} className Parse Class string.
88
+ */
89
+ constructor(className: string);
90
+ /**
91
+ * Static method to get all schemas
92
+ *
93
+ * @returns {Promise} A promise that is resolved with the result when
94
+ * the query completes.
95
+ */
96
+ static all(): Promise<RestSchema[]>;
97
+ /**
98
+ * Get the Schema from Parse
99
+ *
100
+ * @returns {Promise} A promise that is resolved with the result when
101
+ * the query completes.
102
+ */
103
+ get(): Promise<RestSchema>;
104
+ /**
105
+ * Create a new Schema on Parse
106
+ *
107
+ * @returns {Promise} A promise that is resolved with the result when
108
+ * the query completes.
109
+ */
110
+ save(): Promise<ParseSchema>;
111
+ /**
112
+ * Update a Schema on Parse
113
+ *
114
+ * @returns {Promise} A promise that is resolved with the result when
115
+ * the query completes.
116
+ */
117
+ update(): Promise<ParseSchema>;
118
+ /**
119
+ * Removing a Schema from Parse
120
+ * Can only be used on Schema without objects
121
+ *
122
+ * @returns {Promise} A promise that is resolved with the result when
123
+ * the query completes.
124
+ */
125
+ delete(): Promise<void>;
126
+ /**
127
+ * Removes all objects from a Schema (class) in Parse.
128
+ * EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed
129
+ *
130
+ * @returns {Promise} A promise that is resolved with the result when
131
+ * the query completes.
132
+ */
133
+ purge(): Promise<any>;
134
+ /**
135
+ * Assert if ClassName has been filled
136
+ *
137
+ * @private
138
+ */
139
+ assertClassName(): void;
140
+ /**
141
+ * Sets Class Level Permissions when creating / updating a Schema.
142
+ * EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed
143
+ *
144
+ * @param {object | Parse.CLP} clp Class Level Permissions
145
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
146
+ */
147
+ setCLP(clp: PermissionsMap | ParseCLP): this;
148
+ /**
149
+ * Adding a Field to Create / Update a Schema
150
+ *
151
+ * @param {string} name Name of the field that will be created on Parse
152
+ * @param {string} type Can be a (String|Number|Boolean|Date|Parse.File|Parse.GeoPoint|Array|Object|Pointer|Parse.Relation)
153
+ * @param {object} options
154
+ * Valid options are:<ul>
155
+ * <li>required: If field is not set, save operation fails (Requires Parse Server 3.7.0+)
156
+ * <li>defaultValue: If field is not set, a default value is selected (Requires Parse Server 3.7.0+)
157
+ * <li>targetClass: Required if type is Pointer or Parse.Relation
158
+ * </ul>
159
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
160
+ */
161
+ addField<T extends TYPE = any>(name: string, type?: T, options?: FieldOptions): this;
162
+ /**
163
+ * Adding an Index to Create / Update a Schema
164
+ *
165
+ * @param {string} name Name of the index
166
+ * @param {object} index { field: value }
167
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
168
+ *
169
+ * <pre>
170
+ * schema.addIndex('index_name', { 'field': 1 });
171
+ * </pre>
172
+ */
173
+ addIndex(name: string, index: Index): this;
174
+ /**
175
+ * Adding String Field
176
+ *
177
+ * @param {string} name Name of the field that will be created on Parse
178
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
179
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
180
+ */
181
+ addString(name: AttrType<T, string>, options?: FieldOptions<string>): this;
182
+ /**
183
+ * Adding Number Field
184
+ *
185
+ * @param {string} name Name of the field that will be created on Parse
186
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
187
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
188
+ */
189
+ addNumber(name: AttrType<T, number>, options?: FieldOptions<number>): this;
190
+ /**
191
+ * Adding Boolean Field
192
+ *
193
+ * @param {string} name Name of the field that will be created on Parse
194
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
195
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
196
+ */
197
+ addBoolean(name: AttrType<T, boolean>, options?: FieldOptions<boolean>): this;
198
+ /**
199
+ * Adding Bytes Field
200
+ *
201
+ * @param {string} name Name of the field that will be created on Parse
202
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
203
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
204
+ */
205
+ addBytes(name: AttrType<T, Bytes>, options?: FieldOptions<Bytes>): this;
206
+ /**
207
+ * Adding Date Field
208
+ *
209
+ * @param {string} name Name of the field that will be created on Parse
210
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
211
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
212
+ */
213
+ addDate(name: AttrType<T, Date>, options?: FieldOptions<Date>): this;
214
+ /**
215
+ * Adding File Field
216
+ *
217
+ * @param {string} name Name of the field that will be created on Parse
218
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
219
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
220
+ */
221
+ addFile(name: AttrType<T, ParseFile>, options?: FieldOptions<ParseFile>): this;
222
+ /**
223
+ * Adding GeoPoint Field
224
+ *
225
+ * @param {string} name Name of the field that will be created on Parse
226
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
227
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
228
+ */
229
+ addGeoPoint(name: AttrType<T, ParseGeoPoint>, options?: FieldOptions<ParseGeoPoint>): this;
230
+ /**
231
+ * Adding Polygon Field
232
+ *
233
+ * @param {string} name Name of the field that will be created on Parse
234
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
235
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
236
+ */
237
+ addPolygon(name: AttrType<T, ParsePolygon>, options?: FieldOptions<ParsePolygon>): this;
238
+ /**
239
+ * Adding Array Field
240
+ *
241
+ * @param {string} name Name of the field that will be created on Parse
242
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
243
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
244
+ */
245
+ addArray(name: AttrType<T, any[]>, options?: FieldOptions<any[]>): this;
246
+ /**
247
+ * Adding Object Field
248
+ *
249
+ * @param {string} name Name of the field that will be created on Parse
250
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
251
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
252
+ */
253
+ addObject(name: AttrType<T, object>, options?: FieldOptions<object>): this;
254
+ /**
255
+ * Adding Pointer Field
256
+ *
257
+ * @param {string} name Name of the field that will be created on Parse
258
+ * @param {string} targetClass Name of the target Pointer Class
259
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
260
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
261
+ */
262
+ addPointer(name: AttrType<T, ParseObject | Pointer>, targetClass: string, options?: FieldOptions<Pointer>): this;
263
+ /**
264
+ * Adding Relation Field
265
+ *
266
+ * @param {string} name Name of the field that will be created on Parse
267
+ * @param {string} targetClass Name of the target Pointer Class
268
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
269
+ */
270
+ addRelation(name: AttrType<T, ParseRelation>, targetClass: string): this;
271
+ /**
272
+ * Deleting a Field to Update on a Schema
273
+ *
274
+ * @param {string} name Name of the field
275
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
276
+ */
277
+ deleteField(name: string): this;
278
+ /**
279
+ * Deleting an Index to Update on a Schema
280
+ *
281
+ * @param {string} name Name of the field
282
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
283
+ */
284
+ deleteIndex(name: string): this;
285
+ }
286
+ export default ParseSchema;
@@ -0,0 +1,45 @@
1
+ import ParseObject, { Attributes } from './ParseObject';
2
+ import type { FullOptions } from './RESTController';
3
+ /**
4
+ * <p>A Parse.Session object is a local representation of a revocable session.
5
+ * This class is a subclass of a Parse.Object, and retains the same
6
+ * functionality of a Parse.Object.</p>
7
+ *
8
+ * @alias Parse.Session
9
+ * @augments Parse.Object
10
+ */
11
+ declare class ParseSession<T extends Attributes = Attributes> extends ParseObject<T> {
12
+ /**
13
+ * @param {object} attributes The initial set of data to store in the user.
14
+ */
15
+ constructor(attributes?: T);
16
+ /**
17
+ * Returns the session token string.
18
+ *
19
+ * @returns {string}
20
+ */
21
+ getSessionToken(): string;
22
+ static readOnlyAttributes(): string[];
23
+ /**
24
+ * Retrieves the Session object for the currently logged in session.
25
+ *
26
+ * @param {object} options useMasterKey
27
+ * @static
28
+ * @returns {Promise} A promise that is resolved with the Parse.Session
29
+ * object after it has been fetched. If there is no current user, the
30
+ * promise will be rejected.
31
+ */
32
+ static current<T extends ParseSession>(options?: FullOptions): Promise<T>;
33
+ /**
34
+ * Determines whether the current session token is revocable.
35
+ * This method is useful for migrating Express.js or Node.js web apps to
36
+ * use revocable sessions. If you are migrating an app that uses the Parse
37
+ * SDK in the browser only, please use Parse.User.enableRevocableSession()
38
+ * instead, so that sessions can be automatically upgraded.
39
+ *
40
+ * @static
41
+ * @returns {boolean}
42
+ */
43
+ static isCurrentSessionRevocable(): boolean;
44
+ }
45
+ export default ParseSession;