@zeroin.earth/appwrite-graphql 0.14.7 → 0.14.9
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 +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +88 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -5152,7 +5152,9 @@ declare function useVerification(): {
|
|
|
5152
5152
|
status: "idle";
|
|
5153
5153
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5154
5154
|
__typename?: "Token";
|
|
5155
|
+
secret?: string;
|
|
5155
5156
|
expire?: any;
|
|
5157
|
+
userId?: string;
|
|
5156
5158
|
}, AppwriteException, Exact<{
|
|
5157
5159
|
userId: string;
|
|
5158
5160
|
secret: string;
|
|
@@ -5165,7 +5167,9 @@ declare function useVerification(): {
|
|
|
5165
5167
|
submittedAt: number;
|
|
5166
5168
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5167
5169
|
__typename?: "Token";
|
|
5170
|
+
secret?: string;
|
|
5168
5171
|
expire?: any;
|
|
5172
|
+
userId?: string;
|
|
5169
5173
|
}, AppwriteException, Exact<{
|
|
5170
5174
|
userId: string;
|
|
5171
5175
|
secret: string;
|
|
@@ -5184,7 +5188,9 @@ declare function useVerification(): {
|
|
|
5184
5188
|
status: "pending";
|
|
5185
5189
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5186
5190
|
__typename?: "Token";
|
|
5191
|
+
secret?: string;
|
|
5187
5192
|
expire?: any;
|
|
5193
|
+
userId?: string;
|
|
5188
5194
|
}, AppwriteException, Exact<{
|
|
5189
5195
|
userId: string;
|
|
5190
5196
|
secret: string;
|
|
@@ -5197,7 +5203,9 @@ declare function useVerification(): {
|
|
|
5197
5203
|
submittedAt: number;
|
|
5198
5204
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5199
5205
|
__typename?: "Token";
|
|
5206
|
+
secret?: string;
|
|
5200
5207
|
expire?: any;
|
|
5208
|
+
userId?: string;
|
|
5201
5209
|
}, AppwriteException, Exact<{
|
|
5202
5210
|
userId: string;
|
|
5203
5211
|
secret: string;
|
|
@@ -5216,7 +5224,9 @@ declare function useVerification(): {
|
|
|
5216
5224
|
status: "error";
|
|
5217
5225
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5218
5226
|
__typename?: "Token";
|
|
5227
|
+
secret?: string;
|
|
5219
5228
|
expire?: any;
|
|
5229
|
+
userId?: string;
|
|
5220
5230
|
}, AppwriteException, Exact<{
|
|
5221
5231
|
userId: string;
|
|
5222
5232
|
secret: string;
|
|
@@ -5229,7 +5239,9 @@ declare function useVerification(): {
|
|
|
5229
5239
|
submittedAt: number;
|
|
5230
5240
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5231
5241
|
__typename?: "Token";
|
|
5242
|
+
secret?: string;
|
|
5232
5243
|
expire?: any;
|
|
5244
|
+
userId?: string;
|
|
5233
5245
|
}, AppwriteException, Exact<{
|
|
5234
5246
|
userId: string;
|
|
5235
5247
|
secret: string;
|
|
@@ -5237,7 +5249,9 @@ declare function useVerification(): {
|
|
|
5237
5249
|
} | {
|
|
5238
5250
|
data: {
|
|
5239
5251
|
__typename?: "Token";
|
|
5252
|
+
secret?: string;
|
|
5240
5253
|
expire?: any;
|
|
5254
|
+
userId?: string;
|
|
5241
5255
|
};
|
|
5242
5256
|
error: null;
|
|
5243
5257
|
variables: Exact<{
|
|
@@ -5251,7 +5265,9 @@ declare function useVerification(): {
|
|
|
5251
5265
|
status: "success";
|
|
5252
5266
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5253
5267
|
__typename?: "Token";
|
|
5268
|
+
secret?: string;
|
|
5254
5269
|
expire?: any;
|
|
5270
|
+
userId?: string;
|
|
5255
5271
|
}, AppwriteException, Exact<{
|
|
5256
5272
|
userId: string;
|
|
5257
5273
|
secret: string;
|
|
@@ -5264,7 +5280,9 @@ declare function useVerification(): {
|
|
|
5264
5280
|
submittedAt: number;
|
|
5265
5281
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5266
5282
|
__typename?: "Token";
|
|
5283
|
+
secret?: string;
|
|
5267
5284
|
expire?: any;
|
|
5285
|
+
userId?: string;
|
|
5268
5286
|
}, AppwriteException, Exact<{
|
|
5269
5287
|
userId: string;
|
|
5270
5288
|
secret: string;
|
|
@@ -5872,6 +5890,10 @@ declare function useFunction(): {
|
|
|
5872
5890
|
executeFunction: _tanstack_react_query.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
|
|
5873
5891
|
currentExecution: _tanstack_react_query.UseQueryResult<unknown, unknown>;
|
|
5874
5892
|
};
|
|
5893
|
+
declare function useSuspenseFunction({ functionId, body, async, path, method, }: Props): {
|
|
5894
|
+
executeFunction: _tanstack_react_query.UseSuspenseQueryResult<Record<string, unknown>, Error>;
|
|
5895
|
+
currentExecution: _tanstack_react_query.UseQueryResult<unknown, unknown>;
|
|
5896
|
+
};
|
|
5875
5897
|
|
|
5876
5898
|
type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{
|
|
5877
5899
|
' $fragmentName'?: infer TKey;
|
|
@@ -5890,4 +5912,4 @@ declare const fragments: {
|
|
|
5890
5912
|
Identity_ProviderFragment: _graphql_typed_document_node_core.TypedDocumentNode<Identity_ProviderFragmentFragment, unknown>;
|
|
5891
5913
|
};
|
|
5892
5914
|
|
|
5893
|
-
export { fragments, getFragmentData, useAccount, useAppwrite, useCollection, useCreateAnonymousSession, useCreateDocument, useCreateEmailToken, useCreateJWT, useCreateMagicURLToken, useCreateMfaAuthenticator, useCreateMfaChallenge, useCreateMfaRecoveryCodes, useCreatePhoneToken, useCreatePhoneVerification, useCreateSession, useDeleteDocument, useDeleteIdentity, useDeleteMfaAuthenticator, useDeleteSession, useDeleteSessions, useDocument, useFunction, useGetMfaRecoveryCodes, useGetPrefs, useGetSession, useListIdentities, useListMfaFactors, useListSessions, useLogin, useLogout, useLogs, useMutation, usePasswordRecovery, useQuery, useQueryClient, useResetPassword, useSignUp, useSuspenseCollection, useSuspenseCreateJWT, useUpdateDocument, useUpdateEmail, useUpdateMagicURLSession, useUpdateMfa, useUpdateMfaAuthenticator, useUpdateMfaChallenge, useUpdateMfaRecoveryCodes, useUpdateName, useUpdatePassword, useUpdatePhone, useUpdatePhoneSession, useUpdatePhoneVerification, useUpdatePrefs, useUpdateSession, useVerification };
|
|
5915
|
+
export { fragments, getFragmentData, useAccount, useAppwrite, useCollection, useCreateAnonymousSession, useCreateDocument, useCreateEmailToken, useCreateJWT, useCreateMagicURLToken, useCreateMfaAuthenticator, useCreateMfaChallenge, useCreateMfaRecoveryCodes, useCreatePhoneToken, useCreatePhoneVerification, useCreateSession, useDeleteDocument, useDeleteIdentity, useDeleteMfaAuthenticator, useDeleteSession, useDeleteSessions, useDocument, useFunction, useGetMfaRecoveryCodes, useGetPrefs, useGetSession, useListIdentities, useListMfaFactors, useListSessions, useLogin, useLogout, useLogs, useMutation, usePasswordRecovery, useQuery, useQueryClient, useResetPassword, useSignUp, useSuspenseCollection, useSuspenseCreateJWT, useSuspenseFunction, useUpdateDocument, useUpdateEmail, useUpdateMagicURLSession, useUpdateMfa, useUpdateMfaAuthenticator, useUpdateMfaChallenge, useUpdateMfaRecoveryCodes, useUpdateName, useUpdatePassword, useUpdatePhone, useUpdatePhoneSession, useUpdatePhoneVerification, useUpdatePrefs, useUpdateSession, useVerification };
|
package/dist/index.d.ts
CHANGED
|
@@ -5152,7 +5152,9 @@ declare function useVerification(): {
|
|
|
5152
5152
|
status: "idle";
|
|
5153
5153
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5154
5154
|
__typename?: "Token";
|
|
5155
|
+
secret?: string;
|
|
5155
5156
|
expire?: any;
|
|
5157
|
+
userId?: string;
|
|
5156
5158
|
}, AppwriteException, Exact<{
|
|
5157
5159
|
userId: string;
|
|
5158
5160
|
secret: string;
|
|
@@ -5165,7 +5167,9 @@ declare function useVerification(): {
|
|
|
5165
5167
|
submittedAt: number;
|
|
5166
5168
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5167
5169
|
__typename?: "Token";
|
|
5170
|
+
secret?: string;
|
|
5168
5171
|
expire?: any;
|
|
5172
|
+
userId?: string;
|
|
5169
5173
|
}, AppwriteException, Exact<{
|
|
5170
5174
|
userId: string;
|
|
5171
5175
|
secret: string;
|
|
@@ -5184,7 +5188,9 @@ declare function useVerification(): {
|
|
|
5184
5188
|
status: "pending";
|
|
5185
5189
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5186
5190
|
__typename?: "Token";
|
|
5191
|
+
secret?: string;
|
|
5187
5192
|
expire?: any;
|
|
5193
|
+
userId?: string;
|
|
5188
5194
|
}, AppwriteException, Exact<{
|
|
5189
5195
|
userId: string;
|
|
5190
5196
|
secret: string;
|
|
@@ -5197,7 +5203,9 @@ declare function useVerification(): {
|
|
|
5197
5203
|
submittedAt: number;
|
|
5198
5204
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5199
5205
|
__typename?: "Token";
|
|
5206
|
+
secret?: string;
|
|
5200
5207
|
expire?: any;
|
|
5208
|
+
userId?: string;
|
|
5201
5209
|
}, AppwriteException, Exact<{
|
|
5202
5210
|
userId: string;
|
|
5203
5211
|
secret: string;
|
|
@@ -5216,7 +5224,9 @@ declare function useVerification(): {
|
|
|
5216
5224
|
status: "error";
|
|
5217
5225
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5218
5226
|
__typename?: "Token";
|
|
5227
|
+
secret?: string;
|
|
5219
5228
|
expire?: any;
|
|
5229
|
+
userId?: string;
|
|
5220
5230
|
}, AppwriteException, Exact<{
|
|
5221
5231
|
userId: string;
|
|
5222
5232
|
secret: string;
|
|
@@ -5229,7 +5239,9 @@ declare function useVerification(): {
|
|
|
5229
5239
|
submittedAt: number;
|
|
5230
5240
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5231
5241
|
__typename?: "Token";
|
|
5242
|
+
secret?: string;
|
|
5232
5243
|
expire?: any;
|
|
5244
|
+
userId?: string;
|
|
5233
5245
|
}, AppwriteException, Exact<{
|
|
5234
5246
|
userId: string;
|
|
5235
5247
|
secret: string;
|
|
@@ -5237,7 +5249,9 @@ declare function useVerification(): {
|
|
|
5237
5249
|
} | {
|
|
5238
5250
|
data: {
|
|
5239
5251
|
__typename?: "Token";
|
|
5252
|
+
secret?: string;
|
|
5240
5253
|
expire?: any;
|
|
5254
|
+
userId?: string;
|
|
5241
5255
|
};
|
|
5242
5256
|
error: null;
|
|
5243
5257
|
variables: Exact<{
|
|
@@ -5251,7 +5265,9 @@ declare function useVerification(): {
|
|
|
5251
5265
|
status: "success";
|
|
5252
5266
|
mutate: _tanstack_react_query.UseMutateFunction<{
|
|
5253
5267
|
__typename?: "Token";
|
|
5268
|
+
secret?: string;
|
|
5254
5269
|
expire?: any;
|
|
5270
|
+
userId?: string;
|
|
5255
5271
|
}, AppwriteException, Exact<{
|
|
5256
5272
|
userId: string;
|
|
5257
5273
|
secret: string;
|
|
@@ -5264,7 +5280,9 @@ declare function useVerification(): {
|
|
|
5264
5280
|
submittedAt: number;
|
|
5265
5281
|
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<{
|
|
5266
5282
|
__typename?: "Token";
|
|
5283
|
+
secret?: string;
|
|
5267
5284
|
expire?: any;
|
|
5285
|
+
userId?: string;
|
|
5268
5286
|
}, AppwriteException, Exact<{
|
|
5269
5287
|
userId: string;
|
|
5270
5288
|
secret: string;
|
|
@@ -5872,6 +5890,10 @@ declare function useFunction(): {
|
|
|
5872
5890
|
executeFunction: _tanstack_react_query.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
|
|
5873
5891
|
currentExecution: _tanstack_react_query.UseQueryResult<unknown, unknown>;
|
|
5874
5892
|
};
|
|
5893
|
+
declare function useSuspenseFunction({ functionId, body, async, path, method, }: Props): {
|
|
5894
|
+
executeFunction: _tanstack_react_query.UseSuspenseQueryResult<Record<string, unknown>, Error>;
|
|
5895
|
+
currentExecution: _tanstack_react_query.UseQueryResult<unknown, unknown>;
|
|
5896
|
+
};
|
|
5875
5897
|
|
|
5876
5898
|
type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{
|
|
5877
5899
|
' $fragmentName'?: infer TKey;
|
|
@@ -5890,4 +5912,4 @@ declare const fragments: {
|
|
|
5890
5912
|
Identity_ProviderFragment: _graphql_typed_document_node_core.TypedDocumentNode<Identity_ProviderFragmentFragment, unknown>;
|
|
5891
5913
|
};
|
|
5892
5914
|
|
|
5893
|
-
export { fragments, getFragmentData, useAccount, useAppwrite, useCollection, useCreateAnonymousSession, useCreateDocument, useCreateEmailToken, useCreateJWT, useCreateMagicURLToken, useCreateMfaAuthenticator, useCreateMfaChallenge, useCreateMfaRecoveryCodes, useCreatePhoneToken, useCreatePhoneVerification, useCreateSession, useDeleteDocument, useDeleteIdentity, useDeleteMfaAuthenticator, useDeleteSession, useDeleteSessions, useDocument, useFunction, useGetMfaRecoveryCodes, useGetPrefs, useGetSession, useListIdentities, useListMfaFactors, useListSessions, useLogin, useLogout, useLogs, useMutation, usePasswordRecovery, useQuery, useQueryClient, useResetPassword, useSignUp, useSuspenseCollection, useSuspenseCreateJWT, useUpdateDocument, useUpdateEmail, useUpdateMagicURLSession, useUpdateMfa, useUpdateMfaAuthenticator, useUpdateMfaChallenge, useUpdateMfaRecoveryCodes, useUpdateName, useUpdatePassword, useUpdatePhone, useUpdatePhoneSession, useUpdatePhoneVerification, useUpdatePrefs, useUpdateSession, useVerification };
|
|
5915
|
+
export { fragments, getFragmentData, useAccount, useAppwrite, useCollection, useCreateAnonymousSession, useCreateDocument, useCreateEmailToken, useCreateJWT, useCreateMagicURLToken, useCreateMfaAuthenticator, useCreateMfaChallenge, useCreateMfaRecoveryCodes, useCreatePhoneToken, useCreatePhoneVerification, useCreateSession, useDeleteDocument, useDeleteIdentity, useDeleteMfaAuthenticator, useDeleteSession, useDeleteSessions, useDocument, useFunction, useGetMfaRecoveryCodes, useGetPrefs, useGetSession, useListIdentities, useListMfaFactors, useListSessions, useLogin, useLogout, useLogs, useMutation, usePasswordRecovery, useQuery, useQueryClient, useResetPassword, useSignUp, useSuspenseCollection, useSuspenseCreateJWT, useSuspenseFunction, useUpdateDocument, useUpdateEmail, useUpdateMagicURLSession, useUpdateMfa, useUpdateMfaAuthenticator, useUpdateMfaChallenge, useUpdateMfaRecoveryCodes, useUpdateName, useUpdatePassword, useUpdatePhone, useUpdatePhoneSession, useUpdatePhoneVerification, useUpdatePrefs, useUpdateSession, useVerification };
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ __export(src_exports, {
|
|
|
59
59
|
useSignUp: () => useSignUp,
|
|
60
60
|
useSuspenseCollection: () => useSuspenseCollection,
|
|
61
61
|
useSuspenseCreateJWT: () => useSuspenseCreateJWT,
|
|
62
|
+
useSuspenseFunction: () => useSuspenseFunction,
|
|
62
63
|
useUpdateDocument: () => useUpdateDocument,
|
|
63
64
|
useUpdateEmail: () => useUpdateEmail,
|
|
64
65
|
useUpdateMagicURLSession: () => useUpdateMagicURLSession,
|
|
@@ -210,7 +211,7 @@ var UpdatePhoneSessionDocument = { "kind": "Document", "definitions": [{ "kind":
|
|
|
210
211
|
var UpdatePhoneVerificationDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdatePhoneVerification" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "secret" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountUpdatePhoneVerification" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "userId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "secret" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "secret" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "expire" } }] } }] } }] };
|
|
211
212
|
var UpdatePrefsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdatePrefs" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "prefs" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountUpdatePrefs" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "prefs" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "prefs" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "prefs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "data" } }] } }] } }] } }] };
|
|
212
213
|
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" } }] } }] } }] };
|
|
213
|
-
var UpdateVerificationDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateVerification" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "secret" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountUpdateVerification" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "userId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "secret" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "secret" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "expire" } }] } }] } }] };
|
|
214
|
+
var UpdateVerificationDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateVerification" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "secret" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountUpdateVerification" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "userId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "secret" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "secret" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "secret" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expire" } }, { "kind": "Field", "name": { "kind": "Name", "value": "userId" } }] } }] } }] };
|
|
214
215
|
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" } }] } }] } }] } }] };
|
|
215
216
|
var CreateDocumentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateDocument" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "permissions" } }, "type": { "kind": "ListType", "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "databasesCreateDocument" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "databaseId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "collectionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "documentId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "data" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "permissions" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "permissions" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }] } }] } }] };
|
|
216
217
|
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" } }] } }] } }] };
|
|
@@ -262,7 +263,7 @@ var documents = {
|
|
|
262
263
|
"\n mutation UpdatePhoneVerification($userId: String!, $secret: String!) {\n accountUpdatePhoneVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdatePhoneVerificationDocument,
|
|
263
264
|
"\n mutation UpdatePrefs($prefs: JSON!) {\n accountUpdatePrefs(prefs: $prefs) {\n prefs {\n data\n }\n }\n }\n": UpdatePrefsDocument,
|
|
264
265
|
"\n mutation UpdateSession($sessionId: String!) {\n accountUpdateSession(sessionId: $sessionId) {\n userId\n expire\n current\n }\n }\n": UpdateSessionDocument,
|
|
265
|
-
"\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n expire\n }\n }\n": UpdateVerificationDocument,
|
|
266
|
+
"\n mutation UpdateVerification($userId: String!, $secret: String!) {\n accountUpdateVerification(userId: $userId, secret: $secret) {\n secret\n expire\n userId\n }\n }\n": UpdateVerificationDocument,
|
|
266
267
|
"\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,
|
|
267
268
|
"\n mutation CreateDocument(\n $databaseId: String!\n $collectionId: String!\n $documentId: String!\n $data: JSON!\n $permissions: [String!]\n ) {\n databasesCreateDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n data: $data\n permissions: $permissions\n ) {\n _id\n }\n }\n": CreateDocumentDocument,
|
|
268
269
|
"\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,
|
|
@@ -1649,7 +1650,9 @@ var updateVerification = gql(
|
|
|
1649
1650
|
`
|
|
1650
1651
|
mutation UpdateVerification($userId: String!, $secret: String!) {
|
|
1651
1652
|
accountUpdateVerification(userId: $userId, secret: $secret) {
|
|
1653
|
+
secret
|
|
1652
1654
|
expire
|
|
1655
|
+
userId
|
|
1653
1656
|
}
|
|
1654
1657
|
}
|
|
1655
1658
|
`
|
|
@@ -2161,8 +2164,89 @@ function useFunction() {
|
|
|
2161
2164
|
currentExecution: getExecution
|
|
2162
2165
|
};
|
|
2163
2166
|
}
|
|
2167
|
+
function useSuspenseFunction({
|
|
2168
|
+
functionId,
|
|
2169
|
+
body = {},
|
|
2170
|
+
async = false,
|
|
2171
|
+
path = "",
|
|
2172
|
+
method = "POST"
|
|
2173
|
+
}) {
|
|
2174
|
+
const { graphql: graphql2 } = useAppwrite();
|
|
2175
|
+
const [currentExecution, setCurrentExecution] = (0, import_react5.useState)(null);
|
|
2176
|
+
const [currentFunction, setCurrentFunction] = (0, import_react5.useState)(null);
|
|
2177
|
+
const executeFunction = useSuspenseQuery(
|
|
2178
|
+
{
|
|
2179
|
+
queryKey: ["appwrite", "functions", functionId],
|
|
2180
|
+
queryFn: async () => {
|
|
2181
|
+
setCurrentFunction(functionId);
|
|
2182
|
+
const { data } = await graphql2.mutation({
|
|
2183
|
+
query: createExecution,
|
|
2184
|
+
variables: {
|
|
2185
|
+
functionId,
|
|
2186
|
+
body: JSON.stringify(body),
|
|
2187
|
+
async,
|
|
2188
|
+
path,
|
|
2189
|
+
method
|
|
2190
|
+
// headers,
|
|
2191
|
+
}
|
|
2192
|
+
});
|
|
2193
|
+
let unsubscribe = null;
|
|
2194
|
+
const { _id, status, responseBody, errors } = data.functionsCreateExecution ?? {};
|
|
2195
|
+
if (status === "completed") {
|
|
2196
|
+
return JSON.parse(responseBody ?? "{}");
|
|
2197
|
+
}
|
|
2198
|
+
if (status === "failed" && errors) {
|
|
2199
|
+
throw new Error(errors);
|
|
2200
|
+
}
|
|
2201
|
+
setCurrentExecution(_id ?? null);
|
|
2202
|
+
const response = await new Promise((resolve, reject) => {
|
|
2203
|
+
unsubscribe = graphql2.client.subscribe(`executions.${_id}`, (event) => {
|
|
2204
|
+
switch (event.payload.status) {
|
|
2205
|
+
case "completed":
|
|
2206
|
+
setCurrentExecution(null);
|
|
2207
|
+
resolve(JSON.parse(event.payload.responseBody));
|
|
2208
|
+
break;
|
|
2209
|
+
case "failed":
|
|
2210
|
+
setCurrentExecution(null);
|
|
2211
|
+
reject(event.payload.errors);
|
|
2212
|
+
break;
|
|
2213
|
+
}
|
|
2214
|
+
return 1;
|
|
2215
|
+
});
|
|
2216
|
+
});
|
|
2217
|
+
unsubscribe?.();
|
|
2218
|
+
return response;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
);
|
|
2222
|
+
const getExecution = useQuery({
|
|
2223
|
+
queryKey: ["appwrite", "functions", currentFunction, currentExecution],
|
|
2224
|
+
queryFn: async () => {
|
|
2225
|
+
if (!currentExecution || !currentFunction) {
|
|
2226
|
+
return null;
|
|
2227
|
+
}
|
|
2228
|
+
const { data } = await graphql2.query({
|
|
2229
|
+
query: getFunctionExecution,
|
|
2230
|
+
variables: {
|
|
2231
|
+
functionId: currentFunction,
|
|
2232
|
+
executionId: currentExecution
|
|
2233
|
+
}
|
|
2234
|
+
});
|
|
2235
|
+
return data.functionsGetExecution ?? {};
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
return {
|
|
2239
|
+
executeFunction,
|
|
2240
|
+
currentExecution: getExecution
|
|
2241
|
+
};
|
|
2242
|
+
}
|
|
2164
2243
|
|
|
2165
2244
|
// src/account/fragments.ts
|
|
2245
|
+
var fragments_exports = {};
|
|
2246
|
+
__export(fragments_exports, {
|
|
2247
|
+
Account_UserFragment: () => Account_UserFragment,
|
|
2248
|
+
Identity_ProviderFragment: () => Identity_ProviderFragment
|
|
2249
|
+
});
|
|
2166
2250
|
var Account_UserFragment = gql(
|
|
2167
2251
|
/* GraphQL */
|
|
2168
2252
|
`
|
|
@@ -2188,8 +2272,7 @@ var Identity_ProviderFragment = gql(
|
|
|
2188
2272
|
|
|
2189
2273
|
// src/index.ts
|
|
2190
2274
|
var fragments = {
|
|
2191
|
-
|
|
2192
|
-
Identity_ProviderFragment
|
|
2275
|
+
...fragments_exports
|
|
2193
2276
|
};
|
|
2194
2277
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2195
2278
|
0 && (module.exports = {
|
|
@@ -2233,6 +2316,7 @@ var fragments = {
|
|
|
2233
2316
|
useSignUp,
|
|
2234
2317
|
useSuspenseCollection,
|
|
2235
2318
|
useSuspenseCreateJWT,
|
|
2319
|
+
useSuspenseFunction,
|
|
2236
2320
|
useUpdateDocument,
|
|
2237
2321
|
useUpdateEmail,
|
|
2238
2322
|
useUpdateMagicURLSession,
|