@zeroin.earth/appwrite-graphql 0.15.6 → 0.15.7

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 CHANGED
@@ -1,121 +1,11 @@
1
- // src/__generated__/fragment-masking.ts
2
- function getFragmentData(_documentNode, fragmentType) {
3
- return fragmentType;
4
- }
5
-
6
- // src/__generated__/graphql.ts
7
- var Account_UserFragmentDoc = { "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" } }] } }] } }] };
8
- var Identity_ProviderFragmentDoc = { "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" } }] } }] };
9
- var AccountGetDocument = { "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" } }] } }] } }] };
10
- var CreateAnonymousSessionDocument = { "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" } }] } }] } }] };
11
- var CreateEmailTokenDocument = { "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" } }] } }] } }] };
12
- var CreateJwtDocument = { "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" } }] } }] } }] };
13
- var CreateMagicUrlTokenDocument = { "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" } }] } }] } }] };
14
- var CreateMfaAuthenticatorDocument = { "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" } }] } }] } }] };
15
- var CreateMfaChallengeDocument = { "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" } }] } }] } }] };
16
- var CreateMfaRecoveryCodesDocument = { "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" } }] } }] } }] };
17
- var CreatePhoneTokenDocument = { "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" } }] } }] } }] };
18
- var CreatePhoneVerificationDocument = { "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" } }] } }] } }] };
19
- var CreateSessionDocument = { "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" } }] } }] } }] };
20
- var DeleteIdentityDocument = { "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" } }] } }] } }] };
21
- var DeleteMfaAuthenticatorDocument = { "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" } }] } }] } }] };
22
- var DeleteSessionDocument = { "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" } }] } }] } }] };
23
- var DeleteSessionsDocument = { "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" } }] } }] } }] };
24
- var GetMfaRecoveryCodesDocument = { "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" } }] } }] } }] };
25
- var GetPrefsDocument = { "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" } }] } }] } }] };
26
- var GetSessionDocument = { "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" } }] } }] } }] };
27
- var ListIdentitiesDocument = { "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" } }] } }] };
28
- var ListMfaFactorsDocument = { "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" } }] } }] } }] };
29
- var ListSessionsDocument = { "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" } }] } }] } }] } }] };
30
- var CreateEmailPasswordSessionDocument = { "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" } }] } }] } }] };
31
- var ListLogsDocument = { "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" } }] } }] } }] } }] };
32
- var CreateRecoveryDocument = { "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" } }] } }] } }] };
33
- var UpdateRecoveryDocument = { "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" } }] } }] } }] };
34
- var CreateAccountDocument = { "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" } }] } }] } }] };
35
- var VerifyEmailDocument = { "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" } }] } }] } }] };
36
- var UpdateEmailDocument = { "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" } }] } }] } }] };
37
- var UpdateMagicUrlSessionDocument = { "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" } }] } }] } }] };
38
- var UpdateMfaDocument = { "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" } }] } }] } }] };
39
- var UpdateMfaAuthenticatorDocument = { "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" } }] } }] } }] };
40
- var UpdateMfaChallengeDocument = { "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" } }] } }] } }] };
41
- var UpdateMfaRecoveryCodesDocument = { "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" } }] } }] } }] };
42
- var UpdateNameDocument = { "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" } }] } }] } }] };
43
- var UpdatePasswordDocument = { "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" } }] } }] } }] };
44
- var UpdatePhoneDocument = { "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" } }] } }] } }] };
45
- var UpdatePhoneSessionDocument = { "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" } }] } }] } }] };
46
- var UpdatePhoneVerificationDocument = { "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" } }] } }] } }] };
47
- var UpdatePrefsDocument = { "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" } }] } }] } }] } }] };
48
- var UpdateSessionDocument = { "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" } }] } }] } }] };
49
- var UpdateVerificationDocument = { "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" } }] } }] } }] };
50
- var ListDocumentsDocument = { "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" } }] } }] } }] } }] };
51
- var CreateDocumentDocument = { "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" } }] } }] } }] };
52
- var DeleteDocumentDocument = { "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" } }] } }] } }] };
53
- var GetDocumentDocument = { "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" } }] } }] } }] };
54
- var UpdateDocumentDocument = { "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" } }] } }] } }] };
55
- var CreateExecutionDocument = { "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" } }] } }] } }] };
56
- var GetFunctionExecutionDocument = { "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" } }] } }] } }] };
57
-
58
- // src/__generated__/gql.ts
59
- var documents = {
60
- "\n fragment Account_User on User {\n _id\n name\n email\n prefs {\n data\n }\n }\n": Account_UserFragmentDoc,
61
- "\n fragment Identity_Provider on Identity {\n _id\n userId\n provider\n }\n": Identity_ProviderFragmentDoc,
62
- "\n query AccountGet {\n accountGet {\n ...Account_User\n }\n }\n": AccountGetDocument,
63
- "\n mutation CreateAnonymousSession {\n accountCreateAnonymousSession {\n _id\n expire\n current\n }\n }\n": CreateAnonymousSessionDocument,
64
- "\n mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {\n accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {\n expire\n }\n }\n": CreateEmailTokenDocument,
65
- "\n mutation CreateJWT {\n accountCreateJWT {\n jwt\n }\n }\n": CreateJwtDocument,
66
- "\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": CreateMagicUrlTokenDocument,
67
- "\n mutation CreateMfaAuthenticator($type: String!) {\n accountCreateMfaAuthenticator(type: $type) {\n secret\n uri\n }\n }\n": CreateMfaAuthenticatorDocument,
68
- "\n mutation CreateMfaChallenge($factor: String!) {\n accountCreateMfaChallenge(factor: $factor) {\n userId\n expire\n }\n }\n": CreateMfaChallengeDocument,
69
- "\n mutation CreateMfaRecoveryCodes {\n accountCreateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": CreateMfaRecoveryCodesDocument,
70
- "\n mutation CreatePhoneToken($userId: String!, $phone: String!) {\n accountCreatePhoneToken(userId: $userId, phone: $phone) {\n expire\n }\n }\n": CreatePhoneTokenDocument,
71
- "\n mutation CreatePhoneVerification {\n accountCreatePhoneVerification {\n expire\n }\n }\n": CreatePhoneVerificationDocument,
72
- "\n mutation CreateSession($userId: String!, $secret: String!) {\n accountCreateSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": CreateSessionDocument,
73
- "\n mutation DeleteIdentity($identityId: String!) {\n accountDeleteIdentity(identityId: $identityId) {\n status\n }\n }\n": DeleteIdentityDocument,
74
- "\n mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {\n accountDeleteMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n": DeleteMfaAuthenticatorDocument,
75
- "\n mutation DeleteSession($sessionId: String!) {\n accountDeleteSession(sessionId: $sessionId) {\n status\n }\n }\n": DeleteSessionDocument,
76
- "\n mutation DeleteSessions {\n accountDeleteSessions {\n status\n }\n }\n": DeleteSessionsDocument,
77
- "\n query GetMfaRecoveryCodes {\n accountGetMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": GetMfaRecoveryCodesDocument,
78
- "\n query GetPrefs {\n accountGetPrefs {\n data\n }\n }\n": GetPrefsDocument,
79
- "\n query GetSession($sessionId: String!) {\n accountGetSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": GetSessionDocument,
80
- "\n query ListIdentities {\n accountListIdentities {\n total\n identities {\n ...Identity_Provider\n }\n }\n }\n": ListIdentitiesDocument,
81
- "\n query ListMfaFactors {\n accountListMfaFactors {\n totp\n phone\n email\n }\n }\n": ListMfaFactorsDocument,
82
- "\n query ListSessions {\n accountListSessions {\n sessions {\n _id\n _createdAt\n osName\n clientName\n }\n }\n }\n": ListSessionsDocument,
83
- "\n mutation CreateEmailPasswordSession($email: String!, $password: String!) {\n accountCreateEmailPasswordSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n": CreateEmailPasswordSessionDocument,
84
- "\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": ListLogsDocument,
85
- "\n mutation CreateRecovery($email: String!, $url: String!) {\n accountCreateRecovery(email: $email, url: $url) {\n expire\n }\n }\n": CreateRecoveryDocument,
86
- "\n mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {\n accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {\n expire\n }\n }\n": UpdateRecoveryDocument,
87
- "\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": CreateAccountDocument,
88
- "\n mutation VerifyEmail($url: String!) {\n accountCreateVerification(url: $url) {\n expire\n }\n }\n": VerifyEmailDocument,
89
- "\n mutation UpdateEmail($email: String!, $password: String!) {\n accountUpdateEmail(email: $email, password: $password) {\n name\n email\n }\n }\n": UpdateEmailDocument,
90
- "\n mutation UpdateMagicURLSession($userId: String!, $secret: String!) {\n accountUpdateMagicURLSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": UpdateMagicUrlSessionDocument,
91
- "\n mutation UpdateMFA($mfa: Boolean!) {\n accountUpdateMFA(mfa: $mfa) {\n mfa\n }\n }\n": UpdateMfaDocument,
92
- "\n mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {\n accountUpdateMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n": UpdateMfaAuthenticatorDocument,
93
- "\n mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {\n accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {\n status\n }\n }\n": UpdateMfaChallengeDocument,
94
- "\n mutation UpdateMfaRecoveryCodes {\n accountUpdateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": UpdateMfaRecoveryCodesDocument,
95
- "\n mutation UpdateName($name: String!) {\n accountUpdateName(name: $name) {\n name\n }\n }\n": UpdateNameDocument,
96
- "\n mutation UpdatePassword($password: String!, $oldPassword: String!) {\n accountUpdatePassword(password: $password, oldPassword: $oldPassword) {\n status\n }\n }\n": UpdatePasswordDocument,
97
- "\n mutation UpdatePhone($phone: String!, $password: String!) {\n accountUpdatePhone(phone: $phone, password: $password) {\n phone\n }\n }\n": UpdatePhoneDocument,
98
- "\n mutation UpdatePhoneSession($userId: String!, $secret: String!) {\n accountUpdatePhoneSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": UpdatePhoneSessionDocument,
99
- "\n mutation UpdatePhoneVerification($userId: String!, $secret: String!) {\n accountUpdatePhoneVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdatePhoneVerificationDocument,
100
- "\n mutation UpdatePrefs($prefs: JSON!) {\n accountUpdatePrefs(prefs: $prefs) {\n prefs {\n data\n }\n }\n }\n": UpdatePrefsDocument,
101
- "\n mutation UpdateSession($sessionId: String!) {\n accountUpdateSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": UpdateSessionDocument,
102
- "\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n secret\n expire\n userId\n }\n }\n": UpdateVerificationDocument,
103
- "\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": ListDocumentsDocument,
104
- "\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": CreateDocumentDocument,
105
- "\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": DeleteDocumentDocument,
106
- "\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": GetDocumentDocument,
107
- "\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": UpdateDocumentDocument,
108
- "\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": CreateExecutionDocument,
109
- "\n query GetFunctionExecution($functionId: String!, $executionId: String!) {\n functionsGetExecution(functionId: $functionId, executionId: $executionId) {\n status\n errors\n duration\n }\n }\n": GetFunctionExecutionDocument
110
- };
111
- function gql(source) {
112
- return documents[source] ?? {};
113
- }
114
-
115
- // src/account/fragments.ts
116
- var Account_User = gql(
117
- /* GraphQL */
118
- `
1
+ import { useMemo, useEffect, useState } from 'react';
2
+ import { Client, Account, Databases, Functions, Graphql, ID } from 'appwrite';
3
+ import { print } from 'graphql';
4
+ import { QueryClient, useMutation, useQuery, useSuspenseQuery } from '@tanstack/react-query';
5
+ import { atom, useAtom } from 'jotai';
6
+ import { produce, castDraft } from 'immer';
7
+
8
+ function Fe(e,i){return i}var h={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"}}]}}]},T={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"}}]}}]}}]},q={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"}}]}}]}}]},_={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"}}]}}]}}]},F={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"}}]}}]}}]},E={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"}}]}}]}}]},P={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"}}]}}]}}]},R={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"}}]}}]}}]},L={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"}}]}}]}}]},Q={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"}}]}}]}}]},G={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"}}]}}]}}]},O={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"}}]}}]}}]},J={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"}}]}}]}}]},B={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"}}]}}]}}]},K={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"}}]}}]}}]},W={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"}}]}}]}}]},j={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"}}]}}]}}]},z={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"}}]}}]}}]},H={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"}}]}}]},Y={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"}}]}}]}}]},Z={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"}}]}}]}}]}}]},ee={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"}}]}}]}}]},ne={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"}}]}}]}}]}}]},te={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"}}]}}]}}]},ae={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"}}]}}]}}]},ie={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"}}]}}]}}]},oe={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"}}]}}]}}]},re={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"}}]}}]}}]},se={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"}}]}}]}}]},ue={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"}}]}}]}}]},ce={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"}}]}}]}}]},de={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"}}]}}]}}]},le={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"}}]}}]}}]},pe={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"}}]}}]}}]},ye={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"}}]}}]}}]},Se={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"}}]}}]}}]},ke={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"}}]}}]}}]},fe={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"}}]}}]}}]}}]},ge={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"}}]}}]}}]},ve={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"}}]}}]}}]},be={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"}}]}}]}}]}}]},Me={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"}}]}}]}}]},Ne={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"}}]}}]}}]},De={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"}}]}}]}}]},xe={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"}}]}}]}}]};var Pe={"\n fragment Account_User on User {\n _id\n name\n email\n prefs {\n data\n }\n }\n":h,"\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":T,"\n mutation CreateAnonymousSession {\n accountCreateAnonymousSession {\n _id\n expire\n current\n }\n }\n":q,"\n mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {\n accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {\n expire\n }\n }\n":_,"\n mutation CreateJWT {\n accountCreateJWT {\n jwt\n }\n }\n":F,"\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":E,"\n mutation CreateMfaAuthenticator($type: String!) {\n accountCreateMfaAuthenticator(type: $type) {\n secret\n uri\n }\n }\n":P,"\n mutation CreateMfaChallenge($factor: String!) {\n accountCreateMfaChallenge(factor: $factor) {\n userId\n expire\n }\n }\n":R,"\n mutation CreateMfaRecoveryCodes {\n accountCreateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n":L,"\n mutation CreatePhoneToken($userId: String!, $phone: String!) {\n accountCreatePhoneToken(userId: $userId, phone: $phone) {\n expire\n }\n }\n":Q,"\n mutation CreatePhoneVerification {\n accountCreatePhoneVerification {\n expire\n }\n }\n":G,"\n mutation CreateSession($userId: String!, $secret: String!) {\n accountCreateSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n":O,"\n mutation DeleteIdentity($identityId: String!) {\n accountDeleteIdentity(identityId: $identityId) {\n status\n }\n }\n":J,"\n mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {\n accountDeleteMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n":B,"\n mutation DeleteSession($sessionId: String!) {\n accountDeleteSession(sessionId: $sessionId) {\n status\n }\n }\n":K,"\n mutation DeleteSessions {\n accountDeleteSessions {\n status\n }\n }\n":W,"\n query GetMfaRecoveryCodes {\n accountGetMfaRecoveryCodes {\n recoveryCodes\n }\n }\n":j,"\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":z,"\n query ListIdentities {\n accountListIdentities {\n total\n identities {\n ...Identity_Provider\n }\n }\n }\n":H,"\n query ListMfaFactors {\n accountListMfaFactors {\n totp\n phone\n email\n }\n }\n":Y,"\n query ListSessions {\n accountListSessions {\n sessions {\n _id\n _createdAt\n osName\n clientName\n }\n }\n }\n":Z,"\n mutation CreateEmailPasswordSession($email: String!, $password: String!) {\n accountCreateEmailPasswordSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n":ee,"\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":ne,"\n mutation CreateRecovery($email: String!, $url: String!) {\n accountCreateRecovery(email: $email, url: $url) {\n expire\n }\n }\n":te,"\n mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {\n accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {\n expire\n }\n }\n":ae,"\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":ie,"\n mutation VerifyEmail($url: String!) {\n accountCreateVerification(url: $url) {\n expire\n }\n }\n":oe,"\n mutation UpdateEmail($email: String!, $password: String!) {\n accountUpdateEmail(email: $email, password: $password) {\n name\n email\n }\n }\n":re,"\n mutation UpdateMagicURLSession($userId: String!, $secret: String!) {\n accountUpdateMagicURLSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n":se,"\n mutation UpdateMFA($mfa: Boolean!) {\n accountUpdateMFA(mfa: $mfa) {\n mfa\n }\n }\n":ue,"\n mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {\n accountUpdateMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n":ce,"\n mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {\n accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {\n status\n }\n }\n":de,"\n mutation UpdateMfaRecoveryCodes {\n accountUpdateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n":le,"\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":pe,"\n mutation UpdatePhone($phone: String!, $password: String!) {\n accountUpdatePhone(phone: $phone, password: $password) {\n phone\n }\n }\n":ye,"\n mutation UpdatePhoneSession($userId: String!, $secret: String!) {\n accountUpdatePhoneSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n":Se,"\n mutation UpdatePhoneVerification($userId: String!, $secret: String!) {\n accountUpdatePhoneVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n":ke,"\n mutation UpdatePrefs($prefs: JSON!) {\n accountUpdatePrefs(prefs: $prefs) {\n prefs {\n data\n }\n }\n }\n":fe,"\n mutation UpdateSession($sessionId: String!) {\n accountUpdateSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n":ge,"\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n secret\n expire\n userId\n }\n }\n":ve,"\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":be,"\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":Me,"\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":Ne,"\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":De,"\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":xe,"\n query GetFunctionExecution($functionId: String!, $executionId: String!) {\n functionsGetExecution(functionId: $functionId, executionId: $executionId) {\n status\n errors\n duration\n }\n }\n":$e};function o(e){return Pe[e]??{}}var Ce=o(`
119
9
  fragment Account_User on User {
120
10
  _id
121
11
  name
@@ -124,170 +14,19 @@ var Account_User = gql(
124
14
  data
125
15
  }
126
16
  }
127
- `
128
- );
129
- var Identity_Provider = gql(
130
- /* GraphQL */
131
- `
17
+ `),we=o(`
132
18
  fragment Identity_Provider on Identity {
133
19
  _id
134
20
  userId
135
21
  provider
136
22
  }
137
- `
138
- );
139
-
140
- // src/useAppwrite.ts
141
- import { useMemo } from "react";
142
- import { Account, Client, Databases, Functions, Graphql } from "appwrite";
143
- import { print } from "graphql";
144
- import { atom, useAtom } from "jotai";
145
- var client = new Client();
146
- var endpoint = process.env.APPWRITE_ENDPOINT ?? process.env.NEXT_PUBLIC_APPWRITE_URL ?? "http://localhost/v1";
147
- var projectId = process.env.APPWRITE_PROJECT_ID ?? process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID ?? "[PROJECT_ID]";
148
- client.setEndpoint(endpoint).setProject(projectId);
149
- var account = new Account(client);
150
- var databases = new Databases(client);
151
- var functions = new Functions(client);
152
- var graphql = new Graphql(client);
153
- var AccountAtom = atom(account);
154
- var DatabasesAtom = atom(databases);
155
- var FunctionsAtom = atom(functions);
156
- var GraphqlAtom = atom(graphql);
157
- function useAppwrite() {
158
- const [account2] = useAtom(AccountAtom);
159
- const [databases2] = useAtom(DatabasesAtom);
160
- const [functions2] = useAtom(FunctionsAtom);
161
- const [graphqlAppwrite] = useAtom(GraphqlAtom);
162
- const graphql2 = useMemo(
163
- () => ({
164
- client: graphqlAppwrite.client,
165
- query: async ({
166
- query,
167
- variables
168
- }) => {
169
- const { data, errors } = await graphqlAppwrite.query({
170
- query: print(query),
171
- variables
172
- });
173
- return { data, errors };
174
- },
175
- mutation: async ({
176
- query,
177
- variables
178
- }) => {
179
- const { data, errors } = await graphqlAppwrite.mutation({
180
- query: print(query),
181
- variables
182
- });
183
- return { data, errors };
184
- }
185
- }),
186
- [graphqlAppwrite]
187
- );
188
- return {
189
- account: account2,
190
- databases: databases2,
191
- functions: functions2,
192
- graphql: graphql2
193
- };
194
- }
195
-
196
- // src/useMutation.ts
197
- import {
198
- useMutation as useReactMutation
199
- } from "@tanstack/react-query";
200
-
201
- // src/useQueryClient.ts
202
- import { useAtom as useAtom2 } from "jotai";
203
-
204
- // src/states/query.ts
205
- import { QueryClient } from "@tanstack/react-query";
206
- import { atom as atom2 } from "jotai";
207
- var queryClient = new QueryClient();
208
- var QueryAtom = atom2(queryClient);
209
-
210
- // src/useQueryClient.ts
211
- function useQueryClient() {
212
- const [queryClient2] = useAtom2(QueryAtom);
213
- return queryClient2;
214
- }
215
-
216
- // src/useMutation.ts
217
- function useMutation(options) {
218
- const queryClient2 = useQueryClient();
219
- return useReactMutation(options, queryClient2);
220
- }
221
-
222
- // src/useQuery.ts
223
- import {
224
- useQuery as useReactQuery
225
- } from "@tanstack/react-query";
226
- function useQuery(options) {
227
- const queryClient2 = useQueryClient();
228
- return useReactQuery(options, queryClient2);
229
- }
230
-
231
- // src/account/useAccount.ts
232
- import { useEffect } from "react";
233
- import { castDraft, produce } from "immer";
234
- var getAccount = gql(
235
- /* GraphQL */
236
- `
23
+ `);var D=new Client,Ke=process.env.APPWRITE_ENDPOINT??process.env.NEXT_PUBLIC_APPWRITE_URL??"http://localhost/v1",We=process.env.APPWRITE_PROJECT_ID??process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID??"[PROJECT_ID]";D.setEndpoint(Ke).setProject(We);var je=new Account(D),Xe=new Databases(D),ze=new Functions(D),I=new Graphql(D);function r(){let e=useMemo(()=>({client:I.client,query:async({query:i,variables:a})=>{let{data:n,errors:t}=await I.query({query:print(i),variables:a});return {data:n,errors:t}},mutation:async({query:i,variables:a})=>{let{data:n,errors:t}=await I.mutation({query:print(i),variables:a});return {data:n,errors:t}}}),[I]);return {account:je,databases:Xe,functions:ze,graphql:e}}var Ze=new QueryClient,Ae=atom(Ze);function p(){let[e]=useAtom(Ae);return e}function u(e){let i=p();return useMutation(e,i)}function m(e){let i=p();return useQuery(e,i)}var sn=o(`
237
24
  query AccountGet {
238
25
  accountGet {
239
26
  ...Account_User
240
27
  }
241
28
  }
242
- `
243
- );
244
- function useAccount() {
245
- const { graphql: graphql2 } = useAppwrite();
246
- const queryClient2 = useQueryClient();
247
- const queryResult = useQuery({
248
- queryKey: ["appwrite", "account"],
249
- queryFn: async () => {
250
- const { data, errors } = await graphql2.query({
251
- query: getAccount
252
- });
253
- if (errors) {
254
- throw errors;
255
- }
256
- return data.accountGet;
257
- },
258
- retry: false
259
- });
260
- useEffect(() => {
261
- const unsubscribe = graphql2.client.subscribe(
262
- "account",
263
- (response) => {
264
- const isUpdatingPreferences = response.events.some((event) => event.endsWith("prefs"));
265
- if (isUpdatingPreferences) {
266
- queryClient2.setQueryData(
267
- ["appwrite", "account"],
268
- (account2) => produce(account2, (draft) => {
269
- if (draft) {
270
- draft.prefs = castDraft(response.payload.prefs);
271
- }
272
- })
273
- );
274
- return;
275
- }
276
- queryClient2.setQueryData(
277
- ["appwrite", "account"],
278
- response.payload
279
- );
280
- }
281
- );
282
- return unsubscribe;
283
- }, [graphql2.client, queryClient2]);
284
- return queryResult;
285
- }
286
-
287
- // src/account/useCreateAnonymousSession.ts
288
- var createAnonymousSession = gql(
289
- /* GraphQL */
290
- `
29
+ `);function un(){let{graphql:e}=r(),i=p(),a=m({queryKey:["appwrite","account"],queryFn:async()=>{let{data:n,errors:t}=await e.query({query:sn});if(t)throw t;return n.accountGet},retry:!1});return useEffect(()=>e.client.subscribe("account",t=>{if(t.events.some(c=>c.endsWith("prefs"))){i.setQueryData(["appwrite","account"],c=>produce(c,d=>{d&&(d.prefs=castDraft(t.payload.prefs));}));return}i.setQueryData(["appwrite","account"],t.payload);}),[e.client,i]),a}var cn=o(`
291
30
  mutation CreateAnonymousSession {
292
31
  accountCreateAnonymousSession {
293
32
  _id
@@ -295,301 +34,57 @@ var createAnonymousSession = gql(
295
34
  current
296
35
  }
297
36
  }
298
- `
299
- );
300
- function useCreateAnonymousSession() {
301
- const { graphql: graphql2 } = useAppwrite();
302
- const queryResult = useMutation({
303
- mutationFn: async () => {
304
- const { data, errors } = await graphql2.mutation({
305
- query: createAnonymousSession
306
- });
307
- if (errors) {
308
- throw errors;
309
- }
310
- return data.accountCreateAnonymousSession;
311
- }
312
- });
313
- return { ...queryResult };
314
- }
315
-
316
- // src/account/useCreateEmailToken.ts
317
- var createEmailToken = gql(
318
- /* GraphQL */
319
- `
37
+ `);function dn(){let{graphql:e}=r();return {...u({mutationFn:async()=>{let{data:a,errors:n}=await e.mutation({query:cn});if(n)throw n;return a.accountCreateAnonymousSession}})}}var ln=o(`
320
38
  mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {
321
39
  accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {
322
40
  expire
323
41
  }
324
42
  }
325
- `
326
- );
327
- function useCreateEmailToken() {
328
- const { graphql: graphql2 } = useAppwrite();
329
- const queryResult = useMutation({
330
- mutationFn: async ({ userId, email, phrase }) => {
331
- const { data, errors } = await graphql2.mutation({
332
- query: createEmailToken,
333
- variables: {
334
- userId,
335
- email,
336
- phrase
337
- }
338
- });
339
- if (errors) {
340
- throw errors;
341
- }
342
- return data.accountCreateEmailToken;
343
- }
344
- });
345
- return { ...queryResult };
346
- }
347
-
348
- // src/useSuspenseQuery.ts
349
- import {
350
- useSuspenseQuery as useSuspenseReactQuery
351
- } from "@tanstack/react-query";
352
- function useSuspenseQuery(options) {
353
- const queryClient2 = useQueryClient();
354
- return useSuspenseReactQuery(options, queryClient2);
355
- }
356
-
357
- // src/account/useCreateJWT.ts
358
- var accountCreateJWT = gql(
359
- /* GraphQL */
360
- `
43
+ `);function mn(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,email:n,phrase:t})=>{let{data:s,errors:c}=await e.mutation({query:ln,variables:{userId:a,email:n,phrase:t}});if(c)throw c;return s.accountCreateEmailToken}})}}function f(e){let i=p();return useSuspenseQuery(e,i)}var he=o(`
361
44
  mutation CreateJWT {
362
45
  accountCreateJWT {
363
46
  jwt
364
47
  }
365
48
  }
366
- `
367
- );
368
- function useCreateJWT({ gcTime = 6e5 } = {}) {
369
- const { graphql: graphql2 } = useAppwrite();
370
- const queryClient2 = useQueryClient();
371
- const queryResult = useMutation({
372
- gcTime,
373
- mutationKey: ["appwrite", "jwt"],
374
- mutationFn: async () => {
375
- const { data, errors } = await graphql2.mutation({
376
- query: accountCreateJWT
377
- });
378
- if (errors) {
379
- throw errors;
380
- }
381
- return data.accountCreateJWT;
382
- },
383
- onSuccess: (data) => {
384
- graphql2.client.setJWT(data.jwt);
385
- queryClient2.setQueryData(["appwrite", "jwt"], data.jwt, { updatedAt: Date.now() });
386
- }
387
- });
388
- return { ...queryResult };
389
- }
390
- function useSuspenseCreateJWT({ gcTime = 6e5 } = {}) {
391
- const { graphql: graphql2 } = useAppwrite();
392
- const queryResult = useSuspenseQuery({
393
- gcTime,
394
- queryKey: ["appwrite", "jwt"],
395
- queryFn: async () => {
396
- const { data, errors } = await graphql2.mutation({
397
- query: accountCreateJWT
398
- });
399
- if (errors) {
400
- throw errors;
401
- }
402
- graphql2.client.setJWT(data.accountCreateJWT.jwt);
403
- return data.accountCreateJWT;
404
- }
405
- });
406
- return { ...queryResult };
407
- }
408
-
409
- // src/account/useCreateMagicURLToken.ts
410
- var createMagicURLToken = gql(
411
- /* GraphQL */
412
- `
49
+ `);function yn({gcTime:e=6e5}={}){let{graphql:i}=r(),a=p();return {...u({gcTime:e,mutationKey:["appwrite","jwt"],mutationFn:async()=>{let{data:t,errors:s}=await i.mutation({query:he});if(s)throw s;return t.accountCreateJWT},onSuccess:t=>{i.client.setJWT(t.jwt),a.setQueryData(["appwrite","jwt"],t.jwt,{updatedAt:Date.now()});}})}}function Sn({gcTime:e=6e5}={}){let{graphql:i}=r();return {...f({gcTime:e,queryKey:["appwrite","jwt"],queryFn:async()=>{let{data:n,errors:t}=await i.mutation({query:he});if(t)throw t;return i.client.setJWT(n.accountCreateJWT.jwt),n.accountCreateJWT}})}}var kn=o(`
413
50
  mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
414
51
  accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
415
52
  expire
416
53
  }
417
54
  }
418
- `
419
- );
420
- function useCreateMagicURLToken() {
421
- const { graphql: graphql2 } = useAppwrite();
422
- const queryResult = useMutation({
423
- mutationFn: async ({ userId, email, url, phrase }) => {
424
- const { data, errors } = await graphql2.mutation({
425
- query: createMagicURLToken,
426
- variables: {
427
- userId,
428
- email,
429
- url,
430
- phrase
431
- }
432
- });
433
- if (errors) {
434
- throw errors;
435
- }
436
- return data.accountCreateMagicURLToken;
437
- }
438
- });
439
- return { ...queryResult };
440
- }
441
-
442
- // src/account/useCreateMfaAuthenticator.ts
443
- var accountCreateMfaAuthenticator = gql(
444
- /* GraphQL */
445
- `
55
+ `);function fn(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,email:n,url:t,phrase:s})=>{let{data:c,errors:d}=await e.mutation({query:kn,variables:{userId:a,email:n,url:t,phrase:s}});if(d)throw d;return c.accountCreateMagicURLToken}})}}var gn=o(`
446
56
  mutation CreateMfaAuthenticator($type: String!) {
447
57
  accountCreateMfaAuthenticator(type: $type) {
448
58
  secret
449
59
  uri
450
60
  }
451
61
  }
452
- `
453
- );
454
- function useCreateMfaAuthenticator() {
455
- const { graphql: graphql2 } = useAppwrite();
456
- const queryResult = useMutation({
457
- mutationFn: async ({ type = "totp" }) => {
458
- const { data, errors } = await graphql2.mutation({
459
- query: accountCreateMfaAuthenticator,
460
- variables: {
461
- type
462
- }
463
- });
464
- if (errors) {
465
- throw errors;
466
- }
467
- return data.accountCreateMfaAuthenticator;
468
- }
469
- });
470
- return { ...queryResult };
471
- }
472
-
473
- // src/account/useCreateMfaChallenge.ts
474
- var accountCreateMfaChallenge = gql(
475
- /* GraphQL */
476
- `
62
+ `);function vn(){let{graphql:e}=r();return {...u({mutationFn:async({type:a="totp"})=>{let{data:n,errors:t}=await e.mutation({query:gn,variables:{type:a}});if(t)throw t;return n.accountCreateMfaAuthenticator}})}}var bn=o(`
477
63
  mutation CreateMfaChallenge($factor: String!) {
478
64
  accountCreateMfaChallenge(factor: $factor) {
479
65
  userId
480
66
  expire
481
67
  }
482
68
  }
483
- `
484
- );
485
- function useCreateMfaChallenge() {
486
- const { graphql: graphql2 } = useAppwrite();
487
- const queryResult = useMutation({
488
- mutationFn: async ({ factor }) => {
489
- const { data, errors } = await graphql2.mutation({
490
- query: accountCreateMfaChallenge,
491
- variables: {
492
- factor
493
- }
494
- });
495
- if (errors) {
496
- throw errors;
497
- }
498
- return data.accountCreateMfaChallenge;
499
- }
500
- });
501
- return { ...queryResult };
502
- }
503
-
504
- // src/account/useCreateMfaRecoveryCodes.ts
505
- var accountCreateMfaRecoveryCodes = gql(
506
- /* GraphQL */
507
- `
69
+ `);function Mn(){let{graphql:e}=r();return {...u({mutationFn:async({factor:a})=>{let{data:n,errors:t}=await e.mutation({query:bn,variables:{factor:a}});if(t)throw t;return n.accountCreateMfaChallenge}})}}var Nn=o(`
508
70
  mutation CreateMfaRecoveryCodes {
509
71
  accountCreateMfaRecoveryCodes {
510
72
  recoveryCodes
511
73
  }
512
74
  }
513
- `
514
- );
515
- function useCreateMfaRecoveryCodes() {
516
- const { graphql: graphql2 } = useAppwrite();
517
- const queryResult = useMutation({
518
- mutationFn: async () => {
519
- const { data, errors } = await graphql2.mutation({
520
- query: accountCreateMfaRecoveryCodes
521
- });
522
- if (errors) {
523
- throw errors;
524
- }
525
- return data.accountCreateMfaRecoveryCodes;
526
- }
527
- });
528
- return { ...queryResult };
529
- }
530
-
531
- // src/account/useCreatePhoneToken.ts
532
- var createPhoneToken = gql(
533
- /* GraphQL */
534
- `
75
+ `);function Dn(){let{graphql:e}=r();return {...u({mutationFn:async()=>{let{data:a,errors:n}=await e.mutation({query:Nn});if(n)throw n;return a.accountCreateMfaRecoveryCodes}})}}var In=o(`
535
76
  mutation CreatePhoneToken($userId: String!, $phone: String!) {
536
77
  accountCreatePhoneToken(userId: $userId, phone: $phone) {
537
78
  expire
538
79
  }
539
80
  }
540
- `
541
- );
542
- function useCreatePhoneToken() {
543
- const { graphql: graphql2 } = useAppwrite();
544
- const queryResult = useMutation({
545
- mutationFn: async ({ userId, phone }) => {
546
- const { data, errors } = await graphql2.mutation({
547
- query: createPhoneToken,
548
- variables: {
549
- userId,
550
- phone
551
- }
552
- });
553
- if (errors) {
554
- throw errors;
555
- }
556
- return data.accountCreatePhoneToken;
557
- }
558
- });
559
- return { ...queryResult };
560
- }
561
-
562
- // src/account/useCreatePhoneVerification.ts
563
- var createPhoneVerification = gql(
564
- /* GraphQL */
565
- `
81
+ `);function xn(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,phone:n})=>{let{data:t,errors:s}=await e.mutation({query:In,variables:{userId:a,phone:n}});if(s)throw s;return t.accountCreatePhoneToken}})}}var $n=o(`
566
82
  mutation CreatePhoneVerification {
567
83
  accountCreatePhoneVerification {
568
84
  expire
569
85
  }
570
86
  }
571
- `
572
- );
573
- function useCreatePhoneVerification() {
574
- const { graphql: graphql2 } = useAppwrite();
575
- const queryResult = useMutation({
576
- mutationFn: async () => {
577
- const { data, errors } = await graphql2.mutation({
578
- query: createPhoneVerification
579
- });
580
- if (errors) {
581
- throw errors;
582
- }
583
- return data.accountCreatePhoneVerification;
584
- }
585
- });
586
- return { ...queryResult };
587
- }
588
-
589
- // src/account/useCreateSession.ts
590
- var createSession = gql(
591
- /* GraphQL */
592
- `
87
+ `);function Cn(){let{graphql:e}=r();return {...u({mutationFn:async()=>{let{data:a,errors:n}=await e.mutation({query:$n});if(n)throw n;return a.accountCreatePhoneVerification}})}}var wn=o(`
593
88
  mutation CreateSession($userId: String!, $secret: String!) {
594
89
  accountCreateSession(userId: $userId, secret: $secret) {
595
90
  userId
@@ -597,206 +92,43 @@ var createSession = gql(
597
92
  current
598
93
  }
599
94
  }
600
- `
601
- );
602
- function useCreateSession() {
603
- const { graphql: graphql2 } = useAppwrite();
604
- const queryResult = useMutation({
605
- mutationFn: async ({ userId, secret }) => {
606
- const { data, errors } = await graphql2.mutation({
607
- query: createSession,
608
- variables: {
609
- userId,
610
- secret
611
- }
612
- });
613
- if (errors) {
614
- throw errors;
615
- }
616
- return data.accountCreateSession;
617
- }
618
- });
619
- return { ...queryResult };
620
- }
621
-
622
- // src/account/useDeleteIdentity.ts
623
- var accountDeleteIdentity = gql(
624
- /* GraphQL */
625
- `
95
+ `);function Un(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,secret:n})=>{let{data:t,errors:s}=await e.mutation({query:wn,variables:{userId:a,secret:n}});if(s)throw s;return t.accountCreateSession}})}}var An=o(`
626
96
  mutation DeleteIdentity($identityId: String!) {
627
97
  accountDeleteIdentity(identityId: $identityId) {
628
98
  status
629
99
  }
630
100
  }
631
- `
632
- );
633
- function useDeleteIdentity() {
634
- const { graphql: graphql2 } = useAppwrite();
635
- const queryResult = useMutation({
636
- mutationFn: async ({ identityId }) => {
637
- const { data, errors } = await graphql2.mutation({
638
- query: accountDeleteIdentity,
639
- variables: {
640
- identityId
641
- }
642
- });
643
- if (errors) {
644
- throw errors;
645
- }
646
- return data?.accountDeleteIdentity ?? { status: false };
647
- }
648
- });
649
- return { ...queryResult };
650
- }
651
-
652
- // src/account/useDeleteMfaAuthenticator.ts
653
- var updateMFAAuthenticator = gql(
654
- /* GraphQL */
655
- `
101
+ `);function hn(){let{graphql:e}=r();return {...u({mutationFn:async({identityId:a})=>{let{data:n,errors:t}=await e.mutation({query:An,variables:{identityId:a}});if(t)throw t;return n?.accountDeleteIdentity??{status:!1}}})}}var Vn=o(`
656
102
  mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {
657
103
  accountDeleteMfaAuthenticator(type: $type, otp: $otp) {
658
104
  mfa
659
105
  }
660
106
  }
661
- `
662
- );
663
- function useDeleteMfaAuthenticator() {
664
- const { graphql: graphql2 } = useAppwrite();
665
- const queryResult = useMutation({
666
- mutationFn: async ({ type = "totp", otp }) => {
667
- const { data, errors } = await graphql2.mutation({
668
- query: updateMFAAuthenticator,
669
- variables: {
670
- type,
671
- otp
672
- }
673
- });
674
- if (errors) {
675
- throw errors;
676
- }
677
- return data.accountDeleteMfaAuthenticator;
678
- }
679
- });
680
- return { ...queryResult };
681
- }
682
-
683
- // src/account/useDeleteSession.ts
684
- var deleteSession = gql(
685
- /* GraphQL */
686
- `
107
+ `);function Tn(){let{graphql:e}=r();return {...u({mutationFn:async({type:a="totp",otp:n})=>{let{data:t,errors:s}=await e.mutation({query:Vn,variables:{type:a,otp:n}});if(s)throw s;return t.accountDeleteMfaAuthenticator}})}}var qn=o(`
687
108
  mutation DeleteSession($sessionId: String!) {
688
109
  accountDeleteSession(sessionId: $sessionId) {
689
110
  status
690
111
  }
691
112
  }
692
- `
693
- );
694
- function useDeleteSession() {
695
- const { graphql: graphql2 } = useAppwrite();
696
- const queryResult = useMutation({
697
- mutationFn: async ({ sessionId }) => {
698
- const { data, errors } = await graphql2.mutation({
699
- query: deleteSession,
700
- variables: {
701
- sessionId
702
- }
703
- });
704
- if (errors) {
705
- throw errors;
706
- }
707
- return data?.accountDeleteSession ?? { status: false };
708
- }
709
- });
710
- return { ...queryResult };
711
- }
712
-
713
- // src/account/useDeleteSessions.ts
714
- var deleteSessions = gql(
715
- /* GraphQL */
716
- `
113
+ `);function _n(){let{graphql:e}=r();return {...u({mutationFn:async({sessionId:a})=>{let{data:n,errors:t}=await e.mutation({query:qn,variables:{sessionId:a}});if(t)throw t;return n?.accountDeleteSession??{status:!1}}})}}var Fn=o(`
717
114
  mutation DeleteSessions {
718
115
  accountDeleteSessions {
719
116
  status
720
117
  }
721
118
  }
722
- `
723
- );
724
- function useDeleteSessions() {
725
- const { graphql: graphql2 } = useAppwrite();
726
- const queryResult = useMutation({
727
- mutationFn: async () => {
728
- const { data, errors } = await graphql2.mutation({
729
- query: deleteSessions
730
- });
731
- if (errors) {
732
- throw errors;
733
- }
734
- return data?.accountDeleteSessions ?? { status: false };
735
- }
736
- });
737
- return { ...queryResult };
738
- }
739
-
740
- // src/account/useGetMfaRecoveryCodes.ts
741
- var getMFARecoveryCodes = gql(
742
- /* GraphQL */
743
- `
119
+ `);function En(){let{graphql:e}=r();return {...u({mutationFn:async()=>{let{data:a,errors:n}=await e.mutation({query:Fn});if(n)throw n;return a?.accountDeleteSessions??{status:!1}}})}}var Pn=o(`
744
120
  query GetMfaRecoveryCodes {
745
121
  accountGetMfaRecoveryCodes {
746
122
  recoveryCodes
747
123
  }
748
124
  }
749
- `
750
- );
751
- function useGetMfaRecoveryCodes() {
752
- const { graphql: graphql2 } = useAppwrite();
753
- const queryResult = useQuery({
754
- queryKey: ["appwrite", "account", "mfa", "recovery-codes"],
755
- queryFn: async () => {
756
- const { data, errors } = await graphql2.query({
757
- query: getMFARecoveryCodes
758
- });
759
- if (errors) {
760
- throw errors;
761
- }
762
- return data.accountGetMfaRecoveryCodes;
763
- }
764
- });
765
- return { ...queryResult };
766
- }
767
-
768
- // src/account/useGetPrefs.ts
769
- var accountGetPrefs = gql(
770
- /* GraphQL */
771
- `
125
+ `);function Rn(){let{graphql:e}=r();return {...m({queryKey:["appwrite","account","mfa","recovery-codes"],queryFn:async()=>{let{data:a,errors:n}=await e.query({query:Pn});if(n)throw n;return a.accountGetMfaRecoveryCodes}})}}var Ln=o(`
772
126
  query GetPrefs {
773
127
  accountGetPrefs {
774
128
  data
775
129
  }
776
130
  }
777
- `
778
- );
779
- function useGetPrefs() {
780
- const { graphql: graphql2 } = useAppwrite();
781
- const queryResult = useQuery({
782
- queryKey: ["appwrite", "account", "prefs"],
783
- queryFn: async () => {
784
- const { data, errors } = await graphql2.query({
785
- query: accountGetPrefs
786
- });
787
- if (errors) {
788
- throw errors;
789
- }
790
- return data.accountGetPrefs;
791
- }
792
- });
793
- return { ...queryResult };
794
- }
795
-
796
- // src/account/useGetSession.ts
797
- var getSession = gql(
798
- /* GraphQL */
799
- `
131
+ `);function Qn(){let{graphql:e}=r();return {...m({queryKey:["appwrite","account","prefs"],queryFn:async()=>{let{data:a,errors:n}=await e.query({query:Ln});if(n)throw n;return a.accountGetPrefs}})}}var Gn=o(`
800
132
  query GetSession($sessionId: String!) {
801
133
  accountGetSession(sessionId: $sessionId) {
802
134
  userId
@@ -804,30 +136,7 @@ var getSession = gql(
804
136
  current
805
137
  }
806
138
  }
807
- `
808
- );
809
- function useGetSession({ sessionId }) {
810
- const { graphql: graphql2 } = useAppwrite();
811
- const queryResult = useQuery({
812
- queryKey: ["appwrite", "account", "session", sessionId],
813
- queryFn: async () => {
814
- const { data, errors } = await graphql2.query({
815
- query: getSession,
816
- variables: { sessionId }
817
- });
818
- if (errors) {
819
- throw errors;
820
- }
821
- return data.accountGetSession;
822
- }
823
- });
824
- return queryResult;
825
- }
826
-
827
- // src/account/useListIdentities.ts
828
- var accountListIdentities = gql(
829
- /* GraphQL */
830
- `
139
+ `);function On({sessionId:e}){let{graphql:i}=r();return m({queryKey:["appwrite","account","session",e],queryFn:async()=>{let{data:n,errors:t}=await i.query({query:Gn,variables:{sessionId:e}});if(t)throw t;return n.accountGetSession}})}var Jn=o(`
831
140
  query ListIdentities {
832
141
  accountListIdentities {
833
142
  total
@@ -836,29 +145,7 @@ var accountListIdentities = gql(
836
145
  }
837
146
  }
838
147
  }
839
- `
840
- );
841
- function useListIdentities() {
842
- const { graphql: graphql2 } = useAppwrite();
843
- const queryResult = useQuery({
844
- queryKey: ["appwrite", "account", "identities"],
845
- queryFn: async () => {
846
- const { data, errors } = await graphql2.query({
847
- query: accountListIdentities
848
- });
849
- if (errors) {
850
- throw errors;
851
- }
852
- return data.accountListIdentities;
853
- }
854
- });
855
- return { ...queryResult };
856
- }
857
-
858
- // src/account/useListMfaFactors.ts
859
- var listMFAFactors = gql(
860
- /* GraphQL */
861
- `
148
+ `);function Bn(){let{graphql:e}=r();return {...m({queryKey:["appwrite","account","identities"],queryFn:async()=>{let{data:a,errors:n}=await e.query({query:Jn});if(n)throw n;return a.accountListIdentities}})}}var Kn=o(`
862
149
  query ListMfaFactors {
863
150
  accountListMfaFactors {
864
151
  totp
@@ -866,29 +153,7 @@ var listMFAFactors = gql(
866
153
  email
867
154
  }
868
155
  }
869
- `
870
- );
871
- function useListMfaFactors() {
872
- const { graphql: graphql2 } = useAppwrite();
873
- const queryResult = useQuery({
874
- queryKey: ["appwrite", "account", "mfa", "factors"],
875
- queryFn: async () => {
876
- const { data, errors } = await graphql2.query({
877
- query: listMFAFactors
878
- });
879
- if (errors) {
880
- throw errors;
881
- }
882
- return data.accountListMfaFactors;
883
- }
884
- });
885
- return { ...queryResult };
886
- }
887
-
888
- // src/account/useListSessions.ts
889
- var accountListSessions = gql(
890
- /* GraphQL */
891
- `
156
+ `);function Wn(){let{graphql:e}=r();return {...m({queryKey:["appwrite","account","mfa","factors"],queryFn:async()=>{let{data:a,errors:n}=await e.query({query:Kn});if(n)throw n;return a.accountListMfaFactors}})}}var jn=o(`
892
157
  query ListSessions {
893
158
  accountListSessions {
894
159
  sessions {
@@ -899,29 +164,7 @@ var accountListSessions = gql(
899
164
  }
900
165
  }
901
166
  }
902
- `
903
- );
904
- function useListSessions() {
905
- const { graphql: graphql2 } = useAppwrite();
906
- const queryResult = useQuery({
907
- queryKey: ["appwrite", "account", "sessions"],
908
- queryFn: async () => {
909
- const { data, errors } = await graphql2.query({
910
- query: accountListSessions
911
- });
912
- if (errors) {
913
- throw errors;
914
- }
915
- return data.accountListSessions;
916
- }
917
- });
918
- return { ...queryResult };
919
- }
920
-
921
- // src/account/useLogin.ts
922
- var accountCreateEmailPasswordSession = gql(
923
- /* GraphQL */
924
- `
167
+ `);function Xn(){let{graphql:e}=r();return {...m({queryKey:["appwrite","account","sessions"],queryFn:async()=>{let{data:a,errors:n}=await e.query({query:jn});if(n)throw n;return a.accountListSessions}})}}var zn=o(`
925
168
  mutation CreateEmailPasswordSession($email: String!, $password: String!) {
926
169
  accountCreateEmailPasswordSession(email: $email, password: $password) {
927
170
  userId
@@ -929,78 +172,13 @@ var accountCreateEmailPasswordSession = gql(
929
172
  current
930
173
  }
931
174
  }
932
- `
933
- );
934
- function useLogin() {
935
- const { account: account2, graphql: graphql2 } = useAppwrite();
936
- const login = useMutation({
937
- mutationFn: async ({ email, password }) => {
938
- const { data, errors } = await graphql2.mutation({
939
- query: accountCreateEmailPasswordSession,
940
- variables: {
941
- email,
942
- password
943
- }
944
- });
945
- if (errors) {
946
- throw errors;
947
- }
948
- return data.accountCreateEmailPasswordSession;
949
- }
950
- });
951
- const oAuthLogin = useMutation({
952
- mutationFn: async ({ provider, success, failure }) => {
953
- return account2.createOAuth2Session(provider, success, failure);
954
- }
955
- });
956
- return {
957
- login,
958
- oAuthLogin
959
- };
960
- }
961
-
962
- // src/account/useLogout.ts
963
- var deleteSession2 = gql(
964
- /* GraphQL */
965
- `
175
+ `);function Hn(){let{account:e,graphql:i}=r(),a=u({mutationFn:async({email:t,password:s})=>{let{data:c,errors:d}=await i.mutation({query:zn,variables:{email:t,password:s}});if(d)throw d;return c.accountCreateEmailPasswordSession}}),n=u({mutationFn:async({provider:t,success:s,failure:c})=>e.createOAuth2Session(t,s,c)});return {login:a,oAuthLogin:n}}var Yn=o(`
966
176
  mutation DeleteSession($sessionId: String!) {
967
177
  accountDeleteSession(sessionId: $sessionId) {
968
178
  status
969
179
  }
970
180
  }
971
- `
972
- );
973
- function useLogout() {
974
- const { graphql: graphql2 } = useAppwrite();
975
- const queryClient2 = useQueryClient();
976
- const queryResult = useMutation({
977
- mutationFn: async ({ sessionId }) => {
978
- const { data, errors } = await graphql2.mutation({
979
- query: deleteSession2,
980
- variables: {
981
- sessionId
982
- }
983
- });
984
- if (errors) {
985
- throw errors;
986
- }
987
- return data?.accountDeleteSession ?? { status: false };
988
- },
989
- onSuccess: async () => {
990
- queryClient2.setQueryData(["appwrite"], null);
991
- queryClient2.setQueryData(["appwrite", "account"], null);
992
- queryClient2.removeQueries({ queryKey: ["appwrite"] });
993
- queryClient2.removeQueries({ queryKey: ["appwrite", "account"] });
994
- queryClient2.clear();
995
- }
996
- });
997
- return { ...queryResult, mutate: queryResult.mutate };
998
- }
999
-
1000
- // src/account/useLogs.ts
1001
- var accountListLogs = gql(
1002
- /* GraphQL */
1003
- `
181
+ `);function Zn(){let{graphql:e}=r(),i=p(),a=u({mutationFn:async({sessionId:n})=>{let{data:t,errors:s}=await e.mutation({query:Yn,variables:{sessionId:n}});if(s)throw s;return t?.accountDeleteSession??{status:!1}},onSuccess:async()=>{i.setQueryData(["appwrite"],null),i.setQueryData(["appwrite","account"],null),i.removeQueries({queryKey:["appwrite"]}),i.removeQueries({queryKey:["appwrite","account"]}),i.clear();}});return {...a,mutate:a.mutate}}var et=o(`
1004
182
  query ListLogs($queries: [String!]) {
1005
183
  accountListLogs(queries: $queries) {
1006
184
  total
@@ -1029,189 +207,39 @@ var accountListLogs = gql(
1029
207
  }
1030
208
  }
1031
209
  }
1032
- `
1033
- );
1034
- function useLogs({ queries }) {
1035
- const { graphql: graphql2 } = useAppwrite();
1036
- const queryResult = useQuery({
1037
- queryKey: ["appwrite", "account", "logs", queries],
1038
- queryFn: async () => {
1039
- const { data, errors } = await graphql2.query({
1040
- query: accountListLogs,
1041
- variables: {
1042
- queries
1043
- }
1044
- });
1045
- if (errors) {
1046
- throw errors;
1047
- }
1048
- return data.accountListLogs;
1049
- }
1050
- });
1051
- return { ...queryResult };
1052
- }
1053
-
1054
- // src/account/usePasswordRecovery.ts
1055
- var createRecovery = gql(
1056
- /* GraphQL */
1057
- `
210
+ `);function nt({queries:e}){let{graphql:i}=r();return {...m({queryKey:["appwrite","account","logs",e],queryFn:async()=>{let{data:n,errors:t}=await i.query({query:et,variables:{queries:e}});if(t)throw t;return n.accountListLogs}})}}var tt=o(`
1058
211
  mutation CreateRecovery($email: String!, $url: String!) {
1059
212
  accountCreateRecovery(email: $email, url: $url) {
1060
213
  expire
1061
214
  }
1062
215
  }
1063
- `
1064
- );
1065
- function usePasswordRecovery() {
1066
- const { graphql: graphql2 } = useAppwrite();
1067
- const queryResult = useMutation({
1068
- mutationFn: async ({ email, url: resetUrl }) => {
1069
- const { data, errors } = await graphql2.mutation({
1070
- query: createRecovery,
1071
- variables: {
1072
- email,
1073
- url: resetUrl
1074
- }
1075
- });
1076
- if (errors) {
1077
- throw errors;
1078
- }
1079
- return data.accountCreateRecovery;
1080
- },
1081
- onSuccess: async (_, variables) => {
1082
- localStorage.setItem("email", variables.email);
1083
- }
1084
- });
1085
- return { ...queryResult };
1086
- }
1087
-
1088
- // src/account/useResetPassword.ts
1089
- var updateRecovery = gql(
1090
- /* GraphQL */
1091
- `
216
+ `);function at(){let{graphql:e}=r();return {...u({mutationFn:async({email:a,url:n})=>{let{data:t,errors:s}=await e.mutation({query:tt,variables:{email:a,url:n}});if(s)throw s;return t.accountCreateRecovery},onSuccess:async(a,n)=>{localStorage.setItem("email",n.email);}})}}var it=o(`
1092
217
  mutation UpdateRecovery($userId: String!, $secret: String!, $password: String!) {
1093
218
  accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) {
1094
219
  expire
1095
220
  }
1096
221
  }
1097
- `
1098
- );
1099
- function useResetPassword() {
1100
- const { graphql: graphql2 } = useAppwrite();
1101
- const queryResult = useMutation({
1102
- mutationFn: async ({ userId, secret, password }) => {
1103
- const { data, errors } = await graphql2.mutation({
1104
- query: updateRecovery,
1105
- variables: {
1106
- userId,
1107
- secret,
1108
- password
1109
- }
1110
- });
1111
- if (errors) {
1112
- throw errors;
1113
- }
1114
- return data.accountUpdateRecovery ?? {};
1115
- }
1116
- });
1117
- return { ...queryResult };
1118
- }
1119
-
1120
- // src/account/useSignUp.ts
1121
- import { ID } from "appwrite";
1122
- var createAccount = gql(
1123
- /* GraphQL */
1124
- `
222
+ `);function ot(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,secret:n,password:t})=>{let{data:s,errors:c}=await e.mutation({query:it,variables:{userId:a,secret:n,password:t}});if(c)throw c;return s.accountUpdateRecovery??{}}})}}var st=o(`
1125
223
  mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
1126
224
  accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
1127
225
  name
1128
226
  email
1129
227
  }
1130
228
  }
1131
- `
1132
- );
1133
- var verify = gql(
1134
- /* GraphQL */
1135
- `
229
+ `),ut=o(`
1136
230
  mutation VerifyEmail($url: String!) {
1137
231
  accountCreateVerification(url: $url) {
1138
232
  expire
1139
233
  }
1140
234
  }
1141
- `
1142
- );
1143
- function useSignUp() {
1144
- const { graphql: graphql2 } = useAppwrite();
1145
- const signUp = useMutation({
1146
- mutationFn: async ({ userId, email, password, name }) => {
1147
- const { data, errors } = await graphql2.mutation({
1148
- query: createAccount,
1149
- variables: {
1150
- userId: userId ?? ID.unique(),
1151
- name,
1152
- email,
1153
- password
1154
- }
1155
- });
1156
- if (errors) {
1157
- throw errors;
1158
- }
1159
- return data.accountCreate;
1160
- }
1161
- });
1162
- const verifyEmail = useMutation({
1163
- mutationFn: async ({ verifyUrl }) => {
1164
- const { data, errors } = await graphql2.mutation({
1165
- query: verify,
1166
- variables: {
1167
- url: verifyUrl
1168
- }
1169
- });
1170
- if (errors) {
1171
- throw errors;
1172
- }
1173
- return data.accountCreateVerification;
1174
- }
1175
- });
1176
- return { signUp, verifyEmail };
1177
- }
1178
-
1179
- // src/account/useUpdateEmail.ts
1180
- var accountUpdateEmail = gql(
1181
- /* GraphQL */
1182
- `
235
+ `);function ct(){let{graphql:e}=r(),i=u({mutationFn:async({userId:n,email:t,password:s,name:c})=>{let{data:d,errors:l}=await e.mutation({query:st,variables:{userId:n??ID.unique(),name:c,email:t,password:s}});if(l)throw l;return d.accountCreate}}),a=u({mutationFn:async({verifyUrl:n})=>{let{data:t,errors:s}=await e.mutation({query:ut,variables:{url:n}});if(s)throw s;return t.accountCreateVerification}});return {signUp:i,verifyEmail:a}}var dt=o(`
1183
236
  mutation UpdateEmail($email: String!, $password: String!) {
1184
237
  accountUpdateEmail(email: $email, password: $password) {
1185
238
  name
1186
239
  email
1187
240
  }
1188
241
  }
1189
- `
1190
- );
1191
- function useUpdateEmail() {
1192
- const { graphql: graphql2 } = useAppwrite();
1193
- const queryResult = useMutation({
1194
- mutationFn: async ({ email, password }) => {
1195
- const { data, errors } = await graphql2.mutation({
1196
- query: accountUpdateEmail,
1197
- variables: {
1198
- email,
1199
- password
1200
- }
1201
- });
1202
- if (errors) {
1203
- throw errors;
1204
- }
1205
- return data.accountUpdateEmail;
1206
- }
1207
- });
1208
- return { ...queryResult };
1209
- }
1210
-
1211
- // src/account/useUpdateMagicURLSession.ts
1212
- var updateMagicURLSession = gql(
1213
- /* GraphQL */
1214
- `
242
+ `);function lt(){let{graphql:e}=r();return {...u({mutationFn:async({email:a,password:n})=>{let{data:t,errors:s}=await e.mutation({query:dt,variables:{email:a,password:n}});if(s)throw s;return t.accountUpdateEmail}})}}var mt=o(`
1215
243
  mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
1216
244
  accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
1217
245
  userId
@@ -1219,243 +247,49 @@ var updateMagicURLSession = gql(
1219
247
  current
1220
248
  }
1221
249
  }
1222
- `
1223
- );
1224
- function useUpdateMagicURLSession() {
1225
- const { graphql: graphql2 } = useAppwrite();
1226
- const queryResult = useMutation({
1227
- mutationFn: async ({ userId, secret }) => {
1228
- const { data, errors } = await graphql2.mutation({
1229
- query: updateMagicURLSession,
1230
- variables: {
1231
- userId,
1232
- secret
1233
- }
1234
- });
1235
- if (errors) {
1236
- throw errors;
1237
- }
1238
- return data.accountUpdateMagicURLSession;
1239
- }
1240
- });
1241
- return { ...queryResult };
1242
- }
1243
-
1244
- // src/account/useUpdateMfa.ts
1245
- var accountUpdateMFA = gql(
1246
- /* GraphQL */
1247
- `
250
+ `);function pt(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,secret:n})=>{let{data:t,errors:s}=await e.mutation({query:mt,variables:{userId:a,secret:n}});if(s)throw s;return t.accountUpdateMagicURLSession}})}}var yt=o(`
1248
251
  mutation UpdateMFA($mfa: Boolean!) {
1249
252
  accountUpdateMFA(mfa: $mfa) {
1250
253
  mfa
1251
254
  }
1252
255
  }
1253
- `
1254
- );
1255
- function useUpdateMfa() {
1256
- const { graphql: graphql2 } = useAppwrite();
1257
- const queryResult = useMutation({
1258
- mutationFn: async ({ mfa }) => {
1259
- const { data, errors } = await graphql2.mutation({
1260
- query: accountUpdateMFA,
1261
- variables: {
1262
- mfa
1263
- }
1264
- });
1265
- if (errors) {
1266
- throw errors;
1267
- }
1268
- return data.accountUpdateMFA;
1269
- }
1270
- });
1271
- return { ...queryResult };
1272
- }
1273
-
1274
- // src/account/useUpdateMfaAuthenticator.ts
1275
- var updateMFAAuthenticator2 = gql(
1276
- /* GraphQL */
1277
- `
256
+ `);function St(){let{graphql:e}=r();return {...u({mutationFn:async({mfa:a})=>{let{data:n,errors:t}=await e.mutation({query:yt,variables:{mfa:a}});if(t)throw t;return n.accountUpdateMFA}})}}var kt=o(`
1278
257
  mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
1279
258
  accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
1280
259
  mfa
1281
260
  }
1282
261
  }
1283
- `
1284
- );
1285
- function useUpdateMfaAuthenticator() {
1286
- const { graphql: graphql2 } = useAppwrite();
1287
- const queryResult = useMutation({
1288
- mutationFn: async ({ type = "totp", otp }) => {
1289
- const { data, errors } = await graphql2.mutation({
1290
- query: updateMFAAuthenticator2,
1291
- variables: {
1292
- type,
1293
- otp
1294
- }
1295
- });
1296
- if (errors) {
1297
- throw errors;
1298
- }
1299
- return data.accountUpdateMfaAuthenticator;
1300
- }
1301
- });
1302
- return { ...queryResult };
1303
- }
1304
-
1305
- // src/account/useUpdateMfaChallenge.ts
1306
- var accountUpdateMfaChallenge = gql(
1307
- /* GraphQL */
1308
- `
262
+ `);function ft(){let{graphql:e}=r();return {...u({mutationFn:async({type:a="totp",otp:n})=>{let{data:t,errors:s}=await e.mutation({query:kt,variables:{type:a,otp:n}});if(s)throw s;return t.accountUpdateMfaAuthenticator}})}}var gt=o(`
1309
263
  mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
1310
264
  accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
1311
265
  status
1312
266
  }
1313
267
  }
1314
- `
1315
- );
1316
- function useUpdateMfaChallenge() {
1317
- const { graphql: graphql2 } = useAppwrite();
1318
- const queryResult = useMutation({
1319
- mutationFn: async ({ challengeId, otp }) => {
1320
- const { data, errors } = await graphql2.mutation({
1321
- query: accountUpdateMfaChallenge,
1322
- variables: {
1323
- challengeId,
1324
- otp
1325
- }
1326
- });
1327
- if (errors) {
1328
- throw errors;
1329
- }
1330
- return data?.accountUpdateMfaChallenge ?? { status: false };
1331
- }
1332
- });
1333
- return { ...queryResult };
1334
- }
1335
-
1336
- // src/account/useUpdateMfaRecoveryCodes.ts
1337
- var accountUpdateMfaRecoveryCodes = gql(
1338
- /* GraphQL */
1339
- `
268
+ `);function vt(){let{graphql:e}=r();return {...u({mutationFn:async({challengeId:a,otp:n})=>{let{data:t,errors:s}=await e.mutation({query:gt,variables:{challengeId:a,otp:n}});if(s)throw s;return t?.accountUpdateMfaChallenge??{status:!1}}})}}var bt=o(`
1340
269
  mutation UpdateMfaRecoveryCodes {
1341
270
  accountUpdateMfaRecoveryCodes {
1342
271
  recoveryCodes
1343
272
  }
1344
273
  }
1345
- `
1346
- );
1347
- function useUpdateMfaRecoveryCodes() {
1348
- const { graphql: graphql2 } = useAppwrite();
1349
- const queryResult = useMutation({
1350
- mutationFn: async () => {
1351
- const { data, errors } = await graphql2.mutation({
1352
- query: accountUpdateMfaRecoveryCodes
1353
- });
1354
- if (errors) {
1355
- throw errors;
1356
- }
1357
- return data.accountUpdateMfaRecoveryCodes;
1358
- }
1359
- });
1360
- return { ...queryResult };
1361
- }
1362
-
1363
- // src/account/useUpdateName.ts
1364
- var accountUpdateName = gql(
1365
- /* GraphQL */
1366
- `
274
+ `);function Mt(){let{graphql:e}=r();return {...u({mutationFn:async()=>{let{data:a,errors:n}=await e.mutation({query:bt});if(n)throw n;return a.accountUpdateMfaRecoveryCodes}})}}var Nt=o(`
1367
275
  mutation UpdateName($name: String!) {
1368
276
  accountUpdateName(name: $name) {
1369
277
  name
1370
278
  }
1371
279
  }
1372
- `
1373
- );
1374
- function useUpdateName() {
1375
- const { graphql: graphql2 } = useAppwrite();
1376
- const queryResult = useMutation({
1377
- mutationFn: async ({ name }) => {
1378
- const { data: mutationData, errors } = await graphql2.mutation({
1379
- query: accountUpdateName,
1380
- variables: {
1381
- name
1382
- }
1383
- });
1384
- if (errors) {
1385
- throw errors;
1386
- }
1387
- return mutationData.accountUpdateName;
1388
- }
1389
- });
1390
- return { ...queryResult };
1391
- }
1392
-
1393
- // src/account/useUpdatePassword.ts
1394
- var updatePassword = gql(
1395
- /* GraphQL */
1396
- `
280
+ `);function Dt(){let{graphql:e}=r();return {...u({mutationFn:async({name:a})=>{let{data:n,errors:t}=await e.mutation({query:Nt,variables:{name:a}});if(t)throw t;return n.accountUpdateName}})}}var It=o(`
1397
281
  mutation UpdatePassword($password: String!, $oldPassword: String!) {
1398
282
  accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
1399
283
  status
1400
284
  }
1401
285
  }
1402
- `
1403
- );
1404
- function useUpdatePassword() {
1405
- const { graphql: graphql2 } = useAppwrite();
1406
- const queryResult = useMutation({
1407
- mutationFn: async ({ password, oldPassword }) => {
1408
- const { data, errors } = await graphql2.mutation({
1409
- query: updatePassword,
1410
- variables: {
1411
- password,
1412
- oldPassword
1413
- }
1414
- });
1415
- if (errors) {
1416
- throw errors;
1417
- }
1418
- return data?.accountUpdatePassword;
1419
- }
1420
- });
1421
- return { ...queryResult };
1422
- }
1423
-
1424
- // src/account/useUpdatePhone.ts
1425
- var accountUpdatePhone = gql(
1426
- /* GraphQL */
1427
- `
286
+ `);function xt(){let{graphql:e}=r();return {...u({mutationFn:async({password:a,oldPassword:n})=>{let{data:t,errors:s}=await e.mutation({query:It,variables:{password:a,oldPassword:n}});if(s)throw s;return t?.accountUpdatePassword}})}}var $t=o(`
1428
287
  mutation UpdatePhone($phone: String!, $password: String!) {
1429
288
  accountUpdatePhone(phone: $phone, password: $password) {
1430
289
  phone
1431
290
  }
1432
291
  }
1433
- `
1434
- );
1435
- function useUpdatePhone() {
1436
- const { graphql: graphql2 } = useAppwrite();
1437
- const queryResult = useMutation({
1438
- mutationFn: async ({ phone, password }) => {
1439
- const { data, errors } = await graphql2.mutation({
1440
- query: accountUpdatePhone,
1441
- variables: {
1442
- phone,
1443
- password
1444
- }
1445
- });
1446
- if (errors) {
1447
- throw errors;
1448
- }
1449
- return data.accountUpdatePhone;
1450
- }
1451
- });
1452
- return { ...queryResult };
1453
- }
1454
-
1455
- // src/account/useUpdatePhoneSession.ts
1456
- var updatePhoneSession = gql(
1457
- /* GraphQL */
1458
- `
292
+ `);function Ct(){let{graphql:e}=r();return {...u({mutationFn:async({phone:a,password:n})=>{let{data:t,errors:s}=await e.mutation({query:$t,variables:{phone:a,password:n}});if(s)throw s;return t.accountUpdatePhone}})}}var wt=o(`
1459
293
  mutation UpdatePhoneSession($userId: String!, $secret: String!) {
1460
294
  accountUpdatePhoneSession(userId: $userId, secret: $secret) {
1461
295
  userId
@@ -1463,87 +297,13 @@ var updatePhoneSession = gql(
1463
297
  current
1464
298
  }
1465
299
  }
1466
- `
1467
- );
1468
- function useUpdatePhoneSession() {
1469
- const { graphql: graphql2 } = useAppwrite();
1470
- const queryResult = useMutation({
1471
- mutationFn: async ({ userId, secret }) => {
1472
- const { data, errors } = await graphql2.mutation({
1473
- query: updatePhoneSession,
1474
- variables: {
1475
- userId,
1476
- secret
1477
- }
1478
- });
1479
- if (errors) {
1480
- throw errors;
1481
- }
1482
- return data.accountUpdatePhoneSession;
1483
- }
1484
- });
1485
- return { ...queryResult };
1486
- }
1487
-
1488
- // src/account/useUpdatePhoneVerification.ts
1489
- var updatePhoneVerification = gql(
1490
- /* GraphQL */
1491
- `
300
+ `);function Ut(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,secret:n})=>{let{data:t,errors:s}=await e.mutation({query:wt,variables:{userId:a,secret:n}});if(s)throw s;return t.accountUpdatePhoneSession}})}}var At=o(`
1492
301
  mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
1493
302
  accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
1494
303
  expire
1495
304
  }
1496
305
  }
1497
- `
1498
- );
1499
- function useUpdatePhoneVerification() {
1500
- const { graphql: graphql2 } = useAppwrite();
1501
- const queryResult = useMutation({
1502
- mutationFn: async ({ userId, secret }) => {
1503
- const { data, errors } = await graphql2.mutation({
1504
- query: updatePhoneVerification,
1505
- variables: {
1506
- userId,
1507
- secret
1508
- }
1509
- });
1510
- if (errors) {
1511
- throw errors;
1512
- }
1513
- return data.accountUpdatePhoneVerification;
1514
- }
1515
- });
1516
- return { ...queryResult };
1517
- }
1518
-
1519
- // src/account/useUpdatePrefs.ts
1520
- var accountUpdatePrefs = gql(
1521
- /* GraphQL */
1522
- `
1523
- mutation UpdatePrefs($prefs: JSON!) {
1524
- accountUpdatePrefs(prefs: $prefs) {
1525
- prefs {
1526
- data
1527
- }
1528
- }
1529
- }
1530
- `
1531
- );
1532
- function useUpdatePrefs() {
1533
- const { account: account2 } = useAppwrite();
1534
- const queryResult = useMutation({
1535
- mutationFn: async ({ prefs }) => {
1536
- const newPrefs = await account2.updatePrefs(prefs);
1537
- return newPrefs;
1538
- }
1539
- });
1540
- return { ...queryResult };
1541
- }
1542
-
1543
- // src/account/useUpdateSession.ts
1544
- var updateSession = gql(
1545
- /* GraphQL */
1546
- `
306
+ `);function ht(){let{graphql:e}=r();return {...u({mutationFn:async({userId:a,secret:n})=>{let{data:t,errors:s}=await e.mutation({query:At,variables:{userId:a,secret:n}});if(s)throw s;return t.accountUpdatePhoneVerification}})}}function Vt(){let{account:e}=r();return {...u({mutationFn:async({prefs:a})=>await e.updatePrefs(a)})}}var Tt=o(`
1547
307
  mutation UpdateSession($sessionId: String!) {
1548
308
  accountUpdateSession(sessionId: $sessionId) {
1549
309
  userId
@@ -1551,31 +311,7 @@ var updateSession = gql(
1551
311
  current
1552
312
  }
1553
313
  }
1554
- `
1555
- );
1556
- function useUpdateSession() {
1557
- const { graphql: graphql2 } = useAppwrite();
1558
- const queryResult = useMutation({
1559
- mutationFn: async ({ sessionId }) => {
1560
- const { data, errors } = await graphql2.mutation({
1561
- query: updateSession,
1562
- variables: {
1563
- sessionId
1564
- }
1565
- });
1566
- if (errors) {
1567
- throw errors;
1568
- }
1569
- return data.accountUpdateSession;
1570
- }
1571
- });
1572
- return { ...queryResult };
1573
- }
1574
-
1575
- // src/account/useVerification.ts
1576
- var updateVerification = gql(
1577
- /* GraphQL */
1578
- `
314
+ `);function qt(){let{graphql:e}=r();return {...u({mutationFn:async({sessionId:a})=>{let{data:n,errors:t}=await e.mutation({query:Tt,variables:{sessionId:a}});if(t)throw t;return n.accountUpdateSession}})}}var _t=o(`
1579
315
  mutation UpdateVerification($userId: String!, $secret: String!) {
1580
316
  accountUpdateVerification(userId: $userId, secret: $secret) {
1581
317
  secret
@@ -1583,40 +319,7 @@ var updateVerification = gql(
1583
319
  userId
1584
320
  }
1585
321
  }
1586
- `
1587
- );
1588
- function useVerification() {
1589
- const { graphql: graphql2 } = useAppwrite();
1590
- const queryClient2 = useQueryClient();
1591
- const queryResult = useMutation({
1592
- mutationFn: async ({ userId, secret }) => {
1593
- if (!userId || !secret) {
1594
- throw new Error("Missing userId or secret");
1595
- }
1596
- const { data, errors } = await graphql2.mutation({
1597
- query: updateVerification,
1598
- variables: {
1599
- userId,
1600
- secret
1601
- }
1602
- });
1603
- if (errors) {
1604
- throw errors;
1605
- }
1606
- return data.accountUpdateVerification ?? {};
1607
- },
1608
- onSuccess: async () => {
1609
- queryClient2.setQueryData(["appwrite", "account"], null);
1610
- }
1611
- });
1612
- return { ...queryResult };
1613
- }
1614
-
1615
- // src/databases/useCollection.ts
1616
- import { useEffect as useEffect2 } from "react";
1617
- var listDocuments = gql(
1618
- /* GraphQL */
1619
- `
322
+ `);function Ft(){let{graphql:e}=r(),i=p();return {...u({mutationFn:async({userId:n,secret:t})=>{if(!n||!t)throw new Error("Missing userId or secret");let{data:s,errors:c}=await e.mutation({query:_t,variables:{userId:n,secret:t}});if(c)throw c;return s.accountUpdateVerification??{}},onSuccess:async()=>{i.setQueryData(["appwrite","account"],null);}})}}var Te=o(`
1620
323
  query ListDocuments($databaseId: String!, $collectionId: String!, $queries: [String!]) {
1621
324
  databasesListDocuments(
1622
325
  databaseId: $databaseId
@@ -1630,178 +333,7 @@ var listDocuments = gql(
1630
333
  }
1631
334
  }
1632
335
  }
1633
- `
1634
- );
1635
- function useCollection({
1636
- databaseId,
1637
- collectionId,
1638
- queries
1639
- }) {
1640
- const { graphql: graphql2 } = useAppwrite();
1641
- const queryClient2 = useQueryClient();
1642
- const collection = useQuery({
1643
- queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1644
- queryFn: async () => {
1645
- const { data, errors } = await graphql2.query({
1646
- query: listDocuments,
1647
- variables: {
1648
- databaseId,
1649
- collectionId,
1650
- queries
1651
- }
1652
- });
1653
- if (errors) {
1654
- throw errors;
1655
- }
1656
- const documents2 = data.databasesListDocuments?.documents?.map((document) => ({
1657
- ...document,
1658
- ...document ? JSON.parse(document.data) : {}
1659
- })) ?? [];
1660
- return {
1661
- total: data.databasesListDocuments?.total ?? 0,
1662
- documents: documents2
1663
- };
1664
- }
1665
- });
1666
- useEffect2(() => {
1667
- const unsubscribe = graphql2.client.subscribe(
1668
- `databases.${databaseId}.collections.${collectionId}.documents`,
1669
- (response) => {
1670
- const [, operation] = response.events[0].match(/\.(\w+)$/);
1671
- const document = response.payload;
1672
- switch (operation) {
1673
- case "create":
1674
- case "update":
1675
- case "delete":
1676
- queryClient2.setQueryData(
1677
- ["appwrite", "databases", databaseId, collectionId, "documents", document.$id],
1678
- document
1679
- );
1680
- queryClient2.invalidateQueries({
1681
- queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1682
- exact: true
1683
- });
1684
- break;
1685
- }
1686
- }
1687
- );
1688
- return unsubscribe;
1689
- }, [databaseId, collectionId, graphql2.client, queryClient2, queries]);
1690
- return {
1691
- ...collection,
1692
- documents: collection.data?.documents,
1693
- total: collection.data?.total
1694
- };
1695
- }
1696
- function useSuspenseCollection({
1697
- databaseId,
1698
- collectionId,
1699
- queries
1700
- }) {
1701
- const { graphql: graphql2 } = useAppwrite();
1702
- const queryClient2 = useQueryClient();
1703
- const collection = useSuspenseQuery({
1704
- queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1705
- queryFn: async () => {
1706
- const { data, errors } = await graphql2.query({
1707
- query: listDocuments,
1708
- variables: {
1709
- databaseId,
1710
- collectionId,
1711
- queries
1712
- }
1713
- });
1714
- if (errors) {
1715
- throw errors;
1716
- }
1717
- const documents2 = data.databasesListDocuments?.documents?.map((document) => ({
1718
- ...document,
1719
- ...document ? JSON.parse(document.data) : {}
1720
- })) ?? [];
1721
- return {
1722
- total: data.databasesListDocuments?.total ?? 0,
1723
- documents: documents2
1724
- };
1725
- }
1726
- });
1727
- useEffect2(() => {
1728
- const unsubscribe = graphql2.client.subscribe(
1729
- `databases.${databaseId}.collections.${collectionId}.documents`,
1730
- (response) => {
1731
- const [, operation] = response.events[0].match(/\.(\w+)$/);
1732
- const document = response.payload;
1733
- switch (operation) {
1734
- case "create":
1735
- case "update":
1736
- case "delete":
1737
- queryClient2.setQueryData(
1738
- ["appwrite", "databases", databaseId, collectionId, "documents", document.$id],
1739
- document
1740
- );
1741
- queryClient2.invalidateQueries({
1742
- queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1743
- exact: true
1744
- });
1745
- break;
1746
- }
1747
- }
1748
- );
1749
- return unsubscribe;
1750
- }, [databaseId, collectionId, graphql2.client, queryClient2, queries]);
1751
- return {
1752
- ...collection,
1753
- documents: collection.data?.documents,
1754
- total: collection.data?.total
1755
- };
1756
- }
1757
-
1758
- // src/databases/useCreateDocument.ts
1759
- var createDocument = gql(
1760
- /* GraphQL */
1761
- `
1762
- mutation CreateDocument(
1763
- $databaseId: String!
1764
- $collectionId: String!
1765
- $documentId: String!
1766
- $data: JSON!
1767
- $permissions: [String!]
1768
- ) {
1769
- databasesCreateDocument(
1770
- databaseId: $databaseId
1771
- collectionId: $collectionId
1772
- documentId: $documentId
1773
- data: $data
1774
- permissions: $permissions
1775
- ) {
1776
- _id
1777
- }
1778
- }
1779
- `
1780
- );
1781
- function useCreateDocument() {
1782
- const { databases: databases2 } = useAppwrite();
1783
- const mutationResult = useMutation({
1784
- mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
1785
- const { data: mutationData, errors } = await databases2.createDocument(
1786
- databaseId,
1787
- collectionId,
1788
- documentId,
1789
- data,
1790
- permissions
1791
- );
1792
- if (errors) {
1793
- throw errors;
1794
- }
1795
- return mutationData;
1796
- }
1797
- });
1798
- return mutationResult;
1799
- }
1800
-
1801
- // src/databases/useDeleteDocument.ts
1802
- var deleteDocument = gql(
1803
- /* GraphQL */
1804
- `
336
+ `);function Et({databaseId:e,collectionId:i,queries:a,subscribe:n=!0}){let{graphql:t}=r(),s=p(),c=m({queryKey:["appwrite","databases",e,i,{queries:a}],queryFn:async()=>{let{data:d,errors:l}=await t.query({query:Te,variables:{databaseId:e,collectionId:i,queries:a}});if(l)throw l;let S=d.databasesListDocuments?.documents?.map(y=>({...y,...y?JSON.parse(y.data):{}}))??[];return {total:d.databasesListDocuments?.total??0,documents:S}}});return useEffect(()=>n?t.client.subscribe(`databases.${e}.collections.${i}.documents`,l=>{let[,S]=l.events[0].match(/\.(\w+)$/),y=l.payload;switch(S){case"create":case"update":case"delete":s.setQueryData(["appwrite","databases",e,i,"documents",y.$id],y),s.invalidateQueries({queryKey:["appwrite","databases",e,i,{queries:a}],exact:!0});break}}):void 0,[e,i,t.client,s,a,n]),{...c,documents:c.data?.documents,total:c.data?.total}}function Pt({databaseId:e,collectionId:i,queries:a,subscribe:n=!0}){let{graphql:t}=r(),s=p(),c=f({queryKey:["appwrite","databases",e,i,{queries:a}],queryFn:async()=>{let{data:d,errors:l}=await t.query({query:Te,variables:{databaseId:e,collectionId:i,queries:a}});if(l)throw l;let S=d.databasesListDocuments?.documents?.map(y=>({...y,...y?JSON.parse(y.data):{}}))??[];return {total:d.databasesListDocuments?.total??0,documents:S}}});return useEffect(()=>n?t.client.subscribe(`databases.${e}.collections.${i}.documents`,l=>{let[,S]=l.events[0].match(/\.(\w+)$/),y=l.payload;switch(S){case"create":case"update":case"delete":s.setQueryData(["appwrite","databases",e,i,"documents",y.$id],y),s.invalidateQueries({queryKey:["appwrite","databases",e,i,{queries:a}],exact:!0});break}}):void 0,[e,i,t.client,s,a]),{...c,documents:c.data?.documents,total:c.data?.total}}function Rt(){let{databases:e}=r();return u({mutationFn:async({databaseId:a,collectionId:n,documentId:t,data:s,permissions:c})=>{let{data:d,errors:l}=await e.createDocument(a,n,t,s,c);if(l)throw l;return d}})}var Lt=o(`
1805
337
  mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
1806
338
  databasesDeleteDocument(
1807
339
  databaseId: $databaseId
@@ -1811,58 +343,7 @@ var deleteDocument = gql(
1811
343
  status
1812
344
  }
1813
345
  }
1814
- `
1815
- );
1816
- function useDeleteDocument() {
1817
- const { graphql: graphql2 } = useAppwrite();
1818
- const queryClient2 = useQueryClient();
1819
- const mutationResult = useMutation({
1820
- mutationFn: async ({ databaseId, collectionId, documentId }) => {
1821
- const { data: mutationData, errors } = await graphql2.mutation({
1822
- query: deleteDocument,
1823
- variables: {
1824
- databaseId,
1825
- collectionId,
1826
- documentId
1827
- }
1828
- });
1829
- if (errors) {
1830
- throw errors;
1831
- }
1832
- return mutationData.databasesDeleteDocument;
1833
- },
1834
- onSuccess: async (_, variables) => {
1835
- queryClient2.setQueryData(
1836
- [
1837
- "appwrite",
1838
- "databases",
1839
- variables.databaseId,
1840
- variables.collectionId,
1841
- "documents",
1842
- variables.documentId
1843
- ],
1844
- null
1845
- );
1846
- queryClient2.removeQueries({
1847
- queryKey: [
1848
- "appwrite",
1849
- "databases",
1850
- variables.databaseId,
1851
- variables.collectionId,
1852
- "documents",
1853
- variables.documentId
1854
- ]
1855
- });
1856
- }
1857
- });
1858
- return { ...mutationResult };
1859
- }
1860
-
1861
- // src/databases/useDocument.ts
1862
- import { useEffect as useEffect3 } from "react";
1863
- var getDocument = gql(
1864
- /* GraphQL */
1865
- `
346
+ `);function Qt(){let{graphql:e}=r(),i=p();return {...u({mutationFn:async({databaseId:n,collectionId:t,documentId:s})=>{let{data:c,errors:d}=await e.mutation({query:Lt,variables:{databaseId:n,collectionId:t,documentId:s}});if(d)throw d;return c.databasesDeleteDocument},onSuccess:async(n,t)=>{i.setQueryData(["appwrite","databases",t.databaseId,t.collectionId,"documents",t.documentId],null),i.removeQueries({queryKey:["appwrite","databases",t.databaseId,t.collectionId,"documents",t.documentId]});}})}}var Ot=o(`
1866
347
  query GetDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
1867
348
  databasesGetDocument(
1868
349
  databaseId: $databaseId
@@ -1873,100 +354,7 @@ var getDocument = gql(
1873
354
  data
1874
355
  }
1875
356
  }
1876
- `
1877
- );
1878
- function useDocument({
1879
- databaseId,
1880
- collectionId,
1881
- documentId
1882
- }) {
1883
- const { graphql: graphql2 } = useAppwrite();
1884
- const queryClient2 = useQueryClient();
1885
- const queryResult = useQuery({
1886
- queryKey: ["appwrite", "databases", databaseId, collectionId, "documents", documentId],
1887
- queryFn: async () => {
1888
- const { data, errors } = await graphql2.query({
1889
- query: getDocument,
1890
- variables: {
1891
- databaseId,
1892
- collectionId,
1893
- documentId
1894
- }
1895
- });
1896
- if (errors) {
1897
- throw errors;
1898
- }
1899
- const document = {
1900
- ...data.databasesGetDocument,
1901
- ...data.databasesGetDocument ? JSON.parse(data.databasesGetDocument.data) : {}
1902
- };
1903
- return document;
1904
- }
1905
- });
1906
- useEffect3(() => {
1907
- const unsubscribe = graphql2.client.subscribe(
1908
- `databases.${databaseId}.collections.${collectionId}.documents.${documentId}`,
1909
- (response) => {
1910
- queryClient2.setQueryData(
1911
- ["appwrite", "databases", databaseId, collectionId, "documents", documentId],
1912
- response.payload
1913
- );
1914
- }
1915
- );
1916
- return unsubscribe;
1917
- }, [databaseId, collectionId, documentId, graphql2.client, queryClient2]);
1918
- return { ...queryResult };
1919
- }
1920
-
1921
- // src/databases/useUpdateDocument.ts
1922
- var updateDocument = gql(
1923
- /* GraphQL */
1924
- `
1925
- mutation UpdateDocument(
1926
- $databaseId: String!
1927
- $collectionId: String!
1928
- $documentId: String!
1929
- $data: JSON
1930
- $permissions: [String!]
1931
- ) {
1932
- databasesUpdateDocument(
1933
- databaseId: $databaseId
1934
- collectionId: $collectionId
1935
- documentId: $documentId
1936
- data: $data
1937
- permissions: $permissions
1938
- ) {
1939
- _id
1940
- }
1941
- }
1942
- `
1943
- );
1944
- function useUpdateDocument() {
1945
- const { databases: databases2 } = useAppwrite();
1946
- const mutationResult = useMutation({
1947
- mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
1948
- const { data: mutationData, errors } = await databases2.updateDocument(
1949
- databaseId,
1950
- collectionId,
1951
- documentId,
1952
- data,
1953
- permissions
1954
- );
1955
- if (errors) {
1956
- throw errors;
1957
- }
1958
- const document = mutationData;
1959
- return document;
1960
- }
1961
- });
1962
- return { ...mutationResult };
1963
- }
1964
-
1965
- // src/functions/useFunction.ts
1966
- import { useState } from "react";
1967
- var createExecution = gql(
1968
- /* GraphQL */
1969
- `
357
+ `);function Jt({databaseId:e,collectionId:i,documentId:a}){let{graphql:n}=r(),t=p(),s=m({queryKey:["appwrite","databases",e,i,"documents",a],queryFn:async()=>{let{data:c,errors:d}=await n.query({query:Ot,variables:{databaseId:e,collectionId:i,documentId:a}});if(d)throw d;return {...c.databasesGetDocument,...c.databasesGetDocument?JSON.parse(c.databasesGetDocument.data):{}}}});return useEffect(()=>n.client.subscribe(`databases.${e}.collections.${i}.documents.${a}`,d=>{t.setQueryData(["appwrite","databases",e,i,"documents",a],d.payload);}),[e,i,a,n.client,t]),{...s}}function Bt(){let{databases:e}=r();return {...u({mutationFn:async({databaseId:a,collectionId:n,documentId:t,data:s,permissions:c})=>{let{data:d,errors:l}=await e.updateDocument(a,n,t,s,c);if(l)throw l;return d}})}}var qe=o(`
1970
358
  mutation CreateExecution(
1971
359
  $functionId: String!
1972
360
  $body: String
@@ -1989,11 +377,7 @@ var createExecution = gql(
1989
377
  duration
1990
378
  }
1991
379
  }
1992
- `
1993
- );
1994
- var getFunctionExecution = gql(
1995
- /* GraphQL */
1996
- `
380
+ `),_e=o(`
1997
381
  query GetFunctionExecution($functionId: String!, $executionId: String!) {
1998
382
  functionsGetExecution(functionId: $functionId, executionId: $executionId) {
1999
383
  status
@@ -2001,221 +385,8 @@ var getFunctionExecution = gql(
2001
385
  duration
2002
386
  }
2003
387
  }
2004
- `
2005
- );
2006
- function useFunction() {
2007
- const { graphql: graphql2 } = useAppwrite();
2008
- const [currentExecution, setCurrentExecution] = useState(null);
2009
- const [currentFunction, setCurrentFunction] = useState(null);
2010
- const executeFunction = useMutation({
2011
- mutationFn: async ({
2012
- functionId,
2013
- body = {},
2014
- async = false,
2015
- path = "/",
2016
- method = "POST"
2017
- // headers = {},
2018
- }) => {
2019
- setCurrentFunction(functionId);
2020
- const { data } = await graphql2.mutation({
2021
- query: createExecution,
2022
- variables: {
2023
- functionId,
2024
- body: JSON.stringify(body),
2025
- async,
2026
- path,
2027
- method
2028
- // headers: JSON.stringify(headers),
2029
- }
2030
- });
2031
- let unsubscribe = null;
2032
- const { _id, status, responseBody, errors } = data.functionsCreateExecution ?? {};
2033
- if (status === "completed") {
2034
- return JSON.parse(responseBody ?? "{}");
2035
- }
2036
- if (status === "failed" && errors) {
2037
- throw new Error(errors);
2038
- }
2039
- setCurrentExecution(_id ?? null);
2040
- const response = await new Promise((resolve, reject) => {
2041
- unsubscribe = graphql2.client.subscribe(`executions.${_id}`, (event) => {
2042
- switch (event.payload.status) {
2043
- case "completed":
2044
- setCurrentExecution(null);
2045
- resolve(JSON.parse(event.payload.responseBody));
2046
- break;
2047
- case "failed":
2048
- setCurrentExecution(null);
2049
- reject(event.payload.errors);
2050
- break;
2051
- }
2052
- return 1;
2053
- });
2054
- });
2055
- unsubscribe?.();
2056
- return response;
2057
- }
2058
- });
2059
- const getExecution = useQuery({
2060
- queryKey: ["appwrite", "functions", currentFunction, currentExecution],
2061
- queryFn: async () => {
2062
- if (!currentExecution || !currentFunction) {
2063
- return null;
2064
- }
2065
- const { data } = await graphql2.query({
2066
- query: getFunctionExecution,
2067
- variables: {
2068
- functionId: currentFunction,
2069
- executionId: currentExecution
2070
- }
2071
- });
2072
- return data.functionsGetExecution ?? {};
2073
- }
2074
- });
2075
- return {
2076
- executeFunction,
2077
- currentExecution: getExecution
2078
- };
2079
- }
2080
- function useSuspenseFunction({
2081
- functionId,
2082
- body = {},
2083
- async = false,
2084
- path = "/",
2085
- method = "POST"
2086
- }) {
2087
- const { graphql: graphql2 } = useAppwrite();
2088
- const [currentExecution, setCurrentExecution] = useState(null);
2089
- const [currentFunction, setCurrentFunction] = useState(null);
2090
- const executeFunction = useSuspenseQuery(
2091
- {
2092
- queryKey: ["appwrite", "functions", functionId, path],
2093
- queryFn: async () => {
2094
- setCurrentFunction(functionId);
2095
- const { data } = await graphql2.mutation({
2096
- query: createExecution,
2097
- variables: {
2098
- functionId,
2099
- body: JSON.stringify(body),
2100
- async,
2101
- path,
2102
- method
2103
- // headers,
2104
- }
2105
- });
2106
- let unsubscribe = null;
2107
- const { _id, status, responseBody, errors } = data.functionsCreateExecution ?? {};
2108
- if (status === "completed") {
2109
- return JSON.parse(responseBody ?? "{}");
2110
- }
2111
- if (status === "failed" && errors) {
2112
- throw new Error(errors);
2113
- }
2114
- setCurrentExecution(_id ?? null);
2115
- const response = await new Promise((resolve, reject) => {
2116
- unsubscribe = graphql2.client.subscribe(`executions.${_id}`, (event) => {
2117
- switch (event.payload.status) {
2118
- case "completed":
2119
- setCurrentExecution(null);
2120
- resolve(JSON.parse(event.payload.responseBody));
2121
- break;
2122
- case "failed":
2123
- setCurrentExecution(null);
2124
- reject(event.payload.errors);
2125
- break;
2126
- }
2127
- return 1;
2128
- });
2129
- });
2130
- unsubscribe?.();
2131
- return response;
2132
- }
2133
- }
2134
- );
2135
- const getExecution = useQuery({
2136
- queryKey: ["appwrite", "functions", currentFunction, currentExecution],
2137
- queryFn: async () => {
2138
- if (!currentExecution || !currentFunction) {
2139
- return null;
2140
- }
2141
- const { data } = await graphql2.query({
2142
- query: getFunctionExecution,
2143
- variables: {
2144
- functionId: currentFunction,
2145
- executionId: currentExecution
2146
- }
2147
- });
2148
- return data.functionsGetExecution ?? {};
2149
- }
2150
- });
2151
- return {
2152
- executeFunction,
2153
- currentExecution: getExecution
2154
- };
2155
- }
388
+ `);function yu(){let{graphql:e}=r(),[i,a]=useState(null),[n,t]=useState(null),s=u({mutationFn:async({functionId:d,body:l={},async:S=!1,path:y="/",method:$="POST"})=>{t(d);let{data:g}=await e.mutation({query:qe,variables:{functionId:d,body:JSON.stringify(l),async:S,path:y,method:$}}),v=null,{_id:b,status:M,responseBody:C,errors:N}=g.functionsCreateExecution??{};if(M==="completed")return JSON.parse(C??"{}");if(M==="failed"&&N)throw new Error(N);a(b??null);let w=await new Promise((U,A)=>{v=e.client.subscribe(`executions.${b}`,k=>{switch(k.payload.status){case"completed":a(null),U(JSON.parse(k.payload.responseBody));break;case"failed":a(null),A(k.payload.errors);break}return 1});});return v?.(),w}}),c=m({queryKey:["appwrite","functions",n,i],queryFn:async()=>{if(!i||!n)return null;let{data:d}=await e.query({query:_e,variables:{functionId:n,executionId:i}});return d.functionsGetExecution??{}}});return {executeFunction:s,currentExecution:c}}function Su({functionId:e,body:i={},async:a=!1,path:n="/",method:t="POST"}){let{graphql:s}=r(),[c,d]=useState(null),[l,S]=useState(null),y=f({queryKey:["appwrite","functions",e,n],queryFn:async()=>{S(e);let{data:g}=await s.mutation({query:qe,variables:{functionId:e,body:JSON.stringify(i),async:a,path:n,method:t}}),v=null,{_id:b,status:M,responseBody:C,errors:N}=g.functionsCreateExecution??{};if(M==="completed")return JSON.parse(C??"{}");if(M==="failed"&&N)throw new Error(N);d(b??null);let w=await new Promise((U,A)=>{v=s.client.subscribe(`executions.${b}`,k=>{switch(k.payload.status){case"completed":d(null),U(JSON.parse(k.payload.responseBody));break;case"failed":d(null),A(k.payload.errors);break}return 1});});return v?.(),w}}),$=m({queryKey:["appwrite","functions",l,c],queryFn:async()=>{if(!c||!l)return null;let{data:g}=await s.query({query:_e,variables:{functionId:l,executionId:c}});return g.functionsGetExecution??{}}});return {executeFunction:y,currentExecution:$}}var Kt;(a=>(a.Account_UserFragment=Ce,a.Identity_ProviderFragment=we))(Kt||={});
2156
389
 
2157
- // src/index.ts
2158
- var fragments;
2159
- ((fragments2) => {
2160
- fragments2.Account_UserFragment = Account_User;
2161
- fragments2.Identity_ProviderFragment = Identity_Provider;
2162
- })(fragments || (fragments = {}));
2163
- export {
2164
- fragments,
2165
- getFragmentData,
2166
- useAccount,
2167
- useAppwrite,
2168
- useCollection,
2169
- useCreateAnonymousSession,
2170
- useCreateDocument,
2171
- useCreateEmailToken,
2172
- useCreateJWT,
2173
- useCreateMagicURLToken,
2174
- useCreateMfaAuthenticator,
2175
- useCreateMfaChallenge,
2176
- useCreateMfaRecoveryCodes,
2177
- useCreatePhoneToken,
2178
- useCreatePhoneVerification,
2179
- useCreateSession,
2180
- useDeleteDocument,
2181
- useDeleteIdentity,
2182
- useDeleteMfaAuthenticator,
2183
- useDeleteSession,
2184
- useDeleteSessions,
2185
- useDocument,
2186
- useFunction,
2187
- useGetMfaRecoveryCodes,
2188
- useGetPrefs,
2189
- useGetSession,
2190
- useListIdentities,
2191
- useListMfaFactors,
2192
- useListSessions,
2193
- useLogin,
2194
- useLogout,
2195
- useLogs,
2196
- useMutation,
2197
- usePasswordRecovery,
2198
- useQuery,
2199
- useQueryClient,
2200
- useResetPassword,
2201
- useSignUp,
2202
- useSuspenseCollection,
2203
- useSuspenseCreateJWT,
2204
- useSuspenseFunction,
2205
- useUpdateDocument,
2206
- useUpdateEmail,
2207
- useUpdateMagicURLSession,
2208
- useUpdateMfa,
2209
- useUpdateMfaAuthenticator,
2210
- useUpdateMfaChallenge,
2211
- useUpdateMfaRecoveryCodes,
2212
- useUpdateName,
2213
- useUpdatePassword,
2214
- useUpdatePhone,
2215
- useUpdatePhoneSession,
2216
- useUpdatePhoneVerification,
2217
- useUpdatePrefs,
2218
- useUpdateSession,
2219
- useVerification
2220
- };
390
+ export { Kt as fragments, Fe as getFragmentData, un as useAccount, r as useAppwrite, Et as useCollection, dn as useCreateAnonymousSession, Rt as useCreateDocument, mn as useCreateEmailToken, yn as useCreateJWT, fn as useCreateMagicURLToken, vn as useCreateMfaAuthenticator, Mn as useCreateMfaChallenge, Dn as useCreateMfaRecoveryCodes, xn as useCreatePhoneToken, Cn as useCreatePhoneVerification, Un as useCreateSession, Qt as useDeleteDocument, hn as useDeleteIdentity, Tn as useDeleteMfaAuthenticator, _n as useDeleteSession, En as useDeleteSessions, Jt as useDocument, yu as useFunction, Rn as useGetMfaRecoveryCodes, Qn as useGetPrefs, On as useGetSession, Bn as useListIdentities, Wn as useListMfaFactors, Xn as useListSessions, Hn as useLogin, Zn as useLogout, nt as useLogs, u as useMutation, at as usePasswordRecovery, m as useQuery, p as useQueryClient, ot as useResetPassword, ct as useSignUp, Pt as useSuspenseCollection, Sn as useSuspenseCreateJWT, Su as useSuspenseFunction, Bt as useUpdateDocument, lt as useUpdateEmail, pt as useUpdateMagicURLSession, St as useUpdateMfa, ft as useUpdateMfaAuthenticator, vt as useUpdateMfaChallenge, Mt as useUpdateMfaRecoveryCodes, Dt as useUpdateName, xt as useUpdatePassword, Ct as useUpdatePhone, Ut as useUpdatePhoneSession, ht as useUpdatePhoneVerification, Vt as useUpdatePrefs, qt as useUpdateSession, Ft as useVerification };
391
+ //# sourceMappingURL=out.js.map
2221
392
  //# sourceMappingURL=index.mjs.map