@zeroin.earth/appwrite-graphql 0.14.0 → 0.14.2

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
@@ -95,34 +95,104 @@ import { castDraft, produce } from "immer";
95
95
 
96
96
  // src/__generated__/graphql.ts
97
97
  var Account_UserFragmentFragmentDoc = { "kind": "Document", "definitions": [{ "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Account_UserFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "User" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "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" } }] } }] } }] };
98
+ var Identity_ProviderFragmentFragmentDoc = { "kind": "Document", "definitions": [{ "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Identity_ProviderFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Identity" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }] } }] };
98
99
  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_UserFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Account_UserFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "User" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "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" } }] } }] } }] };
99
- var CreateEmailSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateEmailSession" }, "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": "accountCreateEmailSession" }, "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" } }] } }] } }] };
100
+ 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" } }] } }] } }] };
101
+ 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" } }] } }] } }] };
102
+ 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" } }] } }] } }] };
103
+ 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" } }] } }] } }] };
104
+ 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" } }] } }] } }] };
105
+ 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" } }] } }] } }] };
106
+ 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" } }] } }] } }] };
107
+ 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" } }] } }] } }] };
108
+ 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" } }] } }] } }] };
109
+ 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" } }] } }] } }] };
110
+ 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" } }] } }] } }] };
111
+ 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" } }] } }] } }] };
100
112
  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" } }] } }] } }] };
113
+ 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" } }] } }] } }] };
114
+ 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" } }] } }] } }] };
115
+ 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" } }] } }] } }] };
116
+ var ListIdentitiesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListIdentities" }, "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": "accountListIdentities" }, "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": "identities" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Identity_ProviderFragment" } }] } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Identity_ProviderFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Identity" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }] } }] };
117
+ 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" } }] } }] } }] };
118
+ 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" } }] } }] } }] } }] };
119
+ 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" } }] } }] } }] };
120
+ 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" } }] } }] } }] } }] };
101
121
  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" } }] } }] } }] };
102
122
  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" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "passwordAgain" } }, "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" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "passwordAgain" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "passwordAgain" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "expire" } }] } }] } }] };
103
123
  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" } }] } }] } }] };
104
124
  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" } }] } }] } }] };
125
+ 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" } }] } }] } }] };
126
+ 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" } }] } }] } }] };
127
+ 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" } }] } }] } }] };
128
+ 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" } }] } }] } }] };
129
+ 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" } }] } }] } }] };
130
+ 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" } }] } }] } }] };
131
+ 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" } }] } }] } }] };
132
+ 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" } }] } }] } }] };
133
+ 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" } }] } }] } }] };
134
+ 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" } }] } }] } }] };
135
+ 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" } }] } }] } }] };
136
+ 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" } }] } }] } }] } }] };
137
+ 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" } }] } }] } }] };
105
138
  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": "expire" } }] } }] } }] };
106
139
  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" } }] } }] } }] } }] };
107
140
  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" } }] } }] } }] };
141
+ 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" } }] } }] } }] };
108
142
  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" } }] } }] } }] };
143
+ 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": "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": "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" } }, { "kind": "Field", "name": { "kind": "Name", "value": "_collectionId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "_databaseId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "_createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "_updatedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "_permissions" } }, { "kind": "Field", "name": { "kind": "Name", "value": "data" } }] } }] } }] };
109
144
  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" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "headers" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }], "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" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "headers" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "headers" } } }], "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" } }] } }] } }] };
110
145
  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" } }] } }] } }] };
111
146
 
112
147
  // src/__generated__/gql.ts
113
148
  var documents = {
114
149
  "\n fragment Account_UserFragment on User {\n name\n email\n prefs {\n data\n }\n }\n": Account_UserFragmentFragmentDoc,
150
+ "\n fragment Identity_ProviderFragment on Identity {\n userId\n provider\n }\n": Identity_ProviderFragmentFragmentDoc,
115
151
  "\n query AccountGet {\n accountGet {\n ...Account_UserFragment\n }\n }\n": AccountGetDocument,
116
- "\n mutation CreateEmailSession($email: String!, $password: String!) {\n accountCreateEmailSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n": CreateEmailSessionDocument,
152
+ "\n mutation CreateAnonymousSession {\n accountCreateAnonymousSession {\n _id\n expire\n current\n }\n }\n": CreateAnonymousSessionDocument,
153
+ "\n mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {\n accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {\n expire\n }\n }\n": CreateEmailTokenDocument,
154
+ "\n mutation CreateJWT {\n accountCreateJWT {\n jwt\n }\n }\n": CreateJwtDocument,
155
+ "\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,
156
+ "\n mutation CreateMfaAuthenticator($type: String!) {\n accountCreateMfaAuthenticator(type: $type) {\n secret\n uri\n }\n }\n": CreateMfaAuthenticatorDocument,
157
+ "\n mutation CreateMfaChallenge($factor: String!) {\n accountCreateMfaChallenge(factor: $factor) {\n userId\n expire\n }\n }\n": CreateMfaChallengeDocument,
158
+ "\n mutation CreateMfaRecoveryCodes {\n accountCreateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": CreateMfaRecoveryCodesDocument,
159
+ "\n mutation CreatePhoneToken($userId: String!, $phone: String!) {\n accountCreatePhoneToken(userId: $userId, phone: $phone) {\n expire\n }\n }\n": CreatePhoneTokenDocument,
160
+ "\n mutation CreatePhoneVerification {\n accountCreatePhoneVerification {\n expire\n }\n }\n": CreatePhoneVerificationDocument,
161
+ "\n mutation CreateSession($userId: String!, $secret: String!) {\n accountCreateSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": CreateSessionDocument,
162
+ "\n mutation DeleteIdentity($identityId: String!) {\n accountDeleteIdentity(identityId: $identityId) {\n status\n }\n }\n": DeleteIdentityDocument,
163
+ "\n mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {\n accountDeleteMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n": DeleteMfaAuthenticatorDocument,
117
164
  "\n mutation DeleteSession($sessionId: String!) {\n accountDeleteSession(sessionId: $sessionId) {\n status\n }\n }\n": DeleteSessionDocument,
165
+ "\n query GetMfaRecoveryCodes {\n accountGetMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": GetMfaRecoveryCodesDocument,
166
+ "\n query GetPrefs {\n accountGetPrefs {\n data\n }\n }\n": GetPrefsDocument,
167
+ "\n query GetSession($sessionId: String!) {\n accountGetSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": GetSessionDocument,
168
+ "\n query ListIdentities($queries: [String!]) {\n accountListIdentities(queries: $queries) {\n total\n identities {\n ...Identity_ProviderFragment\n }\n }\n }\n": ListIdentitiesDocument,
169
+ "\n query ListMfaFactors {\n accountListMfaFactors {\n totp\n phone\n email\n }\n }\n": ListMfaFactorsDocument,
170
+ "\n query ListSessions {\n accountListSessions {\n sessions {\n _id\n _createdAt\n osName\n clientName\n }\n }\n }\n": ListSessionsDocument,
171
+ "\n mutation CreateEmailPasswordSession($email: String!, $password: String!) {\n accountCreateEmailPasswordSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n": CreateEmailPasswordSessionDocument,
172
+ "\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,
118
173
  "\n mutation CreateRecovery($email: String!, $url: String!) {\n accountCreateRecovery(email: $email, url: $url) {\n expire\n }\n }\n": CreateRecoveryDocument,
119
174
  "\n mutation UpdateRecovery(\n $userId: String!\n $secret: String!\n $password: String!\n $passwordAgain: String!\n ) {\n accountUpdateRecovery(\n userId: $userId\n secret: $secret\n password: $password\n passwordAgain: $passwordAgain\n ) {\n expire\n }\n }\n": UpdateRecoveryDocument,
120
175
  "\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,
121
176
  "\n mutation VerifyEmail($url: String!) {\n accountCreateVerification(url: $url) {\n expire\n }\n }\n": VerifyEmailDocument,
177
+ "\n mutation UpdateEmail($email: String!, $password: String!) {\n accountUpdateEmail(email: $email, password: $password) {\n name\n email\n }\n }\n": UpdateEmailDocument,
178
+ "\n mutation UpdateMagicURLSession($userId: String!, $secret: String!) {\n accountUpdateMagicURLSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": UpdateMagicUrlSessionDocument,
179
+ "\n mutation UpdateMFA($mfa: Boolean!) {\n accountUpdateMFA(mfa: $mfa) {\n mfa\n }\n }\n": UpdateMfaDocument,
180
+ "\n mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {\n accountUpdateMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n": UpdateMfaAuthenticatorDocument,
181
+ "\n mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {\n accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {\n status\n }\n }\n": UpdateMfaChallengeDocument,
182
+ "\n mutation UpdateMfaRecoveryCodes {\n accountUpdateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": UpdateMfaRecoveryCodesDocument,
183
+ "\n mutation UpdateName($name: String!) {\n accountUpdateName(name: $name) {\n name\n }\n }\n": UpdateNameDocument,
184
+ "\n mutation UpdatePassword($password: String!, $oldPassword: String!) {\n accountUpdatePassword(password: $password, oldPassword: $oldPassword) {\n status\n }\n }\n": UpdatePasswordDocument,
185
+ "\n mutation UpdatePhone($phone: String!, $password: String!) {\n accountUpdatePhone(phone: $phone, password: $password) {\n phone\n }\n }\n": UpdatePhoneDocument,
186
+ "\n mutation UpdatePhoneSession($userId: String!, $secret: String!) {\n accountUpdatePhoneSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": UpdatePhoneSessionDocument,
187
+ "\n mutation UpdatePhoneVerification($userId: String!, $secret: String!) {\n accountUpdatePhoneVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdatePhoneVerificationDocument,
188
+ "\n mutation UpdatePrefs($prefs: JSON!) {\n accountUpdatePrefs(prefs: $prefs) {\n prefs {\n data\n }\n }\n }\n": UpdatePrefsDocument,
189
+ "\n mutation UpdateSession($sessionId: String!) {\n accountUpdateSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": UpdateSessionDocument,
122
190
  "\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdateVerificationDocument,
123
191
  "\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,
124
192
  "\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,
193
+ "\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,
125
194
  "\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,
195
+ "\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 _collectionId\n _databaseId\n _createdAt\n _updatedAt\n _permissions\n data\n }\n }\n": UpdateDocumentDocument,
126
196
  "\n mutation CreateExecution(\n $functionId: String!\n $body: String\n $async: Boolean\n $path: String\n $method: String\n $headers: JSON\n ) {\n functionsCreateExecution(\n functionId: $functionId\n body: $body\n async: $async\n path: $path\n method: $method\n headers: $headers\n ) {\n _id\n status\n responseStatusCode\n responseBody\n errors\n duration\n }\n }\n": CreateExecutionDocument,
127
197
  "\n query GetFunctionExecution($functionId: String!, $executionId: String!) {\n functionsGetExecution(functionId: $functionId, executionId: $executionId) {\n status\n errors\n duration\n }\n }\n": GetFunctionExecutionDocument
128
198
  };
@@ -141,9 +211,7 @@ var getAccount = gql(
141
211
  }
142
212
  `
143
213
  );
144
- function useAccount({
145
- options
146
- }) {
214
+ function useAccount() {
147
215
  const { graphql: graphql2 } = useAppwrite();
148
216
  const queryClient2 = useQueryClient();
149
217
  const queryResult = useQuery({
@@ -157,8 +225,7 @@ function useAccount({
157
225
  }
158
226
  return data.accountGet;
159
227
  },
160
- retry: false,
161
- ...options
228
+ retry: false
162
229
  });
163
230
  useEffect(() => {
164
231
  const unsubscribe = graphql2.client.subscribe(
@@ -184,268 +251,1321 @@ function useAccount({
184
251
  );
185
252
  return unsubscribe;
186
253
  }, [graphql2.client, queryClient2]);
187
- return {
188
- data: queryResult.data,
189
- dataUpdatedAt: queryResult.dataUpdatedAt,
190
- error: queryResult.error,
191
- errorUpdateCount: queryResult.errorUpdateCount,
192
- errorUpdatedAt: queryResult.errorUpdatedAt,
193
- failureCount: queryResult.failureCount,
194
- failureReason: queryResult.failureReason,
195
- fetchStatus: queryResult.fetchStatus,
196
- isError: queryResult.isError,
197
- isFetched: queryResult.isFetched,
198
- isFetchedAfterMount: queryResult.isFetchedAfterMount,
199
- isFetching: queryResult.isFetching,
200
- isLoading: queryResult.isLoading,
201
- isLoadingError: queryResult.isLoadingError,
202
- isPaused: queryResult.isPaused,
203
- isPending: queryResult.isPending,
204
- isPlaceholderData: queryResult.isPlaceholderData,
205
- isRefetchError: queryResult.isRefetchError,
206
- isRefetching: queryResult.isRefetching,
207
- isStale: queryResult.isStale,
208
- isSuccess: queryResult.isSuccess,
209
- refetch: queryResult.refetch,
210
- status: queryResult.status
211
- };
254
+ return queryResult;
212
255
  }
213
256
 
214
- // src/account/useLogin.ts
215
- var createEmailSession = gql(
257
+ // src/__generated__/fragment-masking.ts
258
+ function getFragmentData(_documentNode, fragmentType) {
259
+ return fragmentType;
260
+ }
261
+
262
+ // src/account/useCreateAnonymousSession.ts
263
+ var createAnonymousSession = gql(
216
264
  /* GraphQL */
217
265
  `
218
- mutation CreateEmailSession($email: String!, $password: String!) {
219
- accountCreateEmailSession(email: $email, password: $password) {
220
- userId
266
+ mutation CreateAnonymousSession {
267
+ accountCreateAnonymousSession {
268
+ _id
221
269
  expire
222
270
  current
223
271
  }
224
272
  }
225
273
  `
226
274
  );
227
- function useLogin() {
228
- const { account: account2, graphql: graphql2 } = useAppwrite();
229
- const login = useMutation({
230
- mutationFn: async ({ email, password }) => {
231
- return await account2.createEmailPasswordSession(email, password);
275
+ function useCreateAnonymousSession() {
276
+ const { graphql: graphql2 } = useAppwrite();
277
+ const queryResult = useMutation({
278
+ mutationFn: async () => {
279
+ const { data, errors } = await graphql2.mutation({
280
+ query: createAnonymousSession
281
+ });
282
+ if (errors) {
283
+ throw errors;
284
+ }
285
+ return data.accountCreateAnonymousSession;
232
286
  }
233
287
  });
234
- const oAuthLogin = useMutation({
235
- mutationFn: async ({ provider, success, failure }) => {
236
- return account2.createOAuth2Session(provider, success, failure);
288
+ return { ...queryResult };
289
+ }
290
+
291
+ // src/account/useCreateEmailToken.ts
292
+ var createEmailToken = gql(
293
+ /* GraphQL */
294
+ `
295
+ mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {
296
+ accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {
297
+ expire
298
+ }
299
+ }
300
+ `
301
+ );
302
+ function useCreateEmailToken() {
303
+ const { graphql: graphql2 } = useAppwrite();
304
+ const queryResult = useMutation({
305
+ mutationFn: async ({ userId, email, phrase }) => {
306
+ const { data, errors } = await graphql2.mutation({
307
+ query: createEmailToken,
308
+ variables: {
309
+ userId,
310
+ email,
311
+ phrase
312
+ }
313
+ });
314
+ if (errors) {
315
+ throw errors;
316
+ }
317
+ return data.accountCreateEmailToken;
237
318
  }
238
319
  });
239
- return {
240
- login: {
241
- context: login.context,
242
- data: login.data,
243
- error: login.error,
244
- failureCount: login.failureCount,
245
- failureReason: login.failureReason,
246
- isError: login.isError,
247
- isIdle: login.isIdle,
248
- isPaused: login.isPaused,
249
- isPending: login.isPending,
250
- isSuccess: login.isSuccess,
251
- mutate: login.mutate,
252
- mutateAsync: login.mutateAsync,
253
- reset: login.reset,
254
- status: login.status,
255
- submittedAt: login.submittedAt,
256
- variables: login.variables
320
+ return { ...queryResult };
321
+ }
322
+
323
+ // src/useSuspenseQuery.ts
324
+ import {
325
+ useSuspenseQuery as useSuspenseReactQuery
326
+ } from "@tanstack/react-query";
327
+ function useSuspenseQuery(options) {
328
+ const queryClient2 = useQueryClient();
329
+ return useSuspenseReactQuery(options, queryClient2);
330
+ }
331
+
332
+ // src/account/useCreateJWT.ts
333
+ var accountCreateJWT = gql(
334
+ /* GraphQL */
335
+ `
336
+ mutation CreateJWT {
337
+ accountCreateJWT {
338
+ jwt
339
+ }
340
+ }
341
+ `
342
+ );
343
+ function useCreateJWT({ gcTime = 6e5 } = {}) {
344
+ const { graphql: graphql2 } = useAppwrite();
345
+ const queryClient2 = useQueryClient();
346
+ const queryResult = useMutation({
347
+ gcTime,
348
+ mutationKey: ["appwrite", "jwt"],
349
+ mutationFn: async () => {
350
+ const { data, errors } = await graphql2.mutation({
351
+ query: accountCreateJWT
352
+ });
353
+ if (errors) {
354
+ throw errors;
355
+ }
356
+ return data.accountCreateJWT;
257
357
  },
258
- oAuthLogin: {
259
- context: oAuthLogin.context,
260
- data: oAuthLogin.data,
261
- error: oAuthLogin.error,
262
- failureCount: oAuthLogin.failureCount,
263
- failureReason: oAuthLogin.failureReason,
264
- isError: oAuthLogin.isError,
265
- isIdle: oAuthLogin.isIdle,
266
- isPaused: oAuthLogin.isPaused,
267
- isPending: oAuthLogin.isPending,
268
- isSuccess: oAuthLogin.isSuccess,
269
- mutate: oAuthLogin.mutate,
270
- mutateAsync: oAuthLogin.mutateAsync,
271
- reset: oAuthLogin.reset,
272
- status: oAuthLogin.status,
273
- submittedAt: oAuthLogin.submittedAt,
274
- variables: oAuthLogin.variables
358
+ onSuccess: (data) => {
359
+ queryClient2.setQueryData(["appwrite", "jwt"], data.jwt, { updatedAt: Date.now() });
275
360
  }
276
- };
361
+ });
362
+ return { ...queryResult };
363
+ }
364
+ function useSuspenseCreateJWT({ gcTime = 6e5 } = {}) {
365
+ const { graphql: graphql2 } = useAppwrite();
366
+ const queryResult = useSuspenseQuery({
367
+ gcTime,
368
+ queryKey: ["appwrite", "jwt"],
369
+ queryFn: async () => {
370
+ const { data, errors } = await graphql2.mutation({
371
+ query: accountCreateJWT
372
+ });
373
+ if (errors) {
374
+ throw errors;
375
+ }
376
+ return data.accountCreateJWT;
377
+ }
378
+ });
379
+ return { ...queryResult };
277
380
  }
278
381
 
279
- // src/__generated__/fragment-masking.ts
280
- function getFragmentData(_documentNode, fragmentType) {
281
- return fragmentType;
382
+ // src/account/useCreateMagicURLToken.ts
383
+ var createMagicURLToken = gql(
384
+ /* GraphQL */
385
+ `
386
+ mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
387
+ accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
388
+ expire
389
+ }
390
+ }
391
+ `
392
+ );
393
+ function useCreateMagicURLToken() {
394
+ const { graphql: graphql2 } = useAppwrite();
395
+ const queryResult = useMutation({
396
+ mutationFn: async ({ userId, email, url, phrase }) => {
397
+ const { data, errors } = await graphql2.mutation({
398
+ query: createMagicURLToken,
399
+ variables: {
400
+ userId,
401
+ email,
402
+ url,
403
+ phrase
404
+ }
405
+ });
406
+ if (errors) {
407
+ throw errors;
408
+ }
409
+ return data.accountCreateMagicURLToken;
410
+ }
411
+ });
412
+ return { ...queryResult };
413
+ }
414
+
415
+ // src/account/useCreateMfaAuthenticator.ts
416
+ var accountCreateMfaAuthenticator = gql(
417
+ /* GraphQL */
418
+ `
419
+ mutation CreateMfaAuthenticator($type: String!) {
420
+ accountCreateMfaAuthenticator(type: $type) {
421
+ secret
422
+ uri
423
+ }
424
+ }
425
+ `
426
+ );
427
+ function useCreateMfaAuthenticator() {
428
+ const { graphql: graphql2 } = useAppwrite();
429
+ const queryResult = useMutation({
430
+ mutationFn: async ({ type = "totp" }) => {
431
+ const { data, errors } = await graphql2.mutation({
432
+ query: accountCreateMfaAuthenticator,
433
+ variables: {
434
+ type
435
+ }
436
+ });
437
+ if (errors) {
438
+ throw errors;
439
+ }
440
+ return data.accountCreateMfaAuthenticator;
441
+ }
442
+ });
443
+ return { ...queryResult };
444
+ }
445
+
446
+ // src/account/useCreateMfaChallenge.ts
447
+ var accountCreateMfaChallenge = gql(
448
+ /* GraphQL */
449
+ `
450
+ mutation CreateMfaChallenge($factor: String!) {
451
+ accountCreateMfaChallenge(factor: $factor) {
452
+ userId
453
+ expire
454
+ }
455
+ }
456
+ `
457
+ );
458
+ function useCreateMfaChallenge() {
459
+ const { graphql: graphql2 } = useAppwrite();
460
+ const queryResult = useMutation({
461
+ mutationFn: async ({ factor }) => {
462
+ const { data, errors } = await graphql2.mutation({
463
+ query: accountCreateMfaChallenge,
464
+ variables: {
465
+ factor
466
+ }
467
+ });
468
+ if (errors) {
469
+ throw errors;
470
+ }
471
+ return data.accountCreateMfaChallenge;
472
+ }
473
+ });
474
+ return { ...queryResult };
475
+ }
476
+
477
+ // src/account/useCreateMfaRecoveryCodes.ts
478
+ var accountCreateMfaRecoveryCodes = gql(
479
+ /* GraphQL */
480
+ `
481
+ mutation CreateMfaRecoveryCodes {
482
+ accountCreateMfaRecoveryCodes {
483
+ recoveryCodes
484
+ }
485
+ }
486
+ `
487
+ );
488
+ function useCreateMfaRecoveryCodes() {
489
+ const { graphql: graphql2 } = useAppwrite();
490
+ const queryResult = useMutation({
491
+ mutationFn: async () => {
492
+ const { data, errors } = await graphql2.mutation({
493
+ query: accountCreateMfaRecoveryCodes
494
+ });
495
+ if (errors) {
496
+ throw errors;
497
+ }
498
+ return data.accountCreateMfaRecoveryCodes;
499
+ }
500
+ });
501
+ return { ...queryResult };
502
+ }
503
+
504
+ // src/account/useCreatePhoneToken.ts
505
+ var createPhoneToken = gql(
506
+ /* GraphQL */
507
+ `
508
+ mutation CreatePhoneToken($userId: String!, $phone: String!) {
509
+ accountCreatePhoneToken(userId: $userId, phone: $phone) {
510
+ expire
511
+ }
512
+ }
513
+ `
514
+ );
515
+ function useCreatePhoneToken() {
516
+ const { graphql: graphql2 } = useAppwrite();
517
+ const queryResult = useMutation({
518
+ mutationFn: async ({ userId, phone }) => {
519
+ const { data, errors } = await graphql2.mutation({
520
+ query: createPhoneToken,
521
+ variables: {
522
+ userId,
523
+ phone
524
+ }
525
+ });
526
+ if (errors) {
527
+ throw errors;
528
+ }
529
+ return data.accountCreatePhoneToken;
530
+ }
531
+ });
532
+ return { ...queryResult };
533
+ }
534
+
535
+ // src/account/useCreatePhoneVerification.ts
536
+ var createPhoneVerification = gql(
537
+ /* GraphQL */
538
+ `
539
+ mutation CreatePhoneVerification {
540
+ accountCreatePhoneVerification {
541
+ expire
542
+ }
543
+ }
544
+ `
545
+ );
546
+ function useCreatePhoneVerification() {
547
+ const { graphql: graphql2 } = useAppwrite();
548
+ const queryResult = useMutation({
549
+ mutationFn: async () => {
550
+ const { data, errors } = await graphql2.mutation({
551
+ query: createPhoneVerification
552
+ });
553
+ if (errors) {
554
+ throw errors;
555
+ }
556
+ return data.accountCreatePhoneVerification;
557
+ }
558
+ });
559
+ return { ...queryResult };
560
+ }
561
+
562
+ // src/account/useCreateSession.ts
563
+ var createSession = gql(
564
+ /* GraphQL */
565
+ `
566
+ mutation CreateSession($userId: String!, $secret: String!) {
567
+ accountCreateSession(userId: $userId, secret: $secret) {
568
+ userId
569
+ expire
570
+ current
571
+ }
572
+ }
573
+ `
574
+ );
575
+ function useCreateSession() {
576
+ const { graphql: graphql2 } = useAppwrite();
577
+ const queryResult = useMutation({
578
+ mutationFn: async ({ userId, secret }) => {
579
+ const { data, errors } = await graphql2.mutation({
580
+ query: createSession,
581
+ variables: {
582
+ userId,
583
+ secret
584
+ }
585
+ });
586
+ if (errors) {
587
+ throw errors;
588
+ }
589
+ return data.accountCreateSession;
590
+ }
591
+ });
592
+ return { ...queryResult };
593
+ }
594
+
595
+ // src/account/useDeleteIdentity.ts
596
+ var accountDeleteIdentity = gql(
597
+ /* GraphQL */
598
+ `
599
+ mutation DeleteIdentity($identityId: String!) {
600
+ accountDeleteIdentity(identityId: $identityId) {
601
+ status
602
+ }
603
+ }
604
+ `
605
+ );
606
+ function useDeleteIdentity() {
607
+ const { graphql: graphql2 } = useAppwrite();
608
+ const queryResult = useMutation({
609
+ mutationFn: async ({ identityId }) => {
610
+ const { data, errors } = await graphql2.mutation({
611
+ query: accountDeleteIdentity,
612
+ variables: {
613
+ identityId
614
+ }
615
+ });
616
+ if (errors) {
617
+ throw errors;
618
+ }
619
+ return data.accountDeleteIdentity ?? { status: false };
620
+ }
621
+ });
622
+ return { ...queryResult };
623
+ }
624
+
625
+ // src/account/useDeleteMfaAuthenticator.ts
626
+ var updateMFAAuthenticator = gql(
627
+ /* GraphQL */
628
+ `
629
+ mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {
630
+ accountDeleteMfaAuthenticator(type: $type, otp: $otp) {
631
+ mfa
632
+ }
633
+ }
634
+ `
635
+ );
636
+ function useDeleteMfaAuthenticator() {
637
+ const { graphql: graphql2 } = useAppwrite();
638
+ const queryResult = useMutation({
639
+ mutationFn: async ({ type = "totp", otp }) => {
640
+ const { data, errors } = await graphql2.mutation({
641
+ query: updateMFAAuthenticator,
642
+ variables: {
643
+ type,
644
+ otp
645
+ }
646
+ });
647
+ if (errors) {
648
+ throw errors;
649
+ }
650
+ return data.accountDeleteMfaAuthenticator;
651
+ }
652
+ });
653
+ return { ...queryResult };
654
+ }
655
+
656
+ // src/account/useDeleteSession.ts
657
+ var deleteSession = gql(
658
+ /* GraphQL */
659
+ `
660
+ mutation DeleteSession($sessionId: String!) {
661
+ accountDeleteSession(sessionId: $sessionId) {
662
+ status
663
+ }
664
+ }
665
+ `
666
+ );
667
+ function useDeleteSession() {
668
+ const { graphql: graphql2 } = useAppwrite();
669
+ const queryResult = useMutation({
670
+ mutationFn: async ({ sessionId }) => {
671
+ const { data, errors } = await graphql2.mutation({
672
+ query: deleteSession,
673
+ variables: {
674
+ sessionId
675
+ }
676
+ });
677
+ if (errors) {
678
+ throw errors;
679
+ }
680
+ return data.accountDeleteSession;
681
+ }
682
+ });
683
+ return { ...queryResult };
684
+ }
685
+
686
+ // src/account/useDeleteSessions.ts
687
+ var deleteSession2 = gql(
688
+ /* GraphQL */
689
+ `
690
+ mutation DeleteSession($sessionId: String!) {
691
+ accountDeleteSession(sessionId: $sessionId) {
692
+ status
693
+ }
694
+ }
695
+ `
696
+ );
697
+ function useDeleteSessions() {
698
+ const { graphql: graphql2 } = useAppwrite();
699
+ const queryResult = useMutation({
700
+ mutationFn: async ({ sessionId }) => {
701
+ const { data, errors } = await graphql2.mutation({
702
+ query: deleteSession2,
703
+ variables: {
704
+ sessionId
705
+ }
706
+ });
707
+ if (errors) {
708
+ throw errors;
709
+ }
710
+ return data.accountDeleteSession;
711
+ }
712
+ });
713
+ return { ...queryResult };
714
+ }
715
+
716
+ // src/account/useGetMfaRecoveryCodes.ts
717
+ var getMFARecoveryCodes = gql(
718
+ /* GraphQL */
719
+ `
720
+ query GetMfaRecoveryCodes {
721
+ accountGetMfaRecoveryCodes {
722
+ recoveryCodes
723
+ }
724
+ }
725
+ `
726
+ );
727
+ function useGetMfaRecoveryCodes() {
728
+ const { graphql: graphql2 } = useAppwrite();
729
+ const queryResult = useQuery({
730
+ queryKey: ["appwrite", "account", "mfa", "recovery-codes"],
731
+ queryFn: async () => {
732
+ const { data, errors } = await graphql2.query({
733
+ query: getMFARecoveryCodes
734
+ });
735
+ if (errors) {
736
+ throw errors;
737
+ }
738
+ return data.accountGetMfaRecoveryCodes;
739
+ }
740
+ });
741
+ return { ...queryResult };
742
+ }
743
+
744
+ // src/account/useGetPrefs.ts
745
+ var accountGetPrefs = gql(
746
+ /* GraphQL */
747
+ `
748
+ query GetPrefs {
749
+ accountGetPrefs {
750
+ data
751
+ }
752
+ }
753
+ `
754
+ );
755
+ function useGetPrefs() {
756
+ const { graphql: graphql2 } = useAppwrite();
757
+ const queryResult = useQuery({
758
+ queryKey: ["appwrite", "account", "prefs"],
759
+ queryFn: async () => {
760
+ const { data, errors } = await graphql2.query({
761
+ query: accountGetPrefs
762
+ });
763
+ if (errors) {
764
+ throw errors;
765
+ }
766
+ return data.accountGetPrefs;
767
+ }
768
+ });
769
+ return { ...queryResult };
770
+ }
771
+
772
+ // src/account/useGetSession.ts
773
+ var getSession = gql(
774
+ /* GraphQL */
775
+ `
776
+ query GetSession($sessionId: String!) {
777
+ accountGetSession(sessionId: $sessionId) {
778
+ userId
779
+ expire
780
+ current
781
+ }
782
+ }
783
+ `
784
+ );
785
+ function useGetSession({ sessionId }) {
786
+ const { graphql: graphql2 } = useAppwrite();
787
+ const queryResult = useQuery({
788
+ queryKey: ["appwrite", "account", "session", sessionId],
789
+ queryFn: async () => {
790
+ const { data, errors } = await graphql2.query({
791
+ query: getSession,
792
+ variables: { sessionId }
793
+ });
794
+ if (errors) {
795
+ throw errors;
796
+ }
797
+ return data.accountGetSession;
798
+ }
799
+ });
800
+ return queryResult;
801
+ }
802
+
803
+ // src/account/useListIdentities.ts
804
+ var accountListIdentities = gql(
805
+ /* GraphQL */
806
+ `
807
+ query ListIdentities($queries: [String!]) {
808
+ accountListIdentities(queries: $queries) {
809
+ total
810
+ identities {
811
+ ...Identity_ProviderFragment
812
+ }
813
+ }
814
+ }
815
+ `
816
+ );
817
+ function useListIdentities({ queries }) {
818
+ const { graphql: graphql2 } = useAppwrite();
819
+ const queryResult = useQuery({
820
+ queryKey: ["appwrite", "account", "identities", queries],
821
+ queryFn: async () => {
822
+ const { data, errors } = await graphql2.query({
823
+ query: accountListIdentities,
824
+ variables: {
825
+ queries
826
+ }
827
+ });
828
+ if (errors) {
829
+ throw errors;
830
+ }
831
+ return data.accountListIdentities;
832
+ }
833
+ });
834
+ return { ...queryResult };
835
+ }
836
+
837
+ // src/account/useListMfaFactors.ts
838
+ var listMFAFactors = gql(
839
+ /* GraphQL */
840
+ `
841
+ query ListMfaFactors {
842
+ accountListMfaFactors {
843
+ totp
844
+ phone
845
+ email
846
+ }
847
+ }
848
+ `
849
+ );
850
+ function useListMfaFactors() {
851
+ const { graphql: graphql2 } = useAppwrite();
852
+ const queryResult = useQuery({
853
+ queryKey: ["appwrite", "account", "mfa", "factors"],
854
+ queryFn: async () => {
855
+ const { data, errors } = await graphql2.query({
856
+ query: listMFAFactors
857
+ });
858
+ if (errors) {
859
+ throw errors;
860
+ }
861
+ return data.accountListMfaFactors;
862
+ }
863
+ });
864
+ return { ...queryResult };
865
+ }
866
+
867
+ // src/account/useListSessions.ts
868
+ var accountListSessions = gql(
869
+ /* GraphQL */
870
+ `
871
+ query ListSessions {
872
+ accountListSessions {
873
+ sessions {
874
+ _id
875
+ _createdAt
876
+ osName
877
+ clientName
878
+ }
879
+ }
880
+ }
881
+ `
882
+ );
883
+ function useListSessions() {
884
+ const { graphql: graphql2 } = useAppwrite();
885
+ const queryResult = useQuery({
886
+ queryKey: ["appwrite", "account", "sessions"],
887
+ queryFn: async () => {
888
+ const { data, errors } = await graphql2.query({
889
+ query: accountListSessions
890
+ });
891
+ if (errors) {
892
+ throw errors;
893
+ }
894
+ return data.accountListSessions;
895
+ }
896
+ });
897
+ return { ...queryResult };
898
+ }
899
+
900
+ // src/account/useLogin.ts
901
+ var accountCreateEmailPasswordSession = gql(
902
+ /* GraphQL */
903
+ `
904
+ mutation CreateEmailPasswordSession($email: String!, $password: String!) {
905
+ accountCreateEmailPasswordSession(email: $email, password: $password) {
906
+ userId
907
+ expire
908
+ current
909
+ }
910
+ }
911
+ `
912
+ );
913
+ function useLogin() {
914
+ const { account: account2, graphql: graphql2 } = useAppwrite();
915
+ const login = useMutation({
916
+ mutationFn: async ({ email, password }) => {
917
+ const { data, errors } = await graphql2.mutation({
918
+ query: accountCreateEmailPasswordSession,
919
+ variables: {
920
+ email,
921
+ password
922
+ }
923
+ });
924
+ if (errors) {
925
+ throw errors;
926
+ }
927
+ return data.accountCreateEmailPasswordSession;
928
+ }
929
+ });
930
+ const oAuthLogin = useMutation({
931
+ mutationFn: async ({ provider, success, failure }) => {
932
+ return account2.createOAuth2Session(provider, success, failure);
933
+ }
934
+ });
935
+ return {
936
+ login,
937
+ oAuthLogin
938
+ };
939
+ }
940
+
941
+ // src/account/useLogout.ts
942
+ var deleteSession3 = gql(
943
+ /* GraphQL */
944
+ `
945
+ mutation DeleteSession($sessionId: String!) {
946
+ accountDeleteSession(sessionId: $sessionId) {
947
+ status
948
+ }
949
+ }
950
+ `
951
+ );
952
+ function useLogout() {
953
+ const { graphql: graphql2 } = useAppwrite();
954
+ const queryClient2 = useQueryClient();
955
+ const queryResult = useMutation({
956
+ mutationFn: async ({ sessionId }) => {
957
+ const { data, errors } = await graphql2.mutation({
958
+ query: deleteSession3,
959
+ variables: {
960
+ sessionId
961
+ }
962
+ });
963
+ if (errors) {
964
+ throw errors;
965
+ }
966
+ return data?.accountDeleteSession;
967
+ },
968
+ onSuccess: async () => {
969
+ queryClient2.setQueryData(["appwrite"], null);
970
+ queryClient2.removeQueries({ queryKey: ["appwrite"] });
971
+ queryClient2.clear();
972
+ }
973
+ });
974
+ return { ...queryResult, mutate: queryResult.mutate };
975
+ }
976
+
977
+ // src/account/useLogs.ts
978
+ var accountListLogs = gql(
979
+ /* GraphQL */
980
+ `
981
+ query ListLogs($queries: [String!]) {
982
+ accountListLogs(queries: $queries) {
983
+ total
984
+ logs {
985
+ event
986
+ userId
987
+ userEmail
988
+ userName
989
+ mode
990
+ ip
991
+ time
992
+ osCode
993
+ osName
994
+ osVersion
995
+ clientType
996
+ clientCode
997
+ clientName
998
+ clientVersion
999
+ clientEngine
1000
+ clientEngineVersion
1001
+ deviceName
1002
+ deviceBrand
1003
+ deviceModel
1004
+ countryCode
1005
+ countryName
1006
+ }
1007
+ }
1008
+ }
1009
+ `
1010
+ );
1011
+ function useLogs({ queries }) {
1012
+ const { graphql: graphql2 } = useAppwrite();
1013
+ const queryResult = useQuery({
1014
+ queryKey: ["appwrite", "account", "logs", queries],
1015
+ queryFn: async () => {
1016
+ const { data, errors } = await graphql2.query({
1017
+ query: accountListLogs,
1018
+ variables: {
1019
+ queries
1020
+ }
1021
+ });
1022
+ if (errors) {
1023
+ throw errors;
1024
+ }
1025
+ return data.accountListLogs;
1026
+ }
1027
+ });
1028
+ return { ...queryResult };
1029
+ }
1030
+
1031
+ // src/account/usePasswordRecovery.ts
1032
+ var createRecovery = gql(
1033
+ /* GraphQL */
1034
+ `
1035
+ mutation CreateRecovery($email: String!, $url: String!) {
1036
+ accountCreateRecovery(email: $email, url: $url) {
1037
+ expire
1038
+ }
1039
+ }
1040
+ `
1041
+ );
1042
+ function usePasswordRecovery() {
1043
+ const { graphql: graphql2 } = useAppwrite();
1044
+ const queryResult = useMutation({
1045
+ mutationFn: async ({ email, url: resetUrl }) => {
1046
+ const { data, errors } = await graphql2.mutation({
1047
+ query: createRecovery,
1048
+ variables: {
1049
+ email,
1050
+ url: resetUrl
1051
+ }
1052
+ });
1053
+ if (errors) {
1054
+ throw errors;
1055
+ }
1056
+ return data.accountCreateRecovery;
1057
+ },
1058
+ onSuccess: async (_, variables) => {
1059
+ localStorage.setItem("email", variables.email);
1060
+ }
1061
+ });
1062
+ return { ...queryResult };
1063
+ }
1064
+
1065
+ // src/account/useResetPassword.ts
1066
+ var updateRecovery = gql(
1067
+ /* GraphQL */
1068
+ `
1069
+ mutation UpdateRecovery(
1070
+ $userId: String!
1071
+ $secret: String!
1072
+ $password: String!
1073
+ $passwordAgain: String!
1074
+ ) {
1075
+ accountUpdateRecovery(
1076
+ userId: $userId
1077
+ secret: $secret
1078
+ password: $password
1079
+ passwordAgain: $passwordAgain
1080
+ ) {
1081
+ expire
1082
+ }
1083
+ }
1084
+ `
1085
+ );
1086
+ function useResetPassword() {
1087
+ const { graphql: graphql2 } = useAppwrite();
1088
+ const queryResult = useMutation({
1089
+ mutationFn: async ({ userId, secret, password, passwordAgain: confirmPassword }) => {
1090
+ const { data, errors } = await graphql2.mutation({
1091
+ query: updateRecovery,
1092
+ variables: {
1093
+ userId,
1094
+ secret,
1095
+ password,
1096
+ passwordAgain: confirmPassword
1097
+ }
1098
+ });
1099
+ if (errors) {
1100
+ throw errors;
1101
+ }
1102
+ return data.accountUpdateRecovery ?? {};
1103
+ }
1104
+ });
1105
+ return { ...queryResult };
1106
+ }
1107
+
1108
+ // src/account/useSignUp.ts
1109
+ import { ID } from "appwrite";
1110
+ var createAccount = gql(
1111
+ /* GraphQL */
1112
+ `
1113
+ mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
1114
+ accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
1115
+ name
1116
+ email
1117
+ }
1118
+ }
1119
+ `
1120
+ );
1121
+ var verify = gql(
1122
+ /* GraphQL */
1123
+ `
1124
+ mutation VerifyEmail($url: String!) {
1125
+ accountCreateVerification(url: $url) {
1126
+ expire
1127
+ }
1128
+ }
1129
+ `
1130
+ );
1131
+ function useSignUp() {
1132
+ const { graphql: graphql2 } = useAppwrite();
1133
+ const signUp = useMutation({
1134
+ mutationFn: async ({ userId, email, password, name }) => {
1135
+ const { data, errors } = await graphql2.mutation({
1136
+ query: createAccount,
1137
+ variables: {
1138
+ userId: userId ?? ID.unique(),
1139
+ name,
1140
+ email,
1141
+ password
1142
+ }
1143
+ });
1144
+ if (errors) {
1145
+ throw errors;
1146
+ }
1147
+ return data.accountCreate;
1148
+ }
1149
+ });
1150
+ const verifyEmail = useMutation({
1151
+ mutationFn: async ({ verifyUrl }) => {
1152
+ const { data, errors } = await graphql2.mutation({
1153
+ query: verify,
1154
+ variables: {
1155
+ url: verifyUrl
1156
+ }
1157
+ });
1158
+ if (errors) {
1159
+ throw errors;
1160
+ }
1161
+ return data.accountCreateVerification;
1162
+ }
1163
+ });
1164
+ return { signUp, verifyEmail };
1165
+ }
1166
+
1167
+ // src/account/useUpdateEmail.ts
1168
+ var accountUpdateEmail = gql(
1169
+ /* GraphQL */
1170
+ `
1171
+ mutation UpdateEmail($email: String!, $password: String!) {
1172
+ accountUpdateEmail(email: $email, password: $password) {
1173
+ name
1174
+ email
1175
+ }
1176
+ }
1177
+ `
1178
+ );
1179
+ function useUpdateEmail() {
1180
+ const { graphql: graphql2 } = useAppwrite();
1181
+ const queryResult = useMutation({
1182
+ mutationFn: async ({ email, password }) => {
1183
+ const { data, errors } = await graphql2.mutation({
1184
+ query: accountUpdateEmail,
1185
+ variables: {
1186
+ email,
1187
+ password
1188
+ }
1189
+ });
1190
+ if (errors) {
1191
+ throw errors;
1192
+ }
1193
+ return data.accountUpdateEmail;
1194
+ }
1195
+ });
1196
+ return { ...queryResult };
1197
+ }
1198
+
1199
+ // src/account/useUpdateMagicURLSession.ts
1200
+ var updateMagicURLSession = gql(
1201
+ /* GraphQL */
1202
+ `
1203
+ mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
1204
+ accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
1205
+ userId
1206
+ expire
1207
+ current
1208
+ }
1209
+ }
1210
+ `
1211
+ );
1212
+ function useUpdateMagicURLSession() {
1213
+ const { graphql: graphql2 } = useAppwrite();
1214
+ const queryResult = useMutation({
1215
+ mutationFn: async ({ userId, secret }) => {
1216
+ const { data, errors } = await graphql2.mutation({
1217
+ query: updateMagicURLSession,
1218
+ variables: {
1219
+ userId,
1220
+ secret
1221
+ }
1222
+ });
1223
+ if (errors) {
1224
+ throw errors;
1225
+ }
1226
+ return data.accountUpdateMagicURLSession;
1227
+ }
1228
+ });
1229
+ return { ...queryResult };
1230
+ }
1231
+
1232
+ // src/account/useUpdateMfa.ts
1233
+ var accountUpdateMFA = gql(
1234
+ /* GraphQL */
1235
+ `
1236
+ mutation UpdateMFA($mfa: Boolean!) {
1237
+ accountUpdateMFA(mfa: $mfa) {
1238
+ mfa
1239
+ }
1240
+ }
1241
+ `
1242
+ );
1243
+ function useUpdateMfa() {
1244
+ const { graphql: graphql2 } = useAppwrite();
1245
+ const queryResult = useMutation({
1246
+ mutationFn: async ({ mfa }) => {
1247
+ const { data, errors } = await graphql2.mutation({
1248
+ query: accountUpdateMFA,
1249
+ variables: {
1250
+ mfa
1251
+ }
1252
+ });
1253
+ if (errors) {
1254
+ throw errors;
1255
+ }
1256
+ return data.accountUpdateMFA;
1257
+ }
1258
+ });
1259
+ return { ...queryResult };
1260
+ }
1261
+
1262
+ // src/account/useUpdateMfaAuthenticator.ts
1263
+ var updateMFAAuthenticator2 = gql(
1264
+ /* GraphQL */
1265
+ `
1266
+ mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
1267
+ accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
1268
+ mfa
1269
+ }
1270
+ }
1271
+ `
1272
+ );
1273
+ function useUpdateMfaAuthenticator() {
1274
+ const { graphql: graphql2 } = useAppwrite();
1275
+ const queryResult = useMutation({
1276
+ mutationFn: async ({ type = "totp", otp }) => {
1277
+ const { data, errors } = await graphql2.mutation({
1278
+ query: updateMFAAuthenticator2,
1279
+ variables: {
1280
+ type,
1281
+ otp
1282
+ }
1283
+ });
1284
+ if (errors) {
1285
+ throw errors;
1286
+ }
1287
+ return data.accountUpdateMfaAuthenticator;
1288
+ }
1289
+ });
1290
+ return { ...queryResult };
1291
+ }
1292
+
1293
+ // src/account/useUpdateMfaChallenge.ts
1294
+ var accountUpdateMfaChallenge = gql(
1295
+ /* GraphQL */
1296
+ `
1297
+ mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
1298
+ accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
1299
+ status
1300
+ }
1301
+ }
1302
+ `
1303
+ );
1304
+ function useUpdateMfaChallenge() {
1305
+ const { graphql: graphql2 } = useAppwrite();
1306
+ const queryResult = useMutation({
1307
+ mutationFn: async ({ challengeId, otp }) => {
1308
+ const { data, errors } = await graphql2.mutation({
1309
+ query: accountUpdateMfaChallenge,
1310
+ variables: {
1311
+ challengeId,
1312
+ otp
1313
+ }
1314
+ });
1315
+ if (errors) {
1316
+ throw errors;
1317
+ }
1318
+ return data.accountUpdateMfaChallenge;
1319
+ }
1320
+ });
1321
+ return { ...queryResult };
1322
+ }
1323
+
1324
+ // src/account/useUpdateMfaRecoveryCodes.ts
1325
+ var accountUpdateMfaRecoveryCodes = gql(
1326
+ /* GraphQL */
1327
+ `
1328
+ mutation UpdateMfaRecoveryCodes {
1329
+ accountUpdateMfaRecoveryCodes {
1330
+ recoveryCodes
1331
+ }
1332
+ }
1333
+ `
1334
+ );
1335
+ function useUpdateMfaRecoveryCodes() {
1336
+ const { graphql: graphql2 } = useAppwrite();
1337
+ const queryResult = useMutation({
1338
+ mutationFn: async () => {
1339
+ const { data, errors } = await graphql2.mutation({
1340
+ query: accountUpdateMfaRecoveryCodes
1341
+ });
1342
+ if (errors) {
1343
+ throw errors;
1344
+ }
1345
+ return data.accountUpdateMfaRecoveryCodes;
1346
+ }
1347
+ });
1348
+ return { ...queryResult };
1349
+ }
1350
+
1351
+ // src/account/useUpdateName.ts
1352
+ var accountUpdateName = gql(
1353
+ /* GraphQL */
1354
+ `
1355
+ mutation UpdateName($name: String!) {
1356
+ accountUpdateName(name: $name) {
1357
+ name
1358
+ }
1359
+ }
1360
+ `
1361
+ );
1362
+ function useUpdateName() {
1363
+ const { graphql: graphql2 } = useAppwrite();
1364
+ const queryResult = useMutation({
1365
+ mutationFn: async ({ name }) => {
1366
+ const { data: mutationData, errors } = await graphql2.mutation({
1367
+ query: accountUpdateName,
1368
+ variables: {
1369
+ name
1370
+ }
1371
+ });
1372
+ if (errors) {
1373
+ throw errors;
1374
+ }
1375
+ return mutationData.accountUpdateName;
1376
+ }
1377
+ });
1378
+ return { ...queryResult };
282
1379
  }
283
1380
 
284
- // src/account/useLogout.ts
285
- var deleteSession = gql(
1381
+ // src/account/useUpdatePassword.ts
1382
+ var updatePassword = gql(
286
1383
  /* GraphQL */
287
1384
  `
288
- mutation DeleteSession($sessionId: String!) {
289
- accountDeleteSession(sessionId: $sessionId) {
1385
+ mutation UpdatePassword($password: String!, $oldPassword: String!) {
1386
+ accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
290
1387
  status
291
1388
  }
292
1389
  }
293
1390
  `
294
1391
  );
295
- function useLogout() {
1392
+ function useUpdatePassword() {
296
1393
  const { graphql: graphql2 } = useAppwrite();
297
- const queryClient2 = useQueryClient();
298
- const logout = useMutation({
299
- mutationFn: () => {
300
- return graphql2.mutation({
301
- query: deleteSession,
1394
+ const queryResult = useMutation({
1395
+ mutationFn: async ({ password, oldPassword }) => {
1396
+ const { data, errors } = await graphql2.mutation({
1397
+ query: updatePassword,
302
1398
  variables: {
303
- sessionId: "current"
1399
+ password,
1400
+ oldPassword
304
1401
  }
305
1402
  });
306
- },
307
- onSuccess: async () => {
308
- queryClient2.setQueryData(["appwrite", "account"], null);
309
- queryClient2.removeQueries({ queryKey: ["appwrite", "account"] });
1403
+ if (errors) {
1404
+ throw errors;
1405
+ }
1406
+ return data.accountUpdatePassword;
310
1407
  }
311
1408
  });
312
- return logout;
1409
+ return { ...queryResult };
313
1410
  }
314
1411
 
315
- // src/account/usePasswordRecovery.ts
316
- var createRecovery = gql(
1412
+ // src/account/useUpdatePhone.ts
1413
+ var accountUpdatePhone = gql(
317
1414
  /* GraphQL */
318
1415
  `
319
- mutation CreateRecovery($email: String!, $url: String!) {
320
- accountCreateRecovery(email: $email, url: $url) {
321
- expire
1416
+ mutation UpdatePhone($phone: String!, $password: String!) {
1417
+ accountUpdatePhone(phone: $phone, password: $password) {
1418
+ phone
322
1419
  }
323
1420
  }
324
1421
  `
325
1422
  );
326
- function usePasswordRecovery() {
1423
+ function useUpdatePhone() {
327
1424
  const { graphql: graphql2 } = useAppwrite();
328
- const passwordRecovery = useMutation({
329
- mutationFn: async ({ email, resetUrl }) => {
1425
+ const queryResult = useMutation({
1426
+ mutationFn: async ({ phone, password }) => {
330
1427
  const { data, errors } = await graphql2.mutation({
331
- query: createRecovery,
1428
+ query: accountUpdatePhone,
332
1429
  variables: {
333
- email,
334
- url: resetUrl
1430
+ phone,
1431
+ password
335
1432
  }
336
1433
  });
337
1434
  if (errors) {
338
1435
  throw errors;
339
1436
  }
340
- return data.accountCreateRecovery ?? {};
341
- },
342
- onSuccess: async (_, variables) => {
343
- localStorage.setItem("email", variables.email);
1437
+ return data.accountUpdatePhone;
344
1438
  }
345
1439
  });
346
- return passwordRecovery;
1440
+ return { ...queryResult };
347
1441
  }
348
1442
 
349
- // src/account/useResetPassword.ts
350
- var updateRecovery = gql(
1443
+ // src/account/useUpdatePhoneSession.ts
1444
+ var updatePhoneSession = gql(
351
1445
  /* GraphQL */
352
1446
  `
353
- mutation UpdateRecovery(
354
- $userId: String!
355
- $secret: String!
356
- $password: String!
357
- $passwordAgain: String!
358
- ) {
359
- accountUpdateRecovery(
360
- userId: $userId
361
- secret: $secret
362
- password: $password
363
- passwordAgain: $passwordAgain
364
- ) {
1447
+ mutation UpdatePhoneSession($userId: String!, $secret: String!) {
1448
+ accountUpdatePhoneSession(userId: $userId, secret: $secret) {
1449
+ userId
365
1450
  expire
1451
+ current
366
1452
  }
367
1453
  }
368
1454
  `
369
1455
  );
370
- function useResetPassword() {
1456
+ function useUpdatePhoneSession() {
371
1457
  const { graphql: graphql2 } = useAppwrite();
372
- const passwordReset = useMutation({
373
- mutationFn: async ({ userId, secret, password, confirmPassword }) => {
1458
+ const queryResult = useMutation({
1459
+ mutationFn: async ({ userId, secret }) => {
374
1460
  const { data, errors } = await graphql2.mutation({
375
- query: updateRecovery,
1461
+ query: updatePhoneSession,
376
1462
  variables: {
377
1463
  userId,
378
- secret,
379
- password,
380
- passwordAgain: confirmPassword
1464
+ secret
381
1465
  }
382
1466
  });
383
1467
  if (errors) {
384
1468
  throw errors;
385
1469
  }
386
- return data.accountUpdateRecovery ?? {};
1470
+ return data.accountUpdatePhoneSession;
387
1471
  }
388
1472
  });
389
- return passwordReset;
1473
+ return { ...queryResult };
390
1474
  }
391
1475
 
392
- // src/account/useSignUp.ts
393
- import { ID } from "appwrite";
394
- var createAccount = gql(
1476
+ // src/account/useUpdatePhoneVerification.ts
1477
+ var updatePhoneVerification = gql(
395
1478
  /* GraphQL */
396
1479
  `
397
- mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
398
- accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
399
- name
400
- email
1480
+ mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
1481
+ accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
1482
+ expire
401
1483
  }
402
1484
  }
403
1485
  `
404
1486
  );
405
- var verify = gql(
1487
+ function useUpdatePhoneVerification() {
1488
+ const { graphql: graphql2 } = useAppwrite();
1489
+ const queryResult = useMutation({
1490
+ mutationFn: async ({ userId, secret }) => {
1491
+ const { data, errors } = await graphql2.mutation({
1492
+ query: updatePhoneVerification,
1493
+ variables: {
1494
+ userId,
1495
+ secret
1496
+ }
1497
+ });
1498
+ if (errors) {
1499
+ throw errors;
1500
+ }
1501
+ return data.accountUpdatePhoneVerification;
1502
+ }
1503
+ });
1504
+ return { ...queryResult };
1505
+ }
1506
+
1507
+ // src/account/useUpdatePrefs.ts
1508
+ var accountUpdatePrefs = gql(
406
1509
  /* GraphQL */
407
1510
  `
408
- mutation VerifyEmail($url: String!) {
409
- accountCreateVerification(url: $url) {
410
- expire
1511
+ mutation UpdatePrefs($prefs: JSON!) {
1512
+ accountUpdatePrefs(prefs: $prefs) {
1513
+ prefs {
1514
+ data
1515
+ }
411
1516
  }
412
1517
  }
413
1518
  `
414
1519
  );
415
- function useSignUp() {
1520
+ function useUpdatePrefs() {
416
1521
  const { graphql: graphql2 } = useAppwrite();
417
- const signUp = useMutation({
418
- mutationFn: async ({ userId, email, password, name }) => {
1522
+ const queryResult = useMutation({
1523
+ mutationFn: async ({ prefs }) => {
419
1524
  const { data, errors } = await graphql2.mutation({
420
- query: createAccount,
1525
+ query: accountUpdatePrefs,
421
1526
  variables: {
422
- userId: userId ?? ID.unique(),
423
- name,
424
- email,
425
- password
1527
+ prefs
426
1528
  }
427
1529
  });
428
1530
  if (errors) {
429
1531
  throw errors;
430
1532
  }
431
- return data.accountCreate ?? {};
1533
+ return data.accountUpdatePrefs;
432
1534
  }
433
1535
  });
434
- const verifyEmail = useMutation({
435
- mutationFn: async ({ verifyUrl }) => {
1536
+ return { ...queryResult };
1537
+ }
1538
+
1539
+ // src/account/useUpdateSession.ts
1540
+ var updateSession = gql(
1541
+ /* GraphQL */
1542
+ `
1543
+ mutation UpdateSession($sessionId: String!) {
1544
+ accountUpdateSession(sessionId: $sessionId) {
1545
+ userId
1546
+ expire
1547
+ current
1548
+ }
1549
+ }
1550
+ `
1551
+ );
1552
+ function useUpdateSession() {
1553
+ const { graphql: graphql2 } = useAppwrite();
1554
+ const queryResult = useMutation({
1555
+ mutationFn: async ({ sessionId }) => {
436
1556
  const { data, errors } = await graphql2.mutation({
437
- query: verify,
1557
+ query: updateSession,
438
1558
  variables: {
439
- url: verifyUrl
1559
+ sessionId
440
1560
  }
441
1561
  });
442
1562
  if (errors) {
443
1563
  throw errors;
444
1564
  }
445
- return data.accountCreateVerification ?? {};
1565
+ return data.accountUpdateSession;
446
1566
  }
447
1567
  });
448
- return { signUp, verifyEmail };
1568
+ return { ...queryResult };
449
1569
  }
450
1570
 
451
1571
  // src/account/useVerification.ts
@@ -462,7 +1582,7 @@ var updateVerification = gql(
462
1582
  function useVerification() {
463
1583
  const { graphql: graphql2 } = useAppwrite();
464
1584
  const queryClient2 = useQueryClient();
465
- const verify2 = useMutation({
1585
+ const queryResult = useMutation({
466
1586
  mutationFn: async ({ userId, secret }) => {
467
1587
  if (!userId || !secret) {
468
1588
  throw new Error("Missing userId or secret");
@@ -483,7 +1603,7 @@ function useVerification() {
483
1603
  queryClient2.setQueryData(["appwrite", "account"], null);
484
1604
  }
485
1605
  });
486
- return verify2;
1606
+ return { ...queryResult };
487
1607
  }
488
1608
 
489
1609
  // src/databases/useCollection.ts
@@ -509,8 +1629,7 @@ var listDocuments = gql(
509
1629
  function useCollection({
510
1630
  databaseId,
511
1631
  collectionId,
512
- queries,
513
- options
1632
+ queries
514
1633
  }) {
515
1634
  const { graphql: graphql2 } = useAppwrite();
516
1635
  const queryClient2 = useQueryClient();
@@ -536,8 +1655,68 @@ function useCollection({
536
1655
  total: data.databasesListDocuments?.total ?? 0,
537
1656
  documents: documents2
538
1657
  };
539
- },
540
- ...options
1658
+ }
1659
+ });
1660
+ useEffect2(() => {
1661
+ const unsubscribe = graphql2.client.subscribe(
1662
+ `databases.${databaseId}.collections.${collectionId}.documents`,
1663
+ (response) => {
1664
+ const [, operation] = response.events[0].match(/\.(\w+)$/);
1665
+ const document = response.payload;
1666
+ switch (operation) {
1667
+ case "create":
1668
+ case "update":
1669
+ case "delete":
1670
+ queryClient2.setQueryData(
1671
+ ["appwrite", "databases", databaseId, collectionId, "documents", document.$id],
1672
+ document
1673
+ );
1674
+ queryClient2.invalidateQueries({
1675
+ queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1676
+ exact: true
1677
+ });
1678
+ break;
1679
+ }
1680
+ }
1681
+ );
1682
+ return unsubscribe;
1683
+ }, [databaseId, collectionId, graphql2.client, queryClient2, queries]);
1684
+ return {
1685
+ ...collection,
1686
+ documents: collection.data?.documents,
1687
+ total: collection.data?.total
1688
+ };
1689
+ }
1690
+ function useSuspenseCollection({
1691
+ databaseId,
1692
+ collectionId,
1693
+ queries
1694
+ }) {
1695
+ const { graphql: graphql2 } = useAppwrite();
1696
+ const queryClient2 = useQueryClient();
1697
+ const collection = useSuspenseQuery({
1698
+ queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1699
+ queryFn: async () => {
1700
+ const { data, errors } = await graphql2.query({
1701
+ query: listDocuments,
1702
+ variables: {
1703
+ databaseId,
1704
+ collectionId,
1705
+ queries
1706
+ }
1707
+ });
1708
+ if (errors) {
1709
+ throw errors;
1710
+ }
1711
+ const documents2 = data.databasesListDocuments?.documents?.map((document) => ({
1712
+ ...document,
1713
+ ...document ? JSON.parse(document.data) : {}
1714
+ })) ?? [];
1715
+ return {
1716
+ total: data.databasesListDocuments?.total ?? 0,
1717
+ documents: documents2
1718
+ };
1719
+ }
541
1720
  });
542
1721
  useEffect2(() => {
543
1722
  const unsubscribe = graphql2.client.subscribe(
@@ -593,11 +1772,10 @@ var createDocument = gql(
593
1772
  }
594
1773
  `
595
1774
  );
596
- function useCreateDocument(databaseId, collectionId, documentId, data, permissions, options) {
1775
+ function useCreateDocument() {
597
1776
  const { graphql: graphql2 } = useAppwrite();
598
1777
  const mutationResult = useMutation({
599
- mutationKey: ["appwrite", "databases", databaseId, collectionId, "documents", documentId],
600
- mutationFn: async () => {
1778
+ mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
601
1779
  const { data: mutationData, errors } = await graphql2.mutation({
602
1780
  query: createDocument,
603
1781
  variables: {
@@ -611,13 +1789,72 @@ function useCreateDocument(databaseId, collectionId, documentId, data, permissio
611
1789
  if (errors) {
612
1790
  throw errors;
613
1791
  }
614
- return mutationData.databasesCreateDocument?._id;
615
- },
616
- ...options
1792
+ return mutationData.databasesCreateDocument;
1793
+ }
617
1794
  });
618
1795
  return mutationResult;
619
1796
  }
620
1797
 
1798
+ // src/databases/useDeleteDocument.ts
1799
+ var deleteDocument = gql(
1800
+ /* GraphQL */
1801
+ `
1802
+ mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
1803
+ databasesDeleteDocument(
1804
+ databaseId: $databaseId
1805
+ collectionId: $collectionId
1806
+ documentId: $documentId
1807
+ ) {
1808
+ status
1809
+ }
1810
+ }
1811
+ `
1812
+ );
1813
+ function useDeleteDocument() {
1814
+ const { graphql: graphql2 } = useAppwrite();
1815
+ const queryClient2 = useQueryClient();
1816
+ const mutationResult = useMutation({
1817
+ mutationFn: async ({ databaseId, collectionId, documentId }) => {
1818
+ const { data: mutationData, errors } = await graphql2.mutation({
1819
+ query: deleteDocument,
1820
+ variables: {
1821
+ databaseId,
1822
+ collectionId,
1823
+ documentId
1824
+ }
1825
+ });
1826
+ if (errors) {
1827
+ throw errors;
1828
+ }
1829
+ return mutationData.databasesDeleteDocument;
1830
+ },
1831
+ onSuccess: async (_, variables) => {
1832
+ queryClient2.setQueryData(
1833
+ [
1834
+ "appwrite",
1835
+ "databases",
1836
+ variables.databaseId,
1837
+ variables.collectionId,
1838
+ "documents",
1839
+ variables.documentId
1840
+ ],
1841
+ null
1842
+ );
1843
+ queryClient2.removeQueries({
1844
+ queryKey: [
1845
+ "appwrite",
1846
+ "databases",
1847
+ variables.databaseId,
1848
+ variables.collectionId,
1849
+ "documents",
1850
+ variables.documentId
1851
+ ]
1852
+ });
1853
+ }
1854
+ });
1855
+ return { ...mutationResult };
1856
+ }
1857
+
621
1858
  // src/databases/useDocument.ts
622
1859
  import { useEffect as useEffect3 } from "react";
623
1860
  var getDocument = gql(
@@ -635,7 +1872,11 @@ var getDocument = gql(
635
1872
  }
636
1873
  `
637
1874
  );
638
- function useDocument(databaseId, collectionId, documentId, options) {
1875
+ function useDocument({
1876
+ databaseId,
1877
+ collectionId,
1878
+ documentId
1879
+ }) {
639
1880
  const { graphql: graphql2 } = useAppwrite();
640
1881
  const queryClient2 = useQueryClient();
641
1882
  const queryResult = useQuery({
@@ -657,8 +1898,7 @@ function useDocument(databaseId, collectionId, documentId, options) {
657
1898
  ...data.databasesGetDocument ? JSON.parse(data.databasesGetDocument.data) : {}
658
1899
  };
659
1900
  return document;
660
- },
661
- ...options
1901
+ }
662
1902
  });
663
1903
  useEffect3(() => {
664
1904
  const unsubscribe = graphql2.client.subscribe(
@@ -672,7 +1912,63 @@ function useDocument(databaseId, collectionId, documentId, options) {
672
1912
  );
673
1913
  return unsubscribe;
674
1914
  }, [databaseId, collectionId, documentId, graphql2.client, queryClient2]);
675
- return queryResult;
1915
+ return { ...queryResult };
1916
+ }
1917
+
1918
+ // src/databases/useUpdateDocument.ts
1919
+ var updateDocument = gql(
1920
+ /* GraphQL */
1921
+ `
1922
+ mutation UpdateDocument(
1923
+ $databaseId: String!
1924
+ $collectionId: String!
1925
+ $documentId: String!
1926
+ $data: JSON!
1927
+ $permissions: [String!]
1928
+ ) {
1929
+ databasesUpdateDocument(
1930
+ databaseId: $databaseId
1931
+ collectionId: $collectionId
1932
+ documentId: $documentId
1933
+ data: $data
1934
+ permissions: $permissions
1935
+ ) {
1936
+ _id
1937
+ _collectionId
1938
+ _databaseId
1939
+ _createdAt
1940
+ _updatedAt
1941
+ _permissions
1942
+ data
1943
+ }
1944
+ }
1945
+ `
1946
+ );
1947
+ function useUpdateDocument() {
1948
+ const { graphql: graphql2 } = useAppwrite();
1949
+ const mutationResult = useMutation({
1950
+ mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
1951
+ const { data: mutationData, errors } = await graphql2.mutation({
1952
+ query: updateDocument,
1953
+ variables: {
1954
+ databaseId,
1955
+ collectionId,
1956
+ documentId,
1957
+ data,
1958
+ permissions
1959
+ }
1960
+ });
1961
+ if (errors) {
1962
+ throw errors;
1963
+ }
1964
+ const document = {
1965
+ ...mutationData.databasesUpdateDocument,
1966
+ ...mutationData.databasesUpdateDocument ? JSON.parse(mutationData.databasesUpdateDocument.data) : {}
1967
+ };
1968
+ return document;
1969
+ }
1970
+ });
1971
+ return { ...mutationResult };
676
1972
  }
677
1973
 
678
1974
  // src/functions/useFunction.ts
@@ -799,10 +2095,20 @@ var Account_UserFragment = gql(
799
2095
  }
800
2096
  `
801
2097
  );
2098
+ var Identity_ProviderFragment = gql(
2099
+ /* GraphQL */
2100
+ `
2101
+ fragment Identity_ProviderFragment on Identity {
2102
+ userId
2103
+ provider
2104
+ }
2105
+ `
2106
+ );
802
2107
 
803
2108
  // src/index.ts
804
2109
  var fragments = {
805
- Account_UserFragment
2110
+ Account_UserFragment,
2111
+ Identity_ProviderFragment
806
2112
  };
807
2113
  export {
808
2114
  fragments,
@@ -810,17 +2116,55 @@ export {
810
2116
  useAccount,
811
2117
  useAppwrite,
812
2118
  useCollection,
2119
+ useCreateAnonymousSession,
813
2120
  useCreateDocument,
2121
+ useCreateEmailToken,
2122
+ useCreateJWT,
2123
+ useCreateMagicURLToken,
2124
+ useCreateMfaAuthenticator,
2125
+ useCreateMfaChallenge,
2126
+ useCreateMfaRecoveryCodes,
2127
+ useCreatePhoneToken,
2128
+ useCreatePhoneVerification,
2129
+ useCreateSession,
2130
+ useDeleteDocument,
2131
+ useDeleteIdentity,
2132
+ useDeleteMfaAuthenticator,
2133
+ useDeleteSession,
2134
+ useDeleteSessions,
814
2135
  useDocument,
815
2136
  useFunction,
2137
+ useGetMfaRecoveryCodes,
2138
+ useGetPrefs,
2139
+ useGetSession,
2140
+ useListIdentities,
2141
+ useListMfaFactors,
2142
+ useListSessions,
816
2143
  useLogin,
817
2144
  useLogout,
2145
+ useLogs,
818
2146
  useMutation,
819
2147
  usePasswordRecovery,
820
2148
  useQuery,
821
2149
  useQueryClient,
822
2150
  useResetPassword,
823
2151
  useSignUp,
2152
+ useSuspenseCollection,
2153
+ useSuspenseCreateJWT,
2154
+ useUpdateDocument,
2155
+ useUpdateEmail,
2156
+ useUpdateMagicURLSession,
2157
+ useUpdateMfa,
2158
+ useUpdateMfaAuthenticator,
2159
+ useUpdateMfaChallenge,
2160
+ useUpdateMfaRecoveryCodes,
2161
+ useUpdateName,
2162
+ useUpdatePassword,
2163
+ useUpdatePhone,
2164
+ useUpdatePhoneSession,
2165
+ useUpdatePhoneVerification,
2166
+ useUpdatePrefs,
2167
+ useUpdateSession,
824
2168
  useVerification
825
2169
  };
826
2170
  //# sourceMappingURL=index.mjs.map