@zeroin.earth/appwrite-graphql 0.15.4 → 0.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +16 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -57,6 +57,7 @@ type Account_UserFragment = {
|
|
|
57
57
|
};
|
|
58
58
|
type Identity_ProviderFragment = {
|
|
59
59
|
__typename?: 'Identity';
|
|
60
|
+
_id?: string | null;
|
|
60
61
|
userId?: string | null;
|
|
61
62
|
provider?: string | null;
|
|
62
63
|
} & {
|
|
@@ -65,9 +66,6 @@ type Identity_ProviderFragment = {
|
|
|
65
66
|
type GetSessionQueryVariables = Exact<{
|
|
66
67
|
sessionId: Scalars['String']['input'];
|
|
67
68
|
}>;
|
|
68
|
-
type ListIdentitiesQueryVariables = Exact<{
|
|
69
|
-
queries?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
70
|
-
}>;
|
|
71
69
|
type ListLogsQueryVariables = Exact<{
|
|
72
70
|
queries?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
73
71
|
}>;
|
|
@@ -2109,7 +2107,7 @@ declare function useGetSession({ sessionId }: GetSessionQueryVariables): _tansta
|
|
|
2109
2107
|
current?: boolean;
|
|
2110
2108
|
}, AppwriteException>;
|
|
2111
2109
|
|
|
2112
|
-
declare function useListIdentities(
|
|
2110
|
+
declare function useListIdentities(): {
|
|
2113
2111
|
data: {
|
|
2114
2112
|
__typename?: "IdentityList";
|
|
2115
2113
|
total: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ type Account_UserFragment = {
|
|
|
57
57
|
};
|
|
58
58
|
type Identity_ProviderFragment = {
|
|
59
59
|
__typename?: 'Identity';
|
|
60
|
+
_id?: string | null;
|
|
60
61
|
userId?: string | null;
|
|
61
62
|
provider?: string | null;
|
|
62
63
|
} & {
|
|
@@ -65,9 +66,6 @@ type Identity_ProviderFragment = {
|
|
|
65
66
|
type GetSessionQueryVariables = Exact<{
|
|
66
67
|
sessionId: Scalars['String']['input'];
|
|
67
68
|
}>;
|
|
68
|
-
type ListIdentitiesQueryVariables = Exact<{
|
|
69
|
-
queries?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
70
|
-
}>;
|
|
71
69
|
type ListLogsQueryVariables = Exact<{
|
|
72
70
|
queries?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
73
71
|
}>;
|
|
@@ -2109,7 +2107,7 @@ declare function useGetSession({ sessionId }: GetSessionQueryVariables): _tansta
|
|
|
2109
2107
|
current?: boolean;
|
|
2110
2108
|
}, AppwriteException>;
|
|
2111
2109
|
|
|
2112
|
-
declare function useListIdentities(
|
|
2110
|
+
declare function useListIdentities(): {
|
|
2113
2111
|
data: {
|
|
2114
2112
|
__typename?: "IdentityList";
|
|
2115
2113
|
total: number;
|
package/dist/index.js
CHANGED
|
@@ -85,7 +85,7 @@ function getFragmentData(_documentNode, fragmentType) {
|
|
|
85
85
|
|
|
86
86
|
// src/__generated__/graphql.ts
|
|
87
87
|
var Account_UserFragmentDoc = { "kind": "Document", "definitions": [{ "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Account_User" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "User" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }, { "kind": "Field", "name": { "kind": "Name", "value": "prefs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "data" } }] } }] } }] };
|
|
88
|
-
var Identity_ProviderFragmentDoc = { "kind": "Document", "definitions": [{ "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Identity_Provider" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Identity" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }] } }] };
|
|
88
|
+
var Identity_ProviderFragmentDoc = { "kind": "Document", "definitions": [{ "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Identity_Provider" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Identity" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }] } }] };
|
|
89
89
|
var AccountGetDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "AccountGet" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountGet" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Account_User" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Account_User" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "User" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }, { "kind": "Field", "name": { "kind": "Name", "value": "prefs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "data" } }] } }] } }] };
|
|
90
90
|
var CreateAnonymousSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateAnonymousSession" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountCreateAnonymousSession" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expire" } }, { "kind": "Field", "name": { "kind": "Name", "value": "current" } }] } }] } }] };
|
|
91
91
|
var CreateEmailTokenDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateEmailToken" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "email" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "phrase" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountCreateEmailToken" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "userId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "email" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "email" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "phrase" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "phrase" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "expire" } }] } }] } }] };
|
|
@@ -104,7 +104,7 @@ var DeleteSessionsDocument = { "kind": "Document", "definitions": [{ "kind": "Op
|
|
|
104
104
|
var GetMfaRecoveryCodesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetMfaRecoveryCodes" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountGetMfaRecoveryCodes" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "recoveryCodes" } }] } }] } }] };
|
|
105
105
|
var GetPrefsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetPrefs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountGetPrefs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "data" } }] } }] } }] };
|
|
106
106
|
var GetSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountGetSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "sessionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expire" } }, { "kind": "Field", "name": { "kind": "Name", "value": "current" } }] } }] } }] };
|
|
107
|
-
var ListIdentitiesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListIdentities" }, "
|
|
107
|
+
var ListIdentitiesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListIdentities" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountListIdentities" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "total" } }, { "kind": "Field", "name": { "kind": "Name", "value": "identities" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Identity_Provider" } }] } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Identity_Provider" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Identity" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }] } }] };
|
|
108
108
|
var ListMfaFactorsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListMfaFactors" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountListMfaFactors" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "totp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "phone" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }] } }] };
|
|
109
109
|
var ListSessionsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListSessions" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountListSessions" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "sessions" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "_createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "osName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "clientName" } }] } }] } }] } }] };
|
|
110
110
|
var CreateEmailPasswordSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateEmailPasswordSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "email" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "password" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountCreateEmailPasswordSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "email" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "email" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "password" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "password" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expire" } }, { "kind": "Field", "name": { "kind": "Name", "value": "current" } }] } }] } }] };
|
|
@@ -138,7 +138,7 @@ var GetFunctionExecutionDocument = { "kind": "Document", "definitions": [{ "kind
|
|
|
138
138
|
// src/__generated__/gql.ts
|
|
139
139
|
var documents = {
|
|
140
140
|
"\n fragment Account_User on User {\n _id\n name\n email\n prefs {\n data\n }\n }\n": Account_UserFragmentDoc,
|
|
141
|
-
"\n fragment Identity_Provider on Identity {\n userId\n provider\n }\n": Identity_ProviderFragmentDoc,
|
|
141
|
+
"\n fragment Identity_Provider on Identity {\n _id\n userId\n provider\n }\n": Identity_ProviderFragmentDoc,
|
|
142
142
|
"\n query AccountGet {\n accountGet {\n ...Account_User\n }\n }\n": AccountGetDocument,
|
|
143
143
|
"\n mutation CreateAnonymousSession {\n accountCreateAnonymousSession {\n _id\n expire\n current\n }\n }\n": CreateAnonymousSessionDocument,
|
|
144
144
|
"\n mutation CreateEmailToken($userId: String!, $email: String!, $phrase: Boolean) {\n accountCreateEmailToken(userId: $userId, email: $email, phrase: $phrase) {\n expire\n }\n }\n": CreateEmailTokenDocument,
|
|
@@ -157,7 +157,7 @@ var documents = {
|
|
|
157
157
|
"\n query GetMfaRecoveryCodes {\n accountGetMfaRecoveryCodes {\n recoveryCodes\n }\n }\n": GetMfaRecoveryCodesDocument,
|
|
158
158
|
"\n query GetPrefs {\n accountGetPrefs {\n data\n }\n }\n": GetPrefsDocument,
|
|
159
159
|
"\n query GetSession($sessionId: String!) {\n accountGetSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": GetSessionDocument,
|
|
160
|
-
"\n query ListIdentities
|
|
160
|
+
"\n query ListIdentities {\n accountListIdentities {\n total\n identities {\n ...Identity_Provider\n }\n }\n }\n": ListIdentitiesDocument,
|
|
161
161
|
"\n query ListMfaFactors {\n accountListMfaFactors {\n totp\n phone\n email\n }\n }\n": ListMfaFactorsDocument,
|
|
162
162
|
"\n query ListSessions {\n accountListSessions {\n sessions {\n _id\n _createdAt\n osName\n clientName\n }\n }\n }\n": ListSessionsDocument,
|
|
163
163
|
"\n mutation CreateEmailPasswordSession($email: String!, $password: String!) {\n accountCreateEmailPasswordSession(email: $email, password: $password) {\n userId\n expire\n current\n }\n }\n": CreateEmailPasswordSessionDocument,
|
|
@@ -210,6 +210,7 @@ var Identity_Provider = gql(
|
|
|
210
210
|
/* GraphQL */
|
|
211
211
|
`
|
|
212
212
|
fragment Identity_Provider on Identity {
|
|
213
|
+
_id
|
|
213
214
|
userId
|
|
214
215
|
provider
|
|
215
216
|
}
|
|
@@ -716,7 +717,7 @@ function useDeleteIdentity() {
|
|
|
716
717
|
if (errors) {
|
|
717
718
|
throw errors;
|
|
718
719
|
}
|
|
719
|
-
return data
|
|
720
|
+
return data?.accountDeleteIdentity ?? { status: false };
|
|
720
721
|
}
|
|
721
722
|
});
|
|
722
723
|
return { ...queryResult };
|
|
@@ -777,7 +778,7 @@ function useDeleteSession() {
|
|
|
777
778
|
if (errors) {
|
|
778
779
|
throw errors;
|
|
779
780
|
}
|
|
780
|
-
return data
|
|
781
|
+
return data?.accountDeleteSession ?? { status: false };
|
|
781
782
|
}
|
|
782
783
|
});
|
|
783
784
|
return { ...queryResult };
|
|
@@ -804,7 +805,7 @@ function useDeleteSessions() {
|
|
|
804
805
|
if (errors) {
|
|
805
806
|
throw errors;
|
|
806
807
|
}
|
|
807
|
-
return data
|
|
808
|
+
return data?.accountDeleteSessions ?? { status: false };
|
|
808
809
|
}
|
|
809
810
|
});
|
|
810
811
|
return { ...queryResult };
|
|
@@ -901,8 +902,8 @@ function useGetSession({ sessionId }) {
|
|
|
901
902
|
var accountListIdentities = gql(
|
|
902
903
|
/* GraphQL */
|
|
903
904
|
`
|
|
904
|
-
query ListIdentities
|
|
905
|
-
accountListIdentities
|
|
905
|
+
query ListIdentities {
|
|
906
|
+
accountListIdentities {
|
|
906
907
|
total
|
|
907
908
|
identities {
|
|
908
909
|
...Identity_Provider
|
|
@@ -911,16 +912,13 @@ var accountListIdentities = gql(
|
|
|
911
912
|
}
|
|
912
913
|
`
|
|
913
914
|
);
|
|
914
|
-
function useListIdentities(
|
|
915
|
+
function useListIdentities() {
|
|
915
916
|
const { graphql: graphql2 } = useAppwrite();
|
|
916
917
|
const queryResult = useQuery({
|
|
917
|
-
queryKey: ["appwrite", "account", "identities"
|
|
918
|
+
queryKey: ["appwrite", "account", "identities"],
|
|
918
919
|
queryFn: async () => {
|
|
919
920
|
const { data, errors } = await graphql2.query({
|
|
920
|
-
query: accountListIdentities
|
|
921
|
-
variables: {
|
|
922
|
-
queries
|
|
923
|
-
}
|
|
921
|
+
query: accountListIdentities
|
|
924
922
|
});
|
|
925
923
|
if (errors) {
|
|
926
924
|
throw errors;
|
|
@@ -1060,7 +1058,7 @@ function useLogout() {
|
|
|
1060
1058
|
if (errors) {
|
|
1061
1059
|
throw errors;
|
|
1062
1060
|
}
|
|
1063
|
-
return data?.accountDeleteSession;
|
|
1061
|
+
return data?.accountDeleteSession ?? { status: false };
|
|
1064
1062
|
},
|
|
1065
1063
|
onSuccess: async () => {
|
|
1066
1064
|
queryClient2.setQueryData(["appwrite"], null);
|
|
@@ -1403,7 +1401,7 @@ function useUpdateMfaChallenge() {
|
|
|
1403
1401
|
if (errors) {
|
|
1404
1402
|
throw errors;
|
|
1405
1403
|
}
|
|
1406
|
-
return data
|
|
1404
|
+
return data?.accountUpdateMfaChallenge ?? { status: false };
|
|
1407
1405
|
}
|
|
1408
1406
|
});
|
|
1409
1407
|
return { ...queryResult };
|
|
@@ -1491,7 +1489,7 @@ function useUpdatePassword() {
|
|
|
1491
1489
|
if (errors) {
|
|
1492
1490
|
throw errors;
|
|
1493
1491
|
}
|
|
1494
|
-
return data
|
|
1492
|
+
return data?.accountUpdatePassword;
|
|
1495
1493
|
}
|
|
1496
1494
|
});
|
|
1497
1495
|
return { ...queryResult };
|