@tailor-platform/sdk 2.13.1 → 2.14.1
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 +40 -0
- package/dist/application-BWOMdL3D.mjs +1 -0
- package/dist/{application-D3HlhR3i.mjs → application-CfevPO-k.mjs} +21 -17
- package/dist/application-CfevPO-k.mjs.map +1 -0
- package/dist/cli/commands/api/api-call.d.mts +4 -5
- package/dist/cli/commands/deploy/config-id-injector.d.mts +3 -4
- package/dist/cli/commands/deploy/deploy.d.mts +3 -4
- package/dist/cli/commands/deploy/function-registry-types.d.mts +2 -3
- package/dist/cli/commands/executor/get.d.mts +3 -4
- package/dist/cli/commands/executor/jobs.d.mts +10 -11
- package/dist/cli/commands/executor/list.d.mts +3 -4
- package/dist/cli/commands/executor/transform.d.mts +6 -7
- package/dist/cli/commands/executor/trigger.d.mts +4 -5
- package/dist/cli/commands/executor/webhook.d.mts +4 -5
- package/dist/cli/commands/function/get.d.mts +3 -4
- package/dist/cli/commands/function/list.d.mts +3 -4
- package/dist/cli/commands/function/transform.d.mts +2 -3
- package/dist/cli/commands/generate/options.d.mts +2 -3
- package/dist/cli/commands/generate/seed/bundler.d.mts +3 -4
- package/dist/cli/commands/generate/service.d.mts +2 -3
- package/dist/cli/commands/machineuser/list.d.mts +4 -5
- package/dist/cli/commands/machineuser/token.d.mts +4 -5
- package/dist/cli/commands/oauth2client/get.d.mts +3 -4
- package/dist/cli/commands/oauth2client/list.d.mts +3 -4
- package/dist/cli/commands/oauth2client/transform.d.mts +3 -4
- package/dist/cli/commands/organization/folder/create.d.mts +3 -4
- package/dist/cli/commands/organization/folder/delete.d.mts +3 -4
- package/dist/cli/commands/organization/folder/get.d.mts +3 -4
- package/dist/cli/commands/organization/folder/list.d.mts +3 -4
- package/dist/cli/commands/organization/folder/update.d.mts +3 -4
- package/dist/cli/commands/organization/get.d.mts +3 -4
- package/dist/cli/commands/organization/list.d.mts +3 -4
- package/dist/cli/commands/organization/transform.d.mts +5 -6
- package/dist/cli/commands/organization/tree.d.mts +3 -4
- package/dist/cli/commands/organization/update.d.mts +3 -4
- package/dist/cli/commands/remove.d.mts +3 -4
- package/dist/cli/commands/show.d.mts +6 -7
- package/dist/cli/commands/staticwebsite/deploy.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/config.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +35 -35
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +4 -5
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +13 -14
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +2 -3
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +2 -3
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +21 -22
- package/dist/cli/commands/tailordb/migrate/types.d.mts +2 -3
- package/dist/cli/commands/tailordb/truncate.d.mts +3 -4
- package/dist/cli/commands/workflow/executions.d.mts +8 -9
- package/dist/cli/commands/workflow/get.d.mts +3 -4
- package/dist/cli/commands/workflow/list.d.mts +3 -4
- package/dist/cli/commands/workflow/resume.d.mts +4 -5
- package/dist/cli/commands/workflow/start.d.mts +5 -6
- package/dist/cli/commands/workflow/status.d.mts +3 -4
- package/dist/cli/commands/workflow/transform.d.mts +5 -6
- package/dist/cli/commands/workflow/wait.d.mts +3 -4
- package/dist/cli/commands/workflow/waiter.d.mts +3 -4
- package/dist/cli/commands/workspace/app/health.d.mts +3 -4
- package/dist/cli/commands/workspace/app/list.d.mts +3 -4
- package/dist/cli/commands/workspace/app/transform.d.mts +3 -4
- package/dist/cli/commands/workspace/create.d.mts +3 -4
- package/dist/cli/commands/workspace/delete.d.mts +3 -4
- package/dist/cli/commands/workspace/get.d.mts +3 -4
- package/dist/cli/commands/workspace/list.d.mts +3 -4
- package/dist/cli/commands/workspace/restore.d.mts +3 -4
- package/dist/cli/commands/workspace/transform.d.mts +3 -4
- package/dist/cli/commands/workspace/user/invite.d.mts +3 -4
- package/dist/cli/commands/workspace/user/list.d.mts +3 -4
- package/dist/cli/commands/workspace/user/remove.d.mts +3 -4
- package/dist/cli/commands/workspace/user/transform.d.mts +2 -3
- package/dist/cli/commands/workspace/user/update.d.mts +3 -4
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.d.mts +2 -3
- package/dist/cli/main.mjs +43 -41
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +2 -3
- package/dist/cli/shared/args.d.mts +11 -12
- package/dist/cli/shared/beta.d.mts +2 -3
- package/dist/cli/shared/client.d.mts +4 -5
- package/dist/cli/shared/command.d.mts +2 -3
- package/dist/cli/shared/config-loader.d.mts +5 -6
- package/dist/cli/shared/config.d.mts +2 -3
- package/dist/cli/shared/context.d.mts +3 -4
- package/dist/cli/shared/error-json.d.mts +4 -5
- package/dist/cli/shared/logger.d.mts +7 -8
- package/dist/cli/shared/prompt.d.mts +7 -8
- package/dist/cli/shared/readonly-guard.d.mts +2 -3
- package/dist/cli/shared/script-executor.d.mts +7 -8
- package/dist/cli/shared/seed-chunker.d.mts +5 -6
- package/dist/cli/shared/seed-context.d.mts +5 -5
- package/dist/cli/shared/tailordb-namespaces.d.mts +5 -6
- package/dist/cli/shared/type-generator.d.mts +2 -3
- package/dist/cli/shared/workspace-name.d.mts +2 -3
- package/dist/completion/zsh-worker.zsh +1 -1
- package/dist/configure/config/index.d.mts +3 -4
- package/dist/configure/config/types.d.mts +14 -15
- package/dist/configure/index.d.mts +10 -10
- package/dist/configure/index.mjs +1 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +2 -2
- package/dist/configure/services/aigateway/types.d.mts +4 -5
- package/dist/configure/services/auth/index.d.mts +3 -3
- package/dist/configure/services/auth/types.d.mts +24 -25
- package/dist/configure/services/executor/executor.d.mts +3 -4
- package/dist/configure/services/executor/operation.d.mts +6 -7
- package/dist/configure/services/executor/trigger/event.d.mts +56 -57
- package/dist/configure/services/executor/trigger/index.d.mts +2 -2
- package/dist/configure/services/executor/trigger/schedule.d.mts +4 -5
- package/dist/configure/services/executor/trigger/webhook.d.mts +8 -9
- package/dist/configure/services/http-adapter/http-adapter.d.mts +12 -13
- package/dist/configure/services/idp/index.d.mts +2 -2
- package/dist/configure/services/idp/permission.d.mts +4 -5
- package/dist/configure/services/idp/types.d.mts +5 -6
- package/dist/configure/services/resolver/permission.d.mts +4 -5
- package/dist/configure/services/resolver/resolver.d.mts +3 -4
- package/dist/configure/services/resolver/types.d.mts +2 -3
- package/dist/configure/services/secrets/index.d.mts +3 -3
- package/dist/configure/services/secrets/types.d.mts +3 -4
- package/dist/configure/services/staticwebsite/index.d.mts +2 -2
- package/dist/configure/services/staticwebsite/types.d.mts +3 -4
- package/dist/configure/services/tailordb/permission.d.mts +6 -7
- package/dist/configure/services/tailordb/schema.d.mts +8 -9
- package/dist/configure/services/tailordb/types.d.mts +25 -26
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/execution-policy.types.d.mts +8 -9
- package/dist/configure/services/workflow/job.d.mts +4 -5
- package/dist/configure/services/workflow/wait-point.d.mts +5 -6
- package/dist/configure/services/workflow/workflow.d.mts +4 -4
- package/dist/configure/types/aigateway-name.d.mts +3 -4
- package/dist/configure/types/auth-namespace-name.d.mts +3 -4
- package/dist/configure/types/connection-name.d.mts +3 -4
- package/dist/configure/types/field.d.mts +3 -4
- package/dist/configure/types/field.types.d.mts +18 -12
- package/dist/configure/types/idp-name.d.mts +3 -4
- package/dist/configure/types/permission-operand.types.d.mts +7 -8
- package/dist/configure/types/type.d.mts +3 -4
- package/dist/date-DrUO8rOJ.mjs +2 -0
- package/dist/date-DrUO8rOJ.mjs.map +1 -0
- package/dist/kysely/index.d.mts +18 -18
- package/dist/parser/service/idp/types.d.mts +2 -3
- package/dist/parser/service/tailordb/type-source.d.mts +2 -3
- package/dist/parser/service/tailordb/types.d.mts +13 -14
- package/dist/plugin/builtin/enum-constants/index.d.mts +3 -4
- package/dist/plugin/builtin/file-utils/index.d.mts +3 -4
- package/dist/plugin/builtin/kysely-type/index.d.mts +4 -5
- package/dist/plugin/builtin/seed/index.d.mts +4 -5
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +2 -3
- package/dist/plugin/get-generated-table.d.mts +2 -3
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +29 -29
- package/dist/plugin/with-context.d.mts +9 -10
- package/dist/register-ts-hook-DZ1Kpt4s.mjs +642 -0
- package/dist/register-ts-hook-DZ1Kpt4s.mjs.map +1 -0
- package/dist/runtime/aigateway.d.mts +4 -5
- package/dist/runtime/authconnection.d.mts +3 -4
- package/dist/runtime/context.d.mts +6 -7
- package/dist/runtime/date.d.mts +16 -0
- package/dist/runtime/field-parse.d.mts +2 -3
- package/dist/runtime/file.d.mts +14 -15
- package/dist/runtime/globals.d.mts +2 -1
- package/dist/runtime/iconv.d.mts +5 -6
- package/dist/runtime/idp.d.mts +14 -15
- package/dist/runtime/index.d.mts +8 -7
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/logger.d.mts +10 -11
- package/dist/runtime/secretmanager.d.mts +3 -4
- package/dist/runtime/types.d.mts +7 -8
- package/dist/runtime/workflow.d.mts +7 -8
- package/dist/schema-DMlLMsWA.mjs +2 -0
- package/dist/schema-DMlLMsWA.mjs.map +1 -0
- package/dist/seed/index.d.mts +3 -3
- package/dist/service-7SCy2bhm.mjs +7 -0
- package/dist/service-7SCy2bhm.mjs.map +1 -0
- package/dist/service-CWFQ8EVo.mjs +1 -0
- package/dist/shared/src/color.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +21 -22
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +35 -36
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +6 -7
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +229 -230
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +40 -41
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +9 -10
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +3 -4
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +45 -46
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -25
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +17 -18
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +29 -30
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +8 -9
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +37 -38
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +13 -14
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +19 -20
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +25 -26
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +59 -60
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +10 -11
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +7 -8
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +37 -38
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +4 -5
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +6 -7
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +21 -22
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +3 -4
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +50 -51
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +4 -5
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +74 -75
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +35 -36
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +41 -42
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +11 -12
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +97 -98
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +11 -12
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +209 -210
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +24 -25
- package/dist/types/aigateway.generated.d.mts +3 -4
- package/dist/types/app-config.generated.d.mts +2 -3
- package/dist/types/auth-connection.generated.d.mts +3 -4
- package/dist/types/auth.generated.d.mts +15 -16
- package/dist/types/executor.generated.d.mts +26 -27
- package/dist/types/helpers.d.mts +15 -13
- package/dist/types/http-adapter.generated.d.mts +2 -3
- package/dist/types/idp.generated.d.mts +7 -8
- package/dist/types/resolver.generated.d.mts +6 -5
- package/dist/types/secrets.generated.d.mts +3 -4
- package/dist/types/staticwebsite.generated.d.mts +3 -4
- package/dist/types/tailordb.generated.d.mts +7 -8
- package/dist/types/workflow.generated.d.mts +3 -4
- package/dist/utils/test/index.d.mts +3 -4
- package/dist/vitest/index.d.mts +2 -2
- package/dist/vitest/mock-kysely.d.mts +4 -5
- package/dist/vitest/mocks/aigateway.d.mts +3 -4
- package/dist/vitest/mocks/authconnection.d.mts +3 -4
- package/dist/vitest/mocks/file.d.mts +3 -4
- package/dist/vitest/mocks/iconv.d.mts +3 -4
- package/dist/vitest/mocks/idp.d.mts +3 -4
- package/dist/vitest/mocks/logger.d.mts +3 -4
- package/dist/vitest/mocks/secretmanager.d.mts +3 -4
- package/dist/vitest/mocks/tailordb-pglite.d.mts +4 -5
- package/dist/vitest/mocks/tailordb.d.mts +6 -7
- package/dist/vitest/mocks/workflow.d.mts +2 -3
- package/dist/vitest/pglite-kysely.d.mts +5 -6
- package/dist/vitest/setup.d.mts +6 -7
- package/dist/vitest/workflow-local.d.mts +5 -6
- package/docs/services/idp.md +6 -3
- package/docs/services/resolver.md +21 -0
- package/docs/services/tailordb-migration.md +25 -3
- package/docs/services/tailordb.md +2 -0
- package/package.json +13 -13
- package/dist/application-BFTkaW6X.mjs +0 -1
- package/dist/application-D3HlhR3i.mjs.map +0 -1
- package/dist/register-ts-hook-BJmGCQAA.mjs +0 -642
- package/dist/register-ts-hook-BJmGCQAA.mjs.map +0 -1
- package/dist/schema-6d_OHyZf.mjs +0 -2
- package/dist/schema-6d_OHyZf.mjs.map +0 -1
- package/dist/service-BzsSm2f6.mjs +0 -7
- package/dist/service-BzsSm2f6.mjs.map +0 -1
- package/dist/service-CmwD9bwv.mjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AIGatewayName } from "@tailor-platform/sdk";
|
|
2
2
|
//#region src/runtime/aigateway.d.ts
|
|
3
3
|
/** Result of {@link TailorAigatewayAPI.get}. */
|
|
4
|
-
interface GetAIGatewayResult {
|
|
4
|
+
export interface GetAIGatewayResult {
|
|
5
5
|
/** The platform-assigned URL of the AI Gateway. */
|
|
6
6
|
url: string;
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ interface GetAIGatewayResult {
|
|
|
9
9
|
* Platform API surface for `tailor.aigateway`. Describes the shape the
|
|
10
10
|
* platform runtime injects on `globalThis.tailor.aigateway`.
|
|
11
11
|
*/
|
|
12
|
-
interface TailorAigatewayAPI {
|
|
12
|
+
export interface TailorAigatewayAPI {
|
|
13
13
|
/**
|
|
14
14
|
* Resolves an AI Gateway defined in the caller's own workspace.
|
|
15
15
|
* @param name - AI Gateway name, as passed to `defineAIGateway()`
|
|
@@ -18,8 +18,7 @@ interface TailorAigatewayAPI {
|
|
|
18
18
|
get(name: AIGatewayName): Promise<GetAIGatewayResult>;
|
|
19
19
|
}
|
|
20
20
|
/** Runtime wrapper namespace for `tailor.aigateway`. */
|
|
21
|
-
declare const aigateway: {
|
|
21
|
+
export declare const aigateway: {
|
|
22
22
|
readonly get: (name: AIGatewayName) => Promise<GetAIGatewayResult>;
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { GetAIGatewayResult, TailorAigatewayAPI, aigateway };
|
|
24
|
+
//#endregion
|
|
@@ -5,7 +5,7 @@ import { ConnectionName } from "@tailor-platform/sdk";
|
|
|
5
5
|
* Platform API surface for `tailor.authconnection`. Describes the shape the
|
|
6
6
|
* platform runtime injects on `globalThis.tailor.authconnection`.
|
|
7
7
|
*/
|
|
8
|
-
interface TailorAuthconnectionAPI {
|
|
8
|
+
export interface TailorAuthconnectionAPI {
|
|
9
9
|
/**
|
|
10
10
|
* Returns the access token for the given auth connection.
|
|
11
11
|
* @param connectionName - Auth connection name as defined in tailor.config
|
|
@@ -14,8 +14,7 @@ interface TailorAuthconnectionAPI {
|
|
|
14
14
|
getConnectionToken(connectionName: ConnectionName): Promise<AuthConnectionTokenResult$1>;
|
|
15
15
|
}
|
|
16
16
|
/** Runtime wrapper namespace for `tailor.authconnection`. */
|
|
17
|
-
declare const authconnection: {
|
|
17
|
+
export declare const authconnection: {
|
|
18
18
|
readonly getConnectionToken: (connectionName: ConnectionName) => Promise<AuthConnectionTokenResult$1>;
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { TailorAuthconnectionAPI, authconnection };
|
|
20
|
+
//#endregion
|
|
@@ -6,13 +6,13 @@ import { TailorPrincipal } from "./types.mjs";
|
|
|
6
6
|
* Matches the public `TailorPrincipal` shape — `attributes` is the attribute
|
|
7
7
|
* map and `attributeList` is the array of attribute IDs.
|
|
8
8
|
*/
|
|
9
|
-
type Invoker = TailorPrincipal;
|
|
9
|
+
export type Invoker = TailorPrincipal;
|
|
10
10
|
/**
|
|
11
11
|
* Raw platform-side invoker payload returned by `tailor.context.getInvoker()`.
|
|
12
12
|
* The wrapper normalizes this into {@link Invoker}.
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
interface ContextInvoker {
|
|
15
|
+
export interface ContextInvoker {
|
|
16
16
|
/** The invoker's ID */
|
|
17
17
|
id: string;
|
|
18
18
|
/** The invoker's type */
|
|
@@ -29,11 +29,11 @@ interface ContextInvoker {
|
|
|
29
29
|
* runtime injects on `globalThis.tailor.context`.
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
|
-
interface PlatformContextAPI {
|
|
32
|
+
export interface PlatformContextAPI {
|
|
33
33
|
getInvoker(): ContextInvoker | null;
|
|
34
34
|
}
|
|
35
35
|
/** Runtime wrapper API for execution context utilities. */
|
|
36
|
-
interface TailorContextAPI {
|
|
36
|
+
export interface TailorContextAPI {
|
|
37
37
|
/**
|
|
38
38
|
* Returns information about the current invoker.
|
|
39
39
|
* @returns Invoker details, or `null` for anonymous invocations
|
|
@@ -47,8 +47,7 @@ interface TailorContextAPI {
|
|
|
47
47
|
*/
|
|
48
48
|
declare function getInvoker(): Invoker | null;
|
|
49
49
|
/** Runtime wrapper namespace for `tailor.context`. */
|
|
50
|
-
declare const context: {
|
|
50
|
+
export declare const context: {
|
|
51
51
|
readonly getInvoker: typeof getInvoker;
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
|
-
export { ContextInvoker, Invoker, PlatformContextAPI, TailorContextAPI, context };
|
|
53
|
+
//#endregion
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldMetadata, TailorFieldType } from "../configure/types/field.types.mjs";
|
|
2
|
+
//#region src/runtime/date.d.ts
|
|
3
|
+
type DateField = {
|
|
4
|
+
readonly type: TailorFieldType;
|
|
5
|
+
readonly metadata: FieldMetadata;
|
|
6
|
+
readonly fields: Record<string, DateField>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Convert fields using the Date representation to YYYY-MM-DD strings in UTC.
|
|
10
|
+
* @param field - Date or object field defining the value's shape
|
|
11
|
+
* @param value - Value to serialize
|
|
12
|
+
* @returns Value with Date fields converted to strings
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function serializeDateFields(field: DateField, value: unknown): unknown;
|
|
16
|
+
//#endregion
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { TailorPrincipal } from "./types.mjs";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
//#region src/runtime/field-parse.d.ts
|
|
4
|
-
type FieldParseArgs = {
|
|
4
|
+
export type FieldParseArgs = {
|
|
5
5
|
value: unknown;
|
|
6
6
|
data: unknown;
|
|
7
7
|
invoker: TailorPrincipal | null;
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
|
-
export { FieldParseArgs };
|
|
9
|
+
//#endregion
|
package/dist/runtime/file.d.mts
CHANGED
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
* );
|
|
18
18
|
*/
|
|
19
19
|
/** Upload response metadata. */
|
|
20
|
-
interface UploadMetadata {
|
|
20
|
+
export interface UploadMetadata {
|
|
21
21
|
fileSize: number;
|
|
22
22
|
sha256sum: string;
|
|
23
23
|
}
|
|
24
24
|
/** Download response metadata. */
|
|
25
|
-
interface DownloadMetadata {
|
|
25
|
+
export interface DownloadMetadata {
|
|
26
26
|
contentType: string;
|
|
27
27
|
fileSize: number;
|
|
28
28
|
sha256sum: string;
|
|
29
29
|
lastUploadedAt: string;
|
|
30
30
|
}
|
|
31
31
|
/** File metadata (for {@link TailorDBFileAPI.getMetadata}). */
|
|
32
|
-
interface FileMetadata {
|
|
32
|
+
export interface FileMetadata {
|
|
33
33
|
contentType: string;
|
|
34
34
|
fileSize: number;
|
|
35
35
|
sha256sum: string;
|
|
@@ -37,42 +37,42 @@ interface FileMetadata {
|
|
|
37
37
|
lastUploadedAt?: string;
|
|
38
38
|
}
|
|
39
39
|
/** Upload options. */
|
|
40
|
-
interface FileUploadOptions {
|
|
40
|
+
export interface FileUploadOptions {
|
|
41
41
|
contentType?: string;
|
|
42
42
|
}
|
|
43
43
|
/** Upload stream options. */
|
|
44
|
-
interface FileUploadStreamOptions {
|
|
44
|
+
export interface FileUploadStreamOptions {
|
|
45
45
|
contentType?: string;
|
|
46
46
|
fileSize?: number;
|
|
47
47
|
}
|
|
48
48
|
/** Upload response. */
|
|
49
|
-
interface FileUploadResponse {
|
|
49
|
+
export interface FileUploadResponse {
|
|
50
50
|
metadata: UploadMetadata;
|
|
51
51
|
}
|
|
52
52
|
/** Download response. */
|
|
53
|
-
interface FileDownloadResponse {
|
|
53
|
+
export interface FileDownloadResponse {
|
|
54
54
|
data: Uint8Array;
|
|
55
55
|
metadata: DownloadMetadata;
|
|
56
56
|
}
|
|
57
57
|
/** Download-as-Base64 response. */
|
|
58
|
-
interface FileDownloadAsBase64Response {
|
|
58
|
+
export interface FileDownloadAsBase64Response {
|
|
59
59
|
data: string;
|
|
60
60
|
metadata: DownloadMetadata;
|
|
61
61
|
}
|
|
62
62
|
/** Download stream response. */
|
|
63
|
-
interface FileDownloadStreamResponse {
|
|
63
|
+
export interface FileDownloadStreamResponse {
|
|
64
64
|
body: ReadableStream<Uint8Array>;
|
|
65
65
|
metadata: DownloadMetadata;
|
|
66
66
|
}
|
|
67
67
|
/** Error code emitted by {@link TailorDBFileError}. */
|
|
68
|
-
type TailorDBFileErrorCode = "INVALID_PARAMS" | "INVALID_DATA_TYPE" | "OPERATION_FAILED" | "DELETE_FAILED" | "STREAM_OPEN_FAILED" | "STREAM_READ_ERROR" | "STREAM_ERROR" | "FILE_TOO_LARGE";
|
|
68
|
+
export type TailorDBFileErrorCode = "INVALID_PARAMS" | "INVALID_DATA_TYPE" | "OPERATION_FAILED" | "DELETE_FAILED" | "STREAM_OPEN_FAILED" | "STREAM_READ_ERROR" | "STREAM_ERROR" | "FILE_TOO_LARGE";
|
|
69
69
|
/**
|
|
70
70
|
* Type-only shape of the `TailorDBFileError` runtime class. The class itself
|
|
71
71
|
* is provided by the platform runtime (and by `injectMocks` in tests); this
|
|
72
72
|
* interface mirrors it so callers can `import type { TailorDBFileError }` from
|
|
73
73
|
* the wrapper module without depending on any ambient declaration.
|
|
74
74
|
*/
|
|
75
|
-
interface TailorDBFileError extends Error {
|
|
75
|
+
export interface TailorDBFileError extends Error {
|
|
76
76
|
name: "TailorDBFileError";
|
|
77
77
|
code?: TailorDBFileErrorCode;
|
|
78
78
|
cause?: unknown;
|
|
@@ -81,7 +81,7 @@ interface TailorDBFileError extends Error {
|
|
|
81
81
|
* Platform API surface for `tailordb.file`. Describes the shape the platform
|
|
82
82
|
* runtime injects on `globalThis.tailordb.file`.
|
|
83
83
|
*/
|
|
84
|
-
interface TailorDBFileAPI {
|
|
84
|
+
export interface TailorDBFileAPI {
|
|
85
85
|
/**
|
|
86
86
|
* Upload a file to TailorDB.
|
|
87
87
|
* @param namespace - TailorDB namespace
|
|
@@ -157,7 +157,7 @@ interface TailorDBFileAPI {
|
|
|
157
157
|
uploadStream(namespace: string, tableName: string, fieldName: string, recordId: string, readableStream: ReadableStream<Uint8Array | ArrayBuffer>, options?: FileUploadStreamOptions): Promise<FileUploadResponse>;
|
|
158
158
|
}
|
|
159
159
|
/** Runtime wrapper namespace for `tailordb.file`. */
|
|
160
|
-
declare const file: {
|
|
160
|
+
export declare const file: {
|
|
161
161
|
readonly upload: (namespace: string, tableName: string, fieldName: string, recordId: string, data: string | ArrayBuffer | Uint8Array | number[], options?: FileUploadOptions) => Promise<FileUploadResponse>;
|
|
162
162
|
readonly download: (namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadResponse>;
|
|
163
163
|
readonly downloadAsBase64: (namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadAsBase64Response>;
|
|
@@ -166,5 +166,4 @@ declare const file: {
|
|
|
166
166
|
readonly downloadStream: (namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadStreamResponse>;
|
|
167
167
|
readonly uploadStream: (namespace: string, tableName: string, fieldName: string, recordId: string, readableStream: ReadableStream<Uint8Array | ArrayBuffer>, options?: FileUploadStreamOptions) => Promise<FileUploadResponse>;
|
|
168
168
|
};
|
|
169
|
-
//#endregion
|
|
170
|
-
export { DownloadMetadata, FileDownloadAsBase64Response, FileDownloadResponse, FileDownloadStreamResponse, FileMetadata, FileUploadOptions, FileUploadResponse, FileUploadStreamOptions, TailorDBFileAPI, TailorDBFileError, TailorDBFileErrorCode, UploadMetadata, file };
|
|
169
|
+
//#endregion
|
package/dist/runtime/iconv.d.mts
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
* const out = conv.convert(sjisBuffer);
|
|
17
17
|
*/
|
|
18
18
|
/** Instance methods exposed by `tailor.iconv.Iconv`. */
|
|
19
|
-
interface IconvInstance {
|
|
19
|
+
export interface IconvInstance {
|
|
20
20
|
convert(input: string | Uint8Array | ArrayBuffer): string | Uint8Array;
|
|
21
21
|
}
|
|
22
22
|
/** Constructor shape for `tailor.iconv.Iconv`. */
|
|
23
|
-
interface IconvConstructor {
|
|
23
|
+
export interface IconvConstructor {
|
|
24
24
|
new (fromEncoding: string, toEncoding: string): IconvInstance;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
@@ -28,7 +28,7 @@ interface IconvConstructor {
|
|
|
28
28
|
* runtime injects on `globalThis.tailor.iconv` so the wrapper and ambient
|
|
29
29
|
* globals stay in sync.
|
|
30
30
|
*/
|
|
31
|
-
interface TailorIconvAPI {
|
|
31
|
+
export interface TailorIconvAPI {
|
|
32
32
|
/**
|
|
33
33
|
* Convert a string or buffer between encodings.
|
|
34
34
|
* @param str - Input data to convert
|
|
@@ -68,6 +68,5 @@ interface TailorIconvAPI {
|
|
|
68
68
|
Iconv: IconvConstructor;
|
|
69
69
|
}
|
|
70
70
|
/** Runtime API for `tailor.iconv`. */
|
|
71
|
-
declare const iconv: TailorIconvAPI;
|
|
72
|
-
//#endregion
|
|
73
|
-
export { IconvConstructor, IconvInstance, TailorIconvAPI, iconv };
|
|
71
|
+
export declare const iconv: TailorIconvAPI;
|
|
72
|
+
//#endregion
|
package/dist/runtime/idp.d.mts
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* const { users } = await client.users({ first: 10 });
|
|
13
13
|
*/
|
|
14
14
|
/** Configuration object for `idp.Client`. */
|
|
15
|
-
interface ClientConfig {
|
|
15
|
+
export interface ClientConfig {
|
|
16
16
|
namespace: string;
|
|
17
17
|
}
|
|
18
18
|
/** User record returned by IDP operations. */
|
|
19
|
-
interface User {
|
|
19
|
+
export interface User {
|
|
20
20
|
id: string;
|
|
21
21
|
name: string;
|
|
22
22
|
disabled: boolean;
|
|
@@ -33,14 +33,14 @@ interface User {
|
|
|
33
33
|
mfaFactorIds: string[];
|
|
34
34
|
}
|
|
35
35
|
/** Filter options for `idp.Client.users()`. */
|
|
36
|
-
interface UserQuery {
|
|
36
|
+
export interface UserQuery {
|
|
37
37
|
/** Filter by user IDs */
|
|
38
38
|
ids?: string[];
|
|
39
39
|
/** Filter by user names */
|
|
40
40
|
names?: string[];
|
|
41
41
|
}
|
|
42
42
|
/** Pagination/filter options for `idp.Client.users()`. */
|
|
43
|
-
interface ListUsersOptions {
|
|
43
|
+
export interface ListUsersOptions {
|
|
44
44
|
/** Maximum number of users to return */
|
|
45
45
|
first?: number;
|
|
46
46
|
/** Page token for pagination */
|
|
@@ -49,13 +49,13 @@ interface ListUsersOptions {
|
|
|
49
49
|
query?: UserQuery;
|
|
50
50
|
}
|
|
51
51
|
/** Response shape for `idp.Client.users()`. */
|
|
52
|
-
interface ListUsersResponse {
|
|
52
|
+
export interface ListUsersResponse {
|
|
53
53
|
users: User[];
|
|
54
54
|
nextPageToken: string | null;
|
|
55
55
|
totalCount: number;
|
|
56
56
|
}
|
|
57
57
|
/** Input for `idp.Client.createUser()`. */
|
|
58
|
-
interface CreateUserInput {
|
|
58
|
+
export interface CreateUserInput {
|
|
59
59
|
/** The user's name (typically email) */
|
|
60
60
|
name: string;
|
|
61
61
|
/** The user's password. If omitted, the user is created without a password (cannot log in with any password). */
|
|
@@ -64,7 +64,7 @@ interface CreateUserInput {
|
|
|
64
64
|
disabled?: boolean;
|
|
65
65
|
}
|
|
66
66
|
/** Input for `idp.Client.updateUser()`. */
|
|
67
|
-
interface UpdateUserInput {
|
|
67
|
+
export interface UpdateUserInput {
|
|
68
68
|
/** The user's ID */
|
|
69
69
|
id: string;
|
|
70
70
|
/** New name for the user */
|
|
@@ -77,7 +77,7 @@ interface UpdateUserInput {
|
|
|
77
77
|
disabled?: boolean;
|
|
78
78
|
}
|
|
79
79
|
/** Input for `idp.Client.sendPasswordResetEmail()`. */
|
|
80
|
-
interface SendPasswordResetEmailInput {
|
|
80
|
+
export interface SendPasswordResetEmailInput {
|
|
81
81
|
/** The ID of the user */
|
|
82
82
|
userId: string;
|
|
83
83
|
/** The URI to redirect to after password reset */
|
|
@@ -88,7 +88,7 @@ interface SendPasswordResetEmailInput {
|
|
|
88
88
|
subject?: string;
|
|
89
89
|
}
|
|
90
90
|
/** Input for `idp.Client.unenrollMfa()`. */
|
|
91
|
-
interface UnenrollMfaInput {
|
|
91
|
+
export interface UnenrollMfaInput {
|
|
92
92
|
/** The ID of the user whose factor will be unenrolled. */
|
|
93
93
|
userId: string;
|
|
94
94
|
/**
|
|
@@ -98,7 +98,7 @@ interface UnenrollMfaInput {
|
|
|
98
98
|
mfaFactorId: string;
|
|
99
99
|
}
|
|
100
100
|
/** Instance methods exposed by `tailor.idp.Client`. */
|
|
101
|
-
interface IdpClientInstance {
|
|
101
|
+
export interface IdpClientInstance {
|
|
102
102
|
users(options?: ListUsersOptions): Promise<ListUsersResponse>;
|
|
103
103
|
user(userId: string): Promise<User>;
|
|
104
104
|
userByName(name: string): Promise<User>;
|
|
@@ -112,7 +112,7 @@ interface IdpClientInstance {
|
|
|
112
112
|
* Constructor shape for `tailor.idp.Client`.
|
|
113
113
|
* @internal
|
|
114
114
|
*/
|
|
115
|
-
interface IdpClientConstructor {
|
|
115
|
+
export interface IdpClientConstructor {
|
|
116
116
|
new (config: ClientConfig): IdpClientInstance;
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -120,10 +120,9 @@ interface IdpClientConstructor {
|
|
|
120
120
|
* runtime injects on `globalThis.tailor.idp`.
|
|
121
121
|
* @internal
|
|
122
122
|
*/
|
|
123
|
-
interface TailorIdpAPI {
|
|
123
|
+
export interface TailorIdpAPI {
|
|
124
124
|
Client: IdpClientConstructor;
|
|
125
125
|
}
|
|
126
126
|
/** Runtime API for `tailor.idp`. */
|
|
127
|
-
declare const idp: TailorIdpAPI;
|
|
128
|
-
//#endregion
|
|
129
|
-
export { ClientConfig, CreateUserInput, IdpClientConstructor, IdpClientInstance, ListUsersOptions, ListUsersResponse, SendPasswordResetEmailInput, TailorIdpAPI, UnenrollMfaInput, UpdateUserInput, User, UserQuery, idp };
|
|
127
|
+
export declare const idp: TailorIdpAPI;
|
|
128
|
+
//#endregion
|
package/dist/runtime/index.d.mts
CHANGED
|
@@ -7,29 +7,30 @@ import { TailorIconvAPI, iconv } from "./iconv.mjs";
|
|
|
7
7
|
import { TailorIdpAPI, idp } from "./idp.mjs";
|
|
8
8
|
import { TailorLoggerAPI, logger } from "./logger.mjs";
|
|
9
9
|
import { TailorSecretmanagerAPI, secretmanager } from "./secretmanager.mjs";
|
|
10
|
+
import { serializeDateFields } from "./date.mjs";
|
|
10
11
|
//#region src/runtime/index.d.ts
|
|
11
12
|
/** SQL command type recorded on a {@link TailordbQueryResult}. */
|
|
12
|
-
type TailordbCommandType = "INSERT" | "DELETE" | "UPDATE" | "SELECT" | "MOVE" | "FETCH" | "COPY" | "CREATE";
|
|
13
|
+
export type TailordbCommandType = "INSERT" | "DELETE" | "UPDATE" | "SELECT" | "MOVE" | "FETCH" | "COPY" | "CREATE";
|
|
13
14
|
/** Result of a single `queryObject` call against the TailorDB driver. */
|
|
14
|
-
interface TailordbQueryResult<T> {
|
|
15
|
+
export interface TailordbQueryResult<T> {
|
|
15
16
|
rows: T[];
|
|
16
17
|
command: TailordbCommandType;
|
|
17
18
|
rowCount: number;
|
|
18
19
|
}
|
|
19
20
|
/** Instance methods exposed by `tailordb.Client`. */
|
|
20
|
-
interface TailordbClientInstance {
|
|
21
|
+
export interface TailordbClientInstance {
|
|
21
22
|
connect(): Promise<void>;
|
|
22
23
|
end(): Promise<void>;
|
|
23
24
|
queryObject<O>(sql: string, args?: readonly unknown[]): Promise<TailordbQueryResult<O>>;
|
|
24
25
|
}
|
|
25
26
|
/** Constructor shape for `tailordb.Client`. */
|
|
26
|
-
interface TailordbClientConstructor {
|
|
27
|
+
export interface TailordbClientConstructor {
|
|
27
28
|
new (config: {
|
|
28
29
|
namespace: string;
|
|
29
30
|
}): TailordbClientInstance;
|
|
30
31
|
}
|
|
31
32
|
/** Top-level `tailor` runtime object. */
|
|
32
|
-
interface TailorRuntime {
|
|
33
|
+
export interface TailorRuntime {
|
|
33
34
|
secretmanager: TailorSecretmanagerAPI;
|
|
34
35
|
authconnection: TailorAuthconnectionAPI;
|
|
35
36
|
iconv: TailorIconvAPI;
|
|
@@ -40,9 +41,9 @@ interface TailorRuntime {
|
|
|
40
41
|
logger: TailorLoggerAPI;
|
|
41
42
|
}
|
|
42
43
|
/** Top-level `tailordb` runtime object. */
|
|
43
|
-
interface TailordbRuntime {
|
|
44
|
+
export interface TailordbRuntime {
|
|
44
45
|
Client: TailordbClientConstructor;
|
|
45
46
|
file: TailorDBFileAPI;
|
|
46
47
|
}
|
|
47
48
|
//#endregion
|
|
48
|
-
export {
|
|
49
|
+
export { aigateway, authconnection, context, file, iconv, idp, logger, secretmanager, serializeDateFields, workflow };
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e}from"../date-DrUO8rOJ.mjs";import{t}from"../iconv-DlFMt2gW.mjs";import{t as n}from"../secretmanager-vHQoXdQz.mjs";import{t as r}from"../authconnection-CynFBIv8.mjs";import{t as i}from"../idp-G_ojPBB5.mjs";import{t as a}from"../workflow-Cs9ISw6j.mjs";import{t as o}from"../context-D0QjfxzD.mjs";import{t as s}from"../file-COPYfju_.mjs";import{t as c}from"../aigateway-DsWDjzk4.mjs";import{i as l}from"../logger-DP2BjQ93.mjs";export{c as aigateway,r as authconnection,o as context,s as file,t as iconv,i as idp,l as logger,n as secretmanager,e as serializeDateFields,a as workflow};
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
* A single log attribute value. Values outside this union (`null`, nested
|
|
20
20
|
* objects, mixed-type arrays) are silently dropped by the platform.
|
|
21
21
|
*/
|
|
22
|
-
type LogAttributeValue = string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
|
|
22
|
+
export type LogAttributeValue = string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
|
|
23
23
|
/**
|
|
24
24
|
* Structured attributes attached to a log entry. The platform keeps at most 32
|
|
25
25
|
* entries, drops any entry whose key exceeds 128 bytes, and truncates string
|
|
26
26
|
* values over 4096 bytes and arrays over 64 elements.
|
|
27
27
|
*/
|
|
28
|
-
type LogAttributes = Record<string, LogAttributeValue>;
|
|
28
|
+
export type LogAttributes = Record<string, LogAttributeValue>;
|
|
29
29
|
/**
|
|
30
30
|
* Platform API surface for `tailor.logger`. Describes the shape the platform
|
|
31
31
|
* runtime injects on `globalThis.tailor.logger`.
|
|
@@ -34,7 +34,7 @@ type LogAttributes = Record<string, LogAttributeValue>;
|
|
|
34
34
|
* module so callers can either `import * as logger from
|
|
35
35
|
* "@tailor-platform/sdk/runtime/logger"` or pick individual methods.
|
|
36
36
|
*/
|
|
37
|
-
interface TailorLoggerAPI {
|
|
37
|
+
export interface TailorLoggerAPI {
|
|
38
38
|
/**
|
|
39
39
|
* Emits a `debug`-severity log entry.
|
|
40
40
|
* @param message - The log message
|
|
@@ -71,28 +71,27 @@ interface TailorLoggerAPI {
|
|
|
71
71
|
* See {@link TailorLoggerAPI.debug}.
|
|
72
72
|
* @param args - Forwarded to {@link TailorLoggerAPI.debug}
|
|
73
73
|
*/
|
|
74
|
-
declare const debug: TailorLoggerAPI["debug"];
|
|
74
|
+
export declare const debug: TailorLoggerAPI["debug"];
|
|
75
75
|
/**
|
|
76
76
|
* See {@link TailorLoggerAPI.info}.
|
|
77
77
|
* @param args - Forwarded to {@link TailorLoggerAPI.info}
|
|
78
78
|
*/
|
|
79
|
-
declare const info: TailorLoggerAPI["info"];
|
|
79
|
+
export declare const info: TailorLoggerAPI["info"];
|
|
80
80
|
/**
|
|
81
81
|
* See {@link TailorLoggerAPI.warn}.
|
|
82
82
|
* @param args - Forwarded to {@link TailorLoggerAPI.warn}
|
|
83
83
|
*/
|
|
84
|
-
declare const warn: TailorLoggerAPI["warn"];
|
|
84
|
+
export declare const warn: TailorLoggerAPI["warn"];
|
|
85
85
|
/**
|
|
86
86
|
* See {@link TailorLoggerAPI.error}.
|
|
87
87
|
* @param args - Forwarded to {@link TailorLoggerAPI.error}
|
|
88
88
|
*/
|
|
89
|
-
declare const error: TailorLoggerAPI["error"];
|
|
89
|
+
export declare const error: TailorLoggerAPI["error"];
|
|
90
90
|
/**
|
|
91
91
|
* See {@link TailorLoggerAPI.setAttributes}.
|
|
92
92
|
* @param args - Forwarded to {@link TailorLoggerAPI.setAttributes}
|
|
93
93
|
*/
|
|
94
|
-
declare const setAttributes: TailorLoggerAPI["setAttributes"];
|
|
94
|
+
export declare const setAttributes: TailorLoggerAPI["setAttributes"];
|
|
95
95
|
/** `tailor.logger` API object. See {@link TailorLoggerAPI} for method docs. */
|
|
96
|
-
declare const logger: TailorLoggerAPI;
|
|
97
|
-
//#endregion
|
|
98
|
-
export { LogAttributeValue, LogAttributes, TailorLoggerAPI, debug, error, info, logger, setAttributes, warn };
|
|
96
|
+
export declare const logger: TailorLoggerAPI;
|
|
97
|
+
//#endregion
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Platform API surface for `tailor.secretmanager`. Describes the shape the
|
|
17
17
|
* platform runtime injects on `globalThis.tailor.secretmanager`.
|
|
18
18
|
*/
|
|
19
|
-
interface TailorSecretmanagerAPI {
|
|
19
|
+
export interface TailorSecretmanagerAPI {
|
|
20
20
|
/**
|
|
21
21
|
* Returns multiple secrets from a vault. Missing names are omitted from the result.
|
|
22
22
|
* @param vault - Vault name
|
|
@@ -33,9 +33,8 @@ interface TailorSecretmanagerAPI {
|
|
|
33
33
|
getSecret(vault: string, name: string): Promise<string | undefined>;
|
|
34
34
|
}
|
|
35
35
|
/** Runtime wrapper namespace for `tailor.secretmanager`. */
|
|
36
|
-
declare const secretmanager: {
|
|
36
|
+
export declare const secretmanager: {
|
|
37
37
|
readonly getSecrets: <const T extends readonly string[]>(vault: string, names: T) => Promise<Partial<Record<T[number], string>>>;
|
|
38
38
|
readonly getSecret: (vault: string, name: string) => Promise<string | undefined>;
|
|
39
39
|
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { TailorSecretmanagerAPI, secretmanager };
|
|
40
|
+
//#endregion
|
package/dist/runtime/types.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/runtime/types.d.ts
|
|
2
|
-
interface Attributes {}
|
|
3
|
-
interface AttributeList {
|
|
2
|
+
export interface Attributes {}
|
|
3
|
+
export interface AttributeList {
|
|
4
4
|
__tuple?: [];
|
|
5
5
|
}
|
|
6
|
-
type InferredAttributes = keyof Attributes extends never ? Record<string, string | string[] | boolean | boolean[] | undefined> : Attributes;
|
|
6
|
+
export type InferredAttributes = keyof Attributes extends never ? Record<string, string | string[] | boolean | boolean[] | undefined> : Attributes;
|
|
7
7
|
type InferredAttributeList = AttributeList["__tuple"] extends [] ? string[] : AttributeList["__tuple"];
|
|
8
8
|
/** Represents a user or machine user principal in the Tailor Platform. */
|
|
9
|
-
type TailorPrincipal = {
|
|
9
|
+
export type TailorPrincipal = {
|
|
10
10
|
/** The ID of the principal. */
|
|
11
11
|
id: string;
|
|
12
12
|
/** The type of the principal. */
|
|
@@ -18,8 +18,7 @@ type TailorPrincipal = {
|
|
|
18
18
|
/** A list of the principal's attribute IDs. */
|
|
19
19
|
attributeList: InferredAttributeList;
|
|
20
20
|
};
|
|
21
|
-
interface Env {}
|
|
21
|
+
export interface Env {}
|
|
22
22
|
/** Represents environment variables in the Tailor platform. */
|
|
23
|
-
type TailorEnv = keyof Env extends never ? Record<string, string | number | boolean> : Env;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { AttributeList, Attributes, Env, InferredAttributes, TailorEnv, TailorPrincipal };
|
|
23
|
+
export type TailorEnv = keyof Env extends never ? Record<string, string | number | boolean> : Env;
|
|
24
|
+
//#endregion
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
* Specifies the machine user that should be used to execute the workflow.
|
|
18
18
|
* This allows workflows to run with specific authentication context.
|
|
19
19
|
*/
|
|
20
|
-
interface Invoker {
|
|
20
|
+
export interface Invoker {
|
|
21
21
|
/** The namespace where the machine user is defined */
|
|
22
22
|
namespace: string;
|
|
23
23
|
/** The name of the machine user to use for workflow execution */
|
|
24
24
|
machineUserName: string;
|
|
25
25
|
}
|
|
26
26
|
/** Options for {@link startWorkflow}. */
|
|
27
|
-
interface StartWorkflowOptions {
|
|
27
|
+
export interface StartWorkflowOptions {
|
|
28
28
|
/** Optional authentication invoker to specify which machine user should execute the workflow */
|
|
29
29
|
authInvoker?: Invoker;
|
|
30
30
|
}
|
|
@@ -35,11 +35,11 @@ declare const executionPolicyKeyBrand: unique symbol;
|
|
|
35
35
|
* `defineWorkflowExecutionPolicies`). Branded so an arbitrary string that
|
|
36
36
|
* wasn't derived from a declared policy can't be passed as `executionPolicyKey`.
|
|
37
37
|
*/
|
|
38
|
-
type ExecutionPolicyKey = string & {
|
|
38
|
+
export type ExecutionPolicyKey = string & {
|
|
39
39
|
readonly [executionPolicyKeyBrand]: never;
|
|
40
40
|
};
|
|
41
41
|
/** Options for {@link execJobFunction}. */
|
|
42
|
-
interface ExecJobFunctionOptions {
|
|
42
|
+
export interface ExecJobFunctionOptions {
|
|
43
43
|
/**
|
|
44
44
|
* Execution policy key matched by the platform against the policies
|
|
45
45
|
* declared with `defineWorkflowExecutionPolicies` in `tailor.config.ts`.
|
|
@@ -50,7 +50,7 @@ interface ExecJobFunctionOptions {
|
|
|
50
50
|
* Platform API surface for `tailor.workflow`. Describes the shape the platform
|
|
51
51
|
* runtime injects on `globalThis.tailor.workflow`.
|
|
52
52
|
*/
|
|
53
|
-
interface PlatformWorkflowAPI {
|
|
53
|
+
export interface PlatformWorkflowAPI {
|
|
54
54
|
/**
|
|
55
55
|
* Starts a workflow and returns its execution ID.
|
|
56
56
|
* @param workflowName - Workflow name as defined in tailor.config
|
|
@@ -90,12 +90,11 @@ interface PlatformWorkflowAPI {
|
|
|
90
90
|
resolve(executionId: string, key: string, callback: (waitPayload: any) => any): Promise<void>;
|
|
91
91
|
}
|
|
92
92
|
/** Runtime wrapper namespace for `tailor.workflow`. */
|
|
93
|
-
declare const workflow: {
|
|
93
|
+
export declare const workflow: {
|
|
94
94
|
readonly startWorkflow: (workflowName: string, args?: any, options?: StartWorkflowOptions) => Promise<string>;
|
|
95
95
|
readonly resumeWorkflowExecution: (executionId: string) => Promise<string>;
|
|
96
96
|
readonly execJobFunction: (jobName: string, args?: any, options?: ExecJobFunctionOptions) => any;
|
|
97
97
|
readonly wait: (key: string, payload?: any) => any;
|
|
98
98
|
readonly resolve: (executionId: string, key: string, callback: (waitPayload: any) => any) => Promise<void>;
|
|
99
99
|
};
|
|
100
|
-
//#endregion
|
|
101
|
-
export { ExecJobFunctionOptions, ExecutionPolicyKey, Invoker, PlatformWorkflowAPI, StartWorkflowOptions, workflow };
|
|
100
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./date-DrUO8rOJ.mjs";import{t}from"./brand-C8nMKhJC.mjs";import{cloneDeep as n}from"es-toolkit";const r={uuid:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,date:/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/,time:/^(?<hour>[01]\d|2[0-3]):(?<minute>[0-5]\d)$/,datetime:/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})[Tt](?<hour>[01]\d|2[0-3]):(?<minute>[0-5]\d):(?<second>[0-5]\d|60)(\.(?<fraction>\d+))?(?<offset>[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,decimal:/^-?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/};function validateBaseValue(e){let{field:t,value:n,pathArray:i,issues:a}=e,o=i.length>0?i:void 0,s=a.length;switch(t.type){case`string`:typeof n!=`string`&&a.push({message:`Expected a string: received ${String(n)}`,path:o});break;case`integer`:(typeof n!=`number`||!Number.isInteger(n))&&a.push({message:`Expected an integer: received ${String(n)}`,path:o});break;case`float`:(typeof n!=`number`||!Number.isFinite(n))&&a.push({message:`Expected a number: received ${String(n)}`,path:o});break;case`boolean`:typeof n!=`boolean`&&a.push({message:`Expected a boolean: received ${String(n)}`,path:o});break;case`uuid`:(typeof n!=`string`||!r.uuid.test(n))&&a.push({message:`Expected a valid UUID: received ${String(n)}`,path:o});break;case`date`:(typeof n!=`string`||!r.date.test(n))&&a.push({message:`Expected to match "yyyy-MM-dd" format: received ${String(n)}`,path:o});break;case`datetime`:(typeof n!=`string`||!r.datetime.test(n))&&a.push({message:`Expected to match ISO format: received ${String(n)}`,path:o});break;case`time`:(typeof n!=`string`||!r.time.test(n))&&a.push({message:`Expected to match "HH:mm" format: received ${String(n)}`,path:o});break;case`decimal`:(typeof n!=`string`||!r.decimal.test(n))&&a.push({message:`Expected a decimal string: received ${String(n)}`,path:o});break;case`enum`:if(t._metadata.allowedValues){let e=t._metadata.allowedValues.map(e=>e.value);(typeof n!=`string`||!e.includes(n))&&a.push({message:`Must be one of [${e.join(`, `)}]: received ${String(n)}`,path:o})}break;case`nested`:{if(typeof n!=`object`||!n||Array.isArray(n)||n instanceof Date)return a.push({message:`Expected an object: received ${String(n)}`,path:o}),!1;let r=!0;for(let[a,o]of Object.entries(t.fields)){let t=n[a];validateBaseField({...e,field:o,value:t,pathArray:i.concat(a)})||(r=!1)}return r}}return a.length===s}function validateCustomValue(e,t){let{value:n,pathArray:r,issues:i}=e,a=r.length>0?r:void 0;for(let e of t){let t=e({value:n});typeof t==`string`&&i.push({message:t,path:a})}}function validateBaseField(e){let{field:t,value:n,pathArray:r,issues:i}=e,a=r.length>0?r:void 0,o=n==null;if(t._metadata.required&&o)return i.push({message:`Required field is missing`,path:a}),!1;if(!t._metadata.required&&o)return!0;let s=!0;if(t._metadata.array){if(!Array.isArray(n))return i.push({message:`Expected an array`,path:a}),!1;for(let t=0;t<n.length;t++)validateBaseValue({...e,value:n[t],pathArray:r.concat(`[${t}]`)})||(s=!1)}else s=validateBaseValue(e);return s}function validateCustomField(e){let{field:t,value:n,pathArray:r}=e;if(n==null)return;if(t.type===`nested`){let i=t._metadata.array?n:[n];for(let n=0;n<i.length;n++){let a=i[n],o=t._metadata.array?r.concat(`[${n}]`):r;for(let[n,r]of Object.entries(t.fields))validateCustomField({...e,field:r,value:a[n],pathArray:o.concat(n)})}}let i=t._metadata.validate;i?.length&&validateCustomValue(e,i)}function parseInternal(e){let{value:t}=e,n=[],r={...e,issues:n};return validateBaseField(r)&&(t=deserializeDates(r),n.length===0&&validateCustomField({...r,value:t})),n.length>0?{issues:n}:{value:t??null}}function deserializeDates(t){let{field:n,value:r,issues:i,pathArray:a}=t;if(r==null)return r;let convert=(r,a)=>{if(n.type===`date`&&n._metadata.as===`date`){let t=new Date(`${r}T00:00:00.000Z`);return(!Number.isFinite(t.getTime())||e(t)!==r)&&i.push({message:`Expected a valid calendar date: received ${r}`,path:a.length>0?a:void 0}),t}if(n.type!==`nested`)return r;let o=r,s=o;for(let[e,r]of Object.entries(n.fields)){let n=deserializeDates({...t,field:r,value:o[e],pathArray:a.concat(e)});n!==o[e]&&(s===o&&(s={...o}),Object.defineProperty(s,e,{value:n,enumerable:!0,configurable:!0,writable:!0}))}return s};if(!n._metadata.array)return convert(r,a);let o=r,s=o.map((e,t)=>convert(e,a.concat(`[${t}]`)));return s.every((e,t)=>e===o[t])?r:s}function parseInputFields(e){let{fields:t,...n}=e;return parseInternal({...n,field:{type:`nested`,fields:t,_metadata:{required:!0}},pathArray:[]})}function mapAllowedValues(e){return e.map(e=>typeof e==`string`?{value:e,description:``}:{...e,description:e.description??``})}function createTailorDBField(e,t,n,r){return createTailorDBFieldRuntime(e,t,n,r)}function createTailorDBFieldRuntime(e,t,r,i){let a={required:!0},o;t&&(t.optional===!0&&(a.required=!1),t.array===!0&&(a.array=!0)),i&&(a.allowedValues=mapAllowedValues(i));function parseInternal$1(e){return parseInternal({...e,field:s})}function cloneWith(e){let t=s.clone();return Object.assign(t._metadata,e),t}let s={type:e,fields:r??{},_defined:void 0,_output:void 0,_metadata:a,get metadata(){return{...this._metadata}},get rawRelation(){return o?{...o,toward:{...o.toward}}:void 0},description(e){return cloneWith({description:e})},typeName(e){return cloneWith({typeName:e})},validate(...e){return cloneWith({validate:e})},parse(e){return parseInternal$1({value:e.value,data:e.data,invoker:e.invoker,pathArray:[]})},relation(e){let t=s.clone(),n=e.toward,r=`table`in n?n.table:n.type,i=r===`self`?`self`:r.name;return t._setRawRelation({type:e.type,toward:{table:i,as:e.toward.as,key:e.toward.key},backward:e.backward}),t},index(){return cloneWith({index:!0})},unique(){return cloneWith({unique:!0,index:!0})},vector(){return cloneWith({vector:!0})},default(e){return cloneWith({default:e})},hooks(e){return cloneWith({hooks:e})},serial(e){return cloneWith({serial:e})},clone(a){if(this._metadata.validate?.length&&a?.array!==void 0&&a.array!==(this._metadata.array===!0))throw Error(`Cannot change the array option on a field with custom validation`);let s=r;if(r){let e={};for(let[t,n]of Object.entries(r))e[t]=n.clone();s=e}let c=createTailorDBFieldRuntime(e,t,s,i);return Object.assign(c._metadata,n(this._metadata)),a&&(a.optional!==void 0&&(c._metadata.required=!a.optional),a.array!==void 0&&(c._metadata.array=a.array)),o&&c._setRawRelation(n(o)),c},_setRawRelation(e){o=e}};return s}const i=createTailorDBField;function uuid(e){return i(`uuid`,e)}function string(e){return i(`string`,e)}function bool(e){return i(`boolean`,e)}function int(e){return i(`integer`,e)}function float(e){return i(`float`,e)}function decimal(e){if(e?.scale!==void 0&&(!Number.isInteger(e.scale)||e.scale<0||e.scale>12))throw Error(`scale must be an integer between 0 and 12`);let t=i(`decimal`,e);return e?.scale!==void 0&&(t._metadata.scale=e.scale),t}function date(e){return i(`date`,e)}function datetime(e){return i(`datetime`,e)}function time(e){return i(`time`,e)}function _enum(e,t){return i(`enum`,t,void 0,e)}function object(e,t){return i(`nested`,t,e)}function createTailorDBType(e,n,r){let i=r.description,a={},o=[],s={},c={},l=[],u,d,f=new Set;r.description!==void 0&&f.add(`description`);function runMethodOnce(e,t){if(f.has(e))throw Error(`.${e}() has already been set`);let n=t();return f.add(e),n}if(r.pluralForm){if(e===r.pluralForm)throw Error(`The name and the plural form must be different. name=${e}`);a.pluralForm=r.pluralForm}let p={name:e,fields:{...n},_output:null,_description:i,get metadata(){let e={};return o.length>0&&o.forEach(t=>{let n=t.fields.map(e=>String(e)),r=t.name||`idx_${n.join(`_`)}`;e[r]={fields:n,unique:t.unique}}),{name:this.name,description:i,settings:a,permissions:s,files:c,...Object.keys(e).length>0&&{indexes:e},...u&&{typeHook:u},...d&&{typeValidate:d}}},hooks(e){return runMethodOnce(`hooks`,()=>(u=e,this))},validate(e){return runMethodOnce(`validate`,()=>(d=e,this))},features(e){return runMethodOnce(`features`,()=>(a={...a,...e},this))},indexes(...e){return runMethodOnce(`indexes`,()=>(o=e,this))},files(e){return runMethodOnce(`files`,()=>(c=e,this))},permission(e){return runMethodOnce(`permission`,()=>{let t=this;return s.record=e,t})},gqlPermission(e){return runMethodOnce(`gqlPermission`,()=>{let t=this;return s.gql=e,t})},description(e){return runMethodOnce(`description`,()=>(i=e,this._description=e,this))},pickFields(e,t){let n={};for(let r of e){let e=this.fields[r];if(!e)throw Error(`pickFields(): field "${String(r)}" does not exist on this table yet. If it comes from a plugin's .plugin() call, it is only added to the table after \`tailor generate\` runs.`);n[r]=t?e.clone(t):e}return n},omitFields(e){let t=new Set(e),n={};for(let e in this.fields)Object.hasOwn(this.fields,e)&&!t.has(e)&&(n[e]=this.fields[e]);return n},get plugins(){return l},plugin(e){for(let[t,n]of Object.entries(e))l.push({pluginId:t,config:n});return this}};return t(p,`tailordb-type`)}const a=uuid();function dbTable(e,t,n){let r=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0,o,s;return typeof t==`string`?(o=t,s=n):s=t,createTailorDBType(r,{id:a,...s},{pluralForm:i,description:o})}const timestampsUpdatedAtHook=({input:e,now:t})=>e??t,o=Symbol.for(`tailor-platform/sdk:precompiled-script-expr`);timestampsUpdatedAtHook[o]={"hooks.update":`(({ input, now }) => input ?? now)({ input: _value, oldValue: _oldValue, invoker: _principal, now: _now })`};const s={table:dbTable,uuid,string,bool,int,float,decimal,date,datetime,time,enum:_enum,object,fields:{timestamps:()=>({createdAt:datetime().default(`now`).description(`Record creation timestamp`),updatedAt:datetime().default(`now`).hooks({update:timestampsUpdatedAtHook}).description(`Record update timestamp`)})}};export{parseInternal as i,mapAllowedValues as n,parseInputFields as r,s as t};
|
|
2
|
+
//# sourceMappingURL=schema-DMlLMsWA.mjs.map
|