@solidactions/cli 3.20.1 → 3.22.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/README.md +12 -6
- package/dist/command-manifest.json +18 -7
- package/dist/commands/connection-list.js +2 -2
- package/dist/commands/crew-env-delete.js +2 -2
- package/dist/commands/crew-env-list.js +2 -2
- package/dist/commands/crew-env-push.js +5 -2
- package/dist/commands/crew-env-set.js +2 -2
- package/dist/commands/database-push.js +1 -1
- package/dist/commands/deploy.js +41 -12
- package/dist/commands/dev.js +4 -4
- package/dist/commands/doc-pull.js +531 -73
- package/dist/commands/doc-push.js +291 -28
- package/dist/commands/doc-upload.js +5 -2
- package/dist/commands/env-delete.js +12 -5
- package/dist/commands/env-list.js +19 -14
- package/dist/commands/env-map.js +7 -5
- package/dist/commands/env-pull.js +5 -6
- package/dist/commands/env-push.js +10 -6
- package/dist/commands/env-reset.js +12 -8
- package/dist/commands/env-set.js +15 -11
- package/dist/commands/init.js +4 -1
- package/dist/commands/login.js +15 -18
- package/dist/commands/oauth-action-list.js +2 -2
- package/dist/commands/oauth-action-platforms.js +2 -2
- package/dist/commands/oauth-action-search.js +2 -2
- package/dist/commands/oauth-action-view.js +2 -2
- package/dist/commands/project-create.js +1 -1
- package/dist/commands/project-list.js +2 -2
- package/dist/commands/project-logs.js +7 -3
- package/dist/commands/project-view.js +26 -9
- package/dist/commands/pull.js +4 -2
- package/dist/commands/run-list.js +27 -22
- package/dist/commands/run-start.js +22 -18
- package/dist/commands/run-view.js +10 -22
- package/dist/commands/schedule-delete.js +5 -10
- package/dist/commands/schedule-list.js +5 -10
- package/dist/commands/schedule-set.js +39 -44
- package/dist/commands/schedule-state.js +12 -16
- package/dist/commands/state.js +3 -3
- package/dist/commands/webhook-list.js +12 -4
- package/dist/commands/webhook-secret.js +12 -4
- package/dist/commands/workflow-view.js +3 -3
- package/dist/commands/workspaces.js +58 -3
- package/dist/index.js +13 -7
- package/dist/utils/api.js +69 -4
- package/dist/utils/config.js +96 -3
- package/dist/utils/crew.js +6 -1
- package/dist/utils/mcp.js +7 -3
- package/dist/utils/project-ref.js +91 -0
- package/dist/utils/run-status.js +61 -0
- package/dist/utils/secure-write.js +40 -5
- package/dist/utils/workspace-lookup.js +30 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -197,13 +197,15 @@ The CLI stores `host`, `apiKey`, and `workspaceId` in a JSON config file. Two lo
|
|
|
197
197
|
|
|
198
198
|
### Resolution order
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
Each field is looked up in this order, and the first layer that sets it wins:
|
|
201
201
|
|
|
202
202
|
1. Environment variables: `SOLIDACTIONS_HOST`, `SOLIDACTIONS_API_KEY`, `SOLIDACTIONS_WORKSPACE_ID`
|
|
203
203
|
2. Nearest local `./.solidactions/config.json` (walking up from cwd)
|
|
204
204
|
3. Global `~/.solidactions/config.json`
|
|
205
205
|
|
|
206
|
-
|
|
206
|
+
**An API key is only ever sent to the host configured with it.** If a layer above the one that supplies the key sets a *different* `host` (for example a local file with only `"host"`, or `SOLIDACTIONS_HOST` on its own), the CLI refuses instead of sending that key to the other host, and says which file or variable to change. A key from `SOLIDACTIONS_API_KEY` without `SOLIDACTIONS_HOST` goes only to the host in the global config (`~/.solidactions/config.json`), or to `https://app.solidactions.com` when no file names a host. It is never sent to a host that a project folder's `.solidactions/config.json` names (unless that is the same host as the global one), so a cloned repository cannot redirect an exported key; set `SOLIDACTIONS_HOST` as well to use another host. A layer may still set only the workspace (`workspace set --local`, or `SOLIDACTIONS_WORKSPACE_ID`) and use the credentials from the layer below.
|
|
207
|
+
|
|
208
|
+
Hosts are compared exactly, ignoring only surrounding space, trailing slashes and letter case: `https://example.com` and `https://example.com:443` count as different hosts and are refused rather than guessed at. Write the host the same way in every file.
|
|
207
209
|
|
|
208
210
|
### Workspace safety
|
|
209
211
|
|
|
@@ -497,8 +499,8 @@ Manage docs in SA-Docs (the app's built-in documentation vault). `push` is drift
|
|
|
497
499
|
|
|
498
500
|
| Command | Key Flags | Description |
|
|
499
501
|
|---------|-----------|-------------|
|
|
500
|
-
| `doc pull <folder> [dest]` | `-y`, `--overwrite`, `--json` | Download a Docs folder tree (markdown + media) to `dest` (defaults to `./<last-segment>/`);
|
|
501
|
-
| `doc push <
|
|
502
|
+
| `doc pull <folder> [dest]` | `-y`, `--overwrite`, `--json` | Download a Docs folder tree (markdown + media) to `dest` (defaults to `./<last-segment>/`); visual docs arrive as `<title>.html`, canvases as `<title>.canvas.json`, other docs as `<title>.md`. Writes a `.solidactions-docs.json` revision manifest (including a `body_sha256` content hash per file) used by `push`'s drift guard. Falls back to fetching a single doc if `folder` is a doc path, not a folder |
|
|
503
|
+
| `doc push <path>` | `--on-conflict`, `--type`, `--folder`, `--replace`, `--dry-run`, `--force`, `--json` | Upload a directory of docs (walked recursively) or one file: `<title>.md` becomes a markdown doc, `<title>.html` a visual doc, `<title>.canvas.json` or `<title>.canvas` a canvas. Each file must be at most 1 MiB. Manifest-tracked files (from a prior `pull`) are written with a `base_revision` guard and reported separately as written/drifted/unchanged; files whose content hash still matches the last pull are skipped as unchanged (no write, no revision bump). Tracked media files whose bytes changed are replaced the same way, under the same guard; a tracked media file missing locally is left alone — `push` never deletes. An untracked binary in the tree is warned about, never uploaded (use `doc upload`). `--force` skips the drift guard (unchanged files are still skipped). `--dry-run` previews without writing. Untracked files are created under the manifest's `folder_path` when `<dir>` came from a `doc pull` (pass `--folder` to override); docs the push creates are recorded in the directory's manifest (a directory push with no manifest starts one with the pushed folder), so pushing again updates them — unless `--folder` points outside the manifest's folder, in which case nothing is recorded and the push says so; an untracked file whose title already exists in the target folder is skipped per `--on-conflict` (default `skip`, reported as `duplicate_title`) |
|
|
502
504
|
| `doc upload <files...>` | `--folder`, `--title`, `--replace <doc-id-or-path>` | Upload one or more media files to SA-Docs (requires a token with the "docs" ability); `--title` only valid for a single file. `--replace` swaps the bytes behind an existing media doc instead of creating a new one — see below |
|
|
503
505
|
|
|
504
506
|
`doc upload <file> --replace <doc-id-or-path>` swaps the bytes behind an existing media doc, keeping its id, title, and folder, so embeds and references keep resolving — the old image stays in the doc's version history. Single file only; cannot be combined with `--title` or `--folder`. A purely numeric argument is a doc id; anything else is a docs path (`marketing/hero.png`), resolved against the doc's **title** — which `doc pull` may have sanitized, so for path-based work on a pulled folder prefer `doc push` instead:
|
|
@@ -508,7 +510,11 @@ solidactions doc upload logo-v2.png --replace 482
|
|
|
508
510
|
solidactions doc upload logo-v2.png --replace marketing/logo.png
|
|
509
511
|
```
|
|
510
512
|
|
|
511
|
-
|
|
513
|
+
`doc push <file> --replace <doc-id>` replaces the body of an existing doc by its numeric id. It first reads the doc and refuses unless the kinds match: an `.html` file replaces only a visual doc, a `.canvas.json` / `.canvas` file only a canvas, and a `.md` file any doc that is not visual, canvas or media. There is no drift guard (you named the doc). It takes one file and cannot be combined with `--folder`, `--type` or `--on-conflict`. Like `doc upload --replace`, it does not update a pulled directory's manifest.
|
|
514
|
+
|
|
515
|
+
**Visual docs and canvases round-trip through `doc pull` and `doc push`.** `doc pull` writes visual docs as `<title>.html` and canvases as `<title>.canvas.json`; every other non-media doc stays `<title>.md`. `doc push` records the docs it creates in the directory's manifest (when they land in the directory's tracked folder), so pushing the same directory again updates them by id instead of skipping them — a second push of an unchanged file sends nothing. When a pulled doc's local path changes (e.g. `page.md` becomes `page.html`), an unmodified old file is removed after the new one is written; if the old file was edited, the pull refuses before any write even with `--overwrite` — push the edited file first or move it aside and pull again. If the renamed doc's download fails, the pull refuses when another doc would take its old name or any filesystem alias of its old file, or when the old file holds unpublished edits (pull again once the download succeeds). Two planned writes involving a rename also refuse when their target names refer to the same file or physical path, including absent targets under aliased directories. A rename whose new name already holds an untracked local file (or one tracked without a recorded hash) refuses unless `--overwrite`; a file that already holds exactly the pulled bytes is simply adopted. These checks apply even when the old file is gone (or is no longer a regular file): there is then nothing to remove, and a failed download keeps the doc tracked under its old name. A symbolic link at a rename target also makes the pull refuse even with `--overwrite`. Filename allocation compares names case-insensitively, so `Page` and `page` receive distinct names (`Page.md` and `page-2.md`); an unchanged tracked doc keeps its exact filename, including a prior collision suffix. A legacy tracked pair differing only by case that already shares one file refuses before any write. Alias checks follow dangling links to their prospective targets.
|
|
516
|
+
|
|
517
|
+
**`doc pull` propagates deletions, within limits.** A file is removed locally only when its doc was deleted on the server *and* the file's bytes still match what the last pull gave it (the manifest's `body_sha256`) — anything you've edited locally is kept, with a warning that it's now untracked (re-create a markdown doc with `doc push`, a media doc with `doc upload`). Deletions only propagate when the destination's existing manifest `folder_path` matches the folder you're pulling (so pulling a different folder into a directory holding an old manifest deletes nothing), and never on the single-doc pull path; a single-doc pull (`doc pull <folder>/<doc>`) records the doc's folder as the manifest's `folder_path` and, in a directory that already tracks that folder, adds or updates just that one entry; when propagation is skipped for either reason, `pull` says so. Nothing outside the destination directory is removed: every candidate path is resolved physically (so a symlinked subdirectory cannot lead the delete outside), and a file the same pull just wrote is never deleted, even if a case-only rename makes it look orphaned on a case-insensitive filesystem.
|
|
512
518
|
|
|
513
519
|
**`doc pull --overwrite` is destructive.** If a manifest-tracked file still exists on the server *and* your local copy no longer matches the `body_sha256` recorded at the last pull (i.e. you've edited it and haven't pushed yet), a plain `doc pull` — even with `-y`/`--yes` — refuses with exit 1, naming every modified file, rather than silently discarding your edits. Nothing is written before that refusal. `-y`/`--yes` only bypasses the generic "destination is not empty" prompt; it does not cover locally-modified tracked files. Pass `--overwrite` to discard those local changes and re-pull server content anyway (it also implies `--yes`).
|
|
514
520
|
|
|
@@ -518,7 +524,7 @@ You do **not** need `--overwrite` to keep an edited file whose doc was deleted o
|
|
|
518
524
|
|
|
519
525
|
**`doc push` and deleted docs.** If a tracked file's doc was deleted on the server, `push` names it per file (`doc <id> no longer exists (deleted remotely) — re-pull to untrack it, then push to re-create`) and carries on with the other files. Note the deleted doc still holds its title until it leaves the trash, so re-creating it needs the trashed copy restored or purged first — `push` says so if you hit it. `push` exits 1 on drift (a tracked doc moved on since your pull) and on any per-file server error; a deleted doc alone is not an error.
|
|
520
526
|
|
|
521
|
-
**`doc pull` refuses to replace another folder's manifest.** If the destination already tracks a different folder, pulling into it would leave the previously tracked files untracked — and untracked files are not protected from being overwritten by a later pull. `pull` refuses (exit 1, before
|
|
527
|
+
**`doc pull` refuses to replace another folder's manifest.** If the destination already tracks a different folder, pulling into it would leave the previously tracked files untracked — and untracked files are not protected from being overwritten by a later pull. `pull` refuses (exit 1, before anything is written) and names both folders. Pull into a different directory, or pass `--overwrite` to replace the manifest anyway. This also covers the single-doc pull path, whose one-entry manifest would otherwise clobber a folder's.
|
|
522
528
|
|
|
523
529
|
### workspace
|
|
524
530
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"cli_name": "solidactions",
|
|
4
|
-
"cli_version": "3.
|
|
4
|
+
"cli_version": "3.22.0",
|
|
5
5
|
"global_options": [
|
|
6
6
|
{
|
|
7
7
|
"flags": "-V, --version",
|
|
@@ -5678,14 +5678,14 @@
|
|
|
5678
5678
|
],
|
|
5679
5679
|
"name": "push",
|
|
5680
5680
|
"aliases": [],
|
|
5681
|
-
"description": "
|
|
5681
|
+
"description": "Upload docs from local files into SA-Docs: .md as markdown, .html as a visual doc, .canvas.json / .canvas as a canvas",
|
|
5682
5682
|
"hidden": false,
|
|
5683
5683
|
"arguments": [
|
|
5684
5684
|
{
|
|
5685
|
-
"name": "
|
|
5685
|
+
"name": "path",
|
|
5686
5686
|
"required": true,
|
|
5687
5687
|
"variadic": false,
|
|
5688
|
-
"description": "
|
|
5688
|
+
"description": "A directory of .md / .html / .canvas.json / .canvas files (walked recursively), or one such file"
|
|
5689
5689
|
}
|
|
5690
5690
|
],
|
|
5691
5691
|
"options": [
|
|
@@ -5699,14 +5699,13 @@
|
|
|
5699
5699
|
"value_optional": false,
|
|
5700
5700
|
"variadic": false,
|
|
5701
5701
|
"negated": false,
|
|
5702
|
-
"hidden": false
|
|
5703
|
-
"default": "skip"
|
|
5702
|
+
"hidden": false
|
|
5704
5703
|
},
|
|
5705
5704
|
{
|
|
5706
5705
|
"flags": "--type <slug>",
|
|
5707
5706
|
"long": "--type",
|
|
5708
5707
|
"short": null,
|
|
5709
|
-
"description": "Doc-type slug to apply to all uploaded docs",
|
|
5708
|
+
"description": "Doc-type slug to apply to all uploaded docs (.html and canvas files keep visual / canvas)",
|
|
5710
5709
|
"required": false,
|
|
5711
5710
|
"value_required": true,
|
|
5712
5711
|
"value_optional": false,
|
|
@@ -5726,6 +5725,18 @@
|
|
|
5726
5725
|
"negated": false,
|
|
5727
5726
|
"hidden": false
|
|
5728
5727
|
},
|
|
5728
|
+
{
|
|
5729
|
+
"flags": "--replace <doc-id>",
|
|
5730
|
+
"long": "--replace",
|
|
5731
|
+
"short": null,
|
|
5732
|
+
"description": "Replace the body of an existing doc (numeric id) with a single file of the same kind",
|
|
5733
|
+
"required": false,
|
|
5734
|
+
"value_required": true,
|
|
5735
|
+
"value_optional": false,
|
|
5736
|
+
"variadic": false,
|
|
5737
|
+
"negated": false,
|
|
5738
|
+
"hidden": false
|
|
5739
|
+
},
|
|
5729
5740
|
{
|
|
5730
5741
|
"flags": "--dry-run",
|
|
5731
5742
|
"long": "--dry-run",
|
|
@@ -48,10 +48,10 @@ async function connectionList() {
|
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
50
|
if (error.response?.status === 401) {
|
|
51
|
-
console.error(chalk_1.default.red(
|
|
51
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
52
52
|
}
|
|
53
53
|
else if (error.response) {
|
|
54
|
-
console.error(chalk_1.default.red(
|
|
54
|
+
console.error(chalk_1.default.red((0, api_1.formatApiFailure)(error.response.status, error.response.data)));
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
57
|
console.error(chalk_1.default.red('Connection failed:'), error.message);
|
|
@@ -33,13 +33,13 @@ async function crewEnvDelete(crewArg, key, options = {}) {
|
|
|
33
33
|
catch (error) {
|
|
34
34
|
if (error.response) {
|
|
35
35
|
if (error.response.status === 401) {
|
|
36
|
-
console.error(chalk_1.default.red(
|
|
36
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
37
37
|
}
|
|
38
38
|
else if (error.response.status === 404) {
|
|
39
39
|
console.error(chalk_1.default.red(error.response.data?.message || `Variable "${key}" not found for crew "${crew.name}".`));
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
console.error(chalk_1.default.red(
|
|
42
|
+
console.error(chalk_1.default.red((0, api_1.formatApiFailure)(error.response.status, error.response.data)));
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
@@ -73,13 +73,13 @@ async function crewEnvList(crewArg, options = {}) {
|
|
|
73
73
|
catch (error) {
|
|
74
74
|
if (error.response) {
|
|
75
75
|
if (error.response.status === 401) {
|
|
76
|
-
console.error(chalk_1.default.red(
|
|
76
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
77
77
|
}
|
|
78
78
|
else if (error.response.status === 404) {
|
|
79
79
|
console.error(chalk_1.default.red(error.response.data?.message || `Crew "${crewArg}" not found.`));
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
console.error(chalk_1.default.red(
|
|
82
|
+
console.error(chalk_1.default.red((0, api_1.formatApiFailure)(error.response.status, error.response.data)));
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
@@ -72,7 +72,7 @@ async function crewEnvPush(crewArg, filePath = '.env', options = {}) {
|
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
74
|
if (error.response?.status === 401) {
|
|
75
|
-
console.error(chalk_1.default.red(
|
|
75
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
76
76
|
}
|
|
77
77
|
else if (error.response?.status === 404) {
|
|
78
78
|
console.error(chalk_1.default.red(error.response.data?.message || `Crew "${crewArg}" not found.`));
|
|
@@ -148,7 +148,10 @@ async function crewEnvPush(crewArg, filePath = '.env', options = {}) {
|
|
|
148
148
|
await axios_1.default.put(`${config.host}/api/v1/crews/${crew.id}/variables/${entry.key}`, entry.body, { headers: (0, api_1.getApiHeaders)(config, 'application/json') });
|
|
149
149
|
}
|
|
150
150
|
catch (error) {
|
|
151
|
-
if (error.response?.status ===
|
|
151
|
+
if (error.response?.status === 401) {
|
|
152
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
153
|
+
}
|
|
154
|
+
else if (error.response?.status === 422) {
|
|
152
155
|
console.error(chalk_1.default.red(`Failed to push "${entry.key}":`), (0, api_1.formatValidationError)(error.response.data));
|
|
153
156
|
}
|
|
154
157
|
else {
|
|
@@ -58,7 +58,7 @@ async function crewEnvSet(crewArg, key, value, options = {}) {
|
|
|
58
58
|
catch (error) {
|
|
59
59
|
if (error.response) {
|
|
60
60
|
if (error.response.status === 401) {
|
|
61
|
-
console.error(chalk_1.default.red(
|
|
61
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
62
62
|
}
|
|
63
63
|
else if (error.response.status === 404) {
|
|
64
64
|
console.error(chalk_1.default.red(error.response.data?.message || `Crew "${crewArg}" not found.`));
|
|
@@ -67,7 +67,7 @@ async function crewEnvSet(crewArg, key, value, options = {}) {
|
|
|
67
67
|
console.error(chalk_1.default.red((0, api_1.formatValidationError)(error.response.data)));
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
|
-
console.error(chalk_1.default.red(
|
|
70
|
+
console.error(chalk_1.default.red((0, api_1.formatApiFailure)(error.response.status, error.response.data)));
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
@@ -281,7 +281,7 @@ async function databasePushWithConfig(name, file, options, config, dependencies
|
|
|
281
281
|
return value;
|
|
282
282
|
};
|
|
283
283
|
const controlRemaining = () => Math.min(database_data_plane_1.DEFAULT_DATABASE_CONTROL_PLANE_TIMEOUT_MS, remaining());
|
|
284
|
-
stdout(`WARNING: This destructively replaces database "${name}". Quiesce all writers; old URLs and credentials will become invalid. A private snapshot is normalized to WAL, 4096-byte pages, and auto-vacuum NONE; the source file is unchanged.`);
|
|
284
|
+
stdout(`WARNING: This destructively replaces database "${name}" in workspace ${config.workspaceId ?? '(none)'} on ${config.host}. Quiesce all writers; old URLs and credentials will become invalid. A private snapshot is normalized to WAL, 4096-byte pages, and auto-vacuum NONE; the source file is unchanged.`);
|
|
285
285
|
stdout(`Hard deadline: ${Math.ceil(deadlineMs / 60_000)} minutes for ${normalized.inputBytes} bytes. Idempotency key: ${key}`);
|
|
286
286
|
const prepareBody = {
|
|
287
287
|
operation: 'bulk_load_prepare', name, bulk_mode: 'replace', input_bytes: normalized.inputBytes,
|
package/dist/commands/deploy.js
CHANGED
|
@@ -29,6 +29,7 @@ const env_1 = require("../utils/env");
|
|
|
29
29
|
const api_1 = require("../utils/api");
|
|
30
30
|
const deploy_ignore_1 = require("../utils/deploy-ignore");
|
|
31
31
|
const slug_1 = require("../utils/slug");
|
|
32
|
+
const project_ref_1 = require("../utils/project-ref");
|
|
32
33
|
const skills_1 = require("../utils/skills");
|
|
33
34
|
const tar_archive_1 = require("../utils/tar-archive");
|
|
34
35
|
const source_provenance_1 = require("../utils/source-provenance");
|
|
@@ -372,7 +373,12 @@ async function handlePlanLimitReached(config, projectName, error, productionExis
|
|
|
372
373
|
return await createEnvironmentProject(config, projectName, 'production');
|
|
373
374
|
}
|
|
374
375
|
catch (prodError) {
|
|
375
|
-
|
|
376
|
+
if (prodError.response?.status === 401) {
|
|
377
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
console.error(chalk_1.default.red('Failed to create project:'), prodError.response?.data?.message || prodError.message);
|
|
381
|
+
}
|
|
376
382
|
process.exit(1);
|
|
377
383
|
}
|
|
378
384
|
}
|
|
@@ -413,9 +419,7 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
413
419
|
let productionExists = null; // null = unknown (error path)
|
|
414
420
|
let productionSlug = null;
|
|
415
421
|
try {
|
|
416
|
-
const prodResponse = await
|
|
417
|
-
headers: (0, api_1.getApiHeaders)(config),
|
|
418
|
-
});
|
|
422
|
+
const prodResponse = await (0, project_ref_1.getProjectBySlugOrCanonical)(config, projectName, (0, slug_1.slugifyName)(projectName) === '' ? '' : (0, slug_1.buildProjectSlug)(projectName, 'production'));
|
|
419
423
|
productionExists = true;
|
|
420
424
|
productionSlug = prodResponse.data.slug || prodResponse.data.name;
|
|
421
425
|
}
|
|
@@ -425,8 +429,14 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
425
429
|
// Project doesn't exist yet — this is the normal first-deploy path.
|
|
426
430
|
// Do NOT print a warning here; the deploy proceeds to create/deploy successfully.
|
|
427
431
|
}
|
|
432
|
+
else if (error.response?.status === 401) {
|
|
433
|
+
// The key is rejected before the deploy even starts: name the host
|
|
434
|
+
// that refused it like every other command's 401.
|
|
435
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
436
|
+
process.exit(1);
|
|
437
|
+
}
|
|
428
438
|
else {
|
|
429
|
-
// 5xx, network error,
|
|
439
|
+
// 5xx, network error, etc. — fail conservatively rather
|
|
430
440
|
// than treating the project as non-existent and potentially creating it.
|
|
431
441
|
console.error(chalk_1.default.red('Failed to check project existence:'), error.response?.data?.message || error.message);
|
|
432
442
|
process.exit(1);
|
|
@@ -492,9 +502,7 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
492
502
|
const lookupSlug = environment === 'production'
|
|
493
503
|
? projectName
|
|
494
504
|
: `${projectName}-${environment}`;
|
|
495
|
-
const checkResponse = await
|
|
496
|
-
headers: (0, api_1.getApiHeaders)(config),
|
|
497
|
-
});
|
|
505
|
+
const checkResponse = await (0, project_ref_1.getProjectBySlugOrCanonical)(config, lookupSlug, (0, slug_1.slugifyName)(projectName) === '' ? '' : (0, slug_1.buildProjectSlug)(projectName, environment));
|
|
498
506
|
projectSlug = checkResponse.data.slug || checkResponse.data.name;
|
|
499
507
|
}
|
|
500
508
|
}
|
|
@@ -527,12 +535,20 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
527
535
|
envLabel = '';
|
|
528
536
|
console.log(chalk_1.default.blue(`Deploying to project "${projectName}" (production) instead.`));
|
|
529
537
|
}
|
|
538
|
+
else if (createError.response?.status === 401) {
|
|
539
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
540
|
+
process.exit(1);
|
|
541
|
+
}
|
|
530
542
|
else {
|
|
531
543
|
console.error(chalk_1.default.red('Failed to create project:'), createError.response?.data?.message || createError.message);
|
|
532
544
|
process.exit(1);
|
|
533
545
|
}
|
|
534
546
|
}
|
|
535
547
|
}
|
|
548
|
+
else if (error.response?.status === 401) {
|
|
549
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
550
|
+
process.exit(1);
|
|
551
|
+
}
|
|
536
552
|
else {
|
|
537
553
|
console.error(chalk_1.default.red('Failed to check project:'), error.response?.data?.message || error.message);
|
|
538
554
|
process.exit(1);
|
|
@@ -548,7 +564,12 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
548
564
|
await pushYamlDeclarations(config, projectSlug, yamlConfig);
|
|
549
565
|
}
|
|
550
566
|
catch (error) {
|
|
551
|
-
|
|
567
|
+
if (error.response?.status === 401) {
|
|
568
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
console.error(chalk_1.default.red(`Config sync FAILED: ${error.response?.data?.message || error.message}`));
|
|
572
|
+
}
|
|
552
573
|
process.exit(1);
|
|
553
574
|
}
|
|
554
575
|
console.log(chalk_1.default.green(`✓ Config synced for ${projectSlug}${envLabel}`));
|
|
@@ -670,7 +691,12 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
670
691
|
await pushYamlDeclarations(config, projectSlug, yamlConfig);
|
|
671
692
|
}
|
|
672
693
|
catch (error) {
|
|
673
|
-
|
|
694
|
+
if (error.response?.status === 401) {
|
|
695
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
698
|
+
console.error(chalk_1.default.red(`Config sync FAILED: ${error.response?.data?.message || error.message}`));
|
|
699
|
+
}
|
|
674
700
|
cleanupArchive();
|
|
675
701
|
process.exit(1);
|
|
676
702
|
}
|
|
@@ -678,7 +704,7 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
678
704
|
if (yamlConfig && shouldPrintWebhookSecretNotice(yamlConfig.workflows ?? [])) {
|
|
679
705
|
const envFlag = environment !== 'dev' ? ` -e ${environment}` : '';
|
|
680
706
|
console.log('');
|
|
681
|
-
console.log(chalk_1.default.blue(`ℹ Webhook secret: run \`solidactions webhook secret ${projectName}${envFlag}\` to retrieve the generated secret.`));
|
|
707
|
+
console.log(chalk_1.default.blue(`ℹ Webhook secret: run \`solidactions webhook secret ${(0, slug_1.slugifyName)(projectName) || projectName}${envFlag}\` to retrieve the generated secret.`));
|
|
682
708
|
console.log(chalk_1.default.gray(` Set the same value in your sender (e.g. Telegram setWebhook secret_token).`));
|
|
683
709
|
}
|
|
684
710
|
if (options.paused) {
|
|
@@ -723,8 +749,11 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
723
749
|
if (error.response.status === 404) {
|
|
724
750
|
console.error("Project not found.");
|
|
725
751
|
}
|
|
752
|
+
else if (error.response.status === 401) {
|
|
753
|
+
console.error(chalk_1.default.red((0, api_1.authFailedLine)(config.host)));
|
|
754
|
+
}
|
|
726
755
|
else {
|
|
727
|
-
console.error(error.response.status,
|
|
756
|
+
console.error(chalk_1.default.red((0, api_1.formatApiFailure)(error.response.status, error.response.data)));
|
|
728
757
|
}
|
|
729
758
|
}
|
|
730
759
|
else {
|
package/dist/commands/dev.js
CHANGED
|
@@ -200,12 +200,12 @@ function assertLocalConfigParses(configPath) {
|
|
|
200
200
|
* anchored to the entry's project and there is nothing to mismatch.
|
|
201
201
|
*
|
|
202
202
|
* `SOLIDACTIONS_HOST` / `SOLIDACTIONS_API_KEY` env overrides bypass the guard
|
|
203
|
-
* ONLY when BOTH are set.
|
|
204
|
-
* (env > local > global), so with just one var set the OTHER field still falls
|
|
203
|
+
* ONLY when BOTH are set. With just one var set the OTHER field still falls
|
|
205
204
|
* through to the global config — i.e. a partial override would send a run to
|
|
206
205
|
* the production host, or to production credentials, exactly the way #30
|
|
207
|
-
* describes
|
|
208
|
-
*
|
|
206
|
+
* describes — and a partial env override now also meets the cli#124
|
|
207
|
+
* credential-pair refusal. A partial override therefore refuses like any other
|
|
208
|
+
* unanchored run, naming the field that would fall through.
|
|
209
209
|
*/
|
|
210
210
|
function assertProjectLocalConfig(entryPath, env) {
|
|
211
211
|
const envHost = !!process.env.SOLIDACTIONS_HOST;
|