@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/dist/index.mjs DELETED
@@ -1,395 +0,0 @@
1
- import { atom, useAtomValue, useAtom } from 'jotai';
2
- import { print } from 'graphql';
3
- import { Client, Account, Databases, Graphql, ID } from 'appwrite';
4
- import { QueryClient, useMutation, useQuery, useSuspenseQuery } from '@tanstack/react-query';
5
- import { useHydrateAtoms } from 'jotai/utils';
6
- import { useEffect, useState } from 'react';
7
- import { produce, castDraft } from 'immer';
8
-
9
- 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(`
10
- fragment Account_User on User {
11
- _id
12
- name
13
- email
14
- prefs {
15
- data
16
- }
17
- }
18
- `),we=r(`
19
- fragment Identity_Provider on Identity {
20
- _id
21
- userId
22
- provider
23
- }
24
- `);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 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:print(a),variables:n});return {data:t,errors:i}},mutation:async({query:a,variables:n})=>{let{data:t,errors:i}=await e.mutation({query:print(a),variables:n});return {data:t,errors:i}}}),Ue=atom({account:new Account(v),databases:new Databases(v),graphql:qe(new Graphql(v))}),b=atom(e=>e(Ue),(e,a,{endpoint:n,projectId:t})=>{let i=new Client;i.setEndpoint(n).setProject(t);let s=new Account(i),c=new Databases(i),d=new Graphql(i);a(Ue,{account:s,databases:c,graphql:qe(d)});});function o(){let{account:e,databases:a,graphql:n}=useAtomValue(b);return {account:e,databases:a,graphql:n}}var Ye=new QueryClient,_e=atom(Ye);function l(){let[e]=useAtom(_e);return e}function u(e){let a=l();return useMutation(e,a)}function m(e){let a=l();return useQuery(e,a)}function k(e){let a=l(),n=useQuery({...e,enabled:!1},a);return {run:n.refetch,query:n}}function f(e){let a=l();return useSuspenseQuery(e,a)}function rn({endpoint:e,projectId:a,children:n}){return useHydrateAtoms([[b,{endpoint:e,projectId:a}]]),n}var cn=r(`
25
- query AccountGet {
26
- accountGet {
27
- ...Account_User
28
- }
29
- }
30
- `);function dn(){let{graphql:e}=o(),a=l(),n=k(Ee(e));return useEffect(()=>Pe(e,a),[e.client,a]),n}function ln(){let{graphql:e}=o(),a=l(),n=m(Ee(e));return 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=>produce(i,s=>{s&&(s.prefs=castDraft(n.payload.prefs));}));return}a.setQueryData(["appwrite","account"],n.payload);})}var pn=r(`
31
- mutation CreateAnonymousSession {
32
- accountCreateAnonymousSession {
33
- _id
34
- expire
35
- current
36
- }
37
- }
38
- `);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(`
39
- mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {
40
- accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {
41
- expire
42
- }
43
- }
44
- `);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(`
45
- mutation CreateJWT {
46
- accountCreateJWT {
47
- jwt
48
- }
49
- }
50
- `);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(`
51
- mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
52
- accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
53
- expire
54
- }
55
- }
56
- `);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(`
57
- mutation CreateMfaAuthenticator($type: String!) {
58
- accountCreateMfaAuthenticator(type: $type) {
59
- secret
60
- uri
61
- }
62
- }
63
- `);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(`
64
- mutation CreateMfaChallenge($factor: String!) {
65
- accountCreateMfaChallenge(factor: $factor) {
66
- userId
67
- expire
68
- }
69
- }
70
- `);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(`
71
- mutation CreateMfaRecoveryCodes {
72
- accountCreateMfaRecoveryCodes {
73
- recoveryCodes
74
- }
75
- }
76
- `);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(`
77
- mutation CreatePhoneToken($userId: String!, $phone: String!) {
78
- accountCreatePhoneToken(userId: $userId, phone: $phone) {
79
- expire
80
- }
81
- }
82
- `);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(`
83
- mutation CreatePhoneVerification {
84
- accountCreatePhoneVerification {
85
- expire
86
- }
87
- }
88
- `);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(`
89
- mutation CreateSession($userId: String!, $secret: String!) {
90
- accountCreateSession(userId: $userId, secret: $secret) {
91
- userId
92
- expire
93
- current
94
- }
95
- }
96
- `);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(`
97
- mutation DeleteIdentity($identityId: String!) {
98
- accountDeleteIdentity(identityId: $identityId) {
99
- status
100
- }
101
- }
102
- `);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(`
103
- mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {
104
- accountDeleteMfaAuthenticator(type: $type, otp: $otp) {
105
- mfa
106
- }
107
- }
108
- `);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(`
109
- mutation DeleteSession($sessionId: String!) {
110
- accountDeleteSession(sessionId: $sessionId) {
111
- status
112
- }
113
- }
114
- `);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(`
115
- mutation DeleteSessions {
116
- accountDeleteSessions {
117
- status
118
- }
119
- }
120
- `);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(`
121
- query GetMfaRecoveryCodes {
122
- accountGetMfaRecoveryCodes {
123
- recoveryCodes
124
- }
125
- }
126
- `);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(`
127
- query GetPrefs {
128
- accountGetPrefs {
129
- data
130
- }
131
- }
132
- `);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(`
133
- query GetSession($sessionId: String!) {
134
- accountGetSession(sessionId: $sessionId) {
135
- userId
136
- expire
137
- current
138
- }
139
- }
140
- `);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(`
141
- query ListIdentities {
142
- accountListIdentities {
143
- total
144
- identities {
145
- ...Identity_Provider
146
- }
147
- }
148
- }
149
- `);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(`
150
- query ListMfaFactors {
151
- accountListMfaFactors {
152
- totp
153
- phone
154
- email
155
- }
156
- }
157
- `);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(`
158
- query ListSessions {
159
- accountListSessions {
160
- sessions {
161
- _id
162
- _createdAt
163
- osName
164
- clientName
165
- }
166
- }
167
- }
168
- `);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(`
169
- mutation CreateEmailPasswordSession($email: String!, $password: String!) {
170
- accountCreateEmailPasswordSession(email: $email, password: $password) {
171
- userId
172
- expire
173
- current
174
- }
175
- }
176
- `);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(`
177
- mutation DeleteSession($sessionId: String!) {
178
- accountDeleteSession(sessionId: $sessionId) {
179
- status
180
- }
181
- }
182
- `);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(`
183
- query ListLogs($queries: [String!]) {
184
- accountListLogs(queries: $queries) {
185
- total
186
- logs {
187
- event
188
- userId
189
- userEmail
190
- userName
191
- mode
192
- ip
193
- time
194
- osCode
195
- osName
196
- osVersion
197
- clientType
198
- clientCode
199
- clientName
200
- clientVersion
201
- clientEngine
202
- clientEngineVersion
203
- deviceName
204
- deviceBrand
205
- deviceModel
206
- countryCode
207
- countryName
208
- }
209
- }
210
- }
211
- `);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(`
212
- mutation CreateRecovery($email: String!, $url: String!) {
213
- accountCreateRecovery(email: $email, url: $url) {
214
- expire
215
- }
216
- }
217
- `);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(`
218
- mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {
219
- accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {
220
- expire
221
- }
222
- }
223
- `);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(`
224
- mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
225
- accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
226
- name
227
- email
228
- }
229
- }
230
- `),ct=r(`
231
- mutation VerifyEmail($url: String!) {
232
- accountCreateVerification(url: $url) {
233
- expire
234
- }
235
- }
236
- `);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??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(`
237
- mutation UpdateEmail($email: String!, $password: String!) {
238
- accountUpdateEmail(email: $email, password: $password) {
239
- name
240
- email
241
- }
242
- }
243
- `);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(`
244
- mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
245
- accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
246
- userId
247
- expire
248
- current
249
- }
250
- }
251
- `);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(`
252
- mutation UpdateMFA($mfa: Boolean!) {
253
- accountUpdateMFA(mfa: $mfa) {
254
- mfa
255
- }
256
- }
257
- `);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(`
258
- mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
259
- accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
260
- mfa
261
- }
262
- }
263
- `);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(`
264
- mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
265
- accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
266
- status
267
- }
268
- }
269
- `);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(`
270
- mutation UpdateMfaRecoveryCodes {
271
- accountUpdateMfaRecoveryCodes {
272
- recoveryCodes
273
- }
274
- }
275
- `);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(`
276
- mutation UpdateName($name: String!) {
277
- accountUpdateName(name: $name) {
278
- name
279
- }
280
- }
281
- `);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(`
282
- mutation UpdatePassword($password: String!, $oldPassword: String!) {
283
- accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
284
- status
285
- }
286
- }
287
- `);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(`
288
- mutation UpdatePhone($phone: String!, $password: String!) {
289
- accountUpdatePhone(phone: $phone, password: $password) {
290
- phone
291
- }
292
- }
293
- `);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(`
294
- mutation UpdatePhoneSession($userId: String!, $secret: String!) {
295
- accountUpdatePhoneSession(userId: $userId, secret: $secret) {
296
- userId
297
- expire
298
- current
299
- }
300
- }
301
- `);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(`
302
- mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
303
- accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
304
- expire
305
- }
306
- }
307
- `);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(`
308
- mutation UpdateSession($sessionId: String!) {
309
- accountUpdateSession(sessionId: $sessionId) {
310
- userId
311
- expire
312
- current
313
- }
314
- }
315
- `);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(`
316
- mutation UpdateVerification($userId: String!, $secret: String!) {
317
- accountUpdateVerification(userId: $userId, secret: $secret) {
318
- secret
319
- expire
320
- userId
321
- }
322
- }
323
- `);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(`
324
- query ListDocuments($databaseId: String!, $collectionId: String!, $queries: [String!]) {
325
- databasesListDocuments(
326
- databaseId: $databaseId
327
- collectionId: $collectionId
328
- queries: $queries
329
- ) {
330
- total
331
- documents {
332
- _id
333
- data
334
- }
335
- }
336
- }
337
- `);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 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 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(`
338
- mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
339
- databasesDeleteDocument(
340
- databaseId: $databaseId
341
- collectionId: $collectionId
342
- documentId: $documentId
343
- ) {
344
- status
345
- }
346
- }
347
- `);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(`
348
- query GetDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
349
- databasesGetDocument(
350
- databaseId: $databaseId
351
- collectionId: $collectionId
352
- documentId: $documentId
353
- ) {
354
- _id
355
- data
356
- }
357
- }
358
- `);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 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(`
359
- mutation CreateExecution(
360
- $functionId: String!
361
- $body: String
362
- $async: Boolean
363
- $path: String
364
- $method: String # $headers: JSON
365
- ) {
366
- functionsCreateExecution(
367
- functionId: $functionId
368
- body: $body
369
- async: $async
370
- path: $path
371
- method: $method # headers: $headers
372
- ) {
373
- _id
374
- status
375
- responseStatusCode
376
- responseBody
377
- errors
378
- duration
379
- }
380
- }
381
- `),Wt=r(`
382
- query GetFunctionExecution($functionId: String!, $executionId: String!) {
383
- functionsGetExecution(functionId: $functionId, executionId: $executionId) {
384
- status
385
- errors
386
- duration
387
- responseBody
388
- requestPath
389
- }
390
- }
391
- `);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]=useState(null),[t,i]=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]=useState(null),[p,S]=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}})}}var zt;(n=>(n.Account_UserFragment=Ae,n.Identity_ProviderFragment=we))(zt||={});
392
-
393
- export { rn as AppwriteProvider, zt as fragments, Oe as getFragmentData, ln as useAccount, o as useAppwrite, Pt as useCollection, mn as useCreateAnonymousSession, Lt as useCreateDocument, Sn as useCreateEmailToken, kn as useCreateJWT, vn as useCreateMagicURLToken, Mn as useCreateMfaAuthenticator, Dn as useCreateMfaChallenge, In as useCreateMfaRecoveryCodes, $n as useCreatePhoneToken, wn as useCreatePhoneVerification, Tn as useCreateSession, Gt as useDeleteDocument, Vn as useDeleteIdentity, _n as useDeleteMfaAuthenticator, En as useDeleteSession, Rn as useDeleteSessions, Bt as useDocument, Pu as useFunction, Qn as useGetMfaRecoveryCodes, On as useGetPrefs, Bn as useGetSession, dn as useLazyAccount, k as useLazyQuery, Wn as useListIdentities, zn as useListMfaFactors, Hn as useListSessions, Zn as useLogin, nt as useLogout, at as useLogs, u as useMutation, ot as usePasswordRecovery, m as useQuery, l as useQueryClient, st as useResetPassword, dt as useSignUp, Rt as useSuspenseCollection, fn as useSuspenseCreateJWT, Ru as useSuspenseFunction, f as useSuspenseQuery, Kt as useUpdateDocument, pt as useUpdateEmail, yt as useUpdateMagicURLSession, kt as useUpdateMfa, gt as useUpdateMfaAuthenticator, bt as useUpdateMfaChallenge, Nt as useUpdateMfaRecoveryCodes, xt as useUpdateName, Ct as useUpdatePassword, At as useUpdatePhone, ht as useUpdatePhoneSession, Ut as useUpdatePhoneVerification, Vt as useUpdatePrefs, _t as useUpdateSession, Et as useVerification };
394
- //# sourceMappingURL=out.js.map
395
- //# sourceMappingURL=index.mjs.map