@zeroin.earth/appwrite-graphql 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -24,17 +24,55 @@ __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
+ useSuspenseCollection: () => useSuspenseCollection,
61
+ useSuspenseCreateJWT: () => useSuspenseCreateJWT,
62
+ useUpdateDocument: () => useUpdateDocument,
63
+ useUpdateEmail: () => useUpdateEmail,
64
+ useUpdateMagicURLSession: () => useUpdateMagicURLSession,
65
+ useUpdateMfa: () => useUpdateMfa,
66
+ useUpdateMfaAuthenticator: () => useUpdateMfaAuthenticator,
67
+ useUpdateMfaChallenge: () => useUpdateMfaChallenge,
68
+ useUpdateMfaRecoveryCodes: () => useUpdateMfaRecoveryCodes,
69
+ useUpdateName: () => useUpdateName,
70
+ useUpdatePassword: () => useUpdatePassword,
71
+ useUpdatePhone: () => useUpdatePhone,
72
+ useUpdatePhoneSession: () => useUpdatePhoneSession,
73
+ useUpdatePhoneVerification: () => useUpdatePhoneVerification,
74
+ useUpdatePrefs: () => useUpdatePrefs,
75
+ useUpdateSession: () => useUpdateSession,
38
76
  useVerification: () => useVerification
39
77
  });
40
78
  module.exports = __toCommonJS(src_exports);
@@ -132,34 +170,104 @@ var import_immer = require("immer");
132
170
 
133
171
  // src/__generated__/graphql.ts
134
172
  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" } }] } }] } }] };
173
+ 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
174
  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" } }] } }] } }] };
175
+ 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" } }] } }] } }] };
176
+ 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" } }] } }] } }] };
177
+ 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" } }] } }] } }] };
178
+ 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" } }] } }] } }] };
179
+ 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" } }] } }] } }] };
180
+ 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" } }] } }] } }] };
181
+ 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" } }] } }] } }] };
182
+ 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" } }] } }] } }] };
183
+ 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" } }] } }] } }] };
184
+ 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" } }] } }] } }] };
185
+ 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" } }] } }] } }] };
186
+ 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
187
  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" } }] } }] } }] };
188
+ 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" } }] } }] } }] };
189
+ 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" } }] } }] } }] };
190
+ 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" } }] } }] } }] };
191
+ 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" } }] } }] };
192
+ 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" } }] } }] } }] };
193
+ 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" } }] } }] } }] } }] };
194
+ 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" } }] } }] } }] };
195
+ 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
196
  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
197
  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
198
  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
199
  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" } }] } }] } }] };
200
+ 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" } }] } }] } }] };
201
+ 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" } }] } }] } }] };
202
+ 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" } }] } }] } }] };
203
+ 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" } }] } }] } }] };
204
+ 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" } }] } }] } }] };
205
+ 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" } }] } }] } }] };
206
+ 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" } }] } }] } }] };
207
+ 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" } }] } }] } }] };
208
+ 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" } }] } }] } }] };
209
+ 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" } }] } }] } }] };
210
+ 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" } }] } }] } }] };
211
+ 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" } }] } }] } }] } }] };
212
+ 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
213
  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
214
  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
215
  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" } }] } }] } }] };
216
+ 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
217
  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" } }] } }] } }] };
218
+ 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
219
  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
220
  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
221
 
149
222
  // src/__generated__/gql.ts
150
223
  var documents = {
151
224
  "\n fragment Account_UserFragment on User {\n name\n email\n prefs {\n data\n }\n }\n": Account_UserFragmentFragmentDoc,
225
+ "\n fragment Identity_ProviderFragment on Identity {\n userId\n provider\n }\n": Identity_ProviderFragmentFragmentDoc,
152
226
  "\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,
227
+ "\n mutation CreateAnonymousSession {\n accountCreateAnonymousSession {\n _id\n expire\n current\n }\n }\n": CreateAnonymousSessionDocument,
228
+ "\n mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {\n accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {\n expire\n }\n }\n": CreateEmailTokenDocument,
229
+ "\n mutation CreateJWT {\n accountCreateJWT {\n jwt\n }\n }\n": CreateJwtDocument,
230
+ "\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,
231
+ "\n mutation CreateMfaAuthenticator($type: String!) {\n accountCreateMfaAuthenticator(type: $type) {\n secret\n uri\n }\n }\n": CreateMfaAuthenticatorDocument,
232
+ "\n mutation CreateMfaChallenge($factor: String!) {\n accountCreateMfaChallenge(factor: $factor) {\n userId\n expire\n }\n }\n": CreateMfaChallengeDocument,
233
+ "\n mutation CreateMfaRecoveryCodes {\n accountCreateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": CreateMfaRecoveryCodesDocument,
234
+ "\n mutation CreatePhoneToken($userId: String!, $phone: String!) {\n accountCreatePhoneToken(userId: $userId, phone: $phone) {\n expire\n }\n }\n": CreatePhoneTokenDocument,
235
+ "\n mutation CreatePhoneVerification {\n accountCreatePhoneVerification {\n expire\n }\n }\n": CreatePhoneVerificationDocument,
236
+ "\n mutation CreateSession($userId: String!, $secret: String!) {\n accountCreateSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": CreateSessionDocument,
237
+ "\n mutation DeleteIdentity($identityId: String!) {\n accountDeleteIdentity(identityId: $identityId) {\n status\n }\n }\n": DeleteIdentityDocument,
238
+ "\n mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {\n accountDeleteMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n": DeleteMfaAuthenticatorDocument,
154
239
  "\n mutation DeleteSession($sessionId: String!) {\n accountDeleteSession(sessionId: $sessionId) {\n status\n }\n }\n": DeleteSessionDocument,
240
+ "\n query GetMfaRecoveryCodes {\n accountGetMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": GetMfaRecoveryCodesDocument,
241
+ "\n query GetPrefs {\n accountGetPrefs {\n data\n }\n }\n": GetPrefsDocument,
242
+ "\n query GetSession($sessionId: String!) {\n accountGetSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": GetSessionDocument,
243
+ "\n query ListIdentities($queries: [String!]) {\n accountListIdentities(queries: $queries) {\n total\n identities {\n ...Identity_ProviderFragment\n }\n }\n }\n": ListIdentitiesDocument,
244
+ "\n query ListMfaFactors {\n accountListMfaFactors {\n totp\n phone\n email\n }\n }\n": ListMfaFactorsDocument,
245
+ "\n query ListSessions {\n accountListSessions {\n sessions {\n _id\n _createdAt\n osName\n clientName\n }\n }\n }\n": ListSessionsDocument,
246
+ "\n mutation CreateEmailPasswordSession($email: String!, $password: String!) {\n accountCreateEmailPasswordSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n": CreateEmailPasswordSessionDocument,
247
+ "\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
248
  "\n mutation CreateRecovery($email: String!, $url: String!) {\n accountCreateRecovery(email: $email, url: $url) {\n expire\n }\n }\n": CreateRecoveryDocument,
156
249
  "\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
250
  "\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
251
  "\n mutation VerifyEmail($url: String!) {\n accountCreateVerification(url: $url) {\n expire\n }\n }\n": VerifyEmailDocument,
252
+ "\n mutation UpdateEmail($email: String!, $password: String!) {\n accountUpdateEmail(email: $email, password: $password) {\n name\n email\n }\n }\n": UpdateEmailDocument,
253
+ "\n mutation UpdateMagicURLSession($userId: String!, $secret: String!) {\n accountUpdateMagicURLSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": UpdateMagicUrlSessionDocument,
254
+ "\n mutation UpdateMFA($mfa: Boolean!) {\n accountUpdateMFA(mfa: $mfa) {\n mfa\n }\n }\n": UpdateMfaDocument,
255
+ "\n mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {\n accountUpdateMfaAuthenticator(type: $type, otp: $otp) {\n mfa\n }\n }\n": UpdateMfaAuthenticatorDocument,
256
+ "\n mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {\n accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {\n status\n }\n }\n": UpdateMfaChallengeDocument,
257
+ "\n mutation UpdateMfaRecoveryCodes {\n accountUpdateMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": UpdateMfaRecoveryCodesDocument,
258
+ "\n mutation UpdateName($name: String!) {\n accountUpdateName(name: $name) {\n name\n }\n }\n": UpdateNameDocument,
259
+ "\n mutation UpdatePassword($password: String!, $oldPassword: String!) {\n accountUpdatePassword(password: $password, oldPassword: $oldPassword) {\n status\n }\n }\n": UpdatePasswordDocument,
260
+ "\n mutation UpdatePhone($phone: String!, $password: String!) {\n accountUpdatePhone(phone: $phone, password: $password) {\n phone\n }\n }\n": UpdatePhoneDocument,
261
+ "\n mutation UpdatePhoneSession($userId: String!, $secret: String!) {\n accountUpdatePhoneSession(userId: $userId, secret: $secret) {\n userId\n expire\n current\n }\n }\n": UpdatePhoneSessionDocument,
262
+ "\n mutation UpdatePhoneVerification($userId: String!, $secret: String!) {\n accountUpdatePhoneVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdatePhoneVerificationDocument,
263
+ "\n mutation UpdatePrefs($prefs: JSON!) {\n accountUpdatePrefs(prefs: $prefs) {\n prefs {\n data\n }\n }\n }\n": UpdatePrefsDocument,
264
+ "\n mutation UpdateSession($sessionId: String!) {\n accountUpdateSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": UpdateSessionDocument,
159
265
  "\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdateVerificationDocument,
160
266
  "\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
267
  "\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,
268
+ "\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
269
  "\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,
270
+ "\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
271
  "\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
272
  "\n query GetFunctionExecution($functionId: String!, $executionId: String!) {\n functionsGetExecution(functionId: $functionId, executionId: $executionId) {\n status\n errors\n duration\n }\n }\n": GetFunctionExecutionDocument
165
273
  };
@@ -178,9 +286,7 @@ var getAccount = gql(
178
286
  }
179
287
  `
180
288
  );
181
- function useAccount({
182
- options
183
- }) {
289
+ function useAccount() {
184
290
  const { graphql: graphql2 } = useAppwrite();
185
291
  const queryClient2 = useQueryClient();
186
292
  const queryResult = useQuery({
@@ -194,8 +300,7 @@ function useAccount({
194
300
  }
195
301
  return data.accountGet;
196
302
  },
197
- retry: false,
198
- ...options
303
+ retry: false
199
304
  });
200
305
  (0, import_react2.useEffect)(() => {
201
306
  const unsubscribe = graphql2.client.subscribe(
@@ -221,268 +326,1319 @@ function useAccount({
221
326
  );
222
327
  return unsubscribe;
223
328
  }, [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
- };
329
+ return queryResult;
249
330
  }
250
331
 
251
- // src/account/useLogin.ts
252
- var createEmailSession = gql(
332
+ // src/__generated__/fragment-masking.ts
333
+ function getFragmentData(_documentNode, fragmentType) {
334
+ return fragmentType;
335
+ }
336
+
337
+ // src/account/useCreateAnonymousSession.ts
338
+ var createAnonymousSession = gql(
253
339
  /* GraphQL */
254
340
  `
255
- mutation CreateEmailSession($email: String!, $password: String!) {
256
- accountCreateEmailSession(email: $email, password: $password) {
257
- userId
341
+ mutation CreateAnonymousSession {
342
+ accountCreateAnonymousSession {
343
+ _id
258
344
  expire
259
345
  current
260
346
  }
261
347
  }
262
348
  `
263
349
  );
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);
350
+ function useCreateAnonymousSession() {
351
+ const { graphql: graphql2 } = useAppwrite();
352
+ const queryResult = useMutation({
353
+ mutationFn: async () => {
354
+ const { data, errors } = await graphql2.mutation({
355
+ query: createAnonymousSession
356
+ });
357
+ if (errors) {
358
+ throw errors;
359
+ }
360
+ return data.accountCreateAnonymousSession;
269
361
  }
270
362
  });
271
- const oAuthLogin = useMutation({
272
- mutationFn: async ({ provider, success, failure }) => {
273
- return account2.createOAuth2Session(provider, success, failure);
363
+ return { ...queryResult };
364
+ }
365
+
366
+ // src/account/useCreateEmailToken.ts
367
+ var createEmailToken = gql(
368
+ /* GraphQL */
369
+ `
370
+ mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {
371
+ accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {
372
+ expire
373
+ }
374
+ }
375
+ `
376
+ );
377
+ function useCreateEmailToken() {
378
+ const { graphql: graphql2 } = useAppwrite();
379
+ const queryResult = useMutation({
380
+ mutationFn: async ({ userId, email, phrase }) => {
381
+ const { data, errors } = await graphql2.mutation({
382
+ query: createEmailToken,
383
+ variables: {
384
+ userId,
385
+ email,
386
+ phrase
387
+ }
388
+ });
389
+ if (errors) {
390
+ throw errors;
391
+ }
392
+ return data.accountCreateEmailToken;
274
393
  }
275
394
  });
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
395
+ return { ...queryResult };
396
+ }
397
+
398
+ // src/useSuspenseQuery.ts
399
+ var import_react_query4 = require("@tanstack/react-query");
400
+ function useSuspenseQuery(options) {
401
+ const queryClient2 = useQueryClient();
402
+ return (0, import_react_query4.useSuspenseQuery)(options, queryClient2);
403
+ }
404
+
405
+ // src/account/useCreateJWT.ts
406
+ var accountCreateJWT = gql(
407
+ /* GraphQL */
408
+ `
409
+ mutation CreateJWT {
410
+ accountCreateJWT {
411
+ jwt
412
+ }
413
+ }
414
+ `
415
+ );
416
+ function useCreateJWT({ gcTime = 6e5 } = {}) {
417
+ const { graphql: graphql2 } = useAppwrite();
418
+ const queryClient2 = useQueryClient();
419
+ const queryResult = useMutation({
420
+ gcTime,
421
+ mutationKey: ["appwrite", "jwt"],
422
+ mutationFn: async () => {
423
+ const { data, errors } = await graphql2.mutation({
424
+ query: accountCreateJWT
425
+ });
426
+ if (errors) {
427
+ throw errors;
428
+ }
429
+ return data.accountCreateJWT;
294
430
  },
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
431
+ onSuccess: (data) => {
432
+ queryClient2.setQueryData(["appwrite", "jwt"], data.jwt, { updatedAt: Date.now() });
312
433
  }
313
- };
434
+ });
435
+ return { ...queryResult };
436
+ }
437
+ function useSuspenseCreateJWT({ gcTime = 6e5 } = {}) {
438
+ const { graphql: graphql2 } = useAppwrite();
439
+ const queryResult = useSuspenseQuery({
440
+ gcTime,
441
+ queryKey: ["appwrite", "jwt"],
442
+ queryFn: async () => {
443
+ const { data, errors } = await graphql2.mutation({
444
+ query: accountCreateJWT
445
+ });
446
+ if (errors) {
447
+ throw errors;
448
+ }
449
+ return data.accountCreateJWT;
450
+ }
451
+ });
452
+ return { ...queryResult };
314
453
  }
315
454
 
316
- // src/__generated__/fragment-masking.ts
317
- function getFragmentData(_documentNode, fragmentType) {
318
- return fragmentType;
455
+ // src/account/useCreateMagicURLToken.ts
456
+ var createMagicURLToken = gql(
457
+ /* GraphQL */
458
+ `
459
+ mutation CreateMagicURLToken($userId: String!, $email: String!, $url: String, $phrase: Boolean) {
460
+ accountCreateMagicURLToken(userId: $userId, email: $email, url: $url, phrase: $phrase) {
461
+ expire
462
+ }
463
+ }
464
+ `
465
+ );
466
+ function useCreateMagicURLToken() {
467
+ const { graphql: graphql2 } = useAppwrite();
468
+ const queryResult = useMutation({
469
+ mutationFn: async ({ userId, email, url, phrase }) => {
470
+ const { data, errors } = await graphql2.mutation({
471
+ query: createMagicURLToken,
472
+ variables: {
473
+ userId,
474
+ email,
475
+ url,
476
+ phrase
477
+ }
478
+ });
479
+ if (errors) {
480
+ throw errors;
481
+ }
482
+ return data.accountCreateMagicURLToken;
483
+ }
484
+ });
485
+ return { ...queryResult };
486
+ }
487
+
488
+ // src/account/useCreateMfaAuthenticator.ts
489
+ var accountCreateMfaAuthenticator = gql(
490
+ /* GraphQL */
491
+ `
492
+ mutation CreateMfaAuthenticator($type: String!) {
493
+ accountCreateMfaAuthenticator(type: $type) {
494
+ secret
495
+ uri
496
+ }
497
+ }
498
+ `
499
+ );
500
+ function useCreateMfaAuthenticator() {
501
+ const { graphql: graphql2 } = useAppwrite();
502
+ const queryResult = useMutation({
503
+ mutationFn: async ({ type = "totp" }) => {
504
+ const { data, errors } = await graphql2.mutation({
505
+ query: accountCreateMfaAuthenticator,
506
+ variables: {
507
+ type
508
+ }
509
+ });
510
+ if (errors) {
511
+ throw errors;
512
+ }
513
+ return data.accountCreateMfaAuthenticator;
514
+ }
515
+ });
516
+ return { ...queryResult };
517
+ }
518
+
519
+ // src/account/useCreateMfaChallenge.ts
520
+ var accountCreateMfaChallenge = gql(
521
+ /* GraphQL */
522
+ `
523
+ mutation CreateMfaChallenge($factor: String!) {
524
+ accountCreateMfaChallenge(factor: $factor) {
525
+ userId
526
+ expire
527
+ }
528
+ }
529
+ `
530
+ );
531
+ function useCreateMfaChallenge() {
532
+ const { graphql: graphql2 } = useAppwrite();
533
+ const queryResult = useMutation({
534
+ mutationFn: async ({ factor }) => {
535
+ const { data, errors } = await graphql2.mutation({
536
+ query: accountCreateMfaChallenge,
537
+ variables: {
538
+ factor
539
+ }
540
+ });
541
+ if (errors) {
542
+ throw errors;
543
+ }
544
+ return data.accountCreateMfaChallenge;
545
+ }
546
+ });
547
+ return { ...queryResult };
548
+ }
549
+
550
+ // src/account/useCreateMfaRecoveryCodes.ts
551
+ var accountCreateMfaRecoveryCodes = gql(
552
+ /* GraphQL */
553
+ `
554
+ mutation CreateMfaRecoveryCodes {
555
+ accountCreateMfaRecoveryCodes {
556
+ recoveryCodes
557
+ }
558
+ }
559
+ `
560
+ );
561
+ function useCreateMfaRecoveryCodes() {
562
+ const { graphql: graphql2 } = useAppwrite();
563
+ const queryResult = useMutation({
564
+ mutationFn: async () => {
565
+ const { data, errors } = await graphql2.mutation({
566
+ query: accountCreateMfaRecoveryCodes
567
+ });
568
+ if (errors) {
569
+ throw errors;
570
+ }
571
+ return data.accountCreateMfaRecoveryCodes;
572
+ }
573
+ });
574
+ return { ...queryResult };
575
+ }
576
+
577
+ // src/account/useCreatePhoneToken.ts
578
+ var createPhoneToken = gql(
579
+ /* GraphQL */
580
+ `
581
+ mutation CreatePhoneToken($userId: String!, $phone: String!) {
582
+ accountCreatePhoneToken(userId: $userId, phone: $phone) {
583
+ expire
584
+ }
585
+ }
586
+ `
587
+ );
588
+ function useCreatePhoneToken() {
589
+ const { graphql: graphql2 } = useAppwrite();
590
+ const queryResult = useMutation({
591
+ mutationFn: async ({ userId, phone }) => {
592
+ const { data, errors } = await graphql2.mutation({
593
+ query: createPhoneToken,
594
+ variables: {
595
+ userId,
596
+ phone
597
+ }
598
+ });
599
+ if (errors) {
600
+ throw errors;
601
+ }
602
+ return data.accountCreatePhoneToken;
603
+ }
604
+ });
605
+ return { ...queryResult };
606
+ }
607
+
608
+ // src/account/useCreatePhoneVerification.ts
609
+ var createPhoneVerification = gql(
610
+ /* GraphQL */
611
+ `
612
+ mutation CreatePhoneVerification {
613
+ accountCreatePhoneVerification {
614
+ expire
615
+ }
616
+ }
617
+ `
618
+ );
619
+ function useCreatePhoneVerification() {
620
+ const { graphql: graphql2 } = useAppwrite();
621
+ const queryResult = useMutation({
622
+ mutationFn: async () => {
623
+ const { data, errors } = await graphql2.mutation({
624
+ query: createPhoneVerification
625
+ });
626
+ if (errors) {
627
+ throw errors;
628
+ }
629
+ return data.accountCreatePhoneVerification;
630
+ }
631
+ });
632
+ return { ...queryResult };
633
+ }
634
+
635
+ // src/account/useCreateSession.ts
636
+ var createSession = gql(
637
+ /* GraphQL */
638
+ `
639
+ mutation CreateSession($userId: String!, $secret: String!) {
640
+ accountCreateSession(userId: $userId, secret: $secret) {
641
+ userId
642
+ expire
643
+ current
644
+ }
645
+ }
646
+ `
647
+ );
648
+ function useCreateSession() {
649
+ const { graphql: graphql2 } = useAppwrite();
650
+ const queryResult = useMutation({
651
+ mutationFn: async ({ userId, secret }) => {
652
+ const { data, errors } = await graphql2.mutation({
653
+ query: createSession,
654
+ variables: {
655
+ userId,
656
+ secret
657
+ }
658
+ });
659
+ if (errors) {
660
+ throw errors;
661
+ }
662
+ return data.accountCreateSession;
663
+ }
664
+ });
665
+ return { ...queryResult };
666
+ }
667
+
668
+ // src/account/useDeleteIdentity.ts
669
+ var accountDeleteIdentity = gql(
670
+ /* GraphQL */
671
+ `
672
+ mutation DeleteIdentity($identityId: String!) {
673
+ accountDeleteIdentity(identityId: $identityId) {
674
+ status
675
+ }
676
+ }
677
+ `
678
+ );
679
+ function useDeleteIdentity() {
680
+ const { graphql: graphql2 } = useAppwrite();
681
+ const queryResult = useMutation({
682
+ mutationFn: async ({ identityId }) => {
683
+ const { data, errors } = await graphql2.mutation({
684
+ query: accountDeleteIdentity,
685
+ variables: {
686
+ identityId
687
+ }
688
+ });
689
+ if (errors) {
690
+ throw errors;
691
+ }
692
+ return data.accountDeleteIdentity ?? { status: false };
693
+ }
694
+ });
695
+ return { ...queryResult };
696
+ }
697
+
698
+ // src/account/useDeleteMfaAuthenticator.ts
699
+ var updateMFAAuthenticator = gql(
700
+ /* GraphQL */
701
+ `
702
+ mutation DeleteMfaAuthenticator($type: String!, $otp: String!) {
703
+ accountDeleteMfaAuthenticator(type: $type, otp: $otp) {
704
+ mfa
705
+ }
706
+ }
707
+ `
708
+ );
709
+ function useDeleteMfaAuthenticator() {
710
+ const { graphql: graphql2 } = useAppwrite();
711
+ const queryResult = useMutation({
712
+ mutationFn: async ({ type = "totp", otp }) => {
713
+ const { data, errors } = await graphql2.mutation({
714
+ query: updateMFAAuthenticator,
715
+ variables: {
716
+ type,
717
+ otp
718
+ }
719
+ });
720
+ if (errors) {
721
+ throw errors;
722
+ }
723
+ return data.accountDeleteMfaAuthenticator;
724
+ }
725
+ });
726
+ return { ...queryResult };
727
+ }
728
+
729
+ // src/account/useDeleteSession.ts
730
+ var deleteSession = gql(
731
+ /* GraphQL */
732
+ `
733
+ mutation DeleteSession($sessionId: String!) {
734
+ accountDeleteSession(sessionId: $sessionId) {
735
+ status
736
+ }
737
+ }
738
+ `
739
+ );
740
+ function useDeleteSession() {
741
+ const { graphql: graphql2 } = useAppwrite();
742
+ const queryResult = useMutation({
743
+ mutationFn: async ({ sessionId }) => {
744
+ const { data, errors } = await graphql2.mutation({
745
+ query: deleteSession,
746
+ variables: {
747
+ sessionId
748
+ }
749
+ });
750
+ if (errors) {
751
+ throw errors;
752
+ }
753
+ return data.accountDeleteSession;
754
+ }
755
+ });
756
+ return { ...queryResult };
757
+ }
758
+
759
+ // src/account/useDeleteSessions.ts
760
+ var deleteSession2 = gql(
761
+ /* GraphQL */
762
+ `
763
+ mutation DeleteSession($sessionId: String!) {
764
+ accountDeleteSession(sessionId: $sessionId) {
765
+ status
766
+ }
767
+ }
768
+ `
769
+ );
770
+ function useDeleteSessions() {
771
+ const { graphql: graphql2 } = useAppwrite();
772
+ const queryResult = useMutation({
773
+ mutationFn: async ({ sessionId }) => {
774
+ const { data, errors } = await graphql2.mutation({
775
+ query: deleteSession2,
776
+ variables: {
777
+ sessionId
778
+ }
779
+ });
780
+ if (errors) {
781
+ throw errors;
782
+ }
783
+ return data.accountDeleteSession;
784
+ }
785
+ });
786
+ return { ...queryResult };
787
+ }
788
+
789
+ // src/account/useGetMfaRecoveryCodes.ts
790
+ var getMFARecoveryCodes = gql(
791
+ /* GraphQL */
792
+ `
793
+ query GetMfaRecoveryCodes {
794
+ accountGetMfaRecoveryCodes {
795
+ recoveryCodes
796
+ }
797
+ }
798
+ `
799
+ );
800
+ function useGetMfaRecoveryCodes() {
801
+ const { graphql: graphql2 } = useAppwrite();
802
+ const queryResult = useQuery({
803
+ queryKey: ["appwrite", "account", "mfa", "recovery-codes"],
804
+ queryFn: async () => {
805
+ const { data, errors } = await graphql2.query({
806
+ query: getMFARecoveryCodes
807
+ });
808
+ if (errors) {
809
+ throw errors;
810
+ }
811
+ return data.accountGetMfaRecoveryCodes;
812
+ }
813
+ });
814
+ return { ...queryResult };
815
+ }
816
+
817
+ // src/account/useGetPrefs.ts
818
+ var accountGetPrefs = gql(
819
+ /* GraphQL */
820
+ `
821
+ query GetPrefs {
822
+ accountGetPrefs {
823
+ data
824
+ }
825
+ }
826
+ `
827
+ );
828
+ function useGetPrefs() {
829
+ const { graphql: graphql2 } = useAppwrite();
830
+ const queryResult = useQuery({
831
+ queryKey: ["appwrite", "account", "prefs"],
832
+ queryFn: async () => {
833
+ const { data, errors } = await graphql2.query({
834
+ query: accountGetPrefs
835
+ });
836
+ if (errors) {
837
+ throw errors;
838
+ }
839
+ return data.accountGetPrefs;
840
+ }
841
+ });
842
+ return { ...queryResult };
843
+ }
844
+
845
+ // src/account/useGetSession.ts
846
+ var getSession = gql(
847
+ /* GraphQL */
848
+ `
849
+ query GetSession($sessionId: String!) {
850
+ accountGetSession(sessionId: $sessionId) {
851
+ userId
852
+ expire
853
+ current
854
+ }
855
+ }
856
+ `
857
+ );
858
+ function useGetSession({ sessionId }) {
859
+ const { graphql: graphql2 } = useAppwrite();
860
+ const queryResult = useQuery({
861
+ queryKey: ["appwrite", "account", "session", sessionId],
862
+ queryFn: async () => {
863
+ const { data, errors } = await graphql2.query({
864
+ query: getSession,
865
+ variables: { sessionId }
866
+ });
867
+ if (errors) {
868
+ throw errors;
869
+ }
870
+ return data.accountGetSession;
871
+ }
872
+ });
873
+ return queryResult;
874
+ }
875
+
876
+ // src/account/useListIdentities.ts
877
+ var accountListIdentities = gql(
878
+ /* GraphQL */
879
+ `
880
+ query ListIdentities($queries: [String!]) {
881
+ accountListIdentities(queries: $queries) {
882
+ total
883
+ identities {
884
+ ...Identity_ProviderFragment
885
+ }
886
+ }
887
+ }
888
+ `
889
+ );
890
+ function useListIdentities({ queries }) {
891
+ const { graphql: graphql2 } = useAppwrite();
892
+ const queryResult = useQuery({
893
+ queryKey: ["appwrite", "account", "identities", queries],
894
+ queryFn: async () => {
895
+ const { data, errors } = await graphql2.query({
896
+ query: accountListIdentities,
897
+ variables: {
898
+ queries
899
+ }
900
+ });
901
+ if (errors) {
902
+ throw errors;
903
+ }
904
+ return data.accountListIdentities;
905
+ }
906
+ });
907
+ return { ...queryResult };
908
+ }
909
+
910
+ // src/account/useListMfaFactors.ts
911
+ var listMFAFactors = gql(
912
+ /* GraphQL */
913
+ `
914
+ query ListMfaFactors {
915
+ accountListMfaFactors {
916
+ totp
917
+ phone
918
+ email
919
+ }
920
+ }
921
+ `
922
+ );
923
+ function useListMfaFactors() {
924
+ const { graphql: graphql2 } = useAppwrite();
925
+ const queryResult = useQuery({
926
+ queryKey: ["appwrite", "account", "mfa", "factors"],
927
+ queryFn: async () => {
928
+ const { data, errors } = await graphql2.query({
929
+ query: listMFAFactors
930
+ });
931
+ if (errors) {
932
+ throw errors;
933
+ }
934
+ return data.accountListMfaFactors;
935
+ }
936
+ });
937
+ return { ...queryResult };
938
+ }
939
+
940
+ // src/account/useListSessions.ts
941
+ var accountListSessions = gql(
942
+ /* GraphQL */
943
+ `
944
+ query ListSessions {
945
+ accountListSessions {
946
+ sessions {
947
+ _id
948
+ _createdAt
949
+ osName
950
+ clientName
951
+ }
952
+ }
953
+ }
954
+ `
955
+ );
956
+ function useListSessions() {
957
+ const { graphql: graphql2 } = useAppwrite();
958
+ const queryResult = useQuery({
959
+ queryKey: ["appwrite", "account", "sessions"],
960
+ queryFn: async () => {
961
+ const { data, errors } = await graphql2.query({
962
+ query: accountListSessions
963
+ });
964
+ if (errors) {
965
+ throw errors;
966
+ }
967
+ return data.accountListSessions;
968
+ }
969
+ });
970
+ return { ...queryResult };
971
+ }
972
+
973
+ // src/account/useLogin.ts
974
+ var accountCreateEmailPasswordSession = gql(
975
+ /* GraphQL */
976
+ `
977
+ mutation CreateEmailPasswordSession($email: String!, $password: String!) {
978
+ accountCreateEmailPasswordSession(email: $email, password: $password) {
979
+ userId
980
+ expire
981
+ current
982
+ }
983
+ }
984
+ `
985
+ );
986
+ function useLogin() {
987
+ const { account: account2, graphql: graphql2 } = useAppwrite();
988
+ const login = useMutation({
989
+ mutationFn: async ({ email, password }) => {
990
+ const { data, errors } = await graphql2.mutation({
991
+ query: accountCreateEmailPasswordSession,
992
+ variables: {
993
+ email,
994
+ password
995
+ }
996
+ });
997
+ if (errors) {
998
+ throw errors;
999
+ }
1000
+ return data.accountCreateEmailPasswordSession;
1001
+ }
1002
+ });
1003
+ const oAuthLogin = useMutation({
1004
+ mutationFn: async ({ provider, success, failure }) => {
1005
+ return account2.createOAuth2Session(provider, success, failure);
1006
+ }
1007
+ });
1008
+ return {
1009
+ login,
1010
+ oAuthLogin
1011
+ };
1012
+ }
1013
+
1014
+ // src/account/useLogout.ts
1015
+ var deleteSession3 = gql(
1016
+ /* GraphQL */
1017
+ `
1018
+ mutation DeleteSession($sessionId: String!) {
1019
+ accountDeleteSession(sessionId: $sessionId) {
1020
+ status
1021
+ }
1022
+ }
1023
+ `
1024
+ );
1025
+ function useLogout() {
1026
+ const { graphql: graphql2 } = useAppwrite();
1027
+ const queryClient2 = useQueryClient();
1028
+ const queryResult = useMutation({
1029
+ mutationFn: async ({ sessionId }) => {
1030
+ const { data, errors } = await graphql2.mutation({
1031
+ query: deleteSession3,
1032
+ variables: {
1033
+ sessionId
1034
+ }
1035
+ });
1036
+ if (errors) {
1037
+ throw errors;
1038
+ }
1039
+ return data?.accountDeleteSession;
1040
+ },
1041
+ onSuccess: async () => {
1042
+ queryClient2.setQueryData(["appwrite"], null);
1043
+ queryClient2.removeQueries({ queryKey: ["appwrite"] });
1044
+ queryClient2.clear();
1045
+ }
1046
+ });
1047
+ return { ...queryResult, mutate: queryResult.mutate };
1048
+ }
1049
+
1050
+ // src/account/useLogs.ts
1051
+ var accountListLogs = gql(
1052
+ /* GraphQL */
1053
+ `
1054
+ query ListLogs($queries: [String!]) {
1055
+ accountListLogs(queries: $queries) {
1056
+ total
1057
+ logs {
1058
+ event
1059
+ userId
1060
+ userEmail
1061
+ userName
1062
+ mode
1063
+ ip
1064
+ time
1065
+ osCode
1066
+ osName
1067
+ osVersion
1068
+ clientType
1069
+ clientCode
1070
+ clientName
1071
+ clientVersion
1072
+ clientEngine
1073
+ clientEngineVersion
1074
+ deviceName
1075
+ deviceBrand
1076
+ deviceModel
1077
+ countryCode
1078
+ countryName
1079
+ }
1080
+ }
1081
+ }
1082
+ `
1083
+ );
1084
+ function useLogs({ queries }) {
1085
+ const { graphql: graphql2 } = useAppwrite();
1086
+ const queryResult = useQuery({
1087
+ queryKey: ["appwrite", "account", "logs", queries],
1088
+ queryFn: async () => {
1089
+ const { data, errors } = await graphql2.query({
1090
+ query: accountListLogs,
1091
+ variables: {
1092
+ queries
1093
+ }
1094
+ });
1095
+ if (errors) {
1096
+ throw errors;
1097
+ }
1098
+ return data.accountListLogs;
1099
+ }
1100
+ });
1101
+ return { ...queryResult };
1102
+ }
1103
+
1104
+ // src/account/usePasswordRecovery.ts
1105
+ var createRecovery = gql(
1106
+ /* GraphQL */
1107
+ `
1108
+ mutation CreateRecovery($email: String!, $url: String!) {
1109
+ accountCreateRecovery(email: $email, url: $url) {
1110
+ expire
1111
+ }
1112
+ }
1113
+ `
1114
+ );
1115
+ function usePasswordRecovery() {
1116
+ const { graphql: graphql2 } = useAppwrite();
1117
+ const queryResult = useMutation({
1118
+ mutationFn: async ({ email, url: resetUrl }) => {
1119
+ const { data, errors } = await graphql2.mutation({
1120
+ query: createRecovery,
1121
+ variables: {
1122
+ email,
1123
+ url: resetUrl
1124
+ }
1125
+ });
1126
+ if (errors) {
1127
+ throw errors;
1128
+ }
1129
+ return data.accountCreateRecovery;
1130
+ },
1131
+ onSuccess: async (_, variables) => {
1132
+ localStorage.setItem("email", variables.email);
1133
+ }
1134
+ });
1135
+ return { ...queryResult };
1136
+ }
1137
+
1138
+ // src/account/useResetPassword.ts
1139
+ var updateRecovery = gql(
1140
+ /* GraphQL */
1141
+ `
1142
+ mutation UpdateRecovery(
1143
+ $userId: String!
1144
+ $secret: String!
1145
+ $password: String!
1146
+ $passwordAgain: String!
1147
+ ) {
1148
+ accountUpdateRecovery(
1149
+ userId: $userId
1150
+ secret: $secret
1151
+ password: $password
1152
+ passwordAgain: $passwordAgain
1153
+ ) {
1154
+ expire
1155
+ }
1156
+ }
1157
+ `
1158
+ );
1159
+ function useResetPassword() {
1160
+ const { graphql: graphql2 } = useAppwrite();
1161
+ const queryResult = useMutation({
1162
+ mutationFn: async ({ userId, secret, password, passwordAgain: confirmPassword }) => {
1163
+ const { data, errors } = await graphql2.mutation({
1164
+ query: updateRecovery,
1165
+ variables: {
1166
+ userId,
1167
+ secret,
1168
+ password,
1169
+ passwordAgain: confirmPassword
1170
+ }
1171
+ });
1172
+ if (errors) {
1173
+ throw errors;
1174
+ }
1175
+ return data.accountUpdateRecovery ?? {};
1176
+ }
1177
+ });
1178
+ return { ...queryResult };
1179
+ }
1180
+
1181
+ // src/account/useSignUp.ts
1182
+ var import_appwrite2 = require("appwrite");
1183
+ var createAccount = gql(
1184
+ /* GraphQL */
1185
+ `
1186
+ mutation CreateAccount($userId: String!, $name: String, $email: String!, $password: String!) {
1187
+ accountCreate(userId: $userId, name: $name, email: $email, password: $password) {
1188
+ name
1189
+ email
1190
+ }
1191
+ }
1192
+ `
1193
+ );
1194
+ var verify = gql(
1195
+ /* GraphQL */
1196
+ `
1197
+ mutation VerifyEmail($url: String!) {
1198
+ accountCreateVerification(url: $url) {
1199
+ expire
1200
+ }
1201
+ }
1202
+ `
1203
+ );
1204
+ function useSignUp() {
1205
+ const { graphql: graphql2 } = useAppwrite();
1206
+ const signUp = useMutation({
1207
+ mutationFn: async ({ userId, email, password, name }) => {
1208
+ const { data, errors } = await graphql2.mutation({
1209
+ query: createAccount,
1210
+ variables: {
1211
+ userId: userId ?? import_appwrite2.ID.unique(),
1212
+ name,
1213
+ email,
1214
+ password
1215
+ }
1216
+ });
1217
+ if (errors) {
1218
+ throw errors;
1219
+ }
1220
+ return data.accountCreate;
1221
+ }
1222
+ });
1223
+ const verifyEmail = useMutation({
1224
+ mutationFn: async ({ verifyUrl }) => {
1225
+ const { data, errors } = await graphql2.mutation({
1226
+ query: verify,
1227
+ variables: {
1228
+ url: verifyUrl
1229
+ }
1230
+ });
1231
+ if (errors) {
1232
+ throw errors;
1233
+ }
1234
+ return data.accountCreateVerification;
1235
+ }
1236
+ });
1237
+ return { signUp, verifyEmail };
1238
+ }
1239
+
1240
+ // src/account/useUpdateEmail.ts
1241
+ var accountUpdateEmail = gql(
1242
+ /* GraphQL */
1243
+ `
1244
+ mutation UpdateEmail($email: String!, $password: String!) {
1245
+ accountUpdateEmail(email: $email, password: $password) {
1246
+ name
1247
+ email
1248
+ }
1249
+ }
1250
+ `
1251
+ );
1252
+ function useUpdateEmail() {
1253
+ const { graphql: graphql2 } = useAppwrite();
1254
+ const queryResult = useMutation({
1255
+ mutationFn: async ({ email, password }) => {
1256
+ const { data, errors } = await graphql2.mutation({
1257
+ query: accountUpdateEmail,
1258
+ variables: {
1259
+ email,
1260
+ password
1261
+ }
1262
+ });
1263
+ if (errors) {
1264
+ throw errors;
1265
+ }
1266
+ return data.accountUpdateEmail;
1267
+ }
1268
+ });
1269
+ return { ...queryResult };
1270
+ }
1271
+
1272
+ // src/account/useUpdateMagicURLSession.ts
1273
+ var updateMagicURLSession = gql(
1274
+ /* GraphQL */
1275
+ `
1276
+ mutation UpdateMagicURLSession($userId: String!, $secret: String!) {
1277
+ accountUpdateMagicURLSession(userId: $userId, secret: $secret) {
1278
+ userId
1279
+ expire
1280
+ current
1281
+ }
1282
+ }
1283
+ `
1284
+ );
1285
+ function useUpdateMagicURLSession() {
1286
+ const { graphql: graphql2 } = useAppwrite();
1287
+ const queryResult = useMutation({
1288
+ mutationFn: async ({ userId, secret }) => {
1289
+ const { data, errors } = await graphql2.mutation({
1290
+ query: updateMagicURLSession,
1291
+ variables: {
1292
+ userId,
1293
+ secret
1294
+ }
1295
+ });
1296
+ if (errors) {
1297
+ throw errors;
1298
+ }
1299
+ return data.accountUpdateMagicURLSession;
1300
+ }
1301
+ });
1302
+ return { ...queryResult };
1303
+ }
1304
+
1305
+ // src/account/useUpdateMfa.ts
1306
+ var accountUpdateMFA = gql(
1307
+ /* GraphQL */
1308
+ `
1309
+ mutation UpdateMFA($mfa: Boolean!) {
1310
+ accountUpdateMFA(mfa: $mfa) {
1311
+ mfa
1312
+ }
1313
+ }
1314
+ `
1315
+ );
1316
+ function useUpdateMfa() {
1317
+ const { graphql: graphql2 } = useAppwrite();
1318
+ const queryResult = useMutation({
1319
+ mutationFn: async ({ mfa }) => {
1320
+ const { data, errors } = await graphql2.mutation({
1321
+ query: accountUpdateMFA,
1322
+ variables: {
1323
+ mfa
1324
+ }
1325
+ });
1326
+ if (errors) {
1327
+ throw errors;
1328
+ }
1329
+ return data.accountUpdateMFA;
1330
+ }
1331
+ });
1332
+ return { ...queryResult };
1333
+ }
1334
+
1335
+ // src/account/useUpdateMfaAuthenticator.ts
1336
+ var updateMFAAuthenticator2 = gql(
1337
+ /* GraphQL */
1338
+ `
1339
+ mutation UpdateMfaAuthenticator($type: String!, $otp: String!) {
1340
+ accountUpdateMfaAuthenticator(type: $type, otp: $otp) {
1341
+ mfa
1342
+ }
1343
+ }
1344
+ `
1345
+ );
1346
+ function useUpdateMfaAuthenticator() {
1347
+ const { graphql: graphql2 } = useAppwrite();
1348
+ const queryResult = useMutation({
1349
+ mutationFn: async ({ type = "totp", otp }) => {
1350
+ const { data, errors } = await graphql2.mutation({
1351
+ query: updateMFAAuthenticator2,
1352
+ variables: {
1353
+ type,
1354
+ otp
1355
+ }
1356
+ });
1357
+ if (errors) {
1358
+ throw errors;
1359
+ }
1360
+ return data.accountUpdateMfaAuthenticator;
1361
+ }
1362
+ });
1363
+ return { ...queryResult };
1364
+ }
1365
+
1366
+ // src/account/useUpdateMfaChallenge.ts
1367
+ var accountUpdateMfaChallenge = gql(
1368
+ /* GraphQL */
1369
+ `
1370
+ mutation UpdateMfaChallenge($challengeId: String!, $otp: String!) {
1371
+ accountUpdateMfaChallenge(challengeId: $challengeId, otp: $otp) {
1372
+ status
1373
+ }
1374
+ }
1375
+ `
1376
+ );
1377
+ function useUpdateMfaChallenge() {
1378
+ const { graphql: graphql2 } = useAppwrite();
1379
+ const queryResult = useMutation({
1380
+ mutationFn: async ({ challengeId, otp }) => {
1381
+ const { data, errors } = await graphql2.mutation({
1382
+ query: accountUpdateMfaChallenge,
1383
+ variables: {
1384
+ challengeId,
1385
+ otp
1386
+ }
1387
+ });
1388
+ if (errors) {
1389
+ throw errors;
1390
+ }
1391
+ return data.accountUpdateMfaChallenge;
1392
+ }
1393
+ });
1394
+ return { ...queryResult };
1395
+ }
1396
+
1397
+ // src/account/useUpdateMfaRecoveryCodes.ts
1398
+ var accountUpdateMfaRecoveryCodes = gql(
1399
+ /* GraphQL */
1400
+ `
1401
+ mutation UpdateMfaRecoveryCodes {
1402
+ accountUpdateMfaRecoveryCodes {
1403
+ recoveryCodes
1404
+ }
1405
+ }
1406
+ `
1407
+ );
1408
+ function useUpdateMfaRecoveryCodes() {
1409
+ const { graphql: graphql2 } = useAppwrite();
1410
+ const queryResult = useMutation({
1411
+ mutationFn: async () => {
1412
+ const { data, errors } = await graphql2.mutation({
1413
+ query: accountUpdateMfaRecoveryCodes
1414
+ });
1415
+ if (errors) {
1416
+ throw errors;
1417
+ }
1418
+ return data.accountUpdateMfaRecoveryCodes;
1419
+ }
1420
+ });
1421
+ return { ...queryResult };
1422
+ }
1423
+
1424
+ // src/account/useUpdateName.ts
1425
+ var accountUpdateName = gql(
1426
+ /* GraphQL */
1427
+ `
1428
+ mutation UpdateName($name: String!) {
1429
+ accountUpdateName(name: $name) {
1430
+ name
1431
+ }
1432
+ }
1433
+ `
1434
+ );
1435
+ function useUpdateName() {
1436
+ const { graphql: graphql2 } = useAppwrite();
1437
+ const queryResult = useMutation({
1438
+ mutationFn: async ({ name }) => {
1439
+ const { data: mutationData, errors } = await graphql2.mutation({
1440
+ query: accountUpdateName,
1441
+ variables: {
1442
+ name
1443
+ }
1444
+ });
1445
+ if (errors) {
1446
+ throw errors;
1447
+ }
1448
+ return mutationData.accountUpdateName;
1449
+ }
1450
+ });
1451
+ return { ...queryResult };
319
1452
  }
320
1453
 
321
- // src/account/useLogout.ts
322
- var deleteSession = gql(
1454
+ // src/account/useUpdatePassword.ts
1455
+ var updatePassword = gql(
323
1456
  /* GraphQL */
324
1457
  `
325
- mutation DeleteSession($sessionId: String!) {
326
- accountDeleteSession(sessionId: $sessionId) {
1458
+ mutation UpdatePassword($password: String!, $oldPassword: String!) {
1459
+ accountUpdatePassword(password: $password, oldPassword: $oldPassword) {
327
1460
  status
328
1461
  }
329
1462
  }
330
1463
  `
331
1464
  );
332
- function useLogout() {
1465
+ function useUpdatePassword() {
333
1466
  const { graphql: graphql2 } = useAppwrite();
334
- const queryClient2 = useQueryClient();
335
- const logout = useMutation({
336
- mutationFn: () => {
337
- return graphql2.mutation({
338
- query: deleteSession,
1467
+ const queryResult = useMutation({
1468
+ mutationFn: async ({ password, oldPassword }) => {
1469
+ const { data, errors } = await graphql2.mutation({
1470
+ query: updatePassword,
339
1471
  variables: {
340
- sessionId: "current"
1472
+ password,
1473
+ oldPassword
341
1474
  }
342
1475
  });
343
- },
344
- onSuccess: async () => {
345
- queryClient2.setQueryData(["appwrite", "account"], null);
346
- queryClient2.removeQueries({ queryKey: ["appwrite", "account"] });
1476
+ if (errors) {
1477
+ throw errors;
1478
+ }
1479
+ return data.accountUpdatePassword;
347
1480
  }
348
1481
  });
349
- return logout;
1482
+ return { ...queryResult };
350
1483
  }
351
1484
 
352
- // src/account/usePasswordRecovery.ts
353
- var createRecovery = gql(
1485
+ // src/account/useUpdatePhone.ts
1486
+ var accountUpdatePhone = gql(
354
1487
  /* GraphQL */
355
1488
  `
356
- mutation CreateRecovery($email: String!, $url: String!) {
357
- accountCreateRecovery(email: $email, url: $url) {
358
- expire
1489
+ mutation UpdatePhone($phone: String!, $password: String!) {
1490
+ accountUpdatePhone(phone: $phone, password: $password) {
1491
+ phone
359
1492
  }
360
1493
  }
361
1494
  `
362
1495
  );
363
- function usePasswordRecovery() {
1496
+ function useUpdatePhone() {
364
1497
  const { graphql: graphql2 } = useAppwrite();
365
- const passwordRecovery = useMutation({
366
- mutationFn: async ({ email, resetUrl }) => {
1498
+ const queryResult = useMutation({
1499
+ mutationFn: async ({ phone, password }) => {
367
1500
  const { data, errors } = await graphql2.mutation({
368
- query: createRecovery,
1501
+ query: accountUpdatePhone,
369
1502
  variables: {
370
- email,
371
- url: resetUrl
1503
+ phone,
1504
+ password
372
1505
  }
373
1506
  });
374
1507
  if (errors) {
375
1508
  throw errors;
376
1509
  }
377
- return data.accountCreateRecovery ?? {};
378
- },
379
- onSuccess: async (_, variables) => {
380
- localStorage.setItem("email", variables.email);
1510
+ return data.accountUpdatePhone;
381
1511
  }
382
1512
  });
383
- return passwordRecovery;
1513
+ return { ...queryResult };
384
1514
  }
385
1515
 
386
- // src/account/useResetPassword.ts
387
- var updateRecovery = gql(
1516
+ // src/account/useUpdatePhoneSession.ts
1517
+ var updatePhoneSession = gql(
388
1518
  /* GraphQL */
389
1519
  `
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
- ) {
1520
+ mutation UpdatePhoneSession($userId: String!, $secret: String!) {
1521
+ accountUpdatePhoneSession(userId: $userId, secret: $secret) {
1522
+ userId
402
1523
  expire
1524
+ current
403
1525
  }
404
1526
  }
405
1527
  `
406
1528
  );
407
- function useResetPassword() {
1529
+ function useUpdatePhoneSession() {
408
1530
  const { graphql: graphql2 } = useAppwrite();
409
- const passwordReset = useMutation({
410
- mutationFn: async ({ userId, secret, password, confirmPassword }) => {
1531
+ const queryResult = useMutation({
1532
+ mutationFn: async ({ userId, secret }) => {
411
1533
  const { data, errors } = await graphql2.mutation({
412
- query: updateRecovery,
1534
+ query: updatePhoneSession,
413
1535
  variables: {
414
1536
  userId,
415
- secret,
416
- password,
417
- passwordAgain: confirmPassword
1537
+ secret
418
1538
  }
419
1539
  });
420
1540
  if (errors) {
421
1541
  throw errors;
422
1542
  }
423
- return data.accountUpdateRecovery ?? {};
1543
+ return data.accountUpdatePhoneSession;
424
1544
  }
425
1545
  });
426
- return passwordReset;
1546
+ return { ...queryResult };
427
1547
  }
428
1548
 
429
- // src/account/useSignUp.ts
430
- var import_appwrite2 = require("appwrite");
431
- var createAccount = gql(
1549
+ // src/account/useUpdatePhoneVerification.ts
1550
+ var updatePhoneVerification = gql(
432
1551
  /* GraphQL */
433
1552
  `
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
1553
+ mutation UpdatePhoneVerification($userId: String!, $secret: String!) {
1554
+ accountUpdatePhoneVerification(userId: $userId, secret: $secret) {
1555
+ expire
438
1556
  }
439
1557
  }
440
1558
  `
441
1559
  );
442
- var verify = gql(
1560
+ function useUpdatePhoneVerification() {
1561
+ const { graphql: graphql2 } = useAppwrite();
1562
+ const queryResult = useMutation({
1563
+ mutationFn: async ({ userId, secret }) => {
1564
+ const { data, errors } = await graphql2.mutation({
1565
+ query: updatePhoneVerification,
1566
+ variables: {
1567
+ userId,
1568
+ secret
1569
+ }
1570
+ });
1571
+ if (errors) {
1572
+ throw errors;
1573
+ }
1574
+ return data.accountUpdatePhoneVerification;
1575
+ }
1576
+ });
1577
+ return { ...queryResult };
1578
+ }
1579
+
1580
+ // src/account/useUpdatePrefs.ts
1581
+ var accountUpdatePrefs = gql(
443
1582
  /* GraphQL */
444
1583
  `
445
- mutation VerifyEmail($url: String!) {
446
- accountCreateVerification(url: $url) {
447
- expire
1584
+ mutation UpdatePrefs($prefs: JSON!) {
1585
+ accountUpdatePrefs(prefs: $prefs) {
1586
+ prefs {
1587
+ data
1588
+ }
448
1589
  }
449
1590
  }
450
1591
  `
451
1592
  );
452
- function useSignUp() {
1593
+ function useUpdatePrefs() {
453
1594
  const { graphql: graphql2 } = useAppwrite();
454
- const signUp = useMutation({
455
- mutationFn: async ({ userId, email, password, name }) => {
1595
+ const queryResult = useMutation({
1596
+ mutationFn: async ({ prefs }) => {
456
1597
  const { data, errors } = await graphql2.mutation({
457
- query: createAccount,
1598
+ query: accountUpdatePrefs,
458
1599
  variables: {
459
- userId: userId ?? import_appwrite2.ID.unique(),
460
- name,
461
- email,
462
- password
1600
+ prefs
463
1601
  }
464
1602
  });
465
1603
  if (errors) {
466
1604
  throw errors;
467
1605
  }
468
- return data.accountCreate ?? {};
1606
+ return data.accountUpdatePrefs;
469
1607
  }
470
1608
  });
471
- const verifyEmail = useMutation({
472
- mutationFn: async ({ verifyUrl }) => {
1609
+ return { ...queryResult };
1610
+ }
1611
+
1612
+ // src/account/useUpdateSession.ts
1613
+ var updateSession = gql(
1614
+ /* GraphQL */
1615
+ `
1616
+ mutation UpdateSession($sessionId: String!) {
1617
+ accountUpdateSession(sessionId: $sessionId) {
1618
+ userId
1619
+ expire
1620
+ current
1621
+ }
1622
+ }
1623
+ `
1624
+ );
1625
+ function useUpdateSession() {
1626
+ const { graphql: graphql2 } = useAppwrite();
1627
+ const queryResult = useMutation({
1628
+ mutationFn: async ({ sessionId }) => {
473
1629
  const { data, errors } = await graphql2.mutation({
474
- query: verify,
1630
+ query: updateSession,
475
1631
  variables: {
476
- url: verifyUrl
1632
+ sessionId
477
1633
  }
478
1634
  });
479
1635
  if (errors) {
480
1636
  throw errors;
481
1637
  }
482
- return data.accountCreateVerification ?? {};
1638
+ return data.accountUpdateSession;
483
1639
  }
484
1640
  });
485
- return { signUp, verifyEmail };
1641
+ return { ...queryResult };
486
1642
  }
487
1643
 
488
1644
  // src/account/useVerification.ts
@@ -499,7 +1655,7 @@ var updateVerification = gql(
499
1655
  function useVerification() {
500
1656
  const { graphql: graphql2 } = useAppwrite();
501
1657
  const queryClient2 = useQueryClient();
502
- const verify2 = useMutation({
1658
+ const queryResult = useMutation({
503
1659
  mutationFn: async ({ userId, secret }) => {
504
1660
  if (!userId || !secret) {
505
1661
  throw new Error("Missing userId or secret");
@@ -520,7 +1676,7 @@ function useVerification() {
520
1676
  queryClient2.setQueryData(["appwrite", "account"], null);
521
1677
  }
522
1678
  });
523
- return verify2;
1679
+ return { ...queryResult };
524
1680
  }
525
1681
 
526
1682
  // src/databases/useCollection.ts
@@ -546,8 +1702,7 @@ var listDocuments = gql(
546
1702
  function useCollection({
547
1703
  databaseId,
548
1704
  collectionId,
549
- queries,
550
- options
1705
+ queries
551
1706
  }) {
552
1707
  const { graphql: graphql2 } = useAppwrite();
553
1708
  const queryClient2 = useQueryClient();
@@ -573,8 +1728,68 @@ function useCollection({
573
1728
  total: data.databasesListDocuments?.total ?? 0,
574
1729
  documents: documents2
575
1730
  };
576
- },
577
- ...options
1731
+ }
1732
+ });
1733
+ (0, import_react3.useEffect)(() => {
1734
+ const unsubscribe = graphql2.client.subscribe(
1735
+ `databases.${databaseId}.collections.${collectionId}.documents`,
1736
+ (response) => {
1737
+ const [, operation] = response.events[0].match(/\.(\w+)$/);
1738
+ const document = response.payload;
1739
+ switch (operation) {
1740
+ case "create":
1741
+ case "update":
1742
+ case "delete":
1743
+ queryClient2.setQueryData(
1744
+ ["appwrite", "databases", databaseId, collectionId, "documents", document.$id],
1745
+ document
1746
+ );
1747
+ queryClient2.invalidateQueries({
1748
+ queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1749
+ exact: true
1750
+ });
1751
+ break;
1752
+ }
1753
+ }
1754
+ );
1755
+ return unsubscribe;
1756
+ }, [databaseId, collectionId, graphql2.client, queryClient2, queries]);
1757
+ return {
1758
+ ...collection,
1759
+ documents: collection.data?.documents,
1760
+ total: collection.data?.total
1761
+ };
1762
+ }
1763
+ function useSuspenseCollection({
1764
+ databaseId,
1765
+ collectionId,
1766
+ queries
1767
+ }) {
1768
+ const { graphql: graphql2 } = useAppwrite();
1769
+ const queryClient2 = useQueryClient();
1770
+ const collection = useSuspenseQuery({
1771
+ queryKey: ["appwrite", "databases", databaseId, collectionId, { queries }],
1772
+ queryFn: async () => {
1773
+ const { data, errors } = await graphql2.query({
1774
+ query: listDocuments,
1775
+ variables: {
1776
+ databaseId,
1777
+ collectionId,
1778
+ queries
1779
+ }
1780
+ });
1781
+ if (errors) {
1782
+ throw errors;
1783
+ }
1784
+ const documents2 = data.databasesListDocuments?.documents?.map((document) => ({
1785
+ ...document,
1786
+ ...document ? JSON.parse(document.data) : {}
1787
+ })) ?? [];
1788
+ return {
1789
+ total: data.databasesListDocuments?.total ?? 0,
1790
+ documents: documents2
1791
+ };
1792
+ }
578
1793
  });
579
1794
  (0, import_react3.useEffect)(() => {
580
1795
  const unsubscribe = graphql2.client.subscribe(
@@ -630,11 +1845,10 @@ var createDocument = gql(
630
1845
  }
631
1846
  `
632
1847
  );
633
- function useCreateDocument(databaseId, collectionId, documentId, data, permissions, options) {
1848
+ function useCreateDocument() {
634
1849
  const { graphql: graphql2 } = useAppwrite();
635
1850
  const mutationResult = useMutation({
636
- mutationKey: ["appwrite", "databases", databaseId, collectionId, "documents", documentId],
637
- mutationFn: async () => {
1851
+ mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
638
1852
  const { data: mutationData, errors } = await graphql2.mutation({
639
1853
  query: createDocument,
640
1854
  variables: {
@@ -648,13 +1862,72 @@ function useCreateDocument(databaseId, collectionId, documentId, data, permissio
648
1862
  if (errors) {
649
1863
  throw errors;
650
1864
  }
651
- return mutationData.databasesCreateDocument?._id;
652
- },
653
- ...options
1865
+ return mutationData.databasesCreateDocument;
1866
+ }
654
1867
  });
655
1868
  return mutationResult;
656
1869
  }
657
1870
 
1871
+ // src/databases/useDeleteDocument.ts
1872
+ var deleteDocument = gql(
1873
+ /* GraphQL */
1874
+ `
1875
+ mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {
1876
+ databasesDeleteDocument(
1877
+ databaseId: $databaseId
1878
+ collectionId: $collectionId
1879
+ documentId: $documentId
1880
+ ) {
1881
+ status
1882
+ }
1883
+ }
1884
+ `
1885
+ );
1886
+ function useDeleteDocument() {
1887
+ const { graphql: graphql2 } = useAppwrite();
1888
+ const queryClient2 = useQueryClient();
1889
+ const mutationResult = useMutation({
1890
+ mutationFn: async ({ databaseId, collectionId, documentId }) => {
1891
+ const { data: mutationData, errors } = await graphql2.mutation({
1892
+ query: deleteDocument,
1893
+ variables: {
1894
+ databaseId,
1895
+ collectionId,
1896
+ documentId
1897
+ }
1898
+ });
1899
+ if (errors) {
1900
+ throw errors;
1901
+ }
1902
+ return mutationData.databasesDeleteDocument;
1903
+ },
1904
+ onSuccess: async (_, variables) => {
1905
+ queryClient2.setQueryData(
1906
+ [
1907
+ "appwrite",
1908
+ "databases",
1909
+ variables.databaseId,
1910
+ variables.collectionId,
1911
+ "documents",
1912
+ variables.documentId
1913
+ ],
1914
+ null
1915
+ );
1916
+ queryClient2.removeQueries({
1917
+ queryKey: [
1918
+ "appwrite",
1919
+ "databases",
1920
+ variables.databaseId,
1921
+ variables.collectionId,
1922
+ "documents",
1923
+ variables.documentId
1924
+ ]
1925
+ });
1926
+ }
1927
+ });
1928
+ return { ...mutationResult };
1929
+ }
1930
+
658
1931
  // src/databases/useDocument.ts
659
1932
  var import_react4 = require("react");
660
1933
  var getDocument = gql(
@@ -672,7 +1945,11 @@ var getDocument = gql(
672
1945
  }
673
1946
  `
674
1947
  );
675
- function useDocument(databaseId, collectionId, documentId, options) {
1948
+ function useDocument({
1949
+ databaseId,
1950
+ collectionId,
1951
+ documentId
1952
+ }) {
676
1953
  const { graphql: graphql2 } = useAppwrite();
677
1954
  const queryClient2 = useQueryClient();
678
1955
  const queryResult = useQuery({
@@ -694,8 +1971,7 @@ function useDocument(databaseId, collectionId, documentId, options) {
694
1971
  ...data.databasesGetDocument ? JSON.parse(data.databasesGetDocument.data) : {}
695
1972
  };
696
1973
  return document;
697
- },
698
- ...options
1974
+ }
699
1975
  });
700
1976
  (0, import_react4.useEffect)(() => {
701
1977
  const unsubscribe = graphql2.client.subscribe(
@@ -709,7 +1985,63 @@ function useDocument(databaseId, collectionId, documentId, options) {
709
1985
  );
710
1986
  return unsubscribe;
711
1987
  }, [databaseId, collectionId, documentId, graphql2.client, queryClient2]);
712
- return queryResult;
1988
+ return { ...queryResult };
1989
+ }
1990
+
1991
+ // src/databases/useUpdateDocument.ts
1992
+ var updateDocument = gql(
1993
+ /* GraphQL */
1994
+ `
1995
+ mutation UpdateDocument(
1996
+ $databaseId: String!
1997
+ $collectionId: String!
1998
+ $documentId: String!
1999
+ $data: JSON!
2000
+ $permissions: [String!]
2001
+ ) {
2002
+ databasesUpdateDocument(
2003
+ databaseId: $databaseId
2004
+ collectionId: $collectionId
2005
+ documentId: $documentId
2006
+ data: $data
2007
+ permissions: $permissions
2008
+ ) {
2009
+ _id
2010
+ _collectionId
2011
+ _databaseId
2012
+ _createdAt
2013
+ _updatedAt
2014
+ _permissions
2015
+ data
2016
+ }
2017
+ }
2018
+ `
2019
+ );
2020
+ function useUpdateDocument() {
2021
+ const { graphql: graphql2 } = useAppwrite();
2022
+ const mutationResult = useMutation({
2023
+ mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
2024
+ const { data: mutationData, errors } = await graphql2.mutation({
2025
+ query: updateDocument,
2026
+ variables: {
2027
+ databaseId,
2028
+ collectionId,
2029
+ documentId,
2030
+ data,
2031
+ permissions
2032
+ }
2033
+ });
2034
+ if (errors) {
2035
+ throw errors;
2036
+ }
2037
+ const document = {
2038
+ ...mutationData.databasesUpdateDocument,
2039
+ ...mutationData.databasesUpdateDocument ? JSON.parse(mutationData.databasesUpdateDocument.data) : {}
2040
+ };
2041
+ return document;
2042
+ }
2043
+ });
2044
+ return { ...mutationResult };
713
2045
  }
714
2046
 
715
2047
  // src/functions/useFunction.ts
@@ -836,10 +2168,20 @@ var Account_UserFragment = gql(
836
2168
  }
837
2169
  `
838
2170
  );
2171
+ var Identity_ProviderFragment = gql(
2172
+ /* GraphQL */
2173
+ `
2174
+ fragment Identity_ProviderFragment on Identity {
2175
+ userId
2176
+ provider
2177
+ }
2178
+ `
2179
+ );
839
2180
 
840
2181
  // src/index.ts
841
2182
  var fragments = {
842
- Account_UserFragment
2183
+ Account_UserFragment,
2184
+ Identity_ProviderFragment
843
2185
  };
844
2186
  // Annotate the CommonJS export names for ESM import in node:
845
2187
  0 && (module.exports = {
@@ -848,17 +2190,55 @@ var fragments = {
848
2190
  useAccount,
849
2191
  useAppwrite,
850
2192
  useCollection,
2193
+ useCreateAnonymousSession,
851
2194
  useCreateDocument,
2195
+ useCreateEmailToken,
2196
+ useCreateJWT,
2197
+ useCreateMagicURLToken,
2198
+ useCreateMfaAuthenticator,
2199
+ useCreateMfaChallenge,
2200
+ useCreateMfaRecoveryCodes,
2201
+ useCreatePhoneToken,
2202
+ useCreatePhoneVerification,
2203
+ useCreateSession,
2204
+ useDeleteDocument,
2205
+ useDeleteIdentity,
2206
+ useDeleteMfaAuthenticator,
2207
+ useDeleteSession,
2208
+ useDeleteSessions,
852
2209
  useDocument,
853
2210
  useFunction,
2211
+ useGetMfaRecoveryCodes,
2212
+ useGetPrefs,
2213
+ useGetSession,
2214
+ useListIdentities,
2215
+ useListMfaFactors,
2216
+ useListSessions,
854
2217
  useLogin,
855
2218
  useLogout,
2219
+ useLogs,
856
2220
  useMutation,
857
2221
  usePasswordRecovery,
858
2222
  useQuery,
859
2223
  useQueryClient,
860
2224
  useResetPassword,
861
2225
  useSignUp,
2226
+ useSuspenseCollection,
2227
+ useSuspenseCreateJWT,
2228
+ useUpdateDocument,
2229
+ useUpdateEmail,
2230
+ useUpdateMagicURLSession,
2231
+ useUpdateMfa,
2232
+ useUpdateMfaAuthenticator,
2233
+ useUpdateMfaChallenge,
2234
+ useUpdateMfaRecoveryCodes,
2235
+ useUpdateName,
2236
+ useUpdatePassword,
2237
+ useUpdatePhone,
2238
+ useUpdatePhoneSession,
2239
+ useUpdatePhoneVerification,
2240
+ useUpdatePrefs,
2241
+ useUpdateSession,
862
2242
  useVerification
863
2243
  });
864
2244
  //# sourceMappingURL=index.js.map