convex 1.42.0 → 1.42.2-alpha.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/CHANGELOG.md +7 -0
- package/dist/browser.bundle.js +24 -6
- package/dist/browser.bundle.js.map +2 -2
- package/dist/cjs/browser/simple_client.js +2 -2
- package/dist/cjs/browser/simple_client.js.map +2 -2
- package/dist/cjs/browser/sync/authentication_manager.js +21 -4
- package/dist/cjs/browser/sync/authentication_manager.js.map +2 -2
- package/dist/cjs/browser/sync/client.js +2 -1
- package/dist/cjs/browser/sync/client.js.map +2 -2
- package/dist/cjs/cli/dev.js +1 -0
- package/dist/cjs/cli/dev.js.map +2 -2
- package/dist/cjs/cli/generatedApi.js.map +1 -1
- package/dist/cjs/cli/lib/api.js.map +2 -2
- package/dist/cjs/cli/lib/typecheck.js +28 -10
- package/dist/cjs/cli/lib/typecheck.js.map +2 -2
- package/dist/cjs/cli/lib/utils/utils.js +4 -12
- package/dist/cjs/cli/lib/utils/utils.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/client.js +1 -1
- package/dist/cjs/react/client.js.map +2 -2
- package/dist/cjs/react-clerk/ConvexProviderWithClerk.js +2 -1
- package/dist/cjs/react-clerk/ConvexProviderWithClerk.js.map +2 -2
- package/dist/cjs/server/database.js.map +1 -1
- package/dist/cjs/server/impl/meta_impl.js +2 -2
- package/dist/cjs/server/impl/meta_impl.js.map +2 -2
- package/dist/cjs/server/impl/query_impl.js.map +2 -2
- package/dist/cjs/server/impl/registration_impl.js +0 -2
- package/dist/cjs/server/impl/registration_impl.js.map +2 -2
- package/dist/cjs/server/meta.js.map +1 -1
- package/dist/cjs/server/query.js.map +1 -1
- package/dist/cjs/server/registration.js.map +1 -1
- package/dist/cjs/server/schema.js.map +1 -1
- package/dist/cjs-types/browser/simple_client.d.ts +1 -2
- package/dist/cjs-types/browser/simple_client.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/authentication_manager.d.ts +2 -0
- package/dist/cjs-types/browser/sync/authentication_manager.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/client.d.ts +16 -0
- package/dist/cjs-types/browser/sync/client.d.ts.map +1 -1
- package/dist/cjs-types/cli/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/dev.test.d.ts +2 -0
- package/dist/cjs-types/cli/dev.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/generatedApi.d.ts +0 -1
- package/dist/cjs-types/cli/generatedApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/api.d.ts +0 -1
- package/dist/cjs-types/cli/lib/api.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/utils/utils.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/index.d.ts.map +1 -1
- package/dist/cjs-types/react/client.d.ts.map +1 -1
- package/dist/cjs-types/react/client_provided_base_client.test.d.ts +2 -0
- package/dist/cjs-types/react/client_provided_base_client.test.d.ts.map +1 -0
- package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.d.ts +1 -0
- package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.d.ts.map +1 -1
- package/dist/cjs-types/server/database.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/query_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/registration_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/meta.d.ts.map +1 -1
- package/dist/cjs-types/server/query.d.ts.map +1 -1
- package/dist/cjs-types/server/registration.d.ts.map +1 -1
- package/dist/cjs-types/server/schema.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +58 -28
- package/dist/cli.bundle.cjs.map +3 -3
- package/dist/esm/browser/simple_client.js +5 -3
- package/dist/esm/browser/simple_client.js.map +2 -2
- package/dist/esm/browser/sync/authentication_manager.js +21 -4
- package/dist/esm/browser/sync/authentication_manager.js.map +2 -2
- package/dist/esm/browser/sync/client.js +2 -1
- package/dist/esm/browser/sync/client.js.map +2 -2
- package/dist/esm/cli/dev.js +3 -1
- package/dist/esm/cli/dev.js.map +2 -2
- package/dist/esm/cli/lib/api.js.map +2 -2
- package/dist/esm/cli/lib/typecheck.js +28 -10
- package/dist/esm/cli/lib/typecheck.js.map +3 -3
- package/dist/esm/cli/lib/utils/utils.js +4 -12
- package/dist/esm/cli/lib/utils/utils.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/client.js +1 -1
- package/dist/esm/react/client.js.map +2 -2
- package/dist/esm/react-clerk/ConvexProviderWithClerk.js +2 -1
- package/dist/esm/react-clerk/ConvexProviderWithClerk.js.map +2 -2
- package/dist/esm/server/impl/meta_impl.js +2 -2
- package/dist/esm/server/impl/meta_impl.js.map +2 -2
- package/dist/esm/server/impl/query_impl.js.map +2 -2
- package/dist/esm/server/impl/registration_impl.js +0 -2
- package/dist/esm/server/impl/registration_impl.js.map +2 -2
- package/dist/esm/server/schema.js.map +1 -1
- package/dist/esm-types/browser/simple_client.d.ts +1 -2
- package/dist/esm-types/browser/simple_client.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/authentication_manager.d.ts +2 -0
- package/dist/esm-types/browser/sync/authentication_manager.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/client.d.ts +16 -0
- package/dist/esm-types/browser/sync/client.d.ts.map +1 -1
- package/dist/esm-types/cli/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/dev.test.d.ts +2 -0
- package/dist/esm-types/cli/dev.test.d.ts.map +1 -0
- package/dist/esm-types/cli/generatedApi.d.ts +0 -1
- package/dist/esm-types/cli/generatedApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/api.d.ts +0 -1
- package/dist/esm-types/cli/lib/api.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/utils/utils.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/index.d.ts.map +1 -1
- package/dist/esm-types/react/client.d.ts.map +1 -1
- package/dist/esm-types/react/client_provided_base_client.test.d.ts +2 -0
- package/dist/esm-types/react/client_provided_base_client.test.d.ts.map +1 -0
- package/dist/esm-types/react-clerk/ConvexProviderWithClerk.d.ts +1 -0
- package/dist/esm-types/react-clerk/ConvexProviderWithClerk.d.ts.map +1 -1
- package/dist/esm-types/server/database.d.ts.map +1 -1
- package/dist/esm-types/server/impl/query_impl.d.ts.map +1 -1
- package/dist/esm-types/server/impl/registration_impl.d.ts.map +1 -1
- package/dist/esm-types/server/meta.d.ts.map +1 -1
- package/dist/esm-types/server/query.d.ts.map +1 -1
- package/dist/esm-types/server/registration.d.ts.map +1 -1
- package/dist/esm-types/server/schema.d.ts.map +1 -1
- package/dist/react.bundle.js +25 -7
- package/dist/react.bundle.js.map +2 -2
- package/package.json +2 -2
- package/src/browser/simple_client.ts +12 -10
- package/src/browser/sync/authentication_manager.ts +42 -14
- package/src/browser/sync/client.ts +17 -0
- package/src/cli/dev.test.ts +157 -0
- package/src/cli/dev.ts +7 -0
- package/src/cli/generatedApi.ts +0 -1
- package/src/cli/lib/api.ts +0 -1
- package/src/cli/lib/config.test.ts +1 -4
- package/src/cli/lib/typecheck.ts +26 -10
- package/src/cli/lib/utils/utils.ts +4 -12
- package/src/index.ts +1 -1
- package/src/react/ConvexAuthState.test.tsx +145 -0
- package/src/react/client.ts +23 -6
- package/src/react/client_provided_base_client.test.tsx +56 -0
- package/src/react-clerk/ConvexProviderWithClerk.tsx +3 -1
- package/src/server/database.ts +6 -4
- package/src/server/impl/meta_impl.ts +2 -2
- package/src/server/impl/query_impl.ts +1 -3
- package/src/server/impl/registration_impl.ts +0 -2
- package/src/server/meta.ts +10 -0
- package/src/server/query.ts +9 -6
- package/src/server/registration.ts +10 -10
- package/src/server/schema.ts +3 -2
package/src/react/client.ts
CHANGED
|
@@ -287,7 +287,22 @@ export interface MutationOptions<Args extends Record<string, Value>> {
|
|
|
287
287
|
*
|
|
288
288
|
* @public
|
|
289
289
|
*/
|
|
290
|
-
export interface ConvexReactClientOptions extends BaseConvexClientOptions {
|
|
290
|
+
export interface ConvexReactClientOptions extends BaseConvexClientOptions {
|
|
291
|
+
/**
|
|
292
|
+
* An already-constructed {@link BaseConvexClient} to use instead of
|
|
293
|
+
* constructing one internally. When provided, this client (and its
|
|
294
|
+
* derived {@link PaginatedQueryClient}) is used for all operations.
|
|
295
|
+
*
|
|
296
|
+
* @internal
|
|
297
|
+
*/
|
|
298
|
+
baseClient?: BaseConvexClient;
|
|
299
|
+
|
|
300
|
+
// FIXME: Ideally we define `ConvexReactClientOptions` as
|
|
301
|
+
// `type ConvexReactClientOptions = BaseConvexClientOptions | { baseClient: BaseConvexClient }`
|
|
302
|
+
// so that callers won’t try to set `BaseConvexClientOptions` attributes that are ineffective.
|
|
303
|
+
// But since `baseClient` is internal at the moment, I don’t think we can do that.
|
|
304
|
+
// We can fix this if we ever make `baseClient` public.
|
|
305
|
+
}
|
|
291
306
|
|
|
292
307
|
/**
|
|
293
308
|
* A Convex client for use within React.
|
|
@@ -367,11 +382,13 @@ export class ConvexReactClient {
|
|
|
367
382
|
return this.cachedSync;
|
|
368
383
|
}
|
|
369
384
|
// BaseConvexClient and paginated query client are always created together.
|
|
370
|
-
this.cachedSync =
|
|
371
|
-
this.
|
|
372
|
-
(
|
|
373
|
-
|
|
374
|
-
|
|
385
|
+
this.cachedSync =
|
|
386
|
+
this.options.baseClient ??
|
|
387
|
+
new BaseConvexClient(
|
|
388
|
+
this.address,
|
|
389
|
+
() => {}, // Use the PaginatedQueryClient's transition instead.
|
|
390
|
+
this.options,
|
|
391
|
+
);
|
|
375
392
|
if (this.adminAuth) {
|
|
376
393
|
this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity);
|
|
377
394
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { test, expect, describe, vi } from "vitest";
|
|
2
|
+
import ws from "ws";
|
|
3
|
+
|
|
4
|
+
import { ConvexReactClient } from "./client.js";
|
|
5
|
+
import { anyApi } from "../server/api.js";
|
|
6
|
+
import { BaseConvexClient } from "../browser/index.js";
|
|
7
|
+
|
|
8
|
+
const address = "https://127.0.0.1:3001";
|
|
9
|
+
|
|
10
|
+
// A minimal subclass of `BaseConvexClient` used to prove that a
|
|
11
|
+
// caller-provided `BaseConvexClient` (of any subclass) can be plugged into a
|
|
12
|
+
// `ConvexReactClient` via the `client` option.
|
|
13
|
+
class MinimalBaseConvexClient extends BaseConvexClient {}
|
|
14
|
+
|
|
15
|
+
const testBaseConvexClient = () =>
|
|
16
|
+
new MinimalBaseConvexClient(address, () => {}, {
|
|
17
|
+
webSocketConstructor: ws as unknown as typeof WebSocket,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe("ConvexReactClient with a provided BaseConvexClient", () => {
|
|
21
|
+
test("uses the provided client as its `sync` client", () => {
|
|
22
|
+
const baseClient = testBaseConvexClient();
|
|
23
|
+
const client = new ConvexReactClient(address, { baseClient });
|
|
24
|
+
expect(client.sync).toBe(baseClient);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("applies setAdminAuth called before the client is lazily instantiated", () => {
|
|
28
|
+
const baseClient = testBaseConvexClient();
|
|
29
|
+
const setAdminAuthSpy = vi.spyOn(baseClient, "setAdminAuth");
|
|
30
|
+
const client = new ConvexReactClient(address, { baseClient });
|
|
31
|
+
client.setAdminAuth("admin-token");
|
|
32
|
+
expect(setAdminAuthSpy).not.toHaveBeenCalled();
|
|
33
|
+
|
|
34
|
+
// Accessing `sync` lazily instantiates the client, applying admin auth.
|
|
35
|
+
expect(client.sync).toBe(baseClient);
|
|
36
|
+
expect(setAdminAuthSpy).toHaveBeenCalledWith("admin-token", undefined);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("queries and mutations work through the provided client", async () => {
|
|
40
|
+
const baseClient = testBaseConvexClient();
|
|
41
|
+
const client = new ConvexReactClient(address, { baseClient });
|
|
42
|
+
|
|
43
|
+
void client.mutation(
|
|
44
|
+
anyApi.myMutation.default,
|
|
45
|
+
{},
|
|
46
|
+
{
|
|
47
|
+
optimisticUpdate: (localStore) => {
|
|
48
|
+
localStore.setQuery(anyApi.myQuery.default, {}, "queryResult");
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const queryResult = client.query(anyApi.myQuery.default, {});
|
|
54
|
+
expect(await queryResult).toStrictEqual("queryResult");
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -22,6 +22,7 @@ type UseAuth = () => {
|
|
|
22
22
|
// We don't use these properties but they should trigger a new token fetch.
|
|
23
23
|
orgId: string | undefined | null;
|
|
24
24
|
orgRole: string | undefined | null;
|
|
25
|
+
sessionId: string | undefined | null;
|
|
25
26
|
sessionClaims: Record<string, unknown> | undefined | null;
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -66,6 +67,7 @@ function useUseAuthFromClerk(useAuth: UseAuth) {
|
|
|
66
67
|
getToken,
|
|
67
68
|
orgId,
|
|
68
69
|
orgRole,
|
|
70
|
+
sessionId,
|
|
69
71
|
sessionClaims,
|
|
70
72
|
} = useAuth();
|
|
71
73
|
const fetchAccessToken = useCallback(
|
|
@@ -91,7 +93,7 @@ function useUseAuthFromClerk(useAuth: UseAuth) {
|
|
|
91
93
|
// Anything else from the JWT Clerk wants to be reactive goes here too.
|
|
92
94
|
// Clerk's Expo useAuth hook is not memoized so we don't include getToken.
|
|
93
95
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
|
-
[orgId, orgRole],
|
|
96
|
+
[orgId, orgRole, sessionId],
|
|
95
97
|
);
|
|
96
98
|
return useMemo(
|
|
97
99
|
() => ({
|
package/src/server/database.ts
CHANGED
|
@@ -140,8 +140,9 @@ export interface BaseTableReader<
|
|
|
140
140
|
* @see https://docs.convex.dev/database/reading-data
|
|
141
141
|
* @public
|
|
142
142
|
*/
|
|
143
|
-
export interface GenericDatabaseReader<
|
|
144
|
-
extends
|
|
143
|
+
export interface GenericDatabaseReader<
|
|
144
|
+
DataModel extends GenericDataModel,
|
|
145
|
+
> extends BaseDatabaseReader<DataModel> {
|
|
145
146
|
/**
|
|
146
147
|
* An interface to read from the system tables within Convex query functions.
|
|
147
148
|
*
|
|
@@ -216,8 +217,9 @@ export interface GenericDatabaseReaderWithTable<
|
|
|
216
217
|
* @see https://docs.convex.dev/database/writing-data
|
|
217
218
|
* @public
|
|
218
219
|
*/
|
|
219
|
-
export interface GenericDatabaseWriter<
|
|
220
|
-
extends
|
|
220
|
+
export interface GenericDatabaseWriter<
|
|
221
|
+
DataModel extends GenericDataModel,
|
|
222
|
+
> extends GenericDatabaseReader<DataModel> {
|
|
221
223
|
/**
|
|
222
224
|
* Insert a new document into a table.
|
|
223
225
|
*
|
|
@@ -54,9 +54,9 @@ async function getDeploymentMetadata(): Promise<DeploymentMetadata> {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
async function getRequestMetadata(): Promise<RequestMetadata> {
|
|
57
|
-
const { ip, userAgent, requestId, scheduledFunctionId } =
|
|
57
|
+
const { ip, userAgent, requestId, scheduledFunctionId, authToken } =
|
|
58
58
|
await performAsyncSyscall("1.0/getRequestMetadata", {});
|
|
59
|
-
return { ip, userAgent, requestId, scheduledFunctionId };
|
|
59
|
+
return { ip, userAgent, requestId, scheduledFunctionId, authToken };
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export function setupQueryMeta(
|
|
@@ -41,9 +41,7 @@ type SerializedQuery = {
|
|
|
41
41
|
operators: Array<QueryOperator>;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
export class QueryInitializerImpl
|
|
45
|
-
implements QueryInitializer<GenericTableInfo>
|
|
46
|
-
{
|
|
44
|
+
export class QueryInitializerImpl implements QueryInitializer<GenericTableInfo> {
|
|
47
45
|
private tableName: string;
|
|
48
46
|
|
|
49
47
|
constructor(tableName: string) {
|
|
@@ -500,7 +500,6 @@ export const internalQueryGeneric: QueryBuilder<any, "internal"> = ((
|
|
|
500
500
|
async function invokeAction<
|
|
501
501
|
F extends (ctx: GenericActionCtx<GenericDataModel>, ...args: any) => any,
|
|
502
502
|
>(func: F, requestId: string, argsStr: string, visibility: FunctionVisibility) {
|
|
503
|
-
(globalThis as any).Convex?.setupPerformance?.();
|
|
504
503
|
const args = jsonToConvex(JSON.parse(argsStr));
|
|
505
504
|
const calls = setupActionCalls(requestId);
|
|
506
505
|
const ctx = {
|
|
@@ -682,7 +681,6 @@ export const internalActionGeneric: ActionBuilder<any, "internal"> = ((
|
|
|
682
681
|
async function invokeHttpAction<
|
|
683
682
|
F extends (ctx: GenericActionCtx<GenericDataModel>, request: Request) => any,
|
|
684
683
|
>(func: F, request: Request) {
|
|
685
|
-
(globalThis as any).Convex?.setupPerformance?.();
|
|
686
684
|
// TODO(presley): Change the function signature and propagate the requestId from Rust.
|
|
687
685
|
// Ok, to mock it out for now, since http endpoints are only running in V8.
|
|
688
686
|
const requestId = "";
|
package/src/server/meta.ts
CHANGED
|
@@ -114,6 +114,16 @@ export type RequestMetadata = {
|
|
|
114
114
|
* `null` when the function was not scheduled.
|
|
115
115
|
*/
|
|
116
116
|
scheduledFunctionId: string | null;
|
|
117
|
+
/**
|
|
118
|
+
* The raw auth token (a JWT) the request was authenticated with, or `null`
|
|
119
|
+
* when the request was unauthenticated or authenticated with an admin key.
|
|
120
|
+
*
|
|
121
|
+
* This is the same token that `ctx.auth.getUserIdentity()` derives its
|
|
122
|
+
* attributes from.
|
|
123
|
+
*
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
authToken: string | null;
|
|
117
127
|
};
|
|
118
128
|
|
|
119
129
|
/**
|
package/src/server/query.ts
CHANGED
|
@@ -26,8 +26,9 @@ import { SearchFilter, SearchFilterBuilder } from "./search_filter_builder.js";
|
|
|
26
26
|
*
|
|
27
27
|
* @public
|
|
28
28
|
*/
|
|
29
|
-
export interface QueryInitializer<
|
|
30
|
-
extends
|
|
29
|
+
export interface QueryInitializer<
|
|
30
|
+
TableInfo extends GenericTableInfo,
|
|
31
|
+
> extends Query<TableInfo> {
|
|
31
32
|
/**
|
|
32
33
|
* Query by reading all of the values out of this table.
|
|
33
34
|
*
|
|
@@ -163,8 +164,9 @@ export interface QueryInitializer<TableInfo extends GenericTableInfo>
|
|
|
163
164
|
*
|
|
164
165
|
* @public
|
|
165
166
|
*/
|
|
166
|
-
export interface Query<
|
|
167
|
-
extends
|
|
167
|
+
export interface Query<
|
|
168
|
+
TableInfo extends GenericTableInfo,
|
|
169
|
+
> extends OrderedQuery<TableInfo> {
|
|
168
170
|
/**
|
|
169
171
|
* Define the order of the query output.
|
|
170
172
|
*
|
|
@@ -179,8 +181,9 @@ export interface Query<TableInfo extends GenericTableInfo>
|
|
|
179
181
|
*
|
|
180
182
|
* @public
|
|
181
183
|
*/
|
|
182
|
-
export interface OrderedQuery<
|
|
183
|
-
extends
|
|
184
|
+
export interface OrderedQuery<
|
|
185
|
+
TableInfo extends GenericTableInfo,
|
|
186
|
+
> extends AsyncIterable<DocumentByInfo<TableInfo>> {
|
|
184
187
|
/**
|
|
185
188
|
* Filter the query output, returning only the values for which `predicate` evaluates to true.
|
|
186
189
|
*
|
|
@@ -763,8 +763,8 @@ export type MutationBuilder<
|
|
|
763
763
|
| Validator<any, "required", any>
|
|
764
764
|
| void,
|
|
765
765
|
ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,
|
|
766
|
-
OneOrZeroArgs extends
|
|
767
|
-
|
|
766
|
+
OneOrZeroArgs extends ArgsArrayForOptionalValidator<ArgsValidator> =
|
|
767
|
+
DefaultArgsForOptionalValidator<ArgsValidator>,
|
|
768
768
|
>(
|
|
769
769
|
mutation:
|
|
770
770
|
| {
|
|
@@ -856,8 +856,8 @@ export type MutationBuilderWithTable<
|
|
|
856
856
|
| Validator<any, "required", any>
|
|
857
857
|
| void,
|
|
858
858
|
ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,
|
|
859
|
-
OneOrZeroArgs extends
|
|
860
|
-
|
|
859
|
+
OneOrZeroArgs extends ArgsArrayForOptionalValidator<ArgsValidator> =
|
|
860
|
+
DefaultArgsForOptionalValidator<ArgsValidator>,
|
|
861
861
|
>(
|
|
862
862
|
mutation:
|
|
863
863
|
| {
|
|
@@ -949,8 +949,8 @@ export type QueryBuilder<
|
|
|
949
949
|
| Validator<any, "required", any>
|
|
950
950
|
| void,
|
|
951
951
|
ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,
|
|
952
|
-
OneOrZeroArgs extends
|
|
953
|
-
|
|
952
|
+
OneOrZeroArgs extends ArgsArrayForOptionalValidator<ArgsValidator> =
|
|
953
|
+
DefaultArgsForOptionalValidator<ArgsValidator>,
|
|
954
954
|
>(
|
|
955
955
|
query:
|
|
956
956
|
| {
|
|
@@ -1038,8 +1038,8 @@ export type QueryBuilderWithTable<
|
|
|
1038
1038
|
| Validator<any, "required", any>
|
|
1039
1039
|
| void,
|
|
1040
1040
|
ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,
|
|
1041
|
-
OneOrZeroArgs extends
|
|
1042
|
-
|
|
1041
|
+
OneOrZeroArgs extends ArgsArrayForOptionalValidator<ArgsValidator> =
|
|
1042
|
+
DefaultArgsForOptionalValidator<ArgsValidator>,
|
|
1043
1043
|
>(
|
|
1044
1044
|
query:
|
|
1045
1045
|
| {
|
|
@@ -1127,8 +1127,8 @@ export type ActionBuilder<
|
|
|
1127
1127
|
| Validator<any, "required", any>
|
|
1128
1128
|
| void,
|
|
1129
1129
|
ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,
|
|
1130
|
-
OneOrZeroArgs extends
|
|
1131
|
-
|
|
1130
|
+
OneOrZeroArgs extends ArgsArrayForOptionalValidator<ArgsValidator> =
|
|
1131
|
+
DefaultArgsForOptionalValidator<ArgsValidator>,
|
|
1132
1132
|
>(
|
|
1133
1133
|
func:
|
|
1134
1134
|
| {
|
package/src/server/schema.ts
CHANGED
|
@@ -899,7 +899,8 @@ const _systemSchema = defineSchema({
|
|
|
899
899
|
}),
|
|
900
900
|
});
|
|
901
901
|
|
|
902
|
-
export interface SystemDataModel
|
|
903
|
-
|
|
902
|
+
export interface SystemDataModel extends DataModelFromSchemaDefinition<
|
|
903
|
+
typeof _systemSchema
|
|
904
|
+
> {}
|
|
904
905
|
|
|
905
906
|
export type SystemTableNames = TableNamesInDataModel<SystemDataModel>;
|