run402 4.159.3 → 4.160.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/lib/assets.mjs +12 -7
- package/package.json +1 -1
- package/vault-surface.json +1 -1
package/lib/assets.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Usage:
|
|
5
5
|
* run402 assets put <file> [files...] [--project <project_id>] [--key <dest>] [--content-type <mime>] [--private] [--immutable] [--stream]
|
|
6
6
|
* run402 assets get <key> --output <file> [--project <project_id>]
|
|
7
|
-
* run402 assets ls [--project <project_id>] [--prefix <p>] [--limit <n>]
|
|
7
|
+
* run402 assets ls [--project <project_id>] [--prefix <p>] [--limit <n>] [--cursor <c>]
|
|
8
8
|
* run402 assets rm <key> [--project <project_id>]
|
|
9
9
|
* run402 assets sign <key> [keys...] [--project <project_id>] [--ttl <seconds>] [--variant <kind>[,<kind>...]]
|
|
10
10
|
*
|
|
@@ -52,6 +52,7 @@ Options:
|
|
|
52
52
|
printed.
|
|
53
53
|
--prefix <p> Prefix filter (ls only)
|
|
54
54
|
--limit <n> Max results (ls only; default 100, max 1000)
|
|
55
|
+
--cursor <c> ls only: the next_cursor of the previous page, echoed as is.
|
|
55
56
|
--sort <key> v1.50 ls only: key:asc | createdAt:asc | createdAt:desc (default key:asc).
|
|
56
57
|
--filter <k=v> v1.50 ls only: media-picker filter (repeatable). Keys: uploaded_by, tag,
|
|
57
58
|
format, is_image, min_width, max_width, min_height, max_height.
|
|
@@ -132,6 +133,8 @@ Options:
|
|
|
132
133
|
--project <project_id> Project ID (defaults to active project)
|
|
133
134
|
--prefix <p> Only list keys starting with this prefix
|
|
134
135
|
--limit <n> Max results (default 100, max 1000)
|
|
136
|
+
--cursor <c> Next page: pass the previous page's next_cursor unchanged
|
|
137
|
+
(opaque). Repeat while has_more is true.
|
|
135
138
|
--sort <key> v1.50: key:asc (default) | createdAt:asc | createdAt:desc.
|
|
136
139
|
Cursor is sort-pinned — a cursor reused under another sort returns
|
|
137
140
|
the first page with "reset": true.
|
|
@@ -144,6 +147,7 @@ Options:
|
|
|
144
147
|
Examples:
|
|
145
148
|
run402 assets ls --project prj_abc123
|
|
146
149
|
run402 assets ls --project prj_abc123 --prefix images/ --limit 500
|
|
150
|
+
run402 assets ls --project prj_abc123 --prefix images/ --limit 1000 --cursor <next_cursor>
|
|
147
151
|
run402 assets ls --project prj_abc123 --sort createdAt:desc --filter is_image=true --filter min_width=320
|
|
148
152
|
run402 assets ls --project prj_abc123 --filter uploaded_by=agent_abc --filter tag=hero
|
|
149
153
|
`,
|
|
@@ -232,7 +236,7 @@ function parseArgs(rawArgs) {
|
|
|
232
236
|
const valueFlags = [
|
|
233
237
|
"--project", "--key", "--content-type", "--prefix",
|
|
234
238
|
"--limit", "--output", "-o", "--ttl", "--variant",
|
|
235
|
-
"--meta", "--exif-policy", "--sort", "--filter",
|
|
239
|
+
"--meta", "--exif-policy", "--sort", "--filter", "--cursor",
|
|
236
240
|
];
|
|
237
241
|
assertKnownFlags(args, [
|
|
238
242
|
"--project",
|
|
@@ -251,13 +255,14 @@ function parseArgs(rawArgs) {
|
|
|
251
255
|
"--exif-policy",
|
|
252
256
|
"--sort",
|
|
253
257
|
"--filter",
|
|
258
|
+
"--cursor",
|
|
254
259
|
"--help",
|
|
255
260
|
"-h",
|
|
256
261
|
], valueFlags);
|
|
257
262
|
const out = { positional: [], project: null, key: null, private: false, immutable: false,
|
|
258
263
|
stream: false, prefix: null, limit: null,
|
|
259
264
|
output: null, ttl: null, variant: null, contentType: null,
|
|
260
|
-
metadata: null, exifPolicy: null, sort: null, filter: null };
|
|
265
|
+
metadata: null, exifPolicy: null, sort: null, filter: null, cursor: null };
|
|
261
266
|
for (let i = 0; i < args.length; i++) {
|
|
262
267
|
const a = args[i];
|
|
263
268
|
if (a === "--project") out.project = args[++i];
|
|
@@ -281,6 +286,7 @@ function parseArgs(rawArgs) {
|
|
|
281
286
|
}
|
|
282
287
|
else if (a === "--exif-policy") out.exifPolicy = parseExifPolicyFlag(args[++i]);
|
|
283
288
|
// ls --sort and repeatable --filter k=v.
|
|
289
|
+
else if (a === "--cursor") out.cursor = args[++i];
|
|
284
290
|
else if (a === "--sort") out.sort = parseSortFlag(args[++i]);
|
|
285
291
|
else if (a === "--filter") {
|
|
286
292
|
if (out.filter === null) out.filter = {};
|
|
@@ -532,10 +538,9 @@ async function ls(argv) {
|
|
|
532
538
|
const data = await getSdk().assets.ls(resolvedId, {
|
|
533
539
|
prefix: opts.prefix ?? undefined,
|
|
534
540
|
limit: opts.limit ?? undefined,
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
|
|
538
|
-
// separate `--cursor` flag here yet.
|
|
541
|
+
// The cursor is opaque and the gateway's: forwarded unchanged, and an
|
|
542
|
+
// unusable one comes back as the first page with `reset: true`.
|
|
543
|
+
...(opts.cursor ? { cursor: opts.cursor } : {}),
|
|
539
544
|
...(opts.sort ? { sort: opts.sort } : {}),
|
|
540
545
|
...(opts.filter ? { filter: opts.filter } : {}),
|
|
541
546
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.160.0",
|
|
4
4
|
"description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/vault-surface.json
CHANGED