@tailor-platform/sdk 1.73.2 → 1.74.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 +43 -0
- package/dist/application-BndtMTFY.mjs +3 -0
- package/dist/{application-Bb9NNp5m.mjs → application-DwmoI6ZQ.mjs} +231 -153
- package/dist/application-DwmoI6ZQ.mjs.map +1 -0
- package/dist/cli/commands/deploy/apply-phases.d.mts +1 -0
- package/dist/cli/commands/executor/trigger.d.mts +1 -1
- package/dist/cli/index.mjs +102 -13
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/shared/client.d.mts +1 -1
- package/dist/completion/zsh-worker.zsh +28 -3
- package/dist/{repl-editor-BmQOyZJd.mjs → repl-editor-BCozyiNq.mjs} +3 -2
- package/dist/{repl-editor-BmQOyZJd.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
- package/dist/{runtime-B8O6JFS2.mjs → runtime-Zkg3SUwi.mjs} +1974 -1217
- package/dist/runtime-Zkg3SUwi.mjs.map +1 -0
- package/dist/{service-DiEtAsvc.mjs → service-BCRJ-3NV.mjs} +18 -1
- package/dist/{service-DiEtAsvc.mjs.map → service-BCRJ-3NV.mjs.map} +1 -1
- package/dist/service-CPMlIg3X.mjs +3 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +2 -2
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +2 -2
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2 -2
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +1 -1
- package/dist/vitest/index.mjs +2 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/docs/cli/application.md +21 -11
- package/docs/cli/setup.md +25 -0
- package/docs/cli-reference.md +1 -0
- package/docs/services/tailordb.md +23 -0
- package/package.json +8 -8
- package/dist/application-BXdCl6bp.mjs +0 -3
- package/dist/application-Bb9NNp5m.mjs.map +0 -1
- package/dist/runtime-B8O6JFS2.mjs.map +0 -1
- package/dist/service-BXmdFwSH.mjs +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncomingWebhookTrigger, ScheduleTriggerInput } from "../../../types/executor.generated.mjs";
|
|
2
|
-
import { JsonObject } from "@bufbuild/protobuf";
|
|
3
2
|
import { z } from "zod";
|
|
3
|
+
import { JsonObject } from "@bufbuild/protobuf";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/commands/executor/trigger.d.ts
|
|
6
6
|
type ManualTrigger = IncomingWebhookTrigger | ScheduleTriggerInput;
|
package/dist/cli/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { C as CustomDomainStatus, R as FunctionExecution_Type, mt as AuthInvokerSchema, xt as PATScope } from "../service_pb-CIrhGwHk.mjs";
|
|
3
3
|
import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
|
|
4
4
|
import { n as logger, r as styles } from "../logger-BEiZZ3qT.mjs";
|
|
5
|
-
import { $t as
|
|
6
|
-
import { $ as
|
|
7
|
-
import { n as ExecutorSchema } from "../service-
|
|
5
|
+
import { $t as compareSnapshotWithRemote, A as listCommand$12, An as apiCommand, Bn as pagedLogArgs, C as listCommand$13, Cn as hasChanges, Dn as PluginManager, Dt as listCommand$6, E as waitCommand, En as sdkNameLabelKey, F as generateCommand$1, Fn as configArg, G as removeCommand$1, Gt as deploy, H as extractOwnedNamespaces, Hn as toPageDirection, Ht as formatKeyValueTable, I as generateMigrationScript, In as confirmationArgs, It as getCommand$6, K as updateCommand$3, Kt as ensureConfigId, L as writeDbTypesFile, Ln as deploymentArgs, Mn as assertWritable, N as truncateCommand, Nn as defineAppCommand, O as resumeCommand, On as generateUserTypes, Pn as commonArgs, Pt as startCommand, Q as getCommand$5, Qt as parseMigrationLabelNumber, R as getConfiguredEditorCommand, Rn as isVerbose, Rt as executionsCommand, Sn as formatMigrationDiff, T as healthCommand, Tn as resourceTrn, Tt as triggerCommand, U as logBetaWarning, Un as workspaceArgs, Ut as getCommand$1, V as showCommand, Vn as paginationArgs, Vt as functionExecutionStatusToString, X as listCommand$11, Xt as MIGRATION_LABEL_KEY, Y as treeCommand, Zt as handleOptionalToRequiredError, _n as loadDiff, b as createCommand$4, bn as parseMigrationNumberArg, c as listCommand$14, cn as compareLocalTypesWithSnapshot, ct as createCommand$3, dn as getLatestMigrationNumber, en as generateAllTypeManifestsFromSnapshot, et as updateCommand$2, f as restoreCommand, ft as getCommand$3, g as getCommand$7, gn as isValidMigrationNumber, gt as listCommand$8, ht as tokenCommand, i as updateCommand$4, in as INITIAL_SCHEMA_NUMBER, it as getCommand$4, jt as jobsCommand, kn as prompt, m as listCommand$15, mn as getMigrationFiles, nt as listCommand$10, o as removeCommand, ot as deleteCommand$4, pn as getMigrationFilePath, qt as executeScript, r as queryCommand, sn as assertValidMigrationFiles, t as isNativeTypeScriptRuntime, tn as protoGqlPermission, u as inviteCommand, un as createSnapshotFromLocalTypes, ut as listCommand$9, v as deleteCommand$5, vn as reconstructSnapshotFromMigrations, vt as generate, wn as getNamespacesWithMigrations, wt as webhookCommand, xt as getCommand$2, yn as formatMigrationNumber, yt as listCommand$7, z as openInConfiguredEditor, zn as multiConfigArg } from "../runtime-Zkg3SUwi.mjs";
|
|
6
|
+
import { $ as initOAuth2Client, A as hasUserTokenEntry, B as resolveUserTokenKey, C as getDistDir, D as deleteUserTokens, E as loadConfig, G as fetchAll, H as writePlatformConfig, I as loadStoredUserTokens, J as fetchPlatformMachineUserToken, L as loadWorkspaceId, N as loadConsoleBaseUrl, O as fetchLatestToken, P as loadMachineUserName, R as platformConfigFromProfile, U as closeConnectionPool, V as saveUserTokens, W as defaultPlatformBaseUrl, Y as fetchUserInfo, _ as composeFunctionTreeshakeOptions, a as resolveInlineSourcemap, et as initOperatorClient, g as platformBundleDefinePlugin, j as loadAccessToken, k as hasAnyUserTokenEntry, l as INVOKER_EXPR, o as WorkflowJobSchema, q as fetchPaged, s as ResolverSchema, t as defineApplication, tt as isDefaultPlatform, v as createLogLevelTreeshakeOptions, w as hashContent$1, y as resolveBundleLogLevel, z as readPlatformConfig } from "../application-DwmoI6ZQ.mjs";
|
|
7
|
+
import { n as ExecutorSchema } from "../service-BCRJ-3NV.mjs";
|
|
8
8
|
import { t as multiline } from "../multiline-sfHpTZZK.mjs";
|
|
9
9
|
import { r as isPluginGeneratedType } from "../seed-DoMTMLcm.mjs";
|
|
10
10
|
import { t as readPackageJson } from "../package-json-8b0O9TlX.mjs";
|
|
@@ -474,7 +474,8 @@ const deployCommand$1 = defineAppCommand({
|
|
|
474
474
|
aliases: ["apply"],
|
|
475
475
|
description: "Deploy your application by applying the Tailor configuration.",
|
|
476
476
|
args: z.object({
|
|
477
|
-
...
|
|
477
|
+
...workspaceArgs,
|
|
478
|
+
...multiConfigArg,
|
|
478
479
|
...confirmationArgs,
|
|
479
480
|
"dry-run": arg(z.boolean().optional(), {
|
|
480
481
|
alias: "d",
|
|
@@ -2006,7 +2007,7 @@ const folderCommand = defineCommand({
|
|
|
2006
2007
|
description: "Manage organization folders.",
|
|
2007
2008
|
subCommands: {
|
|
2008
2009
|
create: createCommand$3,
|
|
2009
|
-
delete: deleteCommand$
|
|
2010
|
+
delete: deleteCommand$4,
|
|
2010
2011
|
get: getCommand$4,
|
|
2011
2012
|
list: listCommand$10,
|
|
2012
2013
|
update: updateCommand$2
|
|
@@ -2116,7 +2117,7 @@ const createCommand$2 = defineAppCommand({
|
|
|
2116
2117
|
|
|
2117
2118
|
//#endregion
|
|
2118
2119
|
//#region src/cli/commands/profile/delete.ts
|
|
2119
|
-
const deleteCommand$
|
|
2120
|
+
const deleteCommand$3 = defineAppCommand({
|
|
2120
2121
|
name: "delete",
|
|
2121
2122
|
description: "Delete a profile.",
|
|
2122
2123
|
args: z.object({ name: arg(z.string(), {
|
|
@@ -2273,7 +2274,7 @@ const profileCommand = defineCommand({
|
|
|
2273
2274
|
description: "Manage workspace profiles (user + workspace combinations).",
|
|
2274
2275
|
subCommands: {
|
|
2275
2276
|
create: createCommand$2,
|
|
2276
|
-
delete: deleteCommand$
|
|
2277
|
+
delete: deleteCommand$3,
|
|
2277
2278
|
list: listCommand$4,
|
|
2278
2279
|
update: updateCommand$1
|
|
2279
2280
|
},
|
|
@@ -2601,7 +2602,7 @@ const createCommand$1 = defineAppCommand({
|
|
|
2601
2602
|
|
|
2602
2603
|
//#endregion
|
|
2603
2604
|
//#region src/cli/commands/secret/vault/delete.ts
|
|
2604
|
-
const deleteCommand$
|
|
2605
|
+
const deleteCommand$2 = defineAppCommand({
|
|
2605
2606
|
name: "delete",
|
|
2606
2607
|
description: "Delete a Secret Manager vault.",
|
|
2607
2608
|
args: z.object({
|
|
@@ -2697,7 +2698,7 @@ const vaultCommand = defineCommand({
|
|
|
2697
2698
|
description: "Manage Secret Manager vaults.",
|
|
2698
2699
|
subCommands: {
|
|
2699
2700
|
create: createCommand$1,
|
|
2700
|
-
delete: deleteCommand$
|
|
2701
|
+
delete: deleteCommand$2,
|
|
2701
2702
|
list: listCommand$3
|
|
2702
2703
|
},
|
|
2703
2704
|
async run() {
|
|
@@ -3782,6 +3783,75 @@ async function checkGitHub(options) {
|
|
|
3782
3783
|
throw new Error(`Detected ${String(findings.length)} drift finding(s) across ${String(count)} target(s). Re-run \`tailor-sdk setup\` to regenerate, or address each finding above.`);
|
|
3783
3784
|
}
|
|
3784
3785
|
|
|
3786
|
+
//#endregion
|
|
3787
|
+
//#region src/cli/commands/setup/delete.ts
|
|
3788
|
+
function normalizeRelPath(input) {
|
|
3789
|
+
return input.replaceAll("\\", "/").replace(/\/{2,}/g, "/").replace(/^\.\//, "").replace(/\/$/, "");
|
|
3790
|
+
}
|
|
3791
|
+
function targetKey(target) {
|
|
3792
|
+
return `${target.kind}:${target.workspaceName}`;
|
|
3793
|
+
}
|
|
3794
|
+
function resolveMatch(outputDir, targets, input) {
|
|
3795
|
+
const relPath = normalizeRelPath(input);
|
|
3796
|
+
const absPath = resolveWithinRoot(outputDir, relPath);
|
|
3797
|
+
if (absPath === null) throw new Error(`"${input}" must be a path inside the repository.`);
|
|
3798
|
+
const target = targets.find((t) => t.file === relPath);
|
|
3799
|
+
if (!target) throw new Error(`"${relPath}" is not a managed workflow/action file (not recorded in .github/tailor-sdk.lock). Only files generated by \`tailor-sdk setup\` can be deleted with this command.`);
|
|
3800
|
+
return {
|
|
3801
|
+
relPath,
|
|
3802
|
+
absPath,
|
|
3803
|
+
target
|
|
3804
|
+
};
|
|
3805
|
+
}
|
|
3806
|
+
function warnCoordinatorReferences(allTargets, deletedKeys, match) {
|
|
3807
|
+
if (match.target.kind !== "action") return;
|
|
3808
|
+
for (const coordinator of allTargets) if (coordinator.kind === "coordinate" && coordinator.inputs.actionDirs?.includes(match.target.inputs.dir) && !deletedKeys.has(targetKey(coordinator))) logger.warn(`Coordinator "${coordinator.workspaceName}" still references this action's directory (${match.target.inputs.dir}). Re-run \`tailor-sdk setup coordinate\` without --action ${match.target.workspaceName} to remove it there too.`);
|
|
3809
|
+
}
|
|
3810
|
+
/**
|
|
3811
|
+
* Delete managed workflow/action files and their `.github/tailor-sdk.lock` entries.
|
|
3812
|
+
*
|
|
3813
|
+
* Refuses to touch files that are not recorded in the lock, so it never
|
|
3814
|
+
* deletes hand-written workflows or the user-owned tailor-setup action.
|
|
3815
|
+
* @param options - Delete options
|
|
3816
|
+
*/
|
|
3817
|
+
async function setupDelete(options) {
|
|
3818
|
+
logBetaWarning("setup");
|
|
3819
|
+
const { outputDir, yes } = options;
|
|
3820
|
+
const lock = readLock(outputDir);
|
|
3821
|
+
if (!lock || lock.targets.length === 0) throw new Error("No managed workflows found (.github/tailor-sdk.lock is missing or empty). Run `tailor-sdk setup branch` (or another setup subcommand) first.");
|
|
3822
|
+
const matches = [...new Set(options.files.map(normalizeRelPath))].map((relPath) => resolveMatch(outputDir, lock.targets, relPath));
|
|
3823
|
+
const deletedKeys = new Set(matches.map((m) => targetKey(m.target)));
|
|
3824
|
+
for (const match of matches) warnCoordinatorReferences(lock.targets, deletedKeys, match);
|
|
3825
|
+
if (!yes) {
|
|
3826
|
+
const list = matches.map((m) => m.relPath).join("\n ");
|
|
3827
|
+
if (!await prompt.confirm({
|
|
3828
|
+
message: `This will delete the following file(s) and their .github/tailor-sdk.lock entries:\n ${list}\nContinue?`,
|
|
3829
|
+
default: false
|
|
3830
|
+
})) {
|
|
3831
|
+
logger.info("Delete cancelled.");
|
|
3832
|
+
return;
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
const remaining = [...lock.targets];
|
|
3836
|
+
try {
|
|
3837
|
+
for (const { relPath, absPath, target } of matches) {
|
|
3838
|
+
fs$1.rmSync(absPath, { force: true });
|
|
3839
|
+
if (target.kind === "action") {
|
|
3840
|
+
const dir = path.dirname(absPath);
|
|
3841
|
+
if (fs$1.existsSync(dir) && fs$1.readdirSync(dir).length === 0) fs$1.rmdirSync(dir);
|
|
3842
|
+
}
|
|
3843
|
+
const index = remaining.findIndex((t) => targetKey(t) === targetKey(target));
|
|
3844
|
+
if (index !== -1) remaining.splice(index, 1);
|
|
3845
|
+
logger.success(`Deleted ${styles.path(relPath)} (${target.kind} ${target.workspaceName})`);
|
|
3846
|
+
}
|
|
3847
|
+
} finally {
|
|
3848
|
+
if (remaining.length !== lock.targets.length) writeLock(outputDir, {
|
|
3849
|
+
version: 1,
|
|
3850
|
+
targets: remaining
|
|
3851
|
+
});
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3785
3855
|
//#endregion
|
|
3786
3856
|
//#region src/cli/commands/setup/index.ts
|
|
3787
3857
|
const checkCommand = defineAppCommand({
|
|
@@ -3940,6 +4010,24 @@ const previewCommand = defineAppCommand({
|
|
|
3940
4010
|
});
|
|
3941
4011
|
}
|
|
3942
4012
|
});
|
|
4013
|
+
const deleteCommand$1 = defineAppCommand({
|
|
4014
|
+
name: "delete",
|
|
4015
|
+
description: "Delete managed workflow/action file(s) and their .github/tailor-sdk.lock entries.",
|
|
4016
|
+
args: z.object({
|
|
4017
|
+
...confirmationArgs,
|
|
4018
|
+
files: arg(z.string().array().min(1), {
|
|
4019
|
+
positional: true,
|
|
4020
|
+
description: "Workflow/action file(s) to delete, as generated under .github/workflows or .github/actions"
|
|
4021
|
+
})
|
|
4022
|
+
}).strict(),
|
|
4023
|
+
run: async (args) => {
|
|
4024
|
+
await setupDelete({
|
|
4025
|
+
files: args.files,
|
|
4026
|
+
yes: args.yes,
|
|
4027
|
+
outputDir: process.cwd()
|
|
4028
|
+
});
|
|
4029
|
+
}
|
|
4030
|
+
});
|
|
3943
4031
|
const setupCommand = defineCommand({
|
|
3944
4032
|
name: "setup",
|
|
3945
4033
|
description: "Generate CI deploy workflows for your project. (beta)",
|
|
@@ -3949,7 +4037,8 @@ const setupCommand = defineCommand({
|
|
|
3949
4037
|
preview: previewCommand,
|
|
3950
4038
|
action: actionCommand,
|
|
3951
4039
|
coordinate: coordinateCommand,
|
|
3952
|
-
check: checkCommand
|
|
4040
|
+
check: checkCommand,
|
|
4041
|
+
delete: deleteCommand$1
|
|
3953
4042
|
}
|
|
3954
4043
|
});
|
|
3955
4044
|
|
|
@@ -5986,7 +6075,7 @@ async function fetchRemoteTypes(client, workspaceId, namespace) {
|
|
|
5986
6075
|
async function assertMigrationsReproduceLocalTypes(loaded, target) {
|
|
5987
6076
|
const { config, plugins } = loaded;
|
|
5988
6077
|
const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : void 0;
|
|
5989
|
-
const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-
|
|
6078
|
+
const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-BndtMTFY.mjs");
|
|
5990
6079
|
const application = defineApplication({
|
|
5991
6080
|
config,
|
|
5992
6081
|
pluginManager
|
|
@@ -5998,7 +6087,7 @@ async function assertMigrationsReproduceLocalTypes(loaded, target) {
|
|
|
5998
6087
|
await service.processNamespacePlugins();
|
|
5999
6088
|
}
|
|
6000
6089
|
const pluginExecutorFiles = generatePluginFilesIfNeeded(pluginManager, application.tailorDBServices, config.path);
|
|
6001
|
-
const executorService = application.executorService ?? (pluginExecutorFiles.length > 0 ? (await import("../service-
|
|
6090
|
+
const executorService = application.executorService ?? (pluginExecutorFiles.length > 0 ? (await import("../service-CPMlIg3X.mjs")).createExecutorService({ config: { files: [] } }) : void 0);
|
|
6002
6091
|
await executorService?.loadExecutors();
|
|
6003
6092
|
if (pluginExecutorFiles.length > 0) await executorService?.loadPluginExecutorFiles([...pluginExecutorFiles]);
|
|
6004
6093
|
const executorUsedTypes = /* @__PURE__ */ new Set();
|
|
@@ -6668,7 +6757,7 @@ const workspaceCommand = defineCommand({
|
|
|
6668
6757
|
subCommands: {
|
|
6669
6758
|
app: appCommand,
|
|
6670
6759
|
create: createCommand$4,
|
|
6671
|
-
delete: deleteCommand$
|
|
6760
|
+
delete: deleteCommand$5,
|
|
6672
6761
|
get: getCommand$7,
|
|
6673
6762
|
list: listCommand$15,
|
|
6674
6763
|
restore: restoreCommand,
|