@revos/cli 0.1.4 → 0.2.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 +59 -0
- package/dist/adapters/oclif/commands/action-runs/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/action-runs/get.mjs +8 -0
- package/dist/adapters/oclif/commands/action-runs/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/action-runs/list.mjs +8 -0
- package/dist/adapters/oclif/commands/actions/get-input-schema.d.mts +6 -0
- package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +23 -0
- package/dist/adapters/oclif/commands/actions/get-params-schema.d.mts +6 -0
- package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +23 -0
- package/dist/adapters/oclif/commands/actions/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/actions/get.mjs +8 -0
- package/dist/adapters/oclif/commands/actions/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/actions/list.mjs +27 -0
- package/dist/adapters/oclif/commands/ai-instructions/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/ai-instructions/create.mjs +8 -0
- package/dist/adapters/oclif/commands/ai-instructions/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/ai-instructions/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/ai-instructions/get.mjs +8 -0
- package/dist/adapters/oclif/commands/ai-instructions/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/ai-instructions/list.mjs +8 -0
- package/dist/adapters/oclif/commands/ai-instructions/update.d.mts +6 -0
- package/dist/adapters/oclif/commands/ai-instructions/update.mjs +8 -0
- package/dist/adapters/oclif/commands/auth/login.d.mts +2 -2
- package/dist/adapters/oclif/commands/auth/logout.d.mts +1 -1
- package/dist/adapters/oclif/commands/auth/status.d.mts +2 -2
- package/dist/adapters/oclif/commands/gservice-account-keys/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +8 -0
- package/dist/adapters/oclif/commands/gservice-account-keys/reveal.d.mts +6 -0
- package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +14 -0
- package/dist/adapters/oclif/commands/gservice-accounts/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +8 -0
- package/dist/adapters/oclif/commands/gservice-accounts/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/gservice-accounts/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +8 -0
- package/dist/adapters/oclif/commands/gservice-accounts/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +8 -0
- package/dist/adapters/oclif/commands/init.d.mts +1 -1
- package/dist/adapters/oclif/commands/org/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/org/create.mjs +8 -0
- package/dist/adapters/oclif/commands/org/current.d.mts +2 -2
- package/dist/adapters/oclif/commands/org/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/org/get.mjs +8 -0
- package/dist/adapters/oclif/commands/org/list.d.mts +2 -2
- package/dist/adapters/oclif/commands/org/switch.d.mts +1 -1
- package/dist/adapters/oclif/commands/overlays/diff.d.mts +2 -2
- package/dist/adapters/oclif/commands/overlays/pull.d.mts +2 -2
- package/dist/adapters/oclif/commands/overlays/push.d.mts +2 -2
- package/dist/adapters/oclif/commands/overlays/status.d.mts +2 -2
- package/dist/adapters/oclif/commands/score-groups/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/score-groups/create.mjs +8 -0
- package/dist/adapters/oclif/commands/score-groups/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/score-groups/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/score-groups/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/score-groups/get.mjs +8 -0
- package/dist/adapters/oclif/commands/score-groups/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/score-groups/list.mjs +8 -0
- package/dist/adapters/oclif/commands/score-groups/update.d.mts +6 -0
- package/dist/adapters/oclif/commands/score-groups/update.mjs +8 -0
- package/dist/adapters/oclif/commands/scores/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/scores/create.mjs +8 -0
- package/dist/adapters/oclif/commands/scores/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/scores/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/scores/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/scores/list.mjs +8 -0
- package/dist/adapters/oclif/commands/scores/update.d.mts +6 -0
- package/dist/adapters/oclif/commands/scores/update.mjs +8 -0
- package/dist/adapters/oclif/commands/segments/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/create.mjs +8 -0
- package/dist/adapters/oclif/commands/segments/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/segments/evaluate.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/evaluate.mjs +14 -0
- package/dist/adapters/oclif/commands/segments/get-evaluation-history.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +14 -0
- package/dist/adapters/oclif/commands/segments/get-version.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/get-version.mjs +23 -0
- package/dist/adapters/oclif/commands/segments/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/get.mjs +8 -0
- package/dist/adapters/oclif/commands/segments/list-versions.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/list-versions.mjs +29 -0
- package/dist/adapters/oclif/commands/segments/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/list.mjs +8 -0
- package/dist/adapters/oclif/commands/segments/restore-version.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/restore-version.mjs +23 -0
- package/dist/adapters/oclif/commands/segments/update.d.mts +6 -0
- package/dist/adapters/oclif/commands/segments/update.mjs +8 -0
- package/dist/adapters/oclif/commands/table-views/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/table-views/create.mjs +8 -0
- package/dist/adapters/oclif/commands/table-views/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/table-views/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/table-views/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/table-views/list.mjs +8 -0
- package/dist/adapters/oclif/commands/table-views/update.d.mts +6 -0
- package/dist/adapters/oclif/commands/table-views/update.mjs +8 -0
- package/dist/adapters/oclif/commands/tables/create.d.mts +6 -0
- package/dist/adapters/oclif/commands/tables/create.mjs +8 -0
- package/dist/adapters/oclif/commands/tables/delete.d.mts +6 -0
- package/dist/adapters/oclif/commands/tables/delete.mjs +8 -0
- package/dist/adapters/oclif/commands/tables/get.d.mts +6 -0
- package/dist/adapters/oclif/commands/tables/get.mjs +8 -0
- package/dist/adapters/oclif/commands/tables/list.d.mts +6 -0
- package/dist/adapters/oclif/commands/tables/list.mjs +8 -0
- package/dist/adapters/oclif/commands/tables/update.d.mts +6 -0
- package/dist/adapters/oclif/commands/tables/update.mjs +8 -0
- package/dist/factory-D9sR_S_g.mjs +90 -0
- package/dist/{index-B8n2GxTc.d.mts → index-KAzwt5vr.d.mts} +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/presets-Cvazkjmu.mjs +98 -0
- package/package.json +2 -2
- /package/dist/{base.command-BjFWMIzL.d.mts → base.command-d7VW6WTp.d.mts} +0 -0
- /package/dist/{types-DmuJzN0Z.d.mts → types-C_p_6rkj.d.mts} +0 -0
- /package/dist/{types-DsQtGF-c.d.mts → types-Y_ht_ja5.d.mts} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { m as unwrap } from "./core-gKJ_V-K5.mjs";
|
|
2
|
+
import { n as defineApiCommand, t as bodyFlag } from "./factory-D9sR_S_g.mjs";
|
|
3
|
+
import { Args, Flags } from "@oclif/core";
|
|
4
|
+
//#region src/adapters/oclif/presets.ts
|
|
5
|
+
const listFlags = {
|
|
6
|
+
"page-size": Flags.integer({ description: "Maximum number of items to return" }),
|
|
7
|
+
"page-token": Flags.string({ description: "Token for the next page (from previous response)" }),
|
|
8
|
+
"order-by": Flags.string({ description: "Field to order results by (e.g. 'createdAt desc')" }),
|
|
9
|
+
filter: Flags.string({ description: "Filter expression" }),
|
|
10
|
+
fields: Flags.string({ description: "Comma-separated list of fields to include" })
|
|
11
|
+
};
|
|
12
|
+
function getResource(api, key) {
|
|
13
|
+
return api[key];
|
|
14
|
+
}
|
|
15
|
+
function listCommand(spec) {
|
|
16
|
+
return defineApiCommand({
|
|
17
|
+
description: spec.description,
|
|
18
|
+
flags: listFlags,
|
|
19
|
+
call: async ({ api, flags }) => {
|
|
20
|
+
const resource = getResource(api, spec.resource);
|
|
21
|
+
if (!resource.list) throw new Error(`Resource '${String(spec.resource)}' has no list method`);
|
|
22
|
+
const params = {};
|
|
23
|
+
if (flags["page-size"] !== void 0) params.pageSize = flags["page-size"];
|
|
24
|
+
if (flags["page-token"] !== void 0) params.pageToken = flags["page-token"];
|
|
25
|
+
if (flags["order-by"] !== void 0) params.orderBy = flags["order-by"];
|
|
26
|
+
if (flags.filter !== void 0) params.filter = flags.filter;
|
|
27
|
+
if (flags.fields !== void 0) params.fields = flags.fields;
|
|
28
|
+
return unwrap(await resource.list(Object.keys(params).length > 0 ? params : void 0));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function getCommand(spec) {
|
|
33
|
+
return defineApiCommand({
|
|
34
|
+
description: spec.description,
|
|
35
|
+
args: { id: Args.string({
|
|
36
|
+
description: "Resource ID",
|
|
37
|
+
required: true
|
|
38
|
+
}) },
|
|
39
|
+
call: async ({ api, args }) => {
|
|
40
|
+
const resource = getResource(api, spec.resource);
|
|
41
|
+
if (!resource.get) throw new Error(`Resource '${String(spec.resource)}' has no get method`);
|
|
42
|
+
return unwrap(await resource.get({ id: args.id }));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function createCommand(spec) {
|
|
47
|
+
return defineApiCommand({
|
|
48
|
+
description: spec.description,
|
|
49
|
+
flags: { body: bodyFlag },
|
|
50
|
+
call: async ({ api, body }) => {
|
|
51
|
+
const resource = getResource(api, spec.resource);
|
|
52
|
+
if (!resource.create) throw new Error(`Resource '${String(spec.resource)}' has no create method`);
|
|
53
|
+
if (body === void 0) throw new Error("--body is required (inline JSON, '@path' for file, or '-' for stdin)");
|
|
54
|
+
return unwrap(await resource.create({ body }));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function updateCommand(spec) {
|
|
59
|
+
return defineApiCommand({
|
|
60
|
+
description: spec.description,
|
|
61
|
+
args: { id: Args.string({
|
|
62
|
+
description: "Resource ID",
|
|
63
|
+
required: true
|
|
64
|
+
}) },
|
|
65
|
+
flags: { body: bodyFlag },
|
|
66
|
+
call: async ({ api, args, body }) => {
|
|
67
|
+
const resource = getResource(api, spec.resource);
|
|
68
|
+
if (!resource.update) throw new Error(`Resource '${String(spec.resource)}' has no update method`);
|
|
69
|
+
if (body === void 0) throw new Error("--body is required (inline JSON, '@path' for file, or '-' for stdin)");
|
|
70
|
+
return unwrap(await resource.update({
|
|
71
|
+
id: args.id,
|
|
72
|
+
body
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function deleteCommand(spec) {
|
|
78
|
+
return defineApiCommand({
|
|
79
|
+
description: spec.description,
|
|
80
|
+
args: { id: Args.string({
|
|
81
|
+
description: "Resource ID",
|
|
82
|
+
required: true
|
|
83
|
+
}) },
|
|
84
|
+
call: async ({ api, args }) => {
|
|
85
|
+
const resource = getResource(api, spec.resource);
|
|
86
|
+
if (!resource.delete) throw new Error(`Resource '${String(spec.resource)}' has no delete method`);
|
|
87
|
+
return unwrap(await resource.delete({ id: args.id })) ?? {
|
|
88
|
+
id: args.id,
|
|
89
|
+
deleted: true
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
render: (_data, command) => {
|
|
93
|
+
command.log(`Deleted.`);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { updateCommand as a, listCommand as i, deleteCommand as n, getCommand as r, createCommand as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revos/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "RevOS CLI for managing RevOS platform resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"jest": "^29.7.0",
|
|
58
58
|
"tsdown": "^0.21.9",
|
|
59
59
|
"typescript": "^5.7.2",
|
|
60
|
-
"@
|
|
60
|
+
"@revos/config-eslint": "0.0.0"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"registry": "https://registry.npmjs.org",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|