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,289 @@
1
+ import ParseRole from './ParseRole';
2
+ import ParseUser from './ParseUser';
3
+ type Entity = ParseUser | ParseRole | string;
4
+ type UsersMap = Record<string, boolean | any>;
5
+ export type PermissionsMap = {
6
+ writeUserFields?: string[];
7
+ readUserFields?: string[];
8
+ } & Record<string, UsersMap>;
9
+ /**
10
+ * Creates a new CLP.
11
+ * If no argument is given, the CLP has no permissions for anyone.
12
+ * If the argument is a Parse.User or Parse.Role, the CLP will have read and write
13
+ * permission for only that user or role.
14
+ * If the argument is any other JSON object, that object will be interpretted
15
+ * as a serialized CLP created with toJSON().
16
+ *
17
+ * <p>A CLP, or Class Level Permissions can be added to any
18
+ * <code>Parse.Schema</code> to restrict access to only a subset of users
19
+ * of your application.</p>
20
+ *
21
+ * <p>
22
+ * For get/count/find/create/update/delete/addField using the following functions:
23
+ *
24
+ * Entity is type Parse.User or Parse.Role or string
25
+ * Role is type Parse.Role or Name of Parse.Role
26
+ *
27
+ * getGetRequiresAuthentication()
28
+ * setGetRequiresAuthentication(allowed: boolean)
29
+ * getGetPointerFields()
30
+ * setGetPointerFields(pointerFields: string[])
31
+ * getGetAccess(entity: Entity)
32
+ * setGetAccess(entity: Entity, allowed: boolean)
33
+ * getPublicGetAccess()
34
+ * setPublicGetAccess(allowed: boolean)
35
+ * getRoleGetAccess(role: Role)
36
+ * setRoleGetAccess(role: Role, allowed: boolean)
37
+ * getFindRequiresAuthentication()
38
+ * setFindRequiresAuthentication(allowed: boolean)
39
+ * getFindPointerFields()
40
+ * setFindPointerFields(pointerFields: string[])
41
+ * getFindAccess(entity: Entity)
42
+ * setFindAccess(entity: Entity, allowed: boolean)
43
+ * getPublicFindAccess()
44
+ * setPublicFindAccess(allowed: boolean)
45
+ * getRoleFindAccess(role: Role)
46
+ * setRoleFindAccess(role: Role, allowed: boolean)
47
+ * getCountRequiresAuthentication()
48
+ * setCountRequiresAuthentication(allowed: boolean)
49
+ * getCountPointerFields()
50
+ * setCountPointerFields(pointerFields: string[])
51
+ * getCountAccess(entity: Entity)
52
+ * setCountAccess(entity: Entity, allowed: boolean)
53
+ * getPublicCountAccess()
54
+ * setPublicCountAccess(allowed: boolean)
55
+ * getRoleCountAccess(role: Role)
56
+ * setRoleCountAccess(role: Role, allowed: boolean)
57
+ * getCreateRequiresAuthentication()
58
+ * setCreateRequiresAuthentication(allowed: boolean)
59
+ * getCreatePointerFields()
60
+ * setCreatePointerFields(pointerFields: string[])
61
+ * getCreateAccess(entity: Entity)
62
+ * setCreateAccess(entity: Entity, allowed: boolean)
63
+ * getPublicCreateAccess()
64
+ * setPublicCreateAccess(allowed: Boolean)
65
+ * getRoleCreateAccess(role: Role)
66
+ * setRoleCreateAccess(role: Role, allowed: boolean)
67
+ * getUpdateRequiresAuthentication()
68
+ * setUpdateRequiresAuthentication(allowed: boolean)
69
+ * getUpdatePointerFields()
70
+ * setUpdatePointerFields(pointerFields: string[])
71
+ * getUpdateAccess(entity: Entity)
72
+ * setUpdateAccess(entity: Entity, allowed: boolean)
73
+ * getPublicUpdateAccess()
74
+ * setPublicUpdateAccess(allowed: boolean)
75
+ * getRoleUpdateAccess(role: Role)
76
+ * setRoleUpdateAccess(role: Role, allowed: boolean)
77
+ * getDeleteRequiresAuthentication()
78
+ * setDeleteRequiresAuthentication(allowed: boolean)
79
+ * getDeletePointerFields()
80
+ * setDeletePointerFields(pointerFields: string[])
81
+ * getDeleteAccess(entity: Entity)
82
+ * setDeleteAccess(entity: Entity, allowed: boolean)
83
+ * getPublicDeleteAccess()
84
+ * setPublicDeleteAccess(allowed: boolean)
85
+ * getRoleDeleteAccess(role: Role)
86
+ * setRoleDeleteAccess(role: Role, allowed: boolean)
87
+ * getAddFieldRequiresAuthentication()
88
+ * setAddFieldRequiresAuthentication(allowed: boolean)
89
+ * getAddFieldPointerFields()
90
+ * setAddFieldPointerFields(pointerFields: string[])
91
+ * getAddFieldAccess(entity: Entity)
92
+ * setAddFieldAccess(entity: Entity, allowed: boolean)
93
+ * getPublicAddFieldAccess()
94
+ * setPublicAddFieldAccess(allowed: boolean)
95
+ * getRoleAddFieldAccess(role: Role)
96
+ * setRoleAddFieldAccess(role: Role, allowed: boolean)
97
+ * </p>
98
+ *
99
+ * @alias Parse.CLP
100
+ */
101
+ declare class ParseCLP {
102
+ permissionsMap: PermissionsMap;
103
+ /**
104
+ * @param {(Parse.User | Parse.Role | object)} userId The user to initialize the CLP for
105
+ */
106
+ constructor(userId: ParseUser | ParseRole | PermissionsMap);
107
+ /**
108
+ * Returns a JSON-encoded version of the CLP.
109
+ *
110
+ * @returns {object}
111
+ */
112
+ toJSON(): PermissionsMap;
113
+ /**
114
+ * Returns whether this CLP is equal to another object
115
+ *
116
+ * @param other The other object to compare to
117
+ * @returns {boolean}
118
+ */
119
+ equals(other: ParseCLP): boolean;
120
+ _getRoleName(role: ParseRole | string): string;
121
+ _parseEntity(entity: Entity): string;
122
+ _setAccess(permission: string, userId: Entity, allowed: boolean): void;
123
+ _getAccess(permission: string, userId: Entity, returnBoolean?: boolean): boolean | string[];
124
+ _setArrayAccess(permission: string, userId: Entity, fields: string[]): void;
125
+ _setGroupPointerPermission(operation: string, pointerFields: string[]): void;
126
+ _getGroupPointerPermissions(operation: 'readUserFields' | 'writeUserFields'): string[];
127
+ /**
128
+ * Sets user pointer fields to allow permission for get/count/find operations.
129
+ *
130
+ * @param {string[]} pointerFields User pointer fields
131
+ */
132
+ setReadUserFields(pointerFields: string[]): void;
133
+ /**
134
+ * @returns {string[]} User pointer fields
135
+ */
136
+ getReadUserFields(): string[];
137
+ /**
138
+ * Sets user pointer fields to allow permission for create/delete/update/addField operations
139
+ *
140
+ * @param {string[]} pointerFields User pointer fields
141
+ */
142
+ setWriteUserFields(pointerFields: string[]): void;
143
+ /**
144
+ * @returns {string[]} User pointer fields
145
+ */
146
+ getWriteUserFields(): string[];
147
+ /**
148
+ * Sets whether the given user is allowed to retrieve fields from this class.
149
+ *
150
+ * @param userId An instance of Parse.User or its objectId.
151
+ * @param {string[]} fields fields to be protected
152
+ */
153
+ setProtectedFields(userId: Entity, fields: string[]): void;
154
+ /**
155
+ * Returns array of fields are accessable to this user.
156
+ *
157
+ * @param userId An instance of Parse.User or its objectId, or a Parse.Role.
158
+ * @returns {string[]}
159
+ */
160
+ getProtectedFields(userId: Entity): string[];
161
+ /**
162
+ * Sets whether the given user is allowed to read from this class.
163
+ *
164
+ * @param userId An instance of Parse.User or its objectId.
165
+ * @param {boolean} allowed whether that user should have read access.
166
+ */
167
+ setReadAccess(userId: Entity, allowed: boolean): void;
168
+ /**
169
+ * Get whether the given user id is *explicitly* allowed to read from this class.
170
+ * Even if this returns false, the user may still be able to access it if
171
+ * getPublicReadAccess returns true or a role that the user belongs to has
172
+ * write access.
173
+ *
174
+ * @param userId An instance of Parse.User or its objectId, or a Parse.Role.
175
+ * @returns {boolean}
176
+ */
177
+ getReadAccess(userId: Entity): boolean;
178
+ /**
179
+ * Sets whether the given user id is allowed to write to this class.
180
+ *
181
+ * @param userId An instance of Parse.User or its objectId, or a Parse.Role..
182
+ * @param {boolean} allowed Whether that user should have write access.
183
+ */
184
+ setWriteAccess(userId: Entity, allowed: boolean): void;
185
+ /**
186
+ * Gets whether the given user id is *explicitly* allowed to write to this class.
187
+ * Even if this returns false, the user may still be able to write it if
188
+ * getPublicWriteAccess returns true or a role that the user belongs to has
189
+ * write access.
190
+ *
191
+ * @param userId An instance of Parse.User or its objectId, or a Parse.Role.
192
+ * @returns {boolean}
193
+ */
194
+ getWriteAccess(userId: Entity): boolean;
195
+ /**
196
+ * Sets whether the public is allowed to read from this class.
197
+ *
198
+ * @param {boolean} allowed
199
+ */
200
+ setPublicReadAccess(allowed: boolean): void;
201
+ /**
202
+ * Gets whether the public is allowed to read from this class.
203
+ *
204
+ * @returns {boolean}
205
+ */
206
+ getPublicReadAccess(): boolean;
207
+ /**
208
+ * Sets whether the public is allowed to write to this class.
209
+ *
210
+ * @param {boolean} allowed
211
+ */
212
+ setPublicWriteAccess(allowed: boolean): void;
213
+ /**
214
+ * Gets whether the public is allowed to write to this class.
215
+ *
216
+ * @returns {boolean}
217
+ */
218
+ getPublicWriteAccess(): boolean;
219
+ /**
220
+ * Sets whether the public is allowed to protect fields in this class.
221
+ *
222
+ * @param {string[]} fields
223
+ */
224
+ setPublicProtectedFields(fields: string[]): void;
225
+ /**
226
+ * Gets whether the public is allowed to read fields from this class.
227
+ *
228
+ * @returns {string[]}
229
+ */
230
+ getPublicProtectedFields(): string[];
231
+ /**
232
+ * Gets whether users belonging to the given role are allowed
233
+ * to read from this class. Even if this returns false, the role may
234
+ * still be able to write it if a parent role has read access.
235
+ *
236
+ * @param role The name of the role, or a Parse.Role object.
237
+ * @returns {boolean} true if the role has read access. false otherwise.
238
+ * @throws {TypeError} If role is neither a Parse.Role nor a String.
239
+ */
240
+ getRoleReadAccess(role: ParseRole | string): boolean;
241
+ /**
242
+ * Gets whether users belonging to the given role are allowed
243
+ * to write to this user. Even if this returns false, the role may
244
+ * still be able to write it if a parent role has write access.
245
+ *
246
+ * @param role The name of the role, or a Parse.Role object.
247
+ * @returns {boolean} true if the role has write access. false otherwise.
248
+ * @throws {TypeError} If role is neither a Parse.Role nor a String.
249
+ */
250
+ getRoleWriteAccess(role: ParseRole | string): boolean;
251
+ /**
252
+ * Sets whether users belonging to the given role are allowed
253
+ * to read from this class.
254
+ *
255
+ * @param role The name of the role, or a Parse.Role object.
256
+ * @param {boolean} allowed Whether the given role can read this object.
257
+ * @throws {TypeError} If role is neither a Parse.Role nor a String.
258
+ */
259
+ setRoleReadAccess(role: ParseRole | string, allowed: boolean): void;
260
+ /**
261
+ * Sets whether users belonging to the given role are allowed
262
+ * to write to this class.
263
+ *
264
+ * @param role The name of the role, or a Parse.Role object.
265
+ * @param {boolean} allowed Whether the given role can write this object.
266
+ * @throws {TypeError} If role is neither a Parse.Role nor a String.
267
+ */
268
+ setRoleWriteAccess(role: ParseRole | string, allowed: boolean): void;
269
+ /**
270
+ * Gets whether users belonging to the given role are allowed
271
+ * to count to this user. Even if this returns false, the role may
272
+ * still be able to count it if a parent role has count access.
273
+ *
274
+ * @param role The name of the role, or a Parse.Role object.
275
+ * @returns {string[]}
276
+ * @throws {TypeError} If role is neither a Parse.Role nor a String.
277
+ */
278
+ getRoleProtectedFields(role: ParseRole | string): string[];
279
+ /**
280
+ * Sets whether users belonging to the given role are allowed
281
+ * to set access field in this class.
282
+ *
283
+ * @param role The name of the role, or a Parse.Role object.
284
+ * @param {string[]} fields Fields to be protected by Role.
285
+ * @throws {TypeError} If role is neither a Parse.Role nor a String.
286
+ */
287
+ setRoleProtectedFields(role: ParseRole | string, fields: string[]): void;
288
+ }
289
+ export default ParseCLP;
@@ -0,0 +1,69 @@
1
+ import type { RequestOptions } from './RESTController';
2
+ /**
3
+ * Parse.Config is a local representation of configuration data that
4
+ * can be set from the Parse dashboard.
5
+ *
6
+ * @alias Parse.Config
7
+ */
8
+ declare class ParseConfig {
9
+ attributes: Record<string, any>;
10
+ _escapedAttributes: Record<string, any>;
11
+ constructor();
12
+ /**
13
+ * Gets the value of an attribute.
14
+ *
15
+ * @param {string} attr The name of an attribute.
16
+ * @returns {*}
17
+ */
18
+ get(attr: string): any;
19
+ /**
20
+ * Gets the HTML-escaped value of an attribute.
21
+ *
22
+ * @param {string} attr The name of an attribute.
23
+ * @returns {string}
24
+ */
25
+ escape(attr: string): string;
26
+ /**
27
+ * Retrieves the most recently-fetched configuration object, either from
28
+ * memory or from local storage if necessary.
29
+ *
30
+ * @static
31
+ * @returns {Parse.Config} The most recently-fetched Parse.Config if it
32
+ * exists, else an empty Parse.Config.
33
+ */
34
+ static current(): ParseConfig | Promise<ParseConfig>;
35
+ /**
36
+ * Gets a new configuration object from the server.
37
+ *
38
+ * @static
39
+ * @param {object} options
40
+ * Valid options are:<ul>
41
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
42
+ * be used for this request.
43
+ * </ul>
44
+ * @returns {Promise} A promise that is resolved with a newly-created
45
+ * configuration object when the get completes.
46
+ */
47
+ static get(options?: RequestOptions): Promise<ParseConfig>;
48
+ /**
49
+ * Save value keys to the server.
50
+ *
51
+ * @static
52
+ * @param {object} attrs The config parameters and values.
53
+ * @param {object} masterKeyOnlyFlags The flags that define whether config parameters listed
54
+ * in `attrs` should be retrievable only by using the master key.
55
+ * For example: `param1: true` makes `param1` only retrievable by using the master key.
56
+ * If a parameter is not provided or set to `false`, it can be retrieved without
57
+ * using the master key.
58
+ * @returns {Promise} A promise that is resolved with a newly-created
59
+ * configuration object or with the current with the update.
60
+ */
61
+ static save(attrs: Record<string, any>, masterKeyOnlyFlags: Record<string, any>): Promise<ParseConfig>;
62
+ /**
63
+ * Used for testing
64
+ *
65
+ * @private
66
+ */
67
+ static _clearCache(): void;
68
+ }
69
+ export default ParseConfig;