@treeseed/sdk 0.10.16 → 0.10.17
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/dist/api/config.js +10 -3
- package/dist/operations/services/config-runtime.js +6 -1
- package/dist/operations/services/deploy.d.ts +107 -27
- package/dist/operations/services/deploy.js +852 -28
- package/dist/operations/services/project-platform.d.ts +4 -2
- package/dist/operations/services/project-platform.js +56 -27
- package/dist/operations/services/railway-api.d.ts +20 -0
- package/dist/operations/services/railway-api.js +153 -11
- package/dist/operations/services/railway-deploy.d.ts +7 -4
- package/dist/operations/services/railway-deploy.js +12 -4
- package/dist/platform/environment.js +3 -0
- package/dist/reconcile/builtin-adapters.js +34 -20
- package/dist/scripts/tenant-destroy.js +8 -2
- package/dist/workflow/operations.d.ts +92 -0
- package/dist/workflow/operations.js +11 -3
- package/dist/workflow.d.ts +1 -0
- package/package.json +1 -1
- package/templates/github/deploy-web.workflow.yml +8 -1
|
@@ -1227,10 +1227,102 @@ export declare function workflowRecover(helpers: WorkflowOperationHelpers, input
|
|
|
1227
1227
|
finalState?: WorkflowStatePayload;
|
|
1228
1228
|
}>>;
|
|
1229
1229
|
export declare function workflowDestroy(helpers: WorkflowOperationHelpers, input: TreeseedDestroyInput): Promise<TreeseedWorkflowResult<{
|
|
1230
|
+
remoteResult: {
|
|
1231
|
+
target: {
|
|
1232
|
+
kind: string;
|
|
1233
|
+
scope: string;
|
|
1234
|
+
} | {
|
|
1235
|
+
kind: string;
|
|
1236
|
+
branchName: string;
|
|
1237
|
+
};
|
|
1238
|
+
deleteData: boolean;
|
|
1239
|
+
summary: {
|
|
1240
|
+
target: any;
|
|
1241
|
+
identity: any;
|
|
1242
|
+
workerName: any;
|
|
1243
|
+
siteUrl: any;
|
|
1244
|
+
accountId: any;
|
|
1245
|
+
pages: any;
|
|
1246
|
+
formGuardKv: any;
|
|
1247
|
+
sessionKv: any;
|
|
1248
|
+
siteDataDb: any;
|
|
1249
|
+
queue: any;
|
|
1250
|
+
content: any;
|
|
1251
|
+
resources: {
|
|
1252
|
+
pagesProject: any;
|
|
1253
|
+
contentBucket: any;
|
|
1254
|
+
queue: any;
|
|
1255
|
+
dlq: any;
|
|
1256
|
+
database: any;
|
|
1257
|
+
formGuardKv: any;
|
|
1258
|
+
railwayProject: any;
|
|
1259
|
+
webDomain: any;
|
|
1260
|
+
apiDomain: any;
|
|
1261
|
+
railwayServices: {
|
|
1262
|
+
[k: string]: any;
|
|
1263
|
+
};
|
|
1264
|
+
};
|
|
1265
|
+
webCache: {
|
|
1266
|
+
webHost: any;
|
|
1267
|
+
contentHost: any;
|
|
1268
|
+
rulesManaged: boolean;
|
|
1269
|
+
lastSyncedAt: any;
|
|
1270
|
+
lastError: any;
|
|
1271
|
+
policy: {
|
|
1272
|
+
sourcePages: {
|
|
1273
|
+
paths: string[];
|
|
1274
|
+
browserTtlSeconds: number;
|
|
1275
|
+
edgeTtlSeconds: number;
|
|
1276
|
+
staleWhileRevalidateSeconds: number;
|
|
1277
|
+
staleIfErrorSeconds: number;
|
|
1278
|
+
};
|
|
1279
|
+
contentPages: Required<import("../platform/contracts.ts").TreeseedWebCachePolicyConfig>;
|
|
1280
|
+
r2PublishedObjects: Required<import("../platform/contracts.ts").TreeseedWebCachePolicyConfig>;
|
|
1281
|
+
};
|
|
1282
|
+
deployPurge: any;
|
|
1283
|
+
contentPurge: any;
|
|
1284
|
+
};
|
|
1285
|
+
};
|
|
1286
|
+
operations: {
|
|
1287
|
+
cloudflare: any[];
|
|
1288
|
+
railway: {
|
|
1289
|
+
provider: any;
|
|
1290
|
+
type: any;
|
|
1291
|
+
name: any;
|
|
1292
|
+
status: any;
|
|
1293
|
+
}[];
|
|
1294
|
+
local: {
|
|
1295
|
+
provider: any;
|
|
1296
|
+
type: any;
|
|
1297
|
+
name: any;
|
|
1298
|
+
status: any;
|
|
1299
|
+
}[];
|
|
1300
|
+
};
|
|
1301
|
+
} | null;
|
|
1302
|
+
scope: string;
|
|
1303
|
+
dryRun: boolean;
|
|
1304
|
+
force: boolean;
|
|
1305
|
+
deleteData: boolean;
|
|
1306
|
+
destroyRemote: boolean;
|
|
1307
|
+
destroyLocal: boolean;
|
|
1308
|
+
removeBuildArtifacts: boolean;
|
|
1309
|
+
expectedConfirmation: string;
|
|
1310
|
+
stateSummary: {
|
|
1311
|
+
workerName: any;
|
|
1312
|
+
lastDeploymentTimestamp: any;
|
|
1313
|
+
};
|
|
1314
|
+
plannedSteps: {
|
|
1315
|
+
id: string;
|
|
1316
|
+
description: string;
|
|
1317
|
+
}[];
|
|
1318
|
+
} & {
|
|
1319
|
+
finalState?: WorkflowStatePayload;
|
|
1320
|
+
}> | TreeseedWorkflowResult<{
|
|
1230
1321
|
dryRun: boolean;
|
|
1231
1322
|
remoteResult: Record<string, unknown> | null;
|
|
1232
1323
|
scope: string;
|
|
1233
1324
|
force: boolean;
|
|
1325
|
+
deleteData: boolean;
|
|
1234
1326
|
destroyRemote: boolean;
|
|
1235
1327
|
destroyLocal: boolean;
|
|
1236
1328
|
removeBuildArtifacts: boolean;
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
createBranchPreviewDeployTarget,
|
|
34
34
|
createPersistentDeployTarget,
|
|
35
35
|
destroyCloudflareResources,
|
|
36
|
+
destroyTreeseedEnvironmentResources,
|
|
36
37
|
ensureGeneratedWranglerConfig,
|
|
37
38
|
finalizeDeploymentState,
|
|
38
39
|
loadDeployState,
|
|
@@ -4679,6 +4680,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
4679
4680
|
const target = createPersistentDeployTarget(scope);
|
|
4680
4681
|
const dryRun = executionMode === "plan";
|
|
4681
4682
|
const force = input.force === true;
|
|
4683
|
+
const deleteData = input.deleteData === true;
|
|
4682
4684
|
const destroyRemote = input.destroyRemote !== false;
|
|
4683
4685
|
const destroyLocal = input.destroyLocal !== false;
|
|
4684
4686
|
const removeBuildArtifacts = input.removeBuildArtifacts === true;
|
|
@@ -4691,6 +4693,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
4691
4693
|
scope,
|
|
4692
4694
|
dryRun,
|
|
4693
4695
|
force,
|
|
4696
|
+
deleteData,
|
|
4694
4697
|
destroyRemote,
|
|
4695
4698
|
destroyLocal,
|
|
4696
4699
|
removeBuildArtifacts,
|
|
@@ -4706,14 +4709,18 @@ async function workflowDestroy(helpers, input) {
|
|
|
4706
4709
|
remoteResult: null
|
|
4707
4710
|
};
|
|
4708
4711
|
if (executionMode === "plan") {
|
|
4712
|
+
const plannedRemoteResult = destroyRemote ? await destroyTreeseedEnvironmentResources(tenantRoot, { dryRun: true, force, deleteData, target }) : null;
|
|
4709
4713
|
return buildWorkflowResult(
|
|
4710
4714
|
"destroy",
|
|
4711
4715
|
tenantRoot,
|
|
4712
|
-
|
|
4716
|
+
{
|
|
4717
|
+
...payload,
|
|
4718
|
+
remoteResult: plannedRemoteResult
|
|
4719
|
+
},
|
|
4713
4720
|
{
|
|
4714
4721
|
executionMode,
|
|
4715
4722
|
nextSteps: createNextSteps([
|
|
4716
|
-
{ operation: "destroy", reason: "Run without --plan to destroy the selected environment.", input: { environment: scope, force, removeBuildArtifacts } },
|
|
4723
|
+
{ operation: "destroy", reason: "Run without --plan to destroy the selected environment.", input: { environment: scope, force, deleteData, removeBuildArtifacts } },
|
|
4717
4724
|
{ operation: "status", reason: "Confirm the current environment state before making destructive changes." }
|
|
4718
4725
|
])
|
|
4719
4726
|
}
|
|
@@ -4725,6 +4732,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
4725
4732
|
{
|
|
4726
4733
|
environment: scope,
|
|
4727
4734
|
force,
|
|
4735
|
+
deleteData,
|
|
4728
4736
|
destroyRemote,
|
|
4729
4737
|
destroyLocal,
|
|
4730
4738
|
removeBuildArtifacts
|
|
@@ -4754,7 +4762,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
4754
4762
|
if (!confirmed) {
|
|
4755
4763
|
workflowError("destroy", "confirmation_required", `Destroy confirmation required. Re-run with confirm="${expectedConfirmation}".`);
|
|
4756
4764
|
}
|
|
4757
|
-
const remoteResult = destroyRemote ? await executeJournalStep(root, workflowRun.runId, "destroy-remote", () =>
|
|
4765
|
+
const remoteResult = destroyRemote ? await executeJournalStep(root, workflowRun.runId, "destroy-remote", () => destroyTreeseedEnvironmentResources(tenantRoot, { dryRun: false, force, deleteData, target })) : null;
|
|
4758
4766
|
if (!destroyRemote) {
|
|
4759
4767
|
skipJournalStep(root, workflowRun.runId, "destroy-remote", { skippedReason: "destroyRemote=false" });
|
|
4760
4768
|
}
|
package/dist/workflow.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -69,6 +69,13 @@ __WORKING_DIRECTORY_BLOCK__ web:
|
|
|
69
69
|
TREESEED_WEB_SERVICE_SECRET: ${{ secrets.TREESEED_WEB_SERVICE_SECRET }}
|
|
70
70
|
TREESEED_WEB_ASSERTION_SECRET: ${{ secrets.TREESEED_WEB_ASSERTION_SECRET }}
|
|
71
71
|
TREESEED_WEB_CSRF_SECRET: ${{ secrets.TREESEED_WEB_CSRF_SECRET }}
|
|
72
|
+
TREESEED_API_WEB_SERVICE_ID: ${{ vars.TREESEED_API_WEB_SERVICE_ID || vars.TREESEED_WEB_SERVICE_ID || 'web' }}
|
|
73
|
+
TREESEED_API_WEB_SERVICE_SECRET: ${{ secrets.TREESEED_API_WEB_SERVICE_SECRET || secrets.TREESEED_WEB_SERVICE_SECRET }}
|
|
74
|
+
TREESEED_API_WEB_ASSERTION_SECRET: ${{ secrets.TREESEED_API_WEB_ASSERTION_SECRET || secrets.TREESEED_WEB_ASSERTION_SECRET }}
|
|
75
|
+
TREESEED_API_AUTH_SECRET: ${{ secrets.TREESEED_API_AUTH_SECRET || secrets.TREESEED_BETTER_AUTH_SECRET }}
|
|
76
|
+
TREESEED_PLATFORM_RUNNER_SECRET: ${{ secrets.TREESEED_PLATFORM_RUNNER_SECRET }}
|
|
77
|
+
TREESEED_HOSTED_HUBS_GITHUB_OWNER: ${{ vars.TREESEED_HOSTED_HUBS_GITHUB_OWNER }}
|
|
78
|
+
TREESEED_HOSTED_HUBS_GITHUB_TOKEN: ${{ secrets.TREESEED_HOSTED_HUBS_GITHUB_TOKEN }}
|
|
72
79
|
TREESEED_SITE_URL: ${{ vars.TREESEED_SITE_URL }}
|
|
73
80
|
BETTER_AUTH_URL: ${{ vars.BETTER_AUTH_URL || vars.TREESEED_SITE_URL }}
|
|
74
81
|
TREESEED_CENTRAL_MARKET_API_BASE_URL: ${{ vars.TREESEED_CENTRAL_MARKET_API_BASE_URL || 'https://api.treeseed.ai' }}
|
|
@@ -80,7 +87,7 @@ __WORKING_DIRECTORY_BLOCK__ web:
|
|
|
80
87
|
TREESEED_PROJECT_ID: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}
|
|
81
88
|
TREESEED_WORKFLOW_ACTION: ${{ inputs.action_kind }}
|
|
82
89
|
TREESEED_WORKFLOW_ENVIRONMENT: ${{ inputs.environment }}
|
|
83
|
-
TREESEED_WORKFLOW_PLANE:
|
|
90
|
+
TREESEED_WORKFLOW_PLANE: all
|
|
84
91
|
TREESEED_WORKFLOW_PROJECT: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}
|
|
85
92
|
TREESEED_WORKFLOW_PREVIEW_ID: ${{ inputs.preview_id }}
|
|
86
93
|
steps:
|