@dreamlake/dreamlake-cli 0.88.1 → 0.89.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/dist/api/access.d.ts +83 -0
- package/dist/api/access.js +77 -0
- package/dist/api/agent.d.ts +156 -0
- package/dist/api/agent.js +111 -0
- package/dist/api/browser.d.ts +90 -0
- package/dist/api/browser.js +102 -0
- package/dist/api/client.d.ts +53 -0
- package/dist/api/client.js +102 -0
- package/dist/api/common.d.ts +28 -0
- package/dist/api/common.js +16 -0
- package/dist/api/content.d.ts +195 -0
- package/dist/api/content.js +147 -0
- package/dist/api/execution.d.ts +84 -0
- package/dist/api/execution.js +73 -0
- package/dist/api/http.d.ts +19 -0
- package/dist/api/http.js +66 -0
- package/dist/api/index.d.ts +2330 -0
- package/dist/api/index.js +114 -0
- package/dist/api/infra.d.ts +2 -0
- package/dist/api/infra.js +2 -0
- package/dist/api/jobs.d.ts +2 -0
- package/dist/api/jobs.js +2 -0
- package/dist/api/layout.d.ts +2 -0
- package/dist/api/layout.js +2 -0
- package/dist/api/library-edit.d.ts +3 -0
- package/dist/api/library-edit.js +3 -0
- package/dist/api/library-manifest.d.ts +2 -0
- package/dist/api/library-manifest.js +2 -0
- package/dist/api/note-character-plan.d.ts +2 -0
- package/dist/api/note-character-plan.js +2 -0
- package/dist/api/note-editing.d.ts +2 -0
- package/dist/api/note-editing.js +2 -0
- package/dist/api/note-edits.d.ts +21 -0
- package/dist/api/note-edits.js +10 -0
- package/dist/api/note-events.d.ts +5 -0
- package/dist/api/note-events.js +11 -0
- package/dist/api/note-files.d.ts +75 -0
- package/dist/api/note-files.js +65 -0
- package/dist/api/note-html-read.d.ts +2 -0
- package/dist/api/note-html-read.js +2 -0
- package/dist/api/note-html.d.ts +2 -0
- package/dist/api/note-html.js +2 -0
- package/dist/api/note-toc.d.ts +2 -0
- package/dist/api/note-toc.js +2 -0
- package/dist/api/notes.d.ts +304 -0
- package/dist/api/notes.js +181 -0
- package/dist/api/open-resources.d.ts +27 -0
- package/dist/api/open-resources.js +102 -0
- package/dist/api/ownership.d.ts +12 -0
- package/dist/api/ownership.js +24 -0
- package/dist/api/platform.d.ts +83 -0
- package/dist/api/platform.js +56 -0
- package/dist/api/presigned-transfer.d.ts +2 -0
- package/dist/api/presigned-transfer.js +2 -0
- package/dist/api/registered-runs.d.ts +48 -0
- package/dist/api/registered-runs.js +33 -0
- package/dist/api/sessions.d.ts +299 -0
- package/dist/api/sessions.js +105 -0
- package/dist/api/storage.d.ts +46 -0
- package/dist/api/storage.js +34 -0
- package/dist/api/streams.d.ts +18 -0
- package/dist/api/streams.js +70 -0
- package/dist/api/vault.d.ts +93 -0
- package/dist/api/vault.js +79 -0
- package/dist/api/workspace.d.ts +180 -0
- package/dist/api/workspace.js +146 -0
- package/dist/cli/agent-identity.d.ts +4 -0
- package/dist/cli/agent-identity.js +21 -0
- package/dist/cli/agents/identity.d.ts +50 -0
- package/dist/cli/agents/identity.js +105 -0
- package/dist/cli/agents/index.d.ts +31 -0
- package/dist/cli/agents/index.js +580 -0
- package/dist/cli/agents/manage.d.ts +43 -0
- package/dist/cli/agents/manage.js +376 -0
- package/dist/cli/agents/spec.d.ts +104 -0
- package/dist/cli/agents/spec.js +280 -0
- package/dist/cli/agents/web.d.ts +7 -0
- package/dist/cli/agents/web.js +109 -0
- package/dist/cli/artifact/incremental.d.ts +21 -0
- package/dist/cli/artifact/incremental.js +80 -0
- package/dist/cli/artifact/index.d.ts +52 -0
- package/dist/cli/artifact/index.js +405 -0
- package/dist/cli/artifact/meta.d.ts +69 -0
- package/dist/cli/artifact/meta.js +189 -0
- package/dist/cli/auth/commands.d.ts +29 -0
- package/dist/cli/auth/commands.js +327 -0
- package/dist/cli/auth/constants.d.ts +13 -0
- package/dist/cli/auth/constants.js +18 -0
- package/dist/cli/auth/credentials.d.ts +37 -0
- package/dist/cli/auth/credentials.js +155 -0
- package/dist/cli/auth/device-flow.d.ts +32 -0
- package/dist/cli/auth/device-flow.js +154 -0
- package/dist/cli/auth/device-secret.d.ts +6 -0
- package/dist/cli/auth/device-secret.js +26 -0
- package/dist/cli/auth/machine.d.ts +15 -0
- package/dist/cli/auth/machine.js +126 -0
- package/dist/cli/auth/materialized.d.ts +32 -0
- package/dist/cli/auth/materialized.js +102 -0
- package/dist/cli/auth/migrate.d.ts +10 -0
- package/dist/cli/auth/migrate.js +75 -0
- package/dist/cli/client.d.ts +102 -0
- package/dist/cli/client.js +206 -0
- package/dist/cli/collection-list.d.ts +3 -0
- package/dist/cli/collection-list.js +25 -0
- package/dist/cli/compat/ctx.d.ts +26 -0
- package/dist/cli/compat/ctx.js +76 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.d.ts +2 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.js +8 -0
- package/dist/cli/compat/dreamdb-wasm.d.ts +1 -0
- package/dist/cli/compat/dreamdb-wasm.js +26 -0
- package/dist/cli/compat/dreamdb.d.ts +112 -0
- package/dist/cli/compat/dreamdb.js +219 -0
- package/dist/cli/compat/flags.d.ts +2 -0
- package/dist/cli/compat/flags.js +13 -0
- package/dist/cli/compat/http.d.ts +23 -0
- package/dist/cli/compat/http.js +137 -0
- package/dist/cli/compat/presignedTransfer.d.ts +139 -0
- package/dist/cli/compat/presignedTransfer.js +580 -0
- package/dist/cli/compat/s3-backend.d.ts +73 -0
- package/dist/cli/compat/s3-backend.js +132 -0
- package/dist/cli/config.d.ts +22 -0
- package/dist/cli/config.js +96 -0
- package/dist/cli/connection/dto.d.ts +159 -0
- package/dist/cli/connection/dto.js +497 -0
- package/dist/cli/connection/index.d.ts +50 -0
- package/dist/cli/connection/index.js +413 -0
- package/dist/cli/connection/oauth.d.ts +23 -0
- package/dist/cli/connection/oauth.js +290 -0
- package/dist/cli/connection/write.d.ts +47 -0
- package/dist/cli/connection/write.js +573 -0
- package/dist/cli/create/index.d.ts +19 -0
- package/dist/cli/create/index.js +209 -0
- package/dist/cli/declare/index.d.ts +29 -0
- package/dist/cli/declare/index.js +304 -0
- package/dist/cli/delete/index.d.ts +18 -0
- package/dist/cli/delete/index.js +232 -0
- package/dist/cli/download/index.d.ts +9 -0
- package/dist/cli/download/index.js +128 -0
- package/dist/cli/env/compose.d.ts +88 -0
- package/dist/cli/env/compose.js +402 -0
- package/dist/cli/env/index.d.ts +176 -0
- package/dist/cli/env/index.js +1011 -0
- package/dist/cli/experiments/index.d.ts +11 -0
- package/dist/cli/experiments/index.js +168 -0
- package/dist/cli/glob.d.ts +1 -0
- package/dist/cli/glob.js +45 -0
- package/dist/cli/graphql-helpers.d.ts +23 -0
- package/dist/cli/graphql-helpers.js +42 -0
- package/dist/cli/graphql.d.ts +10 -0
- package/dist/cli/graphql.js +47 -0
- package/dist/cli/help-examples.generated.d.ts +1 -0
- package/dist/cli/help-examples.generated.js +192 -0
- package/dist/cli/helpers.d.ts +8 -0
- package/dist/cli/helpers.js +106 -0
- package/dist/cli/hosts/api.d.ts +29 -0
- package/dist/cli/hosts/api.js +54 -0
- package/dist/cli/hosts/bootstrap-source.d.ts +1 -0
- package/dist/cli/hosts/bootstrap-source.js +2 -0
- package/dist/cli/hosts/catalog.d.ts +26 -0
- package/dist/cli/hosts/catalog.js +55 -0
- package/dist/cli/hosts/config.d.ts +45 -0
- package/dist/cli/hosts/config.js +179 -0
- package/dist/cli/hosts/credentials.d.ts +19 -0
- package/dist/cli/hosts/credentials.js +173 -0
- package/dist/cli/hosts/enroll.d.ts +17 -0
- package/dist/cli/hosts/enroll.js +109 -0
- package/dist/cli/hosts/enrollments.d.ts +25 -0
- package/dist/cli/hosts/enrollments.js +54 -0
- package/dist/cli/hosts/index.d.ts +6 -0
- package/dist/cli/hosts/index.js +279 -0
- package/dist/cli/hosts/inventory.d.ts +40 -0
- package/dist/cli/hosts/inventory.js +91 -0
- package/dist/cli/hosts/lifecycle.d.ts +15 -0
- package/dist/cli/hosts/lifecycle.js +108 -0
- package/dist/cli/hosts/metrics-source.d.ts +12 -0
- package/dist/cli/hosts/metrics-source.js +89 -0
- package/dist/cli/hosts/observations.d.ts +39 -0
- package/dist/cli/hosts/observations.js +102 -0
- package/dist/cli/hosts/remote.d.ts +5 -0
- package/dist/cli/hosts/remote.js +66 -0
- package/dist/cli/hosts/ssh.d.ts +63 -0
- package/dist/cli/hosts/ssh.js +276 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +288 -0
- package/dist/cli/infra/api.d.ts +95 -0
- package/dist/cli/infra/api.js +291 -0
- package/dist/cli/infra/index.d.ts +5 -0
- package/dist/cli/infra/index.js +102 -0
- package/dist/cli/infra/move.d.ts +15 -0
- package/dist/cli/infra/move.js +123 -0
- package/dist/cli/infra/transfer.d.ts +15 -0
- package/dist/cli/infra/transfer.js +280 -0
- package/dist/cli/jobs/api.d.ts +69 -0
- package/dist/cli/jobs/api.js +121 -0
- package/dist/cli/jobs/index.d.ts +5 -0
- package/dist/cli/jobs/index.js +140 -0
- package/dist/cli/lakeshore/index.d.ts +98 -0
- package/dist/cli/lakeshore/index.js +502 -0
- package/dist/cli/launch/index.d.ts +43 -0
- package/dist/cli/launch/index.js +270 -0
- package/dist/cli/layout/index.d.ts +2 -0
- package/dist/cli/layout/index.js +44 -0
- package/dist/cli/layout/transport.d.ts +12 -0
- package/dist/cli/layout/transport.js +70 -0
- package/dist/cli/library/add.d.ts +60 -0
- package/dist/cli/library/add.js +348 -0
- package/dist/cli/library/cache.d.ts +26 -0
- package/dist/cli/library/cache.js +88 -0
- package/dist/cli/library/config.d.ts +75 -0
- package/dist/cli/library/config.js +198 -0
- package/dist/cli/library/digest.d.ts +5 -0
- package/dist/cli/library/digest.js +19 -0
- package/dist/cli/library/discover.d.ts +87 -0
- package/dist/cli/library/discover.js +534 -0
- package/dist/cli/library/freshness.d.ts +35 -0
- package/dist/cli/library/freshness.js +109 -0
- package/dist/cli/library/generation.d.ts +35 -0
- package/dist/cli/library/generation.js +211 -0
- package/dist/cli/library/index.d.ts +2 -0
- package/dist/cli/library/index.js +36 -0
- package/dist/cli/library/info.d.ts +69 -0
- package/dist/cli/library/info.js +311 -0
- package/dist/cli/library/list.d.ts +33 -0
- package/dist/cli/library/list.js +86 -0
- package/dist/cli/library/manifest.d.ts +81 -0
- package/dist/cli/library/manifest.js +200 -0
- package/dist/cli/library/manifestCache.d.ts +45 -0
- package/dist/cli/library/manifestCache.js +169 -0
- package/dist/cli/library/pull.d.ts +30 -0
- package/dist/cli/library/pull.js +438 -0
- package/dist/cli/library/push.d.ts +72 -0
- package/dist/cli/library/push.js +642 -0
- package/dist/cli/library/rm.d.ts +31 -0
- package/dist/cli/library/rm.js +200 -0
- package/dist/cli/library/search.d.ts +18 -0
- package/dist/cli/library/search.js +181 -0
- package/dist/cli/library/stat.d.ts +15 -0
- package/dist/cli/library/stat.js +127 -0
- package/dist/cli/library/tools.d.ts +104 -0
- package/dist/cli/library/tools.js +163 -0
- package/dist/cli/library/wire.d.ts +47 -0
- package/dist/cli/library/wire.js +120 -0
- package/dist/cli/list/index.d.ts +26 -0
- package/dist/cli/list/index.js +256 -0
- package/dist/cli/notes/character-plan.d.ts +22 -0
- package/dist/cli/notes/character-plan.js +232 -0
- package/dist/cli/notes/document.d.ts +73 -0
- package/dist/cli/notes/document.js +306 -0
- package/dist/cli/notes/edit-commands.d.ts +106 -0
- package/dist/cli/notes/edit-commands.js +623 -0
- package/dist/cli/notes/editing.d.ts +81 -0
- package/dist/cli/notes/editing.js +305 -0
- package/dist/cli/notes/events.d.ts +36 -0
- package/dist/cli/notes/events.js +54 -0
- package/dist/cli/notes/files-commands.d.ts +120 -0
- package/dist/cli/notes/files-commands.js +554 -0
- package/dist/cli/notes/html-read.d.ts +9 -0
- package/dist/cli/notes/html-read.js +90 -0
- package/dist/cli/notes/html.d.ts +73 -0
- package/dist/cli/notes/html.js +381 -0
- package/dist/cli/notes/index.d.ts +123 -0
- package/dist/cli/notes/index.js +1303 -0
- package/dist/cli/notes/linger.d.ts +59 -0
- package/dist/cli/notes/linger.js +339 -0
- package/dist/cli/notes/media-commands.d.ts +5 -0
- package/dist/cli/notes/media-commands.js +51 -0
- package/dist/cli/notes/move-command.d.ts +83 -0
- package/dist/cli/notes/move-command.js +259 -0
- package/dist/cli/notes/rm-command.d.ts +22 -0
- package/dist/cli/notes/rm-command.js +110 -0
- package/dist/cli/notes/select-command.d.ts +12 -0
- package/dist/cli/notes/select-command.js +84 -0
- package/dist/cli/notes/suggest-diff.d.ts +56 -0
- package/dist/cli/notes/suggest-diff.js +311 -0
- package/dist/cli/notes/toc.d.ts +38 -0
- package/dist/cli/notes/toc.js +144 -0
- package/dist/cli/notes/transfer-command.d.ts +6 -0
- package/dist/cli/notes/transfer-command.js +9 -0
- package/dist/cli/notes/version-commands.d.ts +19 -0
- package/dist/cli/notes/version-commands.js +178 -0
- package/dist/cli/nymph/index.d.ts +74 -0
- package/dist/cli/nymph/index.js +349 -0
- package/dist/cli/org/index.d.ts +34 -0
- package/dist/cli/org/index.js +341 -0
- package/dist/cli/ownership/index.d.ts +12 -0
- package/dist/cli/ownership/index.js +122 -0
- package/dist/cli/ownership/metadata-transfer.d.ts +20 -0
- package/dist/cli/ownership/metadata-transfer.js +159 -0
- package/dist/cli/page/index.d.ts +58 -0
- package/dist/cli/page/index.js +387 -0
- package/dist/cli/pipeline/index.d.ts +69 -0
- package/dist/cli/pipeline/index.js +604 -0
- package/dist/cli/progress.d.ts +60 -0
- package/dist/cli/progress.js +276 -0
- package/dist/cli/project/attachments.d.ts +10 -0
- package/dist/cli/project/attachments.js +39 -0
- package/dist/cli/project/grants.d.ts +10 -0
- package/dist/cli/project/grants.js +39 -0
- package/dist/cli/project/index.d.ts +8 -0
- package/dist/cli/project/index.js +92 -0
- package/dist/cli/project/move.d.ts +57 -0
- package/dist/cli/project/move.js +242 -0
- package/dist/cli/project/output.d.ts +2 -0
- package/dist/cli/project/output.js +29 -0
- package/dist/cli/project/stream.d.ts +55 -0
- package/dist/cli/project/stream.js +207 -0
- package/dist/cli/project/transfer-preview.d.ts +8 -0
- package/dist/cli/project/transfer-preview.js +10 -0
- package/dist/cli/prompt.d.ts +1 -0
- package/dist/cli/prompt.js +17 -0
- package/dist/cli/provider/dreamdir.d.ts +52 -0
- package/dist/cli/provider/dreamdir.js +138 -0
- package/dist/cli/provider/index.d.ts +4 -0
- package/dist/cli/provider/index.js +419 -0
- package/dist/cli/provider/jump-worker.d.ts +9 -0
- package/dist/cli/provider/jump-worker.js +141 -0
- package/dist/cli/provider/lifecycle.d.ts +149 -0
- package/dist/cli/provider/lifecycle.js +1390 -0
- package/dist/cli/provider/machine.d.ts +17 -0
- package/dist/cli/provider/machine.js +116 -0
- package/dist/cli/provider/ssh.d.ts +105 -0
- package/dist/cli/provider/ssh.js +305 -0
- package/dist/cli/provider/terraform.d.ts +140 -0
- package/dist/cli/provider/terraform.js +288 -0
- package/dist/cli/providers/index.d.ts +18 -0
- package/dist/cli/providers/index.js +422 -0
- package/dist/cli/python.d.ts +61 -0
- package/dist/cli/python.js +255 -0
- package/dist/cli/queues/index.d.ts +33 -0
- package/dist/cli/queues/index.js +248 -0
- package/dist/cli/queues/slurm.d.ts +10 -0
- package/dist/cli/queues/slurm.js +134 -0
- package/dist/cli/resources.d.ts +72 -0
- package/dist/cli/resources.js +137 -0
- package/dist/cli/run/index.d.ts +15 -0
- package/dist/cli/run/index.js +163 -0
- package/dist/cli/run/input.d.ts +34 -0
- package/dist/cli/run/input.js +135 -0
- package/dist/cli/run/recovery.d.ts +2 -0
- package/dist/cli/run/recovery.js +18 -0
- package/dist/cli/run/setup.d.ts +3 -0
- package/dist/cli/run/setup.js +62 -0
- package/dist/cli/runconfig/index.d.ts +12 -0
- package/dist/cli/runconfig/index.js +130 -0
- package/dist/cli/runnable/index.d.ts +35 -0
- package/dist/cli/runnable/index.js +575 -0
- package/dist/cli/runnable/path.d.ts +115 -0
- package/dist/cli/runnable/path.js +288 -0
- package/dist/cli/runnable/run.d.ts +91 -0
- package/dist/cli/runnable/run.js +239 -0
- package/dist/cli/runnable/upload.d.ts +43 -0
- package/dist/cli/runnable/upload.js +342 -0
- package/dist/cli/runnable/worker.d.ts +1 -0
- package/dist/cli/runnable/worker.js +44 -0
- package/dist/cli/schemas/workflow-spec.schema.json +335 -0
- package/dist/cli/self-update/index.d.ts +5 -0
- package/dist/cli/self-update/index.js +107 -0
- package/dist/cli/self-update/install.d.ts +60 -0
- package/dist/cli/self-update/install.js +428 -0
- package/dist/cli/self-update/paths.d.ts +40 -0
- package/dist/cli/self-update/paths.js +87 -0
- package/dist/cli/self-update/releases.d.ts +41 -0
- package/dist/cli/self-update/releases.js +153 -0
- package/dist/cli/self-update/settings.d.ts +16 -0
- package/dist/cli/self-update/settings.js +68 -0
- package/dist/cli/self-update/update.d.ts +18 -0
- package/dist/cli/self-update/update.js +241 -0
- package/dist/cli/service-accounts/index.d.ts +3 -0
- package/dist/cli/service-accounts/index.js +149 -0
- package/dist/cli/session-affiliation.d.ts +26 -0
- package/dist/cli/session-affiliation.js +135 -0
- package/dist/cli/sessions/affiliation.d.ts +8 -0
- package/dist/cli/sessions/affiliation.js +66 -0
- package/dist/cli/sessions/api.d.ts +55 -0
- package/dist/cli/sessions/api.js +88 -0
- package/dist/cli/sessions/control.d.ts +6 -0
- package/dist/cli/sessions/control.js +159 -0
- package/dist/cli/sessions/conversation.d.ts +15 -0
- package/dist/cli/sessions/conversation.js +118 -0
- package/dist/cli/sessions/index.d.ts +2 -0
- package/dist/cli/sessions/index.js +209 -0
- package/dist/cli/sessions/managed.d.ts +39 -0
- package/dist/cli/sessions/managed.js +63 -0
- package/dist/cli/sessions/redaction.d.ts +2 -0
- package/dist/cli/sessions/redaction.js +11 -0
- package/dist/cli/sessions/runner/exec.d.ts +108 -0
- package/dist/cli/sessions/runner/exec.js +335 -0
- package/dist/cli/sessions/runner/journal.d.ts +26 -0
- package/dist/cli/sessions/runner/journal.js +49 -0
- package/dist/cli/sessions/runner/native.d.ts +48 -0
- package/dist/cli/sessions/runner/native.js +170 -0
- package/dist/cli/sessions/runner/pod.d.ts +30 -0
- package/dist/cli/sessions/runner/pod.js +129 -0
- package/dist/cli/sessions/runner/serve.d.ts +85 -0
- package/dist/cli/sessions/runner/serve.js +558 -0
- package/dist/cli/sessions/sync.d.ts +47 -0
- package/dist/cli/sessions/sync.js +80 -0
- package/dist/cli/sessions/transport.d.ts +14 -0
- package/dist/cli/sessions/transport.js +116 -0
- package/dist/cli/share.d.ts +15 -0
- package/dist/cli/share.js +139 -0
- package/dist/cli/skill/catalog.d.ts +141 -0
- package/dist/cli/skill/catalog.js +442 -0
- package/dist/cli/skill/files.d.ts +89 -0
- package/dist/cli/skill/files.js +264 -0
- package/dist/cli/skill/index.d.ts +268 -0
- package/dist/cli/skill/index.js +1216 -0
- package/dist/cli/skill/manifest.d.ts +30 -0
- package/dist/cli/skill/manifest.js +101 -0
- package/dist/cli/skill/prefs.d.ts +9 -0
- package/dist/cli/skill/prefs.js +32 -0
- package/dist/cli/skill/reminders.d.ts +15 -0
- package/dist/cli/skill/reminders.js +105 -0
- package/dist/cli/skill/tar.d.ts +17 -0
- package/dist/cli/skill/tar.js +195 -0
- package/dist/cli/snapshot/index.d.ts +24 -0
- package/dist/cli/snapshot/index.js +146 -0
- package/dist/cli/source/access.d.ts +45 -0
- package/dist/cli/source/access.js +563 -0
- package/dist/cli/source/control.d.ts +103 -0
- package/dist/cli/source/control.js +546 -0
- package/dist/cli/source/delete.d.ts +89 -0
- package/dist/cli/source/delete.js +463 -0
- package/dist/cli/source/index.d.ts +288 -0
- package/dist/cli/source/index.js +1348 -0
- package/dist/cli/source/share.d.ts +65 -0
- package/dist/cli/source/share.js +530 -0
- package/dist/cli/source/upload.d.ts +62 -0
- package/dist/cli/source/upload.js +258 -0
- package/dist/cli/source/write.d.ts +77 -0
- package/dist/cli/source/write.js +335 -0
- package/dist/cli/spawn.d.ts +28 -0
- package/dist/cli/spawn.js +81 -0
- package/dist/cli/target.d.ts +22 -0
- package/dist/cli/target.js +85 -0
- package/dist/cli/tasks/index.d.ts +38 -0
- package/dist/cli/tasks/index.js +365 -0
- package/dist/cli/team/index.d.ts +37 -0
- package/dist/cli/team/index.js +407 -0
- package/dist/cli/telemetry.d.ts +23 -0
- package/dist/cli/telemetry.js +262 -0
- package/dist/cli/telemetryJournal.d.ts +26 -0
- package/dist/cli/telemetryJournal.js +104 -0
- package/dist/cli/update/index.d.ts +21 -0
- package/dist/cli/update/index.js +284 -0
- package/dist/cli/upload/index.d.ts +11 -0
- package/dist/cli/upload/index.js +261 -0
- package/dist/cli/upload/kinds.d.ts +10 -0
- package/dist/cli/upload/kinds.js +85 -0
- package/dist/cli/upload/multipart.d.ts +21 -0
- package/dist/cli/upload/multipart.js +248 -0
- package/dist/cli/vault/affected-preview.d.ts +15 -0
- package/dist/cli/vault/affected-preview.js +38 -0
- package/dist/cli/vault/cloud.d.ts +55 -0
- package/dist/cli/vault/cloud.js +287 -0
- package/dist/cli/vault/format.d.ts +18 -0
- package/dist/cli/vault/format.js +104 -0
- package/dist/cli/vault/hostCredentials.d.ts +21 -0
- package/dist/cli/vault/hostCredentials.js +71 -0
- package/dist/cli/vault/hostSupersessions.d.ts +18 -0
- package/dist/cli/vault/hostSupersessions.js +68 -0
- package/dist/cli/vault/import.d.ts +3 -0
- package/dist/cli/vault/import.js +79 -0
- package/dist/cli/vault/index.d.ts +14 -0
- package/dist/cli/vault/index.js +225 -0
- package/dist/cli/vault/keys.d.ts +5 -0
- package/dist/cli/vault/keys.js +165 -0
- package/dist/cli/vault/kms.d.ts +6 -0
- package/dist/cli/vault/kms.js +169 -0
- package/dist/cli/vault/list.d.ts +13 -0
- package/dist/cli/vault/list.js +60 -0
- package/dist/cli/vault/listView.d.ts +21 -0
- package/dist/cli/vault/listView.js +123 -0
- package/dist/cli/vault/managementMetadata.d.ts +2 -0
- package/dist/cli/vault/managementMetadata.js +23 -0
- package/dist/cli/vault/mutations.d.ts +8 -0
- package/dist/cli/vault/mutations.js +151 -0
- package/dist/cli/vault/otp.d.ts +6 -0
- package/dist/cli/vault/otp.js +62 -0
- package/dist/cli/vault/otpIntent.d.ts +23 -0
- package/dist/cli/vault/otpIntent.js +76 -0
- package/dist/cli/vault/passImport.d.ts +25 -0
- package/dist/cli/vault/passImport.js +129 -0
- package/dist/cli/vault/passOtp.d.ts +51 -0
- package/dist/cli/vault/passOtp.js +101 -0
- package/dist/cli/vault/passStore.d.ts +26 -0
- package/dist/cli/vault/passStore.js +134 -0
- package/dist/cli/vault/passwordCommand.d.ts +39 -0
- package/dist/cli/vault/passwordCommand.js +101 -0
- package/dist/cli/vault/passwordProbe.d.ts +27 -0
- package/dist/cli/vault/passwordProbe.js +282 -0
- package/dist/cli/vault/passwordRotation.d.ts +9 -0
- package/dist/cli/vault/passwordRotation.js +273 -0
- package/dist/cli/vault/rotationApi.d.ts +13 -0
- package/dist/cli/vault/rotationApi.js +58 -0
- package/dist/cli/vault/rotationCommand.d.ts +2 -0
- package/dist/cli/vault/rotationCommand.js +75 -0
- package/dist/cli/vault/rotationEngine.d.ts +19 -0
- package/dist/cli/vault/rotationEngine.js +65 -0
- package/dist/cli/vault/rotationHelperSource.d.ts +2 -0
- package/dist/cli/vault/rotationHelperSource.js +3 -0
- package/dist/cli/vault/rotationInput.d.ts +11 -0
- package/dist/cli/vault/rotationInput.js +48 -0
- package/dist/cli/vault/rotationJournal.d.ts +16 -0
- package/dist/cli/vault/rotationJournal.js +183 -0
- package/dist/cli/vault/rotationKeys.d.ts +4 -0
- package/dist/cli/vault/rotationKeys.js +48 -0
- package/dist/cli/vault/rotationPrepare.d.ts +17 -0
- package/dist/cli/vault/rotationPrepare.js +108 -0
- package/dist/cli/vault/rotationRemote.d.ts +33 -0
- package/dist/cli/vault/rotationRemote.js +156 -0
- package/dist/cli/vault/rotationState.d.ts +42 -0
- package/dist/cli/vault/rotationState.js +115 -0
- package/dist/cli/vault/rotationTransport.d.ts +18 -0
- package/dist/cli/vault/rotationTransport.js +71 -0
- package/dist/cli/vault/sshSource.d.ts +18 -0
- package/dist/cli/vault/sshSource.js +196 -0
- package/dist/cli/vault/sshSync.d.ts +17 -0
- package/dist/cli/vault/sshSync.js +224 -0
- package/dist/cli/vault/sshTransfer.d.ts +22 -0
- package/dist/cli/vault/sshTransfer.js +140 -0
- package/dist/cli/vault/terraformState.d.ts +66 -0
- package/dist/cli/vault/terraformState.js +252 -0
- package/dist/cli/vault/terraformStateCommand.d.ts +2 -0
- package/dist/cli/vault/terraformStateCommand.js +61 -0
- package/dist/cli/vault/tree.d.ts +43 -0
- package/dist/cli/vault/tree.js +292 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +9 -0
- package/dist/cli/workflow/index.d.ts +76 -0
- package/dist/cli/workflow/index.js +826 -0
- package/dist/cli/workflow/validate.d.ts +19 -0
- package/dist/cli/workflow/validate.js +353 -0
- package/dist/package.json +1 -0
- package/package.json +28 -10
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// A DreamDB `Backend` that talks to S3 with SigV4-signed requests.
|
|
2
|
+
//
|
|
3
|
+
// The WASM build of @dreamlake/dreamdb deliberately ships no S3 client: the
|
|
4
|
+
// Rust core's one is compiled out, because a browser has neither environment
|
|
5
|
+
// variables nor any business holding credentials. All IO is delegated to a
|
|
6
|
+
// JS-side Backend instead — the package's own note says that on a server you
|
|
7
|
+
// "hand the SDK real credentials via an S3 client". This is that client.
|
|
8
|
+
//
|
|
9
|
+
// (The Python SDK needs no equivalent: its native extension keeps the Rust S3
|
|
10
|
+
// client, so the Python CLI only sets AWS_* and passes a URL.)
|
|
11
|
+
//
|
|
12
|
+
// Credentials come from dreamlake-server's broker
|
|
13
|
+
// (POST .../upload-credentials) and are short-lived and prefix-scoped, so
|
|
14
|
+
// they never touch disk.
|
|
15
|
+
import { AwsClient } from "aws4fetch";
|
|
16
|
+
/**
|
|
17
|
+
* S3 ETags come back quoted (`"abc123"`), but DreamDB hands them straight
|
|
18
|
+
* back as `ifMatch` unquoted. Comparing the two raw forms makes every
|
|
19
|
+
* compare-and-swap fail — and it fails *silently*: the ref simply never
|
|
20
|
+
* advances, and the error only surfaces on the NEXT append as a confusing
|
|
21
|
+
* "it advanced concurrently". Normalize on the way in and out.
|
|
22
|
+
*/
|
|
23
|
+
function unquote(etag) {
|
|
24
|
+
if (!etag)
|
|
25
|
+
return undefined;
|
|
26
|
+
return etag.replace(/^"|"$/g, "");
|
|
27
|
+
}
|
|
28
|
+
export class S3Backend {
|
|
29
|
+
client;
|
|
30
|
+
base;
|
|
31
|
+
/**
|
|
32
|
+
* @param baseUrl path-style dataset base, e.g.
|
|
33
|
+
* `https://s3.us-east-1.amazonaws.com/<bucket>/users/<ns>/<id>`
|
|
34
|
+
*/
|
|
35
|
+
constructor(baseUrl, credentials, region) {
|
|
36
|
+
this.base = baseUrl.replace(/\/+$/, "");
|
|
37
|
+
this.client = new AwsClient({
|
|
38
|
+
accessKeyId: credentials.accessKeyId,
|
|
39
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
40
|
+
// Only pass a session token when there is one (see S3Credentials).
|
|
41
|
+
...(credentials.sessionToken ? { sessionToken: credentials.sessionToken } : {}),
|
|
42
|
+
region,
|
|
43
|
+
service: "s3",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
url(key) {
|
|
47
|
+
return `${this.base}/${key.replace(/^\/+/, "")}`;
|
|
48
|
+
}
|
|
49
|
+
async get(key, range) {
|
|
50
|
+
const headers = {};
|
|
51
|
+
// DreamDB uses [start, end); HTTP Range has an inclusive end.
|
|
52
|
+
if (range)
|
|
53
|
+
headers["Range"] = `bytes=${range.start}-${range.end - 1}`;
|
|
54
|
+
const res = await this.client.fetch(this.url(key), { method: "GET", headers });
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
throw new Error(`GET ${key} → ${res.status} ${await res.text().catch(() => "")}`.slice(0, 300));
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
bytes: new Uint8Array(await res.arrayBuffer()),
|
|
60
|
+
etag: unquote(res.headers.get("etag")),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
async head(key) {
|
|
64
|
+
const res = await this.client.fetch(this.url(key), { method: "HEAD" });
|
|
65
|
+
if (res.status === 404)
|
|
66
|
+
return { exists: false };
|
|
67
|
+
if (!res.ok)
|
|
68
|
+
throw new Error(`HEAD ${key} → ${res.status}`);
|
|
69
|
+
const len = res.headers.get("content-length");
|
|
70
|
+
return {
|
|
71
|
+
exists: true,
|
|
72
|
+
etag: unquote(res.headers.get("etag")),
|
|
73
|
+
size: len ? Number(len) : undefined,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Conditional PUT. DreamDB publishes refs with a compare-and-swap, so the
|
|
78
|
+
* precondition failures are expected control flow, not errors:
|
|
79
|
+
* 412 → someone else advanced the ref → casFailed
|
|
80
|
+
* 412/409 under If-None-Match: * → the object already exists
|
|
81
|
+
*/
|
|
82
|
+
async put(key, bytes, opts = {}) {
|
|
83
|
+
const headers = {};
|
|
84
|
+
if (opts.ifNoneMatchStar)
|
|
85
|
+
headers["If-None-Match"] = "*";
|
|
86
|
+
else if (opts.ifMatch)
|
|
87
|
+
headers["If-Match"] = `"${unquote(opts.ifMatch)}"`;
|
|
88
|
+
const res = await this.client.fetch(this.url(key), {
|
|
89
|
+
method: "PUT",
|
|
90
|
+
headers,
|
|
91
|
+
// aws4fetch signs a BodyInit; a Uint8Array view is passed through as-is.
|
|
92
|
+
body: bytes,
|
|
93
|
+
});
|
|
94
|
+
if (res.status === 412 || res.status === 409) {
|
|
95
|
+
return { status: opts.ifNoneMatchStar ? "exists" : "casFailed" };
|
|
96
|
+
}
|
|
97
|
+
if (!res.ok) {
|
|
98
|
+
throw new Error(`PUT ${key} → ${res.status} ${await res.text().catch(() => "")}`.slice(0, 300));
|
|
99
|
+
}
|
|
100
|
+
return { status: "created", etag: unquote(res.headers.get("etag")) };
|
|
101
|
+
}
|
|
102
|
+
/** Keys under `prefix`, relative to the dataset base (ListObjectsV2). */
|
|
103
|
+
async list(prefix) {
|
|
104
|
+
// The bucket root is one level above the dataset prefix in a path-style
|
|
105
|
+
// URL, so list against the bucket and filter by the full key prefix.
|
|
106
|
+
const u = new URL(this.base);
|
|
107
|
+
const segments = u.pathname.replace(/^\/+|\/+$/g, "").split("/");
|
|
108
|
+
const bucket = segments.shift() ?? "";
|
|
109
|
+
const basePrefix = segments.join("/");
|
|
110
|
+
const full = basePrefix ? `${basePrefix}/${prefix}` : prefix;
|
|
111
|
+
const out = [];
|
|
112
|
+
let token;
|
|
113
|
+
do {
|
|
114
|
+
const q = new URLSearchParams({ "list-type": "2", prefix: full });
|
|
115
|
+
if (token)
|
|
116
|
+
q.set("continuation-token", token);
|
|
117
|
+
const res = await this.client.fetch(`${u.origin}/${bucket}?${q}`, { method: "GET" });
|
|
118
|
+
if (!res.ok)
|
|
119
|
+
throw new Error(`LIST ${prefix} → ${res.status}`);
|
|
120
|
+
const xml = await res.text();
|
|
121
|
+
for (const m of xml.matchAll(/<Key>([^<]+)<\/Key>/g)) {
|
|
122
|
+
const key = m[1];
|
|
123
|
+
out.push(basePrefix ? key.slice(basePrefix.length + 1) : key);
|
|
124
|
+
}
|
|
125
|
+
const more = /<IsTruncated>true<\/IsTruncated>/.test(xml);
|
|
126
|
+
token = more
|
|
127
|
+
? /<NextContinuationToken>([^<]+)<\/NextContinuationToken>/.exec(xml)?.[1]
|
|
128
|
+
: undefined;
|
|
129
|
+
} while (token);
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const DEFAULT_REMOTE: string;
|
|
2
|
+
/** localhost server for `--debug` (a dreamlake-server dev checkout). */
|
|
3
|
+
export declare const LOCAL_REMOTE = "http://localhost:10334";
|
|
4
|
+
/** dreamlake-server base URL. flag > env > materialized > prod. */
|
|
5
|
+
export declare function resolveRemote(flag?: string, dir?: string): string;
|
|
6
|
+
/** Bearer token, or null if unauthenticated. */
|
|
7
|
+
export declare function resolveToken(flag?: string, dir?: string): string | null;
|
|
8
|
+
/** Decode a JWT payload without verifying the signature. Returns {} on failure. */
|
|
9
|
+
export declare function decodeJwtPayload(token: string): Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve the current user's namespace slug:
|
|
12
|
+
* explicit (target @ns) → config.json cache → GET /auth/me → JWT decode.
|
|
13
|
+
*
|
|
14
|
+
* The cache is only trusted when the effective (remote, token) is exactly
|
|
15
|
+
* the materialized pair — under a flag or env-var override it may describe
|
|
16
|
+
* a different environment's account, so we ask the server instead.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveNamespace(explicit: string | null | undefined, opts: {
|
|
19
|
+
token: string;
|
|
20
|
+
remote: string;
|
|
21
|
+
dir?: string;
|
|
22
|
+
}): Promise<string | null>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { identityMode, loadMachineConfig } from "./auth/machine.js";
|
|
2
|
+
// Shared connection config — the READ path, identical to dreamlake-py's
|
|
3
|
+
// `_session.py` so the CLI and the SDK always resolve the same answer:
|
|
4
|
+
//
|
|
5
|
+
// token: flag → DREAMLAKE_API_KEY → ~/.dreamlake/tokens.json → null
|
|
6
|
+
// remote: flag → DREAMLAKE_REMOTE → config.json remote_url → prod
|
|
7
|
+
// namespace: explicit (@ns) → config.json cache → GET /auth/me → JWT decode
|
|
8
|
+
//
|
|
9
|
+
// The multi-env cache (auth.yml) is deliberately absent here — it is a
|
|
10
|
+
// write-path convenience for `env use` and is never consulted to answer
|
|
11
|
+
// "what am I connected to". See auth/materialized.ts.
|
|
12
|
+
//
|
|
13
|
+
// Local dev servers are opt-in via `--debug` or explicit env vars, never
|
|
14
|
+
// a silent default (parity with the SDK, whose default is prod).
|
|
15
|
+
import { BUILTIN_ENVS } from "./auth/credentials.js";
|
|
16
|
+
import { readConfig, readToken } from "./auth/materialized.js";
|
|
17
|
+
export const DEFAULT_REMOTE = BUILTIN_ENVS.prod.server;
|
|
18
|
+
/** localhost server for `--debug` (a dreamlake-server dev checkout). */
|
|
19
|
+
export const LOCAL_REMOTE = "http://localhost:10334";
|
|
20
|
+
function stripTrailingSlash(url) {
|
|
21
|
+
return url.replace(/\/+$/, "");
|
|
22
|
+
}
|
|
23
|
+
/** dreamlake-server base URL. flag > env > materialized > prod. */
|
|
24
|
+
export function resolveRemote(flag, dir) {
|
|
25
|
+
if (identityMode() === "machine") {
|
|
26
|
+
const remote = loadMachineConfig().remote;
|
|
27
|
+
if ((flag && stripTrailingSlash(flag) !== remote) || (process.env.DREAMLAKE_REMOTE && stripTrailingSlash(process.env.DREAMLAKE_REMOTE) !== remote))
|
|
28
|
+
throw new Error("Machine API origin cannot be overridden; select --identity user for personal access");
|
|
29
|
+
return remote;
|
|
30
|
+
}
|
|
31
|
+
const v = flag ||
|
|
32
|
+
process.env.DREAMLAKE_REMOTE ||
|
|
33
|
+
readConfig(dir).remote_url ||
|
|
34
|
+
DEFAULT_REMOTE;
|
|
35
|
+
return stripTrailingSlash(v);
|
|
36
|
+
}
|
|
37
|
+
/** Bearer token, or null if unauthenticated. */
|
|
38
|
+
export function resolveToken(flag, dir) {
|
|
39
|
+
if (identityMode() === "machine")
|
|
40
|
+
throw new Error("Machine identity does not use human bearer tokens. Use dreamlake machine self|host|project, or --identity user for personal commands");
|
|
41
|
+
return flag || process.env.DREAMLAKE_API_KEY || readToken(dir) || null;
|
|
42
|
+
}
|
|
43
|
+
/** Decode a JWT payload without verifying the signature. Returns {} on failure. */
|
|
44
|
+
export function decodeJwtPayload(token) {
|
|
45
|
+
try {
|
|
46
|
+
const part = token.split(".")[1];
|
|
47
|
+
if (!part)
|
|
48
|
+
return {};
|
|
49
|
+
const b64 = part.replace(/-/g, "+").replace(/_/g, "/");
|
|
50
|
+
const json = Buffer.from(b64, "base64").toString("utf8");
|
|
51
|
+
const parsed = JSON.parse(json);
|
|
52
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the current user's namespace slug:
|
|
60
|
+
* explicit (target @ns) → config.json cache → GET /auth/me → JWT decode.
|
|
61
|
+
*
|
|
62
|
+
* The cache is only trusted when the effective (remote, token) is exactly
|
|
63
|
+
* the materialized pair — under a flag or env-var override it may describe
|
|
64
|
+
* a different environment's account, so we ask the server instead.
|
|
65
|
+
*/
|
|
66
|
+
export async function resolveNamespace(explicit, opts) {
|
|
67
|
+
if (explicit)
|
|
68
|
+
return explicit;
|
|
69
|
+
const cfg = readConfig(opts.dir);
|
|
70
|
+
if (cfg.namespace &&
|
|
71
|
+
cfg.remote_url &&
|
|
72
|
+
stripTrailingSlash(cfg.remote_url) === stripTrailingSlash(opts.remote) &&
|
|
73
|
+
readToken(opts.dir) === opts.token) {
|
|
74
|
+
return cfg.namespace;
|
|
75
|
+
}
|
|
76
|
+
// Query server for the authoritative slug.
|
|
77
|
+
try {
|
|
78
|
+
const res = await fetch(`${opts.remote}/auth/me`, {
|
|
79
|
+
headers: { Authorization: `Bearer ${opts.token}` },
|
|
80
|
+
signal: AbortSignal.timeout(5000),
|
|
81
|
+
});
|
|
82
|
+
if (res.ok) {
|
|
83
|
+
const body = (await res.json());
|
|
84
|
+
const slug = body.namespace?.slug;
|
|
85
|
+
if (slug)
|
|
86
|
+
return slug;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// fall through to JWT decode
|
|
91
|
+
}
|
|
92
|
+
// Fallback: decode from JWT (stale but better than nothing).
|
|
93
|
+
const payload = decodeJwtPayload(opts.token);
|
|
94
|
+
const fromJwt = payload.username ?? payload.sub;
|
|
95
|
+
return typeof fromJwt === "string" ? fromJwt : null;
|
|
96
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `manage` is literally `true` in the contract, not `boolean`.
|
|
3
|
+
*
|
|
4
|
+
* That is not a formality. These objects only ever reach a credential manager —
|
|
5
|
+
* a non-manager is told the Connection does not exist rather than handed one
|
|
6
|
+
* with its capabilities switched off — so `manage: false` is not a permission
|
|
7
|
+
* the server can express. A response carrying it is either not from this
|
|
8
|
+
* contract or has lost the field, and a UI reading it would hide the controls
|
|
9
|
+
* from exactly the person entitled to them.
|
|
10
|
+
*
|
|
11
|
+
* `reconnect` was in that group and no longer is. Replace exists to swap a
|
|
12
|
+
* CREDENTIAL, and a Connection whose way in needs none has nothing to swap — so
|
|
13
|
+
* `false` is a real answer the server can give, about a Connection a manager is
|
|
14
|
+
* perfectly entitled to see. Insisting on `true` would refuse it outright.
|
|
15
|
+
*/
|
|
16
|
+
export interface Capabilities {
|
|
17
|
+
manage: true;
|
|
18
|
+
reconnect: boolean;
|
|
19
|
+
disable: boolean;
|
|
20
|
+
enable: boolean;
|
|
21
|
+
delete: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A product's stable id and its display name — likewise for a way in.
|
|
25
|
+
*
|
|
26
|
+
* `id` is what the server routes and compares on; `label` is the only half a
|
|
27
|
+
* person should ever be shown. The CLI printed `connectorKind` and `authKind`,
|
|
28
|
+
* which are those routing values: `s3` names four different products, and
|
|
29
|
+
* `access-key` is a spelling nobody chose.
|
|
30
|
+
*/
|
|
31
|
+
export interface NamedIdentity {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ConnectionSummary {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
connectorKind: string;
|
|
39
|
+
category: string;
|
|
40
|
+
authKind: string;
|
|
41
|
+
/** What this Connection reaches. Printed instead of `connectorKind`. */
|
|
42
|
+
provider: NamedIdentity;
|
|
43
|
+
/** How it gets in. Printed instead of `authKind`. */
|
|
44
|
+
authentication: NamedIdentity;
|
|
45
|
+
lifecycle: "active" | "disabled";
|
|
46
|
+
settingsRevision: number;
|
|
47
|
+
credentialVersion: number;
|
|
48
|
+
affectedSourceCount: number;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
capabilities: Capabilities;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* `configured` is a masked presence projection: which fields are set, and — for
|
|
55
|
+
* the non-secret ones the descriptor marks as safe — what they are set to. Its
|
|
56
|
+
* values are pinned to primitives by the contract, and that pin is enforced
|
|
57
|
+
* here rather than assumed: a nested object is exactly the shape a leaked
|
|
58
|
+
* credential blob would arrive in, and it is refused rather than printed.
|
|
59
|
+
*/
|
|
60
|
+
export interface ConnectionDetail extends ConnectionSummary {
|
|
61
|
+
configured: Record<string, string | number | boolean | null>;
|
|
62
|
+
}
|
|
63
|
+
export interface AffectedSource {
|
|
64
|
+
sourceId: string;
|
|
65
|
+
name: string;
|
|
66
|
+
lifecycle: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* §5's three statuses.
|
|
70
|
+
*
|
|
71
|
+
* `unverified` is not a flavour of `unavailable`. §3.1 requires a `target-bound`
|
|
72
|
+
* connector — `s3` is one — to answer it, because that credential cannot be
|
|
73
|
+
* validated without a target, and the bucket belongs to a Source rather than to
|
|
74
|
+
* the Connection. Reporting it as `unavailable` would send a manager to replace
|
|
75
|
+
* a credential nobody found fault with.
|
|
76
|
+
*
|
|
77
|
+
* This client enumerated two statuses for one slice, following §5's DTO before
|
|
78
|
+
* §5 was corrected to match §3.1, and `connection check` failed for every S3
|
|
79
|
+
* Connection as a result. The vocabulary is transcribed from the contract now,
|
|
80
|
+
* whole.
|
|
81
|
+
*/
|
|
82
|
+
export declare const CHECK_STATUSES: readonly ["available", "unavailable", "unverified"];
|
|
83
|
+
export type CheckStatus = (typeof CHECK_STATUSES)[number];
|
|
84
|
+
export declare const CHECK_REASONS: readonly ["connection-disabled", "upstream-auth-failed", "upstream-forbidden", "upstream-not-found", "upstream-rate-limited", "upstream-timeout", "upstream-unavailable", "target-required", "unknown"];
|
|
85
|
+
export type CheckReason = (typeof CHECK_REASONS)[number];
|
|
86
|
+
export interface CheckResult {
|
|
87
|
+
status: CheckStatus;
|
|
88
|
+
detectedAccess?: "read" | "read-write" | "unknown";
|
|
89
|
+
reason?: CheckReason;
|
|
90
|
+
retryable: boolean;
|
|
91
|
+
checkedAt: string;
|
|
92
|
+
managementHint?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* How many Connections there are, by lifecycle — or `null`.
|
|
96
|
+
*
|
|
97
|
+
* Required and nullable on the wire, and the two mean different things: `null`
|
|
98
|
+
* is the server saying it could not count (the collection is past the cap it
|
|
99
|
+
* will count within), an absent key would be this client guessing. Zero is
|
|
100
|
+
* neither — it is a count.
|
|
101
|
+
*/
|
|
102
|
+
export interface LifecycleCounts {
|
|
103
|
+
all: number;
|
|
104
|
+
active: number;
|
|
105
|
+
disabled: number;
|
|
106
|
+
}
|
|
107
|
+
export interface Page<T> {
|
|
108
|
+
items: T[];
|
|
109
|
+
nextCursor: string | null;
|
|
110
|
+
lifecycleCounts?: LifecycleCounts | null;
|
|
111
|
+
}
|
|
112
|
+
export interface BeginResult {
|
|
113
|
+
operationId: string;
|
|
114
|
+
authorizationUrl: string;
|
|
115
|
+
expiresAt: string;
|
|
116
|
+
}
|
|
117
|
+
export interface OAuthFailure {
|
|
118
|
+
code: string;
|
|
119
|
+
message: string;
|
|
120
|
+
retryable: boolean;
|
|
121
|
+
requestId: string;
|
|
122
|
+
}
|
|
123
|
+
export type OAuthStatus = {
|
|
124
|
+
state: "pending" | "exchanging";
|
|
125
|
+
} | {
|
|
126
|
+
state: "succeeded";
|
|
127
|
+
connection: ConnectionDetail;
|
|
128
|
+
} | {
|
|
129
|
+
state: "failed";
|
|
130
|
+
error: OAuthFailure;
|
|
131
|
+
};
|
|
132
|
+
export declare function isObject(v: unknown): v is Record<string, unknown>;
|
|
133
|
+
export declare function parseSummary(res: unknown, where: string): ConnectionSummary | null;
|
|
134
|
+
export declare function parseDetail(res: unknown, where: string): ConnectionDetail | null;
|
|
135
|
+
export declare function parseAffected(res: unknown, where: string): AffectedSource | null;
|
|
136
|
+
/**
|
|
137
|
+
* A page.
|
|
138
|
+
*
|
|
139
|
+
* `withCounts` is passed only where the contract declares `lifecycleCounts` —
|
|
140
|
+
* the Connection list has it, affected-sources does not — so asking for it is
|
|
141
|
+
* never a guess about which endpoint this is.
|
|
142
|
+
*/
|
|
143
|
+
export declare function parsePage<T>(res: unknown, where: string, item: (raw: unknown, where: string) => T | null, withCounts?: boolean): Page<T> | null;
|
|
144
|
+
export declare function parseCheck(res: unknown, where: string): CheckResult | null;
|
|
145
|
+
export declare function parseBegin(res: unknown, where: string): BeginResult | null;
|
|
146
|
+
/**
|
|
147
|
+
* The operation union, with the invariant enforced at the edge.
|
|
148
|
+
*
|
|
149
|
+
* `succeeded` implies a Connection and `failed` implies an error. Checking that
|
|
150
|
+
* here — rather than in whichever branch happens to render — is what stops a
|
|
151
|
+
* `--json` consumer from being handed `{"state":"succeeded"}` with nothing in
|
|
152
|
+
* it, which is what a silently dropped `connection` looks like on the wire.
|
|
153
|
+
*
|
|
154
|
+
* The failure `code` is NOT checked against a list of known codes. A code this
|
|
155
|
+
* build has never heard of is still the server's stable identity for what went
|
|
156
|
+
* wrong, and refusing to print it would turn a new server-side failure into a
|
|
157
|
+
* client-side one.
|
|
158
|
+
*/
|
|
159
|
+
export declare function parseOAuthStatus(res: unknown, where: string): OAuthStatus | null;
|