@tailor-platform/sdk 1.75.0 → 1.76.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 +34 -0
- package/dist/{application-DYshsH-K.mjs → application-BUfYmf0O.mjs} +274 -10
- package/dist/application-BUfYmf0O.mjs.map +1 -0
- package/dist/application-DbvD5UUz.mjs +3 -0
- package/dist/cli/index.mjs +218 -66
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/query/index.d.mts +4 -0
- package/dist/completion/zsh-worker.zsh +2 -2
- package/dist/configure/index.mjs +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +31 -21
- package/dist/resource_pb-BRv7AMXK.mjs +49 -0
- package/dist/resource_pb-BRv7AMXK.mjs.map +1 -0
- package/dist/{runtime-CJ5usBOu.mjs → runtime-_vUgjiqT.mjs} +27 -252
- package/dist/runtime-_vUgjiqT.mjs.map +1 -0
- package/dist/{schema-Dl_y0m9e.mjs → schema-DrVyN-LP.mjs} +60 -36
- package/dist/schema-DrVyN-LP.mjs.map +1 -0
- package/dist/{service_pb-D-PXRoMg.mjs → service_pb-B2FF59sP.mjs} +1 -1
- package/dist/{service_pb-4unFyubn.mjs → service_pb-B5w9rjPY.mjs} +3 -46
- package/dist/service_pb-B5w9rjPY.mjs.map +1 -0
- package/docs/cli/auth.md +3 -3
- package/docs/cli/setup.md +8 -8
- package/docs/services/tailordb.md +20 -0
- package/package.json +10 -10
- package/dist/application-BJKNlv8c.mjs +0 -3
- package/dist/application-DYshsH-K.mjs.map +0 -1
- package/dist/runtime-CJ5usBOu.mjs.map +0 -1
- package/dist/schema-Dl_y0m9e.mjs.map +0 -1
- package/dist/service_pb-4unFyubn.mjs.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { t as db } from "./schema-
|
|
2
|
-
import {
|
|
1
|
+
import { t as db } from "./schema-DrVyN-LP.mjs";
|
|
2
|
+
import { i as PageDirection, n as Condition_Operator, r as FilterSchema, t as ConditionSchema } from "./resource_pb-BRv7AMXK.mjs";
|
|
3
3
|
import { t as assertDefined } from "./assert-DBxo8jPo.mjs";
|
|
4
4
|
import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-BEiZZ3qT.mjs";
|
|
5
|
-
import { $ as getOAuth2ClientId, B as readPlatformConfig, C as createBundleCache, D as loadConfig, E as hashFile, F as loadMachineUserName, I as loadPlatformClientConfig, J as fetchMachineUserToken, K as fetchAll, M as loadAccessToken, N as loadConfigPath, Q as getConsoleBaseUrl, R as loadWorkspaceId, S as hasGenerationHooks, T as hashContent, U as writePlatformConfig, Y as fetchPaged, _ as platformBundleDefinePlugin, at as resolveStaticWebsiteUrls, d as buildExecutorArgsExpr, et as getOrNull, f as buildResolverOperationHookExpr, g as stringifyFunction, h as TailorDBTypeSchema, i as resolverBundleKey, it as isDefaultPlatform, j as hasUserTokenEntry, l as HTTP_METHODS, m as assertUniqueTailorDBTypeNamesWithExternal, n as generatePluginFilesIfNeeded, o as WorkflowJobFunctionExecutionPolicySchema, ot as byName, p as assertUniqueLocalTailorDBTypeNames, q as fetchAllTolerant, r as loadApplication, rt as initOperatorClient, t as defineApplication, tt as getPlatformBaseUrl, w as getDistDir, x as getPluginGenerationDependencies, z as platformConfigFromProfile } from "./application-
|
|
5
|
+
import { $ as getOAuth2ClientId, B as readPlatformConfig, C as createBundleCache, Ct as toPageDirection, D as loadConfig, E as hashFile, F as loadMachineUserName, I as loadPlatformClientConfig, J as fetchMachineUserToken, K as fetchAll, M as loadAccessToken, N as loadConfigPath, Q as getConsoleBaseUrl, R as loadWorkspaceId, S as hasGenerationHooks, St as resolveMachineUserInputSource, T as hashContent, U as writePlatformConfig, Y as fetchPaged, _ as platformBundleDefinePlugin, _t as organizationArgs, at as resolveStaticWebsiteUrls, bt as parseDuration, ct as configArg, d as buildExecutorArgsExpr, dt as durationArg, et as getOrNull, f as buildResolverOperationHookExpr, ft as folderArgs, g as stringifyFunction, gt as orderArg, h as TailorDBTypeSchema, ht as nonNegativeIntArg, i as resolverBundleKey, it as isDefaultPlatform, j as hasUserTokenEntry, l as HTTP_METHODS, lt as confirmationArgs, m as assertUniqueTailorDBTypeNamesWithExternal, n as generatePluginFilesIfNeeded, o as WorkflowJobFunctionExecutionPolicySchema, ot as byName, p as assertUniqueLocalTailorDBTypeNames, q as fetchAllTolerant, r as loadApplication, rt as initOperatorClient, t as defineApplication, tt as getPlatformBaseUrl, ut as deploymentArgs, vt as pagedLogArgs, w as getDistDir, wt as workspaceArgs, x as getPluginGenerationDependencies, xt as positiveIntArg, yt as paginationArgs, z as platformConfigFromProfile } from "./application-BUfYmf0O.mjs";
|
|
6
6
|
import { o as loadFilesWithIgnores, t as createExecutorService } from "./service-BCRJ-3NV.mjs";
|
|
7
7
|
import { t as multiline } from "./multiline-sfHpTZZK.mjs";
|
|
8
8
|
import { t as readPackageJson } from "./package-json-8b0O9TlX.mjs";
|
|
9
9
|
import { i as userAgent } from "./secret-file-VSVGy1V0.mjs";
|
|
10
10
|
import { n as isCLIError, t as createCLIError } from "./errors-Dtf2WPaW.mjs";
|
|
11
|
+
import { $ as CreateAuthServiceRequestSchema, A as CreatePipelineServiceRequestSchema, At as Subgraph_ServiceType, C as CreateStaticWebsiteRequestSchema, D as CreateSecretManagerVaultRequestSchema, Dt as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, E as CreateSecretManagerSecretRequestSchema, Et as CreateApplicationRequestSchema, F as UpdateIdPServiceRequestSchema, G as ExecutorTriggerType, H as UpdateExecutorExecutorRequestSchema, I as IdPLang, J as CreateAuthIDPConfigRequestSchema, K as CreateAuthConnectionRequestSchema, L as IdPPermissionOperator, M as UpdatePipelineServiceRequestSchema, N as PipelineResolver_OperationType, O as UpdateSecretManagerSecretRequestSchema, Ot as UpdateApplicationRequestSchema, P as CreateIdPServiceRequestSchema, Q as CreateAuthSCIMResourceRequestSchema, R as IdPPermissionPermit, S as AddCustomDomainRequestSchema, St as AuthSCIMConfig_AuthorizationType, Tt as UserProfileProviderConfig_UserProfileProviderType, U as ExecutorJobStatus, V as CreateExecutorExecutorRequestSchema, W as ExecutorTargetType, X as CreateAuthOAuth2ClientRequestSchema, Y as CreateAuthMachineUserRequestSchema, Z as CreateAuthSCIMConfigRequestSchema, _ as TailorDBGQLPermission_Operator, _t as AuthOAuth2Client_ClientType, a as WorkspacePlatformUserRole, at as UpdateAuthMachineUserRequestSchema, b as TailorDBType_Permission_Permit, bt as AuthSCIMAttribute_Type, c as CreateWorkflowRequestSchema, ct as UpdateAuthSCIMResourceRequestSchema, d as WorkflowExecution_Status, dt as UpdateUserProfileConfigRequestSchema, et as CreateTenantConfigRequestSchema, f as WorkflowJobExecution_Status, ft as AuthConnection_Status, g as TailorDBGQLPermission_Action, gt as AuthInvokerSchema, h as UpdateTailorDBTypeRequestSchema, ht as AuthIDPConfig_AuthType, it as UpdateAuthIDPConfigRequestSchema, j as UpdatePipelineResolverRequestSchema, k as CreatePipelineResolverRequestSchema, kt as ApplicationSchemaUpdateAttemptStatus, l as UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, lt as UpdateAuthServiceRequestSchema, m as CreateTailorDBTypeRequestSchema, mt as AuthHookPoint, nt as UpdateAuthConnectionRequestSchema, o as CreateWorkflowJobFunctionExecutionPolicyRequestSchema, ot as UpdateAuthOAuth2ClientRequestSchema, p as CreateTailorDBServiceRequestSchema, pt as AuthConnection_Type, q as CreateAuthHookRequestSchema, rt as UpdateAuthHookRequestSchema, s as CreateWorkflowJobFunctionRequestSchema, st as UpdateAuthSCIMConfigRequestSchema, t as OperatorService, tt as CreateUserProfileConfigRequestSchema, u as UpdateWorkflowRequestSchema, ut as UpdateTenantConfigRequestSchema, v as TailorDBGQLPermission_Permit, vt as AuthOAuth2Client_GrantType, w as UpdateStaticWebsiteRequestSchema, wt as TenantProviderConfig_TenantProviderType, x as TailorDBType_PermitAction, xt as AuthSCIMAttribute_Uniqueness, y as TailorDBType_Permission_Operator, yt as AuthSCIMAttribute_Mutability, z as FunctionExecution_Status } from "./service_pb-B5w9rjPY.mjs";
|
|
11
12
|
import { r as withSpan } from "./telemetry-CdqJEzkj.mjs";
|
|
12
13
|
import { arg, createDefineCommand, defineCommand, runCommand } from "politty";
|
|
13
14
|
import { z } from "zod";
|
|
14
15
|
import { ScalarType, create, fromJson, toJson } from "@bufbuild/protobuf";
|
|
15
16
|
import * as fs$1 from "node:fs";
|
|
16
17
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
17
|
-
import { parseEnv } from "node:util";
|
|
18
18
|
import { ValueSchema, timestampDate } from "@bufbuild/protobuf/wkt";
|
|
19
19
|
import * as path from "pathe";
|
|
20
20
|
import { formatDistanceToNowStrict } from "date-fns";
|
|
@@ -47,240 +47,6 @@ import { createPrompt } from "@toiroakr/read-multiline";
|
|
|
47
47
|
import { astVisitor, parse } from "pgsql-ast-parser";
|
|
48
48
|
import { parse as parse$1 } from "@0no-co/graphql.web";
|
|
49
49
|
|
|
50
|
-
//#region src/cli/shared/args.ts
|
|
51
|
-
const unitToMs = {
|
|
52
|
-
ms: 1,
|
|
53
|
-
s: 1e3,
|
|
54
|
-
m: 60 * 1e3
|
|
55
|
-
};
|
|
56
|
-
const durationPattern = /^(\d+)(ms|s|m)$/;
|
|
57
|
-
/**
|
|
58
|
-
* Schema for duration string validation (e.g., "3s", "500ms", "1m")
|
|
59
|
-
* Only validates format; use parseDuration() to convert to milliseconds
|
|
60
|
-
*/
|
|
61
|
-
const durationArg = z.string().refine((val) => durationPattern.test(val), { message: "Invalid duration format. Expected format: '3s', '500ms', '1m'" }).refine((val) => {
|
|
62
|
-
const match = val.match(durationPattern);
|
|
63
|
-
if (!match) return false;
|
|
64
|
-
const digits = match[1];
|
|
65
|
-
return digits !== void 0 && parseInt(digits, 10) > 0;
|
|
66
|
-
}, { message: "Duration must be greater than 0" });
|
|
67
|
-
/**
|
|
68
|
-
* Parse a validated duration string into milliseconds
|
|
69
|
-
* @param duration - Duration string (e.g., "3s", "500ms", "1m")
|
|
70
|
-
* @returns Duration in milliseconds
|
|
71
|
-
*/
|
|
72
|
-
function parseDuration(duration) {
|
|
73
|
-
const match = assertDefined(duration.match(durationPattern), `invalid duration format: ${duration}`);
|
|
74
|
-
const value = parseInt(assertDefined(match[1], "duration digits group missing"), 10);
|
|
75
|
-
const unit = assertDefined(match[2], "duration unit group missing");
|
|
76
|
-
return value * unitToMs[unit];
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Schema for positive integer validation (from string input)
|
|
80
|
-
* Transforms the string to a number
|
|
81
|
-
*/
|
|
82
|
-
const positiveIntArg = z.coerce.number().int().positive();
|
|
83
|
-
/**
|
|
84
|
-
* Schema for non-negative integer validation (from string input).
|
|
85
|
-
* Accepts 0 (used for `--limit 0` to disable the limit).
|
|
86
|
-
*/
|
|
87
|
-
const nonNegativeIntArg = z.coerce.number().int().nonnegative();
|
|
88
|
-
/**
|
|
89
|
-
* Schema for sort order (`asc` or `desc`).
|
|
90
|
-
*/
|
|
91
|
-
const orderArg = z.enum(["asc", "desc"]);
|
|
92
|
-
/**
|
|
93
|
-
* Translate a CLI `--order` value into the proto `PageDirection` enum.
|
|
94
|
-
* Returns `undefined` when the user did not specify an order so that
|
|
95
|
-
* callers can omit the field and fall back to the server default.
|
|
96
|
-
* @param order - Order string from CLI args (`"asc"` | `"desc"` | undefined)
|
|
97
|
-
* @returns PageDirection, or undefined when `order` is undefined
|
|
98
|
-
*/
|
|
99
|
-
function toPageDirection(order) {
|
|
100
|
-
if (order === void 0) return void 0;
|
|
101
|
-
return order === "asc" ? PageDirection.ASC : PageDirection.DESC;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Load env files from parsed arguments.
|
|
105
|
-
* Processes --env-file first, then --env-file-if-exists.
|
|
106
|
-
*
|
|
107
|
-
* Follows Node.js --env-file behavior:
|
|
108
|
-
* - Variables already set in the environment are NOT overwritten
|
|
109
|
-
* - Variables from later files override those from earlier files
|
|
110
|
-
* @param envFiles - Required env file path(s) that must exist
|
|
111
|
-
* @param envFilesIfExists - Optional env file path(s) that are loaded if they exist
|
|
112
|
-
*/
|
|
113
|
-
function loadEnvFiles(envFiles, envFilesIfExists) {
|
|
114
|
-
const originalEnvKeys = new Set(Object.keys(process.env));
|
|
115
|
-
const load = (files, required) => {
|
|
116
|
-
for (const file of [files ?? []].flat()) {
|
|
117
|
-
const envPath = path.resolve(process.cwd(), file);
|
|
118
|
-
if (!fs$1.existsSync(envPath)) {
|
|
119
|
-
if (required) throw new Error(`Environment file not found: ${envPath}`);
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
const parsed = parseEnv(fs$1.readFileSync(envPath, "utf-8"));
|
|
123
|
-
for (const [key, value] of Object.entries(parsed)) {
|
|
124
|
-
if (originalEnvKeys.has(key)) continue;
|
|
125
|
-
process.env[key] = value;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
load(envFiles, true);
|
|
130
|
-
load(envFilesIfExists, false);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Common arguments for all CLI commands
|
|
134
|
-
*
|
|
135
|
-
* NOTE: --env-file and --env-file-if-exists collide with Node.js flags due to a bug
|
|
136
|
-
* (https://github.com/nodejs/node/issues/54232). Node.js parses these even after the
|
|
137
|
-
* script path, causing warnings (twice due to tsx loader).
|
|
138
|
-
*/
|
|
139
|
-
const commonArgs = {
|
|
140
|
-
"env-file": arg(z.string().optional(), {
|
|
141
|
-
alias: "e",
|
|
142
|
-
description: "Path to the environment file (error if not found)",
|
|
143
|
-
completion: {
|
|
144
|
-
type: "file",
|
|
145
|
-
matcher: [".env.*", ".env"]
|
|
146
|
-
}
|
|
147
|
-
}),
|
|
148
|
-
"env-file-if-exists": arg(z.string().optional(), {
|
|
149
|
-
description: "Path to the environment file (ignored if not found)",
|
|
150
|
-
completion: {
|
|
151
|
-
type: "file",
|
|
152
|
-
matcher: [".env.*", ".env"]
|
|
153
|
-
},
|
|
154
|
-
effect: (_value, { args }) => {
|
|
155
|
-
loadEnvFiles(args["env-file"], args["env-file-if-exists"]);
|
|
156
|
-
}
|
|
157
|
-
}),
|
|
158
|
-
verbose: arg(z.boolean().default(false), {
|
|
159
|
-
description: "Enable verbose logging",
|
|
160
|
-
effect: (value) => {
|
|
161
|
-
verboseMode = value;
|
|
162
|
-
}
|
|
163
|
-
}),
|
|
164
|
-
json: arg(z.boolean().default(false), {
|
|
165
|
-
alias: "j",
|
|
166
|
-
description: "Output as JSON",
|
|
167
|
-
effect: (value) => {
|
|
168
|
-
logger.jsonMode = value;
|
|
169
|
-
}
|
|
170
|
-
})
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Arguments for commands that require workspace context
|
|
174
|
-
*/
|
|
175
|
-
const workspaceArgs = {
|
|
176
|
-
"workspace-id": arg(z.string().optional(), {
|
|
177
|
-
alias: "w",
|
|
178
|
-
description: "Workspace ID",
|
|
179
|
-
env: "TAILOR_PLATFORM_WORKSPACE_ID",
|
|
180
|
-
completion: { type: "none" }
|
|
181
|
-
}),
|
|
182
|
-
profile: arg(z.string().optional(), {
|
|
183
|
-
alias: "p",
|
|
184
|
-
description: "Workspace profile",
|
|
185
|
-
env: "TAILOR_PLATFORM_PROFILE",
|
|
186
|
-
completion: { type: "none" }
|
|
187
|
-
})
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* Shared config arg for commands that accept a config file path
|
|
191
|
-
*/
|
|
192
|
-
const configArg = { config: arg(z.string().default("tailor.config.ts"), {
|
|
193
|
-
alias: "c",
|
|
194
|
-
description: "Path to SDK config file",
|
|
195
|
-
env: "TAILOR_PLATFORM_SDK_CONFIG_PATH",
|
|
196
|
-
completion: {
|
|
197
|
-
type: "file",
|
|
198
|
-
extensions: ["ts"]
|
|
199
|
-
}
|
|
200
|
-
}) };
|
|
201
|
-
/**
|
|
202
|
-
* Shared config arg for commands that accept one or more comma-separated config file paths
|
|
203
|
-
*/
|
|
204
|
-
const multiConfigArg = { config: arg(z.string().default("tailor.config.ts"), {
|
|
205
|
-
alias: "c",
|
|
206
|
-
description: "Path to SDK config file. Use comma-separated paths to deploy multiple apps together.",
|
|
207
|
-
env: "TAILOR_PLATFORM_SDK_CONFIG_PATH",
|
|
208
|
-
completion: {
|
|
209
|
-
type: "file",
|
|
210
|
-
extensions: ["ts"]
|
|
211
|
-
}
|
|
212
|
-
}) };
|
|
213
|
-
/**
|
|
214
|
-
* Arguments for commands that interact with deployed resources (includes config)
|
|
215
|
-
*/
|
|
216
|
-
const deploymentArgs = {
|
|
217
|
-
...workspaceArgs,
|
|
218
|
-
...configArg
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Arguments for commands that require confirmation
|
|
222
|
-
*/
|
|
223
|
-
const confirmationArgs = { yes: arg(z.boolean().default(false), {
|
|
224
|
-
alias: "y",
|
|
225
|
-
description: "Skip confirmation prompts"
|
|
226
|
-
}) };
|
|
227
|
-
/**
|
|
228
|
-
* Arguments for commands that require organization context
|
|
229
|
-
*/
|
|
230
|
-
const organizationArgs = { "organization-id": arg(z.string(), {
|
|
231
|
-
alias: "o",
|
|
232
|
-
description: "Organization ID",
|
|
233
|
-
env: "TAILOR_PLATFORM_ORGANIZATION_ID",
|
|
234
|
-
completion: { type: "none" }
|
|
235
|
-
}) };
|
|
236
|
-
/**
|
|
237
|
-
* Arguments for list commands that accept `--order` / `--limit`. Sort
|
|
238
|
-
* order defaults to `desc` (newest first) because most callers want the
|
|
239
|
-
* latest items; pass `--order asc` to opt in to ascending order. The
|
|
240
|
-
* limit is unbounded by default so existing invocations keep returning
|
|
241
|
-
* every item; pass `--limit N` to cap the result size.
|
|
242
|
-
* @param defaultOrder - Default value for `--order` (defaults to `"desc"`)
|
|
243
|
-
* @returns Argument shape suitable for spreading into a command schema
|
|
244
|
-
*/
|
|
245
|
-
const paginationArgs = (defaultOrder = "desc") => ({
|
|
246
|
-
order: arg(orderArg.default(defaultOrder), { description: "Sort order (asc or desc)" }),
|
|
247
|
-
limit: arg(nonNegativeIntArg.optional(), {
|
|
248
|
-
alias: "l",
|
|
249
|
-
description: "Maximum number of items to return (0 or omit: unlimited)"
|
|
250
|
-
})
|
|
251
|
-
});
|
|
252
|
-
/**
|
|
253
|
-
* Arguments for time-series log list commands. Defaults to newest-first
|
|
254
|
-
* (`desc`) and a 50-item cap so that listing stays responsive on busy
|
|
255
|
-
* workspaces. Pass `--limit 0` to disable the cap and fetch all entries.
|
|
256
|
-
*/
|
|
257
|
-
const pagedLogArgs = {
|
|
258
|
-
order: arg(orderArg.default("desc"), { description: "Sort order (asc or desc)" }),
|
|
259
|
-
limit: arg(nonNegativeIntArg.default(50), {
|
|
260
|
-
alias: "l",
|
|
261
|
-
description: "Maximum number of items to return (0: unlimited)"
|
|
262
|
-
})
|
|
263
|
-
};
|
|
264
|
-
/**
|
|
265
|
-
* Arguments for commands that require folder context
|
|
266
|
-
*/
|
|
267
|
-
const folderArgs = { "folder-id": arg(z.string(), {
|
|
268
|
-
alias: "f",
|
|
269
|
-
description: "Folder ID",
|
|
270
|
-
env: "TAILOR_PLATFORM_FOLDER_ID",
|
|
271
|
-
completion: { type: "none" }
|
|
272
|
-
}) };
|
|
273
|
-
let verboseMode = false;
|
|
274
|
-
/**
|
|
275
|
-
* Returns whether verbose mode is enabled.
|
|
276
|
-
* Used by the global cleanup handler which doesn't have access to parsed args.
|
|
277
|
-
* @returns Whether verbose mode is enabled
|
|
278
|
-
*/
|
|
279
|
-
function isVerbose() {
|
|
280
|
-
return verboseMode;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
//#endregion
|
|
284
50
|
//#region src/cli/shared/command.ts
|
|
285
51
|
/**
|
|
286
52
|
* defineCommand with global args type (CommonArgsType).
|
|
@@ -13936,6 +13702,7 @@ async function startWorkflowCore(options) {
|
|
|
13936
13702
|
async function startWorkflowByName(options) {
|
|
13937
13703
|
const machineUser = await loadMachineUserName({
|
|
13938
13704
|
machineUser: options.machineUser,
|
|
13705
|
+
machineUserSource: options.machineUserSource,
|
|
13939
13706
|
profile: options.profile
|
|
13940
13707
|
});
|
|
13941
13708
|
if (!machineUser) throw new Error("Machine user is required. Specify --machine-user, set TAILOR_PLATFORM_MACHINE_USER_NAME, or set a profile default with 'tailor-sdk profile update <profile> --machine-user <name>'.");
|
|
@@ -13998,6 +13765,7 @@ const startCommand = defineAppCommand({
|
|
|
13998
13765
|
const { executionId, wait } = await startWorkflowByName({
|
|
13999
13766
|
name: args.name,
|
|
14000
13767
|
machineUser: args["machine-user"],
|
|
13768
|
+
machineUserSource: resolveMachineUserInputSource(args["machine-user"]),
|
|
14001
13769
|
arg: args.arg,
|
|
14002
13770
|
workspaceId: args["workspace-id"],
|
|
14003
13771
|
profile: args.profile,
|
|
@@ -15938,14 +15706,10 @@ const listCommand$7 = defineAppCommand({
|
|
|
15938
15706
|
|
|
15939
15707
|
//#endregion
|
|
15940
15708
|
//#region src/cli/commands/machineuser/token.ts
|
|
15941
|
-
|
|
15942
|
-
* Get a machine user access token for the current application.
|
|
15943
|
-
* @param options - Token retrieval options
|
|
15944
|
-
* @returns Machine user token info
|
|
15945
|
-
*/
|
|
15946
|
-
async function getMachineUserToken(options) {
|
|
15709
|
+
async function getMachineUserTokenInternal(options) {
|
|
15947
15710
|
const name = await loadMachineUserName({
|
|
15948
15711
|
machineUser: options.name,
|
|
15712
|
+
machineUserSource: options.nameSource,
|
|
15949
15713
|
profile: options.profile
|
|
15950
15714
|
});
|
|
15951
15715
|
if (!name) throw new Error("Machine user is required. Provide the NAME positional argument, set TAILOR_PLATFORM_MACHINE_USER_NAME, or set a profile default with 'tailor-sdk profile update <profile> --machine-user <name>'.");
|
|
@@ -15975,6 +15739,14 @@ async function getMachineUserToken(options) {
|
|
|
15975
15739
|
expiresAt: expiresAt.toISOString()
|
|
15976
15740
|
};
|
|
15977
15741
|
}
|
|
15742
|
+
/**
|
|
15743
|
+
* Get a machine user access token for the current application.
|
|
15744
|
+
* @param options - Token retrieval options
|
|
15745
|
+
* @returns Machine user token info
|
|
15746
|
+
*/
|
|
15747
|
+
async function getMachineUserToken(options) {
|
|
15748
|
+
return await getMachineUserTokenInternal(options);
|
|
15749
|
+
}
|
|
15978
15750
|
const tokenCommand = defineAppCommand({
|
|
15979
15751
|
name: "token",
|
|
15980
15752
|
description: "Get an access token for a machine user.",
|
|
@@ -15982,13 +15754,13 @@ const tokenCommand = defineAppCommand({
|
|
|
15982
15754
|
...deploymentArgs,
|
|
15983
15755
|
name: arg(z.string().optional(), {
|
|
15984
15756
|
positional: true,
|
|
15985
|
-
description: "Machine user name. Falls back to the active profile's default machine user."
|
|
15986
|
-
env: "TAILOR_PLATFORM_MACHINE_USER_NAME"
|
|
15757
|
+
description: "Machine user name. Falls back to TAILOR_PLATFORM_MACHINE_USER_NAME, then the active profile's default machine user."
|
|
15987
15758
|
})
|
|
15988
15759
|
}).strict(),
|
|
15989
15760
|
run: async (args) => {
|
|
15990
|
-
const token = await
|
|
15761
|
+
const token = await getMachineUserTokenInternal({
|
|
15991
15762
|
name: args.name,
|
|
15763
|
+
nameSource: resolveMachineUserInputSource(args.name, process.argv.slice(2), { valueIsExplicit: args.name !== void 0 }),
|
|
15992
15764
|
workspaceId: args["workspace-id"],
|
|
15993
15765
|
profile: args.profile,
|
|
15994
15766
|
configPath: args.config
|
|
@@ -17521,7 +17293,7 @@ async function generate(options) {
|
|
|
17521
17293
|
if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
|
|
17522
17294
|
let pluginManager;
|
|
17523
17295
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
17524
|
-
const { defineApplication } = await import("./application-
|
|
17296
|
+
const { defineApplication } = await import("./application-DbvD5UUz.mjs");
|
|
17525
17297
|
const application = defineApplication({
|
|
17526
17298
|
config,
|
|
17527
17299
|
pluginManager
|
|
@@ -19208,7 +18980,8 @@ const queryBaseOptionsSchema = z.object({
|
|
|
19208
18980
|
profile: z.string().optional(),
|
|
19209
18981
|
configPath: z.string().optional(),
|
|
19210
18982
|
engine: queryEngineSchema,
|
|
19211
|
-
machineUser: z.string().optional()
|
|
18983
|
+
machineUser: z.string().optional(),
|
|
18984
|
+
machineUserSource: z.enum(["option", "env"]).optional()
|
|
19212
18985
|
});
|
|
19213
18986
|
const queryOptionsSchema = queryBaseOptionsSchema.extend({ query: z.string() });
|
|
19214
18987
|
async function getNamespaceFromSqlQuery(workspaceId, query, client, namespaces) {
|
|
@@ -19233,6 +19006,7 @@ async function loadOptions(options) {
|
|
|
19233
19006
|
if (!result.success) throw new Error(assertDefined(result.error.issues[0], "validation error missing issues").message);
|
|
19234
19007
|
const machineUser = await loadMachineUserName({
|
|
19235
19008
|
machineUser: result.data.machineUser,
|
|
19009
|
+
machineUserSource: result.data.machineUserSource,
|
|
19236
19010
|
profile: result.data.profile
|
|
19237
19011
|
});
|
|
19238
19012
|
if (!machineUser) throw new Error("Machine user is required. Specify --machine-user, set TAILOR_PLATFORM_MACHINE_USER_NAME, or set a profile default with 'tailor-sdk profile update <profile> --machine-user <name>'.");
|
|
@@ -19653,7 +19427,8 @@ const queryCommand = defineAppCommand({
|
|
|
19653
19427
|
profile: args.profile,
|
|
19654
19428
|
configPath: args.config,
|
|
19655
19429
|
engine: args.engine,
|
|
19656
|
-
machineUser: args["machine-user"]
|
|
19430
|
+
machineUser: args["machine-user"],
|
|
19431
|
+
machineUserSource: resolveMachineUserInputSource(args["machine-user"])
|
|
19657
19432
|
};
|
|
19658
19433
|
if (mode.mode === "abort") {
|
|
19659
19434
|
logger.info("Editor closed without a query. Nothing was executed.");
|
|
@@ -19785,5 +19560,5 @@ function isDeno() {
|
|
|
19785
19560
|
}
|
|
19786
19561
|
|
|
19787
19562
|
//#endregion
|
|
19788
|
-
export { getOrganization as $, compareSnapshotWithRemote as $t, listCommand$3 as A, apiCommand as An, getExecutorWaitFailureMessage as At, show as B,
|
|
19789
|
-
//# sourceMappingURL=runtime-
|
|
19563
|
+
export { getOrganization as $, compareSnapshotWithRemote as $t, listCommand$3 as A, apiCommand as An, getExecutorWaitFailureMessage as At, show as B, listWorkflowExecutions as Bt, listCommand$2 as C, hasChanges as Cn, listWebhookExecutors as Ct, waitWorkflowExecution as D, PluginManager as Dn, listCommand$9 as Dt, waitCommand as E, sdkNameLabelKey as En, triggerExecutor as Et, generateCommand as F, startWorkflow as Ft, removeCommand$1 as G, deploy as Gt, extractOwnedNamespaces as H, formatKeyValueTable as Ht, generateMigrationScript as I, getCommand$5 as It, organizationTree as J, waitForExecution as Jt, updateCommand$1 as K, ensureConfigId as Kt, writeDbTypesFile as L, getWorkflow as Lt, truncate as M, assertWritable as Mn, listExecutorJobs as Mt, truncateCommand as N, defineAppCommand as Nn, watchExecutorJob as Nt, resumeCommand as O, generateUserTypes as On, listExecutors as Ot, generate as P, startCommand as Pt, getCommand$1 as Q, parseMigrationLabelNumber as Qt, getConfiguredEditorCommand as R, executionsCommand as Rt, listApps as S, formatMigrationDiff as Sn, getFunctionRegistry as St, healthCommand as T, resourceTrn as Tn, triggerCommand as Tt, logBetaWarning as U, getCommand$6 as Ut, showCommand as V, functionExecutionStatusToString as Vt, remove as W, getExecutor as Wt, listCommand$4 as X, MIGRATION_LABEL_KEY as Xt, treeCommand as Y, bundleMigrationScript as Yt, listOrganizations as Z, handleOptionalToRequiredError as Zt, getWorkspace as _, loadDiff as _n, listMachineUsers as _t, updateUser as a, MIGRATE_FILE_NAME as an, getFolder as at, createCommand as b, parseMigrationNumberArg as bn, listFunctionRegistries as bt, listCommand as c, compareLocalTypesWithSnapshot as cn, createCommand$1 as ct, inviteUser as d, getLatestMigrationNumber as dn, listOAuth2Clients as dt, generateAllTypeManifestsFromSnapshot as en, updateCommand$2 as et, restoreCommand as f, getMigrationDirPath as fn, getCommand$3 as ft, getCommand as g, isValidMigrationNumber as gn, listCommand$7 as gt, listWorkspaces as h, getNextMigrationNumber as hn, tokenCommand as ht, updateCommand as i, INITIAL_SCHEMA_NUMBER as in, getCommand$2 as it, listWorkflows as j, apiCall as jn, jobsCommand as jt, resumeWorkflow as k, prompt as kn, getExecutorJob as kt, listUsers as l, compareSnapshots as ln, createFolder as lt, listCommand$1 as m, getMigrationFiles as mn, getMachineUserToken as mt, query as n, DB_TYPES_FILE_NAME as nn, listCommand$5 as nt, removeCommand as o, SCHEMA_FILE_NAME as on, deleteCommand$1 as ot, restoreWorkspace as p, getMigrationFilePath as pn, getOAuth2Client as pt, updateOrganization as q, executeScript as qt, queryCommand as r, DIFF_FILE_NAME as rn, listFolders as rt, removeUser as s, assertValidMigrationFiles as sn, deleteFolder as st, isNativeTypeScriptRuntime as t, protoGqlPermission as tn, updateFolder as tt, inviteCommand as u, createSnapshotFromLocalTypes as un, listCommand$6 as ut, deleteCommand as v, reconstructSnapshotFromMigrations as vn, generate$1 as vt, getAppHealth as w, getNamespacesWithMigrations as wn, webhookCommand as wt, createWorkspace as x, formatDiffSummary as xn, getCommand$4 as xt, deleteWorkspace as y, formatMigrationNumber as yn, listCommand$8 as yt, openInConfiguredEditor as z, getWorkflowExecution as zt };
|
|
19564
|
+
//# sourceMappingURL=runtime-_vUgjiqT.mjs.map
|