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