@treeseed/sdk 0.4.6 → 0.4.8
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/operations/providers/default.js +1 -0
- package/dist/operations/services/config-runtime.d.ts +121 -26
- package/dist/operations/services/config-runtime.js +330 -196
- package/dist/operations/services/export-runtime.d.ts +18 -0
- package/dist/operations/services/export-runtime.js +136 -0
- package/dist/operations/services/template-registry.d.ts +2 -0
- package/dist/operations/services/template-registry.js +55 -6
- package/dist/operations-registry.js +1 -0
- package/dist/operations-types.d.ts +1 -1
- package/dist/platform/book-export.d.ts +78 -0
- package/dist/platform/book-export.js +449 -0
- package/dist/platform/contracts.d.ts +5 -0
- package/dist/platform/deploy-config.d.ts +2 -0
- package/dist/platform/deploy-config.js +30 -2
- package/dist/platform/env.yaml +5 -0
- package/dist/platform/environment.d.ts +10 -1
- package/dist/platform/environment.js +82 -6
- package/dist/scripts/aggregate-book.js +13 -118
- package/dist/scripts/config-treeseed.js +18 -27
- package/dist/sdk-types.d.ts +1 -0
- package/dist/template-catalog.js +1 -0
- package/dist/workflow/operations.d.ts +293 -177
- package/dist/workflow/operations.js +302 -188
- package/dist/workflow/policy.d.ts +12 -0
- package/dist/workflow/policy.js +58 -0
- package/dist/workflow-state.d.ts +19 -1
- package/dist/workflow-state.js +57 -39
- package/dist/workflow-support.d.ts +2 -1
- package/dist/workflow-support.js +14 -6
- package/dist/workflow.d.ts +14 -1
- package/dist/workflow.js +8 -1
- package/package.json +6 -1
|
@@ -455,6 +455,7 @@ class DefaultTreeseedOperationsProvider {
|
|
|
455
455
|
new WorkflowOperation("close"),
|
|
456
456
|
new WorkflowOperation("stage"),
|
|
457
457
|
new WorkflowOperation("config"),
|
|
458
|
+
new WorkflowOperation("export"),
|
|
458
459
|
new WorkflowOperation("release"),
|
|
459
460
|
new WorkflowOperation("destroy"),
|
|
460
461
|
new WorkflowOperation("dev"),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RemoteTreeseedConfig } from '../../remote.ts';
|
|
2
|
+
import { TREESEED_ENVIRONMENT_SCOPES, validateTreeseedEnvironmentValues } from '../../platform/environment.ts';
|
|
2
3
|
export declare const DEFAULT_TREESEED_API_BASE_URL = "https://api.treeseed.ai";
|
|
3
4
|
export declare const DEFAULT_TEMPLATE_CATALOG_URL = "https://api.treeseed.ai/search/templates";
|
|
4
5
|
export declare const TREESEED_TEMPLATE_CATALOG_URL_ENV = "TREESEED_TEMPLATE_CATALOG_URL";
|
|
@@ -12,6 +13,47 @@ export declare function getTreeseedMachineConfigPaths(tenantRoot: any): {
|
|
|
12
13
|
export declare function getTreeseedRemoteAuthPaths(tenantRoot: any): {
|
|
13
14
|
authPath: string;
|
|
14
15
|
};
|
|
16
|
+
export type TreeseedConfigScope = (typeof TREESEED_ENVIRONMENT_SCOPES)[number];
|
|
17
|
+
export type TreeseedConfigEntrySnapshot = {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
group: string;
|
|
21
|
+
description: string;
|
|
22
|
+
howToGet: string;
|
|
23
|
+
sensitivity: 'secret' | 'plain' | 'derived';
|
|
24
|
+
targets: string[];
|
|
25
|
+
purposes: string[];
|
|
26
|
+
storage: 'shared' | 'scoped';
|
|
27
|
+
scope: TreeseedConfigScope;
|
|
28
|
+
sharedScopes: TreeseedConfigScope[];
|
|
29
|
+
required: boolean;
|
|
30
|
+
currentValue: string;
|
|
31
|
+
suggestedValue: string;
|
|
32
|
+
effectiveValue: string;
|
|
33
|
+
};
|
|
34
|
+
export type TreeseedCollectedConfigContext = {
|
|
35
|
+
tenantRoot: string;
|
|
36
|
+
scopes: TreeseedConfigScope[];
|
|
37
|
+
project: {
|
|
38
|
+
name: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
siteUrl: string;
|
|
41
|
+
};
|
|
42
|
+
configPath: string;
|
|
43
|
+
keyPath: string;
|
|
44
|
+
entriesByScope: Record<TreeseedConfigScope, TreeseedConfigEntrySnapshot[]>;
|
|
45
|
+
valuesByScope: Record<TreeseedConfigScope, Record<string, string>>;
|
|
46
|
+
suggestedValuesByScope: Record<TreeseedConfigScope, Record<string, string>>;
|
|
47
|
+
authStatusByScope: Record<TreeseedConfigScope, ReturnType<typeof createConfigAuthStatus>>;
|
|
48
|
+
validationByScope: Record<TreeseedConfigScope, ReturnType<typeof validateTreeseedEnvironmentValues>>;
|
|
49
|
+
registry: ReturnType<typeof collectTreeseedEnvironmentContext>;
|
|
50
|
+
};
|
|
51
|
+
export type TreeseedConfigValueUpdate = {
|
|
52
|
+
scope: TreeseedConfigScope;
|
|
53
|
+
entryId: string;
|
|
54
|
+
value: string;
|
|
55
|
+
reused?: boolean;
|
|
56
|
+
};
|
|
15
57
|
export declare function createDefaultTreeseedMachineConfig({ tenantRoot, deployConfig, tenantConfig }: {
|
|
16
58
|
tenantRoot: any;
|
|
17
59
|
deployConfig: any;
|
|
@@ -55,6 +97,10 @@ export declare function createDefaultTreeseedMachineConfig({ tenantRoot, deployC
|
|
|
55
97
|
};
|
|
56
98
|
};
|
|
57
99
|
};
|
|
100
|
+
shared: {
|
|
101
|
+
values: {};
|
|
102
|
+
secrets: {};
|
|
103
|
+
};
|
|
58
104
|
environments: {
|
|
59
105
|
[k: string]: {
|
|
60
106
|
values: {};
|
|
@@ -113,7 +159,12 @@ export declare function resolveTreeseedRemoteConfig(startRoot?: string, env?: No
|
|
|
113
159
|
export declare function resolveTreeseedTemplateCatalogEndpoint(startRoot?: string, env?: NodeJS.ProcessEnv): string;
|
|
114
160
|
export declare function resolveTreeseedTemplateCatalogCachePath(startRoot?: string): string;
|
|
115
161
|
export declare function ensureTreeseedGitignoreEntries(tenantRoot: any): string;
|
|
116
|
-
export
|
|
162
|
+
export type TreeseedRepairAction = {
|
|
163
|
+
id: string;
|
|
164
|
+
detail: string;
|
|
165
|
+
};
|
|
166
|
+
export declare function applyTreeseedSafeRepairs(tenantRoot: string): TreeseedRepairAction[];
|
|
167
|
+
export declare function resolveTreeseedMachineEnvironmentValues(tenantRoot: any, scope: any): {};
|
|
117
168
|
export declare function setTreeseedMachineEnvironmentValue(tenantRoot: any, scope: any, entry: any, value: any): any;
|
|
118
169
|
export declare function collectTreeseedEnvironmentContext(tenantRoot: any): import("../../platform/environment.ts").TreeseedResolvedEnvironmentRegistry;
|
|
119
170
|
export declare function collectTreeseedConfigSeedValues(tenantRoot: any, scope: any, env?: NodeJS.ProcessEnv): any;
|
|
@@ -127,14 +178,14 @@ export declare function applyTreeseedEnvironmentToProcess({ tenantRoot, scope, o
|
|
|
127
178
|
tenantRoot: any;
|
|
128
179
|
scope: any;
|
|
129
180
|
override?: boolean | undefined;
|
|
130
|
-
}):
|
|
181
|
+
}): {};
|
|
131
182
|
export declare function validateTreeseedCommandEnvironment({ tenantRoot, scope, purpose }: {
|
|
132
183
|
tenantRoot: any;
|
|
133
184
|
scope: any;
|
|
134
185
|
purpose: any;
|
|
135
186
|
}): {
|
|
136
187
|
registry: import("../../platform/environment.ts").TreeseedResolvedEnvironmentRegistry;
|
|
137
|
-
values:
|
|
188
|
+
values: {};
|
|
138
189
|
validation: import("../../platform/environment.ts").TreeseedEnvironmentValidationResult;
|
|
139
190
|
};
|
|
140
191
|
export declare function assertTreeseedCommandEnvironment({ tenantRoot, scope, purpose }: {
|
|
@@ -143,7 +194,7 @@ export declare function assertTreeseedCommandEnvironment({ tenantRoot, scope, pu
|
|
|
143
194
|
purpose: any;
|
|
144
195
|
}): {
|
|
145
196
|
registry: import("../../platform/environment.ts").TreeseedResolvedEnvironmentRegistry;
|
|
146
|
-
values:
|
|
197
|
+
values: {};
|
|
147
198
|
validation: import("../../platform/environment.ts").TreeseedEnvironmentValidationResult;
|
|
148
199
|
};
|
|
149
200
|
export declare function writeTreeseedLocalEnvironmentFiles(tenantRoot: any): {
|
|
@@ -245,25 +296,69 @@ export declare function initializeTreeseedPersistentEnvironment({ tenantRoot, sc
|
|
|
245
296
|
};
|
|
246
297
|
secrets: string[];
|
|
247
298
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
299
|
+
declare function createConfigAuthStatus(values: any): {
|
|
300
|
+
gh: {
|
|
301
|
+
authenticated: boolean;
|
|
302
|
+
};
|
|
303
|
+
wrangler: {
|
|
304
|
+
authenticated: boolean;
|
|
305
|
+
};
|
|
306
|
+
railway: {
|
|
307
|
+
authenticated: boolean;
|
|
308
|
+
};
|
|
309
|
+
copilot: {
|
|
310
|
+
configured: boolean;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
export declare function listRelevantTreeseedConfigEntries(registry: any, scope: TreeseedConfigScope): any;
|
|
314
|
+
export declare function collectTreeseedConfigContext({ tenantRoot, scopes, env, }: {
|
|
315
|
+
tenantRoot: string;
|
|
316
|
+
scopes?: TreeseedConfigScope[];
|
|
317
|
+
env?: NodeJS.ProcessEnv;
|
|
318
|
+
}): TreeseedCollectedConfigContext;
|
|
319
|
+
export declare function applyTreeseedConfigValues({ tenantRoot, updates, writeLocalFiles, applyLocalEnvironment, }: {
|
|
320
|
+
tenantRoot: string;
|
|
321
|
+
updates: TreeseedConfigValueUpdate[];
|
|
322
|
+
writeLocalFiles?: boolean;
|
|
323
|
+
applyLocalEnvironment?: boolean;
|
|
324
|
+
}): {
|
|
325
|
+
updated: {
|
|
326
|
+
scope: TreeseedConfigScope | "shared";
|
|
327
|
+
id: string;
|
|
328
|
+
reused: boolean;
|
|
329
|
+
cleared: boolean;
|
|
330
|
+
}[];
|
|
331
|
+
envFiles: {
|
|
332
|
+
envLocalPath: string;
|
|
333
|
+
devVarsPath: string;
|
|
334
|
+
} | null;
|
|
335
|
+
};
|
|
336
|
+
export declare function finalizeTreeseedConfig({ tenantRoot, scopes, sync, env, checkConnections, initializePersistent, }: {
|
|
337
|
+
tenantRoot: string;
|
|
338
|
+
scopes?: TreeseedConfigScope[];
|
|
339
|
+
sync?: 'none' | 'github' | 'cloudflare' | 'railway' | 'all';
|
|
340
|
+
env?: NodeJS.ProcessEnv;
|
|
341
|
+
checkConnections?: boolean;
|
|
342
|
+
initializePersistent?: boolean;
|
|
343
|
+
}): {
|
|
344
|
+
scopes: ("local" | "staging" | "prod")[];
|
|
345
|
+
synced: Record<string, unknown>;
|
|
346
|
+
initialized: Array<{
|
|
347
|
+
scope: TreeseedConfigScope;
|
|
348
|
+
secrets: number;
|
|
349
|
+
target: string;
|
|
350
|
+
}>;
|
|
351
|
+
connectionChecks: ReturnType<typeof checkTreeseedProviderConnections>[];
|
|
352
|
+
validationByScope: Record<TreeseedConfigScope, ReturnType<typeof validateTreeseedEnvironmentValues>>;
|
|
353
|
+
};
|
|
354
|
+
export declare function collectTreeseedPrintEnvReport({ tenantRoot, scope, env, revealSecrets, }: {
|
|
355
|
+
tenantRoot: string;
|
|
356
|
+
scope: TreeseedConfigScope;
|
|
357
|
+
env?: NodeJS.ProcessEnv;
|
|
358
|
+
revealSecrets?: boolean;
|
|
359
|
+
}): {
|
|
360
|
+
scope: "local" | "staging" | "prod";
|
|
361
|
+
revealSecrets: boolean;
|
|
362
|
+
entries: any;
|
|
363
|
+
};
|
|
364
|
+
export {};
|