@detergent-software/atk 8.9.0 → 8.9.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +312 -0
- package/README.md +22 -12
- package/build/cli.js +18 -6
- package/build/cli.js.map +1 -1
- package/build/command-manifest.json +1507 -0
- package/build/commands/_app.d.ts.map +1 -1
- package/build/commands/_app.js +8 -4
- package/build/commands/_app.js.map +1 -1
- package/build/commands/audit.d.ts.map +1 -1
- package/build/commands/audit.js +1 -1
- package/build/commands/audit.js.map +1 -1
- package/build/commands/browse.js +2 -2
- package/build/commands/browse.js.map +1 -1
- package/build/commands/cache.d.ts +1 -1
- package/build/commands/cache.d.ts.map +1 -1
- package/build/commands/cache.js +1 -16
- package/build/commands/cache.js.map +1 -1
- package/build/commands/config.d.ts.map +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/config.js.map +1 -1
- package/build/commands/diff.d.ts.map +1 -1
- package/build/commands/diff.js +4 -0
- package/build/commands/diff.js.map +1 -1
- package/build/commands/drift.d.ts.map +1 -1
- package/build/commands/drift.js +4 -0
- package/build/commands/drift.js.map +1 -1
- package/build/commands/index.d.ts.map +1 -1
- package/build/commands/index.js +5 -40
- package/build/commands/index.js.map +1 -1
- package/build/commands/info.d.ts.map +1 -1
- package/build/commands/info.js +50 -33
- package/build/commands/info.js.map +1 -1
- package/build/commands/init.d.ts.map +1 -1
- package/build/commands/init.js +4 -2
- package/build/commands/init.js.map +1 -1
- package/build/commands/install.d.ts.map +1 -1
- package/build/commands/install.js +28 -7
- package/build/commands/install.js.map +1 -1
- package/build/commands/list.js +2 -2
- package/build/commands/list.js.map +1 -1
- package/build/commands/login.d.ts.map +1 -1
- package/build/commands/login.js +12 -2
- package/build/commands/login.js.map +1 -1
- package/build/commands/logout.d.ts.map +1 -1
- package/build/commands/logout.js +9 -1
- package/build/commands/logout.js.map +1 -1
- package/build/commands/outdated.js +1 -1
- package/build/commands/outdated.js.map +1 -1
- package/build/commands/prune.d.ts.map +1 -1
- package/build/commands/prune.js +4 -2
- package/build/commands/prune.js.map +1 -1
- package/build/commands/publish.d.ts +1 -1
- package/build/commands/publish.d.ts.map +1 -1
- package/build/commands/publish.js +33 -37
- package/build/commands/publish.js.map +1 -1
- package/build/commands/release-notes.d.ts.map +1 -1
- package/build/commands/release-notes.js +4 -0
- package/build/commands/release-notes.js.map +1 -1
- package/build/commands/schema.d.ts +3 -3
- package/build/commands/search.js +1 -1
- package/build/commands/search.js.map +1 -1
- package/build/commands/sync.d.ts +1 -1
- package/build/commands/sync.d.ts.map +1 -1
- package/build/commands/sync.js +27 -12
- package/build/commands/sync.js.map +1 -1
- package/build/commands/update.d.ts.map +1 -1
- package/build/commands/update.js +58 -9
- package/build/commands/update.js.map +1 -1
- package/build/commands/whoami.d.ts.map +1 -1
- package/build/commands/whoami.js +16 -4
- package/build/commands/whoami.js.map +1 -1
- package/build/commands/why.js +3 -4
- package/build/commands/why.js.map +1 -1
- package/build/components/Header.d.ts +2 -3
- package/build/components/Header.d.ts.map +1 -1
- package/build/components/Header.js +2 -9
- package/build/components/Header.js.map +1 -1
- package/build/components/LocalEditsHint.d.ts +16 -0
- package/build/components/LocalEditsHint.d.ts.map +1 -0
- package/build/components/LocalEditsHint.js +18 -0
- package/build/components/LocalEditsHint.js.map +1 -0
- package/build/components/SyncAllInSync.d.ts +5 -1
- package/build/components/SyncAllInSync.d.ts.map +1 -1
- package/build/components/SyncAllInSync.js +2 -2
- package/build/components/SyncAllInSync.js.map +1 -1
- package/build/components/header-art.d.ts +7 -0
- package/build/components/header-art.d.ts.map +1 -0
- package/build/components/header-art.js +14 -0
- package/build/components/header-art.js.map +1 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/hooks/useListActions.d.ts.map +1 -1
- package/build/hooks/useListActions.js +4 -0
- package/build/hooks/useListActions.js.map +1 -1
- package/build/hooks/usePruneState.d.ts +1 -7
- package/build/hooks/usePruneState.d.ts.map +1 -1
- package/build/hooks/usePruneState.js +18 -62
- package/build/hooks/usePruneState.js.map +1 -1
- package/build/hooks/usePublishState.d.ts +38 -207
- package/build/hooks/usePublishState.d.ts.map +1 -1
- package/build/hooks/usePublishState.js +83 -1501
- package/build/hooks/usePublishState.js.map +1 -1
- package/build/lib/adapter.d.ts +10 -1
- package/build/lib/adapter.d.ts.map +1 -1
- package/build/lib/adapter.js +46 -3
- package/build/lib/adapter.js.map +1 -1
- package/build/lib/api-client.d.ts +9 -5
- package/build/lib/api-client.d.ts.map +1 -1
- package/build/lib/api-client.js +35 -8
- package/build/lib/api-client.js.map +1 -1
- package/build/lib/atk-api/errors.d.ts +5 -2
- package/build/lib/atk-api/errors.d.ts.map +1 -1
- package/build/lib/atk-api/errors.js +1 -0
- package/build/lib/atk-api/errors.js.map +1 -1
- package/build/lib/atk-api/generated/types.gen.d.ts +12 -12
- package/build/lib/atk-api/index.d.ts +2 -2
- package/build/lib/atk-api/index.d.ts.map +1 -1
- package/build/lib/atk-api/index.js +1 -1
- package/build/lib/atk-api/index.js.map +1 -1
- package/build/lib/atk-api/web-routes.d.ts +25 -6
- package/build/lib/atk-api/web-routes.d.ts.map +1 -1
- package/build/lib/atk-api/web-routes.js +27 -8
- package/build/lib/atk-api/web-routes.js.map +1 -1
- package/build/lib/auth.d.ts +12 -2
- package/build/lib/auth.d.ts.map +1 -1
- package/build/lib/auth.js +38 -3
- package/build/lib/auth.js.map +1 -1
- package/build/lib/checksum.d.ts +40 -14
- package/build/lib/checksum.d.ts.map +1 -1
- package/build/lib/checksum.js +110 -57
- package/build/lib/checksum.js.map +1 -1
- package/build/lib/config.d.ts +4 -4
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/config.js +31 -8
- package/build/lib/config.js.map +1 -1
- package/build/lib/diagnostics.d.ts.map +1 -1
- package/build/lib/diagnostics.js +10 -7
- package/build/lib/diagnostics.js.map +1 -1
- package/build/lib/diff-command.js +1 -1
- package/build/lib/diff-command.js.map +1 -1
- package/build/lib/errors.d.ts +4 -1
- package/build/lib/errors.d.ts.map +1 -1
- package/build/lib/errors.js.map +1 -1
- package/build/lib/format-age.d.ts +3 -0
- package/build/lib/format-age.d.ts.map +1 -0
- package/build/lib/format-age.js +18 -0
- package/build/lib/format-age.js.map +1 -0
- package/build/lib/installer.d.ts +8 -11
- package/build/lib/installer.d.ts.map +1 -1
- package/build/lib/installer.js +83 -28
- package/build/lib/installer.js.map +1 -1
- package/build/lib/local-edits.d.ts +72 -0
- package/build/lib/local-edits.d.ts.map +1 -0
- package/build/lib/local-edits.js +145 -0
- package/build/lib/local-edits.js.map +1 -0
- package/build/lib/lockfile.d.ts +12 -8
- package/build/lib/lockfile.d.ts.map +1 -1
- package/build/lib/lockfile.js +209 -59
- package/build/lib/lockfile.js.map +1 -1
- package/build/lib/mover.d.ts.map +1 -1
- package/build/lib/mover.js +11 -12
- package/build/lib/mover.js.map +1 -1
- package/build/lib/multi-tool-install.d.ts +4 -2
- package/build/lib/multi-tool-install.d.ts.map +1 -1
- package/build/lib/multi-tool-install.js +12 -2
- package/build/lib/multi-tool-install.js.map +1 -1
- package/build/lib/offline.d.ts +19 -0
- package/build/lib/offline.d.ts.map +1 -0
- package/build/lib/offline.js +26 -0
- package/build/lib/offline.js.map +1 -0
- package/build/lib/owned-paths.d.ts +7 -4
- package/build/lib/owned-paths.d.ts.map +1 -1
- package/build/lib/owned-paths.js +23 -8
- package/build/lib/owned-paths.js.map +1 -1
- package/build/lib/parse-json.d.ts +12 -0
- package/build/lib/parse-json.d.ts.map +1 -1
- package/build/lib/parse-json.js +15 -2
- package/build/lib/parse-json.js.map +1 -1
- package/build/lib/pastel/commander-specs.d.ts +7 -0
- package/build/lib/pastel/commander-specs.d.ts.map +1 -0
- package/build/lib/pastel/commander-specs.js +50 -0
- package/build/lib/pastel/commander-specs.js.map +1 -0
- package/build/lib/pastel/generate-arguments.d.ts +3 -3
- package/build/lib/pastel/generate-arguments.d.ts.map +1 -1
- package/build/lib/pastel/generate-arguments.js +25 -22
- package/build/lib/pastel/generate-arguments.js.map +1 -1
- package/build/lib/pastel/generate-command.d.ts +7 -5
- package/build/lib/pastel/generate-command.d.ts.map +1 -1
- package/build/lib/pastel/generate-command.js +32 -67
- package/build/lib/pastel/generate-command.js.map +1 -1
- package/build/lib/pastel/generate-commands.d.ts +3 -5
- package/build/lib/pastel/generate-commands.d.ts.map +1 -1
- package/build/lib/pastel/generate-commands.js +6 -10
- package/build/lib/pastel/generate-commands.js.map +1 -1
- package/build/lib/pastel/generate-options.d.ts +3 -3
- package/build/lib/pastel/generate-options.d.ts.map +1 -1
- package/build/lib/pastel/generate-options.js +16 -13
- package/build/lib/pastel/generate-options.js.map +1 -1
- package/build/lib/pastel/index.d.ts +26 -4
- package/build/lib/pastel/index.d.ts.map +1 -1
- package/build/lib/pastel/index.js +104 -18
- package/build/lib/pastel/index.js.map +1 -1
- package/build/lib/pastel/internal-types.d.ts +39 -8
- package/build/lib/pastel/internal-types.d.ts.map +1 -1
- package/build/lib/pastel/manifest.d.ts +8 -0
- package/build/lib/pastel/manifest.d.ts.map +1 -0
- package/build/lib/pastel/manifest.js +7 -0
- package/build/lib/pastel/manifest.js.map +1 -0
- package/build/lib/pastel/read-commands.d.ts +7 -2
- package/build/lib/pastel/read-commands.d.ts.map +1 -1
- package/build/lib/pastel/read-commands.js +51 -30
- package/build/lib/pastel/read-commands.js.map +1 -1
- package/build/lib/pastel/render-command.d.ts +13 -0
- package/build/lib/pastel/render-command.d.ts.map +1 -0
- package/build/lib/pastel/render-command.js +56 -0
- package/build/lib/pastel/render-command.js.map +1 -0
- package/build/lib/process-alive.d.ts +11 -0
- package/build/lib/process-alive.d.ts.map +1 -0
- package/build/lib/process-alive.js +22 -0
- package/build/lib/process-alive.js.map +1 -0
- package/build/lib/pruner.d.ts +26 -0
- package/build/lib/pruner.d.ts.map +1 -0
- package/build/lib/pruner.js +42 -0
- package/build/lib/pruner.js.map +1 -0
- package/build/lib/publish-flow.d.ts +224 -0
- package/build/lib/publish-flow.d.ts.map +1 -0
- package/build/lib/publish-flow.js +1258 -0
- package/build/lib/publish-flow.js.map +1 -0
- package/build/lib/publish-run.d.ts +55 -0
- package/build/lib/publish-run.d.ts.map +1 -0
- package/build/lib/publish-run.js +169 -0
- package/build/lib/publish-run.js.map +1 -0
- package/build/lib/publisher.d.ts +25 -17
- package/build/lib/publisher.d.ts.map +1 -1
- package/build/lib/publisher.js +54 -53
- package/build/lib/publisher.js.map +1 -1
- package/build/lib/registrar.d.ts.map +1 -1
- package/build/lib/registrar.js +2 -2
- package/build/lib/registrar.js.map +1 -1
- package/build/lib/registry.d.ts +18 -7
- package/build/lib/registry.d.ts.map +1 -1
- package/build/lib/registry.js +113 -32
- package/build/lib/registry.js.map +1 -1
- package/build/lib/root-path.d.ts +11 -0
- package/build/lib/root-path.d.ts.map +1 -1
- package/build/lib/root-path.js +15 -1
- package/build/lib/root-path.js.map +1 -1
- package/build/lib/schemas/config.d.ts +3 -1
- package/build/lib/schemas/config.d.ts.map +1 -1
- package/build/lib/schemas/config.js +1 -1
- package/build/lib/schemas/config.js.map +1 -1
- package/build/lib/schemas/lockfile.d.ts +156 -23
- package/build/lib/schemas/lockfile.d.ts.map +1 -1
- package/build/lib/schemas/lockfile.js +100 -79
- package/build/lib/schemas/lockfile.js.map +1 -1
- package/build/lib/setup.d.ts.map +1 -1
- package/build/lib/setup.js +53 -48
- package/build/lib/setup.js.map +1 -1
- package/build/lib/staging.d.ts +15 -0
- package/build/lib/staging.d.ts.map +1 -0
- package/build/lib/staging.js +33 -0
- package/build/lib/staging.js.map +1 -0
- package/build/lib/sync.d.ts +22 -6
- package/build/lib/sync.d.ts.map +1 -1
- package/build/lib/sync.js +59 -7
- package/build/lib/sync.js.map +1 -1
- package/build/lib/uninstaller.d.ts.map +1 -1
- package/build/lib/uninstaller.js +8 -5
- package/build/lib/uninstaller.js.map +1 -1
- package/build/lib/update-check.d.ts +4 -0
- package/build/lib/update-check.d.ts.map +1 -1
- package/build/lib/update-check.js +55 -56
- package/build/lib/update-check.js.map +1 -1
- package/build/lib/updater.d.ts +31 -1
- package/build/lib/updater.d.ts.map +1 -1
- package/build/lib/updater.js +143 -4
- package/build/lib/updater.js.map +1 -1
- package/build/lib/usage-error.d.ts +20 -0
- package/build/lib/usage-error.d.ts.map +1 -0
- package/build/lib/usage-error.js +41 -0
- package/build/lib/usage-error.js.map +1 -0
- package/build/lib/user-setup.d.ts.map +1 -1
- package/build/lib/user-setup.js +62 -59
- package/build/lib/user-setup.js.map +1 -1
- package/build/lib/write-file.d.ts +5 -0
- package/build/lib/write-file.d.ts.map +1 -1
- package/build/lib/write-file.js +68 -13
- package/build/lib/write-file.js.map +1 -1
- package/package.json +81 -81
|
@@ -157,7 +157,7 @@ export type DeprecateRequest = {
|
|
|
157
157
|
*/
|
|
158
158
|
undo?: boolean;
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
160
|
+
* Point the branch at the new commit if it already exists (the CLI's retry behaviour); 409 `branch_exists` when someone else moved it during the request. Default false → 409 `branch_exists`. A branch with an open pull request is never replaced: 409 `pr_open`, either way.
|
|
161
161
|
*/
|
|
162
162
|
replaceExistingBranch?: boolean;
|
|
163
163
|
/**
|
|
@@ -378,7 +378,7 @@ export type PromoteRequest = {
|
|
|
378
378
|
*/
|
|
379
379
|
kind?: 'asset' | 'bundle';
|
|
380
380
|
/**
|
|
381
|
-
*
|
|
381
|
+
* Point the branch at the new commit if it already exists (the CLI's retry behaviour); 409 `branch_exists` when someone else moved it during the request. Default false → 409 `branch_exists`. A branch with an open pull request is never replaced: 409 `pr_open`, either way.
|
|
382
382
|
*/
|
|
383
383
|
replaceExistingBranch?: boolean;
|
|
384
384
|
/**
|
|
@@ -588,7 +588,7 @@ export type PublishRequest = {
|
|
|
588
588
|
*/
|
|
589
589
|
reviewers?: Array<string> | null;
|
|
590
590
|
/**
|
|
591
|
-
*
|
|
591
|
+
* Point the publish branch at the new commit if it already exists (the CLI's retry behaviour); 409 `branch_exists` when someone else moved it during the request. Default false → 409 `branch_exists`. A branch with an open pull request is never replaced: 409 `pr_open`, either way.
|
|
592
592
|
*/
|
|
593
593
|
replaceExistingBranch?: boolean;
|
|
594
594
|
/**
|
|
@@ -749,7 +749,7 @@ export type UnpublishRequest = {
|
|
|
749
749
|
*/
|
|
750
750
|
version?: string | null;
|
|
751
751
|
/**
|
|
752
|
-
*
|
|
752
|
+
* Point the branch at the new commit if it already exists (the CLI's retry behaviour); 409 `branch_exists` when someone else moved it during the request. Default false → 409 `branch_exists`. A branch with an open pull request is never replaced: 409 `pr_open`, either way.
|
|
753
753
|
*/
|
|
754
754
|
replaceExistingBranch?: boolean;
|
|
755
755
|
/**
|
|
@@ -1446,7 +1446,7 @@ export type PublishPlanErrors = {
|
|
|
1446
1446
|
*/
|
|
1447
1447
|
403: ApiError;
|
|
1448
1448
|
/**
|
|
1449
|
-
* `version_not_bumped`, `version_exists`, or `
|
|
1449
|
+
* `version_not_bumped`, `version_exists`, `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL); with `dependencies`, a detail per asset, with `entry` for entries
|
|
1450
1450
|
*/
|
|
1451
1451
|
409: ApiError;
|
|
1452
1452
|
/**
|
|
@@ -1494,7 +1494,7 @@ export type PublishErrors = {
|
|
|
1494
1494
|
*/
|
|
1495
1495
|
403: ApiError;
|
|
1496
1496
|
/**
|
|
1497
|
-
* `version_not_bumped`, `version_exists`, or `
|
|
1497
|
+
* `version_not_bumped`, `version_exists`, `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL); with `dependencies`, a detail per asset, with `entry` for entries
|
|
1498
1498
|
*/
|
|
1499
1499
|
409: ApiError;
|
|
1500
1500
|
/**
|
|
@@ -1546,7 +1546,7 @@ export type UnpublishPlanErrors = {
|
|
|
1546
1546
|
*/
|
|
1547
1547
|
404: ApiError;
|
|
1548
1548
|
/**
|
|
1549
|
-
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), or `
|
|
1549
|
+
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL)
|
|
1550
1550
|
*/
|
|
1551
1551
|
409: ApiError;
|
|
1552
1552
|
/**
|
|
@@ -1594,7 +1594,7 @@ export type UnpublishErrors = {
|
|
|
1594
1594
|
*/
|
|
1595
1595
|
404: ApiError;
|
|
1596
1596
|
/**
|
|
1597
|
-
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), or `
|
|
1597
|
+
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL)
|
|
1598
1598
|
*/
|
|
1599
1599
|
409: ApiError;
|
|
1600
1600
|
/**
|
|
@@ -1642,7 +1642,7 @@ export type PromotePlanErrors = {
|
|
|
1642
1642
|
*/
|
|
1643
1643
|
404: ApiError;
|
|
1644
1644
|
/**
|
|
1645
|
-
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), or `
|
|
1645
|
+
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL)
|
|
1646
1646
|
*/
|
|
1647
1647
|
409: ApiError;
|
|
1648
1648
|
/**
|
|
@@ -1690,7 +1690,7 @@ export type PromoteErrors = {
|
|
|
1690
1690
|
*/
|
|
1691
1691
|
404: ApiError;
|
|
1692
1692
|
/**
|
|
1693
|
-
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), or `
|
|
1693
|
+
* `referenced_by_bundles` (details list the bundles, then the dependent asset versions), `global_exists` (promote), `bundle_scope_invalid` (promote; details list the refs), `registry_changed` (the registry moved on; retry), `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL)
|
|
1694
1694
|
*/
|
|
1695
1695
|
409: ApiError;
|
|
1696
1696
|
/**
|
|
@@ -1738,7 +1738,7 @@ export type DeprecatePlanErrors = {
|
|
|
1738
1738
|
*/
|
|
1739
1739
|
404: ApiError;
|
|
1740
1740
|
/**
|
|
1741
|
-
* `deprecation_unchanged` (already deprecated with this reason and replacement), `not_deprecated` (undo with no deprecation.json), `deprecation_in_manifest` (undo of a deprecation set by legacy `metadata.deprecated`; publish a version without it), `registry_changed` (the registry moved on; retry), or `
|
|
1741
|
+
* `deprecation_unchanged` (already deprecated with this reason and replacement), `not_deprecated` (undo with no deprecation.json), `deprecation_in_manifest` (undo of a deprecation set by legacy `metadata.deprecated`; publish a version without it), `registry_changed` (the registry moved on; retry), `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL)
|
|
1742
1742
|
*/
|
|
1743
1743
|
409: ApiError;
|
|
1744
1744
|
/**
|
|
@@ -1786,7 +1786,7 @@ export type DeprecateErrors = {
|
|
|
1786
1786
|
*/
|
|
1787
1787
|
404: ApiError;
|
|
1788
1788
|
/**
|
|
1789
|
-
* `deprecation_unchanged` (already deprecated with this reason and replacement), `not_deprecated` (undo with no deprecation.json), `deprecation_in_manifest` (undo of a deprecation set by legacy `metadata.deprecated`; publish a version without it), `registry_changed` (the registry moved on; retry), or `
|
|
1789
|
+
* `deprecation_unchanged` (already deprecated with this reason and replacement), `not_deprecated` (undo with no deprecation.json), `deprecation_in_manifest` (undo of a deprecation set by legacy `metadata.deprecated`; publish a version without it), `registry_changed` (the registry moved on; retry), `branch_exists`, or `pr_open` (a pull request is open on the branch; the message has its URL)
|
|
1790
1790
|
*/
|
|
1791
1791
|
409: ApiError;
|
|
1792
1792
|
/**
|
|
@@ -22,8 +22,8 @@ export type { ArchiveFormat, AssetRef, AssetType, AssetVersionRef, BundleRef, Bu
|
|
|
22
22
|
export { AtkError, isAtkError } from './errors.ts';
|
|
23
23
|
export type { AtkProblem, ProblemCode, ValidationIssue } from './errors.ts';
|
|
24
24
|
export { PUBLISH_LIMITS } from './limits.ts';
|
|
25
|
-
export { assetRoute, authRedirectRoute, bundleRoute, bundlesRoute, catalogRoute, GETTING_STARTED_SERIES, gettingStartedLinks, gettingStartedRoute, gettingStartedSeriesRoute, parseAssetQuery, parseBundleQuery, parseCatalogQuery, publishAssetRoute, publishBundleRoute, webRoutes, } from './web-routes.ts';
|
|
26
|
-
export type { AssetQuery, BundleQuery, CatalogQuery, CatalogSort, GettingStartedLink, GettingStartedSeries, Parsed, WebHref, } from './web-routes.ts';
|
|
25
|
+
export { assetRoute, authRedirectRoute, bundleRoute, bundlesRoute, catalogRoute, GETTING_STARTED_SERIES, gettingStartedLinks, gettingStartedRoute, gettingStartedSeriesRoute, parseAssetQuery, parseBundleQuery, parseBundlesQuery, parseCatalogQuery, publishAssetRoute, publishBundleRoute, webRoutes, } from './web-routes.ts';
|
|
26
|
+
export type { AssetQuery, BundleQuery, BundlesQuery, CatalogQuery, CatalogScope, CatalogSort, GettingStartedLink, GettingStartedSeries, Parsed, WebHref, } from './web-routes.ts';
|
|
27
27
|
export { AssetDependency, AssetTypeSchema, BundleAssetRef, BundleSchema, DeprecatedEntry, HookConfig, HookEventBinding, ManifestSchema, RegistryAsset, RegistryAssetVersionSchema, RegistryAssetVersionsMapSchema, RegistryBundle, RegistrySchema, SecurityBlock, } from '../atk-schemas/index.ts';
|
|
28
28
|
export type { Bundle, Manifest, Registry, RegistryAssetVersion, RegistryAssetVersionsMap } from '../atk-schemas/index.ts';
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/atk-api/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC1E,YAAY,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,GAAG,EACH,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,OAAO,GACR,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/atk-api/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC1E,YAAY,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,GAAG,EACH,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,OAAO,GACR,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -20,7 +20,7 @@ export { createAtkClient } from "./client.js";
|
|
|
20
20
|
export { assetRef, bundleRef, exactVersion, parseOrg } from "./domain.js";
|
|
21
21
|
export { AtkError, isAtkError } from "./errors.js";
|
|
22
22
|
export { PUBLISH_LIMITS } from "./limits.js";
|
|
23
|
-
export { assetRoute, authRedirectRoute, bundleRoute, bundlesRoute, catalogRoute, GETTING_STARTED_SERIES, gettingStartedLinks, gettingStartedRoute, gettingStartedSeriesRoute, parseAssetQuery, parseBundleQuery, parseCatalogQuery, publishAssetRoute, publishBundleRoute, webRoutes, } from "./web-routes.js";
|
|
23
|
+
export { assetRoute, authRedirectRoute, bundleRoute, bundlesRoute, catalogRoute, GETTING_STARTED_SERIES, gettingStartedLinks, gettingStartedRoute, gettingStartedSeriesRoute, parseAssetQuery, parseBundleQuery, parseBundlesQuery, parseCatalogQuery, publishAssetRoute, publishBundleRoute, webRoutes, } from "./web-routes.js";
|
|
24
24
|
// The manifest, bundle and registry Zod schemas live in @atk/schemas; re-exported for the web app.
|
|
25
25
|
export { AssetDependency, AssetTypeSchema, BundleAssetRef, BundleSchema, DeprecatedEntry, HookConfig, HookEventBinding, ManifestSchema, RegistryAsset, RegistryAssetVersionSchema, RegistryAssetVersionsMapSchema, RegistryBundle, RegistrySchema, SecurityBlock, } from "../atk-schemas/index.js";
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/atk-api/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAc9C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2B1E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,GACV,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/atk-api/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAc9C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2B1E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,GACV,MAAM,iBAAiB,CAAC;AAczB,mGAAmG;AACnG,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* Shape (static-export compatible: every page is one HTML file, entity
|
|
7
7
|
* identity in the query string; `trailingSlash: true` -> `asset/index.html`):
|
|
8
8
|
*
|
|
9
|
-
* / catalog (assets) ?q=&type=&tag=&org=&tool=&sort= (repeatable keys)
|
|
9
|
+
* / catalog (assets) ?q=&type=&tag=&org=&tool=&sort=&scope= (repeatable keys)
|
|
10
10
|
* /asset/?type=skill&name=x[&org=y][&version=1.2.0][&file=path]
|
|
11
|
-
* /bundles/ bundle list ?q=
|
|
11
|
+
* /bundles/ bundle list ?q=&scope=
|
|
12
12
|
* /bundle/?name=x[&org=y][&version=1.0.0]
|
|
13
13
|
* /publish/asset/ asset wizard
|
|
14
14
|
* /publish/bundle/ bundle wizard
|
|
@@ -40,14 +40,25 @@ export interface BundleQuery {
|
|
|
40
40
|
readonly ref: BundleRef;
|
|
41
41
|
readonly version?: string;
|
|
42
42
|
}
|
|
43
|
+
export interface BundlesQuery {
|
|
44
|
+
readonly q: string;
|
|
45
|
+
readonly scope: CatalogScope;
|
|
46
|
+
}
|
|
43
47
|
export interface CatalogQuery {
|
|
44
48
|
readonly orgs: readonly string[];
|
|
45
49
|
readonly q: string;
|
|
50
|
+
readonly scope: CatalogScope;
|
|
46
51
|
readonly sort: CatalogSort;
|
|
47
52
|
readonly tags: readonly string[];
|
|
48
53
|
readonly tools: readonly string[];
|
|
49
54
|
readonly types: readonly AssetType[];
|
|
50
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Which items a list shows with no search text and no org picked: `global` (the default) leaves
|
|
58
|
+
* org-scoped items out, `all` shows every scope. Search text or an org filter reaches every scope
|
|
59
|
+
* whatever this says.
|
|
60
|
+
*/
|
|
61
|
+
export type CatalogScope = 'all' | 'global';
|
|
51
62
|
export type CatalogSort = 'name' | 'relevance' | 'updated';
|
|
52
63
|
/** A getting-started page: a series, and optionally one of its chapters (the web's chapter id). */
|
|
53
64
|
export interface GettingStartedLink {
|
|
@@ -95,6 +106,7 @@ export declare const catalogRoute: import("paramour").AppRoute<"/", Readonly<Rec
|
|
|
95
106
|
readonly org: import("paramour").Codec<string[], "required", false, "many", boolean>;
|
|
96
107
|
readonly tool: import("paramour").Codec<string[], "required", false, "many", boolean>;
|
|
97
108
|
readonly sort: import("paramour").Codec<"name" | "relevance" | "updated", "defaulted", true, "single", true>;
|
|
109
|
+
readonly scope: import("paramour").Codec<"global" | "all", "defaulted", true, "single", true>;
|
|
98
110
|
}>;
|
|
99
111
|
/** One asset. Key order is the href's key order. */
|
|
100
112
|
export declare const assetRoute: import("paramour").AppRoute<"/asset", Readonly<Record<never, import("paramour").ParamCodec>>, {
|
|
@@ -106,6 +118,7 @@ export declare const assetRoute: import("paramour").AppRoute<"/asset", Readonly<
|
|
|
106
118
|
}>;
|
|
107
119
|
export declare const bundlesRoute: import("paramour").AppRoute<"/bundles", Readonly<Record<never, import("paramour").ParamCodec>>, {
|
|
108
120
|
readonly q: import("paramour").Codec<string, "optional", false, "single", boolean>;
|
|
121
|
+
readonly scope: import("paramour").Codec<"global" | "all", "defaulted", true, "single", true>;
|
|
109
122
|
}>;
|
|
110
123
|
export declare const bundleRoute: import("paramour").AppRoute<"/bundle", Readonly<Record<never, import("paramour").ParamCodec>>, {
|
|
111
124
|
readonly name: import("paramour").Codec<string, "required", false, "single", boolean>;
|
|
@@ -133,7 +146,8 @@ export declare const webRoutes: {
|
|
|
133
146
|
readonly bundle: (ref: BundleRef, opts?: {
|
|
134
147
|
readonly version?: string;
|
|
135
148
|
}) => WebHref;
|
|
136
|
-
|
|
149
|
+
/** Defaults are omitted, so the canonical bundle list URL is just `/bundles/`. */
|
|
150
|
+
readonly bundles: (query?: Partial<BundlesQuery>) => WebHref;
|
|
137
151
|
/** Defaults are omitted, so the canonical catalog URL is just `/`. */
|
|
138
152
|
readonly catalog: (query?: Partial<CatalogQuery>) => WebHref;
|
|
139
153
|
/** The getting-started hub: a quick start and the video series. */
|
|
@@ -147,12 +161,17 @@ export declare const webRoutes: {
|
|
|
147
161
|
export declare function parseAssetQuery(params: SearchSource): Parsed<AssetQuery>;
|
|
148
162
|
/** The bundle page's query. Never throws: a bad link is `{ ok: false, reason }`. */
|
|
149
163
|
export declare function parseBundleQuery(params: SearchSource): Parsed<BundleQuery>;
|
|
164
|
+
/**
|
|
165
|
+
* The bundle list's query. Lenient, never fails: an unknown scope reads as
|
|
166
|
+
* `global`, and a key that cannot decode (a repeated `q`) falls back to its default.
|
|
167
|
+
*/
|
|
168
|
+
export declare function parseBundlesQuery(params: SearchSource): BundlesQuery;
|
|
150
169
|
/**
|
|
151
170
|
* The catalog's filters. Lenient, never fails: unknown asset types are
|
|
152
171
|
* dropped, an org filter loses a leading `@` like the asset and bundle
|
|
153
|
-
* parsers (an invalid org name is dropped), an unknown sort reads as `relevance`,
|
|
154
|
-
* at all (a repeated `q`) falls back to its
|
|
155
|
-
*
|
|
172
|
+
* parsers (an invalid org name is dropped), an unknown sort reads as `relevance`, an unknown
|
|
173
|
+
* scope as `global`, and a key that cannot decode at all (a repeated `q`) falls back to its
|
|
174
|
+
* default. A bad filter just shows the default view.
|
|
156
175
|
*/
|
|
157
176
|
export declare function parseCatalogQuery(params: SearchSource): CatalogQuery;
|
|
158
177
|
/** Org of a parsed ref, for code that needs the raw string (query keys, display). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-routes.d.ts","sourceRoot":"","sources":["../../../src/lib/atk-api/web-routes.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAuE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAElH,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,SAAS,EAGd,KAAK,GAAG,EAET,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;CACtC;AAED,MAAM,MAAM,WAAW,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gB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAU1E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAKpE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAcpE;AA2CD,qFAAqF;AACrF,YAAY,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* Shape (static-export compatible: every page is one HTML file, entity
|
|
8
8
|
* identity in the query string; `trailingSlash: true` -> `asset/index.html`):
|
|
9
9
|
*
|
|
10
|
-
* / catalog (assets) ?q=&type=&tag=&org=&tool=&sort= (repeatable keys)
|
|
10
|
+
* / catalog (assets) ?q=&type=&tag=&org=&tool=&sort=&scope= (repeatable keys)
|
|
11
11
|
* /asset/?type=skill&name=x[&org=y][&version=1.2.0][&file=path]
|
|
12
|
-
* /bundles/ bundle list ?q=
|
|
12
|
+
* /bundles/ bundle list ?q=&scope=
|
|
13
13
|
* /bundle/?name=x[&org=y][&version=1.0.0]
|
|
14
14
|
* /publish/asset/ asset wizard
|
|
15
15
|
* /publish/bundle/ bundle wizard
|
|
@@ -33,6 +33,7 @@ import { decodeSearch, defineAppRoute, href, p, safeDecodeSearch } from 'paramou
|
|
|
33
33
|
import { assetRef, bundleRef, exactVersion, parseOrg, } from "./domain.js";
|
|
34
34
|
import { isAtkError } from "./errors.js";
|
|
35
35
|
const CATALOG_SORTS = ['relevance', 'name', 'updated'];
|
|
36
|
+
const CATALOG_SCOPES = ['global', 'all'];
|
|
36
37
|
/** Every getting-started series, in the order the hub lists them. One static page each. */
|
|
37
38
|
export const GETTING_STARTED_SERIES = ['basics', 'manage-assets', 'publish-assets'];
|
|
38
39
|
/**
|
|
@@ -60,6 +61,7 @@ export const catalogRoute = defineAppRoute('/', {
|
|
|
60
61
|
org: p.array(),
|
|
61
62
|
tool: p.array(),
|
|
62
63
|
sort: p.enum(CATALOG_SORTS).default('relevance').catch('relevance'),
|
|
64
|
+
scope: p.enum(CATALOG_SCOPES).default('global').catch('global'),
|
|
63
65
|
},
|
|
64
66
|
trailingSlash: true,
|
|
65
67
|
});
|
|
@@ -75,7 +77,10 @@ export const assetRoute = defineAppRoute('/asset', {
|
|
|
75
77
|
trailingSlash: true,
|
|
76
78
|
});
|
|
77
79
|
export const bundlesRoute = defineAppRoute('/bundles', {
|
|
78
|
-
search: {
|
|
80
|
+
search: {
|
|
81
|
+
q: p.string().optional(),
|
|
82
|
+
scope: p.enum(CATALOG_SCOPES).default('global').catch('global'),
|
|
83
|
+
},
|
|
79
84
|
trailingSlash: true,
|
|
80
85
|
});
|
|
81
86
|
export const bundleRoute = defineAppRoute('/bundle', {
|
|
@@ -111,8 +116,11 @@ export const webRoutes = {
|
|
|
111
116
|
bundle(ref, opts) {
|
|
112
117
|
return href(bundleRoute, { search: { name: ref.name, org: ref.org, version: opts?.version } });
|
|
113
118
|
},
|
|
114
|
-
bundles
|
|
115
|
-
|
|
119
|
+
/** Defaults are omitted, so the canonical bundle list URL is just `/bundles/`. */
|
|
120
|
+
bundles(query) {
|
|
121
|
+
return href(bundlesRoute, {
|
|
122
|
+
search: { q: query?.q || undefined, scope: query?.scope ?? 'global' },
|
|
123
|
+
});
|
|
116
124
|
},
|
|
117
125
|
/** Defaults are omitted, so the canonical catalog URL is just `/`. */
|
|
118
126
|
catalog(query) {
|
|
@@ -120,6 +128,7 @@ export const webRoutes = {
|
|
|
120
128
|
search: {
|
|
121
129
|
org: [...(query?.orgs ?? [])],
|
|
122
130
|
q: query?.q ?? '',
|
|
131
|
+
scope: query?.scope ?? 'global',
|
|
123
132
|
sort: query?.sort ?? 'relevance',
|
|
124
133
|
tag: [...(query?.tags ?? [])],
|
|
125
134
|
tool: [...(query?.tools ?? [])],
|
|
@@ -167,12 +176,21 @@ export function parseBundleQuery(params) {
|
|
|
167
176
|
...(version === undefined ? {} : { version: exactVersion(version) }),
|
|
168
177
|
}));
|
|
169
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* The bundle list's query. Lenient, never fails: an unknown scope reads as
|
|
181
|
+
* `global`, and a key that cannot decode (a repeated `q`) falls back to its default.
|
|
182
|
+
*/
|
|
183
|
+
export function parseBundlesQuery(params) {
|
|
184
|
+
const decoded = safeDecodeSearch(bundlesRoute, params);
|
|
185
|
+
const search = decoded.status === 'success' ? decoded.data : decodeSearch(bundlesRoute, without(params, decoded.error.issues));
|
|
186
|
+
return { q: search.q ?? '', scope: search.scope };
|
|
187
|
+
}
|
|
170
188
|
/**
|
|
171
189
|
* The catalog's filters. Lenient, never fails: unknown asset types are
|
|
172
190
|
* dropped, an org filter loses a leading `@` like the asset and bundle
|
|
173
|
-
* parsers (an invalid org name is dropped), an unknown sort reads as `relevance`,
|
|
174
|
-
* at all (a repeated `q`) falls back to its
|
|
175
|
-
*
|
|
191
|
+
* parsers (an invalid org name is dropped), an unknown sort reads as `relevance`, an unknown
|
|
192
|
+
* scope as `global`, and a key that cannot decode at all (a repeated `q`) falls back to its
|
|
193
|
+
* default. A bad filter just shows the default view.
|
|
176
194
|
*/
|
|
177
195
|
export function parseCatalogQuery(params) {
|
|
178
196
|
const decoded = safeDecodeSearch(catalogRoute, params);
|
|
@@ -181,6 +199,7 @@ export function parseCatalogQuery(params) {
|
|
|
181
199
|
return {
|
|
182
200
|
orgs: search.org.flatMap(validOrg),
|
|
183
201
|
q: search.q,
|
|
202
|
+
scope: search.scope,
|
|
184
203
|
sort: search.sort,
|
|
185
204
|
tags: search.tag,
|
|
186
205
|
tools: search.tool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-routes.js","sourceRoot":"","sources":["../../../src/lib/atk-api/web-routes.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE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ACR,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/build/lib/auth.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export type CredentialSource = 'ATK_TOKEN' | 'entra';
|
|
|
17
17
|
* `atk login` / `atk logout`, which change what the chain would return.
|
|
18
18
|
*/
|
|
19
19
|
export declare function clearTokenCache(): void;
|
|
20
|
+
/** The `ATK_TOKEN` bearer, trimmed, or `undefined` when it is unset or blank. When set, it wins the chain. */
|
|
21
|
+
export declare function getAtkTokenFromEnv(): string | undefined;
|
|
20
22
|
/**
|
|
21
23
|
* Resolve the bearer token to send to the ATK API, and where it came from.
|
|
22
24
|
*
|
|
@@ -25,8 +27,10 @@ export declare function clearTokenCache(): void;
|
|
|
25
27
|
* 2. The cached Entra session, refreshed silently (`atk login`)
|
|
26
28
|
*
|
|
27
29
|
* When neither yields a token the {@link AuthError} names `atk login` as the
|
|
28
|
-
* fix, and says so differently when the session has expired.
|
|
29
|
-
*
|
|
30
|
+
* fix, and says so differently when the session has expired. A refresh that
|
|
31
|
+
* failed for another reason (network, an unreadable cache) carries MSAL's
|
|
32
|
+
* detail and names `atk login --force`. Commands never start the device-code
|
|
33
|
+
* flow themselves.
|
|
30
34
|
*/
|
|
31
35
|
export declare function getCredential(): Promise<Credential>;
|
|
32
36
|
/**
|
|
@@ -34,6 +38,12 @@ export declare function getCredential(): Promise<Credential>;
|
|
|
34
38
|
* `undefined` if the chain has not run (or stopped at `ATK_TOKEN`).
|
|
35
39
|
*/
|
|
36
40
|
export declare function getLastEntraSession(): EntraSession | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* When a bearer expires, from its JWT `exp` claim. The payload is decoded, not
|
|
43
|
+
* verified: the API is what decides whether the token is good. `undefined` when
|
|
44
|
+
* the token is not a JWT or carries no numeric `exp`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getTokenExpiry(token: string): Date | undefined;
|
|
37
47
|
/**
|
|
38
48
|
* Validate that a token is accepted by the ATK API by calling `GET /me` with
|
|
39
49
|
* exactly that token — never the process-cached one.
|
package/build/lib/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,YAAY,CAAC;AAChE,OAAO,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,SAAU,SAAQ,WAAW;IAC/B,IAAI,SAAe;CAC7B;AAED,gGAAgG;AAChG,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oDAAoD;AACpD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,YAAY,CAAC;AAChE,OAAO,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,SAAU,SAAQ,WAAW;IAC/B,IAAI,SAAe;CAC7B;AAED,gGAAgG;AAChG,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oDAAoD;AACpD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,OAAO,CAAC;AAYrD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAED,8GAA8G;AAC9G,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAEvD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,CAMnD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,GAAG,SAAS,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAc9D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;IAAE,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAYvE"}
|
package/build/lib/auth.js
CHANGED
|
@@ -10,6 +10,7 @@ export class AuthError extends GuidedError {
|
|
|
10
10
|
export const ATK_TOKEN_ENV_VAR = 'ATK_TOKEN';
|
|
11
11
|
const NOT_SIGNED_IN_MESSAGE = 'Not signed in. Run `atk login` to sign in with your Emergent account.';
|
|
12
12
|
const SESSION_EXPIRED_MESSAGE = 'Your Emergent sign-in has expired. Run `atk login` to renew it.';
|
|
13
|
+
const REFRESH_FAILED_HINT = 'Check your network connection and run the command again. If it keeps failing, run `atk login --force` to sign in again.';
|
|
13
14
|
/** Cached results so a process resolves each chain at most once. */
|
|
14
15
|
let cachedCredential;
|
|
15
16
|
/** The Entra outcome the last {@link getCredential} run observed, for `atk doctor`. */
|
|
@@ -22,6 +23,10 @@ export function clearTokenCache() {
|
|
|
22
23
|
cachedCredential = undefined;
|
|
23
24
|
lastEntraSession = undefined;
|
|
24
25
|
}
|
|
26
|
+
/** The `ATK_TOKEN` bearer, trimmed, or `undefined` when it is unset or blank. When set, it wins the chain. */
|
|
27
|
+
export function getAtkTokenFromEnv() {
|
|
28
|
+
return process.env[ATK_TOKEN_ENV_VAR]?.trim() || undefined;
|
|
29
|
+
}
|
|
25
30
|
/**
|
|
26
31
|
* Resolve the bearer token to send to the ATK API, and where it came from.
|
|
27
32
|
*
|
|
@@ -30,8 +35,10 @@ export function clearTokenCache() {
|
|
|
30
35
|
* 2. The cached Entra session, refreshed silently (`atk login`)
|
|
31
36
|
*
|
|
32
37
|
* When neither yields a token the {@link AuthError} names `atk login` as the
|
|
33
|
-
* fix, and says so differently when the session has expired.
|
|
34
|
-
*
|
|
38
|
+
* fix, and says so differently when the session has expired. A refresh that
|
|
39
|
+
* failed for another reason (network, an unreadable cache) carries MSAL's
|
|
40
|
+
* detail and names `atk login --force`. Commands never start the device-code
|
|
41
|
+
* flow themselves.
|
|
35
42
|
*/
|
|
36
43
|
export function getCredential() {
|
|
37
44
|
cachedCredential ??= resolveCredential().catch((err) => {
|
|
@@ -47,6 +54,27 @@ export function getCredential() {
|
|
|
47
54
|
export function getLastEntraSession() {
|
|
48
55
|
return lastEntraSession;
|
|
49
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* When a bearer expires, from its JWT `exp` claim. The payload is decoded, not
|
|
59
|
+
* verified: the API is what decides whether the token is good. `undefined` when
|
|
60
|
+
* the token is not a JWT or carries no numeric `exp`.
|
|
61
|
+
*/
|
|
62
|
+
export function getTokenExpiry(token) {
|
|
63
|
+
const payload = token.split('.')[1];
|
|
64
|
+
if (!payload) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const claims = JSON.parse(Buffer.from(payload, 'base64url').toString('utf-8'));
|
|
69
|
+
const exp = typeof claims === 'object' && claims !== null && 'exp' in claims ? claims.exp : undefined;
|
|
70
|
+
const expiry = typeof exp === 'number' ? new Date(exp * 1000) : undefined;
|
|
71
|
+
// An out-of-range exp makes an Invalid Date, which toISOString() would throw on.
|
|
72
|
+
return expiry && Number.isFinite(expiry.getTime()) ? expiry : undefined;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
50
78
|
/**
|
|
51
79
|
* Validate that a token is accepted by the ATK API by calling `GET /me` with
|
|
52
80
|
* exactly that token — never the process-cached one.
|
|
@@ -71,7 +99,7 @@ export async function validateToken(token) {
|
|
|
71
99
|
}
|
|
72
100
|
async function resolveCredential() {
|
|
73
101
|
// 1. ATK_TOKEN: a raw bearer for CI and agents
|
|
74
|
-
const atkToken =
|
|
102
|
+
const atkToken = getAtkTokenFromEnv();
|
|
75
103
|
if (atkToken) {
|
|
76
104
|
return { source: 'ATK_TOKEN', token: atkToken };
|
|
77
105
|
}
|
|
@@ -81,6 +109,13 @@ async function resolveCredential() {
|
|
|
81
109
|
if (entra.ok) {
|
|
82
110
|
return { source: 'entra', token: entra.token };
|
|
83
111
|
}
|
|
112
|
+
if (entra.reason === 'error') {
|
|
113
|
+
// A network failure or an unreadable cache, not a missing or expired session.
|
|
114
|
+
throw new AuthError(`Couldn't refresh your Emergent sign-in: ${entra.detail ?? 'unknown error'}`, {
|
|
115
|
+
command: 'atk login --force',
|
|
116
|
+
hint: REFRESH_FAILED_HINT,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
84
119
|
throw new AuthError(entra.reason === 'expired' ? SESSION_EXPIRED_MESSAGE : NOT_SIGNED_IN_MESSAGE, {
|
|
85
120
|
command: 'atk login',
|
|
86
121
|
});
|
package/build/lib/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAqB,eAAe,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE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I,SAAS,CAAC,2CAA2C,KAAK,CAAC,MAAM,IAAI,eAAe,EAAE,EAAE;YAChG,OAAO,EAAE,mBAAmB;YAC5B,IAAI,EAAE,mBAAmB;SAC1B,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,qBAAqB,EAAE;QAChG,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;AACL,CAAC"}
|
package/build/lib/checksum.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConfigEntry } from './schemas/lockfile.js';
|
|
1
2
|
/** Describes a single config-entry verification failure. */
|
|
2
3
|
export interface ConfigEntryFailure {
|
|
3
4
|
file: string;
|
|
@@ -6,18 +7,30 @@ export interface ConfigEntryFailure {
|
|
|
6
7
|
}
|
|
7
8
|
/** Reason a config-entry verification can fail. */
|
|
8
9
|
export type ConfigEntryFailureReason = 'CONFIG_CHECKSUM_MISMATCH' | 'CONFIG_FILE_NOT_FOUND' | 'CONFIG_KEY_NOT_FOUND';
|
|
10
|
+
/**
|
|
11
|
+
* A recorded config entry, as the lockfile holds it, that {@link verifyConfigEntries} can check. Its
|
|
12
|
+
* `checksumVersion` is {@link CONFIG_CHECKSUM_VERSION} for a deep digest and absent for a legacy one;
|
|
13
|
+
* hook groups ignore it.
|
|
14
|
+
*/
|
|
15
|
+
export type VerifiableConfigEntry = Omit<ConfigEntry, 'tool'>;
|
|
9
16
|
/** Recursively collect all files in a directory. */
|
|
10
17
|
export declare function collectFilesRecursive(dirPath: string, baseDir: string): Promise<Array<{
|
|
11
18
|
absolutePath: string;
|
|
12
19
|
relativePath: string;
|
|
13
20
|
}>>;
|
|
21
|
+
/**
|
|
22
|
+
* The lockfile `checksumVersion` of a digest from {@link computeConfigEntryChecksum}. A config entry
|
|
23
|
+
* without one was recorded by an older CLI with {@link legacyConfigEntryChecksum}.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CONFIG_CHECKSUM_VERSION: 2;
|
|
14
26
|
/**
|
|
15
27
|
* Compute a deterministic SHA-256 checksum for a config entry value.
|
|
16
28
|
*
|
|
17
29
|
* Strips the `_managedBy` metadata key (added by ATK at write time),
|
|
18
|
-
* serializes the
|
|
19
|
-
*
|
|
20
|
-
* helper so the checksum logic stays in
|
|
30
|
+
* serializes the rest with keys sorted at every depth (so nested `env` and
|
|
31
|
+
* `headers` count), and returns the hex digest. Both the installer (write path)
|
|
32
|
+
* and the verifier (read path) use this helper so the checksum logic stays in
|
|
33
|
+
* one place.
|
|
21
34
|
*/
|
|
22
35
|
export declare function computeConfigEntryChecksum(entry: Record<string, unknown>): string;
|
|
23
36
|
/**
|
|
@@ -26,6 +39,16 @@ export declare function computeConfigEntryChecksum(entry: Record<string, unknown
|
|
|
26
39
|
* are part of the digest (so audit detects hand-edits to the group).
|
|
27
40
|
*/
|
|
28
41
|
export declare function computeHookGroupChecksum(group: unknown): string;
|
|
42
|
+
/**
|
|
43
|
+
* The git blob sha of raw bytes: what the API's file listing gives as each file's `sha`, so a placed
|
|
44
|
+
* file can be matched to the registry version it came from.
|
|
45
|
+
*/
|
|
46
|
+
export declare function gitBlobSha(content: Uint8Array): string;
|
|
47
|
+
/**
|
|
48
|
+
* The git blob shas `content` matches in the registry repo: of its bytes and, for text, of the same
|
|
49
|
+
* text with LF or with CRLF line endings, which {@link matchesChecksum} counts as the same content.
|
|
50
|
+
*/
|
|
51
|
+
export declare function gitBlobShas(content: Uint8Array): string[];
|
|
29
52
|
/**
|
|
30
53
|
* Compute a SHA-256 hash of raw bytes.
|
|
31
54
|
* Byte-equivalent to {@link hashString} for valid-UTF-8 text content, so
|
|
@@ -56,12 +79,19 @@ export declare function hashString(content: string): string;
|
|
|
56
79
|
export declare function matchesChecksum(content: Uint8Array, expected: string): boolean;
|
|
57
80
|
/**
|
|
58
81
|
* Deterministically serialize a value with object keys sorted recursively.
|
|
59
|
-
* Arrays keep their order; nested object keys are sorted at every level
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* whose meaningful data (`command`, `timeout`) lives inside `hooks[]`.
|
|
82
|
+
* Arrays keep their order; nested object keys are sorted at every level, so
|
|
83
|
+
* deeply-nested fields count: a hook group's `command` and `timeout` inside
|
|
84
|
+
* `hooks[]`, an MCP server's `env` and `headers`.
|
|
63
85
|
*/
|
|
64
86
|
export declare function stableStringify(value: unknown): string;
|
|
87
|
+
/**
|
|
88
|
+
* Re-record the config entries an older CLI checksummed with {@link legacyConfigEntryChecksum}, which
|
|
89
|
+
* can't see nested keys, as {@link computeConfigEntryChecksum} digests of the value the file holds
|
|
90
|
+
* now. Each entry without a `checksumVersion` whose value matches its legacy digest comes back with
|
|
91
|
+
* the deep digest and the current version; every other entry comes back as the same object. The
|
|
92
|
+
* legacy digest can't tell what the nested fields held when it was recorded, so this trusts them once.
|
|
93
|
+
*/
|
|
94
|
+
export declare function upgradeConfigEntryChecksums<T extends VerifiableConfigEntry>(entries: T[], projectDir: string): Promise<T[]>;
|
|
65
95
|
/**
|
|
66
96
|
* Compare a file's current checksum against an expected value (line-ending
|
|
67
97
|
* tolerant; see {@link matchesChecksum}).
|
|
@@ -87,7 +117,8 @@ export declare function verifyChecksums(files: Array<{
|
|
|
87
117
|
* 2. Splits the dot-path key into section/child and looks up the value →
|
|
88
118
|
* `CONFIG_KEY_NOT_FOUND` if missing.
|
|
89
119
|
* 3. Computes a checksum via `computeConfigEntryChecksum()` and compares →
|
|
90
|
-
* `CONFIG_CHECKSUM_MISMATCH` on divergence.
|
|
120
|
+
* `CONFIG_CHECKSUM_MISMATCH` on divergence. An entry without a
|
|
121
|
+
* `checksumVersion` (recorded by an older CLI) also matches its legacy digest.
|
|
91
122
|
*
|
|
92
123
|
* Returns only the entries that failed (empty array = all OK).
|
|
93
124
|
*
|
|
@@ -96,10 +127,5 @@ export declare function verifyChecksums(files: Array<{
|
|
|
96
127
|
* command rather than by an object key, and checksummed via the deep-stable
|
|
97
128
|
* hook-group digest so co-located foreign groups don't affect the result.
|
|
98
129
|
*/
|
|
99
|
-
export declare function verifyConfigEntries(entries:
|
|
100
|
-
checksum: string;
|
|
101
|
-
command?: string;
|
|
102
|
-
file: string;
|
|
103
|
-
key: string;
|
|
104
|
-
}>, projectDir: string): Promise<ConfigEntryFailure[]>;
|
|
130
|
+
export declare function verifyConfigEntries(entries: VerifiableConfigEntry[], projectDir: string): Promise<ConfigEntryFailure[]>;
|
|
105
131
|
//# sourceMappingURL=checksum.d.ts.map
|