@zeroin.earth/appwrite-graphql 0.16.4 → 22.4.1
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 +1 -111
- package/dist/index.cjs +1072 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +17911 -0
- package/dist/index.d.ts +14470 -2559
- package/dist/index.js +738 -121
- package/dist/index.js.map +1 -1
- package/package.json +39 -23
- package/react-native/index.cjs +1071 -0
- package/react-native/index.d.cts +17911 -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/react-native/index.js
DELETED
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jotai = require('jotai');
|
|
4
|
-
var graphql = require('graphql');
|
|
5
|
-
var appwrite = require('react-native-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(`
|
|
27
|
-
query AccountGet {
|
|
28
|
-
accountGet {
|
|
29
|
-
...Account_User
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`);function dn(){let{graphql:e}=o(),a=l(),n=k(Ee(e));return react.useEffect(()=>Pe(e,a),[e.client,a]),n}function ln(){let{graphql:e}=o(),a=l(),n=m(Ee(e));return react.useEffect(()=>Pe(e,a),[e.client,a]),n}function Ee(e){return {queryKey:["appwrite","account"],queryFn:async()=>{let{data:a,errors:n}=await e.query({query:cn});if(n)throw n;return a.accountGet},retry:!1}}function Pe(e,a){return e.client.subscribe("account",n=>{if(n.events.some(i=>i.endsWith("prefs"))){a.setQueryData(["appwrite","account"],i=>immer.produce(i,s=>{s&&(s.prefs=immer.castDraft(n.payload.prefs));}));return}a.setQueryData(["appwrite","account"],n.payload);})}var pn=r(`
|
|
33
|
-
mutation CreateAnonymousSession {
|
|
34
|
-
accountCreateAnonymousSession {
|
|
35
|
-
_id
|
|
36
|
-
expire
|
|
37
|
-
current
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
`);function mn(){let{graphql:e}=o();return {...u({mutationFn:async()=>{let{data:n,errors:t}=await e.mutation({query:pn});if(t)throw t;return n.accountCreateAnonymousSession}})}}var yn=r(`
|
|
41
|
-
mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {
|
|
42
|
-
accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {
|
|
43
|
-
expire
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`);function Sn(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,email:t,phrase:i})=>{let{data:s,errors:c}=await e.mutation({query:yn,variables:{userId:n,email:t,phrase:i}});if(c)throw c;return s.accountCreateEmailToken}})}}var Re=r(`
|
|
47
|
-
mutation CreateJWT {
|
|
48
|
-
accountCreateJWT {
|
|
49
|
-
jwt
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`);function kn({gcTime:e=6e5}={}){let{graphql:a}=o(),n=l();return {...u({gcTime:e,mutationKey:["appwrite","jwt"],mutationFn:async()=>{let{data:i,errors:s}=await a.mutation({query:Re});if(s)throw s;return i.accountCreateJWT},onSuccess:i=>{a.client.setJWT(i.jwt),n.setQueryData(["appwrite","jwt"],i.jwt,{updatedAt:Date.now()});}})}}function fn({gcTime:e=6e5}={}){let{graphql:a}=o();return {...f({gcTime:e,queryKey:["appwrite","jwt"],queryFn:async()=>{let{data:t,errors:i}=await a.mutation({query:Re});if(i)throw i;return a.client.setJWT(t.accountCreateJWT.jwt),t.accountCreateJWT}})}}var gn=r(`
|
|
53
|
-
mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
|
|
54
|
-
accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
|
|
55
|
-
expire
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`);function vn(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,email:t,url:i,phrase:s})=>{let{data:c,errors:d}=await e.mutation({query:gn,variables:{userId:n,email:t,url:i,phrase:s}});if(d)throw d;return c.accountCreateMagicURLToken}})}}var bn=r(`
|
|
59
|
-
mutation CreateMfaAuthenticator($type: String!) {
|
|
60
|
-
accountCreateMfaAuthenticator(type: $type) {
|
|
61
|
-
secret
|
|
62
|
-
uri
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
`);function Mn(){let{graphql:e}=o();return {...u({mutationFn:async({type:n="totp"})=>{let{data:t,errors:i}=await e.mutation({query:bn,variables:{type:n}});if(i)throw i;return t.accountCreateMfaAuthenticator}})}}var Nn=r(`
|
|
66
|
-
mutation CreateMfaChallenge($factor: String!) {
|
|
67
|
-
accountCreateMfaChallenge(factor: $factor) {
|
|
68
|
-
userId
|
|
69
|
-
expire
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`);function Dn(){let{graphql:e}=o();return {...u({mutationFn:async({factor:n})=>{let{data:t,errors:i}=await e.mutation({query:Nn,variables:{factor:n}});if(i)throw i;return t.accountCreateMfaChallenge}})}}var xn=r(`
|
|
73
|
-
mutation CreateMfaRecoveryCodes {
|
|
74
|
-
accountCreateMfaRecoveryCodes {
|
|
75
|
-
recoveryCodes
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
`);function In(){let{graphql:e}=o();return {...u({mutationFn:async()=>{let{data:n,errors:t}=await e.mutation({query:xn});if(t)throw t;return n.accountCreateMfaRecoveryCodes}})}}var Cn=r(`
|
|
79
|
-
mutation CreatePhoneToken($userId: String!, $phone: String!) {
|
|
80
|
-
accountCreatePhoneToken(userId: $userId, phone: $phone) {
|
|
81
|
-
expire
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
`);function $n(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,phone:t})=>{let{data:i,errors:s}=await e.mutation({query:Cn,variables:{userId:n,phone:t}});if(s)throw s;return i.accountCreatePhoneToken}})}}var An=r(`
|
|
85
|
-
mutation CreatePhoneVerification {
|
|
86
|
-
accountCreatePhoneVerification {
|
|
87
|
-
expire
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
`);function wn(){let{graphql:e}=o();return {...u({mutationFn:async()=>{let{data:n,errors:t}=await e.mutation({query:An});if(t)throw t;return n.accountCreatePhoneVerification}})}}var hn=r(`
|
|
91
|
-
mutation CreateSession($userId: String!, $secret: String!) {
|
|
92
|
-
accountCreateSession(userId: $userId, secret: $secret) {
|
|
93
|
-
userId
|
|
94
|
-
expire
|
|
95
|
-
current
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
`);function Tn(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,secret:t})=>{let{data:i,errors:s}=await e.mutation({query:hn,variables:{userId:n,secret:t}});if(s)throw s;return i.accountCreateSession}})}}var Un=r(`
|
|
99
|
-
mutation DeleteIdentity($identityId: String!) {
|
|
100
|
-
accountDeleteIdentity(identityId: $identityId) {
|
|
101
|
-
status
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
`);function Vn(){let{graphql:e}=o();return {...u({mutationFn:async({identityId:n})=>{let{data:t,errors:i}=await e.mutation({query:Un,variables:{identityId:n}});if(i)throw i;return t?.accountDeleteIdentity??{status:!1}}})}}var qn=r(`
|
|
105
|
-
mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {
|
|
106
|
-
accountDeleteMfaAuthenticator(type: $type, otp: $otp) {
|
|
107
|
-
mfa
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
`);function _n(){let{graphql:e}=o();return {...u({mutationFn:async({type:n="totp",otp:t})=>{let{data:i,errors:s}=await e.mutation({query:qn,variables:{type:n,otp:t}});if(s)throw s;return i.accountDeleteMfaAuthenticator}})}}var Fn=r(`
|
|
111
|
-
mutation DeleteSession($sessionId: String!) {
|
|
112
|
-
accountDeleteSession(sessionId: $sessionId) {
|
|
113
|
-
status
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`);function En(){let{graphql:e}=o();return {...u({mutationFn:async({sessionId:n})=>{let{data:t,errors:i}=await e.mutation({query:Fn,variables:{sessionId:n}});if(i)throw i;return t?.accountDeleteSession??{status:!1}}})}}var Pn=r(`
|
|
117
|
-
mutation DeleteSessions {
|
|
118
|
-
accountDeleteSessions {
|
|
119
|
-
status
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`);function Rn(){let{graphql:e}=o();return {...u({mutationFn:async()=>{let{data:n,errors:t}=await e.mutation({query:Pn});if(t)throw t;return n?.accountDeleteSessions??{status:!1}}})}}var Ln=r(`
|
|
123
|
-
query GetMfaRecoveryCodes {
|
|
124
|
-
accountGetMfaRecoveryCodes {
|
|
125
|
-
recoveryCodes
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
`);function Qn(){let{graphql:e}=o();return {...m({queryKey:["appwrite","account","mfa","recovery-codes"],queryFn:async()=>{let{data:n,errors:t}=await e.query({query:Ln});if(t)throw t;return n.accountGetMfaRecoveryCodes}})}}var Gn=r(`
|
|
129
|
-
query GetPrefs {
|
|
130
|
-
accountGetPrefs {
|
|
131
|
-
data
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
`);function On(){let{graphql:e}=o();return {...m({queryKey:["appwrite","account","prefs"],queryFn:async()=>{let{data:n,errors:t}=await e.query({query:Gn});if(t)throw t;return n.accountGetPrefs}})}}var Jn=r(`
|
|
135
|
-
query GetSession($sessionId: String!) {
|
|
136
|
-
accountGetSession(sessionId: $sessionId) {
|
|
137
|
-
userId
|
|
138
|
-
expire
|
|
139
|
-
current
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
`);function Bn({sessionId:e}){let{graphql:a}=o();return m({queryKey:["appwrite","account","session",e],queryFn:async()=>{let{data:t,errors:i}=await a.query({query:Jn,variables:{sessionId:e}});if(i)throw i;return t.accountGetSession}})}var Kn=r(`
|
|
143
|
-
query ListIdentities {
|
|
144
|
-
accountListIdentities {
|
|
145
|
-
total
|
|
146
|
-
identities {
|
|
147
|
-
...Identity_Provider
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
`);function Wn(){let{graphql:e}=o();return {...m({queryKey:["appwrite","account","identities"],queryFn:async()=>{let{data:n,errors:t}=await e.query({query:Kn});if(t)throw t;return n.accountListIdentities}})}}var jn=r(`
|
|
152
|
-
query ListMfaFactors {
|
|
153
|
-
accountListMfaFactors {
|
|
154
|
-
totp
|
|
155
|
-
phone
|
|
156
|
-
email
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
`);function zn(){let{graphql:e}=o();return {...m({queryKey:["appwrite","account","mfa","factors"],queryFn:async()=>{let{data:n,errors:t}=await e.query({query:jn});if(t)throw t;return n.accountListMfaFactors}})}}var Xn=r(`
|
|
160
|
-
query ListSessions {
|
|
161
|
-
accountListSessions {
|
|
162
|
-
sessions {
|
|
163
|
-
_id
|
|
164
|
-
_createdAt
|
|
165
|
-
osName
|
|
166
|
-
clientName
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
`);function Hn(){let{graphql:e}=o();return {...m({queryKey:["appwrite","account","sessions"],queryFn:async()=>{let{data:n,errors:t}=await e.query({query:Xn});if(t)throw t;return n.accountListSessions}})}}var Yn=r(`
|
|
171
|
-
mutation CreateEmailPasswordSession($email: String!, $password: String!) {
|
|
172
|
-
accountCreateEmailPasswordSession(email: $email, password: $password) {
|
|
173
|
-
userId
|
|
174
|
-
expire
|
|
175
|
-
current
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
`);function Zn(){let{account:e,graphql:a}=o(),n=u({mutationFn:async({email:i,password:s})=>{let{data:c,errors:d}=await a.mutation({query:Yn,variables:{email:i,password:s}});if(d)throw d;return c.accountCreateEmailPasswordSession}}),t=u({mutationFn:async({provider:i,success:s,failure:c})=>e.createOAuth2Session(i,s,c)});return {login:n,oAuthLogin:t}}var et=r(`
|
|
179
|
-
mutation DeleteSession($sessionId: String!) {
|
|
180
|
-
accountDeleteSession(sessionId: $sessionId) {
|
|
181
|
-
status
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
`);function nt(){let{graphql:e}=o(),a=l(),n=u({mutationFn:async({sessionId:t})=>{let{data:i,errors:s}=await e.mutation({query:et,variables:{sessionId:t}});if(s)throw s;return i?.accountDeleteSession??{status:!1}},onSuccess:async()=>{a.setQueryData(["appwrite"],null),a.setQueryData(["appwrite","account"],null),a.invalidateQueries({queryKey:["appwrite"]}),a.invalidateQueries({queryKey:["appwrite","account"]}),a.removeQueries({queryKey:["appwrite"]}),a.removeQueries({queryKey:["appwrite","account"]}),a.clear();}});return {...n,mutate:n.mutate}}var tt=r(`
|
|
185
|
-
query ListLogs($queries: [String!]) {
|
|
186
|
-
accountListLogs(queries: $queries) {
|
|
187
|
-
total
|
|
188
|
-
logs {
|
|
189
|
-
event
|
|
190
|
-
userId
|
|
191
|
-
userEmail
|
|
192
|
-
userName
|
|
193
|
-
mode
|
|
194
|
-
ip
|
|
195
|
-
time
|
|
196
|
-
osCode
|
|
197
|
-
osName
|
|
198
|
-
osVersion
|
|
199
|
-
clientType
|
|
200
|
-
clientCode
|
|
201
|
-
clientName
|
|
202
|
-
clientVersion
|
|
203
|
-
clientEngine
|
|
204
|
-
clientEngineVersion
|
|
205
|
-
deviceName
|
|
206
|
-
deviceBrand
|
|
207
|
-
deviceModel
|
|
208
|
-
countryCode
|
|
209
|
-
countryName
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
`);function at({queries:e}){let{graphql:a}=o();return {...m({queryKey:["appwrite","account","logs",e],queryFn:async()=>{let{data:t,errors:i}=await a.query({query:tt,variables:{queries:e}});if(i)throw i;return t.accountListLogs}})}}var it=r(`
|
|
214
|
-
mutation CreateRecovery($email: String!, $url: String!) {
|
|
215
|
-
accountCreateRecovery(email: $email, url: $url) {
|
|
216
|
-
expire
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
`);function ot(){let{graphql:e}=o();return {...u({mutationFn:async({email:n,url:t})=>{let{data:i,errors:s}=await e.mutation({query:it,variables:{email:n,url:t}});if(s)throw s;return i.accountCreateRecovery},onSuccess:async(n,t)=>{localStorage?.setItem("email",t.email);}})}}var rt=r(`
|
|
220
|
-
mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {
|
|
221
|
-
accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {
|
|
222
|
-
expire
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
`);function st(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,secret:t,password:i})=>{let{data:s,errors:c}=await e.mutation({query:rt,variables:{userId:n,secret:t,password:i}});if(c)throw c;return s.accountUpdateRecovery??{}}})}}var ut=r(`
|
|
226
|
-
mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
|
|
227
|
-
accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
|
|
228
|
-
name
|
|
229
|
-
email
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
`),ct=r(`
|
|
233
|
-
mutation VerifyEmail($url: String!) {
|
|
234
|
-
accountCreateVerification(url: $url) {
|
|
235
|
-
expire
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
`);function dt(){let{graphql:e}=o(),a=u({mutationFn:async({userId:t,email:i,password:s,name:c})=>{let{data:d,errors:p}=await e.mutation({query:ut,variables:{userId:t??appwrite.ID.unique(),name:c,email:i,password:s}});if(p)throw p;return d.accountCreate}}),n=u({mutationFn:async({verifyUrl:t})=>{let{data:i,errors:s}=await e.mutation({query:ct,variables:{url:t}});if(s)throw s;return i.accountCreateVerification}});return {signUp:a,verifyEmail:n}}var lt=r(`
|
|
239
|
-
mutation UpdateEmail($email: String!, $password: String!) {
|
|
240
|
-
accountUpdateEmail(email: $email, password: $password) {
|
|
241
|
-
name
|
|
242
|
-
email
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
`);function pt(){let{graphql:e}=o();return {...u({mutationFn:async({email:n,password:t})=>{let{data:i,errors:s}=await e.mutation({query:lt,variables:{email:n,password:t}});if(s)throw s;return i.accountUpdateEmail}})}}var mt=r(`
|
|
246
|
-
mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
|
|
247
|
-
accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
|
|
248
|
-
userId
|
|
249
|
-
expire
|
|
250
|
-
current
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
`);function yt(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,secret:t})=>{let{data:i,errors:s}=await e.mutation({query:mt,variables:{userId:n,secret:t}});if(s)throw s;return i.accountUpdateMagicURLSession}})}}var St=r(`
|
|
254
|
-
mutation UpdateMFA($mfa: Boolean!) {
|
|
255
|
-
accountUpdateMFA(mfa: $mfa) {
|
|
256
|
-
mfa
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
`);function kt(){let{graphql:e}=o();return {...u({mutationFn:async({mfa:n})=>{let{data:t,errors:i}=await e.mutation({query:St,variables:{mfa:n}});if(i)throw i;return t.accountUpdateMFA}})}}var ft=r(`
|
|
260
|
-
mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
|
|
261
|
-
accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
|
|
262
|
-
mfa
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
`);function gt(){let{graphql:e}=o();return {...u({mutationFn:async({type:n="totp",otp:t})=>{let{data:i,errors:s}=await e.mutation({query:ft,variables:{type:n,otp:t}});if(s)throw s;return i.accountUpdateMfaAuthenticator}})}}var vt=r(`
|
|
266
|
-
mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
|
|
267
|
-
accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
|
|
268
|
-
status
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
`);function bt(){let{graphql:e}=o();return {...u({mutationFn:async({challengeId:n,otp:t})=>{let{data:i,errors:s}=await e.mutation({query:vt,variables:{challengeId:n,otp:t}});if(s)throw s;return i?.accountUpdateMfaChallenge??{status:!1}}})}}var Mt=r(`
|
|
272
|
-
mutation UpdateMfaRecoveryCodes {
|
|
273
|
-
accountUpdateMfaRecoveryCodes {
|
|
274
|
-
recoveryCodes
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
`);function Nt(){let{graphql:e}=o();return {...u({mutationFn:async()=>{let{data:n,errors:t}=await e.mutation({query:Mt});if(t)throw t;return n.accountUpdateMfaRecoveryCodes}})}}var Dt=r(`
|
|
278
|
-
mutation UpdateName($name: String!) {
|
|
279
|
-
accountUpdateName(name: $name) {
|
|
280
|
-
name
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
`);function xt(){let{graphql:e}=o();return {...u({mutationFn:async({name:n})=>{let{data:t,errors:i}=await e.mutation({query:Dt,variables:{name:n}});if(i)throw i;return t.accountUpdateName}})}}var It=r(`
|
|
284
|
-
mutation UpdatePassword($password: String!, $oldPassword: String!) {
|
|
285
|
-
accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
|
|
286
|
-
status
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
`);function Ct(){let{graphql:e}=o();return {...u({mutationFn:async({password:n,oldPassword:t})=>{let{data:i,errors:s}=await e.mutation({query:It,variables:{password:n,oldPassword:t}});if(s)throw s;return i?.accountUpdatePassword}})}}var $t=r(`
|
|
290
|
-
mutation UpdatePhone($phone: String!, $password: String!) {
|
|
291
|
-
accountUpdatePhone(phone: $phone, password: $password) {
|
|
292
|
-
phone
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
`);function At(){let{graphql:e}=o();return {...u({mutationFn:async({phone:n,password:t})=>{let{data:i,errors:s}=await e.mutation({query:$t,variables:{phone:n,password:t}});if(s)throw s;return i.accountUpdatePhone}})}}var wt=r(`
|
|
296
|
-
mutation UpdatePhoneSession($userId: String!, $secret: String!) {
|
|
297
|
-
accountUpdatePhoneSession(userId: $userId, secret: $secret) {
|
|
298
|
-
userId
|
|
299
|
-
expire
|
|
300
|
-
current
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
`);function ht(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,secret:t})=>{let{data:i,errors:s}=await e.mutation({query:wt,variables:{userId:n,secret:t}});if(s)throw s;return i.accountUpdatePhoneSession}})}}var Tt=r(`
|
|
304
|
-
mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
|
|
305
|
-
accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
|
|
306
|
-
expire
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
`);function Ut(){let{graphql:e}=o();return {...u({mutationFn:async({userId:n,secret:t})=>{let{data:i,errors:s}=await e.mutation({query:Tt,variables:{userId:n,secret:t}});if(s)throw s;return i.accountUpdatePhoneVerification}})}}function Vt(){let{account:e}=o();return {...u({mutationFn:async({prefs:n})=>await e.updatePrefs(n)})}}var qt=r(`
|
|
310
|
-
mutation UpdateSession($sessionId: String!) {
|
|
311
|
-
accountUpdateSession(sessionId: $sessionId) {
|
|
312
|
-
userId
|
|
313
|
-
expire
|
|
314
|
-
current
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
`);function _t(){let{graphql:e}=o();return {...u({mutationFn:async({sessionId:n})=>{let{data:t,errors:i}=await e.mutation({query:qt,variables:{sessionId:n}});if(i)throw i;return t.accountUpdateSession}})}}var Ft=r(`
|
|
318
|
-
mutation UpdateVerification($userId: String!, $secret: String!) {
|
|
319
|
-
accountUpdateVerification(userId: $userId, secret: $secret) {
|
|
320
|
-
secret
|
|
321
|
-
expire
|
|
322
|
-
userId
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
`);function Et(){let{graphql:e}=o(),a=l();return {...u({mutationFn:async({userId:t,secret:i})=>{if(!t||!i)throw new Error("Missing userId or secret");let{data:s,errors:c}=await e.mutation({query:Ft,variables:{userId:t,secret:i}});if(c)throw c;return s.accountUpdateVerification??{}},onSuccess:async()=>{a.setQueryData(["appwrite","account"],null);}})}}var Qe=r(`
|
|
326
|
-
query ListDocuments($databaseId: String!, $collectionId: String!, $queries: [String!]) {
|
|
327
|
-
databasesListDocuments(
|
|
328
|
-
databaseId: $databaseId
|
|
329
|
-
collectionId: $collectionId
|
|
330
|
-
queries: $queries
|
|
331
|
-
) {
|
|
332
|
-
total
|
|
333
|
-
documents {
|
|
334
|
-
_id
|
|
335
|
-
data
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
`);function Pt({databaseId:e,collectionId:a,queries:n,subscribe:t=!0}){let{graphql:i}=o(),s=l(),c=m({queryKey:["appwrite","databases",e,a,{queries:n}],queryFn:async()=>{let{data:d,errors:p}=await i.query({query:Qe,variables:{databaseId:e,collectionId:a,queries:n}});if(p)throw p;let S=d.databasesListDocuments?.documents?.map(y=>({...y,...y?JSON.parse(y.data):{}}))??[];return {total:d.databasesListDocuments?.total??0,documents:S}}});return react.useEffect(()=>t?i.client.subscribe(`databases.${e}.collections.${a}.documents`,p=>{let[,S]=p.events[0].match(/\.(\w+)$/),y=p.payload;switch(S){case"create":case"update":case"delete":s.setQueryData(["appwrite","databases",e,a,"documents",y.$id],y),s.invalidateQueries({queryKey:["appwrite","databases",e,a,{queries:n}],exact:!0});break}}):void 0,[e,a,i.client,s,n,t]),{...c,documents:c.data?.documents,total:c.data?.total}}function Rt({databaseId:e,collectionId:a,queries:n,subscribe:t=!0}){let{graphql:i}=o(),s=l(),c=f({queryKey:["appwrite","databases",e,a,{queries:n}],queryFn:async()=>{let{data:d,errors:p}=await i.query({query:Qe,variables:{databaseId:e,collectionId:a,queries:n}});if(p)throw p;let S=d.databasesListDocuments?.documents?.map(y=>({...y,...y?JSON.parse(y.data):{}}))??[];return {total:d.databasesListDocuments?.total??0,documents:S}}});return react.useEffect(()=>t?i.client.subscribe(`databases.${e}.collections.${a}.documents`,p=>{let[,S]=p.events[0].match(/\.(\w+)$/),y=p.payload;switch(S){case"create":case"update":case"delete":s.setQueryData(["appwrite","databases",e,a,"documents",y.$id],y),s.invalidateQueries({queryKey:["appwrite","databases",e,a,{queries:n}],exact:!0});break}}):void 0,[e,a,i.client,s,n]),{...c,documents:c.data?.documents,total:c.data?.total}}function Lt(){let{databases:e}=o();return u({mutationFn:async({databaseId:n,collectionId:t,documentId:i,data:s,permissions:c})=>{let{data:d,errors:p}=await e.createDocument(n,t,i,s,c);if(p)throw p;return d}})}var Qt=r(`
|
|
340
|
-
mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
|
|
341
|
-
databasesDeleteDocument(
|
|
342
|
-
databaseId: $databaseId
|
|
343
|
-
collectionId: $collectionId
|
|
344
|
-
documentId: $documentId
|
|
345
|
-
) {
|
|
346
|
-
status
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
`);function Gt(){let{graphql:e}=o(),a=l();return {...u({mutationFn:async({databaseId:t,collectionId:i,documentId:s})=>{let{data:c,errors:d}=await e.mutation({query:Qt,variables:{databaseId:t,collectionId:i,documentId:s}});if(d)throw d;return c.databasesDeleteDocument},onSuccess:async(t,i)=>{a.setQueryData(["appwrite","databases",i.databaseId,i.collectionId,"documents",i.documentId],null),a.removeQueries({queryKey:["appwrite","databases",i.databaseId,i.collectionId,"documents",i.documentId]});}})}}var Jt=r(`
|
|
350
|
-
query GetDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
|
|
351
|
-
databasesGetDocument(
|
|
352
|
-
databaseId: $databaseId
|
|
353
|
-
collectionId: $collectionId
|
|
354
|
-
documentId: $documentId
|
|
355
|
-
) {
|
|
356
|
-
_id
|
|
357
|
-
data
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
`);function Bt({databaseId:e,collectionId:a,documentId:n}){let{graphql:t}=o(),i=l(),s=m({queryKey:["appwrite","databases",e,a,"documents",n],queryFn:async()=>{let{data:c,errors:d}=await t.query({query:Jt,variables:{databaseId:e,collectionId:a,documentId:n}});if(d)throw d;return {...c.databasesGetDocument,...c.databasesGetDocument?JSON.parse(c.databasesGetDocument.data):{}}}});return react.useEffect(()=>t.client.subscribe(`databases.${e}.collections.${a}.documents.${n}`,d=>{i.setQueryData(["appwrite","databases",e,a,"documents",n],d.payload);}),[e,a,n,t.client,i]),{...s}}function Kt(){let{databases:e}=o();return {...u({mutationFn:async({databaseId:n,collectionId:t,documentId:i,data:s,permissions:c})=>{let{data:d,errors:p}=await e.updateDocument(n,t,i,s,c);if(p)throw p;return d}})}}var Ge=r(`
|
|
361
|
-
mutation CreateExecution(
|
|
362
|
-
$functionId: String!
|
|
363
|
-
$body: String
|
|
364
|
-
$async: Boolean
|
|
365
|
-
$path: String
|
|
366
|
-
$method: String # $headers: JSON
|
|
367
|
-
) {
|
|
368
|
-
functionsCreateExecution(
|
|
369
|
-
functionId: $functionId
|
|
370
|
-
body: $body
|
|
371
|
-
async: $async
|
|
372
|
-
path: $path
|
|
373
|
-
method: $method # headers: $headers
|
|
374
|
-
) {
|
|
375
|
-
_id
|
|
376
|
-
status
|
|
377
|
-
responseStatusCode
|
|
378
|
-
responseBody
|
|
379
|
-
errors
|
|
380
|
-
duration
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
`),Wt=r(`
|
|
384
|
-
query GetFunctionExecution($functionId: String!, $executionId: String!) {
|
|
385
|
-
functionsGetExecution(functionId: $functionId, executionId: $executionId) {
|
|
386
|
-
status
|
|
387
|
-
errors
|
|
388
|
-
duration
|
|
389
|
-
responseBody
|
|
390
|
-
requestPath
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
`);function jt({currentExecution:e,currentFunction:a}){let{graphql:n}=o();return k({queryKey:["appwrite","functions",a,e],queryFn:async()=>{if(!e||!a)return null;let{data:i}=await n.query({query:Wt,variables:{functionId:a,executionId:e}});return i.functionsGetExecution??{}}})}function Pu(){let{graphql:e}=o(),[a,n]=react.useState(null),[t,i]=react.useState(null),s=jt({currentExecution:a,currentFunction:t});return {executeFunction:u({mutationFn:async({functionId:d,body:p={},async:S=!1,path:y="/",method:N="POST"})=>{i(d);let{data:D}=await e.mutation({query:Ge,variables:{functionId:d,body:JSON.stringify(p),async:S,path:y,method:N}}),{_id:x,status:I,responseBody:C,errors:g}=D.functionsCreateExecution??{};if(I==="failed")throw new Error(g);n(x??null);let $={};try{$=JSON.parse(C??"{}");}catch{}return $}}),currentExecution:s}}function Ru({functionId:e,body:a={},async:n=!1,path:t="/",method:i="POST"}){let{graphql:s}=o(),[c,d]=react.useState(null),[p,S]=react.useState(null);return {executeFunction:m({queryKey:["appwrite","functions",e,t],queryFn:async()=>{S(e);let{data:N}=await s.mutation({query:Ge,variables:{functionId:e,body:JSON.stringify(a),async:n,path:t,method:i}}),{_id:D,status:x,responseBody:I,errors:C}=N.functionsCreateExecution??{};if(x==="failed")throw new Error(C);d(D??null);let g={};try{g=JSON.parse(I??"{}");}catch{}return g}})}}exports.fragments = void 0;(n=>(n.Account_UserFragment=Ae,n.Identity_ProviderFragment=we))(exports.fragments||={});
|
|
394
|
-
|
|
395
|
-
exports.AppwriteProvider = rn;
|
|
396
|
-
exports.getFragmentData = Oe;
|
|
397
|
-
exports.useAccount = ln;
|
|
398
|
-
exports.useAppwrite = o;
|
|
399
|
-
exports.useCollection = Pt;
|
|
400
|
-
exports.useCreateAnonymousSession = mn;
|
|
401
|
-
exports.useCreateDocument = Lt;
|
|
402
|
-
exports.useCreateEmailToken = Sn;
|
|
403
|
-
exports.useCreateJWT = kn;
|
|
404
|
-
exports.useCreateMagicURLToken = vn;
|
|
405
|
-
exports.useCreateMfaAuthenticator = Mn;
|
|
406
|
-
exports.useCreateMfaChallenge = Dn;
|
|
407
|
-
exports.useCreateMfaRecoveryCodes = In;
|
|
408
|
-
exports.useCreatePhoneToken = $n;
|
|
409
|
-
exports.useCreatePhoneVerification = wn;
|
|
410
|
-
exports.useCreateSession = Tn;
|
|
411
|
-
exports.useDeleteDocument = Gt;
|
|
412
|
-
exports.useDeleteIdentity = Vn;
|
|
413
|
-
exports.useDeleteMfaAuthenticator = _n;
|
|
414
|
-
exports.useDeleteSession = En;
|
|
415
|
-
exports.useDeleteSessions = Rn;
|
|
416
|
-
exports.useDocument = Bt;
|
|
417
|
-
exports.useFunction = Pu;
|
|
418
|
-
exports.useGetMfaRecoveryCodes = Qn;
|
|
419
|
-
exports.useGetPrefs = On;
|
|
420
|
-
exports.useGetSession = Bn;
|
|
421
|
-
exports.useLazyAccount = dn;
|
|
422
|
-
exports.useLazyQuery = k;
|
|
423
|
-
exports.useListIdentities = Wn;
|
|
424
|
-
exports.useListMfaFactors = zn;
|
|
425
|
-
exports.useListSessions = Hn;
|
|
426
|
-
exports.useLogin = Zn;
|
|
427
|
-
exports.useLogout = nt;
|
|
428
|
-
exports.useLogs = at;
|
|
429
|
-
exports.useMutation = u;
|
|
430
|
-
exports.usePasswordRecovery = ot;
|
|
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;
|