@tailor-platform/sdk 1.55.0 → 1.55.2
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 +26 -0
- package/dist/application-D6znmyMd.mjs +4 -0
- package/dist/{application-DzUlASfA.mjs → application-MY7YJJ-C.mjs} +13 -17
- package/dist/application-MY7YJJ-C.mjs.map +1 -0
- package/dist/cli/index.mjs +98 -35
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +10 -10
- package/dist/cli/lib.mjs +2 -2
- package/dist/configure/index.d.mts +3 -3
- package/dist/configure/index.mjs +2 -8
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-BLsnrEtc.d.mts → index-1APcOP9X.d.mts} +3 -3
- package/dist/{index-BE-fpxIo.d.mts → index-CPRnOjjt.d.mts} +2 -2
- package/dist/{index-S6-FtUpA.d.mts → index-CQZVJ5SX.d.mts} +2 -2
- package/dist/{index-D9xG-a6Y.d.mts → index-CfRFkXIO.d.mts} +2 -2
- package/dist/{index-cHqh66cF.d.mts → index-DUupuPhZ.d.mts} +2 -2
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/{plugin-BuE5ZOnW.d.mts → plugin-C_FyVSdl.d.mts} +3 -3
- package/dist/{runtime-BZsl7Mh9.mjs → runtime-DH5F_z8A.mjs} +117 -40
- package/dist/runtime-DH5F_z8A.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/{workflow.generated-CQg1_Ami.d.mts → workflow.generated-BGLDYJOq.d.mts} +2 -2
- package/docs/cli-reference.md +12 -0
- package/docs/services/auth.md +11 -0
- package/package.json +11 -11
- package/dist/application-DM8q9GDI.mjs +0 -4
- package/dist/application-DzUlASfA.mjs.map +0 -1
- package/dist/runtime-BZsl7Mh9.mjs.map +0 -1
|
@@ -420,9 +420,9 @@ interface GeneratorAuthInput {
|
|
|
420
420
|
usernameField: string;
|
|
421
421
|
};
|
|
422
422
|
machineUsers?: Record<string, {
|
|
423
|
-
attributes
|
|
423
|
+
attributes?: Record<string, unknown>;
|
|
424
424
|
}>;
|
|
425
|
-
oauth2Clients?: Record<string,
|
|
425
|
+
oauth2Clients?: Record<string, OAuth2Client>;
|
|
426
426
|
idProvider?: IdProvider;
|
|
427
427
|
}
|
|
428
428
|
/**
|
|
@@ -631,4 +631,4 @@ interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
|
|
|
631
631
|
}
|
|
632
632
|
//#endregion
|
|
633
633
|
export { IdpUserTrigger as A, IdProvider as B, GeneratorConfig as C, ExecutorInput as D, Executor as E, WebhookOperation as F, SCIMAttribute as G, OAuth2ClientInput as H, WorkflowOperation as I, SCIMConfig as J, SCIMAttributeMapping as K, AuthInvoker as L, ResolverExecutedTrigger as M, ScheduleTriggerInput as N, FunctionOperation as O, TailorDBTrigger as P, BuiltinIdP as R, ResolverInput as S, AuthAccessTokenTrigger as T, OIDC as U, OAuth2Client as V, SAML as W, TenantProvider as X, SCIMResource as Y, ResolverNamespaceData as _, PluginExecutorContextBase as a, TailorDBReadyContext as b, PluginGeneratedResolver as c, PluginOutput as d, PluginProcessContext as f, GeneratorResult as g, ExecutorReadyContext as h, PluginExecutorContext as i, IncomingWebhookTrigger as j, GqlOperation as k, PluginGeneratedType as l, TypePluginOutput as m, Plugin as n, PluginGeneratedExecutor as o, TailorDBTypeForPlugin as p, SCIMAuthorization as q, PluginConfigs as r, PluginGeneratedExecutorWithFile as s, NamespacePluginOutput as t, PluginNamespaceProcessContext as u, ResolverReadyContext as v, BaseGeneratorConfig as w, Resolver as x, TailorDBNamespaceData as y, IDToken as z };
|
|
634
|
-
//# sourceMappingURL=plugin-
|
|
634
|
+
//# sourceMappingURL=plugin-C_FyVSdl.d.mts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as db } from "./schema-DKsNhbav.mjs";
|
|
3
3
|
import { $ as FilterSchema, A as FunctionExecution_Status, B as AuthOAuth2Client_GrantType, C as TailorDBType_Permission_Operator, D as IdPLang, E as PipelineResolver_OperationType, F as AuthConnection_Type, H as AuthSCIMAttribute_Type, I as AuthHookPoint, J as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, K as TenantProviderConfig_TenantProviderType, L as AuthIDPConfig_AuthType, M as ExecutorJobStatus, N as ExecutorTargetType, O as IdPPermissionOperator, P as ExecutorTriggerType, Q as Condition_Operator, R as AuthInvokerSchema, S as TailorDBGQLPermission_Permit, T as TailorDBType_PermitAction, U as AuthSCIMAttribute_Uniqueness, V as AuthSCIMAttribute_Mutability, W as AuthSCIMConfig_AuthorizationType, X as Subgraph_ServiceType, Y as ApplicationSchemaUpdateAttemptStatus, Z as ConditionSchema, _ as WorkspacePlatformUserRole, a as fetchMachineUserToken, b as TailorDBGQLPermission_Action, d as initOperatorClient, et as PageDirection, g as OperatorService, h as userAgent, i as fetchAll, k as IdPPermissionPermit, m as resolveStaticWebsiteUrls, o as fetchPaged, p as platformBaseUrl, q as UserProfileProviderConfig_UserProfileProviderType, v as WorkflowExecution_Status, w as TailorDBType_Permission_Permit, x as TailorDBGQLPermission_Operator, y as WorkflowJobExecution_Status, z as AuthOAuth2Client_ClientType } from "./client-DLPEPJ_s.mjs";
|
|
4
4
|
import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-DpJyJvNz.mjs";
|
|
5
|
-
import { C as
|
|
5
|
+
import { C as loadConfigPath, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, c as createExecutorService, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, g as createBundleCache, h as loadFilesWithIgnores, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as HTTP_METHODS, t as defineApplication, v as hashFile, w as loadWorkspaceId, y as loadConfig } from "./application-MY7YJJ-C.mjs";
|
|
6
6
|
import { t as multiline } from "./multiline-Cf9ODpr1.mjs";
|
|
7
7
|
import { t as readPackageJson } from "./package-json-DcQApfPQ.mjs";
|
|
8
8
|
import { n as isCLIError, t as createCLIError } from "./errors-EsY4XO6O.mjs";
|
|
@@ -717,6 +717,34 @@ function coerceFieldValue(field, raw) {
|
|
|
717
717
|
}
|
|
718
718
|
return raw;
|
|
719
719
|
}
|
|
720
|
+
/**
|
|
721
|
+
* Collapse top-level body keys that address a known input field by its
|
|
722
|
+
* protobuf name (snake_case) or JSON name to the field's `localName`. protojson
|
|
723
|
+
* accepts every alias, so converging them here lets the presence checks below
|
|
724
|
+
* reason in a single namespace — otherwise a `--body` written as
|
|
725
|
+
* `{"workspace_id": ...}` slips past the camelCase check and we inject a second
|
|
726
|
+
* `workspaceId`, which the server rejects as a duplicate field. When both forms
|
|
727
|
+
* are present the canonical key wins and the alias is dropped.
|
|
728
|
+
* @param body - The parsed body object to mutate
|
|
729
|
+
* @param fields - The target endpoint's input fields
|
|
730
|
+
* @returns Whether any key was rewritten
|
|
731
|
+
*/
|
|
732
|
+
function normalizeBodyFieldKeys(body, fields) {
|
|
733
|
+
const aliasToLocal = /* @__PURE__ */ new Map();
|
|
734
|
+
for (const f of fields) {
|
|
735
|
+
aliasToLocal.set(f.name, f.localName);
|
|
736
|
+
aliasToLocal.set(f.jsonName, f.localName);
|
|
737
|
+
}
|
|
738
|
+
let changed = false;
|
|
739
|
+
for (const key of Object.keys(body)) {
|
|
740
|
+
const local = aliasToLocal.get(key);
|
|
741
|
+
if (!local || local === key) continue;
|
|
742
|
+
if (!Object.hasOwn(body, local)) body[local] = body[key];
|
|
743
|
+
delete body[key];
|
|
744
|
+
changed = true;
|
|
745
|
+
}
|
|
746
|
+
return changed;
|
|
747
|
+
}
|
|
720
748
|
const FORBIDDEN_SEGMENTS = new Set([
|
|
721
749
|
"__proto__",
|
|
722
750
|
"constructor",
|
|
@@ -833,15 +861,16 @@ Use \`--field key=value\` (repeatable) to set request body fields without writin
|
|
|
833
861
|
mutated = true;
|
|
834
862
|
}
|
|
835
863
|
if (parsedBody && method) {
|
|
864
|
+
if (normalizeBodyFieldKeys(parsedBody, method.input.fields)) mutated = true;
|
|
836
865
|
const fieldNames = method.input.fields.map((f) => f.localName);
|
|
837
|
-
if (fieldNames.includes("workspaceId") && !("workspaceId"
|
|
866
|
+
if (fieldNames.includes("workspaceId") && !Object.hasOwn(parsedBody, "workspaceId")) try {
|
|
838
867
|
parsedBody.workspaceId = await loadWorkspaceId({
|
|
839
868
|
workspaceId: args["workspace-id"],
|
|
840
869
|
profile: args.profile
|
|
841
870
|
});
|
|
842
871
|
mutated = true;
|
|
843
872
|
} catch {}
|
|
844
|
-
if (fieldNames.includes("namespaceName") && !("namespaceName"
|
|
873
|
+
if (fieldNames.includes("namespaceName") && !Object.hasOwn(parsedBody, "namespaceName")) try {
|
|
845
874
|
const { config } = await loadConfig(args.config);
|
|
846
875
|
const ns = resolveNamespaceName(methodName, config);
|
|
847
876
|
if (ns) {
|
|
@@ -3584,7 +3613,7 @@ async function planServices$2(client, workspaceId, appName, appId, auths, forceA
|
|
|
3584
3613
|
};
|
|
3585
3614
|
}));
|
|
3586
3615
|
for (const auth of auths) {
|
|
3587
|
-
const {
|
|
3616
|
+
const { config } = auth;
|
|
3588
3617
|
const existing = existingServices[config.name];
|
|
3589
3618
|
const metaRequest = await buildMetaRequest({
|
|
3590
3619
|
trn: trn$4(workspaceId, config.name),
|
|
@@ -3659,7 +3688,7 @@ async function planIdPConfigs(client, workspaceId, auths, deletedServices, force
|
|
|
3659
3688
|
});
|
|
3660
3689
|
};
|
|
3661
3690
|
for (const authService of auths) {
|
|
3662
|
-
const {
|
|
3691
|
+
const { config } = authService;
|
|
3663
3692
|
const existingIdPConfigs = await fetchIdPConfigs(config.name);
|
|
3664
3693
|
const existingMap = /* @__PURE__ */ new Map();
|
|
3665
3694
|
existingIdPConfigs.forEach((idpConfig) => {
|
|
@@ -3851,7 +3880,7 @@ async function tryProtoBuiltinIdPConfig(client, workspaceId, builtinIdPConfig) {
|
|
|
3851
3880
|
async function planUserProfileConfigs(client, workspaceId, auths, deletedServices, forceApplyAll = false) {
|
|
3852
3881
|
const changeSet = createChangeSet("Auth userProfileConfigs");
|
|
3853
3882
|
for (const auth of auths) {
|
|
3854
|
-
const {
|
|
3883
|
+
const { config } = auth;
|
|
3855
3884
|
const name = `${config.name}-user-profile-config`;
|
|
3856
3885
|
try {
|
|
3857
3886
|
const { userProfileProviderConfig } = await client.getUserProfileConfig({
|
|
@@ -3934,7 +3963,7 @@ function protoUserProfileConfig(userProfile) {
|
|
|
3934
3963
|
async function planTenantConfigs(client, workspaceId, auths, deletedServices, forceApplyAll = false) {
|
|
3935
3964
|
const changeSet = createChangeSet("Auth tenantConfigs");
|
|
3936
3965
|
for (const auth of auths) {
|
|
3937
|
-
const {
|
|
3966
|
+
const { config } = auth;
|
|
3938
3967
|
const name = `${config.name}-tenant-config`;
|
|
3939
3968
|
try {
|
|
3940
3969
|
const { tenantProviderConfig } = await client.getTenantConfig({
|
|
@@ -4026,7 +4055,7 @@ async function planMachineUsers(client, workspaceId, auths, deletedServices, for
|
|
|
4026
4055
|
});
|
|
4027
4056
|
};
|
|
4028
4057
|
for (const auth of auths) {
|
|
4029
|
-
const {
|
|
4058
|
+
const { config } = auth;
|
|
4030
4059
|
const existingMachineUsers = await fetchMachineUsers(config.name);
|
|
4031
4060
|
const existingMap = /* @__PURE__ */ new Map();
|
|
4032
4061
|
existingMachineUsers.forEach((machineUser) => {
|
|
@@ -4165,7 +4194,7 @@ async function planOAuth2Clients(client, workspaceId, auths, deletedServices, ex
|
|
|
4165
4194
|
});
|
|
4166
4195
|
};
|
|
4167
4196
|
for (const auth of auths) {
|
|
4168
|
-
const {
|
|
4197
|
+
const { config } = auth;
|
|
4169
4198
|
const existingOAuth2Clients = await fetchOAuth2Clients(config.name);
|
|
4170
4199
|
const existingClientsMap = /* @__PURE__ */ new Map();
|
|
4171
4200
|
existingOAuth2Clients.forEach((oauth2Client) => {
|
|
@@ -4252,32 +4281,31 @@ async function planOAuth2Clients(client, workspaceId, auths, deletedServices, ex
|
|
|
4252
4281
|
return changeSet;
|
|
4253
4282
|
}
|
|
4254
4283
|
function protoOAuth2Client(oauth2ClientName, oauth2Client) {
|
|
4255
|
-
const parsed = OAuth2ClientSchema.parse(oauth2Client);
|
|
4256
4284
|
return {
|
|
4257
4285
|
name: oauth2ClientName,
|
|
4258
|
-
description:
|
|
4259
|
-
grantTypes:
|
|
4286
|
+
description: oauth2Client.description,
|
|
4287
|
+
grantTypes: oauth2Client.grantTypes.map((grantType) => {
|
|
4260
4288
|
switch (grantType) {
|
|
4261
4289
|
case "authorization_code": return AuthOAuth2Client_GrantType.AUTHORIZATION_CODE;
|
|
4262
4290
|
case "refresh_token": return AuthOAuth2Client_GrantType.REFRESH_TOKEN;
|
|
4263
4291
|
default: throw new Error(`Unknown OAuth2 client grant type: ${grantType}`);
|
|
4264
4292
|
}
|
|
4265
4293
|
}),
|
|
4266
|
-
redirectUris:
|
|
4294
|
+
redirectUris: oauth2Client.redirectURIs,
|
|
4267
4295
|
clientType: {
|
|
4268
4296
|
confidential: AuthOAuth2Client_ClientType.CONFIDENTIAL,
|
|
4269
4297
|
public: AuthOAuth2Client_ClientType.PUBLIC,
|
|
4270
4298
|
browser: AuthOAuth2Client_ClientType.BROWSER
|
|
4271
|
-
}[
|
|
4272
|
-
accessTokenLifetime:
|
|
4273
|
-
refreshTokenLifetime:
|
|
4274
|
-
requireDpop:
|
|
4299
|
+
}[oauth2Client.clientType ?? "confidential"],
|
|
4300
|
+
accessTokenLifetime: oauth2Client.accessTokenLifetimeSeconds,
|
|
4301
|
+
refreshTokenLifetime: oauth2Client.refreshTokenLifetimeSeconds,
|
|
4302
|
+
requireDpop: oauth2Client.requireDpop
|
|
4275
4303
|
};
|
|
4276
4304
|
}
|
|
4277
4305
|
async function planSCIMConfigs(client, workspaceId, auths, deletedServices) {
|
|
4278
4306
|
const changeSet = createChangeSet("Auth scimConfigs");
|
|
4279
4307
|
for (const auth of auths) {
|
|
4280
|
-
const {
|
|
4308
|
+
const { config } = auth;
|
|
4281
4309
|
const name = `${config.name}-scim-config`;
|
|
4282
4310
|
try {
|
|
4283
4311
|
await client.getAuthSCIMConfig({
|
|
@@ -4372,7 +4400,7 @@ async function planSCIMResources(client, workspaceId, auths, deletedServices) {
|
|
|
4372
4400
|
}
|
|
4373
4401
|
};
|
|
4374
4402
|
for (const auth of auths) {
|
|
4375
|
-
const {
|
|
4403
|
+
const { config } = auth;
|
|
4376
4404
|
const existingSCIMResources = await fetchSCIMResources(config.name);
|
|
4377
4405
|
const existingNameSet = /* @__PURE__ */ new Set();
|
|
4378
4406
|
existingSCIMResources.forEach((scimResource) => {
|
|
@@ -4525,7 +4553,7 @@ function formatAuthHookChangeEntries(changeSet, functionRegistryAuthHookChanges)
|
|
|
4525
4553
|
async function planAuthHooks(client, workspaceId, auths, deletedServices, forceApplyAll = false) {
|
|
4526
4554
|
const changeSet = createChangeSet("Auth hooks");
|
|
4527
4555
|
for (const auth of auths) {
|
|
4528
|
-
const {
|
|
4556
|
+
const { config } = auth;
|
|
4529
4557
|
const beforeLogin = config.hooks?.beforeLogin;
|
|
4530
4558
|
let existingHook;
|
|
4531
4559
|
try {
|
|
@@ -5110,7 +5138,7 @@ function resolveIdpNamespace(application, executorName, idpName) {
|
|
|
5110
5138
|
}
|
|
5111
5139
|
function resolveAuthNamespace(application) {
|
|
5112
5140
|
if (!application.authService) throw new Error("No Auth service configured");
|
|
5113
|
-
return application.authService.
|
|
5141
|
+
return application.authService.config.name;
|
|
5114
5142
|
}
|
|
5115
5143
|
function protoExecutor(application, executor) {
|
|
5116
5144
|
const appName = application.name;
|
|
@@ -5195,7 +5223,7 @@ function protoExecutor(application, executor) {
|
|
|
5195
5223
|
const target = executor.operation;
|
|
5196
5224
|
let targetType;
|
|
5197
5225
|
let targetConfig;
|
|
5198
|
-
const authNamespace = application.authService?.
|
|
5226
|
+
const authNamespace = application.authService?.config.name;
|
|
5199
5227
|
const invokerContext = `Executor "${executor.name}"`;
|
|
5200
5228
|
switch (target.kind) {
|
|
5201
5229
|
case "webhook":
|
|
@@ -10303,6 +10331,21 @@ function toExecutorJobAttemptInfo(attempt) {
|
|
|
10303
10331
|
operationReference: attempt.operationReference || ""
|
|
10304
10332
|
};
|
|
10305
10333
|
}
|
|
10334
|
+
function formatSubjectEvent(subject, eventTypes) {
|
|
10335
|
+
const actions = eventTypes.map((eventType) => eventType.split(".").at(-1) ?? eventType).join(", ");
|
|
10336
|
+
return actions ? `event: ${subject} ${actions}` : `event: ${subject}`;
|
|
10337
|
+
}
|
|
10338
|
+
function formatTypedEventTrigger(config) {
|
|
10339
|
+
const typedConfig = config.typedConfig;
|
|
10340
|
+
if (!typedConfig || typedConfig.case === void 0) return null;
|
|
10341
|
+
switch (typedConfig.case) {
|
|
10342
|
+
case "tailordb": return formatSubjectEvent(typedConfig.value.typeName, typedConfig.value.eventTypes);
|
|
10343
|
+
case "pipeline": return formatSubjectEvent(typedConfig.value.resolverName, typedConfig.value.eventTypes);
|
|
10344
|
+
case "idp": return formatSubjectEvent("idp user", typedConfig.value.eventTypes);
|
|
10345
|
+
case "auth": return formatSubjectEvent("auth access_token", typedConfig.value.eventTypes);
|
|
10346
|
+
default: return null;
|
|
10347
|
+
}
|
|
10348
|
+
}
|
|
10306
10349
|
/**
|
|
10307
10350
|
* Format trigger type for human-readable display.
|
|
10308
10351
|
* Examples:
|
|
@@ -10318,7 +10361,12 @@ function formatTriggerType(executor) {
|
|
|
10318
10361
|
if (!config || config.case === void 0) return executorTriggerTypeToString(executor.triggerType);
|
|
10319
10362
|
switch (config.case) {
|
|
10320
10363
|
case "schedule": return `schedule: ${config.value.frequency} (${config.value.timezone})`;
|
|
10321
|
-
case "event":
|
|
10364
|
+
case "event": {
|
|
10365
|
+
const typedTrigger = formatTypedEventTrigger(config.value);
|
|
10366
|
+
if (typedTrigger) return typedTrigger;
|
|
10367
|
+
if (!config.value.eventType) return executorTriggerTypeToString(executor.triggerType);
|
|
10368
|
+
return formatEventTrigger(config.value.eventType, config.value.condition?.expr);
|
|
10369
|
+
}
|
|
10322
10370
|
case "incomingWebhook": return "webhook";
|
|
10323
10371
|
default: return executorTriggerTypeToString(executor.triggerType);
|
|
10324
10372
|
}
|
|
@@ -10354,14 +10402,35 @@ function formatTriggerConfig(executor) {
|
|
|
10354
10402
|
timezone: config.value.timezone,
|
|
10355
10403
|
frequency: config.value.frequency
|
|
10356
10404
|
};
|
|
10357
|
-
case "event": return
|
|
10358
|
-
eventType: config.value.eventType,
|
|
10359
|
-
condition: config.value.condition?.expr || ""
|
|
10360
|
-
};
|
|
10405
|
+
case "event": return formatEventTriggerConfig(config.value);
|
|
10361
10406
|
case "incomingWebhook": return { secret: config.value.secret ? "***" : "" };
|
|
10362
10407
|
default: return {};
|
|
10363
10408
|
}
|
|
10364
10409
|
}
|
|
10410
|
+
function formatEventTriggerConfig(config) {
|
|
10411
|
+
const typedConfig = config.typedConfig;
|
|
10412
|
+
if (!typedConfig || typedConfig.case === void 0) return {
|
|
10413
|
+
eventType: config.eventType,
|
|
10414
|
+
condition: config.condition?.expr || ""
|
|
10415
|
+
};
|
|
10416
|
+
const base = {
|
|
10417
|
+
kind: typedConfig.case,
|
|
10418
|
+
eventTypes: typedConfig.value.eventTypes,
|
|
10419
|
+
namespaceName: typedConfig.value.namespaceName,
|
|
10420
|
+
condition: typedConfig.value.condition?.expr || ""
|
|
10421
|
+
};
|
|
10422
|
+
switch (typedConfig.case) {
|
|
10423
|
+
case "tailordb": return {
|
|
10424
|
+
...base,
|
|
10425
|
+
typeName: typedConfig.value.typeName
|
|
10426
|
+
};
|
|
10427
|
+
case "pipeline": return {
|
|
10428
|
+
...base,
|
|
10429
|
+
resolverName: typedConfig.value.resolverName
|
|
10430
|
+
};
|
|
10431
|
+
default: return base;
|
|
10432
|
+
}
|
|
10433
|
+
}
|
|
10365
10434
|
/**
|
|
10366
10435
|
* Format target config for display.
|
|
10367
10436
|
* @param executor - Executor from proto
|
|
@@ -10409,8 +10478,8 @@ function toExecutorInfo(executor) {
|
|
|
10409
10478
|
triggerType: formatTriggerType(executor),
|
|
10410
10479
|
targetType: executorTargetTypeToString(executor.targetType),
|
|
10411
10480
|
disabled: executor.disabled,
|
|
10412
|
-
triggerConfig:
|
|
10413
|
-
targetConfig:
|
|
10481
|
+
triggerConfig: formatTriggerConfig(executor),
|
|
10482
|
+
targetConfig: formatTargetConfig(executor)
|
|
10414
10483
|
};
|
|
10415
10484
|
}
|
|
10416
10485
|
|
|
@@ -11135,10 +11204,11 @@ const startCommand = defineAppCommand({
|
|
|
11135
11204
|
configPath: args.config,
|
|
11136
11205
|
interval: parseDuration(args.interval)
|
|
11137
11206
|
});
|
|
11207
|
+
const jsonOutput = logger.jsonMode;
|
|
11138
11208
|
logger.info(`Execution ID: ${executionId}`, { mode: "stream" });
|
|
11139
11209
|
if (args.wait) {
|
|
11140
|
-
const result = await wait({ showProgress:
|
|
11141
|
-
if (args.logs && !
|
|
11210
|
+
const result = await wait({ showProgress: !jsonOutput });
|
|
11211
|
+
if (args.logs && !jsonOutput) {
|
|
11142
11212
|
const { execution } = await getWorkflowExecution({
|
|
11143
11213
|
executionId,
|
|
11144
11214
|
workspaceId: args["workspace-id"],
|
|
@@ -11569,6 +11639,7 @@ const listCommand$9 = defineAppCommand({
|
|
|
11569
11639
|
...paginationArgs()
|
|
11570
11640
|
}).strict(),
|
|
11571
11641
|
run: async (args) => {
|
|
11642
|
+
const jsonOutput = logger.jsonMode;
|
|
11572
11643
|
const executors = await listExecutors({
|
|
11573
11644
|
workspaceId: args["workspace-id"],
|
|
11574
11645
|
profile: args.profile,
|
|
@@ -11577,10 +11648,11 @@ const listCommand$9 = defineAppCommand({
|
|
|
11577
11648
|
});
|
|
11578
11649
|
if (executors.length === 0) {
|
|
11579
11650
|
logger.info("No executors found.");
|
|
11651
|
+
if (jsonOutput) logger.out([]);
|
|
11580
11652
|
return;
|
|
11581
11653
|
}
|
|
11582
11654
|
logger.out(executors, { display: { disabled: (v) => v ? styles.warning("true") : styles.dim("false") } });
|
|
11583
|
-
if (!
|
|
11655
|
+
if (!jsonOutput) {
|
|
11584
11656
|
if (executors.some((e) => e.triggerType === "webhook")) logger.info("To see webhook URLs, run: tailor-sdk executor webhook list");
|
|
11585
11657
|
}
|
|
11586
11658
|
}
|
|
@@ -11837,6 +11909,7 @@ const listWebhookCommand = defineAppCommand({
|
|
|
11837
11909
|
...paginationArgs()
|
|
11838
11910
|
}).strict(),
|
|
11839
11911
|
run: async (args) => {
|
|
11912
|
+
const jsonOutput = logger.jsonMode;
|
|
11840
11913
|
const executors = await listWebhookExecutors({
|
|
11841
11914
|
workspaceId: args["workspace-id"],
|
|
11842
11915
|
profile: args.profile,
|
|
@@ -11845,10 +11918,11 @@ const listWebhookCommand = defineAppCommand({
|
|
|
11845
11918
|
});
|
|
11846
11919
|
if (executors.length === 0) {
|
|
11847
11920
|
logger.info("No webhook executors found.");
|
|
11921
|
+
if (jsonOutput) logger.out([]);
|
|
11848
11922
|
return;
|
|
11849
11923
|
}
|
|
11850
11924
|
logger.out(executors, { display: { disabled: (v) => v ? styles.warning("true") : styles.dim("false") } });
|
|
11851
|
-
if (!
|
|
11925
|
+
if (!jsonOutput) logger.info("To test a webhook, run: tailor-sdk executor trigger <name> -d '{\"key\":\"value\"}'");
|
|
11852
11926
|
}
|
|
11853
11927
|
});
|
|
11854
11928
|
const webhookCommand = defineCommand({
|
|
@@ -11996,13 +12070,14 @@ const listCommand$8 = defineAppCommand({
|
|
|
11996
12070
|
...paginationArgs()
|
|
11997
12071
|
}).strict(),
|
|
11998
12072
|
run: async (args) => {
|
|
12073
|
+
const jsonOutput = logger.jsonMode;
|
|
11999
12074
|
const registries = await listFunctionRegistries({
|
|
12000
12075
|
workspaceId: args["workspace-id"],
|
|
12001
12076
|
profile: args.profile,
|
|
12002
12077
|
order: args.order,
|
|
12003
12078
|
limit: args.limit
|
|
12004
12079
|
});
|
|
12005
|
-
const formatted =
|
|
12080
|
+
const formatted = jsonOutput ? registries : registries.map(({ createdAt, updatedAt, ...rest }) => ({
|
|
12006
12081
|
...rest,
|
|
12007
12082
|
createdAt: humanizeRelativeTime(createdAt),
|
|
12008
12083
|
updatedAt: humanizeRelativeTime(updatedAt)
|
|
@@ -12434,7 +12509,7 @@ function createGenerationManager(params) {
|
|
|
12434
12509
|
function getAuthInput() {
|
|
12435
12510
|
const authService = application.authService;
|
|
12436
12511
|
if (!authService) return void 0;
|
|
12437
|
-
const authConfig = authService.
|
|
12512
|
+
const authConfig = authService.config;
|
|
12438
12513
|
const userProfile = authService.userProfile;
|
|
12439
12514
|
return {
|
|
12440
12515
|
name: authConfig.name,
|
|
@@ -14419,7 +14494,7 @@ async function generate(options) {
|
|
|
14419
14494
|
if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
|
|
14420
14495
|
let pluginManager;
|
|
14421
14496
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
14422
|
-
const { defineApplication } = await import("./application-
|
|
14497
|
+
const { defineApplication } = await import("./application-D6znmyMd.mjs");
|
|
14423
14498
|
const application = defineApplication({
|
|
14424
14499
|
config,
|
|
14425
14500
|
pluginManager
|
|
@@ -14826,15 +14901,16 @@ const listCommand$3 = defineAppCommand({
|
|
|
14826
14901
|
...paginationArgs()
|
|
14827
14902
|
}).strict(),
|
|
14828
14903
|
run: async (args) => {
|
|
14904
|
+
const jsonOutput = logger.jsonMode;
|
|
14829
14905
|
const workflows = await listWorkflows({
|
|
14830
14906
|
workspaceId: args["workspace-id"],
|
|
14831
14907
|
profile: args.profile,
|
|
14832
14908
|
order: args.order,
|
|
14833
14909
|
limit: args.limit
|
|
14834
14910
|
});
|
|
14835
|
-
if (workflows.length === 0
|
|
14911
|
+
if (workflows.length === 0) {
|
|
14836
14912
|
logger.info("No workflows found.");
|
|
14837
|
-
return;
|
|
14913
|
+
if (!jsonOutput) return;
|
|
14838
14914
|
}
|
|
14839
14915
|
logger.out(workflows);
|
|
14840
14916
|
}
|
|
@@ -15059,13 +15135,14 @@ const listCommand$2 = defineAppCommand({
|
|
|
15059
15135
|
...paginationArgs()
|
|
15060
15136
|
}).strict(),
|
|
15061
15137
|
run: async (args) => {
|
|
15138
|
+
const jsonOutput = logger.jsonMode;
|
|
15062
15139
|
const apps = await listApps({
|
|
15063
15140
|
workspaceId: args["workspace-id"],
|
|
15064
15141
|
profile: args.profile,
|
|
15065
15142
|
order: args.order,
|
|
15066
15143
|
limit: args.limit
|
|
15067
15144
|
});
|
|
15068
|
-
const formattedApps =
|
|
15145
|
+
const formattedApps = jsonOutput ? apps : apps.map(({ updatedAt: _, createdAt, ...rest }) => ({
|
|
15069
15146
|
...rest,
|
|
15070
15147
|
createdAt: humanizeRelativeTime(createdAt)
|
|
15071
15148
|
}));
|
|
@@ -16610,4 +16687,4 @@ function isDeno() {
|
|
|
16610
16687
|
|
|
16611
16688
|
//#endregion
|
|
16612
16689
|
export { listCommand$5 as $, compareSnapshots as $t, truncate as A, workspaceArgs as An, startCommand as At, logBetaWarning as B, getExecutor as Bt, listCommand$2 as C, configArg as Cn, triggerExecutor as Ct, resumeWorkflow as D, pagedLogArgs as Dn, jobsCommand as Dt, resumeCommand as E, isVerbose as En, getExecutorJob as Et, writeDbTypesFile as F, getWorkflowExecution as Ft, organizationTree as G, parseMigrationLabelNumber as Gt, removeCommand$1 as H, executeScript as Ht, getConfiguredEditorCommand as I, listWorkflowExecutions as It, listOrganizations as J, DIFF_FILE_NAME as Jt, treeCommand as K, bundleMigrationScript as Kt, openInConfiguredEditor as L, functionExecutionStatusToString as Lt, generate as M, getCommand$5 as Mt, generateCommand as N, getWorkflow as Nt, listCommand$3 as O, paginationArgs as On, listExecutorJobs as Ot, generateMigrationScript as P, executionsCommand as Pt, updateFolder as Q, compareLocalTypesWithSnapshot as Qt, show as R, formatKeyValueTable as Rt, listApps as S, commonArgs as Sn, triggerCommand as St, healthCommand as T, deploymentArgs as Tn, listExecutors as Tt, updateCommand$1 as U, waitForExecution$1 as Ut, remove as V, deploy as Vt, updateOrganization as W, MIGRATION_LABEL_KEY as Wt, getOrganization as X, MIGRATE_FILE_NAME as Xt, getCommand$1 as Y, INITIAL_SCHEMA_NUMBER as Yt, updateCommand$2 as Z, SCHEMA_FILE_NAME as Zt, getWorkspace as _, prompt as _n, listFunctionRegistries as _t, updateUser as a, getNextMigrationNumber as an, createCommand$1 as at, createCommand as b, assertWritable as bn, listWebhookExecutors as bt, listCommand as c, reconstructSnapshotFromMigrations as cn, listOAuth2Clients as ct, inviteUser as d, formatMigrationDiff as dn, getMachineUserToken as dt, createSnapshotFromLocalTypes as en, listFolders as et, restoreCommand as f, hasChanges as fn, tokenCommand as ft, getCommand as g, generateUserTypes as gn, listCommand$8 as gt, listWorkspaces as h, trnPrefix as hn, generate$1 as ht, updateCommand as i, getMigrationFiles as in, deleteFolder as it, truncateCommand as j, startWorkflow as jt, listWorkflows as k, toPageDirection as kn, watchExecutorJob as kt, listUsers as l, formatMigrationNumber as ln, getCommand$3 as lt, listCommand$1 as m, sdkNameLabelKey as mn, listMachineUsers as mt, query as n, getMigrationDirPath as nn, getFolder as nt, removeCommand as o, isValidMigrationNumber as on, createFolder as ot, restoreWorkspace as p, getNamespacesWithMigrations as pn, listCommand$7 as pt, listCommand$4 as q, DB_TYPES_FILE_NAME as qt, queryCommand as r, getMigrationFilePath as rn, deleteCommand$1 as rt, removeUser as s, loadDiff as sn, listCommand$6 as st, isNativeTypeScriptRuntime as t, getLatestMigrationNumber as tn, getCommand$2 as tt, inviteCommand as u, formatDiffSummary as un, getOAuth2Client as ut, deleteCommand as v, apiCommand as vn, getCommand$4 as vt, getAppHealth as w, confirmationArgs as wn, listCommand$9 as wt, createWorkspace as x, defineAppCommand as xn, webhookCommand as xt, deleteWorkspace as y, apiCall as yn, getFunctionRegistry as yt, showCommand as z, getCommand$6 as zt };
|
|
16613
|
-
//# sourceMappingURL=runtime-
|
|
16690
|
+
//# sourceMappingURL=runtime-DH5F_z8A.mjs.map
|