@gaganref/confect-test 10.3.1-fork.9 → 10.3.1-fork.90
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/TestConfect.d.ts +37 -11
- package/dist/TestConfect.d.ts.map +1 -1
- package/dist/TestConfect.js +22 -7
- package/dist/TestConfect.js.map +1 -1
- package/dist/internal/Attempt.d.ts +77 -0
- package/dist/internal/Attempt.d.ts.map +1 -0
- package/dist/internal/Attempt.js +154 -0
- package/dist/internal/Attempt.js.map +1 -0
- package/dist/internal/Clock.d.ts +29 -0
- package/dist/internal/Clock.d.ts.map +1 -0
- package/dist/internal/Clock.js +66 -0
- package/dist/internal/Clock.js.map +1 -0
- package/dist/internal/ConvexTest.d.ts +66 -0
- package/dist/internal/ConvexTest.d.ts.map +1 -0
- package/dist/internal/ConvexTest.js +62 -0
- package/dist/internal/ConvexTest.js.map +1 -0
- package/dist/internal/Execution.d.ts +247 -0
- package/dist/internal/Execution.d.ts.map +1 -0
- package/dist/internal/Execution.js +1024 -0
- package/dist/internal/Execution.js.map +1 -0
- package/dist/internal/Globals.d.ts +11 -0
- package/dist/internal/Globals.d.ts.map +1 -0
- package/dist/internal/Globals.js +88 -0
- package/dist/internal/Globals.js.map +1 -0
- package/dist/internal/Invocation.d.ts +68 -0
- package/dist/internal/Invocation.d.ts.map +1 -0
- package/dist/internal/Invocation.js +158 -0
- package/dist/internal/Invocation.js.map +1 -0
- package/dist/internal/Kernel.d.ts +95 -0
- package/dist/internal/Kernel.d.ts.map +1 -0
- package/dist/internal/Kernel.js +91 -0
- package/dist/internal/Kernel.js.map +1 -0
- package/dist/internal/KernelQuery.d.ts +55 -0
- package/dist/internal/KernelQuery.d.ts.map +1 -0
- package/dist/internal/KernelQuery.js +205 -0
- package/dist/internal/KernelQuery.js.map +1 -0
- package/dist/internal/KernelRefusal.d.ts +102 -0
- package/dist/internal/KernelRefusal.d.ts.map +1 -0
- package/dist/internal/KernelRefusal.js +94 -0
- package/dist/internal/KernelRefusal.js.map +1 -0
- package/dist/internal/KernelValues.d.ts +138 -0
- package/dist/internal/KernelValues.d.ts.map +1 -0
- package/dist/internal/KernelValues.js +281 -0
- package/dist/internal/KernelValues.js.map +1 -0
- package/dist/internal/MountedHttp.d.ts +1 -1
- package/dist/internal/MountedHttp.d.ts.map +1 -1
- package/dist/internal/MountedHttp.js +3 -3
- package/dist/internal/MountedHttp.js.map +1 -1
- package/dist/internal/ReadSet.d.ts +55 -0
- package/dist/internal/ReadSet.d.ts.map +1 -0
- package/dist/internal/ReadSet.js +29 -0
- package/dist/internal/ReadSet.js.map +1 -0
- package/dist/internal/Scheduling.d.ts +71 -0
- package/dist/internal/Scheduling.d.ts.map +1 -0
- package/dist/internal/Scheduling.js +60 -0
- package/dist/internal/Scheduling.js.map +1 -0
- package/package.json +5 -5
- package/src/TestConfect.ts +84 -19
- package/src/internal/Attempt.ts +185 -0
- package/src/internal/Clock.ts +95 -0
- package/src/internal/ConvexTest.ts +163 -0
- package/src/internal/Execution.ts +1795 -0
- package/src/internal/Globals.ts +113 -0
- package/src/internal/Invocation.ts +316 -0
- package/src/internal/Kernel.ts +190 -0
- package/src/internal/KernelQuery.ts +405 -0
- package/src/internal/KernelRefusal.ts +112 -0
- package/src/internal/KernelValues.ts +765 -0
- package/src/internal/MountedHttp.ts +13 -6
- package/src/internal/ReadSet.ts +108 -0
- package/src/internal/Scheduling.ts +126 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Clock.js","names":["Globals.host"],"sources":["../../src/internal/Clock.ts"],"sourcesContent":["/**\n * Convex pins `Date` inside a query or mutation to the time it started, and its\n * scheduler reads `Date.now()` for `runAfter`. The kernel wraps the realm's\n * `Date` so it answers a kernel invocation's time inside one and the host's\n * everywhere else. It sets no host timer.\n */\n\nimport * as Globals from \"./Globals.js\";\n\ntype DateConstructor = typeof globalThis.Date;\n\ninterface State {\n /**\n * Each wrapper the kernel installed, and the `Date` it wraps.\n */\n readonly bases: WeakMap<DateConstructor, DateConstructor>;\n readonly pinned: () => number | undefined;\n /**\n * Whether a kernel invocation is running, without reading its time.\n */\n readonly inside: () => boolean;\n}\n\nconst key = Symbol.for(\"@confect/test/Clock\");\n\ntype Global = { [key]?: State; Date: DateConstructor };\n\nconst wrap = (\n base: DateConstructor,\n pinned: () => number | undefined,\n): DateConstructor => {\n const proxy: DateConstructor = new Proxy(base, {\n get: (target, property) =>\n property === \"now\"\n ? () => pinned() ?? target.now()\n : Reflect.get(target, property, target),\n construct: (target, args, newTarget) => {\n const at = args.length === 0 ? pinned() : undefined;\n return Reflect.construct(\n target,\n at === undefined ? args : [at],\n newTarget === proxy ? target : newTarget,\n );\n },\n apply: (target, self, args) => {\n const at = pinned();\n return at === undefined\n ? Reflect.apply(target, self, args)\n : new target(at).toString();\n },\n });\n return proxy;\n};\n\n/**\n * Wrap the realm's current `Date`, unless the kernel already did. `pinned`\n * answers the running invocation's time, or `undefined` outside one, and\n * `inside` says whether one is running. The first install's callbacks answer\n * for every later one, as with `globalThis.Convex`. A test that fakes `Date`\n * replaces the wrapper while the fake is installed, and the next install wraps\n * the `Date` the test restores.\n */\nexport const install = (\n pinned: () => number | undefined,\n inside: () => boolean,\n) => {\n const global = globalThis as Global;\n const state = (global[key] ??= { bases: new WeakMap(), pinned, inside });\n const current = global.Date;\n if (state.bases.has(current)) return;\n const wrapper = wrap(current, () => state.pinned());\n state.bases.set(wrapper, current);\n global.Date = wrapper;\n};\n\n/**\n * Whether `date` is the kernel's wrapper inside a running kernel invocation, so\n * it already answers that invocation's time on the kernel's clock.\n */\nexport const answersInvocation = (date: DateConstructor): boolean => {\n const state = (globalThis as Global)[key];\n return state !== undefined && state.bases.has(date) && state.inside();\n};\n\n/**\n * The host's time in milliseconds, never a kernel invocation's: the real clock,\n * or a test's fake one while it is installed. It reads the test environment's\n * `Date`, never the copy a bound handler pinned.\n */\nexport const hostNow = (): number =>\n Globals.host(() => {\n const global = globalThis as Global;\n const current = global.Date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AAC1D,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { GenericSchema, SchemaDefinition } from "convex/server";
|
|
2
|
+
import * as Execution from "./Execution.js";
|
|
3
|
+
import type * as Kernel from "./Kernel.js";
|
|
4
|
+
import type * as Scheduling from "./Scheduling.js";
|
|
5
|
+
type Modules = Record<string, () => Promise<any>>;
|
|
6
|
+
/**
|
|
7
|
+
* What the kernel adds to convex-test's surface, typed. The shim itself returns
|
|
8
|
+
* `any`, as convex-test's callers expect.
|
|
9
|
+
*/
|
|
10
|
+
export interface KernelControls {
|
|
11
|
+
readonly query: (reference: any, args?: any) => Promise<any>;
|
|
12
|
+
readonly mutation: (reference: any, args?: any) => Promise<any>;
|
|
13
|
+
readonly action: (reference: any, args?: any) => Promise<any>;
|
|
14
|
+
readonly prepare: (reference: any, args?: any) => Promise<Execution.HeldAttempt>;
|
|
15
|
+
readonly apply: (id: string) => Promise<Execution.KernelApply>;
|
|
16
|
+
readonly held: () => ReadonlyArray<Execution.HeldAttempt>;
|
|
17
|
+
/**
|
|
18
|
+
* Move the kernel's clock forward, running each job due on the way at its
|
|
19
|
+
* deadline.
|
|
20
|
+
*/
|
|
21
|
+
readonly advance: (ms: number) => Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* The pending jobs, earliest deadline first.
|
|
24
|
+
*/
|
|
25
|
+
readonly jobs: () => ReadonlyArray<Scheduling.Job>;
|
|
26
|
+
/**
|
|
27
|
+
* Run the jobs due now. No future deadline is crossed.
|
|
28
|
+
*/
|
|
29
|
+
readonly finishInProgressScheduledFunctions: () => Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Run jobs at their deadlines until only standing jobs remain, or fail with
|
|
32
|
+
* `DrainBudgetExceeded` after `maxIterations` jobs. The kernel keeps its own
|
|
33
|
+
* clock, so it never calls `advanceTimers`.
|
|
34
|
+
*/
|
|
35
|
+
readonly finishAllScheduledFunctions: (advanceTimers?: () => void, maxIterations?: number) => Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* How a kit registers a component beyond its schema and modules.
|
|
39
|
+
*/
|
|
40
|
+
export interface RegisterOptions {
|
|
41
|
+
/**
|
|
42
|
+
* The component's functions, as `module:export`, that schedule their own next
|
|
43
|
+
* run, such as the crons component's `public:rescheduler`. A job that runs
|
|
44
|
+
* one, or that one schedules, is never drain work.
|
|
45
|
+
*/
|
|
46
|
+
readonly standing?: ReadonlyArray<string>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The test kernel under convex-test's `convexTest` signature. The fork's kernel
|
|
50
|
+
* lane aliases `convex-test` to this module, so every suite that calls
|
|
51
|
+
* `convexTest` directly, and `TestConfect` itself, runs on the kernel.
|
|
52
|
+
*
|
|
53
|
+
* Beyond convex-test, `prepare` runs a mutation to its commit point and holds
|
|
54
|
+
* it, and `apply` validates and publishes a held attempt. `mutation` applies
|
|
55
|
+
* each attempt it prepares at once and prepares the next on a conflict, up to
|
|
56
|
+
* attempt 5. `runtime` supplies the clock and commit timestamps. Scheduled
|
|
57
|
+
* functions run on the kernel's clock, never on a host timer.
|
|
58
|
+
*/
|
|
59
|
+
export declare function convexTest(schemaOrOptions?: SchemaDefinition<GenericSchema, boolean> | {
|
|
60
|
+
readonly schema?: SchemaDefinition<GenericSchema, boolean>;
|
|
61
|
+
readonly modules?: Modules;
|
|
62
|
+
readonly transactionLimits?: unknown;
|
|
63
|
+
readonly runtime?: Kernel.KernelRuntime;
|
|
64
|
+
}, modules?: Modules): any;
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=ConvexTest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConvexTest.d.ts","sourceRoot":"","sources":["../../src/internal/ConvexTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,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E,CACpC,aAAa,CAAC,EAAE,MAAM,IAAI,EAC1B,aAAa,CAAC,EAAE,MAAM,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC3C;AA4CD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,eAAe,CAAC,EACZ,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,GACxC;IACE,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC;CACzC,EACL,OAAO,CAAC,EAAE,OAAO,GAChB,GAAG,CAoCL"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { rowPending } from "./KernelRefusal.js";
|
|
2
|
+
import { World, anonymous, withIdentity } from "./Execution.js";
|
|
3
|
+
import { componentsGeneric } from "convex/server";
|
|
4
|
+
//#region src/internal/ConvexTest.ts
|
|
5
|
+
const isSchemaDefinition = (value) => value !== null && typeof value === "object" && "tables" in value && typeof value.tables === "object";
|
|
6
|
+
const accessor = (world, caller) => ({
|
|
7
|
+
query: (reference, args) => world.query(caller, reference, args),
|
|
8
|
+
mutation: (reference, args) => world.mutation(caller, reference, args),
|
|
9
|
+
action: (reference, args) => world.action(caller, reference, args),
|
|
10
|
+
prepare: (reference, args) => world.prepare(caller, reference, args),
|
|
11
|
+
apply: (id) => world.apply(id),
|
|
12
|
+
held: () => world.held(),
|
|
13
|
+
run: (handler) => world.run(caller, "", handler),
|
|
14
|
+
runInComponent: (componentPath, handler) => world.run(caller, componentPath, handler),
|
|
15
|
+
withIdentity: (identity) => accessor(world, withIdentity(caller, identity)),
|
|
16
|
+
withRequestMetadata: (metadata) => accessor(world, {
|
|
17
|
+
...caller,
|
|
18
|
+
ip: metadata.ip ?? null,
|
|
19
|
+
userAgent: metadata.userAgent ?? null
|
|
20
|
+
}),
|
|
21
|
+
fetch: () => Promise.reject(rowPending("HTTP routes", 6)),
|
|
22
|
+
jwks: () => Promise.reject(rowPending("JWT verification", 6)),
|
|
23
|
+
advance: (ms) => world.advance(ms),
|
|
24
|
+
jobs: () => world.jobs(),
|
|
25
|
+
finishInProgressScheduledFunctions: () => world.advance(0),
|
|
26
|
+
finishAllScheduledFunctions: (_advanceTimers, maxIterations) => world.drain(maxIterations)
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* The test kernel under convex-test's `convexTest` signature. The fork's kernel
|
|
30
|
+
* lane aliases `convex-test` to this module, so every suite that calls
|
|
31
|
+
* `convexTest` directly, and `TestConfect` itself, runs on the kernel.
|
|
32
|
+
*
|
|
33
|
+
* Beyond convex-test, `prepare` runs a mutation to its commit point and holds
|
|
34
|
+
* it, and `apply` validates and publishes a held attempt. `mutation` applies
|
|
35
|
+
* each attempt it prepares at once and prepares the next on a conflict, up to
|
|
36
|
+
* attempt 5. `runtime` supplies the clock and commit timestamps. Scheduled
|
|
37
|
+
* functions run on the kernel's clock, never on a host timer.
|
|
38
|
+
*/
|
|
39
|
+
function convexTest(schemaOrOptions, modules) {
|
|
40
|
+
let schema;
|
|
41
|
+
let runtime;
|
|
42
|
+
if (isSchemaDefinition(schemaOrOptions)) schema = schemaOrOptions;
|
|
43
|
+
else if (schemaOrOptions !== void 0) {
|
|
44
|
+
if (schemaOrOptions.transactionLimits !== void 0) throw rowPending("transaction limits", 6);
|
|
45
|
+
schema = schemaOrOptions.schema;
|
|
46
|
+
modules = schemaOrOptions.modules;
|
|
47
|
+
runtime = schemaOrOptions.runtime;
|
|
48
|
+
}
|
|
49
|
+
if (modules === void 0) throw new Error("The test kernel needs the modules map: pass `import.meta.glob(...)` as the second argument.");
|
|
50
|
+
const world = new World(schema, modules, runtime);
|
|
51
|
+
return {
|
|
52
|
+
...accessor(world, anonymous),
|
|
53
|
+
registerComponent: (componentPath, componentSchema, componentModules, options) => {
|
|
54
|
+
world.register(componentPath, componentSchema, componentModules, options?.standing);
|
|
55
|
+
return componentsGeneric()[componentPath];
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { convexTest };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=ConvexTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConvexTest.js","names":["Execution.withIdentity","KernelRefusal.rowPending","Execution.World","Execution.anonymous"],"sources":["../../src/internal/ConvexTest.ts"],"sourcesContent":["import type {\n GenericSchema,\n SchemaDefinition,\n UserIdentity,\n} from \"convex/server\";\nimport { componentsGeneric } from \"convex/server\";\nimport * as Execution from \"./Execution.js\";\nimport type * as Kernel from \"./Kernel.js\";\nimport * as KernelRefusal from \"./KernelRefusal.js\";\nimport type * as Scheduling from \"./Scheduling.js\";\n\ntype Modules = Record<string, () => Promise<any>>;\n\n/**\n * What the kernel adds to convex-test's surface, typed. The shim itself returns\n * `any`, as convex-test's callers expect.\n */\nexport interface KernelControls {\n readonly query: (reference: any, args?: any) => Promise<any>;\n readonly mutation: (reference: any, args?: any) => Promise<any>;\n readonly action: (reference: any, args?: any) => Promise<any>;\n readonly prepare: (\n reference: any,\n args?: any,\n ) => Promise<Execution.HeldAttempt>;\n readonly apply: (id: string) => Promise<Execution.KernelApply>;\n readonly held: () => ReadonlyArray<Execution.HeldAttempt>;\n /**\n * Move the kernel's clock forward, running each job due on the way at its\n * deadline.\n */\n readonly advance: (ms: number) => Promise<void>;\n /**\n * The pending jobs, earliest deadline first.\n */\n readonly jobs: () => ReadonlyArray<Scheduling.Job>;\n /**\n * Run the jobs due now. No future deadline is crossed.\n */\n readonly finishInProgressScheduledFunctions: () => Promise<void>;\n /**\n * Run jobs at their deadlines until only standing jobs remain, or fail with\n * `DrainBudgetExceeded` after `maxIterations` jobs. The kernel keeps its own\n * clock, so it never calls `advanceTimers`.\n */\n readonly finishAllScheduledFunctions: (\n advanceTimers?: () => void,\n maxIterations?: number,\n ) => Promise<void>;\n}\n\n/**\n * How a kit registers a component beyond its schema and modules.\n */\nexport interface RegisterOptions {\n /**\n * The component's functions, as `module:export`, that schedule their own next\n * run, such as the crons component's `public:rescheduler`. A job that runs\n * one, or that one schedules, is never drain work.\n */\n readonly standing?: ReadonlyArray<string>;\n}\n\nconst isSchemaDefinition = (\n value: unknown,\n): value is SchemaDefinition<GenericSchema, boolean> =>\n value !== null &&\n typeof value === \"object\" &&\n \"tables\" in value &&\n typeof (value as { tables: unknown }).tables === \"object\";\n\nconst accessor = (world: Execution.World, caller: Execution.Caller): any => ({\n query: (reference: any, args?: any) => world.query(caller, reference, args),\n mutation: (reference: any, args?: any) =>\n world.mutation(caller, reference, args),\n action: (reference: any, args?: any) => world.action(caller, reference, args),\n prepare: (reference: any, args?: any) =>\n world.prepare(caller, reference, args),\n apply: (id: string) => world.apply(id),\n held: () => world.held(),\n run: (handler: (ctx: any) => any) => world.run(caller, \"\", handler),\n runInComponent: (componentPath: string, handler: (ctx: any) => any) =>\n world.run(caller, componentPath, handler),\n withIdentity: (identity: Partial<UserIdentity>) =>\n accessor(world, Execution.withIdentity(caller, identity)),\n withRequestMetadata: (metadata: {\n readonly ip?: string | null;\n readonly userAgent?: string | null;\n }) =>\n accessor(world, {\n ...caller,\n ip: metadata.ip ?? null,\n userAgent: metadata.userAgent ?? null,\n }),\n fetch: () => Promise.reject(KernelRefusal.rowPending(\"HTTP routes\", 6)),\n jwks: () => Promise.reject(KernelRefusal.rowPending(\"JWT verification\", 6)),\n advance: (ms: number) => world.advance(ms),\n jobs: () => world.jobs(),\n finishInProgressScheduledFunctions: () => world.advance(0),\n finishAllScheduledFunctions: (\n _advanceTimers?: () => void,\n maxIterations?: number,\n ) => world.drain(maxIterations),\n});\n\n/**\n * The test kernel under convex-test's `convexTest` signature. The fork's kernel\n * lane aliases `convex-test` to this module, so every suite that calls\n * `convexTest` directly, and `TestConfect` itself, runs on the kernel.\n *\n * Beyond convex-test, `prepare` runs a mutation to its commit point and holds\n * it, and `apply` validates and publishes a held attempt. `mutation` applies\n * each attempt it prepares at once and prepares the next on a conflict, up to\n * attempt 5. `runtime` supplies the clock and commit timestamps. Scheduled\n * functions run on the kernel's clock, never on a host timer.\n */\nexport function convexTest(\n schemaOrOptions?:\n | SchemaDefinition<GenericSchema, boolean>\n | {\n readonly schema?: SchemaDefinition<GenericSchema, boolean>;\n readonly modules?: Modules;\n readonly transactionLimits?: unknown;\n readonly runtime?: Kernel.KernelRuntime;\n },\n modules?: Modules,\n): any {\n let schema: SchemaDefinition<GenericSchema, boolean> | undefined;\n let runtime: Kernel.KernelRuntime | undefined;\n if (isSchemaDefinition(schemaOrOptions)) {\n schema = schemaOrOptions;\n } else if (schemaOrOptions !== undefined) {\n if (schemaOrOptions.transactionLimits !== undefined) {\n throw KernelRefusal.rowPending(\"transaction limits\", 6);\n }\n schema = schemaOrOptions.schema;\n modules = schemaOrOptions.modules;\n runtime = schemaOrOptions.runtime;\n }\n if (modules === undefined) {\n throw new Error(\n \"The test kernel needs the modules map: pass `import.meta.glob(...)` as the second argument.\",\n );\n }\n const world = new Execution.World(schema, modules, runtime);\n return {\n ...accessor(world, Execution.anonymous),\n registerComponent: (\n componentPath: string,\n componentSchema: SchemaDefinition<GenericSchema, boolean>,\n componentModules: Modules,\n options?: RegisterOptions,\n ) => {\n world.register(\n componentPath,\n componentSchema,\n componentModules,\n options?.standing,\n );\n return (componentsGeneric() as any)[componentPath];\n },\n };\n}\n"],"mappings":";;;;AA+DA,MAAM,sBACJ,UAEA,UAAU,QACV,OAAO,UAAU,YACjB,YAAY,SACZ,OAAQ,MAA8B,WAAW;AAEnD,MAAM,YAAY,OAAwB,YAAmC;CA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AAmB;EACtC,oBACE,eACA,iBACA,kBACA,YACG;GACH,MAAM,SACJ,eACA,iBACA,kBACA,SAAS,QACX;GACA,OAAQ,kBAAkB,CAAC,CAAS;EACtC;CACF;AACF"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { type GenericSchema, type SchemaDefinition, type UserIdentity } from "convex/server";
|
|
2
|
+
import { type Value } from "convex/values";
|
|
3
|
+
import * as Invocation from "./Invocation.js";
|
|
4
|
+
import * as Kernel from "./Kernel.js";
|
|
5
|
+
import * as KernelQuery from "./KernelQuery.js";
|
|
6
|
+
import * as KernelRefusal from "./KernelRefusal.js";
|
|
7
|
+
import type * as ReadSet from "./ReadSet.js";
|
|
8
|
+
import * as Scheduling from "./Scheduling.js";
|
|
9
|
+
type Modules = Record<string, () => Promise<any>>;
|
|
10
|
+
/**
|
|
11
|
+
* One registered component: its schema, its function modules, each loaded once
|
|
12
|
+
* when the world opens, and its standing sources.
|
|
13
|
+
*/
|
|
14
|
+
interface Component {
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly schema: KernelQuery.KernelSchema | null;
|
|
17
|
+
readonly loaders: ReadonlyMap<string, () => Promise<any>>;
|
|
18
|
+
readonly loaded: Map<string, any>;
|
|
19
|
+
/**
|
|
20
|
+
* The functions, as `module:export`, that schedule their own next run. A job
|
|
21
|
+
* that runs one, or that one schedules, is never drain work.
|
|
22
|
+
*/
|
|
23
|
+
readonly standing: ReadonlySet<string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Who is calling: the identity and the request attributes a test accessor set.
|
|
27
|
+
*/
|
|
28
|
+
export interface Caller {
|
|
29
|
+
readonly identity: UserIdentity | null;
|
|
30
|
+
readonly token: string | null;
|
|
31
|
+
readonly ip: string | null;
|
|
32
|
+
readonly userAgent: string | null;
|
|
33
|
+
}
|
|
34
|
+
export declare const anonymous: Caller;
|
|
35
|
+
export declare const withIdentity: (caller: Caller, identity: Partial<UserIdentity>) => Caller;
|
|
36
|
+
/**
|
|
37
|
+
* How a prepared attempt's function ended.
|
|
38
|
+
*/
|
|
39
|
+
export type Outcome = {
|
|
40
|
+
readonly _tag: "returned";
|
|
41
|
+
readonly value: Value;
|
|
42
|
+
} | {
|
|
43
|
+
readonly _tag: "failed";
|
|
44
|
+
readonly error: unknown;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* A mutation attempt run to its commit point and held until `apply`.
|
|
48
|
+
*/
|
|
49
|
+
export interface HeldAttempt {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly request: string;
|
|
52
|
+
readonly number: Invocation.Attempt;
|
|
53
|
+
readonly snapshot: Kernel.Version;
|
|
54
|
+
readonly reads: ReadonlyArray<ReadSet.Read>;
|
|
55
|
+
readonly outcome: Outcome;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* What `apply` did with a held attempt. A conflict discards the attempt and
|
|
59
|
+
* holds exactly one next attempt, run against the latest commit. Nothing is
|
|
60
|
+
* retried until that one is applied in turn.
|
|
61
|
+
*/
|
|
62
|
+
export type KernelApply = {
|
|
63
|
+
readonly kind: "applied";
|
|
64
|
+
readonly version: Kernel.Version;
|
|
65
|
+
readonly commitTs: bigint;
|
|
66
|
+
readonly result: Value;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: "conflict";
|
|
69
|
+
readonly next: HeldAttempt;
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: "exhausted";
|
|
72
|
+
readonly error: KernelRefusal.OptimisticConcurrencyControlFailure;
|
|
73
|
+
} | {
|
|
74
|
+
readonly kind: "refused";
|
|
75
|
+
readonly tag: string;
|
|
76
|
+
readonly error: unknown;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* A test backend: its registered components and the kernel state they share.
|
|
80
|
+
*/
|
|
81
|
+
export declare class World {
|
|
82
|
+
private readonly runtime;
|
|
83
|
+
readonly components: Map<string, Component>;
|
|
84
|
+
state: Kernel.State;
|
|
85
|
+
private opened;
|
|
86
|
+
private nextDocId;
|
|
87
|
+
private lastCreationTime;
|
|
88
|
+
private nextQueryId;
|
|
89
|
+
private readonly queries;
|
|
90
|
+
private readonly holding;
|
|
91
|
+
private nextAttemptId;
|
|
92
|
+
/**
|
|
93
|
+
* The latest deadline time has been advanced to. The clock never reads
|
|
94
|
+
* earlier.
|
|
95
|
+
*/
|
|
96
|
+
private floor;
|
|
97
|
+
private readonly targets;
|
|
98
|
+
constructor(schema: SchemaDefinition<GenericSchema, boolean> | null | undefined, modules: Modules, runtime?: Kernel.KernelRuntime);
|
|
99
|
+
register(componentPath: string, schema: SchemaDefinition<GenericSchema, boolean>, modules: Modules, standing?: ReadonlyArray<string>): void;
|
|
100
|
+
/**
|
|
101
|
+
* Load every registered module of every component, once, before any function
|
|
102
|
+
* runs, then check that each standing source names an exported function.
|
|
103
|
+
*/
|
|
104
|
+
open(): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Refuse a standing source no module of its component exports.
|
|
107
|
+
*/
|
|
108
|
+
private checkStanding;
|
|
109
|
+
/**
|
|
110
|
+
* The kernel's time: the runtime's, never earlier than the latest deadline
|
|
111
|
+
* time was advanced to.
|
|
112
|
+
*/
|
|
113
|
+
now(): number;
|
|
114
|
+
private component;
|
|
115
|
+
private resolve;
|
|
116
|
+
query(caller: Caller, reference: any, args: any): Promise<any>;
|
|
117
|
+
mutation(caller: Caller, reference: any, args: any): Promise<any>;
|
|
118
|
+
action(caller: Caller, reference: any, args: any): Promise<any>;
|
|
119
|
+
run(caller: Caller, componentPath: string, handler: (ctx: any) => any): Promise<any>;
|
|
120
|
+
/**
|
|
121
|
+
* Run a mutation to its commit point and hold it as attempt 1.
|
|
122
|
+
*/
|
|
123
|
+
prepare(caller: Caller, reference: any, args: any): Promise<HeldAttempt>;
|
|
124
|
+
apply(id: string): Promise<KernelApply>;
|
|
125
|
+
/**
|
|
126
|
+
* The held attempts, oldest first.
|
|
127
|
+
*/
|
|
128
|
+
held(): ReadonlyArray<HeldAttempt>;
|
|
129
|
+
/**
|
|
130
|
+
* The committed pending jobs, earliest deadline first.
|
|
131
|
+
*/
|
|
132
|
+
jobs(): ReadonlyArray<Scheduling.Job>;
|
|
133
|
+
/**
|
|
134
|
+
* Move the clock forward `ms`, running every job whose deadline falls on the
|
|
135
|
+
* way, in deadline order, each starting at its deadline. Jobs those jobs
|
|
136
|
+
* schedule inside the window run too. `advance(0)` runs what is due now and
|
|
137
|
+
* crosses no future deadline.
|
|
138
|
+
*/
|
|
139
|
+
advance(ms: number, budget?: number): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Run jobs, earliest deadline first and each at its deadline, until only
|
|
142
|
+
* standing jobs are pending. Every job run counts against `budget`.
|
|
143
|
+
*/
|
|
144
|
+
drain(budget?: number): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Run the first of `select(pending)` until it is empty, moving the clock to
|
|
147
|
+
* each job's deadline as it starts.
|
|
148
|
+
*/
|
|
149
|
+
private walk;
|
|
150
|
+
private raiseFloor;
|
|
151
|
+
/**
|
|
152
|
+
* Run one pending job as its own request, moving its row through in progress
|
|
153
|
+
* to success or failed. `walk` picks it from the committed pending jobs and
|
|
154
|
+
* starts it in the same turn, so no cancel can land in between. The job runs
|
|
155
|
+
* as a fresh invocation of the world that scheduled it, whatever invocation
|
|
156
|
+
* the drain itself runs under.
|
|
157
|
+
*/
|
|
158
|
+
private runJob;
|
|
159
|
+
/**
|
|
160
|
+
* Write through a fresh attempt and publish it at once, as the scheduler does
|
|
161
|
+
* for an action's schedule and a job's state. Nothing runs between the
|
|
162
|
+
* snapshot and the commit, so no other commit can conflict with it.
|
|
163
|
+
*/
|
|
164
|
+
private commitNow;
|
|
165
|
+
/**
|
|
166
|
+
* Publish `writes` as the next commit, at the runtime's timestamp for it. No
|
|
167
|
+
* writes publish nothing and ask the runtime for no timestamp, which answers
|
|
168
|
+
* the latest commit's.
|
|
169
|
+
*/
|
|
170
|
+
private publishWrites;
|
|
171
|
+
/**
|
|
172
|
+
* Write a pending job into `attempt`, so the job exists only once that
|
|
173
|
+
* attempt publishes. A job that a standing function schedules, or that runs
|
|
174
|
+
* one, is standing.
|
|
175
|
+
*/
|
|
176
|
+
private scheduleJob;
|
|
177
|
+
/**
|
|
178
|
+
* Cancel a job that has not finished. A finished job stays as it ended.
|
|
179
|
+
*/
|
|
180
|
+
private cancelJob;
|
|
181
|
+
private isStanding;
|
|
182
|
+
private queryAt;
|
|
183
|
+
private mutationAt;
|
|
184
|
+
private actionAt;
|
|
185
|
+
private execution;
|
|
186
|
+
private runQuery;
|
|
187
|
+
private invokeMutation;
|
|
188
|
+
private runMutation;
|
|
189
|
+
/**
|
|
190
|
+
* Run one attempt of a top-level mutation against the latest commit, then
|
|
191
|
+
* hold it. The commit point is once the function has returned and every
|
|
192
|
+
* syscall it started has settled. A test invocation bound when the mutation
|
|
193
|
+
* was first called reaches each attempt's handler with that attempt's
|
|
194
|
+
* number.
|
|
195
|
+
*/
|
|
196
|
+
private prepareMutation;
|
|
197
|
+
/**
|
|
198
|
+
* Validate a held attempt's reads against every commit since its snapshot,
|
|
199
|
+
* then publish its writes or prepare its next attempt. An attempt that wrote
|
|
200
|
+
* nothing publishes nothing and has nothing to validate. It answers its
|
|
201
|
+
* snapshot's version and commit timestamp.
|
|
202
|
+
*/
|
|
203
|
+
private applyHeld;
|
|
204
|
+
/**
|
|
205
|
+
* Apply until the mutation publishes, is refused or is exhausted, as the
|
|
206
|
+
* binary retries a mutation that conflicts.
|
|
207
|
+
*/
|
|
208
|
+
private publish;
|
|
209
|
+
private runAction;
|
|
210
|
+
private schema;
|
|
211
|
+
private view;
|
|
212
|
+
private generateId;
|
|
213
|
+
syscall(op: string, jsonArgs: string): string;
|
|
214
|
+
/**
|
|
215
|
+
* The binary queues a query's or mutation's async syscalls and runs them one
|
|
216
|
+
* at a time, oldest first (`start_async_syscall` and `run_inner` in
|
|
217
|
+
* `crates/isolate/src/environment/udf/mod.rs`, 1.49). A write and a nested
|
|
218
|
+
* call never share a batch (`AsyncSyscallBatch::can_push` in
|
|
219
|
+
* `async_syscall.rs`), and a nested call holds the queue until it has
|
|
220
|
+
* committed or rolled back its subtransaction (`run_udf` in
|
|
221
|
+
* `async_syscall.rs`). So a caller's write made after its nested call runs
|
|
222
|
+
* after that call, and a nested mutation sees every write made before it. An
|
|
223
|
+
* action's calls run side by side.
|
|
224
|
+
*/
|
|
225
|
+
asyncSyscall(op: string, jsonArgs: string): Promise<string>;
|
|
226
|
+
private dispatchAsync;
|
|
227
|
+
jsSyscall(op: string): Promise<never>;
|
|
228
|
+
private get;
|
|
229
|
+
private insert;
|
|
230
|
+
/**
|
|
231
|
+
* A new document's creation time: `at`, or just past the latest one, so no
|
|
232
|
+
* two documents share one.
|
|
233
|
+
*/
|
|
234
|
+
private creationTime;
|
|
235
|
+
private existing;
|
|
236
|
+
private fields;
|
|
237
|
+
private patch;
|
|
238
|
+
private replace;
|
|
239
|
+
private remove;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Whether `globalThis.Convex` is the kernel's, and no other backend installed
|
|
243
|
+
* one behind it.
|
|
244
|
+
*/
|
|
245
|
+
export declare const ownsConvexGlobal: () => boolean;
|
|
246
|
+
export {};
|
|
247
|
+
//# sourceMappingURL=Execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Execution.d.ts","sourceRoot":"","sources":["../../src/internal/Execution.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAA8B,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAIvE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,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