@opvs-ai/cli 0.7.5 → 0.11.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/dist/commands/agent.js +20 -10
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/auth.js +16 -4
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/board-links.js +9 -6
- package/dist/commands/board-links.js.map +1 -1
- package/dist/commands/boards.js +18 -1
- package/dist/commands/boards.js.map +1 -1
- package/dist/commands/comments.js +8 -1
- package/dist/commands/comments.js.map +1 -1
- package/dist/commands/employees.d.ts +28 -0
- package/dist/commands/employees.js +405 -0
- package/dist/commands/employees.js.map +1 -0
- package/dist/commands/files.js +22 -0
- package/dist/commands/files.js.map +1 -1
- package/dist/commands/links.js +70 -0
- package/dist/commands/links.js.map +1 -1
- package/dist/commands/metrics.js +2 -2
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/projects.js +1 -1
- package/dist/commands/projects.js.map +1 -1
- package/dist/commands/session.js +1 -1
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/stages.js +51 -1
- package/dist/commands/stages.js.map +1 -1
- package/dist/commands/tasks.js +113 -13
- package/dist/commands/tasks.js.map +1 -1
- package/dist/commands/views.js +5 -1
- package/dist/commands/views.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/api-url.d.ts +37 -0
- package/dist/lib/api-url.js +42 -0
- package/dist/lib/api-url.js.map +1 -0
- package/dist/lib/pagination.d.ts +33 -0
- package/dist/lib/pagination.js +41 -0
- package/dist/lib/pagination.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination helpers.
|
|
3
|
+
*
|
|
4
|
+
* Two upstream families sit behind the CLI and they do NOT agree on a
|
|
5
|
+
* parameter name:
|
|
6
|
+
*
|
|
7
|
+
* - AgentBoard list endpoints (`GET /boards/{id}/tasks`,
|
|
8
|
+
* `GET /agents/{id}/tasks`) paginate with `page` + `per_page`.
|
|
9
|
+
* - Main-API endpoints (`/board/agent-api/my-tasks`, `/docs/*`,
|
|
10
|
+
* `/employees/*`, `/professions/*`) paginate with `skip` + `limit`.
|
|
11
|
+
*
|
|
12
|
+
* A `?limit=` sent to the first family is an *unknown* query param, so FastAPI
|
|
13
|
+
* drops it silently and serves the endpoint default (100). That is CLI-1
|
|
14
|
+
* (`OSI-37`): `--limit 3` returned 100 rows because nothing rejected the flag,
|
|
15
|
+
* it simply never arrived. Route every `--limit` through `clampLimit()` and
|
|
16
|
+
* write it under the name the specific upstream actually reads.
|
|
17
|
+
*
|
|
18
|
+
* Clamping is the CLI's job because the upstreams declare hard `le=` bounds and
|
|
19
|
+
* answer 422 above them — `--limit 250` should give you the maximum page, not
|
|
20
|
+
* a validation error.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Normalise a user-supplied `--limit` / `--page` value for an upstream that
|
|
24
|
+
* bounds it server-side.
|
|
25
|
+
*
|
|
26
|
+
* @param raw the commander option value (a string, or undefined when omitted)
|
|
27
|
+
* @param max the upstream's declared maximum (its `le=` bound)
|
|
28
|
+
* @param min the upstream's declared minimum (its `ge=` bound), default 1
|
|
29
|
+
* @returns the clamped value as a string, or `undefined` when the flag was
|
|
30
|
+
* omitted or unparseable — callers must then send no param at all and
|
|
31
|
+
* let the upstream apply its own default.
|
|
32
|
+
*/
|
|
33
|
+
export declare function clampLimit(raw: string | number | undefined, max: number, min?: number): string | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination helpers.
|
|
3
|
+
*
|
|
4
|
+
* Two upstream families sit behind the CLI and they do NOT agree on a
|
|
5
|
+
* parameter name:
|
|
6
|
+
*
|
|
7
|
+
* - AgentBoard list endpoints (`GET /boards/{id}/tasks`,
|
|
8
|
+
* `GET /agents/{id}/tasks`) paginate with `page` + `per_page`.
|
|
9
|
+
* - Main-API endpoints (`/board/agent-api/my-tasks`, `/docs/*`,
|
|
10
|
+
* `/employees/*`, `/professions/*`) paginate with `skip` + `limit`.
|
|
11
|
+
*
|
|
12
|
+
* A `?limit=` sent to the first family is an *unknown* query param, so FastAPI
|
|
13
|
+
* drops it silently and serves the endpoint default (100). That is CLI-1
|
|
14
|
+
* (`OSI-37`): `--limit 3` returned 100 rows because nothing rejected the flag,
|
|
15
|
+
* it simply never arrived. Route every `--limit` through `clampLimit()` and
|
|
16
|
+
* write it under the name the specific upstream actually reads.
|
|
17
|
+
*
|
|
18
|
+
* Clamping is the CLI's job because the upstreams declare hard `le=` bounds and
|
|
19
|
+
* answer 422 above them — `--limit 250` should give you the maximum page, not
|
|
20
|
+
* a validation error.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Normalise a user-supplied `--limit` / `--page` value for an upstream that
|
|
24
|
+
* bounds it server-side.
|
|
25
|
+
*
|
|
26
|
+
* @param raw the commander option value (a string, or undefined when omitted)
|
|
27
|
+
* @param max the upstream's declared maximum (its `le=` bound)
|
|
28
|
+
* @param min the upstream's declared minimum (its `ge=` bound), default 1
|
|
29
|
+
* @returns the clamped value as a string, or `undefined` when the flag was
|
|
30
|
+
* omitted or unparseable — callers must then send no param at all and
|
|
31
|
+
* let the upstream apply its own default.
|
|
32
|
+
*/
|
|
33
|
+
export function clampLimit(raw, max, min = 1) {
|
|
34
|
+
if (raw === undefined || raw === null || raw === "")
|
|
35
|
+
return undefined;
|
|
36
|
+
const n = typeof raw === "number" ? raw : Number.parseInt(raw, 10);
|
|
37
|
+
if (!Number.isFinite(n))
|
|
38
|
+
return undefined;
|
|
39
|
+
return String(Math.max(min, Math.min(max, Math.trunc(n))));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/lib/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CACxB,GAAgC,EAChC,GAAW,EACX,GAAG,GAAG,CAAC;IAEP,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|