@zeroin.earth/appwrite-graphql 0.15.5 → 0.15.7

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