@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.
Files changed (114) hide show
  1. package/README.md +59 -0
  2. package/dist/adapters/oclif/commands/action-runs/get.d.mts +6 -0
  3. package/dist/adapters/oclif/commands/action-runs/get.mjs +8 -0
  4. package/dist/adapters/oclif/commands/action-runs/list.d.mts +6 -0
  5. package/dist/adapters/oclif/commands/action-runs/list.mjs +8 -0
  6. package/dist/adapters/oclif/commands/actions/get-input-schema.d.mts +6 -0
  7. package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +23 -0
  8. package/dist/adapters/oclif/commands/actions/get-params-schema.d.mts +6 -0
  9. package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +23 -0
  10. package/dist/adapters/oclif/commands/actions/get.d.mts +6 -0
  11. package/dist/adapters/oclif/commands/actions/get.mjs +8 -0
  12. package/dist/adapters/oclif/commands/actions/list.d.mts +6 -0
  13. package/dist/adapters/oclif/commands/actions/list.mjs +27 -0
  14. package/dist/adapters/oclif/commands/ai-instructions/create.d.mts +6 -0
  15. package/dist/adapters/oclif/commands/ai-instructions/create.mjs +8 -0
  16. package/dist/adapters/oclif/commands/ai-instructions/delete.d.mts +6 -0
  17. package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +8 -0
  18. package/dist/adapters/oclif/commands/ai-instructions/get.d.mts +6 -0
  19. package/dist/adapters/oclif/commands/ai-instructions/get.mjs +8 -0
  20. package/dist/adapters/oclif/commands/ai-instructions/list.d.mts +6 -0
  21. package/dist/adapters/oclif/commands/ai-instructions/list.mjs +8 -0
  22. package/dist/adapters/oclif/commands/ai-instructions/update.d.mts +6 -0
  23. package/dist/adapters/oclif/commands/ai-instructions/update.mjs +8 -0
  24. package/dist/adapters/oclif/commands/auth/login.d.mts +2 -2
  25. package/dist/adapters/oclif/commands/auth/logout.d.mts +1 -1
  26. package/dist/adapters/oclif/commands/auth/status.d.mts +2 -2
  27. package/dist/adapters/oclif/commands/gservice-account-keys/get.d.mts +6 -0
  28. package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +8 -0
  29. package/dist/adapters/oclif/commands/gservice-account-keys/reveal.d.mts +6 -0
  30. package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +14 -0
  31. package/dist/adapters/oclif/commands/gservice-accounts/create.d.mts +6 -0
  32. package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +8 -0
  33. package/dist/adapters/oclif/commands/gservice-accounts/delete.d.mts +6 -0
  34. package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +8 -0
  35. package/dist/adapters/oclif/commands/gservice-accounts/get.d.mts +6 -0
  36. package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +8 -0
  37. package/dist/adapters/oclif/commands/gservice-accounts/list.d.mts +6 -0
  38. package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +8 -0
  39. package/dist/adapters/oclif/commands/init.d.mts +1 -1
  40. package/dist/adapters/oclif/commands/org/create.d.mts +6 -0
  41. package/dist/adapters/oclif/commands/org/create.mjs +8 -0
  42. package/dist/adapters/oclif/commands/org/current.d.mts +2 -2
  43. package/dist/adapters/oclif/commands/org/get.d.mts +6 -0
  44. package/dist/adapters/oclif/commands/org/get.mjs +8 -0
  45. package/dist/adapters/oclif/commands/org/list.d.mts +2 -2
  46. package/dist/adapters/oclif/commands/org/switch.d.mts +1 -1
  47. package/dist/adapters/oclif/commands/overlays/diff.d.mts +2 -2
  48. package/dist/adapters/oclif/commands/overlays/pull.d.mts +2 -2
  49. package/dist/adapters/oclif/commands/overlays/push.d.mts +2 -2
  50. package/dist/adapters/oclif/commands/overlays/status.d.mts +2 -2
  51. package/dist/adapters/oclif/commands/score-groups/create.d.mts +6 -0
  52. package/dist/adapters/oclif/commands/score-groups/create.mjs +8 -0
  53. package/dist/adapters/oclif/commands/score-groups/delete.d.mts +6 -0
  54. package/dist/adapters/oclif/commands/score-groups/delete.mjs +8 -0
  55. package/dist/adapters/oclif/commands/score-groups/get.d.mts +6 -0
  56. package/dist/adapters/oclif/commands/score-groups/get.mjs +8 -0
  57. package/dist/adapters/oclif/commands/score-groups/list.d.mts +6 -0
  58. package/dist/adapters/oclif/commands/score-groups/list.mjs +8 -0
  59. package/dist/adapters/oclif/commands/score-groups/update.d.mts +6 -0
  60. package/dist/adapters/oclif/commands/score-groups/update.mjs +8 -0
  61. package/dist/adapters/oclif/commands/scores/create.d.mts +6 -0
  62. package/dist/adapters/oclif/commands/scores/create.mjs +8 -0
  63. package/dist/adapters/oclif/commands/scores/delete.d.mts +6 -0
  64. package/dist/adapters/oclif/commands/scores/delete.mjs +8 -0
  65. package/dist/adapters/oclif/commands/scores/list.d.mts +6 -0
  66. package/dist/adapters/oclif/commands/scores/list.mjs +8 -0
  67. package/dist/adapters/oclif/commands/scores/update.d.mts +6 -0
  68. package/dist/adapters/oclif/commands/scores/update.mjs +8 -0
  69. package/dist/adapters/oclif/commands/segments/create.d.mts +6 -0
  70. package/dist/adapters/oclif/commands/segments/create.mjs +8 -0
  71. package/dist/adapters/oclif/commands/segments/delete.d.mts +6 -0
  72. package/dist/adapters/oclif/commands/segments/delete.mjs +8 -0
  73. package/dist/adapters/oclif/commands/segments/evaluate.d.mts +6 -0
  74. package/dist/adapters/oclif/commands/segments/evaluate.mjs +14 -0
  75. package/dist/adapters/oclif/commands/segments/get-evaluation-history.d.mts +6 -0
  76. package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +14 -0
  77. package/dist/adapters/oclif/commands/segments/get-version.d.mts +6 -0
  78. package/dist/adapters/oclif/commands/segments/get-version.mjs +23 -0
  79. package/dist/adapters/oclif/commands/segments/get.d.mts +6 -0
  80. package/dist/adapters/oclif/commands/segments/get.mjs +8 -0
  81. package/dist/adapters/oclif/commands/segments/list-versions.d.mts +6 -0
  82. package/dist/adapters/oclif/commands/segments/list-versions.mjs +29 -0
  83. package/dist/adapters/oclif/commands/segments/list.d.mts +6 -0
  84. package/dist/adapters/oclif/commands/segments/list.mjs +8 -0
  85. package/dist/adapters/oclif/commands/segments/restore-version.d.mts +6 -0
  86. package/dist/adapters/oclif/commands/segments/restore-version.mjs +23 -0
  87. package/dist/adapters/oclif/commands/segments/update.d.mts +6 -0
  88. package/dist/adapters/oclif/commands/segments/update.mjs +8 -0
  89. package/dist/adapters/oclif/commands/table-views/create.d.mts +6 -0
  90. package/dist/adapters/oclif/commands/table-views/create.mjs +8 -0
  91. package/dist/adapters/oclif/commands/table-views/delete.d.mts +6 -0
  92. package/dist/adapters/oclif/commands/table-views/delete.mjs +8 -0
  93. package/dist/adapters/oclif/commands/table-views/list.d.mts +6 -0
  94. package/dist/adapters/oclif/commands/table-views/list.mjs +8 -0
  95. package/dist/adapters/oclif/commands/table-views/update.d.mts +6 -0
  96. package/dist/adapters/oclif/commands/table-views/update.mjs +8 -0
  97. package/dist/adapters/oclif/commands/tables/create.d.mts +6 -0
  98. package/dist/adapters/oclif/commands/tables/create.mjs +8 -0
  99. package/dist/adapters/oclif/commands/tables/delete.d.mts +6 -0
  100. package/dist/adapters/oclif/commands/tables/delete.mjs +8 -0
  101. package/dist/adapters/oclif/commands/tables/get.d.mts +6 -0
  102. package/dist/adapters/oclif/commands/tables/get.mjs +8 -0
  103. package/dist/adapters/oclif/commands/tables/list.d.mts +6 -0
  104. package/dist/adapters/oclif/commands/tables/list.mjs +8 -0
  105. package/dist/adapters/oclif/commands/tables/update.d.mts +6 -0
  106. package/dist/adapters/oclif/commands/tables/update.mjs +8 -0
  107. package/dist/factory-D9sR_S_g.mjs +90 -0
  108. package/dist/{index-B8n2GxTc.d.mts → index-KAzwt5vr.d.mts} +2 -2
  109. package/dist/index.d.mts +3 -3
  110. package/dist/presets-Cvazkjmu.mjs +98 -0
  111. package/package.json +2 -2
  112. /package/dist/{base.command-BjFWMIzL.d.mts → base.command-d7VW6WTp.d.mts} +0 -0
  113. /package/dist/{types-DmuJzN0Z.d.mts → types-C_p_6rkj.d.mts} +0 -0
  114. /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.1.4",
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
- "@revosai/config-eslint": "0.0.0"
60
+ "@revos/config-eslint": "0.0.0"
61
61
  },
62
62
  "publishConfig": {
63
63
  "registry": "https://registry.npmjs.org",