@sequenceholdings/studio-cli 0.9.22 → 0.9.24
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/README.md +152 -144
- package/dist/access/commands.js +3 -5
- package/dist/access/principal.js +2 -2
- package/dist/access/tier-hosts.js +2 -2
- package/dist/agents/commands.d.ts +1 -1
- package/dist/agents/commands.js +9 -9
- package/dist/agents/scaffold.js +3 -3
- package/dist/agents/voice.d.ts +1 -1
- package/dist/agents/voice.js +1 -1
- package/dist/app/commands.d.ts +2 -2
- package/dist/app/commands.js +31 -21
- package/dist/app/deploy.d.ts +1 -1
- package/dist/app/deploy.js +1 -1
- package/dist/app/manifest.d.ts +9 -9
- package/dist/app/manifest.js +1 -1
- package/dist/app/prepare.js +1 -1
- package/dist/app/primitive-scaffold.js +1 -1
- package/dist/app/readme.js +6 -6
- package/dist/app/scaffold.js +1 -1
- package/dist/app/validate.d.ts +1 -1
- package/dist/app/workspace-scaffold.js +1 -1
- package/dist/artifact/delegate.d.ts +1 -1
- package/dist/artifact/delegate.js +43 -3
- package/dist/auth-cmds/commands.js +1 -2
- package/dist/bin.js +12 -2
- package/dist/cli-attribution.d.ts +4 -0
- package/dist/cli-attribution.js +25 -3
- package/dist/cli-errors.d.ts +9 -1
- package/dist/cli-errors.js +20 -9
- package/dist/command-contract.d.ts +7 -182
- package/dist/command-contract.js +9 -33
- package/dist/command-help.d.ts +4 -4
- package/dist/command-help.js +24 -24
- package/dist/command-telemetry.js +2 -2
- package/dist/config-dir.d.ts +8 -0
- package/dist/config-dir.js +35 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +15 -3
- package/dist/docs/commands.js +9 -4
- package/dist/env-registry.d.ts +4 -0
- package/dist/env-registry.js +15 -6
- package/dist/envs/commands.d.ts +3 -0
- package/dist/envs/commands.js +11 -0
- package/dist/exit-codes.d.ts +16 -0
- package/dist/exit-codes.js +27 -0
- package/dist/functions/bundle.d.ts +1 -1
- package/dist/functions/commands.js +19 -18
- package/dist/functions/manifest.js +1 -1
- package/dist/functions/service-account-guidance.d.ts +1 -1
- package/dist/functions/service-account-guidance.js +2 -2
- package/dist/lifecycle/check.d.ts +13 -0
- package/dist/lifecycle/check.js +116 -0
- package/dist/lifecycle/commands.d.ts +14 -0
- package/dist/lifecycle/commands.js +121 -0
- package/dist/lifecycle/plan.d.ts +28 -0
- package/dist/lifecycle/plan.js +113 -0
- package/dist/lifecycle/rollback.d.ts +7 -0
- package/dist/lifecycle/rollback.js +89 -0
- package/dist/lifecycle/seq-ci-tools.d.ts +107 -0
- package/dist/lifecycle/seq-ci-tools.js +177 -0
- package/dist/lifecycle/upgrade.d.ts +3 -0
- package/dist/lifecycle/upgrade.js +38 -0
- package/dist/machine-output.d.ts +11 -2
- package/dist/machine-output.js +32 -10
- package/dist/main.d.ts +16 -6
- package/dist/main.js +187 -361
- package/dist/orgs.d.ts +45 -0
- package/dist/orgs.js +106 -0
- package/dist/orm/delegate.d.ts +1 -1
- package/dist/orm/delegate.js +32 -18
- package/dist/orm/deployment-policy.js +1 -2
- package/dist/orm/discover.js +6 -8
- package/dist/orm/execute.d.ts +1 -1
- package/dist/orm/execute.js +5 -6
- package/dist/orm/failures.js +2 -2
- package/dist/orm/help.d.ts +1 -1
- package/dist/orm/help.js +5 -5
- package/dist/orm/history.js +1 -2
- package/dist/orm/operation-show.js +1 -2
- package/dist/orm/version-guard.d.ts +7 -2
- package/dist/orm/version-guard.js +12 -7
- package/dist/pipeline/codegen.js +2 -2
- package/dist/pipeline/commands.js +9 -7
- package/dist/pipeline/discovery.d.ts +1 -1
- package/dist/pipeline/discovery.js +2 -3
- package/dist/pipeline/help.d.ts +1 -1
- package/dist/pipeline/help.js +1 -1
- package/dist/pipeline/lifecycle.js +1 -1
- package/dist/pipeline/stage-secrets.js +4 -4
- package/dist/pipeline/templates.js +2 -2
- package/dist/pnpm-auto-update.js +3 -3
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +1 -1
- package/dist/principals/commands.d.ts +1 -1
- package/dist/principals/commands.js +13 -14
- package/dist/process/commands.js +4 -1
- package/dist/process/run-steps.d.ts +2 -2
- package/dist/process/runs.js +1 -2
- package/dist/registry/commands.d.ts +4 -0
- package/dist/registry/commands.js +281 -0
- package/dist/registry/help.d.ts +8 -0
- package/dist/registry/help.js +64 -0
- package/dist/registry/lifecycle-commands.d.ts +3 -0
- package/dist/registry/lifecycle-commands.js +60 -0
- package/dist/registry/lookup.d.ts +6 -0
- package/dist/registry/lookup.js +18 -0
- package/dist/registry/runners.d.ts +14 -0
- package/dist/registry/runners.js +206 -0
- package/dist/registry/spec.d.ts +45 -0
- package/dist/registry/spec.js +8 -0
- package/dist/repos/commands.js +1 -2
- package/dist/repos/github-connect-command.d.ts +10 -1
- package/dist/repos/github-connect-command.js +52 -11
- package/dist/repos/github-init.d.ts +9 -2
- package/dist/repos/github-init.js +18 -2
- package/dist/repos/init-repo.js +1 -2
- package/dist/run-pinned.d.ts +48 -0
- package/dist/run-pinned.js +127 -0
- package/dist/sdk-source.d.ts +64 -0
- package/dist/sdk-source.js +199 -0
- package/dist/secrets/commands.d.ts +1 -1
- package/dist/secrets/commands.js +29 -24
- package/dist/service-accounts/commands.d.ts +1 -1
- package/dist/service-accounts/commands.js +4 -5
- package/dist/staged-env.d.ts +14 -0
- package/dist/staged-env.js +73 -0
- package/dist/storage/commands.js +21 -22
- package/dist/templates/catalog.d.ts +4 -4
- package/dist/update-check.js +3 -3
- package/dist/version-support.d.ts +39 -0
- package/dist/version-support.js +71 -0
- package/package.json +11 -10
- package/release-summary.json +3 -1
package/dist/orgs.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const STAGES: readonly ["staging", "prod"];
|
|
3
|
+
export type Stage = (typeof STAGES)[number];
|
|
4
|
+
export declare const cliOrgSchema: z.ZodObject<{
|
|
5
|
+
org: z.ZodString;
|
|
6
|
+
stage: z.ZodEnum<{
|
|
7
|
+
staging: "staging";
|
|
8
|
+
prod: "prod";
|
|
9
|
+
}>;
|
|
10
|
+
origins: z.ZodObject<{
|
|
11
|
+
staging: z.ZodOptional<z.ZodString>;
|
|
12
|
+
prod: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type CliOrg = z.infer<typeof cliOrgSchema>;
|
|
16
|
+
declare const orgsFileSchema: z.ZodObject<{
|
|
17
|
+
orgs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
18
|
+
staging: z.ZodOptional<z.ZodString>;
|
|
19
|
+
prod: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type OrgRegistry = z.infer<typeof orgsFileSchema>['orgs'];
|
|
23
|
+
export declare function orgsPath(): string;
|
|
24
|
+
export declare function isStage(value: string): value is Stage;
|
|
25
|
+
/** `cliOrg` from a deployment's discovery response, or null when absent or malformed. */
|
|
26
|
+
export declare function parseCliOrg(value: unknown): CliOrg | null;
|
|
27
|
+
export declare function readOrgs(path?: string): Promise<OrgRegistry>;
|
|
28
|
+
/**
|
|
29
|
+
* Remember what a deployment says about itself. Its own stage's origin is
|
|
30
|
+
* authoritative; an advertised sibling origin only fills a stage not yet known,
|
|
31
|
+
* so one deployment can never repoint the other stage.
|
|
32
|
+
*/
|
|
33
|
+
export declare function recordCliOrg(cliOrg: CliOrg, path?: string): Promise<OrgRegistry>;
|
|
34
|
+
/** The org whose stage serves `url`, if any. */
|
|
35
|
+
export declare function orgOfUrl(orgs: OrgRegistry, url: string): {
|
|
36
|
+
org: string;
|
|
37
|
+
stage: Stage;
|
|
38
|
+
} | null;
|
|
39
|
+
/** The nearest `.seq/github.yml` at or above `cwd`, parsed loosely, or undefined. */
|
|
40
|
+
export declare function repositorySettings(cwd?: string): Promise<Record<string, unknown> | undefined>;
|
|
41
|
+
/** The `org` in the nearest `.seq/github.yml` at or above `cwd`, if any. */
|
|
42
|
+
export declare function repositoryOrg(cwd?: string): Promise<string | undefined>;
|
|
43
|
+
/** The `cli` pin in the nearest `.seq/github.yml`, if any. */
|
|
44
|
+
export declare function repositoryCliPin(cwd?: string): Promise<string | undefined>;
|
|
45
|
+
export {};
|
package/dist/orgs.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orgs and stages for `-e <org>/<stage>`.
|
|
3
|
+
*
|
|
4
|
+
* The published CLI ships no deployment list. Each deployment describes its own
|
|
5
|
+
* org and stage at `/api/auth/cli-config` (`cliOrg`), and the CLI remembers what
|
|
6
|
+
* it has seen in `~/.config/seq-studio/orgs.json`, so an org works once someone
|
|
7
|
+
* has logged in to, or added, either of its stages.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
11
|
+
import { dirname, join, parse as parsePath, resolve } from 'node:path';
|
|
12
|
+
import { load as yamlLoad } from 'js-yaml';
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { cliConfigDir } from './config-dir.js';
|
|
15
|
+
export const STAGES = ['staging', 'prod'];
|
|
16
|
+
const ORG_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
17
|
+
const originSchema = z.string().url().refine((value) => new URL(value).origin === value, 'must be a bare origin');
|
|
18
|
+
export const cliOrgSchema = z.object({
|
|
19
|
+
org: z.string().regex(ORG_PATTERN),
|
|
20
|
+
stage: z.enum(STAGES),
|
|
21
|
+
origins: z.object({ staging: originSchema.optional(), prod: originSchema.optional() }),
|
|
22
|
+
});
|
|
23
|
+
const orgsFileSchema = z.object({
|
|
24
|
+
orgs: z.record(z.string().regex(ORG_PATTERN), z.object({ staging: originSchema.optional(), prod: originSchema.optional() })),
|
|
25
|
+
});
|
|
26
|
+
export function orgsPath() {
|
|
27
|
+
return join(cliConfigDir(), 'orgs.json');
|
|
28
|
+
}
|
|
29
|
+
export function isStage(value) {
|
|
30
|
+
return STAGES.includes(value);
|
|
31
|
+
}
|
|
32
|
+
/** `cliOrg` from a deployment's discovery response, or null when absent or malformed. */
|
|
33
|
+
export function parseCliOrg(value) {
|
|
34
|
+
const parsed = cliOrgSchema.safeParse(value);
|
|
35
|
+
return parsed.success ? parsed.data : null;
|
|
36
|
+
}
|
|
37
|
+
export async function readOrgs(path = orgsPath()) {
|
|
38
|
+
if (!existsSync(path))
|
|
39
|
+
return {};
|
|
40
|
+
const parsed = orgsFileSchema.safeParse(JSON.parse(await readFile(path, 'utf8')));
|
|
41
|
+
if (!parsed.success)
|
|
42
|
+
throw new Error(`${path} is not a valid org registry; delete it and log in again.`);
|
|
43
|
+
return parsed.data.orgs;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Remember what a deployment says about itself. Its own stage's origin is
|
|
47
|
+
* authoritative; an advertised sibling origin only fills a stage not yet known,
|
|
48
|
+
* so one deployment can never repoint the other stage.
|
|
49
|
+
*/
|
|
50
|
+
export async function recordCliOrg(cliOrg, path = orgsPath()) {
|
|
51
|
+
const orgs = await readOrgs(path);
|
|
52
|
+
const known = { ...orgs[cliOrg.org] };
|
|
53
|
+
const own = cliOrg.origins[cliOrg.stage];
|
|
54
|
+
if (own)
|
|
55
|
+
known[cliOrg.stage] = own;
|
|
56
|
+
for (const stage of STAGES) {
|
|
57
|
+
const advertised = cliOrg.origins[stage];
|
|
58
|
+
if (stage !== cliOrg.stage && advertised && !known[stage])
|
|
59
|
+
known[stage] = advertised;
|
|
60
|
+
}
|
|
61
|
+
const next = { ...orgs, [cliOrg.org]: known };
|
|
62
|
+
await mkdir(dirname(path), { recursive: true });
|
|
63
|
+
await writeFile(path, `${JSON.stringify({ orgs: next }, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
64
|
+
return next;
|
|
65
|
+
}
|
|
66
|
+
/** The org whose stage serves `url`, if any. */
|
|
67
|
+
export function orgOfUrl(orgs, url) {
|
|
68
|
+
let origin;
|
|
69
|
+
try {
|
|
70
|
+
origin = new URL(url).origin;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
for (const [org, stages] of Object.entries(orgs)) {
|
|
76
|
+
for (const stage of STAGES)
|
|
77
|
+
if (stages[stage] === origin)
|
|
78
|
+
return { org, stage };
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/** The nearest `.seq/github.yml` at or above `cwd`, parsed loosely, or undefined. */
|
|
83
|
+
export async function repositorySettings(cwd = process.cwd()) {
|
|
84
|
+
let directory = resolve(cwd);
|
|
85
|
+
const { root } = parsePath(directory);
|
|
86
|
+
for (;;) {
|
|
87
|
+
const file = join(directory, '.seq', 'github.yml');
|
|
88
|
+
if (existsSync(file)) {
|
|
89
|
+
const settings = yamlLoad(await readFile(file, 'utf8'));
|
|
90
|
+
return typeof settings === 'object' && settings !== null ? { ...settings } : undefined;
|
|
91
|
+
}
|
|
92
|
+
if (directory === root)
|
|
93
|
+
return undefined;
|
|
94
|
+
directory = dirname(directory);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** The `org` in the nearest `.seq/github.yml` at or above `cwd`, if any. */
|
|
98
|
+
export async function repositoryOrg(cwd = process.cwd()) {
|
|
99
|
+
const org = (await repositorySettings(cwd))?.org;
|
|
100
|
+
return typeof org === 'string' && ORG_PATTERN.test(org) ? org : undefined;
|
|
101
|
+
}
|
|
102
|
+
/** The `cli` pin in the nearest `.seq/github.yml`, if any. */
|
|
103
|
+
export async function repositoryCliPin(cwd = process.cwd()) {
|
|
104
|
+
const pin = (await repositorySettings(cwd))?.cli;
|
|
105
|
+
return typeof pin === 'string' && /^\d+\.\d+$/.test(pin) ? pin : undefined;
|
|
106
|
+
}
|
package/dist/orm/delegate.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `seq-studio orm <sub>` — the Sequence ORM (OpCo data layer).
|
|
3
3
|
*
|
|
4
4
|
* Delegates to `runCli` from `@sequenceholdings/orm/cli` (same pattern as
|
|
5
|
-
* `artifact`): resolve `--env` from `~/.config/
|
|
5
|
+
* `artifact`): resolve `--env` from `~/.config/seq-studio/config.toml`, set
|
|
6
6
|
* SEQUENCE_ORM_BASE_URL, share the seqapi token, forward argv.
|
|
7
7
|
*/
|
|
8
8
|
import { type SourceSpec } from '@sequenceholdings/artifact-studio/source-resolver';
|
package/dist/orm/delegate.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* `seq-studio orm <sub>` — the Sequence ORM (OpCo data layer).
|
|
3
3
|
*
|
|
4
4
|
* Delegates to `runCli` from `@sequenceholdings/orm/cli` (same pattern as
|
|
5
|
-
* `artifact`): resolve `--env` from `~/.config/
|
|
5
|
+
* `artifact`): resolve `--env` from `~/.config/seq-studio/config.toml`, set
|
|
6
6
|
* SEQUENCE_ORM_BASE_URL, share the seqapi token, forward argv.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { resolve as resolvePath } from 'node:path';
|
|
9
9
|
import { ORM_USAGE } from './help.js';
|
|
10
|
+
import { BREAK_GLASS_HEADER, cliAttributionHeaders } from '../cli-attribution.js';
|
|
10
11
|
import { parseArgs } from '../argv.js';
|
|
11
12
|
import { parseSourceSpec, resolveArtifactSource, } from '@sequenceholdings/artifact-studio/source-resolver';
|
|
12
13
|
import { getAccessToken, tryGetAccessTokenWithMode } from '../auth.js';
|
|
@@ -103,16 +104,15 @@ function positionalDir(args) {
|
|
|
103
104
|
* hook), which is also the compiler version validating the definitions.
|
|
104
105
|
* An explicit SEQUENCE_ORM_MODULE_PATH always wins.
|
|
105
106
|
*/
|
|
106
|
-
function aliasOrmModuleForRemoteSource(envName) {
|
|
107
|
+
async function aliasOrmModuleForRemoteSource(envName) {
|
|
107
108
|
if (process.env[envName]?.trim())
|
|
108
109
|
return;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
110
|
+
// The ORM this command loaded (the project's under `sdk: project`). Unresolvable means the namespace's own
|
|
111
|
+
// imports decide; the load error names the missing module.
|
|
112
|
+
const { selectedSdkFile } = await import('../sdk-source.js');
|
|
113
|
+
const authoring = selectedSdkFile({ name: '@sequenceholdings/orm', subpath: './authoring' });
|
|
114
|
+
if (authoring)
|
|
115
|
+
process.env[envName] = authoring;
|
|
116
116
|
}
|
|
117
117
|
async function runOrmFromRepo({ sub, selection, auth, targetUrl, ormCli, unverifiedReason, sourceEnv, }) {
|
|
118
118
|
if (sourceEnv)
|
|
@@ -131,10 +131,10 @@ async function runOrmFromRepo({ sub, selection, auth, targetUrl, ormCli, unverif
|
|
|
131
131
|
repoDir: source.dir,
|
|
132
132
|
...(selection.path !== undefined ? { path: selection.path } : {}),
|
|
133
133
|
});
|
|
134
|
-
const mismatch = await ormVersionMismatch(dir);
|
|
134
|
+
const mismatch = await ormVersionMismatch(dir, { loadedVersion: await loadedOrmVersion() });
|
|
135
135
|
if (mismatch)
|
|
136
136
|
return failWith(mismatch);
|
|
137
|
-
aliasOrmModuleForRemoteSource(ormCli.ORM_MODULE_PATH_ENV);
|
|
137
|
+
await aliasOrmModuleForRemoteSource(ormCli.ORM_MODULE_PATH_ENV);
|
|
138
138
|
// A local apply authors any missing migration into the working tree for
|
|
139
139
|
// review. A clone is discarded, so an authored migration would be applied
|
|
140
140
|
// unreviewed and then lost: require the committed ledger to be in sync.
|
|
@@ -157,9 +157,15 @@ async function runOrmFromRepo({ sub, selection, auth, targetUrl, ormCli, unverif
|
|
|
157
157
|
await source.cleanup();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
/** The ORM version loadOrmCli loaded: the project's under `sdk: project`, else the bundled one. */
|
|
161
|
+
async function loadedOrmVersion() {
|
|
162
|
+
return (await import('../sdk-source.js')).selectedSdkVersion('@sequenceholdings/orm');
|
|
163
|
+
}
|
|
164
|
+
/** `cwd` is the project whose installed ORM and .seq/github.yml decide the copy; the current directory by default. */
|
|
165
|
+
async function loadOrmCli({ cwd } = {}) {
|
|
161
166
|
try {
|
|
162
|
-
|
|
167
|
+
const { importSdk } = await import('../sdk-source.js');
|
|
168
|
+
return await importSdk({ name: '@sequenceholdings/orm', subpath: './cli', bundled: () => import('@sequenceholdings/orm/cli'), cwd });
|
|
163
169
|
}
|
|
164
170
|
catch (err) {
|
|
165
171
|
if (err.code !== 'ERR_MODULE_NOT_FOUND')
|
|
@@ -298,14 +304,17 @@ export async function runOrmCommand(sub, rest) {
|
|
|
298
304
|
if (ORM_NETWORK_SUBS.has(sub) && !requested)
|
|
299
305
|
return failWith(REQUIRE_EXPLICIT_ENV_MESSAGE);
|
|
300
306
|
let targetUrl;
|
|
307
|
+
// Sessions are cached per configured environment: `-e <org>/<stage>` signs in as the environment serving it.
|
|
308
|
+
let authEnv = requested;
|
|
301
309
|
if (requested) {
|
|
302
310
|
const resolved = await resolveConfiguredEnv({ requested });
|
|
303
311
|
targetUrl = resolved.url;
|
|
312
|
+
authEnv = resolved.name;
|
|
304
313
|
process.env['SEQUENCE_ORM_BASE_URL'] = resolved.url;
|
|
305
314
|
}
|
|
306
315
|
const auth = await tryGetAccessTokenWithMode({
|
|
307
316
|
failClosedForM2m: true,
|
|
308
|
-
env:
|
|
317
|
+
env: authEnv,
|
|
309
318
|
targetUrl,
|
|
310
319
|
});
|
|
311
320
|
// The ORM CLI prefers SEQUENCE_ORM_TOKEN over the provider below. A sandbox
|
|
@@ -316,13 +325,18 @@ export async function runOrmCommand(sub, rest) {
|
|
|
316
325
|
else if (auth)
|
|
317
326
|
process.env['SEQUENCE_ORM_TOKEN'] = auth.token;
|
|
318
327
|
// Lazy import keeps `process`/`doctor` from pulling in the optional ORM package.
|
|
319
|
-
|
|
328
|
+
// A local namespace selects its own SDK; a --repo source has no installed packages, so the current directory decides.
|
|
329
|
+
const ormCli = await loadOrmCli({ cwd: repoSelection ? undefined : resolvePath(positionalDir(normalized) ?? '.') });
|
|
320
330
|
if (!ormCli)
|
|
321
331
|
return 1;
|
|
322
332
|
const { runCli, setTokenProvider } = ormCli;
|
|
333
|
+
// The ORM CLI has its own transport: hand it --break-glass, which the router took off argv (cli-attribution.ts).
|
|
334
|
+
const breakGlass = cliAttributionHeaders()[BREAK_GLASS_HEADER];
|
|
335
|
+
if (breakGlass)
|
|
336
|
+
process.env['SEQUENCE_ORM_BREAK_GLASS'] = breakGlass;
|
|
323
337
|
setTokenProvider(async () => {
|
|
324
338
|
try {
|
|
325
|
-
return await getAccessToken({ env:
|
|
339
|
+
return await getAccessToken({ env: authEnv, targetUrl });
|
|
326
340
|
}
|
|
327
341
|
catch {
|
|
328
342
|
return null;
|
|
@@ -337,7 +351,7 @@ async function runLocalOrm({ sub, normalized, auth, targetUrl, unverifiedReason,
|
|
|
337
351
|
const sourceEnvironment = sourceEnv ? await resolveOrmSourceEnvironment({ requested: sourceEnv }) : undefined;
|
|
338
352
|
if (sourceEnvironment && 'error' in sourceEnvironment)
|
|
339
353
|
return failWith(sourceEnvironment.error);
|
|
340
|
-
const problem = (requiresSchemaVersionCheck(sub) ? await ormVersionMismatch(positionalDir(normalized) ?? '.') : null) ??
|
|
354
|
+
const problem = (requiresSchemaVersionCheck(sub) ? await ormVersionMismatch(positionalDir(normalized) ?? '.', { loadedVersion: await loadedOrmVersion() }) : null) ??
|
|
341
355
|
await exportLocalApplySource({ sub, auth, targetUrl, dir: positionalDir(normalized), unverifiedReason, sourceEnvironment, dryRun: normalized.includes('--dry-run') });
|
|
342
356
|
if (problem)
|
|
343
357
|
return failWith(problem);
|
package/dist/orm/discover.js
CHANGED
|
@@ -74,7 +74,7 @@ export async function ormNamespacesCommand(args) {
|
|
|
74
74
|
console.error(`No readable namespaces at offset ${page.offset} (${page.total} total).`);
|
|
75
75
|
else {
|
|
76
76
|
console.error(`${page.offset + 1}-${page.offset + page.namespaces.length} of ${page.total} readable namespace(s)`);
|
|
77
|
-
console.error('Describe one: seq-studio orm
|
|
77
|
+
console.error('Describe one: seq-studio orm show <namespace>');
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const next = page.offset + page.namespaces.length;
|
|
@@ -84,8 +84,7 @@ export async function ormNamespacesCommand(args) {
|
|
|
84
84
|
return 0;
|
|
85
85
|
}
|
|
86
86
|
catch (error) {
|
|
87
|
-
printCliError(error);
|
|
88
|
-
return 1;
|
|
87
|
+
return printCliError(error);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
function findRelation({ schema, name }) {
|
|
@@ -233,7 +232,7 @@ export async function ormDescribeCommand(args) {
|
|
|
233
232
|
else {
|
|
234
233
|
console.log(`${schema.namespace} ${formatLabel(schema.definition_format)} version ${schema.version_id}`);
|
|
235
234
|
printOperations({ operations, heading: 'Persisted operations:' });
|
|
236
|
-
console.error(`Run one: seq-studio orm
|
|
235
|
+
console.error(`Run one: seq-studio orm run ${schema.namespace} <operation> --var <name>=<value>`);
|
|
237
236
|
}
|
|
238
237
|
return 0;
|
|
239
238
|
}
|
|
@@ -244,9 +243,9 @@ export async function ormDescribeCommand(args) {
|
|
|
244
243
|
console.log(JSON.stringify({ ...described, ...identity, operations }, null, 2));
|
|
245
244
|
else {
|
|
246
245
|
printNamespace({ schema, operations });
|
|
247
|
-
console.error(`Describe a table: seq-studio orm
|
|
246
|
+
console.error(`Describe a table: seq-studio orm show ${schema.namespace} <table>`);
|
|
248
247
|
if (operations.length > 0)
|
|
249
|
-
console.error(`Run an operation: seq-studio orm
|
|
248
|
+
console.error(`Run an operation: seq-studio orm run ${schema.namespace} <operation>`);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
251
|
else {
|
|
@@ -282,7 +281,6 @@ export async function ormDescribeCommand(args) {
|
|
|
282
281
|
return 0;
|
|
283
282
|
}
|
|
284
283
|
catch (error) {
|
|
285
|
-
printCliError(error);
|
|
286
|
-
return 1;
|
|
284
|
+
return printCliError(error);
|
|
287
285
|
}
|
|
288
286
|
}
|
package/dist/orm/execute.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `seq-studio orm
|
|
2
|
+
* `seq-studio orm run <namespace> <operation>` — run a deployed persisted
|
|
3
3
|
* operation by name, with no checkout.
|
|
4
4
|
*
|
|
5
5
|
* The data endpoint selects an operation by content hash, so a checkout's
|
package/dist/orm/execute.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `seq-studio orm
|
|
2
|
+
* `seq-studio orm run <namespace> <operation>` — run a deployed persisted
|
|
3
3
|
* operation by name, with no checkout.
|
|
4
4
|
*
|
|
5
5
|
* The data endpoint selects an operation by content hash, so a checkout's
|
|
@@ -147,7 +147,7 @@ function missingOperationMessage({ namespace, operation, page }) {
|
|
|
147
147
|
`No operation '${operation}' in ${namespace}'s deployed version${version}.`,
|
|
148
148
|
...(sameName ? [`Did you mean ${sameName}? Operation names are case-sensitive.`] : []),
|
|
149
149
|
`Deployed operations: ${shown}`,
|
|
150
|
-
`List them with their variables: seq-studio orm
|
|
150
|
+
`List them with their variables: seq-studio orm show ${namespace} --operations`,
|
|
151
151
|
].join('\n');
|
|
152
152
|
}
|
|
153
153
|
function parseEnvelope(body) {
|
|
@@ -191,8 +191,8 @@ export async function ormExecuteDeployedCommand(args) {
|
|
|
191
191
|
const [namespace, operationName] = args.positional;
|
|
192
192
|
if (!NAMESPACE_NAME.test(namespace)) {
|
|
193
193
|
throw new Error(`'${namespace}' is not a namespace name and '${operationName}' is not a directory. ` +
|
|
194
|
-
'Run a deployed operation with: seq-studio orm
|
|
195
|
-
'from a checkout: seq-studio orm
|
|
194
|
+
'Run a deployed operation with: seq-studio orm run <namespace> <operation>; ' +
|
|
195
|
+
'from a checkout: seq-studio orm run <operation> [dir].');
|
|
196
196
|
}
|
|
197
197
|
const fileVariables = await readVariablesFile(args);
|
|
198
198
|
const options = clientOptions(await buildContext(args));
|
|
@@ -213,7 +213,6 @@ export async function ormExecuteDeployedCommand(args) {
|
|
|
213
213
|
throw new Error(failureMessage({ namespace, operation, status: response.status, envelope }));
|
|
214
214
|
}
|
|
215
215
|
catch (error) {
|
|
216
|
-
printCliError(error);
|
|
217
|
-
return 1;
|
|
216
|
+
return printCliError(error);
|
|
218
217
|
}
|
|
219
218
|
}
|
package/dist/orm/failures.js
CHANGED
|
@@ -35,7 +35,7 @@ export function failureSummary(failure) {
|
|
|
35
35
|
export function failureNextStep({ failure, namespace }) {
|
|
36
36
|
const { code, details } = failure;
|
|
37
37
|
if (code === 'NOT_FOUND' && details.cause === 'unknown_operation') {
|
|
38
|
-
return `Next step: list the deployed operations with \`seq-studio orm
|
|
38
|
+
return `Next step: list the deployed operations with \`seq-studio orm show ${namespace} --operations\`, and run one by name with \`seq-studio orm run ${namespace} <operation>\`.`;
|
|
39
39
|
}
|
|
40
40
|
if (code === 'NOT_FOUND') {
|
|
41
41
|
return 'Next step: confirm `-e` targets the right environment; `seq-studio orm namespaces` lists the namespaces you can read. A namespace you cannot read looks the same as one that does not exist.';
|
|
@@ -44,7 +44,7 @@ export function failureNextStep({ failure, namespace }) {
|
|
|
44
44
|
return `Next step: ask an admin of ${namespace} to assign you a role that grants ${details.requirement.replace(/^(capability|role):/, '$1 ')} (\`seq-studio access\`).`;
|
|
45
45
|
}
|
|
46
46
|
if (code === 'BAD_USER_INPUT' && details.variable) {
|
|
47
|
-
return `Next step: fix variable $${details.variable}; \`seq-studio orm
|
|
47
|
+
return `Next step: fix variable $${details.variable}; \`seq-studio orm show ${namespace} --operations\` lists each operation's variables and types.`;
|
|
48
48
|
}
|
|
49
49
|
return null;
|
|
50
50
|
}
|
package/dist/orm/help.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ORM_USAGE = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\n scaffold a namespace package (v2: TypeScript schema + GraphQL documents);\n --repo scaffolds into a git-service repo (see Init into a repo below)\n seq-studio orm
|
|
1
|
+
export declare const ORM_USAGE = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\n scaffold a namespace package (v2: TypeScript schema + GraphQL documents);\n --repo scaffolds into a git-service repo (see Init into a repo below)\n seq-studio orm build [dir] write schema.graphql + operations.manifest.json + typePolicies.gen.ts (offline; runs consumer codegen when codegen.ts is present)\n seq-studio orm build [dir] --migration-export [--check]\n export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing\n seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync\n seq-studio orm plan [dir] -e <env> compile definitions and diff against the registry\n seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait] [--unverified-source \"<reason>\"] [--source-env <env>]\n author the migration, register, apply, and refresh the generated outputs (the everyday command);\n waits until the new version is live (default up to 20m; e.g. --timeout 90s), --no-wait returns once queued\n seq-studio orm plan|apply --repo <ns>/<name> [--path <dir>] [--ref <ref>] -e <env>\n plan/apply a namespace committed to a platform git-service repo (CI deploy-from-git);\n --path selects the namespace directory (default: repo root). A remote apply never\n authors migrations: the committed ledger must already match the definitions.\n seq-studio orm run <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n run the deployed version's persisted operation by name as the caller (no checkout)\n seq-studio orm run <operation> [dir] --variables-file <file> -e <env>\n execute from the checkout manifest through the installed ORM package\n both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF\n seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]\n read rows of a deployed v2 namespace as the caller (row-level security applies)\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]\n run read-only SQL against a deployed v2 namespace as the caller\n qualify tables and double-quote mixed-case columns (e.g. SELECT \"loanNumber\" FROM lending.loans)\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n list the namespaces you can read\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci|source] [--repo <ns>/<name> --branch <branch> (--target <target-key> | --path <dir>)] [--json]\n inspect or explicitly change the namespace's deployment controller\n seq-studio orm show <namespace> [<table> | --operations] -e <env> [--json]\n show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions\n seq-studio orm diff [dir] write/verify the committed migration standalone (--check is the offline CI gate; --allow-destructive consents; --rebase records a v1 -> v2 conversion)\n seq-studio orm migrate-from-yaml <dir> convert a v1 YAML namespace to the v2 TypeScript format (offline; migrations/ preserved)\n seq-studio orm import [dir] --spec <file> | --table <t> --from <schema.table> --map <target=source,...>\n plan a batched copy from an existing Postgres relation into an owned table (writes a SQL script; no database connection)\n\n Environments: see `seq-studio envs list` (built-in: local; more are\n discovered after you authenticate).\n Authenticate with: seq-studio login\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
package/dist/orm/help.js
CHANGED
|
@@ -3,8 +3,8 @@ export const ORM_USAGE = `usage:
|
|
|
3
3
|
seq-studio orm init <dir> [--repo <ns>/<name>]
|
|
4
4
|
scaffold a namespace package (v2: TypeScript schema + GraphQL documents);
|
|
5
5
|
--repo scaffolds into a git-service repo (see Init into a repo below)
|
|
6
|
-
seq-studio orm
|
|
7
|
-
seq-studio orm
|
|
6
|
+
seq-studio orm build [dir] write schema.graphql + operations.manifest.json + typePolicies.gen.ts (offline; runs consumer codegen when codegen.ts is present)
|
|
7
|
+
seq-studio orm build [dir] --migration-export [--check]
|
|
8
8
|
export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing
|
|
9
9
|
seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync
|
|
10
10
|
seq-studio orm plan [dir] -e <env> compile definitions and diff against the registry
|
|
@@ -15,9 +15,9 @@ export const ORM_USAGE = `usage:
|
|
|
15
15
|
plan/apply a namespace committed to a platform git-service repo (CI deploy-from-git);
|
|
16
16
|
--path selects the namespace directory (default: repo root). A remote apply never
|
|
17
17
|
authors migrations: the committed ledger must already match the definitions.
|
|
18
|
-
seq-studio orm
|
|
18
|
+
seq-studio orm run <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
|
|
19
19
|
run the deployed version's persisted operation by name as the caller (no checkout)
|
|
20
|
-
seq-studio orm
|
|
20
|
+
seq-studio orm run <operation> [dir] --variables-file <file> -e <env>
|
|
21
21
|
execute from the checkout manifest through the installed ORM package
|
|
22
22
|
both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF
|
|
23
23
|
seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]
|
|
@@ -30,7 +30,7 @@ export const ORM_USAGE = `usage:
|
|
|
30
30
|
seq-studio orm history <namespace> -e <env> [--limit N] [--json]
|
|
31
31
|
seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci|source] [--repo <ns>/<name> --branch <branch> (--target <target-key> | --path <dir>)] [--json]
|
|
32
32
|
inspect or explicitly change the namespace's deployment controller
|
|
33
|
-
seq-studio orm
|
|
33
|
+
seq-studio orm show <namespace> [<table> | --operations] -e <env> [--json]
|
|
34
34
|
show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions
|
|
35
35
|
seq-studio orm diff [dir] write/verify the committed migration standalone (--check is the offline CI gate; --allow-destructive consents; --rebase records a v1 -> v2 conversion)
|
|
36
36
|
seq-studio orm migrate-from-yaml <dir> convert a v1 YAML namespace to the v2 TypeScript format (offline; migrations/ preserved)
|
package/dist/orm/history.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export declare function requiresSchemaVersionCheck(sub: string): boolean;
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Fail before compiling a v2 schema with an ORM outside its declared range. `loadedVersion` is the ORM this command
|
|
4
|
+
* runs (the project's under `sdk: project`); without it, the copy beside this CLI.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ormVersionMismatch(dir: string, { loadedVersion }?: {
|
|
7
|
+
loadedVersion?: string;
|
|
8
|
+
}): Promise<string | null>;
|
|
@@ -22,8 +22,11 @@ function dependencyRange(manifest) {
|
|
|
22
22
|
}
|
|
23
23
|
return undefined;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Fail before compiling a v2 schema with an ORM outside its declared range. `loadedVersion` is the ORM this command
|
|
27
|
+
* runs (the project's under `sdk: project`); without it, the copy beside this CLI.
|
|
28
|
+
*/
|
|
29
|
+
export async function ormVersionMismatch(dir, { loadedVersion } = {}) {
|
|
27
30
|
const configPath = join(resolve(dir), 'sequence.config.ts');
|
|
28
31
|
try {
|
|
29
32
|
await readFile(configPath);
|
|
@@ -49,11 +52,7 @@ export async function ormVersionMismatch(dir) {
|
|
|
49
52
|
if (typeof range !== 'string' || !validRange(range)) {
|
|
50
53
|
return `invalid @sequenceholdings/orm range "${String(range)}" in ${manifestPath}`;
|
|
51
54
|
}
|
|
52
|
-
|
|
53
|
-
const ormPackagePath = fileURLToPath(new URL('../package.json', import.meta.resolve('@sequenceholdings/orm/cli')));
|
|
54
|
-
const ormManifest = JSON.parse(await readFile(ormPackagePath, 'utf8'));
|
|
55
|
-
const version = typeof ormManifest === 'object' && ormManifest !== null
|
|
56
|
-
? Reflect.get(ormManifest, 'version') : undefined;
|
|
55
|
+
const version = loadedVersion ?? await bundledOrmVersion();
|
|
57
56
|
if (typeof version !== 'string' || !satisfies(version, range)) {
|
|
58
57
|
return `this seq-studio loads @sequenceholdings/orm ${typeof version === 'string' ? version : '(unknown version)'}, ` +
|
|
59
58
|
`but ${manifestPath} requires ${range}. Run the namespace-local CLI after installing its dependencies, ` +
|
|
@@ -61,3 +60,9 @@ export async function ormVersionMismatch(dir) {
|
|
|
61
60
|
}
|
|
62
61
|
return null;
|
|
63
62
|
}
|
|
63
|
+
/** The ORM beside this CLI, matching the delegated ORM import in every installation layout. */
|
|
64
|
+
async function bundledOrmVersion() {
|
|
65
|
+
const ormPackagePath = fileURLToPath(new URL('../package.json', import.meta.resolve('@sequenceholdings/orm/cli')));
|
|
66
|
+
const ormManifest = JSON.parse(await readFile(ormPackagePath, 'utf8'));
|
|
67
|
+
return typeof ormManifest === 'object' && ormManifest !== null ? Reflect.get(ormManifest, 'version') : undefined;
|
|
68
|
+
}
|
package/dist/pipeline/codegen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `seq-studio pipeline
|
|
2
|
+
* `seq-studio pipeline build tables` — emit one `.stage.yml` per table from a
|
|
3
3
|
* typed TypeScript authoring module (SEQ-2485).
|
|
4
4
|
*/
|
|
5
5
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
@@ -67,7 +67,7 @@ export async function pipelineCodegenTablesCommand(args) {
|
|
|
67
67
|
}
|
|
68
68
|
catch (error) {
|
|
69
69
|
console.error(`${LOG} ${error instanceof Error ? error.message : String(error)}`);
|
|
70
|
-
console.error('usage: seq-studio pipeline
|
|
70
|
+
console.error('usage: seq-studio pipeline build tables --from <authoring.ts> [--dir <dir>] [--dry-run]');
|
|
71
71
|
return 1;
|
|
72
72
|
}
|
|
73
73
|
const files = spec.generatePerTableStageFiles(authoring);
|
|
@@ -46,7 +46,7 @@ ${PIPELINE_DISCOVERY_USAGE}
|
|
|
46
46
|
inspect with --retirement-id <id>; resume a stopped operation with
|
|
47
47
|
--retirement-id <id> --resume --yes (never creates a replacement plan)
|
|
48
48
|
|
|
49
|
-
seq-studio pipeline
|
|
49
|
+
seq-studio pipeline build tables [--from <authoring.ts>] [--dir <dir>] [--dry-run] [--force]
|
|
50
50
|
emit one <stage>.stage.yml per table from a typed PerTableIngestionAuthoring
|
|
51
51
|
module (default export, authoring, or silverlakeAuthoring export name)
|
|
52
52
|
|
|
@@ -135,7 +135,7 @@ ${PIPELINE_DISCOVERY_USAGE}
|
|
|
135
135
|
[--repo <namespace>/<slug>] [--json]
|
|
136
136
|
release an adopted binding; the remote object stays live (never deleted)
|
|
137
137
|
|
|
138
|
-
seq-studio pipeline run
|
|
138
|
+
seq-studio pipeline run --stage <slug> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]
|
|
139
139
|
fire the stage's active deployment resource (job run-now / DLT
|
|
140
140
|
start_update) and print the Databricks run URL.
|
|
141
141
|
|
|
@@ -160,9 +160,11 @@ export function pipelineSpecLoadErrorMessage(message) {
|
|
|
160
160
|
return ('@sequenceholdings/pipeline-spec is installed but a dependency failed to load. Reinstall dependencies, then retry.\n' +
|
|
161
161
|
` ${message}`);
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
/** pipeline-spec from the copy this command runs; `cwd` is the project whose SDK and .seq/github.yml decide it. */
|
|
164
|
+
async function importPipelineSpec({ cwd } = {}) {
|
|
164
165
|
try {
|
|
165
|
-
|
|
166
|
+
const { importSdk } = await import('../sdk-source.js');
|
|
167
|
+
return await importSdk({ name: '@sequenceholdings/pipeline-spec', bundled: () => import('@sequenceholdings/pipeline-spec'), cwd });
|
|
166
168
|
}
|
|
167
169
|
catch (err) {
|
|
168
170
|
if (err.code === 'ERR_MODULE_NOT_FOUND') {
|
|
@@ -322,11 +324,11 @@ function printHumanReport(report) {
|
|
|
322
324
|
console.log(report.ok ? `${LOG} validation passed` : `${LOG} validation failed`);
|
|
323
325
|
}
|
|
324
326
|
export async function pipelineValidateCommand(args) {
|
|
325
|
-
const spec = await importPipelineSpec();
|
|
326
|
-
if (!spec)
|
|
327
|
-
return 1;
|
|
328
327
|
const dirArg = args.positional[0] ?? '.';
|
|
329
328
|
const dir = resolve(dirArg);
|
|
329
|
+
const spec = await importPipelineSpec({ cwd: dir });
|
|
330
|
+
if (!spec)
|
|
331
|
+
return 1;
|
|
330
332
|
const json = args.flags.json === true || args.flags.json === 'true';
|
|
331
333
|
const emit = (report) => {
|
|
332
334
|
if (json) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ParsedArgs } from '../process/commands.js';
|
|
2
2
|
type DiscoveryCommand = 'list' | 'assets' | 'search' | 'describe' | 'schema' | 'sample' | 'query';
|
|
3
|
-
export declare const PIPELINE_DISCOVERY_USAGE = " seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repositories (default 50 per page), health and descriptions\n\n seq-studio pipeline assets -e <env> [--repo <namespace>/<name>] [--json]\n discover exact asset IDs from the latest declared specs; --repo filters\n both assets and the SDK export. Declarations may not be deployed yet.\n\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<name>]\n [--limit 1..100] [--offset N] [--json]\n search active asset/column names and descriptions without contacting Databricks\n Case-insensitive literal text (1..200 characters); default 20 assets per page.\n\n seq-studio pipeline
|
|
3
|
+
export declare const PIPELINE_DISCOVERY_USAGE = " seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repositories (default 50 per page), health and descriptions\n\n seq-studio pipeline assets -e <env> [--repo <namespace>/<name>] [--json]\n discover exact asset IDs from the latest declared specs; --repo filters\n both assets and the SDK export. Declarations may not be deployed yet.\n\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<name>]\n [--limit 1..100] [--offset N] [--json]\n search active asset/column names and descriptions without contacting Databricks\n Case-insensitive literal text (1..200 characters); default 20 assets per page.\n\n seq-studio pipeline show <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]\n read active deployed descriptions and declared columns without contacting Databricks\n Includes deployment/source provenance; physical schema is not verified.\n\n seq-studio pipeline schema <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]\n read observed columns, types and available descriptions from the active deployment\n\n seq-studio pipeline sample <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit 1..100] [--json]\n preview rows (default 25); output reports deployment and truncation\n\n seq-studio pipeline query <asset> --sql <sql> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit 1..1000] [--json]\n run read-only SQL against the virtual relation asset (default limit 1000)\n Example: --sql 'SELECT * FROM asset LIMIT 5'. Cross-asset joins are unsupported.\n\n Discovery requires staff access. Search, then describe a relevant asset; use\n schema to verify physical columns, then sample and query values before authoring.\n Metadata reflects active deployments, not unactivated edits. Descriptions do not prove keys\n or relationships. Use --json for the full response, including deployment context.\n -e selects the connection; --target selects its logical deployment target when needed.\n";
|
|
4
4
|
export declare function runPipelineDiscoveryCommand({ sub, args }: {
|
|
5
5
|
sub: DiscoveryCommand;
|
|
6
6
|
args: ParsedArgs;
|
|
@@ -17,7 +17,7 @@ export const PIPELINE_DISCOVERY_USAGE = ` seq-studio pipeline list -e <env> [--
|
|
|
17
17
|
search active asset/column names and descriptions without contacting Databricks
|
|
18
18
|
Case-insensitive literal text (1..200 characters); default 20 assets per page.
|
|
19
19
|
|
|
20
|
-
seq-studio pipeline
|
|
20
|
+
seq-studio pipeline show <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]
|
|
21
21
|
read active deployed descriptions and declared columns without contacting Databricks
|
|
22
22
|
Includes deployment/source provenance; physical schema is not verified.
|
|
23
23
|
|
|
@@ -230,7 +230,6 @@ export async function runPipelineDiscoveryCommand({ sub, args }) {
|
|
|
230
230
|
return 0;
|
|
231
231
|
}
|
|
232
232
|
catch (error) {
|
|
233
|
-
printCliError(error);
|
|
234
|
-
return 1;
|
|
233
|
+
return printCliError(error);
|
|
235
234
|
}
|
|
236
235
|
}
|