@tailor-platform/sdk 2.36.0 → 2.37.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/{application-DaJbleMi.mjs → application-83WVdH85.mjs} +1 -1
  3. package/dist/{application-BbORWCj-.mjs → application-Cida-j1g.mjs} +36 -36
  4. package/dist/application-Cida-j1g.mjs.map +1 -0
  5. package/dist/cli/commands/deploy/deploy.d.mts +6 -1
  6. package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +1 -0
  7. package/dist/cli/commands/executor/jobs.d.mts +3 -0
  8. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -0
  9. package/dist/cli/commands/tailordb/migrate/config.d.mts +4 -0
  10. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +10 -0
  11. package/dist/cli/commands/tailordb/migrate/generate.d.mts +28 -2
  12. package/dist/cli/commands/tailordb/migrate/hints.d.mts +1 -0
  13. package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +3 -0
  14. package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +3 -1
  15. package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +4 -0
  16. package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +44 -6
  17. package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +2 -0
  18. package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +2 -0
  19. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +8 -0
  20. package/dist/cli/commands/tailordb/migrate/types.d.mts +2 -0
  21. package/dist/cli/commands/workspace/create.d.mts +1 -1
  22. package/dist/cli/lib.d.mts +2 -2
  23. package/dist/cli/lib.mjs +1 -1
  24. package/dist/cli/lib.mjs.map +1 -1
  25. package/dist/cli/main.mjs +52 -51
  26. package/dist/cli/main.mjs.map +1 -1
  27. package/dist/cli/shared/client.d.mts +26 -0
  28. package/dist/cli/shared/function-execution.d.mts +2 -0
  29. package/dist/cli/shared/prompt.d.mts +9 -4
  30. package/dist/completion/zsh-worker.zsh +21 -13
  31. package/dist/configure/config/index.d.mts +2 -0
  32. package/dist/configure/config/types.d.mts +2 -0
  33. package/dist/configure/index.mjs.map +1 -1
  34. package/dist/configure/services/tailordb/schema.d.mts +1 -0
  35. package/dist/configure/services/tailordb/types.d.mts +3 -0
  36. package/dist/crashreport-C2AcQNTe.mjs +1 -0
  37. package/dist/{crashreport-DGU6lwiX.mjs → crashreport-D_wf4GZh.mjs} +4 -4
  38. package/dist/{crashreport-DGU6lwiX.mjs.map → crashreport-D_wf4GZh.mjs.map} +1 -1
  39. package/dist/date-representation-Cr7W7Pn2.mjs.map +1 -1
  40. package/dist/{errors-BXmGBX-7.mjs → errors-Dmdnq0zi.mjs} +2 -2
  41. package/dist/errors-Dmdnq0zi.mjs.map +1 -0
  42. package/dist/{kysely-type-B0ri1-Xs.mjs → kysely-type-DVL90_oX.mjs} +6 -6
  43. package/dist/kysely-type-DVL90_oX.mjs.map +1 -0
  44. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  45. package/dist/plugin/builtin/seed/seed-type-processor.d.mts +4 -3
  46. package/dist/plugin/get-generated-table.d.mts +4 -0
  47. package/dist/plugin/index.mjs.map +1 -1
  48. package/dist/plugin/types.d.mts +55 -3
  49. package/dist/plugin/with-context.d.mts +16 -0
  50. package/dist/register-ts-hook-Ht4zCseV.mjs +1115 -0
  51. package/dist/register-ts-hook-Ht4zCseV.mjs.map +1 -0
  52. package/dist/schema-BU1aIQ63.mjs.map +1 -1
  53. package/dist/{secret-file-BxZ-J_Nz.mjs → secret-file-DiuEcLFP.mjs} +2 -2
  54. package/dist/{secret-file-BxZ-J_Nz.mjs.map → secret-file-DiuEcLFP.mjs.map} +1 -1
  55. package/dist/service-CZ0EdD2-.mjs +10 -0
  56. package/dist/service-CZ0EdD2-.mjs.map +1 -0
  57. package/dist/service-DDrbdyd-.mjs +2 -0
  58. package/dist/{service-CaGmqg0r.mjs.map → service-DDrbdyd-.mjs.map} +1 -1
  59. package/dist/service-WhSyhaho.mjs +1 -0
  60. package/dist/service_pb-BMHhVot2.mjs +1 -0
  61. package/dist/service_pb-BxMSK0gg.mjs +2 -0
  62. package/dist/service_pb-BxMSK0gg.mjs.map +1 -0
  63. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +3 -3
  64. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +92 -0
  65. package/dist/tailor-proto/src/tailor/v1/notification_pb.d.mts +176 -0
  66. package/dist/tailor-proto/src/tailor/v1/notification_resource_pb.d.mts +172 -0
  67. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +78 -0
  68. package/dist/types/app-config.generated.d.mts +1 -1
  69. package/dist/types/auth-connection.generated.d.mts +2 -2
  70. package/dist/types/auth.generated.d.mts +13 -13
  71. package/dist/types/executor.generated.d.mts +25 -25
  72. package/dist/types/field.generated.d.mts +2 -2
  73. package/dist/types/http-adapter.generated.d.mts +4 -4
  74. package/dist/types/idp.generated.d.mts +272 -272
  75. package/dist/types/resolver.generated.d.mts +10 -10
  76. package/dist/types/tailordb.generated.d.mts +84 -80
  77. package/dist/types/workflow.generated.d.mts +2 -2
  78. package/dist/vitest/date-representation.d.mts +2 -0
  79. package/dist/vitest/environment.d.mts +1 -0
  80. package/dist/vitest/environment.mjs.map +1 -1
  81. package/dist/vitest/index.mjs.map +1 -1
  82. package/dist/vitest/migration-steps.d.mts +13 -2
  83. package/dist/vitest/mock-kysely.d.mts +12 -2
  84. package/dist/vitest/mocks/aigateway.d.mts +7 -1
  85. package/dist/vitest/mocks/authconnection.d.mts +7 -1
  86. package/dist/vitest/mocks/file.d.mts +8 -2
  87. package/dist/vitest/mocks/iconv.d.mts +7 -1
  88. package/dist/vitest/mocks/idp.d.mts +7 -1
  89. package/dist/vitest/mocks/logger.d.mts +7 -1
  90. package/dist/vitest/mocks/secretmanager.d.mts +7 -1
  91. package/dist/vitest/mocks/tailordb-pglite.d.mts +12 -2
  92. package/dist/vitest/mocks/tailordb.d.mts +22 -4
  93. package/dist/vitest/mocks/workflow.d.mts +2 -1
  94. package/dist/vitest/pglite-kysely.d.mts +18 -2
  95. package/dist/vitest/pglite-temporal.d.mts +5 -1
  96. package/dist/vitest/workflow-local.d.mts +7 -0
  97. package/dist/{workspace_resource_pb-C4CkoYww.mjs → workspace_resource_pb-7smKERdZ.mjs} +2 -2
  98. package/dist/workspace_resource_pb-7smKERdZ.mjs.map +1 -0
  99. package/docs/cli/application.md +51 -21
  100. package/docs/cli/executor.md +2 -0
  101. package/docs/cli/function.md +3 -1
  102. package/docs/cli/tailordb.md +30 -22
  103. package/docs/cli/workflow.md +2 -0
  104. package/docs/cli/workspace.md +19 -17
  105. package/docs/cli-reference.md +5 -4
  106. package/docs/configuration.md +2 -2
  107. package/docs/data-clone.md +1 -1
  108. package/docs/github-actions.md +104 -15
  109. package/docs/plugin/custom.md +4 -4
  110. package/docs/runtime.md +1 -1
  111. package/docs/services/auth.md +2 -0
  112. package/docs/services/idp.md +2 -0
  113. package/docs/services/tailordb/index.md +7 -2
  114. package/docs/services/tailordb/migration.md +71 -30
  115. package/docs/services/workflow.md +1 -1
  116. package/docs/testing.md +9 -9
  117. package/package.json +13 -13
  118. package/dist/application-BbORWCj-.mjs.map +0 -1
  119. package/dist/crashreport-WsYAWARW.mjs +0 -1
  120. package/dist/errors-BXmGBX-7.mjs.map +0 -1
  121. package/dist/kysely-type-B0ri1-Xs.mjs.map +0 -1
  122. package/dist/register-ts-hook-iAcG1dfz.mjs +0 -1057
  123. package/dist/register-ts-hook-iAcG1dfz.mjs.map +0 -1
  124. package/dist/service-CaGmqg0r.mjs +0 -2
  125. package/dist/service-DTrVVaDJ.mjs +0 -1
  126. package/dist/service-hIarp2Gl.mjs +0 -8
  127. package/dist/service-hIarp2Gl.mjs.map +0 -1
  128. package/dist/service_pb-6EkMfdOb.mjs +0 -2
  129. package/dist/service_pb-6EkMfdOb.mjs.map +0 -1
  130. package/dist/service_pb-CsJKokDl.mjs +0 -1
  131. package/dist/workspace_resource_pb-C4CkoYww.mjs.map +0 -1
@@ -2,13 +2,18 @@
2
2
  * Run a multi-step migration script's `steps` in tests the way `tailor deploy`
3
3
  * does: in dependency order, each step in its own transaction.
4
4
  */
5
- /** A step as declared in a migration script's `steps`. */
5
+ /**
6
+ * A step as declared in a migration script's `steps`.
7
+ *
8
+ * **Beta:** This API may change in future releases.
9
+ */
6
10
  export interface RunnableMigrationStep<Trx, Context> {
7
11
  /** Steps that must complete before this one starts. */
8
12
  readonly dependsOn?: readonly string[];
9
13
  /** The step body; it receives its own transaction. */
10
14
  run: (trx: Trx, context: Context) => Promise<unknown>;
11
15
  }
16
+ /** **Beta:** This API may change in future releases. */
12
17
  export interface RunMigrationStepsOptions<Trx, Context extends {
13
18
  env: unknown;
14
19
  }> {
@@ -21,7 +26,11 @@ export interface RunMigrationStepsOptions<Trx, Context extends {
21
26
  /** Values passed as `env` to every step; defaults to `{}`. */
22
27
  env?: Context["env"];
23
28
  }
24
- /** Thrown by {@link runMigrationSteps} when a step fails. */
29
+ /**
30
+ * Thrown by {@link runMigrationSteps} when a step fails.
31
+ *
32
+ * **Beta:** This API may change in future releases.
33
+ */
25
34
  export declare class MigrationStepError extends Error {
26
35
  /** The step that failed. */
27
36
  readonly step: string;
@@ -33,6 +42,8 @@ export declare class MigrationStepError extends Error {
33
42
  * Run a migration script's `steps` in the order `tailor deploy` runs them,
34
43
  * committing each step separately, so a test can observe what a failure in a
35
44
  * later step leaves behind.
45
+ *
46
+ * **Beta:** This API may change in future releases.
36
47
  * @param steps - The script's exported `steps`
37
48
  * @param options - Transaction runner and env
38
49
  * @returns Names of the steps that ran, in execution order
@@ -1,5 +1,9 @@
1
1
  import { Kysely, OperationNode, OperationNodeKind, Transaction } from "kysely";
2
- /** A single statement executed against the mock, captured in order. */
2
+ /**
3
+ * A single statement executed against the mock, captured in order.
4
+ *
5
+ * **Beta:** This API may change in future releases.
6
+ */
3
7
  export interface ExecutedQuery {
4
8
  /** The Kysely operation node kind, e.g. `"SelectQueryNode"`. */
5
9
  kind: OperationNodeKind;
@@ -22,7 +26,11 @@ type MockResult = MockRow[] | {
22
26
  numAffectedRows?: number | bigint;
23
27
  };
24
28
  type QueryResolver = (query: ExecutedQuery) => MockResult | undefined;
25
- /** Controls and assertions for a {@link createKyselyMock} instance. */
29
+ /**
30
+ * Controls and assertions for a {@link createKyselyMock} instance.
31
+ *
32
+ * **Beta:** This API may change in future releases.
33
+ */
26
34
  export interface KyselyMock<DB> {
27
35
  /** The mock Kysely instance to run queries against. */
28
36
  db: Kysely<DB>;
@@ -53,6 +61,8 @@ export interface KyselyMock<DB> {
53
61
  * Create a mock Kysely instance for unit-testing code that runs Kysely queries.
54
62
  * Pass the namespace schema as the type argument, e.g.
55
63
  * `createKyselyMock<Namespace["main-db"]>()`.
64
+ *
65
+ * **Beta:** This API may change in future releases.
56
66
  * @returns A {@link KyselyMock} with the mock `db`, recorded queries, and result staging.
57
67
  */
58
68
  export declare function createKyselyMock<DB = Record<string, never>>(): KyselyMock<DB>;
@@ -2,13 +2,19 @@ import { AIGatewayName } from "@tailor-platform/sdk";
2
2
  interface AigatewayCall {
3
3
  name: AIGatewayName;
4
4
  }
5
- /** Initial fixtures for an AI Gateway mock. */
5
+ /**
6
+ * Initial fixtures for an AI Gateway mock.
7
+ *
8
+ * **Beta:** This API may change in future releases.
9
+ */
6
10
  export interface MockAigatewayOptions {
7
11
  /** AI Gateway URLs available when the mock is acquired. */
8
12
  urls?: Partial<Record<AIGatewayName, string>>;
9
13
  }
10
14
  /**
11
15
  * Acquire a disposable mock for `tailor.aigateway`. Restored on dispose.
16
+ *
17
+ * **Beta:** This API may change in future releases.
12
18
  * @param options - Initial AI Gateway URL fixtures
13
19
  * @returns Disposable AI Gateway mock control object
14
20
  * @example
@@ -2,7 +2,11 @@ import { AuthConnectionTokenResult, ConnectionName } from "@tailor-platform/sdk"
2
2
  interface AuthConnectionCall {
3
3
  connectionName: ConnectionName;
4
4
  }
5
- /** Initial fixtures and fallback behavior for an AuthConnection mock. */
5
+ /**
6
+ * Initial fixtures and fallback behavior for an AuthConnection mock.
7
+ *
8
+ * **Beta:** This API may change in future releases.
9
+ */
6
10
  export interface MockAuthconnectionOptions {
7
11
  /** Tokens available when the mock is acquired. */
8
12
  tokens?: Partial<Record<ConnectionName, AuthConnectionTokenResult>>;
@@ -11,6 +15,8 @@ export interface MockAuthconnectionOptions {
11
15
  }
12
16
  /**
13
17
  * Acquire a disposable mock for `tailor.authconnection`. Restored on dispose.
18
+ *
19
+ * **Beta:** This API may change in future releases.
14
20
  * @param options - Initial token fixtures and fallback behavior
15
21
  * @returns Disposable AuthConnection mock control object
16
22
  * @example
@@ -8,13 +8,19 @@ interface FileCall {
8
8
  fieldName: string;
9
9
  recordId: string;
10
10
  }
11
- /** Controls fallback behavior for File calls without a configured result. */
11
+ /**
12
+ * Controls fallback behavior for File calls without a configured result.
13
+ *
14
+ * **Beta:** This API may change in future releases.
15
+ */
12
16
  export interface MockFileOptions {
13
17
  /** Return a type-compatible fixture or throw when no behavior is configured. */
14
18
  onUnhandled?: "fallback" | "error";
15
19
  }
16
20
  /**
17
21
  * Acquire a disposable mock for `tailordb.file`. Restored on dispose.
22
+ *
23
+ * **Beta:** This API may change in future releases.
18
24
  * @param options - Controls behavior for calls without a configured result
19
25
  * @returns Disposable File mock control object
20
26
  * @example
@@ -45,9 +51,9 @@ export declare function mockFile(options?: MockFileOptions): {
45
51
  calls: FileCall[];
46
52
  clear(): void;
47
53
  reset(): void;
54
+ delete: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<void>>;
48
55
  download: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadResponse>>;
49
56
  downloadAsBase64: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadAsBase64Response>>;
50
- delete: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<void>>;
51
57
  getMetadata: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileMetadata>>;
52
58
  downloadStream: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadStreamResponse>>;
53
59
  uploadStream: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string, readableStream: ReadableStream<Uint8Array | ArrayBuffer>, options?: FileUploadStreamOptions) => Promise<FileUploadResponse>>;
@@ -10,13 +10,19 @@ type ConvertMockProcedure = (input: string | Uint8Array | ArrayBuffer, fromEncod
10
10
  type ConvertBufferMockProcedure = (input: Uint8Array | ArrayBuffer, fromEncoding: string, toEncoding: string) => ConversionResult;
11
11
  type EncodeMockProcedure = (input: string, encoding: string) => ConversionResult;
12
12
  type TypedOperationMock<RuntimeProcedure, MockProcedure extends (...args: never[]) => unknown> = RuntimeProcedure & MockInstance<MockProcedure>;
13
- /** Controls how unconfigured Iconv operations are handled. */
13
+ /**
14
+ * Controls how unconfigured Iconv operations are handled.
15
+ *
16
+ * **Beta:** This API may change in future releases.
17
+ */
14
18
  export interface MockIconvOptions {
15
19
  /** Return an empty type-compatible value or throw when no behavior is configured. */
16
20
  onUnhandled?: "fallback" | "error";
17
21
  }
18
22
  /**
19
23
  * Acquire a disposable mock for `tailor.iconv`. Restored on dispose.
24
+ *
25
+ * **Beta:** This API may change in future releases.
20
26
  * @param options - Fallback behavior for unconfigured operations
21
27
  * @returns Disposable Iconv mock control object
22
28
  * @example
@@ -7,7 +7,11 @@ interface IdpCall {
7
7
  args: unknown[];
8
8
  namespace: string;
9
9
  }
10
- /** Controls fallback behavior for IdP calls without a configured result. */
10
+ /**
11
+ * Controls fallback behavior for IdP calls without a configured result.
12
+ *
13
+ * **Beta:** This API may change in future releases.
14
+ */
11
15
  export interface MockIdpOptions {
12
16
  /** Return a type-compatible fixture or throw when no behavior is configured. */
13
17
  onUnhandled?: "fallback" | "error";
@@ -15,6 +19,8 @@ export interface MockIdpOptions {
15
19
  type IdpNamespaceMocks = { [Method in IdpMethod]: Mock<IdpClientInstance[Method]>; };
16
20
  /**
17
21
  * Acquire a disposable mock for `tailor.idp`. Restored on dispose.
22
+ *
23
+ * **Beta:** This API may change in future releases.
18
24
  * @param options - Controls behavior for calls without a configured result
19
25
  * @returns Disposable IDP mock control object
20
26
  * @example
@@ -6,12 +6,18 @@ interface LogCall {
6
6
  message: string;
7
7
  attributes?: LogAttributes;
8
8
  }
9
- /** Initial fixtures for a logger mock. */
9
+ /**
10
+ * Initial fixtures for a logger mock.
11
+ *
12
+ * **Beta:** This API may change in future releases.
13
+ */
10
14
  export interface MockLoggerOptions {}
11
15
  /**
12
16
  * Acquire a disposable mock for `tailor.logger`. Each method is a `vi.fn`, so
13
17
  * calls can be asserted directly; `calls` returns the `debug`/`info`/`warn`/
14
18
  * `error` entries in the order they were emitted. Restored on dispose.
19
+ *
20
+ * **Beta:** This API may change in future releases.
15
21
  * @param _options - Reserved for future initial fixtures
16
22
  * @returns Disposable logger mock control object
17
23
  * @example
@@ -4,7 +4,11 @@ interface SecretCall {
4
4
  name?: string;
5
5
  names?: readonly string[];
6
6
  }
7
- /** Initial fixtures for a Secret Manager mock. */
7
+ /**
8
+ * Initial fixtures for a Secret Manager mock.
9
+ *
10
+ * **Beta:** This API may change in future releases.
11
+ */
8
12
  export interface MockSecretmanagerOptions {
9
13
  /** Secrets to merge over fixtures inherited from the currently installed mock. */
10
14
  secrets?: Record<string, Record<string, string>>;
@@ -14,6 +18,8 @@ export interface MockSecretmanagerOptions {
14
18
  * inherited (cloned) from the currently-installed mock on acquisition and
15
19
  * restored on dispose, so secrets seeded outside the test survive across
16
20
  * `using` scopes while per-test `setSecrets()` overrides stay isolated.
21
+ *
22
+ * **Beta:** This API may change in future releases.
17
23
  * @param options - Initial Secret Manager fixtures
18
24
  * @returns Disposable SecretManager mock control object
19
25
  * @example
@@ -1,5 +1,9 @@
1
1
  import { PGliteClient } from "../pglite-kysely.mjs";
2
- /** A query executed through the PGlite-backed TailorDB client. */
2
+ /**
3
+ * A query executed through the PGlite-backed TailorDB client.
4
+ *
5
+ * **Beta:** This API may change in future releases.
6
+ */
3
7
  export interface ExecutedPGliteQuery {
4
8
  /** Namespace of the `getDB` call that issued the query. */
5
9
  namespace: string;
@@ -8,7 +12,11 @@ export interface ExecutedPGliteQuery {
8
12
  /** Parameter values bound to the placeholders. */
9
13
  params: unknown[];
10
14
  }
11
- /** Options for {@link mockTailordbWithPGlite}. */
15
+ /**
16
+ * Options for {@link mockTailordbWithPGlite}.
17
+ *
18
+ * **Beta:** This API may change in future releases.
19
+ */
12
20
  export interface MockTailordbPGliteOptions {
13
21
  /**
14
22
  * PGlite instance per `getDB` namespace. A `getDB` call for a namespace
@@ -28,6 +36,8 @@ interface CreatedClient {
28
36
  * PGlite instances are borrowed, never closed — close them yourself (e.g. in
29
37
  * `afterAll`).
30
38
  *
39
+ * **Beta:** This API may change in future releases.
40
+ *
31
41
  * Create the tables a test needs up front: run the script `kyselyTypePlugin`
32
42
  * writes when `pgliteSchemaPath` is set, or your own `CREATE TABLE`
33
43
  * statements matching the generated Kysely types. PGlite runs full PostgreSQL
@@ -1,19 +1,35 @@
1
1
  type QueryResolver = (query: string, params: unknown[]) => unknown[] | undefined;
2
- /** Controls how unmatched TailorDB queries are handled. */
2
+ /**
3
+ * Controls how unmatched TailorDB queries are handled.
4
+ *
5
+ * **Beta:** This API may change in future releases.
6
+ */
3
7
  export interface MockTailordbOptions {
4
8
  /** Return an empty result or throw when no configured query behavior matches. */
5
9
  onUnhandled?: "fallback" | "error";
6
10
  }
7
- /** Matches a TailorDB query by SQL text and optionally by parameters. */
11
+ /**
12
+ * Matches a TailorDB query by SQL text and optionally by parameters.
13
+ *
14
+ * **Beta:** This API may change in future releases.
15
+ */
8
16
  export interface QueryMatch {
9
17
  /** Exact SQL text or regular expression to match. */
10
18
  sql: string | RegExp;
11
19
  /** Exact parameters or a predicate for parameter matching. */
12
20
  params?: readonly unknown[] | ((params: unknown[]) => boolean);
13
21
  }
14
- /** Selects TailorDB queries that receive a configured response. */
22
+ /**
23
+ * Selects TailorDB queries that receive a configured response.
24
+ *
25
+ * **Beta:** This API may change in future releases.
26
+ */
15
27
  export type QueryMatcher = string | RegExp | QueryMatch | ((query: string, params: unknown[]) => boolean);
16
- /** Configures persistent and one-time responses for matched queries. */
28
+ /**
29
+ * Configures persistent and one-time responses for matched queries.
30
+ *
31
+ * **Beta:** This API may change in future releases.
32
+ */
17
33
  export interface QueryBehavior<Row> {
18
34
  /** Return these rows for every matching query after one-time responses are consumed. */
19
35
  returnsRows(rows: Row[]): QueryBehavior<Row>;
@@ -43,6 +59,8 @@ declare class MockQueryResult {
43
59
  * `tailordb.Client` whose `queryObject` is a shared `vi.fn()` (so query
44
60
  * responses can be staged before the client is constructed). Restored on
45
61
  * dispose.
62
+ *
63
+ * **Beta:** This API may change in future releases.
46
64
  * @param options - Query fallback behavior
47
65
  * @returns Disposable TailorDB mock control object
48
66
  * @example
@@ -22,7 +22,8 @@ type WaitPayload<Payload> = [Payload] extends [undefined] ? undefined : Payload;
22
22
  /**
23
23
  * Acquire a disposable mock for workflow operations (`tailor.workflow`).
24
24
  * Restored on dispose.
25
-
25
+ *
26
+ * **Beta:** This API may change in future releases.
26
27
  * @returns Disposable workflow mock control object
27
28
  * @example
28
29
  * ```typescript
@@ -1,6 +1,10 @@
1
1
  import { PGliteField } from "./pglite-temporal.mjs";
2
2
  import { ColumnType, Kysely } from "kysely";
3
- /** Result of a {@link PGliteClient.query} call. */
3
+ /**
4
+ * Result of a {@link PGliteClient.query} call.
5
+ *
6
+ * **Beta:** This API may change in future releases.
7
+ */
4
8
  export interface PGliteQueryResult {
5
9
  /** Rows returned by the statement. */
6
10
  rows: unknown[];
@@ -17,6 +21,8 @@ export interface PGliteQueryResult {
17
21
  * The subset of a `@electric-sql/pglite` `PGlite` instance used by
18
22
  * {@link createKyselyPGlite}. Any client with a compatible `query`/`close`
19
23
  * pair works.
24
+ *
25
+ * **Beta:** This API may change in future releases.
20
26
  */
21
27
  export interface PGliteClient {
22
28
  /** Run a single SQL statement with positional (`$1`, `$2`, ...) parameters. */
@@ -30,6 +36,8 @@ type UnmigratedColumn<C> = C extends ColumnType<infer S, infer I, infer U> ? Col
30
36
  * `DB` as its rows stand before the migration script has run: every column
31
37
  * accepts on insert and update whatever it can still hold on read.
32
38
  *
39
+ * **Beta:** This API may change in future releases.
40
+ *
33
41
  * The generated `db.ts` types a column the migration makes required as
34
42
  * `ColumnType<T | null, T, T>`, and an enum whose values it narrows as
35
43
  * `ColumnType<Before, After, After>`, so `migrate.ts` cannot write a null
@@ -45,7 +53,11 @@ type UnmigratedColumn<C> = C extends ColumnType<infer S, infer I, infer U> ? Col
45
53
  * ```
46
54
  */
47
55
  export type Unmigrated<DB> = { [T in keyof DB]: { [C in keyof DB[T]]: UnmigratedColumn<DB[T][C]>; }; };
48
- /** Options for {@link createKyselyPGlite}. */
56
+ /**
57
+ * Options for {@link createKyselyPGlite}.
58
+ *
59
+ * **Beta:** This API may change in future releases.
60
+ */
49
61
  export interface CreateKyselyPGliteOptions {
50
62
  /**
51
63
  * Read date/datetime/time columns back as `Temporal.PlainDate`/`Temporal.Instant`/
@@ -61,6 +73,8 @@ export interface CreateKyselyPGliteOptions {
61
73
  * {@link Unmigrated} so the test can stage the rows the script has not yet
62
74
  * backfilled: `createKyselyPGlite<Unmigrated<Database>>(new PGlite())`.
63
75
  *
76
+ * **Beta:** This API may change in future releases.
77
+ *
64
78
  * PGlite runs full PostgreSQL while TailorDB supports a subset of it, so a
65
79
  * statement passing here can still be rejected by the platform; keep a
66
80
  * statement-level test (see `createKyselyMock`) alongside.
@@ -93,6 +107,8 @@ export declare function createKyselyPGlite<DB = Record<string, never>>(client: P
93
107
  * throws, so the script under test still runs against checked relations, and calls that are nested
94
108
  * or overlap keep relations unchecked until all of them are done. NOT NULL, UNIQUE, and CHECK
95
109
  * constraints stay enforced.
110
+ *
111
+ * **Beta:** This API may change in future releases.
96
112
  * @param client - The PGlite instance the rows are written to
97
113
  * @param prepare - Writes the rows, for example with the Kysely instance of the same client
98
114
  * @returns Whatever `prepare` returns
@@ -1,4 +1,8 @@
1
- /** Name and Postgres type OID of a column PGlite returned. */
1
+ /**
2
+ * Name and Postgres type OID of a column PGlite returned.
3
+ *
4
+ * **Beta:** This API may change in future releases.
5
+ */
2
6
  export interface PGliteField {
3
7
  /** Column name */
4
8
  name: string;
@@ -6,6 +6,7 @@ type AnyWorkflowJob = WorkflowJob<string, any, any>;
6
6
  type AnyWorkflow = Workflow<AnyWorkflowJob>;
7
7
  type WorkflowInput<W extends AnyWorkflow> = W["mainJob"] extends WorkflowJob<string, infer I, any> ? I : never;
8
8
  type WorkflowOutput<W extends AnyWorkflow> = W["mainJob"] extends WorkflowJob<string, any, infer O> ? Awaited<O> : never;
9
+ /** **Beta:** This API may change in future releases. */
9
10
  export interface RunWorkflowLocallyOptions {
10
11
  /** Env passed to workflow job bodies during this local run. */
11
12
  env?: TailorEnv;
@@ -13,6 +14,8 @@ export interface RunWorkflowLocallyOptions {
13
14
  /**
14
15
  * Run a workflow's main job and dependent job starts locally with real job bodies.
15
16
  *
17
+ * **Beta:** This API may change in future releases.
18
+ *
16
19
  * Use this for local full-chain workflow tests. Regular `.start()` calls
17
20
  * delegate to the platform workflow runtime and should be mocked with
18
21
  * `mockWorkflow()` when you are not intentionally running the local chain.
@@ -22,6 +25,8 @@ export interface RunWorkflowLocallyOptions {
22
25
  export declare function runWorkflowLocally<W extends Workflow<WorkflowJob<string, undefined, any>>>(workflow: W): Promise<WorkflowOutput<W>>;
23
26
  /**
24
27
  * Run a no-input workflow locally with optional runner settings.
28
+ *
29
+ * **Beta:** This API may change in future releases.
25
30
  * @param workflow - Workflow definition to run
26
31
  * @param args - Must be `undefined` for no-input workflows
27
32
  * @param options - Local runner options
@@ -30,6 +35,8 @@ export declare function runWorkflowLocally<W extends Workflow<WorkflowJob<string
30
35
  export declare function runWorkflowLocally<W extends Workflow<WorkflowJob<string, undefined, any>>>(workflow: W, args: undefined, options?: RunWorkflowLocallyOptions): Promise<WorkflowOutput<W>>;
31
36
  /**
32
37
  * Run a workflow locally with real job bodies.
38
+ *
39
+ * **Beta:** This API may change in future releases.
33
40
  * @param workflow - Workflow definition to run
34
41
  * @param args - Arguments passed to the workflow's main job
35
42
  * @param options - Local runner options