@@ -12,53 +12,59 @@ internal struct Parse {
12
12
static var sessionDelegate : ParseURLSessionDelegate !
13
13
}
14
14
15
- internal func initialize( applicationId: String ,
16
- clientKey: String ? = nil ,
17
- primaryKey: String ? = nil ,
18
- serverURL: URL ,
19
- liveQueryServerURL: URL ? = nil ,
20
- requiringCustomObjectIds: Bool = false ,
21
- usingTransactions: Bool = false ,
22
- usingEqualQueryConstraint: Bool = false ,
23
- usingPostForQuery: Bool = false ,
24
- primitiveStore: ParsePrimitiveStorable ? = nil ,
25
- requestCachePolicy: URLRequest . CachePolicy = . useProtocolCachePolicy,
26
- cacheMemoryCapacity: Int = 512_000 ,
27
- cacheDiskCapacity: Int = 10_000_000 ,
28
- migratingFromObjcSDK: Bool = false ,
29
- usingDataProtectionKeychain: Bool = false ,
30
- deletingKeychainIfNeeded: Bool = false ,
31
- httpAdditionalHeaders: [ AnyHashable : Any ] ? = nil ,
32
- usingAutomaticLogin: Bool = false ,
33
- maxConnectionAttempts: Int = 5 ,
34
- liveQueryConnectionAdditionalProperties: Bool = true ,
35
- liveQueryMaxConnectionAttempts: Int = 20 ,
36
- testing: Bool = false ,
37
- testLiveQueryDontCloseSocket: Bool = false ,
38
- authentication: ( ( URLAuthenticationChallenge ,
39
- ( URLSession . AuthChallengeDisposition ,
40
- URLCredential ? ) -> Void ) -> Void ) ? = nil ) async throws {
41
- var configuration = ParseConfiguration ( applicationId: applicationId,
42
- clientKey: clientKey,
43
- primaryKey: primaryKey,
44
- serverURL: serverURL,
45
- liveQueryServerURL: liveQueryServerURL,
46
- requiringCustomObjectIds: requiringCustomObjectIds,
47
- usingTransactions: usingTransactions,
48
- usingEqualQueryConstraint: usingEqualQueryConstraint,
49
- usingPostForQuery: usingPostForQuery,
50
- primitiveStore: primitiveStore,
51
- requestCachePolicy: requestCachePolicy,
52
- cacheMemoryCapacity: cacheMemoryCapacity,
53
- cacheDiskCapacity: cacheDiskCapacity,
54
- usingDataProtectionKeychain: usingDataProtectionKeychain,
55
- deletingKeychainIfNeeded: deletingKeychainIfNeeded,
56
- httpAdditionalHeaders: httpAdditionalHeaders,
57
- usingAutomaticLogin: usingAutomaticLogin,
58
- maxConnectionAttempts: maxConnectionAttempts,
59
- liveQueryConnectionAdditionalProperties: liveQueryConnectionAdditionalProperties,
60
- liveQueryMaxConnectionAttempts: liveQueryMaxConnectionAttempts,
61
- authentication: authentication)
15
+ internal func initialize(
16
+ applicationId: String ,
17
+ clientKey: String ? = nil ,
18
+ primaryKey: String ? = nil ,
19
+ maintenanceKey: String ? = nil ,
20
+ serverURL: URL ,
21
+ liveQueryServerURL: URL ? = nil ,
22
+ requiringCustomObjectIds: Bool = false ,
23
+ usingTransactions: Bool = false ,
24
+ usingEqualQueryConstraint: Bool = false ,
25
+ usingPostForQuery: Bool = false ,
26
+ primitiveStore: ParsePrimitiveStorable ? = nil ,
27
+ requestCachePolicy: URLRequest . CachePolicy = . useProtocolCachePolicy,
28
+ cacheMemoryCapacity: Int = 512_000 ,
29
+ cacheDiskCapacity: Int = 10_000_000 ,
30
+ migratingFromObjcSDK: Bool = false ,
31
+ usingDataProtectionKeychain: Bool = false ,
32
+ deletingKeychainIfNeeded: Bool = false ,
33
+ httpAdditionalHeaders: [ AnyHashable : Any ] ? = nil ,
34
+ usingAutomaticLogin: Bool = false ,
35
+ maxConnectionAttempts: Int = 5 ,
36
+ liveQueryConnectionAdditionalProperties: Bool = true ,
37
+ liveQueryMaxConnectionAttempts: Int = 20 ,
38
+ testing: Bool = false ,
39
+ testLiveQueryDontCloseSocket: Bool = false ,
40
+ authentication: ( ( URLAuthenticationChallenge ,
41
+ ( URLSession . AuthChallengeDisposition ,
42
+ URLCredential ? ) -> Void ) -> Void ) ? = nil
43
+ ) async throws {
44
+ var configuration = ParseConfiguration (
45
+ applicationId: applicationId,
46
+ clientKey: clientKey,
47
+ primaryKey: primaryKey,
48
+ maintenanceKey: maintenanceKey,
49
+ serverURL: serverURL,
50
+ liveQueryServerURL: liveQueryServerURL,
51
+ requiringCustomObjectIds: requiringCustomObjectIds,
52
+ usingTransactions: usingTransactions,
53
+ usingEqualQueryConstraint: usingEqualQueryConstraint,
54
+ usingPostForQuery: usingPostForQuery,
55
+ primitiveStore: primitiveStore,
56
+ requestCachePolicy: requestCachePolicy,
57
+ cacheMemoryCapacity: cacheMemoryCapacity,
58
+ cacheDiskCapacity: cacheDiskCapacity,
59
+ usingDataProtectionKeychain: usingDataProtectionKeychain,
60
+ deletingKeychainIfNeeded: deletingKeychainIfNeeded,
61
+ httpAdditionalHeaders: httpAdditionalHeaders,
62
+ usingAutomaticLogin: usingAutomaticLogin,
63
+ maxConnectionAttempts: maxConnectionAttempts,
64
+ liveQueryConnectionAdditionalProperties: liveQueryConnectionAdditionalProperties,
65
+ liveQueryMaxConnectionAttempts: liveQueryMaxConnectionAttempts,
66
+ authentication: authentication
67
+ )
62
68
configuration. isMigratingFromObjcSDK = migratingFromObjcSDK
63
69
configuration. isTestingSDK = testing
64
70
configuration. isTestingLiveQueryDontCloseSocket = testLiveQueryDontCloseSocket
@@ -215,6 +221,8 @@ public func initialize(configuration: ParseConfiguration) async throws { // swif
215
221
- parameter primaryKey: The primary key for your Parse application. This key should only be
216
222
specified when using the SDK on a server. This has been renamed from `masterKey` to reflect
217
223
inclusive language.
224
+ - parameter maintenanceKey: The maintenance key for your Parse application. This key should only be
225
+ specified when using the SDK on a server.
218
226
- parameter serverURL: The server URL to connect to Parse Server.
219
227
- parameter liveQueryServerURL: The live query server URL to connect to Parse Server.
220
228
- parameter requiringCustomObjectIds: Requires `objectId`'s to be created on the client
@@ -265,6 +273,7 @@ public func initialize(
265
273
applicationId: String ,
266
274
clientKey: String ? = nil ,
267
275
primaryKey: String ? = nil ,
276
+ maintenanceKey: String ? = nil ,
268
277
serverURL: URL ,
269
278
liveQueryServerURL: URL ? = nil ,
270
279
requiringCustomObjectIds: Bool = false ,
@@ -287,28 +296,31 @@ public func initialize(
287
296
( URLSession . AuthChallengeDisposition ,
288
297
URLCredential ? ) -> Void ) -> Void ) ? = nil
289
298
) async throws {
290
- let configuration = ParseConfiguration ( applicationId: applicationId,
291
- clientKey: clientKey,
292
- primaryKey: primaryKey,
293
- serverURL: serverURL,
294
- liveQueryServerURL: liveQueryServerURL,
295
- requiringCustomObjectIds: requiringCustomObjectIds,
296
- usingTransactions: usingTransactions,
297
- usingEqualQueryConstraint: usingEqualQueryConstraint,
298
- usingPostForQuery: usingPostForQuery,
299
- primitiveStore: primitiveStore,
300
- requestCachePolicy: requestCachePolicy,
301
- cacheMemoryCapacity: cacheMemoryCapacity,
302
- cacheDiskCapacity: cacheDiskCapacity,
303
- usingDataProtectionKeychain: usingDataProtectionKeychain,
304
- deletingKeychainIfNeeded: deletingKeychainIfNeeded,
305
- httpAdditionalHeaders: httpAdditionalHeaders,
306
- usingAutomaticLogin: usingAutomaticLogin,
307
- maxConnectionAttempts: maxConnectionAttempts,
308
- liveQueryConnectionAdditionalProperties: liveQueryConnectionAdditionalProperties,
309
- liveQueryMaxConnectionAttempts: liveQueryMaxConnectionAttempts,
310
- parseFileTransfer: parseFileTransfer,
311
- authentication: authentication)
299
+ let configuration = ParseConfiguration (
300
+ applicationId: applicationId,
301
+ clientKey: clientKey,
302
+ primaryKey: primaryKey,
303
+ maintenanceKey: maintenanceKey,
304
+ serverURL: serverURL,
305
+ liveQueryServerURL: liveQueryServerURL,
306
+ requiringCustomObjectIds: requiringCustomObjectIds,
307
+ usingTransactions: usingTransactions,
308
+ usingEqualQueryConstraint: usingEqualQueryConstraint,
309
+ usingPostForQuery: usingPostForQuery,
310
+ primitiveStore: primitiveStore,
311
+ requestCachePolicy: requestCachePolicy,
312
+ cacheMemoryCapacity: cacheMemoryCapacity,
313
+ cacheDiskCapacity: cacheDiskCapacity,
314
+ usingDataProtectionKeychain: usingDataProtectionKeychain,
315
+ deletingKeychainIfNeeded: deletingKeychainIfNeeded,
316
+ httpAdditionalHeaders: httpAdditionalHeaders,
317
+ usingAutomaticLogin: usingAutomaticLogin,
318
+ maxConnectionAttempts: maxConnectionAttempts,
319
+ liveQueryConnectionAdditionalProperties: liveQueryConnectionAdditionalProperties,
320
+ liveQueryMaxConnectionAttempts: liveQueryMaxConnectionAttempts,
321
+ parseFileTransfer: parseFileTransfer,
322
+ authentication: authentication
323
+ )
312
324
try await initialize ( configuration: configuration)
313
325
}
314
326
0 commit comments