@tailor-platform/sdk 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/bin/tailor.mjs +3 -2
- package/dist/application-D5lh2-_W.mjs +194 -0
- package/dist/application-D5lh2-_W.mjs.map +1 -0
- package/dist/application-o09L68wE.mjs +1 -0
- package/dist/cli/commands/api/index.d.mts +1 -1
- package/dist/cli/commands/deploy/config-id-injector.d.mts +16 -0
- package/dist/cli/commands/executor/trigger.d.mts +1 -1
- package/dist/cli/commands/workflow/start.d.mts +1 -1
- package/dist/cli/commands/workspace/create.d.mts +1 -1
- package/dist/cli/commands/workspace/list.d.mts +1 -1
- package/dist/cli/lib.d.mts +10 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.d.mts +2 -0
- package/dist/cli/main.mjs +42 -1137
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/args.d.mts +71 -1
- package/dist/cli/shared/beta.d.mts +8 -0
- package/dist/cli/shared/client.d.mts +11 -1
- package/dist/cli/shared/command.d.mts +11 -0
- package/dist/cli/shared/config.d.mts +13 -0
- package/dist/cli/shared/context.d.mts +1 -1
- package/dist/cli/shared/logger.d.mts +64 -0
- package/dist/cli/shared/prompt.d.mts +53 -0
- package/dist/cli/shared/script-executor.d.mts +2 -2
- package/dist/cli/shared/workspace-name.d.mts +10 -1
- package/dist/completion/zsh-worker.zsh +10 -206
- package/dist/configure/index.mjs +1 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +18 -0
- package/dist/configure/services/tailordb/types.d.mts +1 -1
- package/dist/{crashreport-B-_HTKLr.mjs → crashreport-BN28xp5B.mjs} +2 -2
- package/dist/{crashreport-B-_HTKLr.mjs.map → crashreport-BN28xp5B.mjs.map} +1 -1
- package/dist/crashreport-By23O2k-.mjs +1 -0
- package/dist/errors-BlX4gUw5.mjs +4 -0
- package/dist/errors-BlX4gUw5.mjs.map +1 -0
- package/dist/es-builtins-BHCXINQp.mjs +2 -0
- package/dist/es-builtins-BHCXINQp.mjs.map +1 -0
- package/dist/field-column-type-QMtF6lUp.mjs +2 -0
- package/dist/field-column-type-QMtF6lUp.mjs.map +1 -0
- package/dist/{kysely-type-BTi3BMtL.mjs → kysely-type-CmvAz1Xj.mjs} +4 -4
- package/dist/kysely-type-CmvAz1Xj.mjs.map +1 -0
- package/dist/{logger-BcGy-u7G.mjs → logger-CCjs1DuH.mjs} +4 -4
- package/dist/logger-CCjs1DuH.mjs.map +1 -0
- package/dist/node-builtins-TQHhwNzG.mjs +2 -0
- package/dist/node-builtins-TQHhwNzG.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/register-ts-hook-CL3Z3VP0.mjs +642 -0
- package/dist/register-ts-hook-CL3Z3VP0.mjs.map +1 -0
- package/dist/schema-AYG4OhXY.mjs +2 -0
- package/dist/{schema-Ze_dI5VX.mjs.map → schema-AYG4OhXY.mjs.map} +1 -1
- package/dist/service-COC9whur.mjs +1 -0
- package/dist/{service-DlgaUO4V.mjs → service-CqbQXFDp.mjs} +2 -2
- package/dist/{service-DlgaUO4V.mjs.map → service-CqbQXFDp.mjs.map} +1 -1
- package/dist/{service-BVe9u2Rt.mjs → service-DDon86tM.mjs} +4 -4
- package/dist/service-DDon86tM.mjs.map +1 -0
- package/dist/service_pb-BNxUPfP3.mjs +2 -0
- package/dist/service_pb-BNxUPfP3.mjs.map +1 -0
- package/dist/service_pb-D-xFu9Ub.mjs +1 -0
- package/dist/shared/src/color.d.mts +5 -0
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +12 -0
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +18 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +130 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +43 -4
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +9 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs +1 -1
- package/dist/wait-point-registry-B-ESkTZX.mjs +2 -0
- package/dist/wait-point-registry-B-ESkTZX.mjs.map +1 -0
- package/dist/workspace_resource_pb-B7S-zx4Z.mjs +2 -0
- package/dist/workspace_resource_pb-B7S-zx4Z.mjs.map +1 -0
- package/docs/cli-reference.md +0 -16
- package/docs/github-actions.md +16 -3
- package/docs/migration/v2.md +5 -1
- package/docs/migration/v3.md +39 -0
- package/docs/services/tailordb-migration.md +12 -0
- package/docs/services/tailordb.md +11 -9
- package/package.json +13 -14
- package/dist/application-DFOUovmN.mjs +0 -1
- package/dist/application-D_4vg1KR.mjs +0 -192
- package/dist/application-D_4vg1KR.mjs.map +0 -1
- package/dist/crashreport-BmsRIdpy.mjs +0 -1
- package/dist/errors-DSEXKRVD.mjs +0 -2
- package/dist/errors-DSEXKRVD.mjs.map +0 -1
- package/dist/kysely-type-BTi3BMtL.mjs.map +0 -1
- package/dist/logger-BcGy-u7G.mjs.map +0 -1
- package/dist/node-builtins-oBl7EbyV.mjs +0 -2
- package/dist/node-builtins-oBl7EbyV.mjs.map +0 -1
- package/dist/register-ts-hook-Drnaproy.mjs +0 -640
- package/dist/register-ts-hook-Drnaproy.mjs.map +0 -1
- package/dist/schema-Ze_dI5VX.mjs +0 -2
- package/dist/service-BVe9u2Rt.mjs.map +0 -1
- package/dist/service-CpZELSBa.mjs +0 -1
- package/dist/service_pb-DGKCLuAs.mjs +0 -2
- package/dist/service_pb-DGKCLuAs.mjs.map +0 -1
- package/dist/service_pb-_aeFE-Nv.mjs +0 -1
- package/dist/wait-point-registry-BrkwfyjS.mjs +0 -2
- package/dist/wait-point-registry-BrkwfyjS.mjs.map +0 -1
- package/dist/workspace_resource_pb--GeYQPXu.mjs +0 -2
- package/dist/workspace_resource_pb--GeYQPXu.mjs.map +0 -1
- package/docs/cli/setup.md +0 -210
|
@@ -9,5 +9,75 @@ declare const orderArg: z.ZodEnum<{
|
|
|
9
9
|
desc: "desc";
|
|
10
10
|
}>;
|
|
11
11
|
type Order = z.infer<typeof orderArg>;
|
|
12
|
+
type EnvFileArg = string | string[] | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Load env files from parsed arguments.
|
|
15
|
+
* Processes --env-file first, then --env-file-if-exists.
|
|
16
|
+
*
|
|
17
|
+
* Follows Node.js --env-file behavior:
|
|
18
|
+
* - Variables already set in the environment are NOT overwritten
|
|
19
|
+
* - Variables from later files override those from earlier files
|
|
20
|
+
* @param envFiles - Required env file path(s) that must exist
|
|
21
|
+
* @param envFilesIfExists - Optional env file path(s) that are loaded if they exist
|
|
22
|
+
*/
|
|
23
|
+
declare function loadEnvFiles(envFiles: EnvFileArg, envFilesIfExists: EnvFileArg): void;
|
|
24
|
+
interface CommonArgsOptions {
|
|
25
|
+
/** Extra short alias for `--verbose` (e.g. `"v"`), for plugins that need one */
|
|
26
|
+
verboseAlias?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build the common arguments for all CLI commands. CLI plugins call this so
|
|
30
|
+
* their forwarded global flags parse identically to the host Tailor CLI and
|
|
31
|
+
* feed the same logger state.
|
|
32
|
+
*
|
|
33
|
+
* NOTE: --env-file and --env-file-if-exists collide with Node.js flags due to a bug
|
|
34
|
+
* (https://github.com/nodejs/node/issues/54232). Node.js parses these even after the
|
|
35
|
+
* script path, causing warnings (twice due to tsx loader).
|
|
36
|
+
* @param options - Per-plugin adjustments to the shared arguments
|
|
37
|
+
* @returns Argument shape suitable for spreading into a command schema
|
|
38
|
+
*/
|
|
39
|
+
declare function createCommonArgs(options?: CommonArgsOptions): {
|
|
40
|
+
"env-file": z.ZodOptional<z.ZodString>;
|
|
41
|
+
"env-file-if-exists": z.ZodOptional<z.ZodString>;
|
|
42
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Common arguments for all CLI commands
|
|
47
|
+
*/
|
|
48
|
+
declare const commonArgs: {
|
|
49
|
+
"env-file": z.ZodOptional<z.ZodString>;
|
|
50
|
+
"env-file-if-exists": z.ZodOptional<z.ZodString>;
|
|
51
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Arguments for commands that require workspace context
|
|
56
|
+
*/
|
|
57
|
+
declare const workspaceArgs: {
|
|
58
|
+
"workspace-id": z.ZodOptional<z.ZodString>;
|
|
59
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Shared config arg for commands that accept a config file path
|
|
63
|
+
*/
|
|
64
|
+
declare const configArg: {
|
|
65
|
+
config: z.ZodDefault<z.ZodString>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Arguments for commands that interact with deployed resources (includes config)
|
|
69
|
+
*/
|
|
70
|
+
declare const deploymentArgs: {
|
|
71
|
+
config: z.ZodDefault<z.ZodString>;
|
|
72
|
+
"workspace-id": z.ZodOptional<z.ZodString>;
|
|
73
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Arguments for commands that require confirmation
|
|
77
|
+
*/
|
|
78
|
+
declare const confirmationArgs: {
|
|
79
|
+
yes: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
};
|
|
81
|
+
type CommonArgsType = z.infer<z.ZodObject<typeof commonArgs>>;
|
|
12
82
|
//#endregion
|
|
13
|
-
export { Order, orderArg };
|
|
83
|
+
export { CommonArgsType, Order, commonArgs, configArg, confirmationArgs, createCommonArgs, deploymentArgs, loadEnvFiles, orderArg, workspaceArgs };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/cli/shared/beta.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Warn that a feature is in beta.
|
|
4
|
+
* @param {string} featureName - Name of the beta feature (e.g., "tailordb migration")
|
|
5
|
+
*/
|
|
6
|
+
declare function logBetaWarning(featureName: string): void;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { logBetaWarning };
|
|
@@ -14,7 +14,7 @@ import { ListMeterAITokenUsagesRequestSchema, ListMeterAITokenUsagesResponseSche
|
|
|
14
14
|
import { CreateIdPClientRequestSchema, CreateIdPClientResponseSchema, CreateIdPServiceRequestSchema, CreateIdPServiceResponseSchema, DeleteIdPClientRequestSchema, DeleteIdPClientResponseSchema, DeleteIdPServiceRequestSchema, DeleteIdPServiceResponseSchema, GetIdPClientRequestSchema, GetIdPClientResponseSchema, GetIdPServiceRequestSchema, GetIdPServiceResponseSchema, ListIdPClientsRequestSchema, ListIdPClientsResponseSchema, ListIdPServicesRequestSchema, ListIdPServicesResponseSchema, UpdateIdPServiceRequestSchema, UpdateIdPServiceResponseSchema } from "../../tailor-proto/src/tailor/v1/idp_pb.mjs";
|
|
15
15
|
import { AddCustomDomainRequestSchema, AddCustomDomainResponseSchema, CreateDeploymentRequestSchema, CreateDeploymentResponseSchema, CreateStaticWebsiteRequestSchema, CreateStaticWebsiteResponseSchema, DeleteStaticWebsiteRequestSchema, DeleteStaticWebsiteResponseSchema, GetCustomDomainRequestSchema, GetCustomDomainResponseSchema, GetStaticWebsiteRequestSchema, GetStaticWebsiteResponseSchema, ListCustomDomainsRequestSchema, ListCustomDomainsResponseSchema, ListStaticWebsitesRequestSchema, ListStaticWebsitesResponseSchema, PublishDeploymentRequestSchema, PublishDeploymentResponseSchema, RemoveCustomDomainRequestSchema, RemoveCustomDomainResponseSchema, UpdateStaticWebsiteRequestSchema, UpdateStaticWebsiteResponseSchema, UploadFileRequestSchema, UploadFileResponseSchema } from "../../tailor-proto/src/tailor/v1/staticwebsite_pb.mjs";
|
|
16
16
|
import { CreateWorkflowJobFunctionExecutionPolicyRequestSchema, CreateWorkflowJobFunctionExecutionPolicyResponseSchema, CreateWorkflowJobFunctionRequestSchema, CreateWorkflowJobFunctionResponseSchema, CreateWorkflowRequestSchema, CreateWorkflowResponseSchema, DeleteWorkflowJobFunctionExecutionPolicyRequestSchema, DeleteWorkflowJobFunctionExecutionPolicyResponseSchema, DeleteWorkflowJobFunctionRequestSchema, DeleteWorkflowJobFunctionResponseSchema, DeleteWorkflowRequestSchema, DeleteWorkflowResponseSchema, GetWorkflowByNameRequestSchema, GetWorkflowByNameResponseSchema, GetWorkflowExecutionRequestSchema, GetWorkflowExecutionResponseSchema, GetWorkflowJobFunctionByNameRequestSchema, GetWorkflowJobFunctionByNameResponseSchema, GetWorkflowJobFunctionExecutionPolicyByKeyRequestSchema, GetWorkflowJobFunctionExecutionPolicyByKeyResponseSchema, GetWorkflowJobFunctionExecutionPolicyRequestSchema, GetWorkflowJobFunctionExecutionPolicyResponseSchema, GetWorkflowJobFunctionRequestSchema, GetWorkflowJobFunctionResponseSchema, GetWorkflowRequestSchema, GetWorkflowResponseSchema, ListWorkflowExecutionsRequestSchema, ListWorkflowExecutionsResponseSchema, ListWorkflowJobFunctionExecutionPoliciesRequestSchema, ListWorkflowJobFunctionExecutionPoliciesResponseSchema, ListWorkflowJobFunctionsRequestSchema, ListWorkflowJobFunctionsResponseSchema, ListWorkflowsRequestSchema, ListWorkflowsResponseSchema, ResumeWorkflowExecutionRequestSchema, ResumeWorkflowExecutionResponseSchema, StartWorkflowRequestSchema, StartWorkflowResponseSchema, TestResumeWorkflowRequestSchema, TestResumeWorkflowResponseSchema, TestStartWorkflowRequestSchema, TestStartWorkflowResponseSchema, UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, UpdateWorkflowJobFunctionExecutionPolicyResponseSchema, UpdateWorkflowJobFunctionRequestSchema, UpdateWorkflowJobFunctionResponseSchema, UpdateWorkflowRequestSchema, UpdateWorkflowResponseSchema } from "../../tailor-proto/src/tailor/v1/workflow_pb.mjs";
|
|
17
|
-
import { GetMetadataRequestSchema, GetMetadataResponseSchema, SetMetadataRequestSchema, SetMetadataResponseSchema } from "../../tailor-proto/src/tailor/v1/metadata_pb.mjs";
|
|
17
|
+
import { BulkSetMetadataRequestSchema, BulkSetMetadataResponseSchema, GetMetadataRequestSchema, GetMetadataResponseSchema, ListMetadataRequestSchema, ListMetadataResponseSchema, SetMetadataRequestSchema, SetMetadataResponseSchema } from "../../tailor-proto/src/tailor/v1/metadata_pb.mjs";
|
|
18
18
|
import { CreateOTLPExporterRequestSchema, CreateOTLPExporterResponseSchema, CreateResourceAttributesConfigRequestSchema, CreateResourceAttributesConfigResponseSchema, DeleteOTLPExporterRequestSchema, DeleteOTLPExporterResponseSchema, DeleteResourceAttributesConfigRequestSchema, DeleteResourceAttributesConfigResponseSchema, GetOTLPExporterRequestSchema, GetOTLPExporterResponseSchema, GetResourceAttributesConfigRequestSchema, GetResourceAttributesConfigResponseSchema, ListOTLPExportersRequestSchema, ListOTLPExportersResponseSchema, TestOTLPExporterRequestSchema, TestOTLPExporterResponseSchema, UpdateOTLPExporterRequestSchema, UpdateOTLPExporterResponseSchema, UpdateResourceAttributesConfigRequestSchema, UpdateResourceAttributesConfigResponseSchema } from "../../tailor-proto/src/tailor/v1/telemetryrouter_pb.mjs";
|
|
19
19
|
import { OperatorService, PingRequestSchema, PingResponseSchema } from "../../tailor-proto/src/tailor/v1/service_pb.mjs";
|
|
20
20
|
import "@badgateway/oauth2-client";
|
|
@@ -1213,6 +1213,16 @@ declare function initOperatorClient(accessToken: string, config?: PlatformClient
|
|
|
1213
1213
|
input: typeof GetMetadataRequestSchema;
|
|
1214
1214
|
output: typeof GetMetadataResponseSchema;
|
|
1215
1215
|
};
|
|
1216
|
+
bulkSetMetadata: {
|
|
1217
|
+
methodKind: "unary";
|
|
1218
|
+
input: typeof BulkSetMetadataRequestSchema;
|
|
1219
|
+
output: typeof BulkSetMetadataResponseSchema;
|
|
1220
|
+
};
|
|
1221
|
+
listMetadata: {
|
|
1222
|
+
methodKind: "unary";
|
|
1223
|
+
input: typeof ListMetadataRequestSchema;
|
|
1224
|
+
output: typeof ListMetadataResponseSchema;
|
|
1225
|
+
};
|
|
1216
1226
|
createControlplaneMachineUser: {
|
|
1217
1227
|
methodKind: "unary";
|
|
1218
1228
|
input: typeof CreateControlplaneMachineUserRequestSchema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommonArgsType } from "./args.mjs";
|
|
2
|
+
import { createDefineCommand } from "politty";
|
|
3
|
+
//#region src/cli/shared/command.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* defineCommand with global args type (CommonArgsType).
|
|
6
|
+
* Use this for leaf commands with `run` to get type-safe access to global args.
|
|
7
|
+
* Parent commands with only `subCommands` can use `defineCommand` from politty directly.
|
|
8
|
+
*/
|
|
9
|
+
declare const defineAppCommand: ReturnType<typeof createDefineCommand<CommonArgsType>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { defineAppCommand };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LoadedConfig } from "./config-loader.mjs";
|
|
2
|
+
//#region src/cli/shared/config.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Extracts namespace keys under `config.db` that this app owns
|
|
5
|
+
* (i.e. not declared with `{ external: true }`). Use this for destructive
|
|
6
|
+
* operations like `tailordb truncate --all` to avoid touching namespaces
|
|
7
|
+
* owned by other apps.
|
|
8
|
+
* @param config - Loaded application configuration.
|
|
9
|
+
* @returns Owned namespace names in insertion order.
|
|
10
|
+
*/
|
|
11
|
+
declare function extractOwnedNamespaces(config: LoadedConfig): string[];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { extractOwnedNamespaces };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { StyleFn } from "../../shared/src/color.mjs";
|
|
2
|
+
//#region src/cli/shared/logger.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Semantic style functions for inline text styling
|
|
5
|
+
*/
|
|
6
|
+
declare const styles: {
|
|
7
|
+
success: StyleFn;
|
|
8
|
+
error: StyleFn;
|
|
9
|
+
warning: StyleFn;
|
|
10
|
+
info: StyleFn;
|
|
11
|
+
create: StyleFn;
|
|
12
|
+
update: StyleFn;
|
|
13
|
+
delete: StyleFn;
|
|
14
|
+
replace: StyleFn;
|
|
15
|
+
unchanged: StyleFn;
|
|
16
|
+
bold: StyleFn;
|
|
17
|
+
dim: StyleFn;
|
|
18
|
+
highlight: StyleFn;
|
|
19
|
+
successBright: StyleFn;
|
|
20
|
+
errorBright: StyleFn;
|
|
21
|
+
resourceType: StyleFn;
|
|
22
|
+
resourceName: StyleFn;
|
|
23
|
+
path: StyleFn;
|
|
24
|
+
value: StyleFn;
|
|
25
|
+
placeholder: (text: string) => string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Log output modes
|
|
29
|
+
*/
|
|
30
|
+
type LogMode = "default" | "stream" | "plain";
|
|
31
|
+
interface LogOptions {
|
|
32
|
+
/** Output mode (default: "default") */
|
|
33
|
+
mode?: LogMode;
|
|
34
|
+
/** Number of spaces to indent the entire line (default: 0) */
|
|
35
|
+
indent?: number;
|
|
36
|
+
}
|
|
37
|
+
/** Field transformer function. null excludes the field from table output. */
|
|
38
|
+
type FieldTransformer = ((value: unknown, item: object) => string) | null;
|
|
39
|
+
interface OutOptions {
|
|
40
|
+
/** Table display field transform/exclude settings. Only applied in table mode (not JSON). */
|
|
41
|
+
display?: Record<string, FieldTransformer>;
|
|
42
|
+
/** Show null values in table output (default: false) */
|
|
43
|
+
showNull?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The CLI logger. Diagnostics go to stderr; `out()` writes primary output to
|
|
47
|
+
* stdout as a table, or as JSON when `jsonMode` is on. `--json` and
|
|
48
|
+
* `--verbose` feed the `jsonMode` / `verbose` state, which CLI plugins share
|
|
49
|
+
* with the SDK code paths they call.
|
|
50
|
+
*/
|
|
51
|
+
declare const logger: {
|
|
52
|
+
jsonMode: boolean;
|
|
53
|
+
verbose: boolean;
|
|
54
|
+
info(message: string, opts?: LogOptions): void;
|
|
55
|
+
success(message: string, opts?: LogOptions): void;
|
|
56
|
+
warn(message: string, opts?: LogOptions): void;
|
|
57
|
+
error(message: string, opts?: LogOptions): void;
|
|
58
|
+
log(message: string): void;
|
|
59
|
+
newline(): void;
|
|
60
|
+
debug(message: string): void;
|
|
61
|
+
out(data: string | object | object[], options?: OutOptions): void;
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { FieldTransformer, LogMode, LogOptions, OutOptions, logger, styles };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region src/cli/shared/prompt.d.ts
|
|
2
|
+
/** Options accepted by {@link prompt.confirm}. */
|
|
3
|
+
interface ConfirmConfig {
|
|
4
|
+
message: string;
|
|
5
|
+
default?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Options accepted by {@link prompt.text}. */
|
|
8
|
+
interface TextConfig {
|
|
9
|
+
message: string;
|
|
10
|
+
default?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
validate?: (value: string) => boolean | string | Promise<boolean | string>;
|
|
13
|
+
}
|
|
14
|
+
/** Options accepted by {@link prompt.password}. */
|
|
15
|
+
interface PasswordConfig {
|
|
16
|
+
message: string;
|
|
17
|
+
mask?: boolean | string;
|
|
18
|
+
validate?: (value: string) => boolean | string | Promise<boolean | string>;
|
|
19
|
+
}
|
|
20
|
+
/** A selectable entry of {@link SelectConfig.choices}. */
|
|
21
|
+
interface SelectChoice<Value> {
|
|
22
|
+
value: Value;
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
short?: string;
|
|
26
|
+
disabled?: boolean | string;
|
|
27
|
+
}
|
|
28
|
+
/** Options accepted by {@link prompt.select}. */
|
|
29
|
+
interface SelectConfig<Value> {
|
|
30
|
+
message: string;
|
|
31
|
+
choices: readonly SelectChoice<Value>[];
|
|
32
|
+
default?: NoInfer<Value>;
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
loop?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Interactive prompts that fail with an actionable message instead of hanging
|
|
38
|
+
* when stdin is not a TTY (CI, piped input), and exit with 130 on Ctrl-C.
|
|
39
|
+
*
|
|
40
|
+
* The config types are declared here rather than inferred from
|
|
41
|
+
* `@inquirer/prompts`: inference pulls `@inquirer/*` internals (`Context`,
|
|
42
|
+
* `Keybinding`, `PartialDeep`) into this public type, and those cannot be
|
|
43
|
+
* named portably from the published declarations (TS2883). They cover the
|
|
44
|
+
* options this CLI uses — widen them here when a call site needs more.
|
|
45
|
+
*/
|
|
46
|
+
declare const prompt: {
|
|
47
|
+
confirm: (config: ConfirmConfig) => Promise<boolean>;
|
|
48
|
+
text: (config: TextConfig) => Promise<string>;
|
|
49
|
+
password: (config: PasswordConfig) => Promise<string>;
|
|
50
|
+
select: <const Value>(config: SelectConfig<Value>) => Promise<Value>;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ConfirmConfig, PasswordConfig, SelectChoice, SelectConfig, TextConfig, prompt };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AuthInvokerSchema } from "../../tailor-proto/src/tailor/v1/auth_resource_pb.mjs";
|
|
2
2
|
import { FunctionExecution_Status } from "../../tailor-proto/src/tailor/v1/function_resource_pb.mjs";
|
|
3
3
|
import { OperatorClient } from "./client.mjs";
|
|
4
|
-
import { Jsonifiable } from "type-fest";
|
|
5
4
|
import { MessageInitShape } from "@bufbuild/protobuf";
|
|
5
|
+
import { Jsonifiable } from "type-fest";
|
|
6
6
|
//#region src/cli/shared/script-executor.d.ts
|
|
7
7
|
/** Authentication context for script execution, provided as a plain object. */
|
|
8
8
|
type ScriptInvoker = MessageInitShape<typeof AuthInvokerSchema>;
|
|
@@ -53,7 +53,7 @@ interface ExecutionWaitResult {
|
|
|
53
53
|
* Wait for a function execution to complete
|
|
54
54
|
*
|
|
55
55
|
* Polls the getFunctionExecution API until the execution reaches a terminal state
|
|
56
|
-
* (SUCCESS or
|
|
56
|
+
* (SUCCESS, FAILED, or CANCELED).
|
|
57
57
|
* @param {OperatorClient} client - Operator client instance
|
|
58
58
|
* @param {string} workspaceId - Workspace ID
|
|
59
59
|
* @param {string} executionId - Execution ID to wait for
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/cli/shared/workspace-name.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Validates a workspace name against the platform's naming rules: 3-63
|
|
5
|
+
* lowercase alphanumeric or hyphen characters, not starting or ending with a
|
|
6
|
+
* hyphen.
|
|
7
|
+
*/
|
|
8
|
+
declare const workspaceNameSchema: z.ZodString;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { workspaceNameSchema };
|