@zeroin.earth/appwrite-graphql 0.16.5 → 23.0.0
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/README.md +574 -159
- package/dist/index.cjs +990 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +16953 -0
- package/dist/index.d.ts +13864 -2911
- package/dist/index.js +680 -145
- package/dist/index.js.map +1 -1
- package/package.json +73 -28
- package/react-native/index.cjs +989 -0
- package/react-native/index.d.cts +16953 -0
- package/dist/index.d.mts +0 -6000
- package/dist/index.mjs +0 -395
- package/dist/index.mjs.map +0 -1
- package/react-native/index.d.ts +0 -6000
- package/react-native/index.js +0 -453
package/dist/index.js
CHANGED
|
@@ -1,35 +1,15 @@
|
|
|
1
|
-
'
|
|
2
|
-
|
|
3
|
-
var jotai = require('jotai');
|
|
4
|
-
var graphql = require('graphql');
|
|
5
|
-
var appwrite = require('appwrite');
|
|
6
|
-
var reactQuery = require('@tanstack/react-query');
|
|
7
|
-
var utils = require('jotai/utils');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
var immer = require('immer');
|
|
10
|
-
|
|
11
|
-
function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"Account_User"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"prefs"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"Identity_Provider"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Identity"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"provider"}}]}}]},q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AccountGet"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountGet"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Account_User"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Account_User"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"prefs"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]},_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAnonymousSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateAnonymousSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateEmailToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phrase"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateEmailToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"phrase"},value:{kind:"Variable",name:{kind:"Name",value:"phrase"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},E={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateJWT"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateJWT"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jwt"}}]}}]}}]},P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateMagicURLToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"url"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phrase"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateMagicURLToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"url"},value:{kind:"Variable",name:{kind:"Name",value:"url"}}},{kind:"Argument",name:{kind:"Name",value:"phrase"},value:{kind:"Variable",name:{kind:"Name",value:"phrase"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateMfaAuthenticator"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateMfaAuthenticator"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secret"}},{kind:"Field",name:{kind:"Name",value:"uri"}}]}}]}}]},L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateMfaChallenge"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"factor"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateMfaChallenge"},arguments:[{kind:"Argument",name:{kind:"Name",value:"factor"},value:{kind:"Variable",name:{kind:"Name",value:"factor"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},Q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateMfaRecoveryCodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateMfaRecoveryCodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"recoveryCodes"}}]}}]}}]},G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePhoneToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreatePhoneToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"phone"},value:{kind:"Variable",name:{kind:"Name",value:"phone"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePhoneVerification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreatePhoneVerification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},J={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"secret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"secret"},value:{kind:"Variable",name:{kind:"Name",value:"secret"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteIdentity"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"identityId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountDeleteIdentity"},arguments:[{kind:"Argument",name:{kind:"Name",value:"identityId"},value:{kind:"Variable",name:{kind:"Name",value:"identityId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]},K={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteMfaAuthenticator"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"otp"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountDeleteMfaAuthenticator"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}},{kind:"Argument",name:{kind:"Name",value:"otp"},value:{kind:"Variable",name:{kind:"Name",value:"otp"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfa"}}]}}]}}]},W={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sessionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountDeleteSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sessionId"},value:{kind:"Variable",name:{kind:"Name",value:"sessionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]},j={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteSessions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountDeleteSessions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]},z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetMfaRecoveryCodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountGetMfaRecoveryCodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"recoveryCodes"}}]}}]}}]},X={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPrefs"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountGetPrefs"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]},H={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sessionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountGetSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sessionId"},value:{kind:"Variable",name:{kind:"Name",value:"sessionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},Y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListIdentities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountListIdentities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"identities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Identity_Provider"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Identity_Provider"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Identity"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"provider"}}]}}]},Z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListMfaFactors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountListMfaFactors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totp"}},{kind:"Field",name:{kind:"Name",value:"phone"}},{kind:"Field",name:{kind:"Name",value:"email"}}]}}]}}]},ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListSessions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountListSessions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sessions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"_createdAt"}},{kind:"Field",name:{kind:"Name",value:"osName"}},{kind:"Field",name:{kind:"Name",value:"clientName"}}]}}]}}]}}]},ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateEmailPasswordSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateEmailPasswordSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListLogs"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queries"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountListLogs"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queries"},value:{kind:"Variable",name:{kind:"Name",value:"queries"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"logs"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"event"}},{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"userEmail"}},{kind:"Field",name:{kind:"Name",value:"userName"}},{kind:"Field",name:{kind:"Name",value:"mode"}},{kind:"Field",name:{kind:"Name",value:"ip"}},{kind:"Field",name:{kind:"Name",value:"time"}},{kind:"Field",name:{kind:"Name",value:"osCode"}},{kind:"Field",name:{kind:"Name",value:"osName"}},{kind:"Field",name:{kind:"Name",value:"osVersion"}},{kind:"Field",name:{kind:"Name",value:"clientType"}},{kind:"Field",name:{kind:"Name",value:"clientCode"}},{kind:"Field",name:{kind:"Name",value:"clientName"}},{kind:"Field",name:{kind:"Name",value:"clientVersion"}},{kind:"Field",name:{kind:"Name",value:"clientEngine"}},{kind:"Field",name:{kind:"Name",value:"clientEngineVersion"}},{kind:"Field",name:{kind:"Name",value:"deviceName"}},{kind:"Field",name:{kind:"Name",value:"deviceBrand"}},{kind:"Field",name:{kind:"Name",value:"deviceModel"}},{kind:"Field",name:{kind:"Name",value:"countryCode"}},{kind:"Field",name:{kind:"Name",value:"countryName"}}]}}]}}]}}]},ae={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRecovery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"url"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateRecovery"},arguments:[{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"url"},value:{kind:"Variable",name:{kind:"Name",value:"url"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateRecovery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"secret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateRecovery"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"secret"},value:{kind:"Variable",name:{kind:"Name",value:"secret"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},oe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"email"}}]}}]}}]},re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"VerifyEmail"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"url"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountCreateVerification"},arguments:[{kind:"Argument",name:{kind:"Name",value:"url"},value:{kind:"Variable",name:{kind:"Name",value:"url"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateEmail"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateEmail"},arguments:[{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"email"}}]}}]}}]},ue={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateMagicURLSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"secret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateMagicURLSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"secret"},value:{kind:"Variable",name:{kind:"Name",value:"secret"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},ce={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateMFA"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"mfa"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateMFA"},arguments:[{kind:"Argument",name:{kind:"Name",value:"mfa"},value:{kind:"Variable",name:{kind:"Name",value:"mfa"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfa"}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateMfaAuthenticator"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"otp"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateMfaAuthenticator"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}},{kind:"Argument",name:{kind:"Name",value:"otp"},value:{kind:"Variable",name:{kind:"Name",value:"otp"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfa"}}]}}]}}]},le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateMfaChallenge"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"challengeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"otp"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateMfaChallenge"},arguments:[{kind:"Argument",name:{kind:"Name",value:"challengeId"},value:{kind:"Variable",name:{kind:"Name",value:"challengeId"}}},{kind:"Argument",name:{kind:"Name",value:"otp"},value:{kind:"Variable",name:{kind:"Name",value:"otp"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]},pe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateMfaRecoveryCodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateMfaRecoveryCodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"recoveryCodes"}}]}}]}}]},me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateName"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]},ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePassword"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"oldPassword"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdatePassword"},arguments:[{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}},{kind:"Argument",name:{kind:"Name",value:"oldPassword"},value:{kind:"Variable",name:{kind:"Name",value:"oldPassword"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]},Se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePhone"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdatePhone"},arguments:[{kind:"Argument",name:{kind:"Name",value:"phone"},value:{kind:"Variable",name:{kind:"Name",value:"phone"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"phone"}}]}}]}}]},ke={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePhoneSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"secret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdatePhoneSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"secret"},value:{kind:"Variable",name:{kind:"Name",value:"secret"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePhoneVerification"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"secret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdatePhoneVerification"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"secret"},value:{kind:"Variable",name:{kind:"Name",value:"secret"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expire"}}]}}]}}]},ge={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePrefs"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prefs"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdatePrefs"},arguments:[{kind:"Argument",name:{kind:"Name",value:"prefs"},value:{kind:"Variable",name:{kind:"Name",value:"prefs"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"prefs"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]}}]},ve={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateSession"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sessionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateSession"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sessionId"},value:{kind:"Variable",name:{kind:"Name",value:"sessionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"current"}}]}}]}}]},be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateVerification"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"secret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountUpdateVerification"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"secret"},value:{kind:"Variable",name:{kind:"Name",value:"secret"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secret"}},{kind:"Field",name:{kind:"Name",value:"expire"}},{kind:"Field",name:{kind:"Name",value:"userId"}}]}}]}}]},Me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListDocuments"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"databaseId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queries"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"databasesListDocuments"},arguments:[{kind:"Argument",name:{kind:"Name",value:"databaseId"},value:{kind:"Variable",name:{kind:"Name",value:"databaseId"}}},{kind:"Argument",name:{kind:"Name",value:"collectionId"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}},{kind:"Argument",name:{kind:"Name",value:"queries"},value:{kind:"Variable",name:{kind:"Name",value:"queries"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]}}]},Ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"databaseId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"permissions"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"databasesCreateDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"databaseId"},value:{kind:"Variable",name:{kind:"Name",value:"databaseId"}}},{kind:"Argument",name:{kind:"Name",value:"collectionId"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}},{kind:"Argument",name:{kind:"Name",value:"documentId"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}},{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}},{kind:"Argument",name:{kind:"Name",value:"permissions"},value:{kind:"Variable",name:{kind:"Name",value:"permissions"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}}]}}]}}]},De={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"databaseId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"databasesDeleteDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"databaseId"},value:{kind:"Variable",name:{kind:"Name",value:"databaseId"}}},{kind:"Argument",name:{kind:"Name",value:"collectionId"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}},{kind:"Argument",name:{kind:"Name",value:"documentId"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]},xe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"databaseId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"databasesGetDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"databaseId"},value:{kind:"Variable",name:{kind:"Name",value:"databaseId"}}},{kind:"Argument",name:{kind:"Name",value:"collectionId"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}},{kind:"Argument",name:{kind:"Name",value:"documentId"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]},Ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"databaseId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"permissions"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"databasesUpdateDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"databaseId"},value:{kind:"Variable",name:{kind:"Name",value:"databaseId"}}},{kind:"Argument",name:{kind:"Name",value:"collectionId"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}},{kind:"Argument",name:{kind:"Name",value:"documentId"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}},{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}},{kind:"Argument",name:{kind:"Name",value:"permissions"},value:{kind:"Variable",name:{kind:"Name",value:"permissions"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}}]}}]}}]},Ce={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateExecution"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"functionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"body"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"async"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"path"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"method"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"functionsCreateExecution"},arguments:[{kind:"Argument",name:{kind:"Name",value:"functionId"},value:{kind:"Variable",name:{kind:"Name",value:"functionId"}}},{kind:"Argument",name:{kind:"Name",value:"body"},value:{kind:"Variable",name:{kind:"Name",value:"body"}}},{kind:"Argument",name:{kind:"Name",value:"async"},value:{kind:"Variable",name:{kind:"Name",value:"async"}}},{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"Variable",name:{kind:"Name",value:"path"}}},{kind:"Argument",name:{kind:"Name",value:"method"},value:{kind:"Variable",name:{kind:"Name",value:"method"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"responseStatusCode"}},{kind:"Field",name:{kind:"Name",value:"responseBody"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"duration"}}]}}]}}]},$e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetFunctionExecution"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"functionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"executionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"functionsGetExecution"},arguments:[{kind:"Argument",name:{kind:"Name",value:"functionId"},value:{kind:"Variable",name:{kind:"Name",value:"functionId"}}},{kind:"Argument",name:{kind:"Name",value:"executionId"},value:{kind:"Variable",name:{kind:"Name",value:"executionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"responseBody"}},{kind:"Field",name:{kind:"Name",value:"requestPath"}}]}}]}}]};var Be={"\n fragment Account_User on User {\n _id\n name\n email\n prefs {\n data\n }\n }\n":U,"\n fragment Identity_Provider on Identity {\n _id\n userId\n provider\n }\n":V,"\n query AccountGet {\n accountGet {\n ...Account_User\n }\n }\n":q,"\n mutation CreateAnonymousSession {\n accountCreateAnonymousSession {\n _id\n expire\n current\n }\n }\n":_,"\n mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {\n accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {\n expire\n }\n }\n":F,"\n mutation CreateJWT {\n accountCreateJWT {\n jwt\n }\n }\n":E,"\n mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {\n accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {\n expire\n }\n }\n":P,"\n mutation CreateMfaAuthenticator($type: String!) {\n accountCreateMfaAuthenticator(type: $type) {\n secret\n uri\n }\n }\n":R,"\n mutation CreateMfaChallenge($factor: String!) {\n accountCreateMfaChallenge(factor: $factor) {\n userId\n expire\n }\n }\n":L,"\n mutation CreateMfaRecoveryCodes {\n accountCreateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n":Q,"\n mutation CreatePhoneToken($userId: String!, $phone: String!) {\n accountCreatePhoneToken(userId: $userId, phone: $phone) {\n expire\n }\n }\n":G,"\n mutation CreatePhoneVerification {\n accountCreatePhoneVerification {\n expire\n }\n }\n":O,"\n mutation CreateSession($userId: String!, $secret: String!) {\n accountCreateSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n":J,"\n mutation DeleteIdentity($identityId: String!) {\n accountDeleteIdentity(identityId: $identityId) {\n status\n }\n }\n":B,"\n mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {\n accountDeleteMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n":K,"\n mutation DeleteSession($sessionId: String!) {\n accountDeleteSession(sessionId: $sessionId) {\n status\n }\n }\n":W,"\n mutation DeleteSessions {\n accountDeleteSessions {\n status\n }\n }\n":j,"\n query GetMfaRecoveryCodes {\n accountGetMfaRecoveryCodes {\n recoveryCodes\n }\n }\n":z,"\n query GetPrefs {\n accountGetPrefs {\n data\n }\n }\n":X,"\n query GetSession($sessionId: String!) {\n accountGetSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n":H,"\n query ListIdentities {\n accountListIdentities {\n total\n identities {\n ...Identity_Provider\n }\n }\n }\n":Y,"\n query ListMfaFactors {\n accountListMfaFactors {\n totp\n phone\n email\n }\n }\n":Z,"\n query ListSessions {\n accountListSessions {\n sessions {\n _id\n _createdAt\n osName\n clientName\n }\n }\n }\n":ee,"\n mutation CreateEmailPasswordSession($email: String!, $password: String!) {\n accountCreateEmailPasswordSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n":ne,"\n query ListLogs($queries: [String!]) {\n accountListLogs(queries: $queries) {\n total\n logs {\n event\n userId\n userEmail\n userName\n mode\n ip\n time\n osCode\n osName\n osVersion\n clientType\n clientCode\n clientName\n clientVersion\n clientEngine\n clientEngineVersion\n deviceName\n deviceBrand\n deviceModel\n countryCode\n countryName\n }\n }\n }\n":te,"\n mutation CreateRecovery($email: String!, $url: String!) {\n accountCreateRecovery(email: $email, url: $url) {\n expire\n }\n }\n":ae,"\n mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {\n accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {\n expire\n }\n }\n":ie,"\n mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {\n accountCreate(userId: $userId, name: $name, email: $email, password: $password) {\n name\n email\n }\n }\n":oe,"\n mutation VerifyEmail($url: String!) {\n accountCreateVerification(url: $url) {\n expire\n }\n }\n":re,"\n mutation UpdateEmail($email: String!, $password: String!) {\n accountUpdateEmail(email: $email, password: $password) {\n name\n email\n }\n }\n":se,"\n mutation UpdateMagicURLSession($userId: String!, $secret: String!) {\n accountUpdateMagicURLSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n":ue,"\n mutation UpdateMFA($mfa: Boolean!) {\n accountUpdateMFA(mfa: $mfa) {\n mfa\n }\n }\n":ce,"\n mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {\n accountUpdateMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n":de,"\n mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {\n accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {\n status\n }\n }\n":le,"\n mutation UpdateMfaRecoveryCodes {\n accountUpdateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n":pe,"\n mutation UpdateName($name: String!) {\n accountUpdateName(name: $name) {\n name\n }\n }\n":me,"\n mutation UpdatePassword($password: String!, $oldPassword: String!) {\n accountUpdatePassword(password: $password, oldPassword: $oldPassword) {\n status\n }\n }\n":ye,"\n mutation UpdatePhone($phone: String!, $password: String!) {\n accountUpdatePhone(phone: $phone, password: $password) {\n phone\n }\n }\n":Se,"\n mutation UpdatePhoneSession($userId: String!, $secret: String!) {\n accountUpdatePhoneSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n":ke,"\n mutation UpdatePhoneVerification($userId: String!, $secret: String!) {\n accountUpdatePhoneVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n":fe,"\n mutation UpdatePrefs($prefs: JSON!) {\n accountUpdatePrefs(prefs: $prefs) {\n prefs {\n data\n }\n }\n }\n":ge,"\n mutation UpdateSession($sessionId: String!) {\n accountUpdateSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n":ve,"\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n secret\n expire\n userId\n }\n }\n":be,"\n query ListDocuments($databaseId: String!, $collectionId: String!, $queries: [String!]) {\n databasesListDocuments(\n databaseId: $databaseId\n collectionId: $collectionId\n queries: $queries\n ) {\n total\n documents {\n _id\n data\n }\n }\n }\n":Me,"\n mutation CreateDocument(\n $databaseId: String!\n $collectionId: String!\n $documentId: String!\n $data: JSON!\n $permissions: [String!]\n ) {\n databasesCreateDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n data: $data\n permissions: $permissions\n ) {\n _id\n }\n }\n":Ne,"\n mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {\n databasesDeleteDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n ) {\n status\n }\n }\n":De,"\n query GetDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {\n databasesGetDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n ) {\n _id\n data\n }\n }\n":xe,"\n mutation UpdateDocument(\n $databaseId: String!\n $collectionId: String!\n $documentId: String!\n $data: JSON\n $permissions: [String!]\n ) {\n databasesUpdateDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n data: $data\n permissions: $permissions\n ) {\n _id\n }\n }\n":Ie,"\n mutation CreateExecution(\n $functionId: String!\n $body: String\n $async: Boolean\n $path: String\n $method: String # $headers: JSON\n ) {\n functionsCreateExecution(\n functionId: $functionId\n body: $body\n async: $async\n path: $path\n method: $method # headers: $headers\n ) {\n _id\n status\n responseStatusCode\n responseBody\n errors\n duration\n }\n }\n":Ce,"\n query GetFunctionExecution($functionId: String!, $executionId: String!) {\n functionsGetExecution(functionId: $functionId, executionId: $executionId) {\n status\n errors\n duration\n responseBody\n requestPath\n }\n }\n":$e};function r(e){return Be[e]??{}}var Ae=r(`
|
|
12
|
-
fragment Account_User on User {
|
|
13
|
-
_id
|
|
14
|
-
name
|
|
15
|
-
email
|
|
16
|
-
prefs {
|
|
17
|
-
data
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`),we=r(`
|
|
21
|
-
fragment Identity_Provider on Identity {
|
|
22
|
-
_id
|
|
23
|
-
userId
|
|
24
|
-
provider
|
|
25
|
-
}
|
|
26
|
-
`);var We=process.env.APPWRITE_ENDPOINT??process.env.EXPO_PUBLIC_APPWRITE_URL??process.env.NEXT_PUBLIC_APPWRITE_URL??"http://localhost/v1",je=process.env.APPWRITE_PROJECT_ID??process.env.EXPO_PUBLIC_APPWRITE_PROJECT_ID??process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID??"[PROJECT_ID]",v=new appwrite.Client;v.setEndpoint(We).setProject(je);var qe=e=>({client:e.client,query:async({query:a,variables:n})=>{let{data:t,errors:i}=await e.query({query:graphql.print(a),variables:n});return {data:t,errors:i}},mutation:async({query:a,variables:n})=>{let{data:t,errors:i}=await e.mutation({query:graphql.print(a),variables:n});return {data:t,errors:i}}}),Ue=jotai.atom({account:new appwrite.Account(v),databases:new appwrite.Databases(v),graphql:qe(new appwrite.Graphql(v))}),b=jotai.atom(e=>e(Ue),(e,a,{endpoint:n,projectId:t})=>{let i=new appwrite.Client;i.setEndpoint(n).setProject(t);let s=new appwrite.Account(i),c=new appwrite.Databases(i),d=new appwrite.Graphql(i);a(Ue,{account:s,databases:c,graphql:qe(d)});});function o(){let{account:e,databases:a,graphql:n}=jotai.useAtomValue(b);return {account:e,databases:a,graphql:n}}var Ye=new reactQuery.QueryClient,_e=jotai.atom(Ye);function l(){let[e]=jotai.useAtom(_e);return e}function u(e){let a=l();return reactQuery.useMutation(e,a)}function m(e){let a=l();return reactQuery.useQuery(e,a)}function k(e){let a=l(),n=reactQuery.useQuery({...e,enabled:!1},a);return {run:n.refetch,query:n}}function f(e){let a=l();return reactQuery.useSuspenseQuery(e,a)}function rn({endpoint:e,projectId:a,children:n}){return utils.useHydrateAtoms([[b,{endpoint:e,projectId:a}]]),n}var cn=r(`
|
|
1
|
+
import*as O from'react';import {useContext,useState,useEffect,useMemo,useCallback,useRef}from'react';import {QueryClient,QueryClientProvider,QueryClientContext,useMutation,useQuery,useSuspenseQuery,onlineManager}from'@tanstack/react-query';import {ReactQueryDevtools}from'@tanstack/react-query-devtools';import {PersistQueryClientProvider}from'@tanstack/react-query-persist-client';import {print}from'graphql';import {Client,Teams,TablesDB,Messaging,Locale,Functions,Databases,Storage,Realtime,Avatars,Account,Graphql,Channel,ID,Query}from'appwrite';import {graphql}from'gql.tada';import {produce,castDraft}from'immer';import {createAsyncStoragePersister}from'@tanstack/query-async-storage-persister';var I=O.createContext(null),at=new QueryClient;function it({client:t,queryClient:e,persister:s,onCacheRestored:r,children:o}){let n=e??at;return s?O.createElement(PersistQueryClientProvider,{client:n,persistOptions:{persister:s,dehydrateOptions:{shouldDehydrateMutation:u=>u.state.isPaused,shouldDehydrateQuery:u=>u.state.status==="success"}},onSuccess:()=>{n.resumePausedMutations(),r?.();}},O.createElement(I.Provider,{value:t},o),O.createElement(ReactQueryDevtools,{initialIsOpen:false})):O.createElement(QueryClientProvider,{client:n},O.createElement(I.Provider,{value:t},o),O.createElement(ReactQueryDevtools,{initialIsOpen:false}))}function i(){let t=useContext(I);if(!t)throw new Error("Wrap your app in <AppwriteProvider>");return t}function m(){let t=useContext(QueryClientContext);if(!t)throw new Error("Wrap your app in <QueryClientProvider>");return t}function p(t){let e=m();return useMutation(t,e)}function d(t){let e=m();return useQuery(t,e)}function Q(t){let e=m(),s=useQuery({...t,enabled:false},e);return {run:s.refetch,query:s}}function S(t){let e=m();return useSuspenseQuery(t,e)}var dt=t=>({client:t.client,query:async({query:e,variables:s})=>{let{data:r,errors:o}=await t.query({query:{query:print(e),variables:s}});return {data:r,errors:o}},mutation:async({query:e,variables:s})=>{let{data:r,errors:o}=await t.mutation({query:{query:print(e),variables:s}});return {data:r,errors:o}}});function V({endpoint:t,projectId:e}){let s=new Client;return s.setEndpoint(t).setProject(e),{client:s,account:new Account(s),avatars:new Avatars(s),realtime:new Realtime(s),storage:new Storage(s),graphql:dt(new Graphql(s)),databases:new Databases(s),functions:new Functions(s),locale:new Locale(s),messaging:new Messaging(s),tablesDB:new TablesDB(s),teams:new Teams(s)}}var a=class t{keys=["appwrite"];_type;constructor(){}static create(...e){let s=new t;return s.keys.push(...e),s}static account(){return t.create("account")}static databases(){return t.create("databases")}static database(e){return t.create("databases",e)}static tablesDB(e){return t.create("tablesDB",e)}static buckets(){return t.create("buckets")}static bucket(e){return t.create("buckets",e)}static functions(){return t.create("functions")}static function(e){return t.create("functions",e)}static teams(){return t.create("teams")}static team(e){return t.create("teams",e)}static locale(){return t.create("locale")}static messaging(){return t.create("messaging")}jwt(){return this.keys.push("jwt"),this}anonymous(){return this.keys.push("anonymous"),this}emailToken(){return this.keys.push("emailToken"),this}emailVerification(){return this.keys.push("emailVerification"),this}magicUrl(){return this.keys.push("magicUrl"),this}mfaAuthenticator(){return this.keys.push("mfaAuthenticator"),this}mfaChallenge(){return this.keys.push("mfaChallenge"),this}mfaCodes(){return this.keys.push("mfaCodes"),this}oauth2Token(){return this.keys.push("oauth2Token"),this}phoneToken(){return this.keys.push("phoneToken"),this}phoneVerification(){return this.keys.push("phoneVerification"),this}pushTarget(){return this.keys.push("pushTarget"),this}identity(){return this.keys.push("identity"),this}prefs(){return this.keys.push("prefs"),this}login(){return this.keys.push("login"),this}signUp(){return this.keys.push("signUp"),this}name(){return this.keys.push("name"),this}email(){return this.keys.push("email"),this}phone(){return this.keys.push("phone"),this}password(){return this.keys.push("password"),this}recovery(){return this.keys.push("recovery"),this}mfa(){return this.keys.push("mfa"),this}status(){return this.keys.push("status"),this}logs(){return this.keys.push("logs"),this}verification(){return this.keys.push("verification"),this}session(e){return this.keys.push("sessions"),e&&this.keys.push(e),this}sessions(){return [...this.keys,"sessions"]}identities(){return [...this.keys,"identities"]}mfaFactors(){return [...this.keys,"mfaFactors"]}collections(){return this.keys.push("collections"),this}collection(e){return this.keys.push("collections",e),this}transactions(){return this.keys.push("transactions"),this}transaction(e){return this.keys.push("transactions",e),this}documents(){return this.keys.push("documents"),this}document(e){return this.keys.push("documents",e),this}operations(){return this.keys.push("operations"),this}table(e){return this.keys.push("table",e),this}rows(){return this.keys.push("rows"),this}row(e){return this.keys.push("row",e),this}files(){return this.keys.push("files"),this}file(e){return this.keys.push("files",e),this}executions(){return this.keys.push("executions"),this}execution(e){return this.keys.push("executions",e),this}teamName(){return this.keys.push("name"),this}teamPrefs(){return this.keys.push("prefs"),this}memberships(){return this.keys.push("memberships"),this}membership(e){return this.keys.push("memberships",e),this}membershipStatus(){return this.keys.push("membershipStatus"),this}continents(){return [...this.keys,"continents"]}countries(){return [...this.keys,"countries"]}countriesEU(){return [...this.keys,"countriesEU"]}countriesPhones(){return [...this.keys,"countriesPhones"]}currencies(){return [...this.keys,"currencies"]}languages(){return [...this.keys,"languages"]}codes(){return [...this.keys,"codes"]}subscriber(){return this.keys.push("subscriber"),this}create(){return [...this.keys,"create"]}upsert(){return [...this.keys,"upsert"]}update(){return [...this.keys,"update"]}delete(){return [...this.keys,"delete"]}key(){return [...this.keys]}};var gt=graphql(`
|
|
27
2
|
query AccountGet {
|
|
28
3
|
accountGet {
|
|
29
|
-
|
|
4
|
+
_id
|
|
5
|
+
name
|
|
6
|
+
email
|
|
7
|
+
prefs {
|
|
8
|
+
data
|
|
9
|
+
}
|
|
30
10
|
}
|
|
31
11
|
}
|
|
32
|
-
`);function
|
|
12
|
+
`);function $(t){return {queryKey:a.account().key(),queryFn:async()=>{let{data:e,errors:s}=await t.graphql.query({query:gt});if(s)throw s;return e.accountGet},retry:false}}function xt(){let t=i(),e=m(),[s,r]=useState(false),o=Q(Ee(t));return useEffect(()=>{if(!s)return;let n=Ie(t.realtime,e);return ()=>{n.then(u=>u.close());}},[s,t.realtime,e]),{...o,run:()=>(r(true),o.run())}}function At(t={}){let e=i(),s=m(),r=d({...Ee(e),...t});return useEffect(()=>{let o=Ie(e.realtime,s);return ()=>{o.then(n=>n.close());}},[e.realtime,s]),r}function Ee(t){return $(t)}function Ie(t,e){return t.subscribe(Channel.account(),s=>{if(s.events.some(o=>o.endsWith("prefs"))){e.setQueryData(a.account().key(),o=>produce(o,n=>{n&&(n.prefs=castDraft(s.payload.prefs));}));return}e.setQueryData(a.account().key(),s.payload);})}var Kt=graphql(`
|
|
33
13
|
mutation CreateAnonymousSession {
|
|
34
14
|
accountCreateAnonymousSession {
|
|
35
15
|
_id
|
|
@@ -37,57 +17,67 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
37
17
|
current
|
|
38
18
|
}
|
|
39
19
|
}
|
|
40
|
-
`);function
|
|
20
|
+
`);function Ot(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().anonymous().create(),mutationFn:async()=>{let{data:r,errors:o}=await t.mutation({query:Kt});if(o)throw o;return r.accountCreateAnonymousSession},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().anonymous().create()});}})}}var Tt=graphql(`
|
|
41
21
|
mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {
|
|
42
22
|
accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {
|
|
43
23
|
expire
|
|
44
24
|
}
|
|
45
25
|
}
|
|
46
|
-
`);function
|
|
26
|
+
`);function kt(){let{graphql:t}=i();return {...p({mutationKey:a.account().emailToken().create(),mutationFn:async({userId:s,email:r,phrase:o})=>{let{data:n,errors:u}=await t.mutation({query:Tt,variables:{userId:s,email:r,phrase:o}});if(u)throw u;return n.accountCreateEmailToken}})}}var ve=graphql(`
|
|
47
27
|
mutation CreateJWT {
|
|
48
28
|
accountCreateJWT {
|
|
49
29
|
jwt
|
|
50
30
|
}
|
|
51
31
|
}
|
|
52
|
-
`);function
|
|
32
|
+
`);function Et({gcTime:t=6e5}={}){let{graphql:e}=i(),s=m();return {...p({gcTime:t,mutationKey:a.account().jwt().create(),mutationFn:async()=>{let{data:o,errors:n}=await e.mutation({query:ve});if(n)throw n;return o.accountCreateJWT},onSuccess:o=>{e.client.setJWT(o.jwt),s.setQueryData(a.account().jwt().create(),o.jwt,{updatedAt:Date.now()});}})}}function It({gcTime:t=6e5}={}){let{graphql:e}=i();return {...S({gcTime:t,queryKey:a.account().jwt().create(),queryFn:async()=>{let{data:r,errors:o}=await e.mutation({query:ve});if(o)throw o;return e.client.setJWT(r.accountCreateJWT.jwt),r.accountCreateJWT}})}}var Qt=graphql(`
|
|
53
33
|
mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
|
|
54
34
|
accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
|
|
55
35
|
expire
|
|
56
36
|
}
|
|
57
37
|
}
|
|
58
|
-
`);function
|
|
38
|
+
`);function Vt(){let{graphql:t}=i();return {...p({mutationKey:a.account().magicUrl().create(),mutationFn:async({userId:s,email:r,url:o,phrase:n})=>{let{data:u,errors:c}=await t.mutation({query:Qt,variables:{userId:s,email:r,url:o,phrase:n}});if(c)throw c;return u.accountCreateMagicURLToken}})}}var Mt=graphql(`
|
|
59
39
|
mutation CreateMfaAuthenticator($type: String!) {
|
|
60
40
|
accountCreateMfaAuthenticator(type: $type) {
|
|
61
41
|
secret
|
|
62
42
|
uri
|
|
63
43
|
}
|
|
64
44
|
}
|
|
65
|
-
`);function
|
|
45
|
+
`);function Pt(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().mfaAuthenticator().create(),mutationFn:async({type:r="totp"})=>{let{data:o,errors:n}=await t.mutation({query:Mt,variables:{type:r}});if(n)throw n;return o.accountCreateMfaAuthenticator},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().mfaAuthenticator().key()});}})}}var Ut=graphql(`
|
|
66
46
|
mutation CreateMfaChallenge($factor: String!) {
|
|
67
47
|
accountCreateMfaChallenge(factor: $factor) {
|
|
48
|
+
_id
|
|
68
49
|
userId
|
|
69
50
|
expire
|
|
70
51
|
}
|
|
71
52
|
}
|
|
72
|
-
`);function
|
|
53
|
+
`);function Lt(){let{graphql:t}=i();return {...p({mutationKey:a.account().mfaChallenge().create(),mutationFn:async({factor:s})=>{let{data:r,errors:o}=await t.mutation({query:Ut,variables:{factor:s}});if(o)throw o;return r.accountCreateMfaChallenge}})}}var Nt=graphql(`
|
|
73
54
|
mutation CreateMfaRecoveryCodes {
|
|
74
55
|
accountCreateMfaRecoveryCodes {
|
|
75
56
|
recoveryCodes
|
|
76
57
|
}
|
|
77
58
|
}
|
|
78
|
-
`);function
|
|
59
|
+
`);function Gt(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().mfaCodes().create(),mutationFn:async()=>{let{data:r,errors:o}=await t.mutation({query:Nt});if(o)throw o;return r.accountCreateMfaRecoveryCodes},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().mfaCodes().key()});}})}}function Bt(){let{account:t}=i();return {...p({mutationKey:a.account().oauth2Token().create(),mutationFn:async({provider:s,success:r,failure:o,scopes:n})=>t.createOAuth2Token({provider:s,success:r,failure:o,scopes:n})})}}var Jt=graphql(`
|
|
79
60
|
mutation CreatePhoneToken($userId: String!, $phone: String!) {
|
|
80
61
|
accountCreatePhoneToken(userId: $userId, phone: $phone) {
|
|
81
62
|
expire
|
|
82
63
|
}
|
|
83
64
|
}
|
|
84
|
-
`);function
|
|
65
|
+
`);function Wt(){let{graphql:t}=i();return {...p({mutationKey:a.account().phoneToken().create(),mutationFn:async({userId:s,phone:r})=>{let{data:o,errors:n}=await t.mutation({query:Jt,variables:{userId:s,phone:r}});if(n)throw n;return o.accountCreatePhoneToken}})}}var Ht=graphql(`
|
|
85
66
|
mutation CreatePhoneVerification {
|
|
86
67
|
accountCreatePhoneVerification {
|
|
87
68
|
expire
|
|
88
69
|
}
|
|
89
70
|
}
|
|
90
|
-
`);function
|
|
71
|
+
`);function Xt(){let{graphql:t}=i();return {...p({mutationKey:a.account().phoneVerification().create(),mutationFn:async()=>{let{data:s,errors:r}=await t.mutation({query:Ht});if(r)throw r;return s.accountCreatePhoneVerification}})}}var Zt=graphql(`
|
|
72
|
+
mutation CreatePushTarget($targetId: String!, $identifier: String!, $providerId: String) {
|
|
73
|
+
accountCreatePushTarget(targetId: $targetId, identifier: $identifier, providerId: $providerId) {
|
|
74
|
+
_id
|
|
75
|
+
userId
|
|
76
|
+
providerType
|
|
77
|
+
identifier
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`);function er(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().pushTarget().create(),mutationFn:async({targetId:r,identifier:o,providerId:n})=>{let{data:u,errors:c}=await t.mutation({query:Zt,variables:{targetId:r,identifier:o,providerId:n}});if(c)throw c;return u.accountCreatePushTarget},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var rr=graphql(`
|
|
91
81
|
mutation CreateSession($userId: String!, $secret: String!) {
|
|
92
82
|
accountCreateSession(userId: $userId, secret: $secret) {
|
|
93
83
|
userId
|
|
@@ -95,43 +85,58 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
95
85
|
current
|
|
96
86
|
}
|
|
97
87
|
}
|
|
98
|
-
`);function
|
|
88
|
+
`);function or(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().session().create(),mutationFn:async({userId:r,secret:o})=>{let{data:n,errors:u}=await t.mutation({query:rr,variables:{userId:r,secret:o}});if(u)throw u;return n.accountCreateSession},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().sessions()});}})}}var nr=graphql(`
|
|
89
|
+
mutation CreateEmailVerification($url: String!) {
|
|
90
|
+
accountCreateEmailVerification(url: $url) {
|
|
91
|
+
_id
|
|
92
|
+
userId
|
|
93
|
+
secret
|
|
94
|
+
expire
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`);function ar(){let{graphql:t}=i();return {...p({mutationKey:a.account().emailVerification().create(),mutationFn:async({url:s})=>{let{data:r,errors:o}=await t.mutation({query:nr,variables:{url:s}});if(o)throw o;return r.accountCreateEmailVerification}})}}var ur=graphql(`
|
|
99
98
|
mutation DeleteIdentity($identityId: String!) {
|
|
100
99
|
accountDeleteIdentity(identityId: $identityId) {
|
|
101
100
|
status
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
`);function
|
|
105
|
-
mutation DeleteMfaAuthenticator($type: String
|
|
106
|
-
accountDeleteMfaAuthenticator(type: $type
|
|
107
|
-
|
|
103
|
+
`);function pr(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().identity().delete(),mutationFn:async({identityId:r})=>{let{data:o,errors:n}=await t.mutation({query:ur,variables:{identityId:r}});if(n)throw n;return o?.accountDeleteIdentity??{status:""}},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var mr=graphql(`
|
|
104
|
+
mutation DeleteMfaAuthenticator($type: String!) {
|
|
105
|
+
accountDeleteMfaAuthenticator(type: $type) {
|
|
106
|
+
status
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`);function lr(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().mfaAuthenticator().delete(),mutationFn:async({type:r="totp"})=>{let{data:o,errors:n}=await t.mutation({query:mr,variables:{type:r}});if(n)throw n;return o?.accountDeleteMfaAuthenticator??{status:""}},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().mfaAuthenticator().key()});}})}}var fr=graphql(`
|
|
110
|
+
mutation DeletePushTarget($targetId: String!) {
|
|
111
|
+
accountDeletePushTarget(targetId: $targetId) {
|
|
112
|
+
status
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
|
-
`);function
|
|
115
|
+
`);function dr(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().pushTarget().delete(),mutationFn:async({targetId:r})=>{let{data:o,errors:n}=await t.mutation({query:fr,variables:{targetId:r}});if(n)throw n;return o?.accountDeletePushTarget??{status:""}},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var gr=graphql(`
|
|
111
116
|
mutation DeleteSession($sessionId: String!) {
|
|
112
117
|
accountDeleteSession(sessionId: $sessionId) {
|
|
113
118
|
status
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
|
-
`);function
|
|
121
|
+
`);function qr(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().session().delete(),mutationFn:async({sessionId:r})=>{let{data:o,errors:n}=await t.mutation({query:gr,variables:{sessionId:r}});if(n)throw n;return o?.accountDeleteSession??{status:""}},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().sessions()});}})}}var wr=graphql(`
|
|
117
122
|
mutation DeleteSessions {
|
|
118
123
|
accountDeleteSessions {
|
|
119
124
|
status
|
|
120
125
|
}
|
|
121
126
|
}
|
|
122
|
-
`);function
|
|
127
|
+
`);function Rr(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().session().delete(),mutationFn:async()=>{let{data:r,errors:o}=await t.mutation({query:wr});if(o)throw o;return r?.accountDeleteSessions??{status:""}},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().sessions()}),e.clear();}})}}var Ar=graphql(`
|
|
123
128
|
query GetMfaRecoveryCodes {
|
|
124
129
|
accountGetMfaRecoveryCodes {
|
|
125
130
|
recoveryCodes
|
|
126
131
|
}
|
|
127
132
|
}
|
|
128
|
-
`);function
|
|
133
|
+
`);function Cr(t={}){let{graphql:e}=i();return {...d({queryKey:a.account().mfaCodes().key(),queryFn:async()=>{let{data:r,errors:o}=await e.query({query:Ar});if(o)throw o;return r.accountGetMfaRecoveryCodes},...t})}}var Or=graphql(`
|
|
129
134
|
query GetPrefs {
|
|
130
135
|
accountGetPrefs {
|
|
131
136
|
data
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
|
-
`);function
|
|
139
|
+
`);function Sr(t={}){let{graphql:e}=i();return {...d({queryKey:a.account().prefs().key(),queryFn:async()=>{let{data:r,errors:o}=await e.query({query:Or});if(o)throw o;return r.accountGetPrefs},...t})}}var kr=graphql(`
|
|
135
140
|
query GetSession($sessionId: String!) {
|
|
136
141
|
accountGetSession(sessionId: $sessionId) {
|
|
137
142
|
userId
|
|
@@ -139,16 +144,18 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
139
144
|
current
|
|
140
145
|
}
|
|
141
146
|
}
|
|
142
|
-
`);function
|
|
147
|
+
`);function Dr({sessionId:t},e={}){let{graphql:s}=i();return d({queryKey:a.account().session(t).key(),queryFn:async()=>{let{data:o,errors:n}=await s.query({query:kr,variables:{sessionId:t}});if(n)throw n;return o.accountGetSession},...e})}var Ir=graphql(`
|
|
143
148
|
query ListIdentities {
|
|
144
149
|
accountListIdentities {
|
|
145
150
|
total
|
|
146
151
|
identities {
|
|
147
|
-
|
|
152
|
+
_id
|
|
153
|
+
userId
|
|
154
|
+
provider
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
157
|
}
|
|
151
|
-
`);function
|
|
158
|
+
`);function vr(t={}){let{graphql:e}=i();return {...d({queryKey:a.account().identities(),queryFn:async()=>{let{data:r,errors:o}=await e.query({query:Ir});if(o)throw o;return r.accountListIdentities},...t})}}var Vr=graphql(`
|
|
152
159
|
query ListMfaFactors {
|
|
153
160
|
accountListMfaFactors {
|
|
154
161
|
totp
|
|
@@ -156,7 +163,7 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
156
163
|
email
|
|
157
164
|
}
|
|
158
165
|
}
|
|
159
|
-
`);function
|
|
166
|
+
`);function $r(t={}){let{graphql:e}=i();return {...d({queryKey:a.account().mfaFactors(),queryFn:async()=>{let{data:r,errors:o}=await e.query({query:Vr});if(o)throw o;return r.accountListMfaFactors},...t})}}var Pr=graphql(`
|
|
160
167
|
query ListSessions {
|
|
161
168
|
accountListSessions {
|
|
162
169
|
sessions {
|
|
@@ -167,7 +174,7 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
167
174
|
}
|
|
168
175
|
}
|
|
169
176
|
}
|
|
170
|
-
`);function
|
|
177
|
+
`);function Fr(t={}){let{graphql:e}=i();return {...d({queryKey:a.account().sessions(),queryFn:async()=>{let{data:r,errors:o}=await e.query({query:Pr});if(o)throw o;return r.accountListSessions},...t})}}var Lr=graphql(`
|
|
171
178
|
mutation CreateEmailPasswordSession($email: String!, $password: String!) {
|
|
172
179
|
accountCreateEmailPasswordSession(email: $email, password: $password) {
|
|
173
180
|
userId
|
|
@@ -175,13 +182,13 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
175
182
|
current
|
|
176
183
|
}
|
|
177
184
|
}
|
|
178
|
-
`);function
|
|
185
|
+
`);function _r(){let{account:t,graphql:e}=i(),s=m(),r=p({mutationKey:a.account().login().create(),mutationFn:async({email:n,password:u})=>{let{data:c,errors:l}=await e.mutation({query:Lr,variables:{email:n,password:u}});if(l)throw l;return c.accountCreateEmailPasswordSession},onSuccess:()=>{s.invalidateQueries({queryKey:a.account().key()}),s.invalidateQueries({queryKey:a.account().sessions()});}}),o=p({mutationFn:async({provider:n,success:u,failure:c})=>t.createOAuth2Session({provider:n,success:u,failure:c})});return {login:r,oAuthLogin:o}}var Gr=graphql(`
|
|
179
186
|
mutation DeleteSession($sessionId: String!) {
|
|
180
187
|
accountDeleteSession(sessionId: $sessionId) {
|
|
181
188
|
status
|
|
182
189
|
}
|
|
183
190
|
}
|
|
184
|
-
`);function
|
|
191
|
+
`);function Br(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().session().delete(),mutationFn:async({sessionId:r})=>{let{data:o,errors:n}=await t.mutation({query:Gr,variables:{sessionId:r}});if(n)throw n;return o?.accountDeleteSession??{status:""}},onSuccess:async()=>{e.clear();}})}}var Jr=graphql(`
|
|
185
192
|
query ListLogs($queries: [String!]) {
|
|
186
193
|
accountListLogs(queries: $queries) {
|
|
187
194
|
total
|
|
@@ -210,39 +217,48 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
210
217
|
}
|
|
211
218
|
}
|
|
212
219
|
}
|
|
213
|
-
`);function
|
|
220
|
+
`);function Wr({queries:t},e={}){let{graphql:s}=i();return {...d({queryKey:[...a.account().logs().key(),...t??[]],queryFn:async()=>{let{data:o,errors:n}=await s.query({query:Jr,variables:{queries:t}});if(n)throw n;return o.accountListLogs},...e})}}var Hr=graphql(`
|
|
214
221
|
mutation CreateRecovery($email: String!, $url: String!) {
|
|
215
222
|
accountCreateRecovery(email: $email, url: $url) {
|
|
216
223
|
expire
|
|
217
224
|
}
|
|
218
225
|
}
|
|
219
|
-
`);function
|
|
226
|
+
`);function Xr(){let{graphql:t}=i();return {...p({mutationKey:a.account().recovery().create(),mutationFn:async({email:s,url:r})=>{let{data:o,errors:n}=await t.mutation({query:Hr,variables:{email:s,url:r}});if(n)throw n;return o.accountCreateRecovery},onSuccess:async(s,r)=>{try{localStorage?.setItem("email",r.email);}catch(o){console.error("Could not save email to local storage. If you are using react-native, this is expected.",o);}}})}}var Zr=graphql(`
|
|
220
227
|
mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {
|
|
221
228
|
accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {
|
|
222
229
|
expire
|
|
223
230
|
}
|
|
224
231
|
}
|
|
225
|
-
`);function
|
|
232
|
+
`);function eo(){let{graphql:t}=i();return {...p({mutationKey:a.account().recovery().update(),mutationFn:async({userId:s,secret:r,password:o})=>{let{data:n,errors:u}=await t.mutation({query:Zr,variables:{userId:s,secret:r,password:o}});if(u)throw u;return n.accountUpdateRecovery}})}}var to=graphql(`
|
|
226
233
|
mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
|
|
227
234
|
accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
|
|
228
235
|
name
|
|
229
236
|
email
|
|
230
237
|
}
|
|
231
238
|
}
|
|
232
|
-
`),
|
|
239
|
+
`),ro=graphql(`
|
|
233
240
|
mutation VerifyEmail($url: String!) {
|
|
234
241
|
accountCreateVerification(url: $url) {
|
|
235
242
|
expire
|
|
236
243
|
}
|
|
237
244
|
}
|
|
238
|
-
`);function
|
|
245
|
+
`);function oo(){let{graphql:t}=i(),e=p({mutationKey:a.account().signUp().create(),mutationFn:async({userId:r,email:o,password:n,name:u})=>{let{data:c,errors:l}=await t.mutation({query:to,variables:{userId:r??ID.unique(),name:u,email:o,password:n}});if(l)throw l;return c.accountCreate}}),s=p({mutationKey:a.account().emailVerification().create(),mutationFn:async({verifyUrl:r})=>{let{data:o,errors:n}=await t.mutation({query:ro,variables:{url:r}});if(n)throw n;return o.accountCreateVerification}});return {signUp:e,verifyEmail:s}}var M=graphql(`
|
|
239
246
|
mutation UpdateEmail($email: String!, $password: String!) {
|
|
240
247
|
accountUpdateEmail(email: $email, password: $password) {
|
|
241
248
|
name
|
|
242
249
|
email
|
|
243
250
|
}
|
|
244
251
|
}
|
|
245
|
-
`);function
|
|
252
|
+
`);function no(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().email().update(),mutationFn:async({email:r,password:o})=>{let{data:n,errors:u}=await t.mutation({query:M,variables:{email:r,password:o}});if(u)throw u;return n.accountUpdateEmail},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var io=graphql(`
|
|
253
|
+
mutation UpdateEmailVerification($userId: String!, $secret: String!) {
|
|
254
|
+
accountUpdateEmailVerification(userId: $userId, secret: $secret) {
|
|
255
|
+
_id
|
|
256
|
+
userId
|
|
257
|
+
secret
|
|
258
|
+
expire
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
`);function uo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().emailVerification().update(),mutationFn:async({userId:r,secret:o})=>{let{data:n,errors:u}=await t.mutation({query:io,variables:{userId:r,secret:o}});if(u)throw u;return n.accountUpdateEmailVerification},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var co=graphql(`
|
|
246
262
|
mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
|
|
247
263
|
accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
|
|
248
264
|
userId
|
|
@@ -250,49 +266,52 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
250
266
|
current
|
|
251
267
|
}
|
|
252
268
|
}
|
|
253
|
-
`);function
|
|
269
|
+
`);function mo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().magicUrl().update(),mutationFn:async({userId:r,secret:o})=>{let{data:n,errors:u}=await t.mutation({query:co,variables:{userId:r,secret:o}});if(u)throw u;return n.accountUpdateMagicURLSession},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().sessions()});}})}}var yo=graphql(`
|
|
254
270
|
mutation UpdateMFA($mfa: Boolean!) {
|
|
255
271
|
accountUpdateMFA(mfa: $mfa) {
|
|
256
272
|
mfa
|
|
257
273
|
}
|
|
258
274
|
}
|
|
259
|
-
`);function
|
|
275
|
+
`);function fo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().mfa().update(),mutationFn:async({mfa:r})=>{let{data:o,errors:n}=await t.mutation({query:yo,variables:{mfa:r}});if(n)throw n;return o.accountUpdateMFA},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().mfaFactors()});}})}}var go=graphql(`
|
|
260
276
|
mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
|
|
261
277
|
accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
|
|
262
278
|
mfa
|
|
263
279
|
}
|
|
264
280
|
}
|
|
265
|
-
`);function
|
|
281
|
+
`);function qo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().mfaAuthenticator().update(),mutationFn:async({type:r="totp",otp:o})=>{let{data:n,errors:u}=await t.mutation({query:go,variables:{type:r,otp:o}});if(u)throw u;return n.accountUpdateMfaAuthenticator},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().mfaFactors()});}})}}var wo=graphql(`
|
|
266
282
|
mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
|
|
267
283
|
accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
|
|
268
|
-
|
|
284
|
+
_id
|
|
285
|
+
userId
|
|
286
|
+
expire
|
|
287
|
+
current
|
|
269
288
|
}
|
|
270
289
|
}
|
|
271
|
-
`);function
|
|
290
|
+
`);function Ro(){let{graphql:t}=i();return {...p({mutationKey:a.account().mfaChallenge().update(),mutationFn:async({challengeId:s,otp:r})=>{let{data:o,errors:n}=await t.mutation({query:wo,variables:{challengeId:s,otp:r}});if(n)throw n;return o?.accountUpdateMfaChallenge??null}})}}var Ao=graphql(`
|
|
272
291
|
mutation UpdateMfaRecoveryCodes {
|
|
273
292
|
accountUpdateMfaRecoveryCodes {
|
|
274
293
|
recoveryCodes
|
|
275
294
|
}
|
|
276
295
|
}
|
|
277
|
-
`);function
|
|
296
|
+
`);function Co(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().mfaCodes().update(),mutationFn:async()=>{let{data:r,errors:o}=await t.mutation({query:Ao});if(o)throw o;return r.accountUpdateMfaRecoveryCodes},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().mfaCodes().key()});}})}}var P=graphql(`
|
|
278
297
|
mutation UpdateName($name: String!) {
|
|
279
298
|
accountUpdateName(name: $name) {
|
|
280
299
|
name
|
|
281
300
|
}
|
|
282
301
|
}
|
|
283
|
-
`);function
|
|
302
|
+
`);function Oo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().name().update(),mutationFn:async({name:r})=>{let{data:o,errors:n}=await t.mutation({query:P,variables:{name:r}});if(n)throw n;return o.accountUpdateName},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var F=graphql(`
|
|
284
303
|
mutation UpdatePassword($password: String!, $oldPassword: String!) {
|
|
285
304
|
accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
|
|
286
305
|
status
|
|
287
306
|
}
|
|
288
307
|
}
|
|
289
|
-
`);function
|
|
308
|
+
`);function To(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().password().update(),mutationFn:async({password:r,oldPassword:o})=>{let{data:n,errors:u}=await t.mutation({query:F,variables:{password:r,oldPassword:o}});if(u)throw u;return n?.accountUpdatePassword},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var U=graphql(`
|
|
290
309
|
mutation UpdatePhone($phone: String!, $password: String!) {
|
|
291
310
|
accountUpdatePhone(phone: $phone, password: $password) {
|
|
292
311
|
phone
|
|
293
312
|
}
|
|
294
313
|
}
|
|
295
|
-
`);function
|
|
314
|
+
`);function Do(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().phone().update(),mutationFn:async({phone:r,password:o})=>{let{data:n,errors:u}=await t.mutation({query:U,variables:{phone:r,password:o}});if(u)throw u;return n.accountUpdatePhone},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var Io=graphql(`
|
|
296
315
|
mutation UpdatePhoneSession($userId: String!, $secret: String!) {
|
|
297
316
|
accountUpdatePhoneSession(userId: $userId, secret: $secret) {
|
|
298
317
|
userId
|
|
@@ -300,13 +319,30 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
300
319
|
current
|
|
301
320
|
}
|
|
302
321
|
}
|
|
303
|
-
`);function
|
|
322
|
+
`);function vo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().phoneToken().update(),mutationFn:async({userId:r,secret:o})=>{let{data:n,errors:u}=await t.mutation({query:Io,variables:{userId:r,secret:o}});if(u)throw u;return n.accountUpdatePhoneSession},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()}),e.invalidateQueries({queryKey:a.account().sessions()});}})}}var Vo=graphql(`
|
|
304
323
|
mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
|
|
305
324
|
accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
|
|
306
325
|
expire
|
|
307
326
|
}
|
|
308
327
|
}
|
|
309
|
-
`);function
|
|
328
|
+
`);function $o(){let{graphql:t}=i();return {...p({mutationKey:a.account().phoneVerification().update(),mutationFn:async({userId:s,secret:r})=>{let{data:o,errors:n}=await t.mutation({query:Vo,variables:{userId:s,secret:r}});if(n)throw n;return o.accountUpdatePhoneVerification}})}}var L=graphql(`
|
|
329
|
+
mutation UpdatePrefs($prefs: Assoc!) {
|
|
330
|
+
accountUpdatePrefs(prefs: $prefs) {
|
|
331
|
+
prefs {
|
|
332
|
+
data
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
`);function Po(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().prefs().update(),mutationFn:async({prefs:r})=>{let{data:o,errors:n}=await t.mutation({query:L,variables:{prefs:r}});if(n)throw n;return o?.accountUpdatePrefs},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var Uo=graphql(`
|
|
337
|
+
mutation UpdatePushTarget($targetId: String!, $identifier: String!) {
|
|
338
|
+
accountUpdatePushTarget(targetId: $targetId, identifier: $identifier) {
|
|
339
|
+
_id
|
|
340
|
+
userId
|
|
341
|
+
providerType
|
|
342
|
+
identifier
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
`);function Lo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().pushTarget().update(),mutationFn:async({targetId:r,identifier:o})=>{let{data:n,errors:u}=await t.mutation({query:Uo,variables:{targetId:r,identifier:o}});if(u)throw u;return n.accountUpdatePushTarget},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var No=graphql(`
|
|
310
346
|
mutation UpdateSession($sessionId: String!) {
|
|
311
347
|
accountUpdateSession(sessionId: $sessionId) {
|
|
312
348
|
userId
|
|
@@ -314,7 +350,14 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
314
350
|
current
|
|
315
351
|
}
|
|
316
352
|
}
|
|
317
|
-
`);function
|
|
353
|
+
`);function Go(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().session().update(),mutationFn:async({sessionId:r})=>{let{data:o,errors:n}=await t.mutation({query:No,variables:{sessionId:r}});if(n)throw n;return o.accountUpdateSession},onSuccess:()=>{e.invalidateQueries({queryKey:a.account().sessions()});}})}}var jo=graphql(`
|
|
354
|
+
mutation UpdateStatus {
|
|
355
|
+
accountUpdateStatus {
|
|
356
|
+
_id
|
|
357
|
+
status
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
`);function Jo(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().status().update(),mutationFn:async()=>{let{data:r,errors:o}=await t.mutation({query:jo});if(o)throw o;return r.accountUpdateStatus},onSuccess:async()=>{e.invalidateQueries({queryKey:a.account().key()});}})}}var zo=graphql(`
|
|
318
361
|
mutation UpdateVerification($userId: String!, $secret: String!) {
|
|
319
362
|
accountUpdateVerification(userId: $userId, secret: $secret) {
|
|
320
363
|
secret
|
|
@@ -322,12 +365,37 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
322
365
|
userId
|
|
323
366
|
}
|
|
324
367
|
}
|
|
325
|
-
`);function
|
|
326
|
-
query
|
|
368
|
+
`);function Ho(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.account().verification().update(),mutationFn:async({userId:r,secret:o})=>{if(!r||!o)throw new Error("Missing userId or secret");let{data:n,errors:u}=await t.mutation({query:zo,variables:{userId:r,secret:o}});if(u)throw u;return n.accountUpdateVerification},onSuccess:async()=>{e.setQueryData(a.account().key(),null);}})}}function Yo({code:t,width:e,height:s,quality:r}){let{avatars:o}=i();return useMemo(()=>o?.getBrowser({code:t,width:e,height:s,quality:r}),[o,t,e,s,r])}function es({code:t,width:e,height:s,quality:r}){let{avatars:o}=i();return useMemo(()=>o?.getCreditCard({code:t,width:e,height:s,quality:r}),[o,t,e,s,r])}function rs({url:t}){let{avatars:e}=i();return useMemo(()=>e?.getFavicon({url:t}),[e,t])}function ss({code:t,width:e,height:s,quality:r}){let{avatars:o}=i();return useMemo(()=>o?.getFlag({code:t,width:e,height:s,quality:r}),[o,t,e,s,r])}function as({url:t,width:e,height:s}){let{avatars:r}=i();return useMemo(()=>r?.getImage({url:t,width:e,height:s}),[r,t,e,s])}function us({name:t,width:e,height:s,background:r}={}){let{avatars:o}=i();return useMemo(()=>o?.getInitials({name:t,width:e,height:s,background:r}),[o,t,e,s,r])}function cs({text:t,size:e,margin:s,download:r}){let{avatars:o}=i();return useMemo(()=>o?.getQR({text:t,size:e,margin:s,download:r}),[o,t,e,s,r])}function ls({url:t,width:e,height:s}){let{avatars:r}=i();return useMemo(()=>r?.getScreenshot({url:t,width:e,height:s}),[r,t,e,s])}function _(t,e){return !e||e.length===0?t:[Query.select(e),...t]}var N=graphql(`
|
|
369
|
+
query GetDocument(
|
|
370
|
+
$databaseId: String!
|
|
371
|
+
$collectionId: String!
|
|
372
|
+
$documentId: String!
|
|
373
|
+
$queries: [String!]
|
|
374
|
+
$transactionId: String
|
|
375
|
+
) {
|
|
376
|
+
databasesGetDocument(
|
|
377
|
+
databaseId: $databaseId
|
|
378
|
+
collectionId: $collectionId
|
|
379
|
+
documentId: $documentId
|
|
380
|
+
queries: $queries
|
|
381
|
+
transactionId: $transactionId
|
|
382
|
+
) {
|
|
383
|
+
_id
|
|
384
|
+
data
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
`);function G(t,{databaseId:e,collectionId:s,documentId:r,queries:o,transactionId:n,fields:u}){let c=Array.isArray(o)?o:o?[o]:[],l=_(c,u);return {queryKey:[...a.database(e).collection(s).document(r).key(),...l],queryFn:async()=>{let{data:y,errors:f}=await t.graphql.query({query:N,variables:{databaseId:e,collectionId:s,documentId:r,queries:l.length>0?l:void 0,transactionId:n}});if(f)throw f;return {...y.databasesGetDocument,...y.databasesGetDocument?JSON.parse(y.databasesGetDocument.data):{}}}}}var fs=graphql(`
|
|
388
|
+
query ListDocuments(
|
|
389
|
+
$databaseId: String!
|
|
390
|
+
$collectionId: String!
|
|
391
|
+
$queries: [String!]
|
|
392
|
+
$transactionId: String
|
|
393
|
+
) {
|
|
327
394
|
databasesListDocuments(
|
|
328
395
|
databaseId: $databaseId
|
|
329
396
|
collectionId: $collectionId
|
|
330
397
|
queries: $queries
|
|
398
|
+
transactionId: $transactionId
|
|
331
399
|
) {
|
|
332
400
|
total
|
|
333
401
|
documents {
|
|
@@ -336,41 +404,532 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
336
404
|
}
|
|
337
405
|
}
|
|
338
406
|
}
|
|
339
|
-
`);function
|
|
340
|
-
mutation
|
|
407
|
+
`);function B(t,{databaseId:e,collectionId:s,queries:r,transactionId:o,fields:n}){let u=_(r??[],n);return {queryKey:[...a.database(e).collection(s).key(),...u],queryFn:async()=>{let{data:c,errors:l}=await t.graphql.query({query:fs,variables:{databaseId:e,collectionId:s,queries:u,transactionId:o}});if(l)throw l;let y=c.databasesListDocuments?.documents?.map(f=>({...f,...f?JSON.parse(f.data):{}}))??[];return {total:c.databasesListDocuments?.total??0,documents:y}}}}function $e({databaseId:t,collectionId:e,queries:s,transactionId:r,fields:o}){let n=i();return B(n,{databaseId:t,collectionId:e,queries:s,transactionId:r,fields:o})}function Me(t,e,s,r){let{realtime:o}=i(),n=m(),u=JSON.stringify(s);useEffect(()=>{if(!r)return;let c=o.subscribe(Channel.tablesdb(t).table(e).row(),l=>{let[,y]=l.events[0].match(/\.(\w+)$/),f=l.payload;switch(y){case "create":case "update":case "delete":n.setQueryData(a.database(t).collection(e).document(f.$id).key(),f),n.invalidateQueries({queryKey:a.database(t).collection(e).key()});break}});return ()=>{c.then(l=>l.close());}},[t,e,o,n,u,r]);}function E({databaseId:t,collectionId:e,queries:s=[],transactionId:r,subscribe:o=true,fields:n},u={}){let c=$e({databaseId:t,collectionId:e,queries:s,transactionId:r,fields:n}),l=d({...c,...u});return Me(t,e,s,o),{...l,documents:l.data?.documents,total:l.data?.total}}function j({databaseId:t,collectionId:e,queries:s,transactionId:r,subscribe:o=true,fields:n},u={}){let c=$e({databaseId:t,collectionId:e,queries:s,transactionId:r,fields:n}),l=S({...c,...u});return Me(t,e,s,o),{...l,documents:l.data?.documents,total:l.data?.total}}function Pe(t){let[e,s]=useState(1),r=useRef(0),o=(e-1)*t;return {page:e,offset:o,totalRef:r,nextPage:()=>{s(l=>{let y=(l-1)*t;return r.current>0&&y+t<r.current?l+1:l});},previousPage:()=>{s(l=>l>1?l-1:l);},handlePageChange:l=>{if(!(l<1)){if(r.current>0){let y=Math.ceil(r.current/t);if(l>y)return}s(l);}}}}function bs({databaseId:t,collectionId:e,queries:s,transactionId:r,limit:o=25,fields:n},u={}){let{page:c,offset:l,totalRef:y,nextPage:f,previousPage:q,handlePageChange:w}=Pe(o),g=E({databaseId:t,collectionId:e,queries:[...s,Query.limit(o),Query.offset(l)],transactionId:r,fields:n},u),b=g.data?.total??0;return y.current=b,{documents:g.data?.documents??[],total:b,page:c,hasNextPage:b>0&&l+o<b,hasPreviousPage:c>1,handlePageChange:w,nextPage:f,previousPage:q,isLoading:g.isLoading,isError:g.isError,error:g.error,isFetching:g.isFetching}}function ws({databaseId:t,collectionId:e,queries:s,transactionId:r,limit:o=25,fields:n},u={}){let{page:c,offset:l,totalRef:y,nextPage:f,previousPage:q,handlePageChange:w}=Pe(o),g=j({databaseId:t,collectionId:e,queries:[...s,Query.limit(o),Query.offset(l)],transactionId:r,fields:n},u),b=g.total??0;return y.current=b,{documents:g.documents??[],total:b,page:c,hasNextPage:b>0&&l+o<b,hasPreviousPage:c>1,handlePageChange:w,nextPage:f,previousPage:q,isLoading:g.isLoading,isError:g.isError,error:g.error,isFetching:g.isFetching}}var J=graphql(`
|
|
408
|
+
mutation CreateDocument(
|
|
409
|
+
$databaseId: String!
|
|
410
|
+
$collectionId: String!
|
|
411
|
+
$documentId: String!
|
|
412
|
+
$data: Json!
|
|
413
|
+
$permissions: [String!]
|
|
414
|
+
$transactionId: String
|
|
415
|
+
) {
|
|
416
|
+
databasesCreateDocument(
|
|
417
|
+
databaseId: $databaseId
|
|
418
|
+
collectionId: $collectionId
|
|
419
|
+
documentId: $documentId
|
|
420
|
+
data: $data
|
|
421
|
+
permissions: $permissions
|
|
422
|
+
transactionId: $transactionId
|
|
423
|
+
) {
|
|
424
|
+
_id
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
`);function xs(){let{graphql:t}=i(),e=m();return p({mutationKey:a.databases().collections().documents().create(),mutationFn:async({databaseId:r,collectionId:o,documentId:n,data:u,permissions:c,transactionId:l})=>{let{data:y,errors:f}=await t.mutation({query:J,variables:{databaseId:r,collectionId:o,documentId:n,data:JSON.stringify(u),permissions:c,transactionId:l}});if(f)throw f;return y.databasesCreateDocument},onSuccess:(r,o)=>{let n=a.database(o.databaseId).collection(o.collectionId).document(r._id).key();e.invalidateQueries({queryKey:a.database(o.databaseId).collection(o.collectionId).key()}),e.setQueryData(n,{...o,...o.data});}})}var Cs=graphql(`
|
|
428
|
+
mutation CreateOperations($transactionId: String!, $operations: [String!]) {
|
|
429
|
+
databasesCreateOperations(transactionId: $transactionId, operations: $operations) {
|
|
430
|
+
_id
|
|
431
|
+
status
|
|
432
|
+
operations
|
|
433
|
+
expiresAt
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
`);function Ks(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.databases().transactions().operations().create(),mutationFn:async({transactionId:r,operations:o})=>{let{data:n,errors:u}=await t.mutation({query:Cs,variables:{transactionId:r,operations:o}});if(u)throw u;return n.databasesCreateOperations},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.databases().transaction(o.transactionId).key()});}})}}var Ss=graphql(`
|
|
437
|
+
mutation CreateTransaction($ttl: Int) {
|
|
438
|
+
databasesCreateTransaction(ttl: $ttl) {
|
|
439
|
+
_id
|
|
440
|
+
status
|
|
441
|
+
operations
|
|
442
|
+
expiresAt
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
`);function Ts(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.databases().transactions().create(),mutationFn:async({ttl:r}={})=>{let{data:o,errors:n}=await t.mutation({query:Ss,variables:{ttl:r}});if(n)throw n;return o.databasesCreateTransaction},onSuccess:()=>{e.invalidateQueries({queryKey:a.databases().transactions().key()});}})}}var W=graphql(`
|
|
446
|
+
mutation DecrementDocumentAttribute(
|
|
447
|
+
$databaseId: String!
|
|
448
|
+
$collectionId: String!
|
|
449
|
+
$documentId: String!
|
|
450
|
+
$attribute: String!
|
|
451
|
+
$value: Int
|
|
452
|
+
$min: Int
|
|
453
|
+
$transactionId: String
|
|
454
|
+
) {
|
|
455
|
+
databasesDecrementDocumentAttribute(
|
|
456
|
+
databaseId: $databaseId
|
|
457
|
+
collectionId: $collectionId
|
|
458
|
+
documentId: $documentId
|
|
459
|
+
attribute: $attribute
|
|
460
|
+
value: $value
|
|
461
|
+
min: $min
|
|
462
|
+
transactionId: $transactionId
|
|
463
|
+
) {
|
|
464
|
+
_id
|
|
465
|
+
data
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
`);function Ds(){let{graphql:t}=i(),e=m();return {...p({mutationKey:[...a.databases().transactions().operations().key(),"decrementAttribute"],mutationFn:async({databaseId:r,collectionId:o,documentId:n,attribute:u,value:c,min:l,transactionId:y})=>{let{data:f,errors:q}=await t.mutation({query:W,variables:{databaseId:r,collectionId:o,documentId:n,attribute:u,value:c,min:l,transactionId:y}});if(q)throw q;return f.databasesDecrementDocumentAttribute},onMutate:async r=>{let o=a.database(r.databaseId).collection(r.collectionId).document(r.documentId).key();await e.cancelQueries({queryKey:o});let n=e.getQueriesData({queryKey:o});return e.setQueryData(o,u=>{if(!u)return u;let c=u[r.attribute]??0,l=r.value??1,y=r.min!=null?Math.max(c-l,r.min):c-l;return {...u,[r.attribute]:y}}),{previousEntries:n,documentKeyPrefix:o}},onError:(r,o,n)=>{if(n?.previousEntries)for(let[u,c]of n.previousEntries)e.setQueryData(u,c);},onSettled:(r,o,n)=>{e.invalidateQueries({queryKey:a.database(n.databaseId).collection(n.collectionId).key()});}})}}var z=graphql(`
|
|
469
|
+
mutation DeleteDocument(
|
|
470
|
+
$databaseId: String!
|
|
471
|
+
$collectionId: String!
|
|
472
|
+
$documentId: String!
|
|
473
|
+
$transactionId: String
|
|
474
|
+
) {
|
|
341
475
|
databasesDeleteDocument(
|
|
342
476
|
databaseId: $databaseId
|
|
343
477
|
collectionId: $collectionId
|
|
344
478
|
documentId: $documentId
|
|
479
|
+
transactionId: $transactionId
|
|
345
480
|
) {
|
|
346
481
|
status
|
|
347
482
|
}
|
|
348
483
|
}
|
|
349
|
-
`);function
|
|
350
|
-
|
|
351
|
-
|
|
484
|
+
`);function Is(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.databases().collections().documents().delete(),mutationFn:async({databaseId:r,collectionId:o,documentId:n,transactionId:u})=>{let{data:c,errors:l}=await t.mutation({query:z,variables:{databaseId:r,collectionId:o,documentId:n,transactionId:u}});if(l)throw l;return c?.databasesDeleteDocument??{status:""}},onMutate:async r=>{let o=a.database(r.databaseId).collection(r.collectionId).document(r.documentId).key();await e.cancelQueries({queryKey:o});let n=e.getQueriesData({queryKey:o});return e.removeQueries({queryKey:o}),{previousEntries:n,documentKeyPrefix:o}},onError:(r,o,n)=>{if(n?.previousEntries)for(let[u,c]of n.previousEntries)e.setQueryData(u,c);},onSettled:(r,o,n)=>{e.removeQueries({queryKey:a.database(n.databaseId).collection(n.collectionId).document(n.documentId).key()}),e.invalidateQueries({queryKey:a.database(n.databaseId).collection(n.collectionId).key()});}})}}var Qs=graphql(`
|
|
485
|
+
mutation DeleteTransaction($transactionId: String!) {
|
|
486
|
+
databasesDeleteTransaction(transactionId: $transactionId) {
|
|
487
|
+
status
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
`);function Vs(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.databases().transactions().delete(),mutationFn:async({transactionId:r})=>{let{data:o,errors:n}=await t.mutation({query:Qs,variables:{transactionId:r}});if(n)throw n;return o?.databasesDeleteTransaction??{status:""}},onSuccess:(r,o)=>{e.removeQueries({queryKey:a.databases().transaction(o.transactionId).key()}),e.invalidateQueries({queryKey:a.databases().transactions().key()});}})}}function Fe({databaseId:t,collectionId:e,documentId:s,queries:r,transactionId:o,fields:n}){let u=i();return G(u,{databaseId:t,collectionId:e,documentId:s,queries:r,transactionId:o,fields:n})}function Ue(t,e,s,r){let{realtime:o}=i(),n=m();useEffect(()=>{let u=o.subscribe(Channel.tablesdb(t).table(e).row(s).update(),c=>{n.setQueryData(a.database(t).collection(e).document(s).key(),c.payload);});return ()=>{u.then(c=>c.close());}},[t,e,s,o,n,r]);}function Ps({databaseId:t,collectionId:e,documentId:s,queries:r,transactionId:o,fields:n},u={}){let c=Fe({databaseId:t,collectionId:e,documentId:s,queries:r,transactionId:o,fields:n}),l=JSON.stringify(r),y=d({...c,...u});return Ue(t,e,s,l),{...y}}function Fs({databaseId:t,collectionId:e,documentId:s,queries:r,transactionId:o,fields:n},u={}){let c=Fe({databaseId:t,collectionId:e,documentId:s,queries:r,transactionId:o,fields:n}),l=JSON.stringify(r),y=S({...c,...u});return Ue(t,e,s,l),{...y}}var Ls=graphql(`
|
|
491
|
+
query GetTransaction($transactionId: String!) {
|
|
492
|
+
databasesGetTransaction(transactionId: $transactionId) {
|
|
493
|
+
_id
|
|
494
|
+
_createdAt
|
|
495
|
+
_updatedAt
|
|
496
|
+
status
|
|
497
|
+
operations
|
|
498
|
+
expiresAt
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
`);function _s({transactionId:t},e={}){let{graphql:s}=i();return {...d({queryKey:a.databases().transaction(t).key(),queryFn:async()=>{let{data:o,errors:n}=await s.query({query:Ls,variables:{transactionId:t}});if(n)throw n;return o.databasesGetTransaction},...e})}}var H=graphql(`
|
|
502
|
+
mutation IncrementDocumentAttribute(
|
|
503
|
+
$databaseId: String!
|
|
504
|
+
$collectionId: String!
|
|
505
|
+
$documentId: String!
|
|
506
|
+
$attribute: String!
|
|
507
|
+
$value: Int
|
|
508
|
+
$max: Int
|
|
509
|
+
$transactionId: String
|
|
510
|
+
) {
|
|
511
|
+
databasesIncrementDocumentAttribute(
|
|
512
|
+
databaseId: $databaseId
|
|
513
|
+
collectionId: $collectionId
|
|
514
|
+
documentId: $documentId
|
|
515
|
+
attribute: $attribute
|
|
516
|
+
value: $value
|
|
517
|
+
max: $max
|
|
518
|
+
transactionId: $transactionId
|
|
519
|
+
) {
|
|
520
|
+
_id
|
|
521
|
+
data
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
`);function Gs(){let{graphql:t}=i(),e=m();return {...p({mutationKey:[...a.databases().transactions().operations().key(),"incrementAttribute"],mutationFn:async({databaseId:r,collectionId:o,documentId:n,attribute:u,value:c,max:l,transactionId:y})=>{let{data:f,errors:q}=await t.mutation({query:H,variables:{databaseId:r,collectionId:o,documentId:n,attribute:u,value:c,max:l,transactionId:y}});if(q)throw q;return f.databasesIncrementDocumentAttribute},onMutate:async r=>{let o=a.database(r.databaseId).collection(r.collectionId).document(r.documentId).key();await e.cancelQueries({queryKey:o});let n=e.getQueriesData({queryKey:o});return e.setQueryData(o,u=>{if(!u)return u;let c=u[r.attribute]??0,l=r.value??1,y=r.max!=null?Math.min(c+l,r.max):c+l;return {...u,[r.attribute]:y}}),{previousEntries:n,documentKeyPrefix:o}},onError:(r,o,n)=>{if(n?.previousEntries)for(let[u,c]of n.previousEntries)e.setQueryData(u,c);},onSettled:(r,o,n)=>{e.invalidateQueries({queryKey:a.database(n.databaseId).collection(n.collectionId).key()});}})}}function js({databaseId:t,collectionId:e,queries:s,transactionId:r,limit:o=25,subscribe:n=true,fields:u}){let[c,l]=useState(1),[y,f]=useState([]),q=(c-1)*o,w=[...s,Query.limit(o),Query.offset(q)],g=E({databaseId:t,collectionId:e,queries:w,transactionId:r,subscribe:n,fields:u});useEffect(()=>{g.documents&&f(c===1?[...g.documents]:A=>{let T=(c-1)*o+g.documents.length;return A.length<T?[...A,...g.documents]:A});},[g.documents,c,o]);let b=g.total??0,C=b>0&&q+o<b,K=useCallback(()=>{C&&!g.isFetching&&l(A=>A+1);},[C,g.isFetching]),x=useCallback(()=>{f([]),l(1);},[]);return {documents:y,total:b,hasNextPage:C,fetchNextPage:K,isFetchingNextPage:c>1&&g.isFetching,isLoading:g.isLoading,isError:g.isError,error:g.error,isFetching:g.isFetching,reset:x}}var Ws=graphql(`
|
|
525
|
+
query ListTransactions($queries: String) {
|
|
526
|
+
databasesListTransactions(queries: $queries) {
|
|
527
|
+
total
|
|
528
|
+
transactions {
|
|
529
|
+
_id
|
|
530
|
+
_createdAt
|
|
531
|
+
_updatedAt
|
|
532
|
+
status
|
|
533
|
+
operations
|
|
534
|
+
expiresAt
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
`);function zs({queries:t}={},e={}){let{graphql:s}=i();return {...d({queryKey:[...a.databases().transactions().key(),...t?[t]:[]],queryFn:async()=>{let{data:o,errors:n}=await s.query({query:Ws,variables:{queries:t}});if(n)throw n;return o.databasesListTransactions},...e})}}function Y(t,e){if(typeof e=="function")return e(t);switch(e){case "last-write-wins":return X(t.base,t.local);case "server-wins":return "abort";case "merge-shallow":{let s=X(t.base,t.local),r=X(t.base,t.remote);return {...s,...r}}}}function X(t,e){let s={};for(let r of Object.keys(e))JSON.stringify(t[r])!==JSON.stringify(e[r])&&(s[r]=e[r]);return s}function k(t){return async(e,s,r)=>{let{databaseId:o,collectionId:n,documentId:u}=s,l=r.getMutationCache().getAll().find(b=>JSON.stringify(b.state.variables)===JSON.stringify(s))?.state.context?.baseSnapshot,y=s.data;if(l){let{data:b,errors:C}=await e.graphql.query({query:N,variables:{databaseId:o,collectionId:n,documentId:u}});if(C)throw C;let K=b.databasesGetDocument,x={...K,...K?JSON.parse(K.data):{}};delete x.data,delete x._id;let A={...l,...s.data},T=Y({base:l,remote:x,local:A,mutationKey:[o,n,u]},t);if(T==="abort")return await r.setQueryData(a.database(o).collection(n).document(u).key(),x),{_id:u};y=T;}let{data:f,errors:q}=await e.graphql.mutation({query:Z,variables:{...s,data:JSON.stringify(y.data??y)}}),w=y.data??y;delete s.data;let g={...l,...w,_id:u};if(await r.setQueryData(a.database(o).collection(n).document(u).key(),b=>b&&{...b,...g}),q)throw q;return f.databasesUpdateDocument}}var Z=graphql(`
|
|
539
|
+
mutation UpdateDocument(
|
|
540
|
+
$databaseId: String!
|
|
541
|
+
$collectionId: String!
|
|
542
|
+
$documentId: String!
|
|
543
|
+
$data: Json
|
|
544
|
+
$permissions: [String!]
|
|
545
|
+
$transactionId: String
|
|
546
|
+
) {
|
|
547
|
+
databasesUpdateDocument(
|
|
548
|
+
databaseId: $databaseId
|
|
549
|
+
collectionId: $collectionId
|
|
550
|
+
documentId: $documentId
|
|
551
|
+
data: $data
|
|
552
|
+
permissions: $permissions
|
|
553
|
+
transactionId: $transactionId
|
|
554
|
+
) {
|
|
555
|
+
_id
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
`);function Ys(){let t=i(),e=m();return {...p({mutationKey:a.databases().collections().documents().update(),mutationFn:async({databaseId:r,collectionId:o,documentId:n,data:u,permissions:c,transactionId:l},y)=>{let f=y.meta.willPerformOfflineMutation??false;if(y.meta.willPerformOfflineMutation!=null&&delete y.meta.willPerformOfflineMutation,f)try{return await k(y.meta.conflictStrategy)(t,{databaseId:r,collectionId:o,documentId:n,data:u,permissions:c,transactionId:l},e)}catch(g){throw console.error("Conflict-aware update failed:",g),g}let{data:q,errors:w}=await t.graphql.mutation({query:Z,variables:{databaseId:r,collectionId:o,documentId:n,data:JSON.stringify(u),permissions:c,transactionId:l}});if(w)throw w;return q.databasesUpdateDocument},onMutate:async(r,o)=>{let n=a.database(r.databaseId).collection(r.collectionId).document(r.documentId).key();await e.cancelQueries({queryKey:n});let u=e.getQueriesData({queryKey:n}),c=u.find(([,f])=>f!=null)?.[1],l=c?JSON.parse(JSON.stringify(c)):void 0;e.setQueryData(n,f=>f&&{...f,...r.data});let y=onlineManager.isOnline()===false;return o.meta={...o.meta,willPerformOfflineMutation:y},{previousEntries:u,documentKeyPrefix:n,baseSnapshot:l,willPerformOfflineMutation:y}},onError:(r,o,n)=>{if(n?.previousEntries)for(let[u,c]of n.previousEntries)e.setQueryData(u,c);},onSettled:(r,o,n)=>{e.invalidateQueries({queryKey:a.database(n.databaseId).collection(n.collectionId).key()});}})}}var en=graphql(`
|
|
559
|
+
mutation UpdateTransaction($transactionId: String!, $commit: Boolean, $rollback: Boolean) {
|
|
560
|
+
databasesUpdateTransaction(
|
|
561
|
+
transactionId: $transactionId
|
|
562
|
+
commit: $commit
|
|
563
|
+
rollback: $rollback
|
|
564
|
+
) {
|
|
565
|
+
_id
|
|
566
|
+
status
|
|
567
|
+
operations
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
`);function tn(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.databases().transactions().update(),mutationFn:async({transactionId:r,commit:o,rollback:n})=>{let{data:u,errors:c}=await t.mutation({query:en,variables:{transactionId:r,commit:o,rollback:n}});if(c)throw c;return u.databasesUpdateTransaction},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.databases().transaction(o.transactionId).key()}),e.invalidateQueries({queryKey:a.databases().transactions().key()});}})}}var ee=graphql(`
|
|
571
|
+
mutation UpsertDocument(
|
|
572
|
+
$databaseId: String!
|
|
573
|
+
$collectionId: String!
|
|
574
|
+
$documentId: String!
|
|
575
|
+
$data: Json!
|
|
576
|
+
$permissions: [String!]
|
|
577
|
+
$transactionId: String
|
|
578
|
+
) {
|
|
579
|
+
databasesUpsertDocument(
|
|
352
580
|
databaseId: $databaseId
|
|
353
581
|
collectionId: $collectionId
|
|
354
582
|
documentId: $documentId
|
|
583
|
+
data: $data
|
|
584
|
+
permissions: $permissions
|
|
585
|
+
transactionId: $transactionId
|
|
586
|
+
) {
|
|
587
|
+
_id
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
`);function sn(){let t=i(),e=m();return {...p({mutationKey:a.databases().collections().documents().upsert(),mutationFn:async({databaseId:r,collectionId:o,documentId:n,data:u,permissions:c,transactionId:l},y)=>{let f=y.meta.willPerformOfflineMutation??false;if(y.meta.willPerformOfflineMutation!=null&&delete y.meta.willPerformOfflineMutation,f)try{return await k(y.meta.conflictStrategy)(t,{databaseId:r,collectionId:o,documentId:n,data:u,permissions:c,transactionId:l},e)}catch(g){throw console.error("Conflict-aware update failed:",g),g}let{data:q,errors:w}=await t.graphql.mutation({query:ee,variables:{databaseId:r,collectionId:o,documentId:n,data:JSON.stringify(u),permissions:c,transactionId:l}});if(w)throw w;return q.databasesUpsertDocument},onMutate:async(r,o)=>{let n=a.database(r.databaseId).collection(r.collectionId).document(r.documentId).key();await e.cancelQueries({queryKey:n});let u=e.getQueriesData({queryKey:n}),c=u.find(([,f])=>f!=null)?.[1],l=c?JSON.parse(JSON.stringify(c)):void 0;e.setQueryData(n,f=>f&&{...f,...r.data});let y=onlineManager.isOnline()===false;return o.meta={...o.meta,willPerformOfflineMutation:y},{previousEntries:u,documentKeyPrefix:n,baseSnapshot:l,willPerformOfflineMutation:y}},onError:(r,o,n)=>{if(n?.previousEntries)for(let[u,c]of n.previousEntries)e.setQueryData(u,c);},onSettled:(r,o,n)=>{e.invalidateQueries({queryKey:a.database(n.databaseId).collection(n.collectionId).key()});}})}}var an=graphql(`
|
|
591
|
+
query GetLocale {
|
|
592
|
+
localeGet {
|
|
593
|
+
ip
|
|
594
|
+
countryCode
|
|
595
|
+
country
|
|
596
|
+
continentCode
|
|
597
|
+
continent
|
|
598
|
+
eu
|
|
599
|
+
currency
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
`);function un(){let{graphql:t}=i();return {...d({queryKey:a.locale().key(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:an});if(r)throw r;return s.localeGet}})}}var cn=graphql(`
|
|
603
|
+
query ListLocaleCodes {
|
|
604
|
+
localeListCodes {
|
|
605
|
+
total
|
|
606
|
+
localeCodes {
|
|
607
|
+
code
|
|
608
|
+
name
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
`);function mn(){let{graphql:t}=i();return {...d({queryKey:a.locale().codes(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:cn});if(r)throw r;return s.localeListCodes}})}}var yn=graphql(`
|
|
613
|
+
query ListContinents {
|
|
614
|
+
localeListContinents {
|
|
615
|
+
total
|
|
616
|
+
continents {
|
|
617
|
+
name
|
|
618
|
+
code
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
`);function fn(){let{graphql:t}=i();return {...d({queryKey:a.locale().continents(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:yn});if(r)throw r;return s.localeListContinents}})}}var hn=graphql(`
|
|
623
|
+
query ListCountries {
|
|
624
|
+
localeListCountries {
|
|
625
|
+
total
|
|
626
|
+
countries {
|
|
627
|
+
name
|
|
628
|
+
code
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
`);function gn(){let{graphql:t}=i();return {...d({queryKey:a.locale().countries(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:hn});if(r)throw r;return s.localeListCountries}})}}var bn=graphql(`
|
|
633
|
+
query ListCountriesEU {
|
|
634
|
+
localeListCountriesEU {
|
|
635
|
+
total
|
|
636
|
+
countries {
|
|
637
|
+
name
|
|
638
|
+
code
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
`);function wn(){let{graphql:t}=i();return {...d({queryKey:a.locale().countriesEU(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:bn});if(r)throw r;return s.localeListCountriesEU}})}}var xn=graphql(`
|
|
643
|
+
query ListCountriesPhones {
|
|
644
|
+
localeListCountriesPhones {
|
|
645
|
+
total
|
|
646
|
+
phones {
|
|
647
|
+
code
|
|
648
|
+
countryCode
|
|
649
|
+
countryName
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
`);function An(){let{graphql:t}=i();return {...d({queryKey:a.locale().countriesPhones(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:xn});if(r)throw r;return s.localeListCountriesPhones}})}}var Kn=graphql(`
|
|
654
|
+
query ListCurrencies {
|
|
655
|
+
localeListCurrencies {
|
|
656
|
+
total
|
|
657
|
+
currencies {
|
|
658
|
+
symbol
|
|
659
|
+
name
|
|
660
|
+
symbolNative
|
|
661
|
+
decimalDigits
|
|
662
|
+
rounding
|
|
663
|
+
code
|
|
664
|
+
namePlural
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
`);function On(){let{graphql:t}=i();return {...d({queryKey:a.locale().currencies(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:Kn});if(r)throw r;return s.localeListCurrencies}})}}var Tn=graphql(`
|
|
669
|
+
query ListLanguages {
|
|
670
|
+
localeListLanguages {
|
|
671
|
+
total
|
|
672
|
+
languages {
|
|
673
|
+
name
|
|
674
|
+
code
|
|
675
|
+
nativeName
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
`);function kn(){let{graphql:t}=i();return {...d({queryKey:a.locale().languages(),queryFn:async()=>{let{data:s,errors:r}=await t.query({query:Tn});if(r)throw r;return s.localeListLanguages}})}}var te=graphql(`
|
|
680
|
+
mutation CreateSubscriber($subscriberId: String!, $topicId: String!, $targetId: String!) {
|
|
681
|
+
messagingCreateSubscriber(subscriberId: $subscriberId, topicId: $topicId, targetId: $targetId) {
|
|
682
|
+
_id
|
|
683
|
+
_createdAt
|
|
684
|
+
_updatedAt
|
|
685
|
+
targetId
|
|
686
|
+
userId
|
|
687
|
+
userName
|
|
688
|
+
topicId
|
|
689
|
+
providerType
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
`);function En(){let{graphql:t}=i();return {...p({mutationKey:a.messaging().subscriber().create(),mutationFn:async({subscriberId:s,topicId:r,targetId:o})=>{let{data:n,errors:u}=await t.mutation({query:te,variables:{subscriberId:s,topicId:r,targetId:o}});if(u)throw u;return n?.messagingCreateSubscriber}})}}var re=graphql(`
|
|
693
|
+
mutation DeleteSubscriber($topicId: String!, $subscriberId: String!) {
|
|
694
|
+
messagingDeleteSubscriber(topicId: $topicId, subscriberId: $subscriberId) {
|
|
695
|
+
status
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
`);function vn(){let{graphql:t}=i();return {...p({mutationKey:a.messaging().subscriber().delete(),mutationFn:async({topicId:s,subscriberId:r})=>{let{data:o,errors:n}=await t.mutation({query:re,variables:{topicId:s,subscriberId:r}});if(n)throw n;return o?.messagingDeleteSubscriber??{status:""}}})}}var Vn=graphql(`
|
|
699
|
+
query GetFile($bucketId: String!, $fileId: String!) {
|
|
700
|
+
storageGetFile(bucketId: $bucketId, fileId: $fileId) {
|
|
701
|
+
_id
|
|
702
|
+
bucketId
|
|
703
|
+
_createdAt
|
|
704
|
+
_updatedAt
|
|
705
|
+
_permissions
|
|
706
|
+
name
|
|
707
|
+
signature
|
|
708
|
+
mimeType
|
|
709
|
+
sizeOriginal
|
|
710
|
+
chunksTotal
|
|
711
|
+
chunksUploaded
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
`);function $n({bucketId:t,fileId:e}){let{graphql:s}=i();return {...d({queryKey:a.bucket(t).file(e).key(),queryFn:async()=>{let{data:o,errors:n}=await s.query({query:Vn,variables:{bucketId:t,fileId:e}});if(n)throw n;return o.storageGetFile}})}}function Pn({bucketId:t,fileId:e,token:s}){let{storage:r}=i();return useMemo(()=>r?.getFileDownload({bucketId:t,fileId:e,token:s}),[r,t,e,s])}function Un({bucketId:t,fileId:e,width:s,height:r,gravity:o,quality:n,borderWidth:u,borderColor:c,borderRadius:l,opacity:y,rotation:f,background:q,output:w,token:g}){let{storage:b}=i();return useMemo(()=>b?.getFilePreview({bucketId:t,fileId:e,width:s,height:r,gravity:o,quality:n,borderWidth:u,borderColor:c,borderRadius:l,opacity:y,rotation:f,background:q,output:w,token:g}),[b,t,e,s,r,o,n,u,c,l,y,f,q,w,g])}function _n({bucketId:t,fileId:e,token:s}){let{storage:r}=i();return useMemo(()=>r?.getFileView({bucketId:t,fileId:e,token:s}),[r,t,e,s])}var Gn=graphql(`
|
|
715
|
+
query ListFiles($bucketId: String!, $queries: [String!], $search: String) {
|
|
716
|
+
storageListFiles(bucketId: $bucketId, queries: $queries, search: $search) {
|
|
717
|
+
total
|
|
718
|
+
files {
|
|
719
|
+
_id
|
|
720
|
+
bucketId
|
|
721
|
+
_createdAt
|
|
722
|
+
_updatedAt
|
|
723
|
+
_permissions
|
|
724
|
+
name
|
|
725
|
+
signature
|
|
726
|
+
mimeType
|
|
727
|
+
sizeOriginal
|
|
728
|
+
chunksTotal
|
|
729
|
+
chunksUploaded
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
`);function Bn({bucketId:t,queries:e,search:s}){let{graphql:r}=i();return {...d({queryKey:[...a.bucket(t).files().key(),...e??[],...s?[s]:[]],queryFn:async()=>{let{data:n,errors:u}=await r.query({query:Gn,variables:{bucketId:t,queries:e,search:s}});if(u)throw u;return n.storageListFiles}})}}function jn(){let{storage:t}=i(),e=m();return {...p({mutationKey:a.buckets().files().create(),mutationFn:async({bucketId:r,fileId:o,file:n,permissions:u,onProgress:c})=>t.createFile({bucketId:r,fileId:o,file:n,permissions:u,onProgress:c}),onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.bucket(o.bucketId).files().key()});}})}}var Wn=graphql(`
|
|
734
|
+
mutation UpdateFile(
|
|
735
|
+
$bucketId: String!
|
|
736
|
+
$fileId: String!
|
|
737
|
+
$name: String
|
|
738
|
+
$permissions: [String!]
|
|
739
|
+
) {
|
|
740
|
+
storageUpdateFile(
|
|
741
|
+
bucketId: $bucketId
|
|
742
|
+
fileId: $fileId
|
|
743
|
+
name: $name
|
|
744
|
+
permissions: $permissions
|
|
355
745
|
) {
|
|
356
746
|
_id
|
|
747
|
+
bucketId
|
|
748
|
+
name
|
|
749
|
+
_permissions
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
`);function zn(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.buckets().files().update(),mutationFn:async({bucketId:r,fileId:o,name:n,permissions:u})=>{let{data:c,errors:l}=await t.mutation({query:Wn,variables:{bucketId:r,fileId:o,name:n,permissions:u}});if(l)throw l;return c.storageUpdateFile},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.bucket(o.bucketId).files().key()});}})}}var Xn=graphql(`
|
|
753
|
+
mutation DeleteFile($bucketId: String!, $fileId: String!) {
|
|
754
|
+
storageDeleteFile(bucketId: $bucketId, fileId: $fileId) {
|
|
755
|
+
status
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
`);function Yn(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.buckets().files().delete(),mutationFn:async({bucketId:r,fileId:o})=>{let{data:n,errors:u}=await t.mutation({query:Xn,variables:{bucketId:r,fileId:o}});if(u)throw u;return n?.storageDeleteFile??{status:""}},onSuccess:(r,o)=>{e.removeQueries({queryKey:a.bucket(o.bucketId).file(o.fileId).key()}),e.invalidateQueries({queryKey:a.bucket(o.bucketId).files().key()});}})}}var ea=graphql(`
|
|
759
|
+
query GetTeam($teamId: String!) {
|
|
760
|
+
teamsGet(teamId: $teamId) {
|
|
761
|
+
_id
|
|
762
|
+
_createdAt
|
|
763
|
+
_updatedAt
|
|
764
|
+
name
|
|
765
|
+
total
|
|
766
|
+
prefs {
|
|
767
|
+
data
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
`);function oe(t,{teamId:e}){return {queryKey:a.team(e).key(),queryFn:async()=>{let{data:s,errors:r}=await t.graphql.query({query:ea,variables:{teamId:e}});if(r)throw r;return s.teamsGet}}}function ta({teamId:t},e={}){let s=i();return {...d({...oe(s,{teamId:t}),...e})}}var oa=graphql(`
|
|
772
|
+
query ListTeams($queries: [String!], $search: String) {
|
|
773
|
+
teamsList(queries: $queries, search: $search) {
|
|
774
|
+
total
|
|
775
|
+
teams {
|
|
776
|
+
_id
|
|
777
|
+
_createdAt
|
|
778
|
+
_updatedAt
|
|
779
|
+
name
|
|
780
|
+
total
|
|
781
|
+
prefs {
|
|
782
|
+
data
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
`);function sa({queries:t,search:e}={},s={}){let{graphql:r}=i();return {...d({queryKey:[...a.teams().key(),...t??[],...e?[e]:[]],queryFn:async()=>{let{data:n,errors:u}=await r.query({query:oa,variables:{queries:t,search:e}});if(u)throw u;return n.teamsList},...s})}}var aa=graphql(`
|
|
788
|
+
query GetTeamPrefs($teamId: String!) {
|
|
789
|
+
teamsGetPrefs(teamId: $teamId) {
|
|
790
|
+
data
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
`);function ia({teamId:t},e={}){let{graphql:s}=i();return {...d({queryKey:a.team(t).teamPrefs().key(),queryFn:async()=>{let{data:o,errors:n}=await s.query({query:aa,variables:{teamId:t}});if(n)throw n;return o.teamsGetPrefs},...e})}}var pa=graphql(`
|
|
794
|
+
query GetMembership($teamId: String!, $membershipId: String!) {
|
|
795
|
+
teamsGetMembership(teamId: $teamId, membershipId: $membershipId) {
|
|
796
|
+
_id
|
|
797
|
+
_createdAt
|
|
798
|
+
_updatedAt
|
|
799
|
+
userId
|
|
800
|
+
userName
|
|
801
|
+
userEmail
|
|
802
|
+
teamId
|
|
803
|
+
teamName
|
|
804
|
+
invited
|
|
805
|
+
joined
|
|
806
|
+
confirm
|
|
807
|
+
mfa
|
|
808
|
+
roles
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
`);function ca({teamId:t,membershipId:e},s={}){let{graphql:r}=i();return {...d({queryKey:a.team(t).membership(e).key(),queryFn:async()=>{let{data:n,errors:u}=await r.query({query:pa,variables:{teamId:t,membershipId:e}});if(u)throw u;return n.teamsGetMembership},...s})}}var la=graphql(`
|
|
812
|
+
query ListMemberships($teamId: String!, $queries: [String!], $search: String) {
|
|
813
|
+
teamsListMemberships(teamId: $teamId, queries: $queries, search: $search) {
|
|
814
|
+
total
|
|
815
|
+
memberships {
|
|
816
|
+
_id
|
|
817
|
+
_createdAt
|
|
818
|
+
_updatedAt
|
|
819
|
+
userId
|
|
820
|
+
userName
|
|
821
|
+
userEmail
|
|
822
|
+
teamId
|
|
823
|
+
teamName
|
|
824
|
+
invited
|
|
825
|
+
joined
|
|
826
|
+
confirm
|
|
827
|
+
mfa
|
|
828
|
+
roles
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
`);function ya({teamId:t,queries:e,search:s},r={}){let{graphql:o}=i();return {...d({queryKey:[...a.team(t).memberships().key(),...e??[],...s?[s]:[]],queryFn:async()=>{let{data:u,errors:c}=await o.query({query:la,variables:{teamId:t,queries:e,search:s}});if(c)throw c;return u.teamsListMemberships},...r})}}var se=graphql(`
|
|
833
|
+
mutation CreateTeam($teamId: String!, $name: String!, $roles: [String!]) {
|
|
834
|
+
teamsCreate(teamId: $teamId, name: $name, roles: $roles) {
|
|
835
|
+
_id
|
|
836
|
+
name
|
|
837
|
+
total
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
`);function da(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().create(),mutationFn:async({teamId:r,name:o,roles:n})=>{let{data:u,errors:c}=await t.mutation({query:se,variables:{teamId:r,name:o,roles:n}});if(c)throw c;return u.teamsCreate},onSuccess:()=>{e.invalidateQueries({queryKey:a.teams().key()});}})}}var ne=graphql(`
|
|
841
|
+
mutation UpdateTeamName($teamId: String!, $name: String!) {
|
|
842
|
+
teamsUpdateName(teamId: $teamId, name: $name) {
|
|
843
|
+
_id
|
|
844
|
+
name
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
`);function ga(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().teamName().update(),mutationFn:async({teamId:r,name:o})=>{let{data:n,errors:u}=await t.mutation({query:ne,variables:{teamId:r,name:o}});if(u)throw u;return n.teamsUpdateName},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.team(o.teamId).key()}),e.invalidateQueries({queryKey:a.teams().key()});}})}}var ae=graphql(`
|
|
848
|
+
mutation UpdateTeamPrefs($teamId: String!, $prefs: Assoc!) {
|
|
849
|
+
teamsUpdatePrefs(teamId: $teamId, prefs: $prefs) {
|
|
357
850
|
data
|
|
358
851
|
}
|
|
359
852
|
}
|
|
360
|
-
`);function
|
|
853
|
+
`);function ba(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().teamPrefs().update(),mutationFn:async({teamId:r,prefs:o})=>{let{data:n,errors:u}=await t.mutation({query:ae,variables:{teamId:r,prefs:o}});if(u)throw u;return n.teamsUpdatePrefs},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.team(o.teamId).key()});}})}}var ie=graphql(`
|
|
854
|
+
mutation DeleteTeam($teamId: String!) {
|
|
855
|
+
teamsDelete(teamId: $teamId) {
|
|
856
|
+
status
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
`);function Ra(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().delete(),mutationFn:async({teamId:r})=>{let{data:o,errors:n}=await t.mutation({query:ie,variables:{teamId:r}});if(n)throw n;return o?.teamsDelete??{status:""}},onSuccess:(r,o)=>{e.removeQueries({queryKey:a.team(o.teamId).key()}),e.invalidateQueries({queryKey:a.teams().key()});}})}}var ue=graphql(`
|
|
860
|
+
mutation CreateMembership(
|
|
861
|
+
$teamId: String!
|
|
862
|
+
$roles: [String!]!
|
|
863
|
+
$email: String
|
|
864
|
+
$userId: String
|
|
865
|
+
$phone: String
|
|
866
|
+
$url: String
|
|
867
|
+
$name: String
|
|
868
|
+
) {
|
|
869
|
+
teamsCreateMembership(
|
|
870
|
+
teamId: $teamId
|
|
871
|
+
roles: $roles
|
|
872
|
+
email: $email
|
|
873
|
+
userId: $userId
|
|
874
|
+
phone: $phone
|
|
875
|
+
url: $url
|
|
876
|
+
name: $name
|
|
877
|
+
) {
|
|
878
|
+
_id
|
|
879
|
+
userId
|
|
880
|
+
teamId
|
|
881
|
+
roles
|
|
882
|
+
confirm
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
`);function Aa(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().memberships().create(),mutationFn:async({teamId:r,roles:o,email:n,userId:u,phone:c,url:l,name:y})=>{let{data:f,errors:q}=await t.mutation({query:ue,variables:{teamId:r,roles:o,email:n,userId:u,phone:c,url:l,name:y}});if(q)throw q;return f.teamsCreateMembership},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.team(o.teamId).memberships().key()}),e.invalidateQueries({queryKey:a.team(o.teamId).key()});}})}}var pe=graphql(`
|
|
886
|
+
mutation UpdateMembership($teamId: String!, $membershipId: String!, $roles: [String!]!) {
|
|
887
|
+
teamsUpdateMembership(teamId: $teamId, membershipId: $membershipId, roles: $roles) {
|
|
888
|
+
_id
|
|
889
|
+
roles
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
`);function Ka(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().memberships().update(),mutationFn:async({teamId:r,membershipId:o,roles:n})=>{let{data:u,errors:c}=await t.mutation({query:pe,variables:{teamId:r,membershipId:o,roles:n}});if(c)throw c;return u.teamsUpdateMembership},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.team(o.teamId).memberships().key()});}})}}var Sa=graphql(`
|
|
893
|
+
mutation UpdateMembershipStatus(
|
|
894
|
+
$teamId: String!
|
|
895
|
+
$membershipId: String!
|
|
896
|
+
$userId: String!
|
|
897
|
+
$secret: String!
|
|
898
|
+
) {
|
|
899
|
+
teamsUpdateMembershipStatus(
|
|
900
|
+
teamId: $teamId
|
|
901
|
+
membershipId: $membershipId
|
|
902
|
+
userId: $userId
|
|
903
|
+
secret: $secret
|
|
904
|
+
) {
|
|
905
|
+
_id
|
|
906
|
+
confirm
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
`);function Ta(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().membershipStatus().update(),mutationFn:async({teamId:r,membershipId:o,userId:n,secret:u})=>{let{data:c,errors:l}=await t.mutation({query:Sa,variables:{teamId:r,membershipId:o,userId:n,secret:u}});if(l)throw l;return c.teamsUpdateMembershipStatus},onSuccess:(r,o)=>{e.invalidateQueries({queryKey:a.team(o.teamId).memberships().key()});}})}}var ce=graphql(`
|
|
910
|
+
mutation DeleteMembership($teamId: String!, $membershipId: String!) {
|
|
911
|
+
teamsDeleteMembership(teamId: $teamId, membershipId: $membershipId) {
|
|
912
|
+
status
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
`);function Da(){let{graphql:t}=i(),e=m();return {...p({mutationKey:a.teams().memberships().delete(),mutationFn:async({teamId:r,membershipId:o})=>{let{data:n,errors:u}=await t.mutation({query:ce,variables:{teamId:r,membershipId:o}});if(u)throw u;return n?.teamsDeleteMembership??{status:""}},onSuccess:(r,o)=>{e.removeQueries({queryKey:a.team(o.teamId).membership(o.membershipId).key()}),e.invalidateQueries({queryKey:a.team(o.teamId).memberships().key()}),e.invalidateQueries({queryKey:a.team(o.teamId).key()});}})}}var me=class t{queries=[];equal(e,s){return this.queries.push(Query.equal(e,s)),this}notEqual(e,s){return this.queries.push(Query.notEqual(e,s)),this}regex(e,s){return this.queries.push(Query.regex(e,s)),this}lessThan(e,s){return this.queries.push(Query.lessThan(e,s)),this}lessThanEqual(e,s){return this.queries.push(Query.lessThanEqual(e,s)),this}greaterThan(e,s){return this.queries.push(Query.greaterThan(e,s)),this}greaterThanEqual(e,s){return this.queries.push(Query.greaterThanEqual(e,s)),this}isNull(e){return this.queries.push(Query.isNull(e)),this}isNotNull(e){return this.queries.push(Query.isNotNull(e)),this}exists(e){return this.queries.push(Query.exists(e)),this}notExists(e){return this.queries.push(Query.notExists(e)),this}between(e,s,r){return this.queries.push(Query.between(e,s,r)),this}startsWith(e,s){return this.queries.push(Query.startsWith(e,s)),this}endsWith(e,s){return this.queries.push(Query.endsWith(e,s)),this}select(e){return this.queries.push(Query.select(e)),this}search(e,s){return this.queries.push(Query.search(e,s)),this}orderAsc(e){return this.queries.push(Query.orderAsc(e)),this}orderDesc(e){return this.queries.push(Query.orderDesc(e)),this}orderRandom(){return this.queries.push(Query.orderRandom()),this}cursorAfter(e){return this.queries.push(Query.cursorAfter(e)),this}cursorBefore(e){return this.queries.push(Query.cursorBefore(e)),this}limit(e){return this.queries.push(Query.limit(e)),this}offset(e){return this.queries.push(Query.offset(e)),this}contains(e,s){return this.queries.push(Query.contains(e,s)),this}containsAny(e,s){return this.queries.push(Query.containsAny(e,s)),this}containsAll(e,s){return this.queries.push(Query.containsAll(e,s)),this}notContains(e,s){return this.queries.push(Query.notContains(e,s)),this}notSearch(e,s){return this.queries.push(Query.notSearch(e,s)),this}notBetween(e,s,r){return this.queries.push(Query.notBetween(e,s,r)),this}notStartsWith(e,s){return this.queries.push(Query.notStartsWith(e,s)),this}notEndsWith(e,s){return this.queries.push(Query.notEndsWith(e,s)),this}createdBefore(e){return this.queries.push(Query.createdBefore(e)),this}createdAfter(e){return this.queries.push(Query.createdAfter(e)),this}createdBetween(e,s){return this.queries.push(Query.createdBetween(e,s)),this}updatedBefore(e){return this.queries.push(Query.updatedBefore(e)),this}updatedAfter(e){return this.queries.push(Query.updatedAfter(e)),this}updatedBetween(e,s){return this.queries.push(Query.updatedBetween(e,s)),this}or(...e){let s=e.map(r=>r(new t).queries).flat();return this.queries.push(Query.or(s)),this}and(...e){let s=e.map(r=>r(new t).queries).flat();return this.queries.push(Query.and(s)),this}elemMatch(e,s){return this.queries.push(Query.elemMatch(e,s.queries)),this}distanceEqual(e,s,r,o,n=true){return this.queries.push(Query.distanceEqual(e,[s,r],o,n)),this}distanceNotEqual(e,s,r,o,n=true){return this.queries.push(Query.distanceNotEqual(e,[s,r],o,n)),this}distanceGreaterThan(e,s,r,o,n=true){return this.queries.push(Query.distanceGreaterThan(e,[s,r],o,n)),this}distanceLessThan(e,s,r,o,n=true){return this.queries.push(Query.distanceLessThan(e,[s,r],o,n)),this}intersects(e,s){return this.queries.push(Query.intersects(e,s)),this}notIntersects(e,s){return this.queries.push(Query.notIntersects(e,s)),this}crosses(e,s){return this.queries.push(Query.crosses(e,s)),this}notCrosses(e,s){return this.queries.push(Query.notCrosses(e,s)),this}overlaps(e,s){return this.queries.push(Query.overlaps(e,s)),this}notOverlaps(e,s){return this.queries.push(Query.notOverlaps(e,s)),this}touches(e,s){return this.queries.push(Query.touches(e,s)),this}notTouches(e,s){return this.queries.push(Query.notTouches(e,s)),this}build(){return [...this.queries]}};function yw(){return new me}function D(){}function Ge(t){let e;if(t.then(s=>(e=s,s),D)?.catch(D),e!==void 0)return {data:e}}function Be(t){return t}function Ea(t){return {mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function Ia(t,e,s){let r=()=>{let o=t.promise?.then(e).catch(n=>s(n)?(process.env.NODE_ENV!=="production"&&console.error(`A query that was dehydrated as pending ended up rejecting. [${t.queryHash}]: ${n}; The error will be redacted in production builds`),Promise.reject(new Error("redacted"))):Promise.reject(n));return o?.catch(D),o};return {dehydratedAt:Date.now(),state:{...t.state,...t.state.data!==void 0&&{data:e(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,...t.state.status==="pending"&&{promise:r()},...t.meta&&{meta:t.meta}}}function je(t){return t.state.isPaused}function Je(t){return t.state.status==="success"}function va(t){return true}function le(t,e={}){let s=e.shouldDehydrateMutation??t.getDefaultOptions().dehydrate?.shouldDehydrateMutation??je,r=t.getMutationCache().getAll().flatMap(l=>s(l)?[Ea(l)]:[]),o=e.shouldDehydrateQuery??t.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Je,n=e.shouldRedactErrors??t.getDefaultOptions().dehydrate?.shouldRedactErrors??va,u=e.serializeData??t.getDefaultOptions().dehydrate?.serializeData??Be,c=t.getQueryCache().getAll().flatMap(l=>o(l)?[Ia(l,u,n)]:[]);return {mutations:r,queries:c}}function ye(t,e,s){if(typeof e!="object"||e===null)return;let r=t.getMutationCache(),o=t.getQueryCache(),n=s?.defaultOptions?.deserializeData??t.getDefaultOptions().hydrate?.deserializeData??Be,u=e.mutations||[],c=e.queries||[];u.forEach(({state:l,...y})=>{r.build(t,{...t.getDefaultOptions().hydrate?.mutations,...s?.defaultOptions?.mutations,...y},l);}),c.forEach(({queryKey:l,state:y,queryHash:f,meta:q,promise:w,dehydratedAt:g})=>{let b=w?Ge(w):void 0,C=y.data===void 0?b?.data:y.data,K=C===void 0?C:n(C),x=o.get(f),A=x?.state.status==="pending",T=x?.state.fetchStatus==="fetching";if(x){let tt=b&&g!==void 0&&g>x.state.dataUpdatedAt;if(y.dataUpdatedAt>x.state.dataUpdatedAt||tt){let{fetchStatus:za,...rt}=y;x.setState({...rt,data:K});}}else x=o.build(t,{...t.getDefaultOptions().hydrate?.queries,...s?.defaultOptions?.queries,queryKey:l,queryHash:f,meta:q},{...y,data:K,fetchStatus:"idle",status:K!==void 0?"success":y.status});w&&!A&&!T&&(g===void 0||g>x.state.dataUpdatedAt)&&x.fetch(void 0,{initialPromise:Promise.resolve(w).then(n)}).catch(D);});}var Qa=["added","removed","updated"];function We(t){return Qa.includes(t)}async function Va({queryClient:t,persister:e,maxAge:s=1e3*60*60*24,buster:r="",hydrateOptions:o}){try{let n=await e.restoreClient();if(n)if(n.timestamp){let u=Date.now()-n.timestamp>s,c=n.buster!==r;if(u||c)return e.removeClient();ye(t,n.clientState,o);}else return e.removeClient()}catch(n){throw process.env.NODE_ENV!=="production"&&(console.error(n),console.warn("Encountered an error attempting to restore client cache from persisted location. As a precaution, the persisted cache will be discarded.")),await e.removeClient(),n}}async function ze({queryClient:t,persister:e,buster:s="",dehydrateOptions:r}){let o={buster:s,timestamp:Date.now(),clientState:le(t,r)};await e.persistClient(o);}function $a(t){let e=t.queryClient.getQueryCache().subscribe(r=>{We(r.type)&&ze(t);}),s=t.queryClient.getMutationCache().subscribe(r=>{We(r.type)&&ze(t);});return ()=>{e(),s();}}function He(t){let e=false,s,r=()=>{e=true,s?.();},o=Va(t).then(()=>{e||(s=$a(t));});return [r,o]}function R(t,e,s){return async(r,o)=>{let n=s?.serializeData?{...o,data:JSON.stringify(o.data)}:o,{data:u,errors:c}=await r.graphql.mutation({query:t,variables:n});if(c)throw c;return u[e]}}var Xe=[{mutationKey:a.databases().collections().documents().create(),mutationFn:R(J,"databasesCreateDocument",{serializeData:true})},{mutationKey:a.databases().collections().documents().delete(),mutationFn:R(z,"databasesDeleteDocument")},{mutationKey:a.databases().collections().documents().upsert(),mutationFn:R(ee,"databasesUpsertDocument",{serializeData:true})},{mutationKey:[...a.databases().transactions().operations().key(),"incrementAttribute"],mutationFn:R(H,"databasesIncrementDocumentAttribute")},{mutationKey:[...a.databases().transactions().operations().key(),"decrementAttribute"],mutationFn:R(W,"databasesDecrementDocumentAttribute")},{mutationKey:a.account().prefs().update(),mutationFn:R(L,"accountUpdatePrefs")},{mutationKey:a.account().name().update(),mutationFn:R(P,"accountUpdateName")},{mutationKey:a.account().email().update(),mutationFn:R(M,"accountUpdateEmail")},{mutationKey:a.account().password().update(),mutationFn:R(F,"accountUpdatePassword")},{mutationKey:a.account().phone().update(),mutationFn:R(U,"accountUpdatePhone")},{mutationKey:a.teams().create(),mutationFn:R(se,"teamsCreate")},{mutationKey:a.teams().delete(),mutationFn:R(ie,"teamsDelete")},{mutationKey:a.teams().teamName().update(),mutationFn:R(ne,"teamsUpdateName")},{mutationKey:a.teams().teamPrefs().update(),mutationFn:R(ae,"teamsUpdatePrefs")},{mutationKey:a.teams().memberships().create(),mutationFn:R(ue,"teamsCreateMembership")},{mutationKey:a.teams().memberships().delete(),mutationFn:R(ce,"teamsDeleteMembership")},{mutationKey:a.teams().memberships().update(),mutationFn:R(pe,"teamsUpdateMembership")},{mutationKey:a.messaging().subscriber().create(),mutationFn:R(te,"messagingCreateSubscriber")},{mutationKey:a.messaging().subscriber().delete(),mutationFn:R(re,"messagingDeleteSubscriber")}];function fe(t,e,s){for(let o of Xe)t.setMutationDefaults(o.mutationKey,{mutationFn:n=>o.mutationFn(e,n,t),scope:{id:"appwrite"}});let r=s?.conflictStrategy??"last-write-wins";t.setMutationDefaults(a.databases().collections().documents().update(),{mutationFn:o=>k(r)(e,o,t),scope:{id:"appwrite"}});}var Ua={shouldDehydrateMutation:t=>t.state.isPaused,shouldDehydrateQuery:t=>t.state.status==="success"};function La({endpoint:t,projectId:e,storage:s,persister:r,networkAdapter:o,throttleTime:n=1e3,conflictStrategy:u="last-write-wins"}){if(s&&r)throw new Error("Provide either `storage` or `persister`, not both.");let c=V({endpoint:t,projectId:e}),l=new QueryClient({defaultOptions:{mutations:{networkMode:"offlineFirst",meta:{conflictStrategy:u}},queries:{networkMode:"offlineFirst",gcTime:1e3*60*60*24}}});fe(l,c,{conflictStrategy:u});let y=r??(s?createAsyncStoragePersister({storage:s,key:"appwrite-graphql-offline-cache",throttleTime:n}):void 0);return o.listen(f=>{onlineManager.setOnline(f);}),{appwrite:c,queryClient:l,persister:y,startPersistence(){if(!y)throw new Error("No persister configured. Provide `storage` or `persister` to createOfflineClient.");let[f,q]=He({queryClient:l,persister:y,dehydrateOptions:Ua}),w=q.then(()=>{l.resumePausedMutations();});return {unsubscribe:f,restored:w}}}}function _a(){return {listen:t=>{let e=()=>{t(navigator.onLine);};return window.addEventListener("online",e),window.addEventListener("offline",e),t(navigator.onLine),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e);}}}}var et=graphql(`
|
|
361
916
|
mutation CreateExecution(
|
|
362
917
|
$functionId: String!
|
|
363
918
|
$body: String
|
|
364
919
|
$async: Boolean
|
|
365
920
|
$path: String
|
|
366
|
-
$method: String
|
|
921
|
+
$method: String
|
|
922
|
+
$headers: String
|
|
923
|
+
$scheduledAt: String
|
|
367
924
|
) {
|
|
368
925
|
functionsCreateExecution(
|
|
369
926
|
functionId: $functionId
|
|
370
927
|
body: $body
|
|
371
928
|
async: $async
|
|
372
929
|
path: $path
|
|
373
|
-
method: $method
|
|
930
|
+
method: $method
|
|
931
|
+
headers: $headers
|
|
932
|
+
scheduledAt: $scheduledAt
|
|
374
933
|
) {
|
|
375
934
|
_id
|
|
376
935
|
status
|
|
@@ -380,7 +939,7 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
380
939
|
duration
|
|
381
940
|
}
|
|
382
941
|
}
|
|
383
|
-
`),
|
|
942
|
+
`),Na=graphql(`
|
|
384
943
|
query GetFunctionExecution($functionId: String!, $executionId: String!) {
|
|
385
944
|
functionsGetExecution(functionId: $functionId, executionId: $executionId) {
|
|
386
945
|
status
|
|
@@ -390,66 +949,42 @@ function Oe(e,a){return a}var U={kind:"Document",definitions:[{kind:"FragmentDef
|
|
|
390
949
|
requestPath
|
|
391
950
|
}
|
|
392
951
|
}
|
|
393
|
-
`);function
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
exports.useQuery = m;
|
|
432
|
-
exports.useQueryClient = l;
|
|
433
|
-
exports.useResetPassword = st;
|
|
434
|
-
exports.useSignUp = dt;
|
|
435
|
-
exports.useSuspenseCollection = Rt;
|
|
436
|
-
exports.useSuspenseCreateJWT = fn;
|
|
437
|
-
exports.useSuspenseFunction = Ru;
|
|
438
|
-
exports.useSuspenseQuery = f;
|
|
439
|
-
exports.useUpdateDocument = Kt;
|
|
440
|
-
exports.useUpdateEmail = pt;
|
|
441
|
-
exports.useUpdateMagicURLSession = yt;
|
|
442
|
-
exports.useUpdateMfa = kt;
|
|
443
|
-
exports.useUpdateMfaAuthenticator = gt;
|
|
444
|
-
exports.useUpdateMfaChallenge = bt;
|
|
445
|
-
exports.useUpdateMfaRecoveryCodes = Nt;
|
|
446
|
-
exports.useUpdateName = xt;
|
|
447
|
-
exports.useUpdatePassword = Ct;
|
|
448
|
-
exports.useUpdatePhone = At;
|
|
449
|
-
exports.useUpdatePhoneSession = ht;
|
|
450
|
-
exports.useUpdatePhoneVerification = Ut;
|
|
451
|
-
exports.useUpdatePrefs = Vt;
|
|
452
|
-
exports.useUpdateSession = _t;
|
|
453
|
-
exports.useVerification = Et;
|
|
454
|
-
//# sourceMappingURL=out.js.map
|
|
952
|
+
`);function Ga({currentExecution:t,currentFunction:e}){let{graphql:s}=i(),r=!!e&&!!t;return {...d({queryKey:r?a.function(e).execution(t).key():a.functions().key(),queryFn:async()=>{if(!t||!e)return null;let{data:n}=await s.query({query:Na,variables:{functionId:e,executionId:t}});if(!n?.functionsGetExecution)throw new Error("Execution not found");return n.functionsGetExecution??null},enabled:r})}}function fR(){let{graphql:t}=i(),[e,s]=useState(null),[r,o]=useState(null),n=Ga({currentExecution:e,currentFunction:r});return {executeFunction:p({mutationKey:a.functions().executions().create(),mutationFn:async({functionId:c,body:l={},async:y=false,path:f="/",method:q="POST",headers:w={},scheduledAt:g})=>{o(c);let{data:b}=await t.mutation({query:et,variables:{functionId:c,body:JSON.stringify(l),async:y,path:f,method:q,headers:JSON.stringify(w),scheduledAt:g}}),{_id:C,status:K,errors:x,responseBody:A}=b.functionsCreateExecution??{};if(K==="failed")throw new Error(x);if(s(C??null),typeof A=="string"){if(A.trim().startsWith("{")&&A.trim().endsWith("}"))try{return JSON.parse(A)}catch(T){return console.error("Failed to parse response body:",T),A}return A}}}),currentExecution:n}}function dR({functionId:t,body:e={},async:s=false,path:r="/",method:o="POST",headers:n={},scheduledAt:u}){let{graphql:c}=i();return {executeFunction:S({queryKey:[...a.function(t).key(),"execute",{path:r,method:o,body:e}],queryFn:async()=>{let{data:y}=await c.mutation({query:et,variables:{functionId:t,body:JSON.stringify(e),async:s,path:r,method:o,headers:JSON.stringify(n),scheduledAt:u}});if(y?.functionsCreateExecution?.status==="failed")throw new Error(y.functionsCreateExecution.errors);let{responseBody:f}=y.functionsCreateExecution??{};if(typeof f=="string"&&f.trim().startsWith("{")&&f.trim().endsWith("}"))try{return JSON.parse(f)}catch(q){return console.error("Failed to parse response body:",q),f}return f},staleTime:1/0})}}var ja=graphql(`
|
|
953
|
+
query GetExecution($functionId: String!, $executionId: String!) {
|
|
954
|
+
functionsGetExecution(functionId: $functionId, executionId: $executionId) {
|
|
955
|
+
_id
|
|
956
|
+
_createdAt
|
|
957
|
+
_updatedAt
|
|
958
|
+
functionId
|
|
959
|
+
trigger
|
|
960
|
+
status
|
|
961
|
+
requestMethod
|
|
962
|
+
requestPath
|
|
963
|
+
responseStatusCode
|
|
964
|
+
responseBody
|
|
965
|
+
errors
|
|
966
|
+
duration
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
`);function RR({functionId:t,executionId:e},s={}){let{graphql:r}=i();return {...d({queryKey:a.function(t).execution(e).key(),queryFn:async()=>{let{data:n,errors:u}=await r.query({query:ja,variables:{functionId:t,executionId:e}});if(u)throw u;return n.functionsGetExecution},...s})}}var Wa=graphql(`
|
|
970
|
+
query ListExecutions($functionId: String!, $queries: [String!]) {
|
|
971
|
+
functionsListExecutions(functionId: $functionId, queries: $queries) {
|
|
972
|
+
total
|
|
973
|
+
executions {
|
|
974
|
+
_id
|
|
975
|
+
_createdAt
|
|
976
|
+
_updatedAt
|
|
977
|
+
functionId
|
|
978
|
+
trigger
|
|
979
|
+
status
|
|
980
|
+
requestMethod
|
|
981
|
+
requestPath
|
|
982
|
+
responseStatusCode
|
|
983
|
+
responseBody
|
|
984
|
+
errors
|
|
985
|
+
duration
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
`);function SR({functionId:t,queries:e},s={}){let{graphql:r}=i();return {...d({queryKey:[...a.function(t).executions().key(),...e??[]],queryFn:async()=>{let{data:n,errors:u}=await r.query({query:Wa,variables:{functionId:t,queries:e}});if(u)throw u;return n.functionsListExecutions},...s})}}export{it as AppwriteProvider,a as Keys,me as QueryBuilder,V as createAppwriteClient,La as createOfflineClient,$ as getAccountQuery,B as getCollectionQuery,G as getDocumentQuery,fe as hydrateMutationDefaults,Xe as mutationRegistry,yw as q,Y as resolveConflict,oe as teamQueryOptions,At as useAccount,i as useAppwrite,Yo as useAvatarBrowser,es as useAvatarCreditCard,rs as useAvatarFavicon,ss as useAvatarFlag,as as useAvatarImage,us as useAvatarInitials,cs as useAvatarQR,ls as useAvatarScreenshot,E as useCollection,bs as useCollectionWithPagination,Ot as useCreateAnonymousSession,xs as useCreateDocument,kt as useCreateEmailToken,ar as useCreateEmailVerification,jn as useCreateFile,Et as useCreateJWT,Vt as useCreateMagicURLToken,Aa as useCreateMembership,Pt as useCreateMfaAuthenticator,Lt as useCreateMfaChallenge,Gt as useCreateMfaRecoveryCodes,Bt as useCreateOAuth2Token,Ks as useCreateOperations,Wt as useCreatePhoneToken,Xt as useCreatePhoneVerification,er as useCreatePushTarget,or as useCreateSession,En as useCreateSubscriber,da as useCreateTeam,Ts as useCreateTransaction,Ds as useDecrementAttribute,Is as useDeleteDocument,Yn as useDeleteFile,pr as useDeleteIdentity,Da as useDeleteMembership,lr as useDeleteMfaAuthenticator,dr as useDeletePushTarget,qr as useDeleteSession,Rr as useDeleteSessions,vn as useDeleteSubscriber,Ra as useDeleteTeam,Vs as useDeleteTransaction,Ps as useDocument,$n as useFile,Pn as useFileDownload,Un as useFilePreview,_n as useFileView,Bn as useFiles,fR as useFunction,RR as useGetExecution,Cr as useGetMfaRecoveryCodes,Sr as useGetPrefs,Dr as useGetSession,_s as useGetTransaction,Gs as useIncrementAttribute,js as useInfiniteCollection,xt as useLazyAccount,Q as useLazyQuery,SR as useListExecutions,vr as useListIdentities,$r as useListMfaFactors,Fr as useListSessions,zs as useListTransactions,un as useLocale,mn as useLocaleCodes,fn as useLocaleContinents,gn as useLocaleCountries,wn as useLocaleCountriesEU,An as useLocaleCountriesPhones,On as useLocaleCurrencies,kn as useLocaleLanguages,_r as useLogin,Br as useLogout,Wr as useLogs,p as useMutation,Xr as usePasswordRecovery,d as useQuery,m as useQueryClient,eo as useResetPassword,oo as useSignUp,j as useSuspenseCollection,ws as useSuspenseCollectionWithPagination,It as useSuspenseCreateJWT,Fs as useSuspenseDocument,dR as useSuspenseFunction,S as useSuspenseQuery,ta as useTeam,ca as useTeamMembership,ya as useTeamMemberships,ia as useTeamPrefs,sa as useTeams,Ys as useUpdateDocument,no as useUpdateEmail,uo as useUpdateEmailVerification,zn as useUpdateFile,mo as useUpdateMagicURLSession,Ka as useUpdateMembership,Ta as useUpdateMembershipStatus,fo as useUpdateMfa,qo as useUpdateMfaAuthenticator,Ro as useUpdateMfaChallenge,Co as useUpdateMfaRecoveryCodes,Oo as useUpdateName,To as useUpdatePassword,Do as useUpdatePhone,vo as useUpdatePhoneSession,$o as useUpdatePhoneVerification,Po as useUpdatePrefs,Lo as useUpdatePushTarget,Go as useUpdateSession,Jo as useUpdateStatus,ga as useUpdateTeamName,ba as useUpdateTeamPrefs,tn as useUpdateTransaction,sn as useUpsertDocument,Ho as useVerification,_a as webNetworkAdapter};//# sourceMappingURL=index.js.map
|
|
455
990
|
//# sourceMappingURL=index.js.map
|