@zeroin.earth/appwrite-graphql 0.13.1 → 0.14.0

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 CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _graphql_typed_document_node_core from '@graphql-typed-document-node/core';
2
2
  import { TypedDocumentNode, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
3
- import { Account, Client, Models, AppwriteException } from 'appwrite';
4
- import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
3
+ import { Account, Databases, Functions, Client, Models, AppwriteException, OAuthProvider } from 'appwrite';
4
+ import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { DefaultError, UseMutationOptions, QueryKey, UndefinedInitialDataOptions, DefinedInitialDataOptions, UseQueryOptions } from '@tanstack/react-query';
6
- import * as _tanstack_query_core_build_legacy_queryClient_bm_z2rsD from '@tanstack/query-core/build/legacy/queryClient-bm-z2rsD';
6
+ import * as _tanstack_query_core from '@tanstack/query-core';
7
7
 
8
8
  type Maybe<T> = T | null;
9
9
  /** All built-in and custom scalars, mapped to their actual values */
@@ -41,12 +41,6 @@ type Preferences = {
41
41
  __typename?: 'Preferences';
42
42
  data?: Maybe<Scalars['JSON']['output']>;
43
43
  };
44
- type Session = {
45
- __typename?: 'Session';
46
- current?: Maybe<Scalars['Boolean']['output']>;
47
- expire?: Maybe<Scalars['String']['output']>;
48
- userId?: Maybe<Scalars['String']['output']>;
49
- };
50
44
  type Token = {
51
45
  __typename?: 'Token';
52
46
  _createdAt?: Maybe<Scalars['String']['output']>;
@@ -102,6 +96,8 @@ type DeleteSessionMutation = {
102
96
  type Variables = Record<string, unknown>;
103
97
  declare function useAppwrite(): {
104
98
  account: Account;
99
+ databases: Databases;
100
+ functions: Functions;
105
101
  graphql: {
106
102
  client: Client;
107
103
  query: <T, V extends Variables = Variables>({ query, variables, }: {
@@ -121,37 +117,101 @@ declare function useAppwrite(): {
121
117
  };
122
118
  };
123
119
 
124
- declare function useMutation<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>): _tanstack_react_query_build_legacy_types.UseMutationResult<TData, TError, TVariables, TContext>;
120
+ declare function useMutation<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>): _tanstack_react_query.UseMutationResult<TData, TError, TVariables, TContext>;
125
121
 
126
- declare function useQuery<TQueryFnData, TError, TData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): _tanstack_react_query_build_legacy_types.UseQueryResult<TData, TError>;
122
+ declare function useQuery<TQueryFnData, TError, TData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): _tanstack_react_query.UseQueryResult<TData, TError>;
127
123
 
128
- declare function useQueryClient(): _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.b;
124
+ declare function useQueryClient(): _tanstack_query_core.QueryClient;
129
125
 
130
126
  declare function useAccount<Preferences extends Models.Preferences>({ options, }: {
131
127
  options?: UseQueryOptions<AccountGetQuery['accountGet'], AppwriteException, AccountGetQuery['accountGet'], string[]>;
132
- }): _tanstack_react_query_build_legacy_types.UseQueryResult<{
133
- __typename?: "User";
134
- } & {
135
- ' $fragmentRefs'?: {
136
- Account_UserFragmentFragment: Account_UserFragmentFragment;
128
+ }): {
129
+ data: {
130
+ __typename?: "User";
131
+ } & {
132
+ ' $fragmentRefs'?: {
133
+ Account_UserFragmentFragment: Account_UserFragmentFragment;
134
+ };
137
135
  };
138
- }, AppwriteException>;
136
+ dataUpdatedAt: number;
137
+ error: AppwriteException;
138
+ errorUpdateCount: number;
139
+ errorUpdatedAt: number;
140
+ failureCount: number;
141
+ failureReason: AppwriteException;
142
+ fetchStatus: _tanstack_react_query.FetchStatus;
143
+ isError: boolean;
144
+ isFetched: boolean;
145
+ isFetchedAfterMount: boolean;
146
+ isFetching: boolean;
147
+ isLoading: boolean;
148
+ isLoadingError: boolean;
149
+ isPaused: boolean;
150
+ isPending: boolean;
151
+ isPlaceholderData: boolean;
152
+ isRefetchError: boolean;
153
+ isRefetching: boolean;
154
+ isStale: boolean;
155
+ isSuccess: boolean;
156
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
157
+ __typename?: "User";
158
+ } & {
159
+ ' $fragmentRefs'?: {
160
+ Account_UserFragmentFragment: Account_UserFragmentFragment;
161
+ };
162
+ }, AppwriteException>>;
163
+ status: "pending" | "error" | "success";
164
+ };
139
165
 
140
166
  type LoginProps = {
141
167
  email: string;
142
168
  password: string;
143
169
  };
144
170
  type OAuthLoginProps = {
145
- provider: string;
171
+ provider: OAuthProvider;
146
172
  success: string;
147
173
  failure: string;
148
174
  };
149
175
  declare function useLogin(): {
150
- login: _tanstack_react_query_build_legacy_types.UseMutationResult<Session, AppwriteException, LoginProps, unknown>;
151
- oAuthLogin: _tanstack_react_query_build_legacy_types.UseMutationResult<void | URL, AppwriteException, OAuthLoginProps, unknown>;
176
+ login: {
177
+ context: unknown;
178
+ data: Models.Session;
179
+ error: AppwriteException;
180
+ failureCount: number;
181
+ failureReason: AppwriteException;
182
+ isError: boolean;
183
+ isIdle: boolean;
184
+ isPaused: boolean;
185
+ isPending: boolean;
186
+ isSuccess: boolean;
187
+ mutate: _tanstack_react_query.UseMutateFunction<Models.Session, AppwriteException, LoginProps, unknown>;
188
+ mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Models.Session, AppwriteException, LoginProps, unknown>;
189
+ reset: () => void;
190
+ status: "pending" | "error" | "success" | "idle";
191
+ submittedAt: number;
192
+ variables: LoginProps;
193
+ };
194
+ oAuthLogin: {
195
+ context: unknown;
196
+ data: void | URL;
197
+ error: AppwriteException;
198
+ failureCount: number;
199
+ failureReason: AppwriteException;
200
+ isError: boolean;
201
+ isIdle: boolean;
202
+ isPaused: boolean;
203
+ isPending: boolean;
204
+ isSuccess: boolean;
205
+ mutate: _tanstack_react_query.UseMutateFunction<void | URL, AppwriteException, OAuthLoginProps, unknown>;
206
+ mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<void | URL, AppwriteException, OAuthLoginProps, unknown>;
207
+ reset: () => void;
208
+ status: "pending" | "error" | "success" | "idle";
209
+ submittedAt: number;
210
+ variables: OAuthLoginProps;
211
+ };
152
212
  };
153
213
 
154
- declare function useLogout(): _tanstack_react_query_build_legacy_types.UseMutationResult<{
214
+ declare function useLogout(): _tanstack_react_query.UseMutationResult<{
155
215
  data: DeleteSessionMutation;
156
216
  errors: unknown[];
157
217
  }, Error, void, unknown>;
@@ -163,7 +223,7 @@ type Props$3 = {
163
223
  /**
164
224
  * Send the recovery email to the address supplied
165
225
  */
166
- declare function usePasswordRecovery(): _tanstack_react_query_build_legacy_types.UseMutationResult<Token, AppwriteException, Props$3, unknown>;
226
+ declare function usePasswordRecovery(): _tanstack_react_query.UseMutationResult<Token, AppwriteException, Props$3, unknown>;
167
227
 
168
228
  type Props$2 = {
169
229
  userId: string;
@@ -171,7 +231,7 @@ type Props$2 = {
171
231
  password: string;
172
232
  confirmPassword: string;
173
233
  };
174
- declare function useResetPassword(): _tanstack_react_query_build_legacy_types.UseMutationResult<Token, AppwriteException, Props$2, unknown>;
234
+ declare function useResetPassword(): _tanstack_react_query.UseMutationResult<Token, AppwriteException, Props$2, unknown>;
175
235
 
176
236
  type SignUpProps = {
177
237
  userId?: string;
@@ -183,15 +243,15 @@ type VerifyProps = {
183
243
  verifyUrl: string;
184
244
  };
185
245
  declare function useSignUp(): {
186
- signUp: _tanstack_react_query_build_legacy_types.UseMutationResult<User, Error, SignUpProps, unknown>;
187
- verifyEmail: _tanstack_react_query_build_legacy_types.UseMutationResult<Token, Error, VerifyProps, unknown>;
246
+ signUp: _tanstack_react_query.UseMutationResult<User, Error, SignUpProps, unknown>;
247
+ verifyEmail: _tanstack_react_query.UseMutationResult<Token, Error, VerifyProps, unknown>;
188
248
  };
189
249
 
190
250
  type Props$1 = {
191
251
  userId: string | null;
192
252
  secret: string | null;
193
253
  };
194
- declare function useVerification(): _tanstack_react_query_build_legacy_types.UseMutationResult<Token, AppwriteException, Props$1, unknown>;
254
+ declare function useVerification(): _tanstack_react_query.UseMutationResult<Token, AppwriteException, Props$1, unknown>;
195
255
 
196
256
  type Document<T> = T & Models.Document;
197
257
  type Collection<T> = Models.DocumentList<Document<T>>;
@@ -210,6 +270,7 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
210
270
  error: AppwriteException;
211
271
  isError: true;
212
272
  isPending: false;
273
+ isLoading: false;
213
274
  isLoadingError: false;
214
275
  isRefetchError: true;
215
276
  isSuccess: false;
@@ -222,14 +283,13 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
222
283
  isFetched: boolean;
223
284
  isFetchedAfterMount: boolean;
224
285
  isFetching: boolean;
225
- isLoading: boolean;
226
286
  isInitialLoading: boolean;
227
287
  isPaused: boolean;
228
288
  isPlaceholderData: boolean;
229
289
  isRefetching: boolean;
230
290
  isStale: boolean;
231
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
232
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
291
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
292
+ fetchStatus: _tanstack_react_query.FetchStatus;
233
293
  } | {
234
294
  documents: Document<TDocument>[];
235
295
  total: number;
@@ -237,6 +297,7 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
237
297
  error: null;
238
298
  isError: false;
239
299
  isPending: false;
300
+ isLoading: false;
240
301
  isLoadingError: false;
241
302
  isRefetchError: false;
242
303
  isSuccess: true;
@@ -249,14 +310,13 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
249
310
  isFetched: boolean;
250
311
  isFetchedAfterMount: boolean;
251
312
  isFetching: boolean;
252
- isLoading: boolean;
253
313
  isInitialLoading: boolean;
254
314
  isPaused: boolean;
255
315
  isPlaceholderData: boolean;
256
316
  isRefetching: boolean;
257
317
  isStale: boolean;
258
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
259
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
318
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
319
+ fetchStatus: _tanstack_react_query.FetchStatus;
260
320
  } | {
261
321
  documents: Document<TDocument>[];
262
322
  total: number;
@@ -264,6 +324,7 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
264
324
  error: AppwriteException;
265
325
  isError: true;
266
326
  isPending: false;
327
+ isLoading: false;
267
328
  isLoadingError: true;
268
329
  isRefetchError: false;
269
330
  isSuccess: false;
@@ -276,14 +337,40 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
276
337
  isFetched: boolean;
277
338
  isFetchedAfterMount: boolean;
278
339
  isFetching: boolean;
279
- isLoading: boolean;
280
340
  isInitialLoading: boolean;
281
341
  isPaused: boolean;
282
342
  isPlaceholderData: boolean;
283
343
  isRefetching: boolean;
284
344
  isStale: boolean;
285
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
286
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
345
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
346
+ fetchStatus: _tanstack_react_query.FetchStatus;
347
+ } | {
348
+ documents: Document<TDocument>[];
349
+ total: number;
350
+ data: undefined;
351
+ error: null;
352
+ isError: false;
353
+ isPending: true;
354
+ isLoading: true;
355
+ isLoadingError: false;
356
+ isRefetchError: false;
357
+ isSuccess: false;
358
+ status: "pending";
359
+ dataUpdatedAt: number;
360
+ errorUpdatedAt: number;
361
+ failureCount: number;
362
+ failureReason: AppwriteException;
363
+ errorUpdateCount: number;
364
+ isFetched: boolean;
365
+ isFetchedAfterMount: boolean;
366
+ isFetching: boolean;
367
+ isInitialLoading: boolean;
368
+ isPaused: boolean;
369
+ isPlaceholderData: boolean;
370
+ isRefetching: boolean;
371
+ isStale: boolean;
372
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
373
+ fetchStatus: _tanstack_react_query.FetchStatus;
287
374
  } | {
288
375
  documents: Document<TDocument>[];
289
376
  total: number;
@@ -309,13 +396,13 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
309
396
  isPlaceholderData: boolean;
310
397
  isRefetching: boolean;
311
398
  isStale: boolean;
312
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
313
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
399
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
400
+ fetchStatus: _tanstack_react_query.FetchStatus;
314
401
  };
315
402
 
316
- declare function useCreateDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, data: TDocument, permissions?: string[], options?: UseMutationOptions<string | undefined | null, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query_build_legacy_types.UseMutationResult<string, AppwriteException, Document<TDocument>, string[]>;
403
+ declare function useCreateDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, data: TDocument, permissions?: string[], options?: UseMutationOptions<string | undefined | null, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query.UseMutationResult<string, AppwriteException, Document<TDocument>, string[]>;
317
404
 
318
- declare function useDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, options?: UseQueryOptions<Document<TDocument>, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query_build_legacy_types.UseQueryResult<Document<TDocument>, AppwriteException>;
405
+ declare function useDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, options?: UseQueryOptions<Document<TDocument>, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query.UseQueryResult<Document<TDocument>, AppwriteException>;
319
406
 
320
407
  type Props = {
321
408
  functionId: string;
@@ -326,8 +413,8 @@ type Props = {
326
413
  headers?: object | undefined;
327
414
  };
328
415
  declare function useFunction(): {
329
- executeFunction: _tanstack_react_query_build_legacy_types.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
330
- currentExecution: _tanstack_react_query_build_legacy_types.UseQueryResult<unknown, unknown>;
416
+ executeFunction: _tanstack_react_query.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
417
+ currentExecution: _tanstack_react_query.UseQueryResult<unknown, unknown>;
331
418
  };
332
419
 
333
420
  type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _graphql_typed_document_node_core from '@graphql-typed-document-node/core';
2
2
  import { TypedDocumentNode, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
3
- import { Account, Client, Models, AppwriteException } from 'appwrite';
4
- import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
3
+ import { Account, Databases, Functions, Client, Models, AppwriteException, OAuthProvider } from 'appwrite';
4
+ import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { DefaultError, UseMutationOptions, QueryKey, UndefinedInitialDataOptions, DefinedInitialDataOptions, UseQueryOptions } from '@tanstack/react-query';
6
- import * as _tanstack_query_core_build_legacy_queryClient_bm_z2rsD from '@tanstack/query-core/build/legacy/queryClient-bm-z2rsD';
6
+ import * as _tanstack_query_core from '@tanstack/query-core';
7
7
 
8
8
  type Maybe<T> = T | null;
9
9
  /** All built-in and custom scalars, mapped to their actual values */
@@ -41,12 +41,6 @@ type Preferences = {
41
41
  __typename?: 'Preferences';
42
42
  data?: Maybe<Scalars['JSON']['output']>;
43
43
  };
44
- type Session = {
45
- __typename?: 'Session';
46
- current?: Maybe<Scalars['Boolean']['output']>;
47
- expire?: Maybe<Scalars['String']['output']>;
48
- userId?: Maybe<Scalars['String']['output']>;
49
- };
50
44
  type Token = {
51
45
  __typename?: 'Token';
52
46
  _createdAt?: Maybe<Scalars['String']['output']>;
@@ -102,6 +96,8 @@ type DeleteSessionMutation = {
102
96
  type Variables = Record<string, unknown>;
103
97
  declare function useAppwrite(): {
104
98
  account: Account;
99
+ databases: Databases;
100
+ functions: Functions;
105
101
  graphql: {
106
102
  client: Client;
107
103
  query: <T, V extends Variables = Variables>({ query, variables, }: {
@@ -121,37 +117,101 @@ declare function useAppwrite(): {
121
117
  };
122
118
  };
123
119
 
124
- declare function useMutation<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>): _tanstack_react_query_build_legacy_types.UseMutationResult<TData, TError, TVariables, TContext>;
120
+ declare function useMutation<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>): _tanstack_react_query.UseMutationResult<TData, TError, TVariables, TContext>;
125
121
 
126
- declare function useQuery<TQueryFnData, TError, TData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): _tanstack_react_query_build_legacy_types.UseQueryResult<TData, TError>;
122
+ declare function useQuery<TQueryFnData, TError, TData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): _tanstack_react_query.UseQueryResult<TData, TError>;
127
123
 
128
- declare function useQueryClient(): _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.b;
124
+ declare function useQueryClient(): _tanstack_query_core.QueryClient;
129
125
 
130
126
  declare function useAccount<Preferences extends Models.Preferences>({ options, }: {
131
127
  options?: UseQueryOptions<AccountGetQuery['accountGet'], AppwriteException, AccountGetQuery['accountGet'], string[]>;
132
- }): _tanstack_react_query_build_legacy_types.UseQueryResult<{
133
- __typename?: "User";
134
- } & {
135
- ' $fragmentRefs'?: {
136
- Account_UserFragmentFragment: Account_UserFragmentFragment;
128
+ }): {
129
+ data: {
130
+ __typename?: "User";
131
+ } & {
132
+ ' $fragmentRefs'?: {
133
+ Account_UserFragmentFragment: Account_UserFragmentFragment;
134
+ };
137
135
  };
138
- }, AppwriteException>;
136
+ dataUpdatedAt: number;
137
+ error: AppwriteException;
138
+ errorUpdateCount: number;
139
+ errorUpdatedAt: number;
140
+ failureCount: number;
141
+ failureReason: AppwriteException;
142
+ fetchStatus: _tanstack_react_query.FetchStatus;
143
+ isError: boolean;
144
+ isFetched: boolean;
145
+ isFetchedAfterMount: boolean;
146
+ isFetching: boolean;
147
+ isLoading: boolean;
148
+ isLoadingError: boolean;
149
+ isPaused: boolean;
150
+ isPending: boolean;
151
+ isPlaceholderData: boolean;
152
+ isRefetchError: boolean;
153
+ isRefetching: boolean;
154
+ isStale: boolean;
155
+ isSuccess: boolean;
156
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
157
+ __typename?: "User";
158
+ } & {
159
+ ' $fragmentRefs'?: {
160
+ Account_UserFragmentFragment: Account_UserFragmentFragment;
161
+ };
162
+ }, AppwriteException>>;
163
+ status: "pending" | "error" | "success";
164
+ };
139
165
 
140
166
  type LoginProps = {
141
167
  email: string;
142
168
  password: string;
143
169
  };
144
170
  type OAuthLoginProps = {
145
- provider: string;
171
+ provider: OAuthProvider;
146
172
  success: string;
147
173
  failure: string;
148
174
  };
149
175
  declare function useLogin(): {
150
- login: _tanstack_react_query_build_legacy_types.UseMutationResult<Session, AppwriteException, LoginProps, unknown>;
151
- oAuthLogin: _tanstack_react_query_build_legacy_types.UseMutationResult<void | URL, AppwriteException, OAuthLoginProps, unknown>;
176
+ login: {
177
+ context: unknown;
178
+ data: Models.Session;
179
+ error: AppwriteException;
180
+ failureCount: number;
181
+ failureReason: AppwriteException;
182
+ isError: boolean;
183
+ isIdle: boolean;
184
+ isPaused: boolean;
185
+ isPending: boolean;
186
+ isSuccess: boolean;
187
+ mutate: _tanstack_react_query.UseMutateFunction<Models.Session, AppwriteException, LoginProps, unknown>;
188
+ mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Models.Session, AppwriteException, LoginProps, unknown>;
189
+ reset: () => void;
190
+ status: "pending" | "error" | "success" | "idle";
191
+ submittedAt: number;
192
+ variables: LoginProps;
193
+ };
194
+ oAuthLogin: {
195
+ context: unknown;
196
+ data: void | URL;
197
+ error: AppwriteException;
198
+ failureCount: number;
199
+ failureReason: AppwriteException;
200
+ isError: boolean;
201
+ isIdle: boolean;
202
+ isPaused: boolean;
203
+ isPending: boolean;
204
+ isSuccess: boolean;
205
+ mutate: _tanstack_react_query.UseMutateFunction<void | URL, AppwriteException, OAuthLoginProps, unknown>;
206
+ mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<void | URL, AppwriteException, OAuthLoginProps, unknown>;
207
+ reset: () => void;
208
+ status: "pending" | "error" | "success" | "idle";
209
+ submittedAt: number;
210
+ variables: OAuthLoginProps;
211
+ };
152
212
  };
153
213
 
154
- declare function useLogout(): _tanstack_react_query_build_legacy_types.UseMutationResult<{
214
+ declare function useLogout(): _tanstack_react_query.UseMutationResult<{
155
215
  data: DeleteSessionMutation;
156
216
  errors: unknown[];
157
217
  }, Error, void, unknown>;
@@ -163,7 +223,7 @@ type Props$3 = {
163
223
  /**
164
224
  * Send the recovery email to the address supplied
165
225
  */
166
- declare function usePasswordRecovery(): _tanstack_react_query_build_legacy_types.UseMutationResult<Token, AppwriteException, Props$3, unknown>;
226
+ declare function usePasswordRecovery(): _tanstack_react_query.UseMutationResult<Token, AppwriteException, Props$3, unknown>;
167
227
 
168
228
  type Props$2 = {
169
229
  userId: string;
@@ -171,7 +231,7 @@ type Props$2 = {
171
231
  password: string;
172
232
  confirmPassword: string;
173
233
  };
174
- declare function useResetPassword(): _tanstack_react_query_build_legacy_types.UseMutationResult<Token, AppwriteException, Props$2, unknown>;
234
+ declare function useResetPassword(): _tanstack_react_query.UseMutationResult<Token, AppwriteException, Props$2, unknown>;
175
235
 
176
236
  type SignUpProps = {
177
237
  userId?: string;
@@ -183,15 +243,15 @@ type VerifyProps = {
183
243
  verifyUrl: string;
184
244
  };
185
245
  declare function useSignUp(): {
186
- signUp: _tanstack_react_query_build_legacy_types.UseMutationResult<User, Error, SignUpProps, unknown>;
187
- verifyEmail: _tanstack_react_query_build_legacy_types.UseMutationResult<Token, Error, VerifyProps, unknown>;
246
+ signUp: _tanstack_react_query.UseMutationResult<User, Error, SignUpProps, unknown>;
247
+ verifyEmail: _tanstack_react_query.UseMutationResult<Token, Error, VerifyProps, unknown>;
188
248
  };
189
249
 
190
250
  type Props$1 = {
191
251
  userId: string | null;
192
252
  secret: string | null;
193
253
  };
194
- declare function useVerification(): _tanstack_react_query_build_legacy_types.UseMutationResult<Token, AppwriteException, Props$1, unknown>;
254
+ declare function useVerification(): _tanstack_react_query.UseMutationResult<Token, AppwriteException, Props$1, unknown>;
195
255
 
196
256
  type Document<T> = T & Models.Document;
197
257
  type Collection<T> = Models.DocumentList<Document<T>>;
@@ -210,6 +270,7 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
210
270
  error: AppwriteException;
211
271
  isError: true;
212
272
  isPending: false;
273
+ isLoading: false;
213
274
  isLoadingError: false;
214
275
  isRefetchError: true;
215
276
  isSuccess: false;
@@ -222,14 +283,13 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
222
283
  isFetched: boolean;
223
284
  isFetchedAfterMount: boolean;
224
285
  isFetching: boolean;
225
- isLoading: boolean;
226
286
  isInitialLoading: boolean;
227
287
  isPaused: boolean;
228
288
  isPlaceholderData: boolean;
229
289
  isRefetching: boolean;
230
290
  isStale: boolean;
231
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
232
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
291
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
292
+ fetchStatus: _tanstack_react_query.FetchStatus;
233
293
  } | {
234
294
  documents: Document<TDocument>[];
235
295
  total: number;
@@ -237,6 +297,7 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
237
297
  error: null;
238
298
  isError: false;
239
299
  isPending: false;
300
+ isLoading: false;
240
301
  isLoadingError: false;
241
302
  isRefetchError: false;
242
303
  isSuccess: true;
@@ -249,14 +310,13 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
249
310
  isFetched: boolean;
250
311
  isFetchedAfterMount: boolean;
251
312
  isFetching: boolean;
252
- isLoading: boolean;
253
313
  isInitialLoading: boolean;
254
314
  isPaused: boolean;
255
315
  isPlaceholderData: boolean;
256
316
  isRefetching: boolean;
257
317
  isStale: boolean;
258
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
259
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
318
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
319
+ fetchStatus: _tanstack_react_query.FetchStatus;
260
320
  } | {
261
321
  documents: Document<TDocument>[];
262
322
  total: number;
@@ -264,6 +324,7 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
264
324
  error: AppwriteException;
265
325
  isError: true;
266
326
  isPending: false;
327
+ isLoading: false;
267
328
  isLoadingError: true;
268
329
  isRefetchError: false;
269
330
  isSuccess: false;
@@ -276,14 +337,40 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
276
337
  isFetched: boolean;
277
338
  isFetchedAfterMount: boolean;
278
339
  isFetching: boolean;
279
- isLoading: boolean;
280
340
  isInitialLoading: boolean;
281
341
  isPaused: boolean;
282
342
  isPlaceholderData: boolean;
283
343
  isRefetching: boolean;
284
344
  isStale: boolean;
285
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
286
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
345
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
346
+ fetchStatus: _tanstack_react_query.FetchStatus;
347
+ } | {
348
+ documents: Document<TDocument>[];
349
+ total: number;
350
+ data: undefined;
351
+ error: null;
352
+ isError: false;
353
+ isPending: true;
354
+ isLoading: true;
355
+ isLoadingError: false;
356
+ isRefetchError: false;
357
+ isSuccess: false;
358
+ status: "pending";
359
+ dataUpdatedAt: number;
360
+ errorUpdatedAt: number;
361
+ failureCount: number;
362
+ failureReason: AppwriteException;
363
+ errorUpdateCount: number;
364
+ isFetched: boolean;
365
+ isFetchedAfterMount: boolean;
366
+ isFetching: boolean;
367
+ isInitialLoading: boolean;
368
+ isPaused: boolean;
369
+ isPlaceholderData: boolean;
370
+ isRefetching: boolean;
371
+ isStale: boolean;
372
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
373
+ fetchStatus: _tanstack_react_query.FetchStatus;
287
374
  } | {
288
375
  documents: Document<TDocument>[];
289
376
  total: number;
@@ -309,13 +396,13 @@ declare function useCollection<TDocument>({ databaseId, collectionId, queries, o
309
396
  isPlaceholderData: boolean;
310
397
  isRefetching: boolean;
311
398
  isStale: boolean;
312
- refetch: (options?: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD._) => Promise<_tanstack_query_core_build_legacy_queryClient_bm_z2rsD.ad<Collection<TDocument>, AppwriteException>>;
313
- fetchStatus: _tanstack_query_core_build_legacy_queryClient_bm_z2rsD.a6;
399
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Collection<TDocument>, AppwriteException>>;
400
+ fetchStatus: _tanstack_react_query.FetchStatus;
314
401
  };
315
402
 
316
- declare function useCreateDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, data: TDocument, permissions?: string[], options?: UseMutationOptions<string | undefined | null, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query_build_legacy_types.UseMutationResult<string, AppwriteException, Document<TDocument>, string[]>;
403
+ declare function useCreateDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, data: TDocument, permissions?: string[], options?: UseMutationOptions<string | undefined | null, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query.UseMutationResult<string, AppwriteException, Document<TDocument>, string[]>;
317
404
 
318
- declare function useDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, options?: UseQueryOptions<Document<TDocument>, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query_build_legacy_types.UseQueryResult<Document<TDocument>, AppwriteException>;
405
+ declare function useDocument<TDocument>(databaseId: string, collectionId: string, documentId: string, options?: UseQueryOptions<Document<TDocument>, AppwriteException, Document<TDocument>, string[]>): _tanstack_react_query.UseQueryResult<Document<TDocument>, AppwriteException>;
319
406
 
320
407
  type Props = {
321
408
  functionId: string;
@@ -326,8 +413,8 @@ type Props = {
326
413
  headers?: object | undefined;
327
414
  };
328
415
  declare function useFunction(): {
329
- executeFunction: _tanstack_react_query_build_legacy_types.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
330
- currentExecution: _tanstack_react_query_build_legacy_types.UseQueryResult<unknown, unknown>;
416
+ executeFunction: _tanstack_react_query.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
417
+ currentExecution: _tanstack_react_query.UseQueryResult<unknown, unknown>;
331
418
  };
332
419
 
333
420
  type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{