convex 0.12.0 → 0.12.2-nobin

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.
Files changed (37) hide show
  1. package/README.md +3 -1
  2. package/api-extractor-configs/temp/api-tmp.api.md +95 -0
  3. package/api-extractor-configs/temp/browser-tmp.api.md +180 -0
  4. package/api-extractor-configs/temp/react-auth0-tmp.api.md +21 -0
  5. package/api-extractor-configs/temp/react-clerk-tmp.api.md +21 -0
  6. package/api-extractor-configs/temp/react-tmp.api.md +227 -0
  7. package/api-extractor-configs/temp/schema-tmp.api.md +105 -0
  8. package/api-extractor-configs/temp/server-tmp.api.md +535 -0
  9. package/api-extractor-configs/temp/values-tmp.api.md +94 -0
  10. package/build.py +10 -1
  11. package/dist/browser.bundle.js +1 -1
  12. package/dist/browser.bundle.js.map +1 -1
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/react-auth0/ConvexProviderWithAuth0.js.map +1 -1
  16. package/dist/cjs/react-clerk/ConvexProviderWithClerk.js.map +2 -2
  17. package/dist/cli.bundle.cjs +1 -1
  18. package/dist/cli.bundle.cjs.map +1 -1
  19. package/dist/esm/index.js +1 -1
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/react-auth0/ConvexProviderWithAuth0.js.map +1 -1
  22. package/dist/esm/react-clerk/ConvexProviderWithClerk.js.map +2 -2
  23. package/dist/react.bundle.js +1 -1
  24. package/dist/react.bundle.js.map +1 -1
  25. package/dist/types/index.d.ts +1 -1
  26. package/dist/types/react-auth0/ConvexProviderWithAuth0.d.ts +1 -2
  27. package/dist/types/react-auth0/ConvexProviderWithAuth0.d.ts.map +1 -1
  28. package/dist/types/react-clerk/ConvexProviderWithClerk.d.ts +2 -4
  29. package/dist/types/react-clerk/ConvexProviderWithClerk.d.ts.map +1 -1
  30. package/dist/types/react-clerk/react-clerk-internal.d.ts +35 -0
  31. package/dist/types/react-clerk/react-clerk.d.ts +35 -0
  32. package/package.json +2 -5
  33. package/react-clerk-api-extractor.json +18 -0
  34. package/src/index.ts +1 -1
  35. package/src/react-auth0/ConvexProviderWithAuth0.tsx +1 -1
  36. package/src/react-clerk/ConvexProviderWithClerk.tsx +3 -3
  37. /package/dist/types/{react → react-auth0}/react-auth0-internal.d.ts +0 -0
package/README.md CHANGED
@@ -25,8 +25,10 @@ This package includes several separate entry points for building apps on Convex:
25
25
  working with values stored in Convex.
26
26
  - [`convex/schema`](https://docs.convex.dev/api/modules/schema): Utilities for
27
27
  defining the schema of your Convex project.
28
- - [`convex/react-auth0`](https://docs.convex.dev/api/modules/values): A React
28
+ - [`convex/react-auth0`](https://docs.convex.dev/api/modules/react_auth0): A React
29
29
  component for authenticating users with Auth0.
30
+ - [`convex/react-clerk`](https://docs.convex.dev/api/modules/react_clerk): A React
31
+ component for authenticating users with Clerk.
30
32
 
31
33
  This package also includes [`convex`](https://docs.convex.dev/using/cli), a
32
34
  command-line interface for managing Convex projects.
@@ -0,0 +1,95 @@
1
+ ## API Report File for "convex"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // @public
8
+ export type ActionNames<API extends GenericAPI> = keyof API["allActions"] & string;
9
+
10
+ // @public
11
+ export type ApiFromModules<Modules extends Record<string, Record<string, any>>> = {
12
+ publicQueries: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
13
+ isQuery: true;
14
+ isPublic: true;
15
+ }>>>;
16
+ allQueries: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
17
+ isQuery: true;
18
+ }>>>;
19
+ publicMutations: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
20
+ isMutation: true;
21
+ isPublic: true;
22
+ }>>>;
23
+ allMutations: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
24
+ isMutation: true;
25
+ }>>>;
26
+ publicActions: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
27
+ isAction: true;
28
+ isPublic: true;
29
+ }>>>;
30
+ allActions: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
31
+ isAction: true;
32
+ }>>>;
33
+ };
34
+
35
+ // Warning: (ae-forgotten-export) The symbol "Value" needs to be exported by the entry point index.d.ts
36
+ //
37
+ // @public
38
+ export type ArgsAndOptions<F extends (args?: Record<string, Value>) => any, Options> = Parameters<F>["length"] extends 0 ? [
39
+ args?: {},
40
+ options?: Options
41
+ ] : [args: Parameters<F>[0], options?: Options];
42
+
43
+ // @public
44
+ export type ArgsObject<F extends (args?: Record<string, Value>) => any> = Parameters<F>["length"] extends 0 ? {} : Parameters<F>[0] & Record<string, Value>;
45
+
46
+ // @public
47
+ export type GenericAPI = {
48
+ publicQueries: Record<string, ConvexFunction>;
49
+ allQueries: Record<string, ConvexFunction>;
50
+ publicMutations: Record<string, ConvexFunction>;
51
+ allMutations: Record<string, ConvexFunction>;
52
+ publicActions: Record<string, ConvexFunction>;
53
+ allActions: Record<string, ConvexFunction>;
54
+ };
55
+
56
+ // @public
57
+ export type MutationNames<API extends GenericAPI> = keyof API["allMutations"] & string;
58
+
59
+ // @public
60
+ export type NamedAction<API extends GenericAPI, Name extends ActionNames<API>> = API["allActions"][Name];
61
+
62
+ // @public
63
+ export type NamedMutation<API extends GenericAPI, Name extends MutationNames<API>> = API["allMutations"][Name];
64
+
65
+ // @public
66
+ export type NamedQuery<API extends GenericAPI, Name extends QueryNames<API>> = API["allQueries"][Name];
67
+
68
+ // @public
69
+ export type OptionalRestArgs<F extends (args?: Record<string, Value>) => any> = Parameters<F>["length"] extends 0 ? [
70
+ args?: {}
71
+ ] : [args: Parameters<F>[0]];
72
+
73
+ // @public
74
+ export type PublicActionNames<API extends GenericAPI> = keyof API["publicActions"] & string;
75
+
76
+ // @public
77
+ export type PublicMutationNames<API extends GenericAPI> = keyof API["publicMutations"] & string;
78
+
79
+ // @public
80
+ export type PublicQueryNames<API extends GenericAPI> = keyof API["publicQueries"] & string;
81
+
82
+ // @public
83
+ export type QueryNames<API extends GenericAPI> = keyof API["allQueries"] & string;
84
+
85
+ // Warnings were encountered during analysis:
86
+ //
87
+ // src/api/index.ts:20:3 - (ae-forgotten-export) The symbol "ConvexFunction" needs to be exported by the entry point index.d.ts
88
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "Expand" needs to be exported by the entry point index.d.ts
89
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "ConvertToClientFunctions" needs to be exported by the entry point index.d.ts
90
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "PickByValue" needs to be exported by the entry point index.d.ts
91
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "MergeAllExports" needs to be exported by the entry point index.d.ts
92
+
93
+ // (No @packageDocumentation comment for this package)
94
+
95
+ ```
@@ -0,0 +1,180 @@
1
+ ## API Report File for "convex"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // @public
8
+ export type ActionNames<API extends GenericAPI> = keyof API["allActions"] & string;
9
+
10
+ // @public
11
+ export type ApiFromModules<Modules extends Record<string, Record<string, any>>> = {
12
+ publicQueries: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
13
+ isQuery: true;
14
+ isPublic: true;
15
+ }>>>;
16
+ allQueries: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
17
+ isQuery: true;
18
+ }>>>;
19
+ publicMutations: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
20
+ isMutation: true;
21
+ isPublic: true;
22
+ }>>>;
23
+ allMutations: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
24
+ isMutation: true;
25
+ }>>>;
26
+ publicActions: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
27
+ isAction: true;
28
+ isPublic: true;
29
+ }>>>;
30
+ allActions: Expand<ConvertToClientFunctions<PickByValue<MergeAllExports<Modules>, {
31
+ isAction: true;
32
+ }>>>;
33
+ };
34
+
35
+ // Warning: (ae-forgotten-export) The symbol "Value" needs to be exported by the entry point index.d.ts
36
+ //
37
+ // @public
38
+ export type ArgsAndOptions<F extends (args?: Record<string, Value>) => any, Options> = Parameters<F>["length"] extends 0 ? [
39
+ args?: {},
40
+ options?: Options
41
+ ] : [args: Parameters<F>[0], options?: Options];
42
+
43
+ // @public
44
+ export type ArgsObject<F extends (args?: Record<string, Value>) => any> = Parameters<F>["length"] extends 0 ? {} : Parameters<F>[0] & Record<string, Value>;
45
+
46
+ // @public
47
+ export interface ClientOptions {
48
+ unsavedChangesWarning?: boolean;
49
+ verbose?: boolean;
50
+ webSocketConstructor?: typeof WebSocket;
51
+ }
52
+
53
+ // @public
54
+ export class ConvexHttpClient<API extends GenericAPI> {
55
+ constructor(address: string);
56
+ action<Name extends PublicActionNames<API>>(name: Name, ...args: OptionalRestArgs<NamedAction<API, Name>>): Promise<ReturnType<NamedAction<API, Name>>>;
57
+ backendUrl(): string;
58
+ clearAuth(): void;
59
+ mutation<Name extends PublicMutationNames<API>>(name: Name, ...args: OptionalRestArgs<NamedMutation<API, Name>>): Promise<ReturnType<NamedMutation<API, Name>>>;
60
+ query<Name extends PublicQueryNames<API>>(name: Name, ...args: OptionalRestArgs<NamedQuery<API, Name>>): Promise<ReturnType<NamedQuery<API, Name>>>;
61
+ setAuth(value: string): void;
62
+ // @internal
63
+ setDebug(debug: boolean): void;
64
+ }
65
+
66
+ // @public
67
+ export type GenericAPI = {
68
+ publicQueries: Record<string, ConvexFunction>;
69
+ allQueries: Record<string, ConvexFunction>;
70
+ publicMutations: Record<string, ConvexFunction>;
71
+ allMutations: Record<string, ConvexFunction>;
72
+ publicActions: Record<string, ConvexFunction>;
73
+ allActions: Record<string, ConvexFunction>;
74
+ };
75
+
76
+ // @public
77
+ export class InternalConvexClient {
78
+ constructor(address: string, onTransition: (updatedQueries: QueryToken[]) => void, options?: ClientOptions);
79
+ // (undocumented)
80
+ action(udfPath: string, args: Record<string, Value>): Promise<any>;
81
+ // (undocumented)
82
+ clearAuth(): void;
83
+ // (undocumented)
84
+ close(): Promise<void>;
85
+ // Warning: (ae-forgotten-export) The symbol "ConnectionState" needs to be exported by the entry point index.d.ts
86
+ connectionState(): ConnectionState;
87
+ // (undocumented)
88
+ hasAuth(): boolean;
89
+ localQueryResult(udfPath: string, args: Record<string, Value>): Value | undefined;
90
+ // (undocumented)
91
+ mutate<Args extends Record<string, Value>>(udfPath: string, args: Args, optimisticUpdate?: OptimisticUpdate<GenericAPI, Args> | null): Promise<any>;
92
+ queryJournal(name: string, args: Record<string, Value>): QueryJournal | undefined;
93
+ // @internal (undocumented)
94
+ setAdminAuth(value: string, fakeUserIdentity?: UserIdentityAttributes): void;
95
+ // Warning: (ae-forgotten-export) The symbol "AuthTokenFetcher" needs to be exported by the entry point index.d.ts
96
+ //
97
+ // (undocumented)
98
+ setAuth(fetchToken: AuthTokenFetcher): Promise<void>;
99
+ subscribe(name: string, args?: Record<string, Value>, journal?: QueryJournal): {
100
+ queryToken: QueryToken;
101
+ unsubscribe: () => void;
102
+ };
103
+ }
104
+
105
+ // @public
106
+ export type MutationNames<API extends GenericAPI> = keyof API["allMutations"] & string;
107
+
108
+ // @public
109
+ export type NamedAction<API extends GenericAPI, Name extends ActionNames<API>> = API["allActions"][Name];
110
+
111
+ // @public
112
+ export type NamedMutation<API extends GenericAPI, Name extends MutationNames<API>> = API["allMutations"][Name];
113
+
114
+ // @public
115
+ export type NamedQuery<API extends GenericAPI, Name extends QueryNames<API>> = API["allQueries"][Name];
116
+
117
+ // @public
118
+ export interface OptimisticLocalStore<API extends GenericAPI = GenericAPI> {
119
+ getAllQueries<Name extends PublicQueryNames<API>>(name: Name): {
120
+ args: ArgsObject<NamedQuery<API, Name>>;
121
+ value: undefined | ReturnType<NamedQuery<API, Name>>;
122
+ }[];
123
+ getQuery<Name extends PublicQueryNames<API>>(name: Name, ...args: OptionalRestArgs<NamedQuery<API, Name>>): undefined | ReturnType<NamedQuery<API, Name>>;
124
+ setQuery<Name extends PublicQueryNames<API>>(name: Name, args: ArgsObject<NamedQuery<API, Name>>, value: undefined | ReturnType<NamedQuery<API, Name>>): void;
125
+ }
126
+
127
+ // @public
128
+ export type OptimisticUpdate<API extends GenericAPI, Args extends Record<string, Value>> = (localQueryStore: OptimisticLocalStore<API>, args: Args) => void;
129
+
130
+ // @public
131
+ export type OptionalRestArgs<F extends (args?: Record<string, Value>) => any> = Parameters<F>["length"] extends 0 ? [
132
+ args?: {}
133
+ ] : [args: Parameters<F>[0]];
134
+
135
+ // @public
136
+ export type PublicActionNames<API extends GenericAPI> = keyof API["publicActions"] & string;
137
+
138
+ // @public
139
+ export type PublicMutationNames<API extends GenericAPI> = keyof API["publicMutations"] & string;
140
+
141
+ // @public
142
+ export type PublicQueryNames<API extends GenericAPI> = keyof API["publicQueries"] & string;
143
+
144
+ // @public
145
+ export type QueryJournal = string | null;
146
+
147
+ // @public
148
+ export type QueryNames<API extends GenericAPI> = keyof API["allQueries"] & string;
149
+
150
+ // @public
151
+ export type QueryResult = {
152
+ success: true;
153
+ value: Value;
154
+ } | {
155
+ success: false;
156
+ errorMessage: string;
157
+ };
158
+
159
+ // @public
160
+ export type QueryToken = string;
161
+
162
+ // Warning: (ae-forgotten-export) The symbol "UserIdentity" needs to be exported by the entry point index.d.ts
163
+ // Warning: (ae-internal-missing-underscore) The name "UserIdentityAttributes" should be prefixed with an underscore because the declaration is marked as @internal
164
+ //
165
+ // @internal (undocumented)
166
+ export type UserIdentityAttributes = Omit<UserIdentity, "updatedAt" | "issuer"> & {
167
+ updatedAt?: string;
168
+ };
169
+
170
+ // Warnings were encountered during analysis:
171
+ //
172
+ // src/api/index.ts:20:3 - (ae-forgotten-export) The symbol "ConvexFunction" needs to be exported by the entry point index.d.ts
173
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "Expand" needs to be exported by the entry point index.d.ts
174
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "ConvertToClientFunctions" needs to be exported by the entry point index.d.ts
175
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "PickByValue" needs to be exported by the entry point index.d.ts
176
+ // src/api/index.ts:227:3 - (ae-forgotten-export) The symbol "MergeAllExports" needs to be exported by the entry point index.d.ts
177
+
178
+ // (No @packageDocumentation comment for this package)
179
+
180
+ ```
@@ -0,0 +1,21 @@
1
+ ## API Report File for "convex"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { ReactNode } from 'react';
8
+
9
+ // @public
10
+ export function ConvexProviderWithAuth0({ children, client, }: {
11
+ children: ReactNode;
12
+ client: IConvexReactClient;
13
+ }): JSX.Element;
14
+
15
+ // Warnings were encountered during analysis:
16
+ //
17
+ // src/react-auth0/ConvexProviderWithAuth0.tsx:30:3 - (ae-forgotten-export) The symbol "IConvexReactClient" needs to be exported by the entry point index.d.ts
18
+
19
+ // (No @packageDocumentation comment for this package)
20
+
21
+ ```
@@ -0,0 +1,21 @@
1
+ ## API Report File for "convex"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { ReactNode } from 'react';
8
+
9
+ // @public
10
+ export function ConvexProviderWithClerk({ children, client, }: {
11
+ children: ReactNode;
12
+ client: IConvexReactClient;
13
+ }): JSX.Element;
14
+
15
+ // Warnings were encountered during analysis:
16
+ //
17
+ // src/react-clerk/ConvexProviderWithClerk.tsx:32:3 - (ae-forgotten-export) The symbol "IConvexReactClient" needs to be exported by the entry point index.d.ts
18
+
19
+ // (No @packageDocumentation comment for this package)
20
+
21
+ ```
@@ -0,0 +1,227 @@
1
+ ## API Report File for "convex"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { default as React_2 } from 'react';
8
+ import { ReactNode } from 'react';
9
+
10
+ // @public
11
+ export function Authenticated({ children }: {
12
+ children: ReactNode;
13
+ }): JSX.Element | null;
14
+
15
+ // @public
16
+ export function AuthLoading({ children }: {
17
+ children: ReactNode;
18
+ }): JSX.Element | null;
19
+
20
+ // @public
21
+ export type AuthTokenFetcher = (args: {
22
+ forceRefreshToken: boolean;
23
+ }) => Promise<string | null | undefined>;
24
+
25
+ // @public
26
+ export type ConvexAuthState = {
27
+ isLoading: boolean;
28
+ isAuthenticated: boolean;
29
+ };
30
+
31
+ // @public
32
+ export const ConvexProvider: React_2.FC<{
33
+ client: ConvexReactClient<any>;
34
+ children?: React_2.ReactNode;
35
+ }>;
36
+
37
+ // @public
38
+ export function ConvexProviderWithAuth({ children, client, useAuth, }: {
39
+ children?: ReactNode;
40
+ client: IConvexReactClient;
41
+ useAuth: () => {
42
+ isLoading: boolean;
43
+ isAuthenticated: boolean;
44
+ fetchAccessToken: (args: {
45
+ forceRefreshToken: boolean;
46
+ }) => Promise<string | null>;
47
+ };
48
+ }): JSX.Element;
49
+
50
+ // Warning: (ae-forgotten-export) The symbol "GenericAPI" needs to be exported by the entry point index.d.ts
51
+ //
52
+ // @public
53
+ export class ConvexReactClient<API extends GenericAPI> {
54
+ constructor(address: string, options?: ReactClientOptions);
55
+ // Warning: (ae-forgotten-export) The symbol "PublicActionNames" needs to be exported by the entry point index.d.ts
56
+ action<Name extends PublicActionNames<API>>(name: Name): ReactAction<API, Name>;
57
+ clearAuth(): void;
58
+ close(): Promise<void>;
59
+ // Warning: (ae-forgotten-export) The symbol "ConnectionState" needs to be exported by the entry point index.d.ts
60
+ connectionState(): ConnectionState;
61
+ // Warning: (ae-forgotten-export) The symbol "PublicMutationNames" needs to be exported by the entry point index.d.ts
62
+ mutation<Name extends PublicMutationNames<API>>(name: Name): ReactMutation<API, Name>;
63
+ // Warning: (ae-forgotten-export) The symbol "UserIdentityAttributes" needs to be exported by the entry point index.d.ts
64
+ //
65
+ // @internal (undocumented)
66
+ setAdminAuth(token: string, identity?: UserIdentityAttributes): void;
67
+ setAuth(fetchToken: AuthTokenFetcher): Promise<void>;
68
+ // Warning: (ae-forgotten-export) The symbol "PublicQueryNames" needs to be exported by the entry point index.d.ts
69
+ // Warning: (ae-forgotten-export) The symbol "ArgsObject" needs to be exported by the entry point index.d.ts
70
+ // Warning: (ae-forgotten-export) The symbol "NamedQuery" needs to be exported by the entry point index.d.ts
71
+ // Warning: (ae-forgotten-export) The symbol "QueryJournal" needs to be exported by the entry point index.d.ts
72
+ watchQuery<Name extends PublicQueryNames<API>>(name: Name, args: ArgsObject<NamedQuery<API, Name>>, journal?: QueryJournal): Watch<ReturnType<NamedQuery<API, Name>>>;
73
+ }
74
+
75
+ // Warning: (ae-forgotten-export) The symbol "OptimisticLocalStore" needs to be exported by the entry point index.d.ts
76
+ //
77
+ // @public
78
+ export function optimisticallyUpdateValueInPaginatedQuery<API extends GenericAPI, Name extends PaginatedQueryNames<API>>(localStore: OptimisticLocalStore<API>, name: Name, args: PaginatedQueryArgs<NamedQuery<API, Name>>, updateValue: (currentValue: PaginatedQueryReturnType<NamedQuery<API, Name>>) => PaginatedQueryReturnType<NamedQuery<API, Name>>): void;
79
+
80
+ // Warning: (ae-forgotten-export) The symbol "Expand" needs to be exported by the entry point index.d.ts
81
+ // Warning: (ae-forgotten-export) The symbol "BetterOmit" needs to be exported by the entry point index.d.ts
82
+ //
83
+ // @public
84
+ export type PaginatedQueryArgs<Query extends PaginatedQueryFunction<any, any>> = Expand<BetterOmit<Parameters<Query>[0], "paginationOpts">>;
85
+
86
+ // Warning: (ae-forgotten-export) The symbol "PaginationResult" needs to be exported by the entry point index.d.ts
87
+ //
88
+ // @public
89
+ export type PaginatedQueryFunction<Args extends object, ReturnType> = (args: {
90
+ paginationOpts: PaginationOptions;
91
+ } & Args) => PaginationResult<ReturnType>;
92
+
93
+ // Warning: (ae-forgotten-export) The symbol "PickByValue" needs to be exported by the entry point index.d.ts
94
+ //
95
+ // @public
96
+ export type PaginatedQueryNames<API extends GenericAPI> = keyof PickByValue<API["publicQueries"], PaginatedQueryFunction<any, any>> & string;
97
+
98
+ // @public
99
+ export type PaginatedQueryReturnType<Query extends PaginatedQueryFunction<any, any>> = Query extends PaginatedQueryFunction<any, infer ReturnType> ? ReturnType : never;
100
+
101
+ // @public
102
+ export interface ReactAction<API extends GenericAPI, Name extends PublicActionNames<API>> {
103
+ // Warning: (ae-forgotten-export) The symbol "OptionalRestArgs" needs to be exported by the entry point index.d.ts
104
+ // Warning: (ae-forgotten-export) The symbol "NamedAction" needs to be exported by the entry point index.d.ts
105
+ (...args: OptionalRestArgs<NamedAction<API, Name>>): Promise<ReturnType<NamedAction<API, Name>>>;
106
+ }
107
+
108
+ // @public
109
+ export interface ReactClientOptions {
110
+ unsavedChangesWarning?: boolean;
111
+ verbose?: boolean;
112
+ webSocketConstructor?: typeof WebSocket;
113
+ }
114
+
115
+ // @public
116
+ export interface ReactMutation<API extends GenericAPI, Name extends PublicMutationNames<API>> {
117
+ // Warning: (ae-forgotten-export) The symbol "NamedMutation" needs to be exported by the entry point index.d.ts
118
+ (...args: OptionalRestArgs<NamedMutation<API, Name>>): Promise<ReturnType<NamedMutation<API, Name>>>;
119
+ // Warning: (ae-forgotten-export) The symbol "OptimisticUpdate" needs to be exported by the entry point index.d.ts
120
+ withOptimisticUpdate(optimisticUpdate: OptimisticUpdate<API, ArgsObject<NamedMutation<API, Name>>>): ReactMutation<API, Name>;
121
+ }
122
+
123
+ // @public
124
+ export type RequestForQueries = Record<string, {
125
+ name: string;
126
+ args: Record<string, Value>;
127
+ }>;
128
+
129
+ // @public
130
+ export function Unauthenticated({ children }: {
131
+ children: ReactNode;
132
+ }): JSX.Element | null;
133
+
134
+ // @public
135
+ export type UseActionForAPI<API extends GenericAPI> = <Name extends PublicActionNames<API>>(name: Name) => ReactAction<API, Name>;
136
+
137
+ // @public
138
+ export function useActionGeneric<API extends GenericAPI, Name extends PublicActionNames<API>>(name: Name): ReactAction<API, Name>;
139
+
140
+ // @public
141
+ export function useConvexAuth(): {
142
+ isLoading: boolean;
143
+ isAuthenticated: boolean;
144
+ };
145
+
146
+ // @public
147
+ export type UseConvexForAPI<API extends GenericAPI> = () => ConvexReactClient<API>;
148
+
149
+ // @public
150
+ export function useConvexGeneric<API extends GenericAPI>(): ConvexReactClient<API>;
151
+
152
+ // @public
153
+ export type UseMutationForAPI<API extends GenericAPI> = <Name extends PublicMutationNames<API>>(name: Name) => ReactMutation<API, Name>;
154
+
155
+ // @public
156
+ export function useMutationGeneric<API extends GenericAPI, Name extends PublicMutationNames<API>>(name: Name): ReactMutation<API, Name>;
157
+
158
+ // @public
159
+ export type UsePaginatedQueryForAPI<API extends GenericAPI> = <Name extends PaginatedQueryNames<API>>(name: Name, args: PaginatedQueryArgs<NamedQuery<API, Name>>, options: {
160
+ initialNumItems: number;
161
+ }) => UsePaginatedQueryResult<PaginatedQueryReturnType<NamedQuery<API, Name>>>;
162
+
163
+ // @public
164
+ export function usePaginatedQueryGeneric(name: string, args: Record<string, Value>, options: {
165
+ initialNumItems: number;
166
+ }): UsePaginatedQueryResult<any>;
167
+
168
+ // @public
169
+ export type UsePaginatedQueryResult<T> = {
170
+ results: T[];
171
+ } & ({
172
+ status: "CanLoadMore";
173
+ loadMore: (numItems: number) => void;
174
+ } | {
175
+ status: "LoadingMore";
176
+ loadMore: undefined;
177
+ } | {
178
+ status: "Exhausted";
179
+ loadMore: undefined;
180
+ });
181
+
182
+ // @public
183
+ export type UseQueriesForAPI<API extends GenericAPI> = <QueryNameMap extends Record<string, PublicQueryNames<API>>>(queries: {
184
+ [Identifier in keyof QueryNameMap]: {
185
+ name: QueryNameMap[Identifier];
186
+ args: ArgsObject<NamedQuery<API, QueryNameMap[Identifier]>>;
187
+ };
188
+ }) => {
189
+ [Identifier in keyof QueryNameMap]: ReturnType<NamedQuery<API, QueryNameMap[Identifier]>> | undefined | Error;
190
+ };
191
+
192
+ // @public
193
+ export function useQueriesGeneric(queries: RequestForQueries): Record<string, any | undefined | Error>;
194
+
195
+ // Warning: (ae-forgotten-export) The symbol "ArgsAndOptions" needs to be exported by the entry point index.d.ts
196
+ //
197
+ // @public
198
+ export type UseQueryForAPI<API extends GenericAPI> = <Name extends PublicQueryNames<API>>(name: Name, ...argsAndOptions: ArgsAndOptions<NamedQuery<API, Name>, UseQueryOptions>) => ReturnType<NamedQuery<API, Name>> | undefined;
199
+
200
+ // @public
201
+ export function useQueryGeneric(name: string, args?: Record<string, Value>, _options?: UseQueryOptions): unknown | undefined;
202
+
203
+ // Warning: (ae-internal-missing-underscore) The name "useQueryInternal" should be prefixed with an underscore because the declaration is marked as @internal
204
+ //
205
+ // @internal
206
+ export function useQueryInternal(convex: ConvexReactClient<any>, name: string, args?: Record<string, Value>, _options?: UseQueryOptions): unknown | undefined;
207
+
208
+ // @public
209
+ export interface UseQueryOptions {
210
+ }
211
+
212
+ // @public
213
+ export interface Watch<T> {
214
+ journal(): QueryJournal | undefined;
215
+ localQueryResult(): T | undefined;
216
+ onUpdate(callback: () => void): () => void;
217
+ }
218
+
219
+ // Warnings were encountered during analysis:
220
+ //
221
+ // src/react/ConvexAuthState.tsx:64:3 - (ae-forgotten-export) The symbol "IConvexReactClient" needs to be exported by the entry point index.d.ts
222
+ // src/react/use_paginated_query.ts:283:5 - (ae-forgotten-export) The symbol "PaginationOptions" needs to be exported by the entry point index.d.ts
223
+ // src/react/use_queries.ts:161:5 - (ae-forgotten-export) The symbol "Value" needs to be exported by the entry point index.d.ts
224
+
225
+ // (No @packageDocumentation comment for this package)
226
+
227
+ ```
@@ -0,0 +1,105 @@
1
+ ## API Report File for "convex"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // Warning: (ae-forgotten-export) The symbol "MaybeMakeLooseDataModel" needs to be exported by the entry point index.d.ts
8
+ // Warning: (ae-forgotten-export) The symbol "MaybeMakeLooseTableInfo" needs to be exported by the entry point index.d.ts
9
+ //
10
+ // @public
11
+ export type DataModelFromSchemaDefinition<SchemaDef extends SchemaDefinition<any, boolean>> = MaybeMakeLooseDataModel<{
12
+ [TableName in keyof SchemaDef["tables"] & string]: SchemaDef["tables"][TableName] extends TableDefinition<infer Document, infer FieldPaths, infer Indexes, infer SearchIndexes> ? MaybeMakeLooseTableInfo<{
13
+ document: Expand<IdField<TableName> & Document>;
14
+ fieldPaths: keyof IdField<TableName> | FieldPaths;
15
+ indexes: Expand<Indexes & SystemIndexes>;
16
+ searchIndexes: SearchIndexes;
17
+ }, SchemaDef["isStrict"]> : never;
18
+ }, SchemaDef["isStrict"]>;
19
+
20
+ // @public
21
+ export function defineSchema<Schema extends GenericSchema, IsStrict extends boolean = true>(schema: Schema, options?: DefineSchemaOptions<IsStrict>): SchemaDefinition<Schema, IsStrict>;
22
+
23
+ // @public
24
+ export interface DefineSchemaOptions<IsStrict extends boolean> {
25
+ // (undocumented)
26
+ exportDocumentType?: boolean;
27
+ strict?: IsStrict;
28
+ }
29
+
30
+ // Warning: (ae-forgotten-export) The symbol "Validator" needs to be exported by the entry point index.d.ts
31
+ // Warning: (ae-forgotten-export) The symbol "ExtractDocument" needs to be exported by the entry point index.d.ts
32
+ // Warning: (ae-forgotten-export) The symbol "ExtractFieldPaths" needs to be exported by the entry point index.d.ts
33
+ //
34
+ // @public
35
+ export function defineTable<DocumentSchema extends Validator<Record<string, any>, false, any>>(documentSchema: DocumentSchema): TableDefinition<ExtractDocument<DocumentSchema>, ExtractFieldPaths<DocumentSchema>>;
36
+
37
+ // Warning: (ae-forgotten-export) The symbol "ObjectValidator" needs to be exported by the entry point index.d.ts
38
+ //
39
+ // @public
40
+ export function defineTable<DocumentSchema extends Record<string, Validator<any, any, any>>>(documentSchema: DocumentSchema): TableDefinition<ExtractDocument<ObjectValidator<DocumentSchema>>, ExtractFieldPaths<ObjectValidator<DocumentSchema>>>;
41
+
42
+ // @public
43
+ export type GenericSchema = Record<string, TableDefinition>;
44
+
45
+ // @public
46
+ export class SchemaDefinition<Schema extends GenericSchema, IsStrict extends boolean> {
47
+ // @internal
48
+ constructor(tables: Schema, options?: DefineSchemaOptions<IsStrict>);
49
+ // @internal
50
+ export(): string;
51
+ // (undocumented)
52
+ isStrict: IsStrict;
53
+ // (undocumented)
54
+ tables: Schema;
55
+ }
56
+
57
+ // @public
58
+ export interface SearchIndexConfig<SearchField extends string, FilterFields extends string> {
59
+ filterFields?: FilterFields[];
60
+ searchField: SearchField;
61
+ }
62
+
63
+ // Warning: (ae-forgotten-export) The symbol "GenericDocument" needs to be exported by the entry point index.d.ts
64
+ // Warning: (ae-forgotten-export) The symbol "GenericTableIndexes" needs to be exported by the entry point index.d.ts
65
+ // Warning: (ae-forgotten-export) The symbol "GenericTableSearchIndexes" needs to be exported by the entry point index.d.ts
66
+ //
67
+ // @public
68
+ export class TableDefinition<Document extends GenericDocument = GenericDocument, FieldPaths extends string = string, Indexes extends GenericTableIndexes = {}, SearchIndexes extends GenericTableSearchIndexes = {}> {
69
+ // @internal
70
+ constructor(documentType: Validator<any, any, any>);
71
+ // @internal
72
+ export(): {
73
+ indexes: {
74
+ indexDescriptor: string;
75
+ fields: string[];
76
+ }[];
77
+ searchIndexes: {
78
+ indexDescriptor: string;
79
+ searchField: string;
80
+ filterFields: string[];
81
+ }[];
82
+ referencedTableNames: Set<string>;
83
+ documentType: string;
84
+ };
85
+ // Warning: (ae-forgotten-export) The symbol "IndexTiebreakerField" needs to be exported by the entry point index.d.ts
86
+ index<IndexName extends string, FirstFieldPath extends FieldPaths, RestFieldPaths extends FieldPaths[]>(name: IndexName, fields: [FirstFieldPath, ...RestFieldPaths]): TableDefinition<Document, FieldPaths, Expand<Indexes & Record<IndexName, [
87
+ FirstFieldPath,
88
+ ...RestFieldPaths,
89
+ IndexTiebreakerField
90
+ ]>>, SearchIndexes>;
91
+ searchIndex<IndexName extends string, SearchField extends FieldPaths, FilterFields extends FieldPaths = never>(name: IndexName, indexConfig: Expand<SearchIndexConfig<SearchField, FilterFields>>): TableDefinition<Document, FieldPaths, Indexes, Expand<SearchIndexes & Record<IndexName, {
92
+ searchField: SearchField;
93
+ filterFields: FilterFields;
94
+ }>>>;
95
+ }
96
+
97
+ // Warnings were encountered during analysis:
98
+ //
99
+ // src/schema/index.ts:448:13 - (ae-forgotten-export) The symbol "Expand" needs to be exported by the entry point index.d.ts
100
+ // src/schema/index.ts:448:13 - (ae-forgotten-export) The symbol "IdField" needs to be exported by the entry point index.d.ts
101
+ // src/schema/index.ts:450:13 - (ae-forgotten-export) The symbol "SystemIndexes" needs to be exported by the entry point index.d.ts
102
+
103
+ // (No @packageDocumentation comment for this package)
104
+
105
+ ```