@khotan/cli 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/khotan.js +82 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,7 @@ documented surface and the executable surface cannot drift. Run `khotan help` or
|
|
|
124
124
|
| App env | `apps env list <id>`, `apps env set <id> <KEY> --value V`, `apps env reveal <id> <KEY>`, `apps env unset <id> <KEY>`, `apps env bulk-set <id> --var A=1 --var B=2` |
|
|
125
125
|
| Pipelines | same shape as apps under `pipelines …` |
|
|
126
126
|
| Databases | `databases list`, `databases create --name db`, `databases connection <id>`, `databases rotate-credentials <id>`, `databases delete <id>` |
|
|
127
|
+
| Buckets | `buckets list`, `buckets get <id>`, `buckets create --name uploads [--idempotency-key <k>]`, `buckets credentials <id>`, `buckets delete <id>` |
|
|
127
128
|
| Files | `files list`, `files get <id>`, `files upload <path>`, `files download <id> --output <path>`, `files download-url <id>`, `files preview-url <id>`, `files update <id> --name new.txt`, `files delete <id>` |
|
|
128
129
|
| Folders | `folders list`, `folders create --name docs`, `folders rename <id> --name new`, `folders delete <id>` |
|
|
129
130
|
| Context | `context list`, `context get <slug>`, `context raw <slug>`, `context create --title T --kind knowledge --content '...' --folder-id <id>`, `context update <slug> --expected-revision 3 --content '...' --folder-id <id>`, `context delete <slug>` |
|
|
@@ -144,7 +145,7 @@ Each capability has a safety class (`read`, `write`, `destructive`, `secret`):
|
|
|
144
145
|
- **Destructive** commands (`delete`, `env unset`) prompt for confirmation in a
|
|
145
146
|
terminal and **refuse** in non-interactive sessions unless you pass `--yes`.
|
|
146
147
|
- **Secret** values (`env reveal`, `databases connection`,
|
|
147
|
-
`databases rotate-credentials`) are only available via explicit commands and
|
|
148
|
+
`databases rotate-credentials`, `buckets credentials`) are only available via explicit commands and
|
|
148
149
|
are never included in list/table output.
|
|
149
150
|
|
|
150
151
|
### File transfer
|
package/dist/khotan.js
CHANGED
|
@@ -415,7 +415,7 @@ var idField = (name, description) => ({
|
|
|
415
415
|
type: "string",
|
|
416
416
|
required: true,
|
|
417
417
|
description
|
|
418
|
-
}), article = (noun) => /^[aeiou]/i.test(noun) ? "an" : "a", identityCapabilities, databaseCapabilities, redisCapabilities, fileCapabilities, folderCapabilities, contextCapabilities, appsCapabilities, pipelinesCapabilities, oauthLifecycleCapabilities, integrationsCapabilities, emailSubscriptionCapabilities, projectCapabilities, capabilities, khotanCatalog, capabilitiesById;
|
|
418
|
+
}), article = (noun) => /^[aeiou]/i.test(noun) ? "an" : "a", identityCapabilities, databaseCapabilities, redisCapabilities, bucketCapabilities, fileCapabilities, folderCapabilities, contextCapabilities, appsCapabilities, pipelinesCapabilities, oauthLifecycleCapabilities, integrationsCapabilities, emailSubscriptionCapabilities, projectCapabilities, capabilities, khotanCatalog, capabilitiesById;
|
|
419
419
|
var init_catalog = __esm(() => {
|
|
420
420
|
init_version();
|
|
421
421
|
identityCapabilities = [
|
|
@@ -708,6 +708,85 @@ var init_catalog = __esm(() => {
|
|
|
708
708
|
cli: { command: ["redis", "connection"], summary: "Get Redis connection credentials (secret)", defaultOutput: "raw" }
|
|
709
709
|
}
|
|
710
710
|
];
|
|
711
|
+
bucketCapabilities = [
|
|
712
|
+
{
|
|
713
|
+
id: "buckets.list",
|
|
714
|
+
domain: "buckets",
|
|
715
|
+
safety: "read",
|
|
716
|
+
auth: true,
|
|
717
|
+
title: "List storage buckets",
|
|
718
|
+
description: "List the organization's storage buckets (no credentials).",
|
|
719
|
+
input: [],
|
|
720
|
+
http: { method: "GET", path: "/api/v1/buckets", operationId: "listBuckets" },
|
|
721
|
+
cli: { command: ["buckets", "list"], summary: "List storage buckets", defaultOutput: "table" }
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
id: "buckets.get",
|
|
725
|
+
domain: "buckets",
|
|
726
|
+
safety: "read",
|
|
727
|
+
auth: true,
|
|
728
|
+
title: "Get a storage bucket",
|
|
729
|
+
description: "Get one storage bucket by id, including status and failure state (no credentials).",
|
|
730
|
+
input: [idField("bucketId", "The bucket id.")],
|
|
731
|
+
http: { method: "GET", path: "/api/v1/buckets/{bucketId}", operationId: "getBucket" },
|
|
732
|
+
cli: { command: ["buckets", "get"], summary: "Get a storage bucket", defaultOutput: "detail" }
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
id: "buckets.create",
|
|
736
|
+
domain: "buckets",
|
|
737
|
+
safety: "write",
|
|
738
|
+
auth: true,
|
|
739
|
+
title: "Create a storage bucket",
|
|
740
|
+
description: "Provision a Khotan-managed storage bucket: a private folder subtree in the organization's file storage, reached through the Files API with a scoped key. Provisioning is synchronous; branch on the returned status (ready or failed). Pass --idempotency-key to make retries safe — the same key returns the original bucket instead of creating a second one.",
|
|
741
|
+
input: [
|
|
742
|
+
{ name: "name", location: "body", type: "string", required: true, description: "The bucket name (1-63 characters)." },
|
|
743
|
+
{
|
|
744
|
+
name: "idempotencyKey",
|
|
745
|
+
location: "body",
|
|
746
|
+
type: "string",
|
|
747
|
+
description: "Optional client-chosen key; a retry with the same key returns the original bucket."
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
http: { method: "POST", path: "/api/v1/buckets", operationId: "createBucket", bodyMode: "json" },
|
|
751
|
+
cli: {
|
|
752
|
+
command: ["buckets", "create"],
|
|
753
|
+
summary: "Create a storage bucket",
|
|
754
|
+
defaultOutput: "detail",
|
|
755
|
+
examples: ["khotan buckets create --name uploads --idempotency-key deploy-42"]
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
id: "buckets.delete",
|
|
760
|
+
domain: "buckets",
|
|
761
|
+
safety: "destructive",
|
|
762
|
+
auth: true,
|
|
763
|
+
title: "Delete a storage bucket",
|
|
764
|
+
description: "Permanently delete a storage bucket: empties its folder subtree, revokes its scoped credentials, then removes the record. Fails if deletion protection is enabled; remove protection from the dashboard first.",
|
|
765
|
+
input: [idField("bucketId", "The bucket id.")],
|
|
766
|
+
http: { method: "DELETE", path: "/api/v1/buckets/{bucketId}", operationId: "deleteBucket" },
|
|
767
|
+
cli: { command: ["buckets", "delete"], summary: "Delete a storage bucket" }
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
id: "buckets.credentials",
|
|
771
|
+
domain: "buckets",
|
|
772
|
+
safety: "secret",
|
|
773
|
+
auth: true,
|
|
774
|
+
title: "Issue storage bucket credentials (secret)",
|
|
775
|
+
description: "Issue a folder-scoped API key for the bucket and return its secret once. The key acts only through the Files API and only within the bucket's folder subtree. Each call rotates the credential: any previously issued key for this bucket is revoked. Secret-bearing; explicit-only.",
|
|
776
|
+
input: [idField("bucketId", "The bucket id.")],
|
|
777
|
+
http: {
|
|
778
|
+
method: "POST",
|
|
779
|
+
path: "/api/v1/buckets/{bucketId}/credentials",
|
|
780
|
+
operationId: "issueBucketCredentials",
|
|
781
|
+
bodyMode: "none"
|
|
782
|
+
},
|
|
783
|
+
cli: {
|
|
784
|
+
command: ["buckets", "credentials"],
|
|
785
|
+
summary: "Issue storage bucket credentials (secret)",
|
|
786
|
+
defaultOutput: "raw"
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
];
|
|
711
790
|
fileCapabilities = [
|
|
712
791
|
{
|
|
713
792
|
id: "files.list",
|
|
@@ -1491,6 +1570,7 @@ var init_catalog = __esm(() => {
|
|
|
1491
1570
|
...integrationsCapabilities,
|
|
1492
1571
|
...databaseCapabilities,
|
|
1493
1572
|
...redisCapabilities,
|
|
1573
|
+
...bucketCapabilities,
|
|
1494
1574
|
...folderCapabilities,
|
|
1495
1575
|
...projectCapabilities,
|
|
1496
1576
|
...emailSubscriptionCapabilities
|
|
@@ -1551,6 +1631,7 @@ var init_reference = __esm(() => {
|
|
|
1551
1631
|
pipelines: "Pipelines",
|
|
1552
1632
|
databases: "Databases",
|
|
1553
1633
|
redis: "Redis (KV)",
|
|
1634
|
+
buckets: "Storage buckets",
|
|
1554
1635
|
files: "Files",
|
|
1555
1636
|
folders: "Folders",
|
|
1556
1637
|
context: "Context documents",
|