@zeroin.earth/appwrite-graphql 23.0.2 → 23.0.3

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.
@@ -1,7 +1,7 @@
1
1
  import * as _graphql_typed_document_node_core from '@graphql-typed-document-node/core';
2
2
  import { TypedDocumentNode, ResultOf } from '@graphql-typed-document-node/core';
3
3
  import * as appwrite from 'react-native-appwrite';
4
- import { AppwriteException, Client, Account as Account$1, Avatars, Realtime, Storage, Databases, Functions, Locale as Locale$1, Messaging as Messaging$1, TablesDB as TablesDB$1, Teams, AuthenticatorType, AuthenticationFactor, OAuthProvider, Browser, CreditCard, Flag, Models, ImageGravity, ImageFormat } from 'react-native-appwrite';
4
+ import { Realtime, AppwriteException, Client, Account as Account$1, Avatars, Storage, Databases, Functions, Locale as Locale$1, Messaging as Messaging$1, TablesDB as TablesDB$1, Teams, AuthenticatorType, AuthenticationFactor, OAuthProvider, Browser, CreditCard, Flag, Models, ImageGravity, ImageFormat } from 'react-native-appwrite';
5
5
  export { AppwriteException, AuthenticationFactor, AuthenticatorType, ID, Models, OAuthProvider } from 'react-native-appwrite';
6
6
  import * as _tanstack_react_query from '@tanstack/react-query';
7
7
  import { UseMutationOptions, QueryKey, UndefinedInitialDataOptions, DefinedInitialDataOptions, UseQueryOptions, UseSuspenseQueryOptions, QueryClient } from '@tanstack/react-query';
@@ -13,6 +13,22 @@ import * as gql_tada from 'gql.tada';
13
13
  import { ResultOf as ResultOf$1, VariablesOf } from 'gql.tada';
14
14
  import * as _tanstack_query_core from '@tanstack/query-core';
15
15
 
16
+ /** Minimal realtime interface — works with both the standalone Realtime class (web) and Client-integrated realtime (React Native). */
17
+ type RealtimeLike = Pick<Realtime, 'subscribe'>;
18
+ /**
19
+ * Resolves intersection and mapped types into a flat object for cleaner IntelliSense.
20
+ * @internal
21
+ */
22
+ type Prettify<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
25
+ type QueryOptions = {
26
+ enabled?: boolean;
27
+ retry?: boolean | number | ((failureCount: number, error: unknown) => boolean);
28
+ retryDelay?: number | ((attemptIndex: number) => number);
29
+ staleTime?: number;
30
+ };
31
+
16
32
  /**
17
33
  * Returns the Appwrite client instance from context.
18
34
  * Must be used within an {@link AppwriteProvider}. Throws if called outside the provider.
@@ -21,7 +37,7 @@ declare function useAppwrite(): {
21
37
  client: appwrite.Client;
22
38
  account: appwrite.Account;
23
39
  avatars: appwrite.Avatars;
24
- realtime: appwrite.Realtime;
40
+ realtime: RealtimeLike;
25
41
  storage: appwrite.Storage;
26
42
  graphql: {
27
43
  client: appwrite.Client;
@@ -56,20 +72,6 @@ declare function useAppwrite(): {
56
72
  teams: appwrite.Teams;
57
73
  };
58
74
 
59
- /**
60
- * Resolves intersection and mapped types into a flat object for cleaner IntelliSense.
61
- * @internal
62
- */
63
- type Prettify<T> = {
64
- [K in keyof T]: T[K];
65
- } & {};
66
- type QueryOptions = {
67
- enabled?: boolean;
68
- retry?: boolean | number | ((failureCount: number, error: unknown) => boolean);
69
- retryDelay?: number | ((attemptIndex: number) => number);
70
- staleTime?: number;
71
- };
72
-
73
75
  /**
74
76
  * Wrapper around TanStack Query's `useMutation` that automatically injects the Appwrite-managed `QueryClient`.
75
77
  * Use this instead of importing `useMutation` from `@tanstack/react-query` directly.
@@ -125,7 +127,7 @@ declare function createAppwriteClient({ endpoint, projectId, }: {
125
127
  client: Client;
126
128
  account: Account$1;
127
129
  avatars: Avatars;
128
- realtime: Realtime;
130
+ realtime: RealtimeLike;
129
131
  storage: Storage;
130
132
  graphql: {
131
133
  client: Client;
@@ -1455,9 +1457,9 @@ type SignUpVariables = Prettify<Omit<VariablesOf<typeof createAccount>, 'userId'
1455
1457
  /** The result returned by the {@link useSignUp} mutation. */
1456
1458
  type SignUpResult = Prettify<ResultOf$1<typeof createAccount>['accountCreate']>;
1457
1459
  /** The variables accepted by the verify email mutation in {@link useSignUp}. */
1458
- type VerifyEmailVariables = {
1460
+ type VerifyEmailVariables = Prettify<{
1459
1461
  verifyUrl: string;
1460
- };
1462
+ }>;
1461
1463
  /** The result returned by the verify email mutation in {@link useSignUp}. */
1462
1464
  type VerifyEmailResult = Prettify<ResultOf$1<typeof verify>['accountCreateVerification']>;
1463
1465
  /**
@@ -1512,7 +1514,9 @@ declare function useSignUp(): {
1512
1514
  }, unknown>;
1513
1515
  verifyEmail: _tanstack_react_query.UseMutationResult<{
1514
1516
  expire: string;
1515
- }, AppwriteException[], VerifyEmailVariables, unknown>;
1517
+ }, AppwriteException[], {
1518
+ verifyUrl: string;
1519
+ }, unknown>;
1516
1520
  };
1517
1521
 
1518
1522
  declare const accountUpdateEmail: gql_tada.TadaDocumentNode<{
@@ -1,7 +1,7 @@
1
1
  import * as _graphql_typed_document_node_core from '@graphql-typed-document-node/core';
2
2
  import { TypedDocumentNode, ResultOf } from '@graphql-typed-document-node/core';
3
3
  import * as appwrite from 'react-native-appwrite';
4
- import { AppwriteException, Client, Account as Account$1, Avatars, Realtime, Storage, Databases, Functions, Locale as Locale$1, Messaging as Messaging$1, TablesDB as TablesDB$1, Teams, AuthenticatorType, AuthenticationFactor, OAuthProvider, Browser, CreditCard, Flag, Models, ImageGravity, ImageFormat } from 'react-native-appwrite';
4
+ import { Realtime, AppwriteException, Client, Account as Account$1, Avatars, Storage, Databases, Functions, Locale as Locale$1, Messaging as Messaging$1, TablesDB as TablesDB$1, Teams, AuthenticatorType, AuthenticationFactor, OAuthProvider, Browser, CreditCard, Flag, Models, ImageGravity, ImageFormat } from 'react-native-appwrite';
5
5
  export { AppwriteException, AuthenticationFactor, AuthenticatorType, ID, Models, OAuthProvider } from 'react-native-appwrite';
6
6
  import * as _tanstack_react_query from '@tanstack/react-query';
7
7
  import { UseMutationOptions, QueryKey, UndefinedInitialDataOptions, DefinedInitialDataOptions, UseQueryOptions, UseSuspenseQueryOptions, QueryClient } from '@tanstack/react-query';
@@ -13,6 +13,22 @@ import * as gql_tada from 'gql.tada';
13
13
  import { ResultOf as ResultOf$1, VariablesOf } from 'gql.tada';
14
14
  import * as _tanstack_query_core from '@tanstack/query-core';
15
15
 
16
+ /** Minimal realtime interface — works with both the standalone Realtime class (web) and Client-integrated realtime (React Native). */
17
+ type RealtimeLike = Pick<Realtime, 'subscribe'>;
18
+ /**
19
+ * Resolves intersection and mapped types into a flat object for cleaner IntelliSense.
20
+ * @internal
21
+ */
22
+ type Prettify<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
25
+ type QueryOptions = {
26
+ enabled?: boolean;
27
+ retry?: boolean | number | ((failureCount: number, error: unknown) => boolean);
28
+ retryDelay?: number | ((attemptIndex: number) => number);
29
+ staleTime?: number;
30
+ };
31
+
16
32
  /**
17
33
  * Returns the Appwrite client instance from context.
18
34
  * Must be used within an {@link AppwriteProvider}. Throws if called outside the provider.
@@ -21,7 +37,7 @@ declare function useAppwrite(): {
21
37
  client: appwrite.Client;
22
38
  account: appwrite.Account;
23
39
  avatars: appwrite.Avatars;
24
- realtime: appwrite.Realtime;
40
+ realtime: RealtimeLike;
25
41
  storage: appwrite.Storage;
26
42
  graphql: {
27
43
  client: appwrite.Client;
@@ -56,20 +72,6 @@ declare function useAppwrite(): {
56
72
  teams: appwrite.Teams;
57
73
  };
58
74
 
59
- /**
60
- * Resolves intersection and mapped types into a flat object for cleaner IntelliSense.
61
- * @internal
62
- */
63
- type Prettify<T> = {
64
- [K in keyof T]: T[K];
65
- } & {};
66
- type QueryOptions = {
67
- enabled?: boolean;
68
- retry?: boolean | number | ((failureCount: number, error: unknown) => boolean);
69
- retryDelay?: number | ((attemptIndex: number) => number);
70
- staleTime?: number;
71
- };
72
-
73
75
  /**
74
76
  * Wrapper around TanStack Query's `useMutation` that automatically injects the Appwrite-managed `QueryClient`.
75
77
  * Use this instead of importing `useMutation` from `@tanstack/react-query` directly.
@@ -125,7 +127,7 @@ declare function createAppwriteClient({ endpoint, projectId, }: {
125
127
  client: Client;
126
128
  account: Account$1;
127
129
  avatars: Avatars;
128
- realtime: Realtime;
130
+ realtime: RealtimeLike;
129
131
  storage: Storage;
130
132
  graphql: {
131
133
  client: Client;
@@ -1455,9 +1457,9 @@ type SignUpVariables = Prettify<Omit<VariablesOf<typeof createAccount>, 'userId'
1455
1457
  /** The result returned by the {@link useSignUp} mutation. */
1456
1458
  type SignUpResult = Prettify<ResultOf$1<typeof createAccount>['accountCreate']>;
1457
1459
  /** The variables accepted by the verify email mutation in {@link useSignUp}. */
1458
- type VerifyEmailVariables = {
1460
+ type VerifyEmailVariables = Prettify<{
1459
1461
  verifyUrl: string;
1460
- };
1462
+ }>;
1461
1463
  /** The result returned by the verify email mutation in {@link useSignUp}. */
1462
1464
  type VerifyEmailResult = Prettify<ResultOf$1<typeof verify>['accountCreateVerification']>;
1463
1465
  /**
@@ -1512,7 +1514,9 @@ declare function useSignUp(): {
1512
1514
  }, unknown>;
1513
1515
  verifyEmail: _tanstack_react_query.UseMutationResult<{
1514
1516
  expire: string;
1515
- }, AppwriteException[], VerifyEmailVariables, unknown>;
1517
+ }, AppwriteException[], {
1518
+ verifyUrl: string;
1519
+ }, unknown>;
1516
1520
  };
1517
1521
 
1518
1522
  declare const accountUpdateEmail: gql_tada.TadaDocumentNode<{