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