@zeroin.earth/appwrite-graphql 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs 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({
@@ -155,297 +223,1316 @@ function useAccount({
155
223
  if (errors) {
156
224
  throw errors;
157
225
  }
158
- return data.accountGet;
159
- },
160
- retry: false,
161
- ...options
226
+ return data.accountGet;
227
+ },
228
+ retry: false
229
+ });
230
+ useEffect(() => {
231
+ const unsubscribe = graphql2.client.subscribe(
232
+ "account",
233
+ (response) => {
234
+ const isUpdatingPreferences = response.events.some((event) => event.endsWith("prefs"));
235
+ if (isUpdatingPreferences) {
236
+ queryClient2.setQueryData(
237
+ ["appwrite", "account"],
238
+ (account2) => produce(account2, (draft) => {
239
+ if (draft) {
240
+ draft.prefs = castDraft(response.payload.prefs);
241
+ }
242
+ })
243
+ );
244
+ return;
245
+ }
246
+ queryClient2.setQueryData(
247
+ ["appwrite", "account"],
248
+ response.payload
249
+ );
250
+ }
251
+ );
252
+ return unsubscribe;
253
+ }, [graphql2.client, queryClient2]);
254
+ return queryResult;
255
+ }
256
+
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(
264
+ /* GraphQL */
265
+ `
266
+ mutation CreateAnonymousSession {
267
+ accountCreateAnonymousSession {
268
+ _id
269
+ expire
270
+ current
271
+ }
272
+ }
273
+ `
274
+ );
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;
286
+ }
287
+ });
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;
318
+ }
319
+ });
320
+ return { ...queryResult };
321
+ }
322
+
323
+ // src/account/useCreateJWT.ts
324
+ var accountCreateJWT = gql(
325
+ /* GraphQL */
326
+ `
327
+ mutation CreateJWT {
328
+ accountCreateJWT {
329
+ jwt
330
+ }
331
+ }
332
+ `
333
+ );
334
+ function useCreateJWT() {
335
+ const { graphql: graphql2 } = useAppwrite();
336
+ const queryResult = useMutation({
337
+ mutationFn: async () => {
338
+ const { data, errors } = await graphql2.mutation({
339
+ query: accountCreateJWT
340
+ });
341
+ if (errors) {
342
+ throw errors;
343
+ }
344
+ return data.accountCreateJWT;
345
+ }
346
+ });
347
+ return { ...queryResult };
348
+ }
349
+
350
+ // src/account/useCreateMagicURLToken.ts
351
+ var createMagicURLToken = gql(
352
+ /* GraphQL */
353
+ `
354
+ mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
355
+ accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
356
+ expire
357
+ }
358
+ }
359
+ `
360
+ );
361
+ function useCreateMagicURLToken() {
362
+ const { graphql: graphql2 } = useAppwrite();
363
+ const queryResult = useMutation({
364
+ mutationFn: async ({ userId, email, url, phrase }) => {
365
+ const { data, errors } = await graphql2.mutation({
366
+ query: createMagicURLToken,
367
+ variables: {
368
+ userId,
369
+ email,
370
+ url,
371
+ phrase
372
+ }
373
+ });
374
+ if (errors) {
375
+ throw errors;
376
+ }
377
+ return data.accountCreateMagicURLToken;
378
+ }
379
+ });
380
+ return { ...queryResult };
381
+ }
382
+
383
+ // src/account/useCreateMfaAuthenticator.ts
384
+ var accountCreateMfaAuthenticator = gql(
385
+ /* GraphQL */
386
+ `
387
+ mutation CreateMfaAuthenticator($type: String!) {
388
+ accountCreateMfaAuthenticator(type: $type) {
389
+ secret
390
+ uri
391
+ }
392
+ }
393
+ `
394
+ );
395
+ function useCreateMfaAuthenticator() {
396
+ const { graphql: graphql2 } = useAppwrite();
397
+ const queryResult = useMutation({
398
+ mutationFn: async ({ type = "totp" }) => {
399
+ const { data, errors } = await graphql2.mutation({
400
+ query: accountCreateMfaAuthenticator,
401
+ variables: {
402
+ type
403
+ }
404
+ });
405
+ if (errors) {
406
+ throw errors;
407
+ }
408
+ return data.accountCreateMfaAuthenticator;
409
+ }
410
+ });
411
+ return { ...queryResult };
412
+ }
413
+
414
+ // src/account/useCreateMfaChallenge.ts
415
+ var accountCreateMfaChallenge = gql(
416
+ /* GraphQL */
417
+ `
418
+ mutation CreateMfaChallenge($factor: String!) {
419
+ accountCreateMfaChallenge(factor: $factor) {
420
+ userId
421
+ expire
422
+ }
423
+ }
424
+ `
425
+ );
426
+ function useCreateMfaChallenge() {
427
+ const { graphql: graphql2 } = useAppwrite();
428
+ const queryResult = useMutation({
429
+ mutationFn: async ({ factor }) => {
430
+ const { data, errors } = await graphql2.mutation({
431
+ query: accountCreateMfaChallenge,
432
+ variables: {
433
+ factor
434
+ }
435
+ });
436
+ if (errors) {
437
+ throw errors;
438
+ }
439
+ return data.accountCreateMfaChallenge;
440
+ }
441
+ });
442
+ return { ...queryResult };
443
+ }
444
+
445
+ // src/account/useCreateMfaRecoveryCodes.ts
446
+ var accountCreateMfaRecoveryCodes = gql(
447
+ /* GraphQL */
448
+ `
449
+ mutation CreateMfaRecoveryCodes {
450
+ accountCreateMfaRecoveryCodes {
451
+ recoveryCodes
452
+ }
453
+ }
454
+ `
455
+ );
456
+ function useCreateMfaRecoveryCodes() {
457
+ const { graphql: graphql2 } = useAppwrite();
458
+ const queryResult = useMutation({
459
+ mutationFn: async () => {
460
+ const { data, errors } = await graphql2.mutation({
461
+ query: accountCreateMfaRecoveryCodes
462
+ });
463
+ if (errors) {
464
+ throw errors;
465
+ }
466
+ return data.accountCreateMfaRecoveryCodes;
467
+ }
468
+ });
469
+ return { ...queryResult };
470
+ }
471
+
472
+ // src/account/useCreatePhoneToken.ts
473
+ var createPhoneToken = gql(
474
+ /* GraphQL */
475
+ `
476
+ mutation CreatePhoneToken($userId: String!, $phone: String!) {
477
+ accountCreatePhoneToken(userId: $userId, phone: $phone) {
478
+ expire
479
+ }
480
+ }
481
+ `
482
+ );
483
+ function useCreatePhoneToken() {
484
+ const { graphql: graphql2 } = useAppwrite();
485
+ const queryResult = useMutation({
486
+ mutationFn: async ({ userId, phone }) => {
487
+ const { data, errors } = await graphql2.mutation({
488
+ query: createPhoneToken,
489
+ variables: {
490
+ userId,
491
+ phone
492
+ }
493
+ });
494
+ if (errors) {
495
+ throw errors;
496
+ }
497
+ return data.accountCreatePhoneToken;
498
+ }
499
+ });
500
+ return { ...queryResult };
501
+ }
502
+
503
+ // src/account/useCreatePhoneVerification.ts
504
+ var createPhoneVerification = gql(
505
+ /* GraphQL */
506
+ `
507
+ mutation CreatePhoneVerification {
508
+ accountCreatePhoneVerification {
509
+ expire
510
+ }
511
+ }
512
+ `
513
+ );
514
+ function useCreatePhoneVerification() {
515
+ const { graphql: graphql2 } = useAppwrite();
516
+ const queryResult = useMutation({
517
+ mutationFn: async () => {
518
+ const { data, errors } = await graphql2.mutation({
519
+ query: createPhoneVerification
520
+ });
521
+ if (errors) {
522
+ throw errors;
523
+ }
524
+ return data.accountCreatePhoneVerification;
525
+ }
526
+ });
527
+ return { ...queryResult };
528
+ }
529
+
530
+ // src/account/useCreateSession.ts
531
+ var createSession = gql(
532
+ /* GraphQL */
533
+ `
534
+ mutation CreateSession($userId: String!, $secret: String!) {
535
+ accountCreateSession(userId: $userId, secret: $secret) {
536
+ userId
537
+ expire
538
+ current
539
+ }
540
+ }
541
+ `
542
+ );
543
+ function useCreateSession() {
544
+ const { graphql: graphql2 } = useAppwrite();
545
+ const queryResult = useMutation({
546
+ mutationFn: async ({ userId, secret }) => {
547
+ const { data, errors } = await graphql2.mutation({
548
+ query: createSession,
549
+ variables: {
550
+ userId,
551
+ secret
552
+ }
553
+ });
554
+ if (errors) {
555
+ throw errors;
556
+ }
557
+ return data.accountCreateSession;
558
+ }
559
+ });
560
+ return { ...queryResult };
561
+ }
562
+
563
+ // src/account/useDeleteIdentity.ts
564
+ var accountDeleteIdentity = gql(
565
+ /* GraphQL */
566
+ `
567
+ mutation DeleteIdentity($identityId: String!) {
568
+ accountDeleteIdentity(identityId: $identityId) {
569
+ status
570
+ }
571
+ }
572
+ `
573
+ );
574
+ function useDeleteIdentity() {
575
+ const { graphql: graphql2 } = useAppwrite();
576
+ const queryResult = useMutation({
577
+ mutationFn: async ({ identityId }) => {
578
+ const { data, errors } = await graphql2.mutation({
579
+ query: accountDeleteIdentity,
580
+ variables: {
581
+ identityId
582
+ }
583
+ });
584
+ if (errors) {
585
+ throw errors;
586
+ }
587
+ return data.accountDeleteIdentity ?? { status: false };
588
+ }
589
+ });
590
+ return { ...queryResult };
591
+ }
592
+
593
+ // src/account/useDeleteMfaAuthenticator.ts
594
+ var updateMFAAuthenticator = gql(
595
+ /* GraphQL */
596
+ `
597
+ mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {
598
+ accountDeleteMfaAuthenticator(type: $type, otp: $otp) {
599
+ mfa
600
+ }
601
+ }
602
+ `
603
+ );
604
+ function useDeleteMfaAuthenticator() {
605
+ const { graphql: graphql2 } = useAppwrite();
606
+ const queryResult = useMutation({
607
+ mutationFn: async ({ type = "totp", otp }) => {
608
+ const { data, errors } = await graphql2.mutation({
609
+ query: updateMFAAuthenticator,
610
+ variables: {
611
+ type,
612
+ otp
613
+ }
614
+ });
615
+ if (errors) {
616
+ throw errors;
617
+ }
618
+ return data.accountDeleteMfaAuthenticator;
619
+ }
620
+ });
621
+ return { ...queryResult };
622
+ }
623
+
624
+ // src/account/useDeleteSession.ts
625
+ var deleteSession = gql(
626
+ /* GraphQL */
627
+ `
628
+ mutation DeleteSession($sessionId: String!) {
629
+ accountDeleteSession(sessionId: $sessionId) {
630
+ status
631
+ }
632
+ }
633
+ `
634
+ );
635
+ function useDeleteSession() {
636
+ const { graphql: graphql2 } = useAppwrite();
637
+ const queryResult = useMutation({
638
+ mutationFn: async ({ sessionId }) => {
639
+ const { data, errors } = await graphql2.mutation({
640
+ query: deleteSession,
641
+ variables: {
642
+ sessionId
643
+ }
644
+ });
645
+ if (errors) {
646
+ throw errors;
647
+ }
648
+ return data.accountDeleteSession;
649
+ }
650
+ });
651
+ return { ...queryResult };
652
+ }
653
+
654
+ // src/account/useDeleteSessions.ts
655
+ var deleteSession2 = gql(
656
+ /* GraphQL */
657
+ `
658
+ mutation DeleteSession($sessionId: String!) {
659
+ accountDeleteSession(sessionId: $sessionId) {
660
+ status
661
+ }
662
+ }
663
+ `
664
+ );
665
+ function useDeleteSessions() {
666
+ const { graphql: graphql2 } = useAppwrite();
667
+ const queryResult = useMutation({
668
+ mutationFn: async ({ sessionId }) => {
669
+ const { data, errors } = await graphql2.mutation({
670
+ query: deleteSession2,
671
+ variables: {
672
+ sessionId
673
+ }
674
+ });
675
+ if (errors) {
676
+ throw errors;
677
+ }
678
+ return data.accountDeleteSession;
679
+ }
680
+ });
681
+ return { ...queryResult };
682
+ }
683
+
684
+ // src/account/useGetMfaRecoveryCodes.ts
685
+ var getMFARecoveryCodes = gql(
686
+ /* GraphQL */
687
+ `
688
+ query GetMfaRecoveryCodes {
689
+ accountGetMfaRecoveryCodes {
690
+ recoveryCodes
691
+ }
692
+ }
693
+ `
694
+ );
695
+ function useGetMfaRecoveryCodes() {
696
+ const { graphql: graphql2 } = useAppwrite();
697
+ const queryResult = useQuery({
698
+ queryKey: ["appwrite", "account", "mfa", "recovery-codes"],
699
+ queryFn: async () => {
700
+ const { data, errors } = await graphql2.query({
701
+ query: getMFARecoveryCodes
702
+ });
703
+ if (errors) {
704
+ throw errors;
705
+ }
706
+ return data.accountGetMfaRecoveryCodes;
707
+ }
708
+ });
709
+ return { ...queryResult };
710
+ }
711
+
712
+ // src/account/useGetPrefs.ts
713
+ var accountGetPrefs = gql(
714
+ /* GraphQL */
715
+ `
716
+ query GetPrefs {
717
+ accountGetPrefs {
718
+ data
719
+ }
720
+ }
721
+ `
722
+ );
723
+ function useGetPrefs() {
724
+ const { graphql: graphql2 } = useAppwrite();
725
+ const queryResult = useQuery({
726
+ queryKey: ["appwrite", "account", "prefs"],
727
+ queryFn: async () => {
728
+ const { data, errors } = await graphql2.query({
729
+ query: accountGetPrefs
730
+ });
731
+ if (errors) {
732
+ throw errors;
733
+ }
734
+ return data.accountGetPrefs;
735
+ }
736
+ });
737
+ return { ...queryResult };
738
+ }
739
+
740
+ // src/account/useGetSession.ts
741
+ var getSession = gql(
742
+ /* GraphQL */
743
+ `
744
+ query GetSession($sessionId: String!) {
745
+ accountGetSession(sessionId: $sessionId) {
746
+ userId
747
+ expire
748
+ current
749
+ }
750
+ }
751
+ `
752
+ );
753
+ function useGetSession({ sessionId }) {
754
+ const { graphql: graphql2 } = useAppwrite();
755
+ const queryResult = useQuery({
756
+ queryKey: ["appwrite", "account", "session", sessionId],
757
+ queryFn: async () => {
758
+ const { data, errors } = await graphql2.query({
759
+ query: getSession,
760
+ variables: { sessionId }
761
+ });
762
+ if (errors) {
763
+ throw errors;
764
+ }
765
+ return data.accountGetSession;
766
+ }
767
+ });
768
+ return queryResult;
769
+ }
770
+
771
+ // src/account/useListIdentities.ts
772
+ var accountListIdentities = gql(
773
+ /* GraphQL */
774
+ `
775
+ query ListIdentities($queries: [String!]) {
776
+ accountListIdentities(queries: $queries) {
777
+ total
778
+ identities {
779
+ ...Identity_ProviderFragment
780
+ }
781
+ }
782
+ }
783
+ `
784
+ );
785
+ function useListIdentities({ queries }) {
786
+ const { graphql: graphql2 } = useAppwrite();
787
+ const queryResult = useQuery({
788
+ queryKey: ["appwrite", "account", "identities", queries],
789
+ queryFn: async () => {
790
+ const { data, errors } = await graphql2.query({
791
+ query: accountListIdentities,
792
+ variables: {
793
+ queries
794
+ }
795
+ });
796
+ if (errors) {
797
+ throw errors;
798
+ }
799
+ return data.accountListIdentities;
800
+ }
801
+ });
802
+ return { ...queryResult };
803
+ }
804
+
805
+ // src/account/useListMfaFactors.ts
806
+ var listMFAFactors = gql(
807
+ /* GraphQL */
808
+ `
809
+ query ListMfaFactors {
810
+ accountListMfaFactors {
811
+ totp
812
+ phone
813
+ email
814
+ }
815
+ }
816
+ `
817
+ );
818
+ function useListMfaFactors() {
819
+ const { graphql: graphql2 } = useAppwrite();
820
+ const queryResult = useQuery({
821
+ queryKey: ["appwrite", "account", "mfa", "factors"],
822
+ queryFn: async () => {
823
+ const { data, errors } = await graphql2.query({
824
+ query: listMFAFactors
825
+ });
826
+ if (errors) {
827
+ throw errors;
828
+ }
829
+ return data.accountListMfaFactors;
830
+ }
831
+ });
832
+ return { ...queryResult };
833
+ }
834
+
835
+ // src/account/useListSessions.ts
836
+ var accountListSessions = gql(
837
+ /* GraphQL */
838
+ `
839
+ query ListSessions {
840
+ accountListSessions {
841
+ sessions {
842
+ _id
843
+ _createdAt
844
+ osName
845
+ clientName
846
+ }
847
+ }
848
+ }
849
+ `
850
+ );
851
+ function useListSessions() {
852
+ const { graphql: graphql2 } = useAppwrite();
853
+ const queryResult = useQuery({
854
+ queryKey: ["appwrite", "account", "sessions"],
855
+ queryFn: async () => {
856
+ const { data, errors } = await graphql2.query({
857
+ query: accountListSessions
858
+ });
859
+ if (errors) {
860
+ throw errors;
861
+ }
862
+ return data.accountListSessions;
863
+ }
864
+ });
865
+ return { ...queryResult };
866
+ }
867
+
868
+ // src/account/useLogin.ts
869
+ var accountCreateEmailPasswordSession = gql(
870
+ /* GraphQL */
871
+ `
872
+ mutation CreateEmailPasswordSession($email: String!, $password: String!) {
873
+ accountCreateEmailPasswordSession(email: $email, password: $password) {
874
+ userId
875
+ expire
876
+ current
877
+ }
878
+ }
879
+ `
880
+ );
881
+ function useLogin() {
882
+ const { account: account2, graphql: graphql2 } = useAppwrite();
883
+ const login = useMutation({
884
+ mutationFn: async ({ email, password }) => {
885
+ const { data, errors } = await graphql2.mutation({
886
+ query: accountCreateEmailPasswordSession,
887
+ variables: {
888
+ email,
889
+ password
890
+ }
891
+ });
892
+ if (errors) {
893
+ throw errors;
894
+ }
895
+ return data.accountCreateEmailPasswordSession;
896
+ }
897
+ });
898
+ const oAuthLogin = useMutation({
899
+ mutationFn: async ({ provider, success, failure }) => {
900
+ return account2.createOAuth2Session(provider, success, failure);
901
+ }
902
+ });
903
+ return {
904
+ login,
905
+ oAuthLogin
906
+ };
907
+ }
908
+
909
+ // src/account/useLogout.ts
910
+ var deleteSession3 = gql(
911
+ /* GraphQL */
912
+ `
913
+ mutation DeleteSession($sessionId: String!) {
914
+ accountDeleteSession(sessionId: $sessionId) {
915
+ status
916
+ }
917
+ }
918
+ `
919
+ );
920
+ function useLogout() {
921
+ const { graphql: graphql2 } = useAppwrite();
922
+ const queryClient2 = useQueryClient();
923
+ const queryResult = useMutation({
924
+ mutationFn: async ({ sessionId }) => {
925
+ const { data, errors } = await graphql2.mutation({
926
+ query: deleteSession3,
927
+ variables: {
928
+ sessionId
929
+ }
930
+ });
931
+ if (errors) {
932
+ throw errors;
933
+ }
934
+ return data?.accountDeleteSession;
935
+ },
936
+ onSuccess: async () => {
937
+ queryClient2.setQueryData(["appwrite", "account"], null);
938
+ queryClient2.removeQueries({ queryKey: ["appwrite", "account"] });
939
+ }
940
+ });
941
+ return { ...queryResult, mutate: queryResult.mutate };
942
+ }
943
+
944
+ // src/account/useLogs.ts
945
+ var accountListLogs = gql(
946
+ /* GraphQL */
947
+ `
948
+ query ListLogs($queries: [String!]) {
949
+ accountListLogs(queries: $queries) {
950
+ total
951
+ logs {
952
+ event
953
+ userId
954
+ userEmail
955
+ userName
956
+ mode
957
+ ip
958
+ time
959
+ osCode
960
+ osName
961
+ osVersion
962
+ clientType
963
+ clientCode
964
+ clientName
965
+ clientVersion
966
+ clientEngine
967
+ clientEngineVersion
968
+ deviceName
969
+ deviceBrand
970
+ deviceModel
971
+ countryCode
972
+ countryName
973
+ }
974
+ }
975
+ }
976
+ `
977
+ );
978
+ function useLogs({ queries }) {
979
+ const { graphql: graphql2 } = useAppwrite();
980
+ const queryResult = useQuery({
981
+ queryKey: ["appwrite", "account", "logs", queries],
982
+ queryFn: async () => {
983
+ const { data, errors } = await graphql2.query({
984
+ query: accountListLogs,
985
+ variables: {
986
+ queries
987
+ }
988
+ });
989
+ if (errors) {
990
+ throw errors;
991
+ }
992
+ return data.accountListLogs;
993
+ }
994
+ });
995
+ return { ...queryResult };
996
+ }
997
+
998
+ // src/account/usePasswordRecovery.ts
999
+ var createRecovery = gql(
1000
+ /* GraphQL */
1001
+ `
1002
+ mutation CreateRecovery($email: String!, $url: String!) {
1003
+ accountCreateRecovery(email: $email, url: $url) {
1004
+ expire
1005
+ }
1006
+ }
1007
+ `
1008
+ );
1009
+ function usePasswordRecovery() {
1010
+ const { graphql: graphql2 } = useAppwrite();
1011
+ const queryResult = useMutation({
1012
+ mutationFn: async ({ email, url: resetUrl }) => {
1013
+ const { data, errors } = await graphql2.mutation({
1014
+ query: createRecovery,
1015
+ variables: {
1016
+ email,
1017
+ url: resetUrl
1018
+ }
1019
+ });
1020
+ if (errors) {
1021
+ throw errors;
1022
+ }
1023
+ return data.accountCreateRecovery;
1024
+ },
1025
+ onSuccess: async (_, variables) => {
1026
+ localStorage.setItem("email", variables.email);
1027
+ }
1028
+ });
1029
+ return { ...queryResult };
1030
+ }
1031
+
1032
+ // src/account/useResetPassword.ts
1033
+ var updateRecovery = gql(
1034
+ /* GraphQL */
1035
+ `
1036
+ mutation UpdateRecovery(
1037
+ $userId: String!
1038
+ $secret: String!
1039
+ $password: String!
1040
+ $passwordAgain: String!
1041
+ ) {
1042
+ accountUpdateRecovery(
1043
+ userId: $userId
1044
+ secret: $secret
1045
+ password: $password
1046
+ passwordAgain: $passwordAgain
1047
+ ) {
1048
+ expire
1049
+ }
1050
+ }
1051
+ `
1052
+ );
1053
+ function useResetPassword() {
1054
+ const { graphql: graphql2 } = useAppwrite();
1055
+ const queryResult = useMutation({
1056
+ mutationFn: async ({ userId, secret, password, passwordAgain: confirmPassword }) => {
1057
+ const { data, errors } = await graphql2.mutation({
1058
+ query: updateRecovery,
1059
+ variables: {
1060
+ userId,
1061
+ secret,
1062
+ password,
1063
+ passwordAgain: confirmPassword
1064
+ }
1065
+ });
1066
+ if (errors) {
1067
+ throw errors;
1068
+ }
1069
+ return data.accountUpdateRecovery ?? {};
1070
+ }
1071
+ });
1072
+ return { ...queryResult };
1073
+ }
1074
+
1075
+ // src/account/useSignUp.ts
1076
+ import { ID } from "appwrite";
1077
+ var createAccount = gql(
1078
+ /* GraphQL */
1079
+ `
1080
+ mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
1081
+ accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
1082
+ name
1083
+ email
1084
+ }
1085
+ }
1086
+ `
1087
+ );
1088
+ var verify = gql(
1089
+ /* GraphQL */
1090
+ `
1091
+ mutation VerifyEmail($url: String!) {
1092
+ accountCreateVerification(url: $url) {
1093
+ expire
1094
+ }
1095
+ }
1096
+ `
1097
+ );
1098
+ function useSignUp() {
1099
+ const { graphql: graphql2 } = useAppwrite();
1100
+ const signUp = useMutation({
1101
+ mutationFn: async ({ userId, email, password, name }) => {
1102
+ const { data, errors } = await graphql2.mutation({
1103
+ query: createAccount,
1104
+ variables: {
1105
+ userId: userId ?? ID.unique(),
1106
+ name,
1107
+ email,
1108
+ password
1109
+ }
1110
+ });
1111
+ if (errors) {
1112
+ throw errors;
1113
+ }
1114
+ return data.accountCreate;
1115
+ }
1116
+ });
1117
+ const verifyEmail = useMutation({
1118
+ mutationFn: async ({ verifyUrl }) => {
1119
+ const { data, errors } = await graphql2.mutation({
1120
+ query: verify,
1121
+ variables: {
1122
+ url: verifyUrl
1123
+ }
1124
+ });
1125
+ if (errors) {
1126
+ throw errors;
1127
+ }
1128
+ return data.accountCreateVerification;
1129
+ }
1130
+ });
1131
+ return { signUp, verifyEmail };
1132
+ }
1133
+
1134
+ // src/account/useUpdateEmail.ts
1135
+ var accountUpdateEmail = gql(
1136
+ /* GraphQL */
1137
+ `
1138
+ mutation UpdateEmail($email: String!, $password: String!) {
1139
+ accountUpdateEmail(email: $email, password: $password) {
1140
+ name
1141
+ email
1142
+ }
1143
+ }
1144
+ `
1145
+ );
1146
+ function useUpdateEmail() {
1147
+ const { graphql: graphql2 } = useAppwrite();
1148
+ const queryResult = useMutation({
1149
+ mutationFn: async ({ email, password }) => {
1150
+ const { data, errors } = await graphql2.mutation({
1151
+ query: accountUpdateEmail,
1152
+ variables: {
1153
+ email,
1154
+ password
1155
+ }
1156
+ });
1157
+ if (errors) {
1158
+ throw errors;
1159
+ }
1160
+ return data.accountUpdateEmail;
1161
+ }
1162
+ });
1163
+ return { ...queryResult };
1164
+ }
1165
+
1166
+ // src/account/useUpdateMagicURLSession.ts
1167
+ var updateMagicURLSession = gql(
1168
+ /* GraphQL */
1169
+ `
1170
+ mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
1171
+ accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
1172
+ userId
1173
+ expire
1174
+ current
1175
+ }
1176
+ }
1177
+ `
1178
+ );
1179
+ function useUpdateMagicURLSession() {
1180
+ const { graphql: graphql2 } = useAppwrite();
1181
+ const queryResult = useMutation({
1182
+ mutationFn: async ({ userId, secret }) => {
1183
+ const { data, errors } = await graphql2.mutation({
1184
+ query: updateMagicURLSession,
1185
+ variables: {
1186
+ userId,
1187
+ secret
1188
+ }
1189
+ });
1190
+ if (errors) {
1191
+ throw errors;
1192
+ }
1193
+ return data.accountUpdateMagicURLSession;
1194
+ }
1195
+ });
1196
+ return { ...queryResult };
1197
+ }
1198
+
1199
+ // src/account/useUpdateMfa.ts
1200
+ var accountUpdateMFA = gql(
1201
+ /* GraphQL */
1202
+ `
1203
+ mutation UpdateMFA($mfa: Boolean!) {
1204
+ accountUpdateMFA(mfa: $mfa) {
1205
+ mfa
1206
+ }
1207
+ }
1208
+ `
1209
+ );
1210
+ function useUpdateMfa() {
1211
+ const { graphql: graphql2 } = useAppwrite();
1212
+ const queryResult = useMutation({
1213
+ mutationFn: async ({ mfa }) => {
1214
+ const { data, errors } = await graphql2.mutation({
1215
+ query: accountUpdateMFA,
1216
+ variables: {
1217
+ mfa
1218
+ }
1219
+ });
1220
+ if (errors) {
1221
+ throw errors;
1222
+ }
1223
+ return data.accountUpdateMFA;
1224
+ }
1225
+ });
1226
+ return { ...queryResult };
1227
+ }
1228
+
1229
+ // src/account/useUpdateMfaAuthenticator.ts
1230
+ var updateMFAAuthenticator2 = gql(
1231
+ /* GraphQL */
1232
+ `
1233
+ mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
1234
+ accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
1235
+ mfa
1236
+ }
1237
+ }
1238
+ `
1239
+ );
1240
+ function useUpdateMfaAuthenticator() {
1241
+ const { graphql: graphql2 } = useAppwrite();
1242
+ const queryResult = useMutation({
1243
+ mutationFn: async ({ type = "totp", otp }) => {
1244
+ const { data, errors } = await graphql2.mutation({
1245
+ query: updateMFAAuthenticator2,
1246
+ variables: {
1247
+ type,
1248
+ otp
1249
+ }
1250
+ });
1251
+ if (errors) {
1252
+ throw errors;
1253
+ }
1254
+ return data.accountUpdateMfaAuthenticator;
1255
+ }
1256
+ });
1257
+ return { ...queryResult };
1258
+ }
1259
+
1260
+ // src/account/useUpdateMfaChallenge.ts
1261
+ var accountUpdateMfaChallenge = gql(
1262
+ /* GraphQL */
1263
+ `
1264
+ mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
1265
+ accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
1266
+ status
1267
+ }
1268
+ }
1269
+ `
1270
+ );
1271
+ function useUpdateMfaChallenge() {
1272
+ const { graphql: graphql2 } = useAppwrite();
1273
+ const queryResult = useMutation({
1274
+ mutationFn: async ({ challengeId, otp }) => {
1275
+ const { data, errors } = await graphql2.mutation({
1276
+ query: accountUpdateMfaChallenge,
1277
+ variables: {
1278
+ challengeId,
1279
+ otp
1280
+ }
1281
+ });
1282
+ if (errors) {
1283
+ throw errors;
1284
+ }
1285
+ return data.accountUpdateMfaChallenge;
1286
+ }
1287
+ });
1288
+ return { ...queryResult };
1289
+ }
1290
+
1291
+ // src/account/useUpdateMfaRecoveryCodes.ts
1292
+ var accountUpdateMfaRecoveryCodes = gql(
1293
+ /* GraphQL */
1294
+ `
1295
+ mutation UpdateMfaRecoveryCodes {
1296
+ accountUpdateMfaRecoveryCodes {
1297
+ recoveryCodes
1298
+ }
1299
+ }
1300
+ `
1301
+ );
1302
+ function useUpdateMfaRecoveryCodes() {
1303
+ const { graphql: graphql2 } = useAppwrite();
1304
+ const queryResult = useMutation({
1305
+ mutationFn: async () => {
1306
+ const { data, errors } = await graphql2.mutation({
1307
+ query: accountUpdateMfaRecoveryCodes
1308
+ });
1309
+ if (errors) {
1310
+ throw errors;
1311
+ }
1312
+ return data.accountUpdateMfaRecoveryCodes;
1313
+ }
162
1314
  });
163
- useEffect(() => {
164
- const unsubscribe = graphql2.client.subscribe(
165
- "account",
166
- (response) => {
167
- const isUpdatingPreferences = response.events.some((event) => event.endsWith("prefs"));
168
- if (isUpdatingPreferences) {
169
- queryClient2.setQueryData(
170
- ["appwrite", "account"],
171
- (account2) => produce(account2, (draft) => {
172
- if (draft) {
173
- draft.prefs = castDraft(response.payload.prefs);
174
- }
175
- })
176
- );
177
- return;
178
- }
179
- queryClient2.setQueryData(
180
- ["appwrite", "account"],
181
- response.payload
182
- );
183
- }
184
- );
185
- return unsubscribe;
186
- }, [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
- };
1315
+ return { ...queryResult };
212
1316
  }
213
1317
 
214
- // src/account/useLogin.ts
215
- var createEmailSession = gql(
1318
+ // src/account/useUpdateName.ts
1319
+ var accountUpdateName = gql(
216
1320
  /* GraphQL */
217
1321
  `
218
- mutation CreateEmailSession($email: String!, $password: String!) {
219
- accountCreateEmailSession(email: $email, password: $password) {
220
- userId
221
- expire
222
- current
1322
+ mutation UpdateName($name: String!) {
1323
+ accountUpdateName(name: $name) {
1324
+ name
223
1325
  }
224
1326
  }
225
1327
  `
226
1328
  );
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);
232
- }
233
- });
234
- const oAuthLogin = useMutation({
235
- mutationFn: async ({ provider, success, failure }) => {
236
- return account2.createOAuth2Session(provider, success, failure);
1329
+ function useUpdateName() {
1330
+ const { graphql: graphql2 } = useAppwrite();
1331
+ const queryResult = useMutation({
1332
+ mutationFn: async ({ name }) => {
1333
+ const { data: mutationData, errors } = await graphql2.mutation({
1334
+ query: accountUpdateName,
1335
+ variables: {
1336
+ name
1337
+ }
1338
+ });
1339
+ if (errors) {
1340
+ throw errors;
1341
+ }
1342
+ return mutationData.accountUpdateName;
237
1343
  }
238
1344
  });
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
257
- },
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
275
- }
276
- };
1345
+ return { ...queryResult };
277
1346
  }
278
1347
 
279
- // src/__generated__/fragment-masking.ts
280
- function getFragmentData(_documentNode, fragmentType) {
281
- return fragmentType;
282
- }
283
-
284
- // src/account/useLogout.ts
285
- var deleteSession = gql(
1348
+ // src/account/useUpdatePassword.ts
1349
+ var updatePassword = gql(
286
1350
  /* GraphQL */
287
1351
  `
288
- mutation DeleteSession($sessionId: String!) {
289
- accountDeleteSession(sessionId: $sessionId) {
1352
+ mutation UpdatePassword($password: String!, $oldPassword: String!) {
1353
+ accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
290
1354
  status
291
1355
  }
292
1356
  }
293
1357
  `
294
1358
  );
295
- function useLogout() {
1359
+ function useUpdatePassword() {
296
1360
  const { graphql: graphql2 } = useAppwrite();
297
- const queryClient2 = useQueryClient();
298
- const logout = useMutation({
299
- mutationFn: () => {
300
- return graphql2.mutation({
301
- query: deleteSession,
1361
+ const queryResult = useMutation({
1362
+ mutationFn: async ({ password, oldPassword }) => {
1363
+ const { data, errors } = await graphql2.mutation({
1364
+ query: updatePassword,
302
1365
  variables: {
303
- sessionId: "current"
1366
+ password,
1367
+ oldPassword
304
1368
  }
305
1369
  });
306
- },
307
- onSuccess: async () => {
308
- queryClient2.setQueryData(["appwrite", "account"], null);
309
- queryClient2.removeQueries({ queryKey: ["appwrite", "account"] });
1370
+ if (errors) {
1371
+ throw errors;
1372
+ }
1373
+ return data.accountUpdatePassword;
310
1374
  }
311
1375
  });
312
- return logout;
1376
+ return { ...queryResult };
313
1377
  }
314
1378
 
315
- // src/account/usePasswordRecovery.ts
316
- var createRecovery = gql(
1379
+ // src/account/useUpdatePhone.ts
1380
+ var accountUpdatePhone = gql(
317
1381
  /* GraphQL */
318
1382
  `
319
- mutation CreateRecovery($email: String!, $url: String!) {
320
- accountCreateRecovery(email: $email, url: $url) {
321
- expire
1383
+ mutation UpdatePhone($phone: String!, $password: String!) {
1384
+ accountUpdatePhone(phone: $phone, password: $password) {
1385
+ phone
322
1386
  }
323
1387
  }
324
1388
  `
325
1389
  );
326
- function usePasswordRecovery() {
1390
+ function useUpdatePhone() {
327
1391
  const { graphql: graphql2 } = useAppwrite();
328
- const passwordRecovery = useMutation({
329
- mutationFn: async ({ email, resetUrl }) => {
1392
+ const queryResult = useMutation({
1393
+ mutationFn: async ({ phone, password }) => {
330
1394
  const { data, errors } = await graphql2.mutation({
331
- query: createRecovery,
1395
+ query: accountUpdatePhone,
332
1396
  variables: {
333
- email,
334
- url: resetUrl
1397
+ phone,
1398
+ password
335
1399
  }
336
1400
  });
337
1401
  if (errors) {
338
1402
  throw errors;
339
1403
  }
340
- return data.accountCreateRecovery ?? {};
341
- },
342
- onSuccess: async (_, variables) => {
343
- localStorage.setItem("email", variables.email);
1404
+ return data.accountUpdatePhone;
344
1405
  }
345
1406
  });
346
- return passwordRecovery;
1407
+ return { ...queryResult };
347
1408
  }
348
1409
 
349
- // src/account/useResetPassword.ts
350
- var updateRecovery = gql(
1410
+ // src/account/useUpdatePhoneSession.ts
1411
+ var updatePhoneSession = gql(
351
1412
  /* GraphQL */
352
1413
  `
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
- ) {
1414
+ mutation UpdatePhoneSession($userId: String!, $secret: String!) {
1415
+ accountUpdatePhoneSession(userId: $userId, secret: $secret) {
1416
+ userId
365
1417
  expire
1418
+ current
366
1419
  }
367
1420
  }
368
1421
  `
369
1422
  );
370
- function useResetPassword() {
1423
+ function useUpdatePhoneSession() {
371
1424
  const { graphql: graphql2 } = useAppwrite();
372
- const passwordReset = useMutation({
373
- mutationFn: async ({ userId, secret, password, confirmPassword }) => {
1425
+ const queryResult = useMutation({
1426
+ mutationFn: async ({ userId, secret }) => {
374
1427
  const { data, errors } = await graphql2.mutation({
375
- query: updateRecovery,
1428
+ query: updatePhoneSession,
376
1429
  variables: {
377
1430
  userId,
378
- secret,
379
- password,
380
- passwordAgain: confirmPassword
1431
+ secret
381
1432
  }
382
1433
  });
383
1434
  if (errors) {
384
1435
  throw errors;
385
1436
  }
386
- return data.accountUpdateRecovery ?? {};
1437
+ return data.accountUpdatePhoneSession;
387
1438
  }
388
1439
  });
389
- return passwordReset;
1440
+ return { ...queryResult };
390
1441
  }
391
1442
 
392
- // src/account/useSignUp.ts
393
- import { ID } from "appwrite";
394
- var createAccount = gql(
1443
+ // src/account/useUpdatePhoneVerification.ts
1444
+ var updatePhoneVerification = gql(
395
1445
  /* GraphQL */
396
1446
  `
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
1447
+ mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
1448
+ accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
1449
+ expire
401
1450
  }
402
1451
  }
403
1452
  `
404
1453
  );
405
- var verify = gql(
1454
+ function useUpdatePhoneVerification() {
1455
+ const { graphql: graphql2 } = useAppwrite();
1456
+ const queryResult = useMutation({
1457
+ mutationFn: async ({ userId, secret }) => {
1458
+ const { data, errors } = await graphql2.mutation({
1459
+ query: updatePhoneVerification,
1460
+ variables: {
1461
+ userId,
1462
+ secret
1463
+ }
1464
+ });
1465
+ if (errors) {
1466
+ throw errors;
1467
+ }
1468
+ return data.accountUpdatePhoneVerification;
1469
+ }
1470
+ });
1471
+ return { ...queryResult };
1472
+ }
1473
+
1474
+ // src/account/useUpdatePrefs.ts
1475
+ var accountUpdatePrefs = gql(
406
1476
  /* GraphQL */
407
1477
  `
408
- mutation VerifyEmail($url: String!) {
409
- accountCreateVerification(url: $url) {
410
- expire
1478
+ mutation UpdatePrefs($prefs: JSON!) {
1479
+ accountUpdatePrefs(prefs: $prefs) {
1480
+ prefs {
1481
+ data
1482
+ }
411
1483
  }
412
1484
  }
413
1485
  `
414
1486
  );
415
- function useSignUp() {
1487
+ function useUpdatePrefs() {
416
1488
  const { graphql: graphql2 } = useAppwrite();
417
- const signUp = useMutation({
418
- mutationFn: async ({ userId, email, password, name }) => {
1489
+ const queryResult = useMutation({
1490
+ mutationFn: async ({ prefs }) => {
419
1491
  const { data, errors } = await graphql2.mutation({
420
- query: createAccount,
1492
+ query: accountUpdatePrefs,
421
1493
  variables: {
422
- userId: userId ?? ID.unique(),
423
- name,
424
- email,
425
- password
1494
+ prefs
426
1495
  }
427
1496
  });
428
1497
  if (errors) {
429
1498
  throw errors;
430
1499
  }
431
- return data.accountCreate ?? {};
1500
+ return data.accountUpdatePrefs;
432
1501
  }
433
1502
  });
434
- const verifyEmail = useMutation({
435
- mutationFn: async ({ verifyUrl }) => {
1503
+ return { ...queryResult };
1504
+ }
1505
+
1506
+ // src/account/useUpdateSession.ts
1507
+ var updateSession = gql(
1508
+ /* GraphQL */
1509
+ `
1510
+ mutation UpdateSession($sessionId: String!) {
1511
+ accountUpdateSession(sessionId: $sessionId) {
1512
+ userId
1513
+ expire
1514
+ current
1515
+ }
1516
+ }
1517
+ `
1518
+ );
1519
+ function useUpdateSession() {
1520
+ const { graphql: graphql2 } = useAppwrite();
1521
+ const queryResult = useMutation({
1522
+ mutationFn: async ({ sessionId }) => {
436
1523
  const { data, errors } = await graphql2.mutation({
437
- query: verify,
1524
+ query: updateSession,
438
1525
  variables: {
439
- url: verifyUrl
1526
+ sessionId
440
1527
  }
441
1528
  });
442
1529
  if (errors) {
443
1530
  throw errors;
444
1531
  }
445
- return data.accountCreateVerification ?? {};
1532
+ return data.accountUpdateSession;
446
1533
  }
447
1534
  });
448
- return { signUp, verifyEmail };
1535
+ return { ...queryResult };
449
1536
  }
450
1537
 
451
1538
  // src/account/useVerification.ts
@@ -462,7 +1549,7 @@ var updateVerification = gql(
462
1549
  function useVerification() {
463
1550
  const { graphql: graphql2 } = useAppwrite();
464
1551
  const queryClient2 = useQueryClient();
465
- const verify2 = useMutation({
1552
+ const queryResult = useMutation({
466
1553
  mutationFn: async ({ userId, secret }) => {
467
1554
  if (!userId || !secret) {
468
1555
  throw new Error("Missing userId or secret");
@@ -483,7 +1570,7 @@ function useVerification() {
483
1570
  queryClient2.setQueryData(["appwrite", "account"], null);
484
1571
  }
485
1572
  });
486
- return verify2;
1573
+ return { ...queryResult };
487
1574
  }
488
1575
 
489
1576
  // src/databases/useCollection.ts
@@ -509,8 +1596,7 @@ var listDocuments = gql(
509
1596
  function useCollection({
510
1597
  databaseId,
511
1598
  collectionId,
512
- queries,
513
- options
1599
+ queries
514
1600
  }) {
515
1601
  const { graphql: graphql2 } = useAppwrite();
516
1602
  const queryClient2 = useQueryClient();
@@ -536,8 +1622,7 @@ function useCollection({
536
1622
  total: data.databasesListDocuments?.total ?? 0,
537
1623
  documents: documents2
538
1624
  };
539
- },
540
- ...options
1625
+ }
541
1626
  });
542
1627
  useEffect2(() => {
543
1628
  const unsubscribe = graphql2.client.subscribe(
@@ -593,11 +1678,10 @@ var createDocument = gql(
593
1678
  }
594
1679
  `
595
1680
  );
596
- function useCreateDocument(databaseId, collectionId, documentId, data, permissions, options) {
1681
+ function useCreateDocument() {
597
1682
  const { graphql: graphql2 } = useAppwrite();
598
1683
  const mutationResult = useMutation({
599
- mutationKey: ["appwrite", "databases", databaseId, collectionId, "documents", documentId],
600
- mutationFn: async () => {
1684
+ mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
601
1685
  const { data: mutationData, errors } = await graphql2.mutation({
602
1686
  query: createDocument,
603
1687
  variables: {
@@ -611,13 +1695,72 @@ function useCreateDocument(databaseId, collectionId, documentId, data, permissio
611
1695
  if (errors) {
612
1696
  throw errors;
613
1697
  }
614
- return mutationData.databasesCreateDocument?._id;
615
- },
616
- ...options
1698
+ return mutationData.databasesCreateDocument;
1699
+ }
617
1700
  });
618
1701
  return mutationResult;
619
1702
  }
620
1703
 
1704
+ // src/databases/useDeleteDocument.ts
1705
+ var deleteDocument = gql(
1706
+ /* GraphQL */
1707
+ `
1708
+ mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
1709
+ databasesDeleteDocument(
1710
+ databaseId: $databaseId
1711
+ collectionId: $collectionId
1712
+ documentId: $documentId
1713
+ ) {
1714
+ status
1715
+ }
1716
+ }
1717
+ `
1718
+ );
1719
+ function useDeleteDocument() {
1720
+ const { graphql: graphql2 } = useAppwrite();
1721
+ const queryClient2 = useQueryClient();
1722
+ const mutationResult = useMutation({
1723
+ mutationFn: async ({ databaseId, collectionId, documentId }) => {
1724
+ const { data: mutationData, errors } = await graphql2.mutation({
1725
+ query: deleteDocument,
1726
+ variables: {
1727
+ databaseId,
1728
+ collectionId,
1729
+ documentId
1730
+ }
1731
+ });
1732
+ if (errors) {
1733
+ throw errors;
1734
+ }
1735
+ return mutationData.databasesDeleteDocument;
1736
+ },
1737
+ onSuccess: async (_, variables) => {
1738
+ queryClient2.setQueryData(
1739
+ [
1740
+ "appwrite",
1741
+ "databases",
1742
+ variables.databaseId,
1743
+ variables.collectionId,
1744
+ "documents",
1745
+ variables.documentId
1746
+ ],
1747
+ null
1748
+ );
1749
+ queryClient2.removeQueries({
1750
+ queryKey: [
1751
+ "appwrite",
1752
+ "databases",
1753
+ variables.databaseId,
1754
+ variables.collectionId,
1755
+ "documents",
1756
+ variables.documentId
1757
+ ]
1758
+ });
1759
+ }
1760
+ });
1761
+ return { ...mutationResult };
1762
+ }
1763
+
621
1764
  // src/databases/useDocument.ts
622
1765
  import { useEffect as useEffect3 } from "react";
623
1766
  var getDocument = gql(
@@ -635,7 +1778,11 @@ var getDocument = gql(
635
1778
  }
636
1779
  `
637
1780
  );
638
- function useDocument(databaseId, collectionId, documentId, options) {
1781
+ function useDocument({
1782
+ databaseId,
1783
+ collectionId,
1784
+ documentId
1785
+ }) {
639
1786
  const { graphql: graphql2 } = useAppwrite();
640
1787
  const queryClient2 = useQueryClient();
641
1788
  const queryResult = useQuery({
@@ -657,8 +1804,7 @@ function useDocument(databaseId, collectionId, documentId, options) {
657
1804
  ...data.databasesGetDocument ? JSON.parse(data.databasesGetDocument.data) : {}
658
1805
  };
659
1806
  return document;
660
- },
661
- ...options
1807
+ }
662
1808
  });
663
1809
  useEffect3(() => {
664
1810
  const unsubscribe = graphql2.client.subscribe(
@@ -672,7 +1818,63 @@ function useDocument(databaseId, collectionId, documentId, options) {
672
1818
  );
673
1819
  return unsubscribe;
674
1820
  }, [databaseId, collectionId, documentId, graphql2.client, queryClient2]);
675
- return queryResult;
1821
+ return { ...queryResult };
1822
+ }
1823
+
1824
+ // src/databases/useUpdateDocument.ts
1825
+ var updateDocument = gql(
1826
+ /* GraphQL */
1827
+ `
1828
+ mutation UpdateDocument(
1829
+ $databaseId: String!
1830
+ $collectionId: String!
1831
+ $documentId: String!
1832
+ $data: JSON!
1833
+ $permissions: [String!]
1834
+ ) {
1835
+ databasesUpdateDocument(
1836
+ databaseId: $databaseId
1837
+ collectionId: $collectionId
1838
+ documentId: $documentId
1839
+ data: $data
1840
+ permissions: $permissions
1841
+ ) {
1842
+ _id
1843
+ _collectionId
1844
+ _databaseId
1845
+ _createdAt
1846
+ _updatedAt
1847
+ _permissions
1848
+ data
1849
+ }
1850
+ }
1851
+ `
1852
+ );
1853
+ function useUpdateDocument() {
1854
+ const { graphql: graphql2 } = useAppwrite();
1855
+ const mutationResult = useMutation({
1856
+ mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
1857
+ const { data: mutationData, errors } = await graphql2.mutation({
1858
+ query: updateDocument,
1859
+ variables: {
1860
+ databaseId,
1861
+ collectionId,
1862
+ documentId,
1863
+ data,
1864
+ permissions
1865
+ }
1866
+ });
1867
+ if (errors) {
1868
+ throw errors;
1869
+ }
1870
+ const document = {
1871
+ ...mutationData.databasesUpdateDocument,
1872
+ ...mutationData.databasesUpdateDocument ? JSON.parse(mutationData.databasesUpdateDocument.data) : {}
1873
+ };
1874
+ return document;
1875
+ }
1876
+ });
1877
+ return { ...mutationResult };
676
1878
  }
677
1879
 
678
1880
  // src/functions/useFunction.ts
@@ -799,10 +2001,20 @@ var Account_UserFragment = gql(
799
2001
  }
800
2002
  `
801
2003
  );
2004
+ var Identity_ProviderFragment = gql(
2005
+ /* GraphQL */
2006
+ `
2007
+ fragment Identity_ProviderFragment on Identity {
2008
+ userId
2009
+ provider
2010
+ }
2011
+ `
2012
+ );
802
2013
 
803
2014
  // src/index.ts
804
2015
  var fragments = {
805
- Account_UserFragment
2016
+ Account_UserFragment,
2017
+ Identity_ProviderFragment
806
2018
  };
807
2019
  export {
808
2020
  fragments,
@@ -810,17 +2022,53 @@ export {
810
2022
  useAccount,
811
2023
  useAppwrite,
812
2024
  useCollection,
2025
+ useCreateAnonymousSession,
813
2026
  useCreateDocument,
2027
+ useCreateEmailToken,
2028
+ useCreateJWT,
2029
+ useCreateMagicURLToken,
2030
+ useCreateMfaAuthenticator,
2031
+ useCreateMfaChallenge,
2032
+ useCreateMfaRecoveryCodes,
2033
+ useCreatePhoneToken,
2034
+ useCreatePhoneVerification,
2035
+ useCreateSession,
2036
+ useDeleteDocument,
2037
+ useDeleteIdentity,
2038
+ useDeleteMfaAuthenticator,
2039
+ useDeleteSession,
2040
+ useDeleteSessions,
814
2041
  useDocument,
815
2042
  useFunction,
2043
+ useGetMfaRecoveryCodes,
2044
+ useGetPrefs,
2045
+ useGetSession,
2046
+ useListIdentities,
2047
+ useListMfaFactors,
2048
+ useListSessions,
816
2049
  useLogin,
817
2050
  useLogout,
2051
+ useLogs,
818
2052
  useMutation,
819
2053
  usePasswordRecovery,
820
2054
  useQuery,
821
2055
  useQueryClient,
822
2056
  useResetPassword,
823
2057
  useSignUp,
2058
+ useUpdateDocument,
2059
+ useUpdateEmail,
2060
+ useUpdateMagicURLSession,
2061
+ useUpdateMfa,
2062
+ useUpdateMfaAuthenticator,
2063
+ useUpdateMfaChallenge,
2064
+ useUpdateMfaRecoveryCodes,
2065
+ useUpdateName,
2066
+ useUpdatePassword,
2067
+ useUpdatePhone,
2068
+ useUpdatePhoneSession,
2069
+ useUpdatePhoneVerification,
2070
+ useUpdatePrefs,
2071
+ useUpdateSession,
824
2072
  useVerification
825
2073
  };
826
2074
  //# sourceMappingURL=index.mjs.map