@revos/cli 0.2.0 → 0.2.2

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 (152) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +286 -41
  3. package/dist/adapters/oclif/commands/action-runs/get.mjs +1 -1
  4. package/dist/adapters/oclif/commands/action-runs/list.mjs +8 -2
  5. package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +2 -2
  6. package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +2 -2
  7. package/dist/adapters/oclif/commands/actions/get.mjs +1 -1
  8. package/dist/adapters/oclif/commands/actions/list.mjs +8 -4
  9. package/dist/adapters/oclif/commands/ai-instructions/create.mjs +1 -1
  10. package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +1 -1
  11. package/dist/adapters/oclif/commands/ai-instructions/get.mjs +1 -1
  12. package/dist/adapters/oclif/commands/ai-instructions/list.mjs +8 -2
  13. package/dist/adapters/oclif/commands/ai-instructions/update.mjs +1 -1
  14. package/dist/adapters/oclif/commands/api.d.mts +11 -0
  15. package/dist/adapters/oclif/commands/api.mjs +112 -0
  16. package/dist/adapters/oclif/commands/apply.d.mts +28 -0
  17. package/dist/adapters/oclif/commands/apply.mjs +77 -0
  18. package/dist/adapters/oclif/commands/auth/login.d.mts +5 -4
  19. package/dist/adapters/oclif/commands/auth/login.mjs +22 -11
  20. package/dist/adapters/oclif/commands/auth/logout.d.mts +1 -1
  21. package/dist/adapters/oclif/commands/auth/logout.mjs +7 -3
  22. package/dist/adapters/oclif/commands/auth/status.d.mts +2 -2
  23. package/dist/adapters/oclif/commands/auth/status.mjs +2 -2
  24. package/dist/adapters/oclif/commands/connections/create.d.mts +6 -0
  25. package/dist/adapters/oclif/commands/connections/create.mjs +8 -0
  26. package/dist/adapters/oclif/commands/connections/delete.d.mts +6 -0
  27. package/dist/adapters/oclif/commands/connections/delete.mjs +8 -0
  28. package/dist/adapters/oclif/commands/connections/get.d.mts +6 -0
  29. package/dist/adapters/oclif/commands/connections/get.mjs +8 -0
  30. package/dist/adapters/oclif/commands/connections/list.d.mts +6 -0
  31. package/dist/adapters/oclif/commands/connections/list.mjs +14 -0
  32. package/dist/adapters/oclif/commands/connections/update.d.mts +6 -0
  33. package/dist/adapters/oclif/commands/connections/update.mjs +8 -0
  34. package/dist/adapters/oclif/commands/cubes/create.d.mts +6 -0
  35. package/dist/adapters/oclif/commands/cubes/create.mjs +8 -0
  36. package/dist/adapters/oclif/commands/cubes/delete.d.mts +6 -0
  37. package/dist/adapters/oclif/commands/cubes/delete.mjs +8 -0
  38. package/dist/adapters/oclif/commands/cubes/get.d.mts +6 -0
  39. package/dist/adapters/oclif/commands/cubes/get.mjs +8 -0
  40. package/dist/adapters/oclif/commands/cubes/list.d.mts +6 -0
  41. package/dist/adapters/oclif/commands/cubes/list.mjs +13 -0
  42. package/dist/adapters/oclif/commands/cubes/update.d.mts +6 -0
  43. package/dist/adapters/oclif/commands/cubes/update.mjs +8 -0
  44. package/dist/adapters/oclif/commands/diff.d.mts +27 -0
  45. package/dist/adapters/oclif/commands/diff.mjs +66 -0
  46. package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +1 -1
  47. package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +2 -2
  48. package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +1 -1
  49. package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +1 -1
  50. package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +1 -1
  51. package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +7 -2
  52. package/dist/adapters/oclif/commands/init.d.mts +2 -1
  53. package/dist/adapters/oclif/commands/init.mjs +28 -24
  54. package/dist/adapters/oclif/commands/org/create.mjs +1 -1
  55. package/dist/adapters/oclif/commands/org/current.d.mts +2 -2
  56. package/dist/adapters/oclif/commands/org/current.mjs +2 -2
  57. package/dist/adapters/oclif/commands/org/get.mjs +1 -1
  58. package/dist/adapters/oclif/commands/org/list.d.mts +3 -11
  59. package/dist/adapters/oclif/commands/org/list.mjs +26 -26
  60. package/dist/adapters/oclif/commands/org/switch.d.mts +3 -2
  61. package/dist/adapters/oclif/commands/org/switch.mjs +13 -5
  62. package/dist/adapters/oclif/commands/pull.d.mts +28 -0
  63. package/dist/adapters/oclif/commands/pull.mjs +88 -0
  64. package/dist/adapters/oclif/commands/score-groups/create.mjs +3 -2
  65. package/dist/adapters/oclif/commands/score-groups/delete.mjs +1 -1
  66. package/dist/adapters/oclif/commands/score-groups/get.mjs +1 -1
  67. package/dist/adapters/oclif/commands/score-groups/list.mjs +3 -2
  68. package/dist/adapters/oclif/commands/score-groups/update.mjs +1 -1
  69. package/dist/adapters/oclif/commands/scores/create.mjs +3 -2
  70. package/dist/adapters/oclif/commands/scores/delete.mjs +1 -1
  71. package/dist/adapters/oclif/commands/scores/list.mjs +3 -2
  72. package/dist/adapters/oclif/commands/scores/update.mjs +1 -1
  73. package/dist/adapters/oclif/commands/segments/create.mjs +1 -1
  74. package/dist/adapters/oclif/commands/segments/delete.mjs +1 -1
  75. package/dist/adapters/oclif/commands/segments/evaluate.mjs +2 -2
  76. package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +2 -2
  77. package/dist/adapters/oclif/commands/segments/get-version.mjs +2 -2
  78. package/dist/adapters/oclif/commands/segments/get.mjs +1 -1
  79. package/dist/adapters/oclif/commands/segments/list-versions.mjs +16 -5
  80. package/dist/adapters/oclif/commands/segments/list.mjs +9 -2
  81. package/dist/adapters/oclif/commands/segments/restore-version.mjs +2 -2
  82. package/dist/adapters/oclif/commands/segments/update.mjs +1 -1
  83. package/dist/adapters/oclif/commands/sources/create.d.mts +11 -0
  84. package/dist/adapters/oclif/commands/sources/create.mjs +16 -0
  85. package/dist/adapters/oclif/commands/sources/delete.d.mts +6 -0
  86. package/dist/adapters/oclif/commands/sources/delete.mjs +8 -0
  87. package/dist/adapters/oclif/commands/sources/get.d.mts +6 -0
  88. package/dist/adapters/oclif/commands/sources/get.mjs +8 -0
  89. package/dist/adapters/oclif/commands/sources/list-streams.d.mts +6 -0
  90. package/dist/adapters/oclif/commands/sources/list-streams.mjs +31 -0
  91. package/dist/adapters/oclif/commands/sources/list.d.mts +6 -0
  92. package/dist/adapters/oclif/commands/sources/list.mjs +13 -0
  93. package/dist/adapters/oclif/commands/sources/update.d.mts +15 -0
  94. package/dist/adapters/oclif/commands/sources/update.mjs +21 -0
  95. package/dist/adapters/oclif/commands/status.d.mts +26 -0
  96. package/dist/adapters/oclif/commands/status.mjs +77 -0
  97. package/dist/adapters/oclif/commands/table-views/create.mjs +3 -2
  98. package/dist/adapters/oclif/commands/table-views/delete.mjs +1 -1
  99. package/dist/adapters/oclif/commands/table-views/list.mjs +3 -2
  100. package/dist/adapters/oclif/commands/table-views/update.mjs +1 -1
  101. package/dist/adapters/oclif/commands/tables/create.mjs +1 -1
  102. package/dist/adapters/oclif/commands/tables/delete.mjs +1 -1
  103. package/dist/adapters/oclif/commands/tables/get.mjs +1 -1
  104. package/dist/adapters/oclif/commands/tables/list.mjs +3 -2
  105. package/dist/adapters/oclif/commands/tables/update.mjs +1 -1
  106. package/dist/{base.command-d7VW6WTp.d.mts → base.command-D7X3ZNtY.d.mts} +0 -1
  107. package/dist/{base.command-DlVQ9Cqa.mjs → base.command-cV5d65r8.mjs} +15 -12
  108. package/dist/chunk-CfYAbeIz.mjs +13 -0
  109. package/dist/core-CMrP5BQS.mjs +2378 -0
  110. package/dist/{factory-D9sR_S_g.mjs → factory-C6XLqhT9.mjs} +44 -10
  111. package/dist/iac-render-BSZZEP0n.mjs +17 -0
  112. package/dist/index-BqKwXXAo.d.mts +598 -0
  113. package/dist/index.d.mts +3 -4
  114. package/dist/index.mjs +2 -2
  115. package/dist/{presets-Cvazkjmu.mjs → presets-CJbFbHlw.mjs} +35 -8
  116. package/dist/templates/.claude/settings.json +39 -0
  117. package/dist/templates/.devcontainer/devcontainer.json +2 -2
  118. package/dist/templates/.devcontainer/setup.sh +3 -0
  119. package/dist/templates/AGENTS.md +36 -13
  120. package/dist/templates/dbt/dbt_project.yml +2 -2
  121. package/dist/templates/skills/create-connections/SKILL.md +210 -0
  122. package/dist/templates/skills/create-connections/references/mappers.md +152 -0
  123. package/dist/templates/skills/{create-semantic-model → create-cubes}/SKILL.md +28 -26
  124. package/dist/templates/skills/create-cubes/references/bq-pk-fk-conventions.md +183 -0
  125. package/dist/templates/skills/{create-semantic-model → create-cubes}/references/cube-examples.md +85 -7
  126. package/dist/templates/skills/create-cubes/references/hubspot-entities.md +289 -0
  127. package/dist/templates/skills/create-cubes/references/jira-entities.md +201 -0
  128. package/dist/templates/skills/create-cubes/references/netsuite-entities.md +121 -0
  129. package/dist/templates/skills/create-cubes/references/stripe-entities.md +114 -0
  130. package/dist/templates/skills/create-dbt-transformations/SKILL.md +62 -33
  131. package/dist/templates/skills/create-dbt-transformations/references/edge-cases.md +21 -3
  132. package/dist/templates/skills/create-dbt-transformations/references/schema-conventions.md +21 -7
  133. package/dist/templates/skills/create-dbt-transformations/references/sql-templates.md +34 -20
  134. package/dist/templates/skills/explore-lakehouse/SKILL.md +8 -4
  135. package/dist/templates/skills/load-sample-data/SKILL.md +119 -0
  136. package/dist/templates/skills/visualize-semantic-model/SKILL.md +159 -0
  137. package/dist/templates/skills/visualize-semantic-model/scripts/render_graph.py +186 -0
  138. package/dist/{types-Y_ht_ja5.d.mts → types-CGjxcj4L.d.mts} +3 -0
  139. package/package.json +48 -6
  140. package/dist/adapters/oclif/commands/overlays/diff.d.mts +0 -19
  141. package/dist/adapters/oclif/commands/overlays/diff.mjs +0 -80
  142. package/dist/adapters/oclif/commands/overlays/pull.d.mts +0 -15
  143. package/dist/adapters/oclif/commands/overlays/pull.mjs +0 -44
  144. package/dist/adapters/oclif/commands/overlays/push.d.mts +0 -18
  145. package/dist/adapters/oclif/commands/overlays/push.mjs +0 -59
  146. package/dist/adapters/oclif/commands/overlays/status.d.mts +0 -18
  147. package/dist/adapters/oclif/commands/overlays/status.mjs +0 -53
  148. package/dist/core-gKJ_V-K5.mjs +0 -973
  149. package/dist/index-KAzwt5vr.d.mts +0 -190
  150. package/dist/types-C_p_6rkj.d.mts +0 -69
  151. /package/dist/templates/skills/{create-semantic-model → create-cubes}/references/key-patterns.md +0 -0
  152. /package/dist/templates/skills/{create-semantic-model → create-cubes}/references/validation-queries.md +0 -0
@@ -0,0 +1,112 @@
1
+ import { F as ApiError } from "../../../core-CMrP5BQS.mjs";
2
+ import { r as defineApiCommand, t as bodyFlag } from "../../../factory-C6XLqhT9.mjs";
3
+ import { client } from "@revos/api-client";
4
+ import { Args, Flags } from "@oclif/core";
5
+ //#region src/adapters/oclif/commands/api.ts
6
+ const ALLOWED_METHODS = [
7
+ "GET",
8
+ "POST",
9
+ "PATCH",
10
+ "PUT",
11
+ "DELETE"
12
+ ];
13
+ function normalizeMethod(input) {
14
+ const upper = (input ?? "GET").toUpperCase();
15
+ if (!ALLOWED_METHODS.includes(upper)) throw new Error(`Unsupported --method '${input}'. Use one of: ${ALLOWED_METHODS.join(", ")}.`);
16
+ return upper;
17
+ }
18
+ function parseHeaders(values) {
19
+ const out = {};
20
+ for (const raw of values ?? []) {
21
+ const idx = raw.indexOf(":");
22
+ if (idx <= 0) throw new Error(`Invalid --header value '${raw}'. Expected 'Name: value'.`);
23
+ const name = raw.slice(0, idx).trim();
24
+ if (!name) throw new Error(`Invalid --header value '${raw}': empty name.`);
25
+ out[name] = raw.slice(idx + 1).trim();
26
+ }
27
+ return out;
28
+ }
29
+ function parseQuery(values) {
30
+ const out = {};
31
+ for (const raw of values ?? []) {
32
+ const idx = raw.indexOf("=");
33
+ if (idx <= 0) throw new Error(`Invalid --query value '${raw}'. Expected 'key=value'.`);
34
+ const key = raw.slice(0, idx).trim();
35
+ if (!key) throw new Error(`Invalid --query value '${raw}': empty key.`);
36
+ const value = raw.slice(idx + 1);
37
+ const existing = out[key];
38
+ if (existing === void 0) out[key] = value;
39
+ else if (Array.isArray(existing)) existing.push(value);
40
+ else out[key] = [existing, value];
41
+ }
42
+ return out;
43
+ }
44
+ var api_default = defineApiCommand({
45
+ description: "Call an arbitrary RevOS REST endpoint. Reuses your stored auth, API base URL, and organization context.",
46
+ examples: [
47
+ "<%= config.bin %> <%= command.id %> /organizations",
48
+ "<%= config.bin %> <%= command.id %> /tables -q pageSize=50 -q 'orderBy=createdAt desc'",
49
+ "<%= config.bin %> <%= command.id %> /connections -X POST --body '{\"name\":\"my-conn\"}'",
50
+ "<%= config.bin %> <%= command.id %> /connections -X POST --body @body.json",
51
+ "<%= config.bin %> <%= command.id %> /segments/seg_123 -X DELETE",
52
+ "<%= config.bin %> <%= command.id %> /organizations -H 'X-Foo: bar'"
53
+ ],
54
+ args: { path: Args.string({
55
+ description: "Path relative to API base URL (e.g. /organizations). Absolute URLs pass through.",
56
+ required: true
57
+ }) },
58
+ flags: {
59
+ method: Flags.string({
60
+ char: "X",
61
+ description: "HTTP method (case-insensitive).",
62
+ default: "GET",
63
+ helpValue: "GET|POST|PATCH|PUT|DELETE"
64
+ }),
65
+ header: Flags.string({
66
+ char: "H",
67
+ description: "Extra request header in 'Name: value' form. Repeatable.",
68
+ multiple: true
69
+ }),
70
+ query: Flags.string({
71
+ char: "q",
72
+ description: "Query parameter 'key=value'. Repeatable; repeats become arrays.",
73
+ multiple: true
74
+ }),
75
+ body: bodyFlag
76
+ },
77
+ call: async ({ flags, args, body }) => {
78
+ const method = normalizeMethod(flags.method);
79
+ const headers = parseHeaders(flags.header);
80
+ const query = parseQuery(flags.query);
81
+ const result = await client.request({
82
+ method,
83
+ url: args.path,
84
+ security: [{
85
+ scheme: "bearer",
86
+ type: "http"
87
+ }],
88
+ ...Object.keys(headers).length ? { headers } : {},
89
+ ...Object.keys(query).length ? { query } : {},
90
+ ...body !== void 0 ? { body } : {}
91
+ });
92
+ if (result.error !== void 0 && result.error !== null) {
93
+ const status = result.response?.status ?? 0;
94
+ const statusText = result.response?.statusText ?? "";
95
+ const url = result.request?.url ?? args.path;
96
+ const errBody = result.error;
97
+ let message;
98
+ if (typeof errBody === "object" && errBody !== null && "message" in errBody) {
99
+ const m = errBody.message;
100
+ message = typeof m === "string" ? m : JSON.stringify(m);
101
+ } else if (typeof errBody === "string") message = errBody;
102
+ else message = JSON.stringify(errBody);
103
+ throw new ApiError(message, status, statusText, url, errBody);
104
+ }
105
+ return result.data;
106
+ },
107
+ render: (data, command) => {
108
+ command.log(JSON.stringify(data, null, 2));
109
+ }
110
+ });
111
+ //#endregion
112
+ export { ALLOWED_METHODS, api_default as default, normalizeMethod, parseHeaders, parseQuery };
@@ -0,0 +1,28 @@
1
+ import { c as IacError, s as AppliedResource } from "../../../index-BqKwXXAo.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
3
+ import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
4
+
5
+ //#region src/adapters/oclif/commands/apply.d.ts
6
+ interface ApplyJsonOutput {
7
+ project: {
8
+ path: string;
9
+ orgId: string;
10
+ };
11
+ applied: AppliedResource[];
12
+ errors: IacError[];
13
+ }
14
+ declare class Apply extends BaseCommand<typeof Apply> {
15
+ static description: string;
16
+ static flags: {
17
+ project: _$_oclif_core_interfaces0.OptionFlag<string | undefined, _$_oclif_core_interfaces0.CustomOptions>;
18
+ "dry-run": _$_oclif_core_interfaces0.BooleanFlag<boolean>;
19
+ parallelism: _$_oclif_core_interfaces0.OptionFlag<number | undefined, _$_oclif_core_interfaces0.CustomOptions>;
20
+ };
21
+ static args: {
22
+ path: _$_oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
23
+ };
24
+ run(): Promise<ApplyJsonOutput>;
25
+ private renderHuman;
26
+ }
27
+ //#endregion
28
+ export { ApplyJsonOutput, Apply as default };
@@ -0,0 +1,77 @@
1
+ import { d as projectRoot, f as createApiClient, l as buildIacRegistry, o as apply, u as discoverProject, v as getConfig } from "../../../core-CMrP5BQS.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-cV5d65r8.mjs";
3
+ import { n as renderIacErrors, t as APPLY_ACTION_LABELS } from "../../../iac-render-BSZZEP0n.mjs";
4
+ import chalk from "chalk";
5
+ import { Args, Flags } from "@oclif/core";
6
+ //#region src/adapters/oclif/commands/apply.ts
7
+ var Apply = class extends BaseCommand {
8
+ static description = "Reconcile local revos resources with the API. Creates resources without metadata.id; updates resources whose local spec drifts from the remote.";
9
+ static flags = {
10
+ project: Flags.string({ description: "Path to the project root (defaults to walking up from cwd)" }),
11
+ "dry-run": Flags.boolean({
12
+ description: "Read-only mode: report what would change without writing to the API or YAML files (still reads remote state to detect drift)",
13
+ default: false
14
+ }),
15
+ parallelism: Flags.integer({ description: "Max concurrent API calls within a single dependency level (default 4)" })
16
+ };
17
+ static args = { path: Args.string({
18
+ description: "Restrict scan to a sub-path within the project",
19
+ required: false
20
+ }) };
21
+ async run() {
22
+ const project = discoverProject({
23
+ cwd: process.cwd(),
24
+ projectPath: this.flags.project
25
+ });
26
+ const dryRun = this.flags["dry-run"];
27
+ const config = await getConfig();
28
+ const result = await apply({
29
+ project,
30
+ registry: buildIacRegistry(createApiClient({
31
+ apiUrl: config.apiUrl,
32
+ token: config.token,
33
+ organizationId: project.metadata.orgId
34
+ })),
35
+ startPath: this.args.path ?? projectRoot(project),
36
+ dryRun,
37
+ parallelism: this.flags.parallelism
38
+ });
39
+ if (!this.jsonEnabled()) this.renderHuman(result);
40
+ if (result.errors.length > 0) this.exit(2);
41
+ return {
42
+ project: {
43
+ path: project.path,
44
+ orgId: project.metadata.orgId
45
+ },
46
+ applied: result.applied,
47
+ errors: result.errors
48
+ };
49
+ }
50
+ renderHuman(result) {
51
+ if (result.errors.length > 0) {
52
+ renderIacErrors(result.errors, (msg) => this.log(msg));
53
+ return;
54
+ }
55
+ if (result.applied.length === 0) {
56
+ this.log(chalk.dim("No resources found."));
57
+ return;
58
+ }
59
+ const counts = result.applied.reduce((acc, a) => {
60
+ acc[a.action] = (acc[a.action] ?? 0) + 1;
61
+ return acc;
62
+ }, {});
63
+ this.table(result.applied.map((a) => ({
64
+ address: a.address,
65
+ action: APPLY_ACTION_LABELS[a.action] ?? a.action,
66
+ id: a.id ?? chalk.dim("—")
67
+ })), { columns: [
68
+ { key: "address" },
69
+ { key: "action" },
70
+ { key: "id" }
71
+ ] });
72
+ const summary = Object.entries(counts).map(([k, v]) => `${k}: ${v}`).join(", ");
73
+ this.log(chalk.dim(`\n${summary}`));
74
+ }
75
+ };
76
+ //#endregion
77
+ export { Apply as default };
@@ -1,13 +1,14 @@
1
- import { t as AuthResult } from "../../../../types-Y_ht_ja5.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-d7VW6WTp.mjs";
1
+ import { t as AuthResult } from "../../../../types-CGjxcj4L.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
3
3
  import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
4
4
 
5
5
  //#region src/adapters/oclif/commands/auth/login.d.ts
6
6
  declare class AuthLogin extends BaseCommand<typeof AuthLogin> {
7
7
  static description: string;
8
8
  static flags: {
9
- "clerk-domain": _$_oclif_core_interfaces0.OptionFlag<string | undefined, _$_oclif_core_interfaces0.CustomOptions>;
10
- "clerk-client-id": _$_oclif_core_interfaces0.OptionFlag<string | undefined, _$_oclif_core_interfaces0.CustomOptions>;
9
+ dev: _$_oclif_core_interfaces0.BooleanFlag<boolean>;
10
+ "auth-url": _$_oclif_core_interfaces0.OptionFlag<string | undefined, _$_oclif_core_interfaces0.CustomOptions>;
11
+ "auth-client-id": _$_oclif_core_interfaces0.OptionFlag<string | undefined, _$_oclif_core_interfaces0.CustomOptions>;
11
12
  };
12
13
  run(): Promise<AuthResult>;
13
14
  }
@@ -1,5 +1,5 @@
1
- import { A as getCredentialsPath, C as getUserInfo, D as tokenResponseToCredentials, N as saveCredentials, O as startOAuthServer, S as generatePKCEChallenge, T as setClerkConfig, b as buildAuthorizationUrl, m as unwrap, n as selectOrganization, p as createApiClient, x as exchangeCodeForTokens } from "../../../../core-gKJ_V-K5.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-DlVQ9Cqa.mjs";
1
+ import { C as getActiveAuthConfig, D as setAuthEnv, E as setAuthConfig, O as tokenResponseToCredentials, P as saveCredentials, S as generatePKCEChallenge, b as buildAuthorizationUrl, f as createApiClient, j as getCredentialsPath, k as startOAuthServer, n as selectOrganization, p as unwrap, w as getUserInfo, x as exchangeCodeForTokens, y as AUTH_ENVS } from "../../../../core-CMrP5BQS.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
3
3
  import chalk from "chalk";
4
4
  import { Flags } from "@oclif/core";
5
5
  import open from "open";
@@ -7,33 +7,44 @@ import open from "open";
7
7
  var AuthLogin = class extends BaseCommand {
8
8
  static description = "Authenticate with RevOS via browser";
9
9
  static flags = {
10
- "clerk-domain": Flags.string({ description: "Custom Clerk domain URL" }),
11
- "clerk-client-id": Flags.string({ description: "Custom Clerk OAuth client ID" })
10
+ dev: Flags.boolean({ description: "Authenticate against the development environment" }),
11
+ "auth-url": Flags.string({ description: "Custom OAuth provider URL" }),
12
+ "auth-client-id": Flags.string({ description: "Custom OAuth client ID" })
12
13
  };
13
14
  async run() {
14
15
  const { flags } = this;
15
- if (flags["clerk-domain"] || flags["clerk-client-id"]) setClerkConfig({
16
- clerkDomain: flags["clerk-domain"],
17
- clerkClientId: flags["clerk-client-id"]
16
+ let apiUrlOverride;
17
+ if (flags.dev) {
18
+ setAuthEnv("development");
19
+ apiUrlOverride = AUTH_ENVS.development.apiUrl;
20
+ }
21
+ if (flags["auth-url"] || flags["auth-client-id"]) setAuthConfig({
22
+ authUrl: flags["auth-url"],
23
+ authClientId: flags["auth-client-id"]
18
24
  });
19
25
  if (!this.jsonEnabled()) this.log("Starting authentication...\n");
20
26
  const server = await startOAuthServer();
21
27
  const redirectUri = `http://localhost:${server.port}/callback`;
22
28
  const pkce = generatePKCEChallenge();
23
- const authUrl = buildAuthorizationUrl(redirectUri, pkce);
29
+ const authorizationUrl = buildAuthorizationUrl(redirectUri, pkce);
24
30
  if (!this.jsonEnabled()) {
25
31
  this.log("Opening browser for authentication...");
26
32
  this.log("If the browser doesn't open, visit this URL:\n");
27
- this.log(` ${authUrl}\n`);
33
+ this.log(` ${authorizationUrl}\n`);
28
34
  this.log("Waiting for authentication... (Press Ctrl+C to cancel)\n");
29
35
  }
30
- await open(authUrl);
36
+ await open(authorizationUrl);
31
37
  const callbackResult = await server.waitForCallback();
32
38
  if (callbackResult.state !== pkce.state) throw new Error("Invalid state parameter. Authentication may have been tampered with.");
33
39
  if (!this.jsonEnabled()) this.log("Received authorization code, exchanging for tokens...\n");
34
40
  const tokenResponse = await exchangeCodeForTokens(callbackResult.code, redirectUri, pkce.codeVerifier);
35
41
  const userInfo = await getUserInfo(tokenResponse.access_token);
36
42
  const credentials = tokenResponseToCredentials(tokenResponse, userInfo);
43
+ const apiUrl = apiUrlOverride ?? process.env.REVOS_API_URL ?? "https://api.revos.ai";
44
+ const activeAuth = getActiveAuthConfig();
45
+ credentials.apiUrl = apiUrl;
46
+ credentials.authUrl = activeAuth.authUrl;
47
+ credentials.authClientId = activeAuth.authClientId;
37
48
  saveCredentials(credentials);
38
49
  if (!this.jsonEnabled()) {
39
50
  this.log(chalk.green(`\nAuthenticated as ${userInfo.email || userInfo.sub}`));
@@ -41,7 +52,7 @@ var AuthLogin = class extends BaseCommand {
41
52
  }
42
53
  try {
43
54
  const orgs = unwrap(await createApiClient({
44
- apiUrl: process.env.REVOS_API_URL || "https://api.revos.ai",
55
+ apiUrl,
45
56
  token: tokenResponse.access_token
46
57
  }).organizations.list());
47
58
  if (orgs.length === 1) {
@@ -1,4 +1,4 @@
1
- import { t as BaseCommand } from "../../../../base.command-d7VW6WTp.mjs";
1
+ import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
2
2
 
3
3
  //#region src/adapters/oclif/commands/auth/logout.d.ts
4
4
  declare class AuthLogout extends BaseCommand<typeof AuthLogout> {
@@ -1,5 +1,6 @@
1
- import { k as deleteCredentials } from "../../../../core-gKJ_V-K5.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-DlVQ9Cqa.mjs";
1
+ import { A as deleteCredentials } from "../../../../core-CMrP5BQS.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
3
+ import * as os from "os";
3
4
  //#region src/adapters/oclif/commands/auth/logout.ts
4
5
  var AuthLogout = class extends BaseCommand {
5
6
  static description = "Remove stored authentication credentials";
@@ -8,7 +9,10 @@ var AuthLogout = class extends BaseCommand {
8
9
  if (!this.jsonEnabled()) {
9
10
  if (deleted) this.log("Logged out successfully. Credentials removed.");
10
11
  else this.log("No stored credentials found.");
11
- if (process.env.REVOS_TOKEN) this.warn("REVOS_TOKEN environment variable is still set. Unset it to fully log out:\n\n unset REVOS_TOKEN");
12
+ if (process.env.REVOS_TOKEN) {
13
+ const unsetCmd = process.platform === "win32" ? " PowerShell: Remove-Item Env:REVOS_TOKEN" + os.EOL + " CMD: set REVOS_TOKEN=" : " unset REVOS_TOKEN";
14
+ this.warn(`REVOS_TOKEN environment variable is still set. Unset it to fully log out:${os.EOL}${os.EOL}${unsetCmd}`);
15
+ }
12
16
  }
13
17
  return { deleted };
14
18
  }
@@ -1,5 +1,5 @@
1
- import { n as AuthStatusInfo } from "../../../../types-Y_ht_ja5.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-d7VW6WTp.mjs";
1
+ import { n as AuthStatusInfo } from "../../../../types-CGjxcj4L.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
3
3
 
4
4
  //#region src/adapters/oclif/commands/auth/status.d.ts
5
5
  declare class AuthStatus extends BaseCommand<typeof AuthStatus> {
@@ -1,5 +1,5 @@
1
- import { A as getCredentialsPath, M as loadCredentials, j as isTokenExpired } from "../../../../core-gKJ_V-K5.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-DlVQ9Cqa.mjs";
1
+ import { M as isTokenExpired, N as loadCredentials, j as getCredentialsPath } from "../../../../core-CMrP5BQS.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
3
3
  import chalk from "chalk";
4
4
  //#region src/adapters/oclif/commands/auth/status.ts
5
5
  var AuthStatus = class extends BaseCommand {
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/connections/create.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/connections/create.ts
3
+ var create_default = createCommand({
4
+ resource: "connections",
5
+ description: "Create a new connection"
6
+ });
7
+ //#endregion
8
+ export { create_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/connections/delete.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/connections/delete.ts
3
+ var delete_default = deleteCommand({
4
+ resource: "connections",
5
+ description: "Delete a connection"
6
+ });
7
+ //#endregion
8
+ export { delete_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/connections/get.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/connections/get.ts
3
+ var get_default = getCommand({
4
+ resource: "connections",
5
+ description: "Get a connection by ID"
6
+ });
7
+ //#endregion
8
+ export { get_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/connections/list.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,14 @@
1
+ import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/connections/list.ts
3
+ var list_default = listCommand({
4
+ resource: "connections",
5
+ description: "List connections",
6
+ defaultColumns: [
7
+ "id",
8
+ "name",
9
+ "status",
10
+ "sourceId"
11
+ ]
12
+ });
13
+ //#endregion
14
+ export { list_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/connections/update.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/connections/update.ts
3
+ var update_default = updateCommand({
4
+ resource: "connections",
5
+ description: "Update a connection"
6
+ });
7
+ //#endregion
8
+ export { update_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/cubes/create.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/cubes/create.ts
3
+ var create_default = createCommand({
4
+ resource: "cubes",
5
+ description: "Create a new cube"
6
+ });
7
+ //#endregion
8
+ export { create_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/cubes/delete.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/cubes/delete.ts
3
+ var delete_default = deleteCommand({
4
+ resource: "cubes",
5
+ description: "Delete a cube"
6
+ });
7
+ //#endregion
8
+ export { delete_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/cubes/get.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/cubes/get.ts
3
+ var get_default = getCommand({
4
+ resource: "cubes",
5
+ description: "Get a cube by ID"
6
+ });
7
+ //#endregion
8
+ export { get_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/cubes/list.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,13 @@
1
+ import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/cubes/list.ts
3
+ var list_default = listCommand({
4
+ resource: "cubes",
5
+ description: "List cubes",
6
+ defaultColumns: [
7
+ "id",
8
+ "name",
9
+ "updatedAt"
10
+ ]
11
+ });
12
+ //#endregion
13
+ export { list_default as default };
@@ -0,0 +1,6 @@
1
+ import * as _$_oclif_core0 from "@oclif/core";
2
+
3
+ //#region src/adapters/oclif/commands/cubes/update.d.ts
4
+ declare const _default: typeof _$_oclif_core0.Command;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
2
+ //#region src/adapters/oclif/commands/cubes/update.ts
3
+ var update_default = updateCommand({
4
+ resource: "cubes",
5
+ description: "Update a cube"
6
+ });
7
+ //#endregion
8
+ export { update_default as default };
@@ -0,0 +1,27 @@
1
+ import { c as IacError, s as AppliedResource } from "../../../index-BqKwXXAo.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
3
+ import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
4
+
5
+ //#region src/adapters/oclif/commands/diff.d.ts
6
+ interface DiffJsonOutput {
7
+ project: {
8
+ path: string;
9
+ orgId: string;
10
+ };
11
+ applied: AppliedResource[];
12
+ errors: IacError[];
13
+ }
14
+ declare class Diff extends BaseCommand<typeof Diff> {
15
+ static description: string;
16
+ static flags: {
17
+ project: _$_oclif_core_interfaces0.OptionFlag<string | undefined, _$_oclif_core_interfaces0.CustomOptions>;
18
+ parallelism: _$_oclif_core_interfaces0.OptionFlag<number | undefined, _$_oclif_core_interfaces0.CustomOptions>;
19
+ };
20
+ static args: {
21
+ path: _$_oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
22
+ };
23
+ run(): Promise<DiffJsonOutput>;
24
+ private renderHuman;
25
+ }
26
+ //#endregion
27
+ export { DiffJsonOutput, Diff as default };
@@ -0,0 +1,66 @@
1
+ import { d as projectRoot, f as createApiClient, l as buildIacRegistry, o as apply, s as formatDiffLine, u as discoverProject, v as getConfig } from "../../../core-CMrP5BQS.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-cV5d65r8.mjs";
3
+ import { n as renderIacErrors, t as APPLY_ACTION_LABELS } from "../../../iac-render-BSZZEP0n.mjs";
4
+ import chalk from "chalk";
5
+ import { Args, Flags } from "@oclif/core";
6
+ //#region src/adapters/oclif/commands/diff.ts
7
+ var Diff = class extends BaseCommand {
8
+ static description = "Show the drift between local YAML and the API without making changes";
9
+ static flags = {
10
+ project: Flags.string({ description: "Path to the project root (defaults to walking up from cwd)" }),
11
+ parallelism: Flags.integer({ description: "Max concurrent API calls within a single dependency level (default 4)" })
12
+ };
13
+ static args = { path: Args.string({
14
+ description: "Restrict scan to a sub-path within the project",
15
+ required: false
16
+ }) };
17
+ async run() {
18
+ const project = discoverProject({
19
+ cwd: process.cwd(),
20
+ projectPath: this.flags.project
21
+ });
22
+ const config = await getConfig();
23
+ const result = await apply({
24
+ project,
25
+ registry: buildIacRegistry(createApiClient({
26
+ apiUrl: config.apiUrl,
27
+ token: config.token,
28
+ organizationId: project.metadata.orgId
29
+ })),
30
+ startPath: this.args.path ?? projectRoot(project),
31
+ dryRun: true,
32
+ parallelism: this.flags.parallelism
33
+ });
34
+ if (!this.jsonEnabled()) this.renderHuman(result);
35
+ if (result.errors.length > 0) this.exit(2);
36
+ return {
37
+ project: {
38
+ path: project.path,
39
+ orgId: project.metadata.orgId
40
+ },
41
+ applied: result.applied,
42
+ errors: result.errors
43
+ };
44
+ }
45
+ renderHuman(result) {
46
+ if (result.errors.length > 0) {
47
+ renderIacErrors(result.errors, (msg) => this.log(msg));
48
+ return;
49
+ }
50
+ if (result.applied.length === 0) {
51
+ this.log(chalk.dim("No resources found."));
52
+ return;
53
+ }
54
+ let drift = 0;
55
+ for (const r of result.applied) {
56
+ if (r.action === "unchanged") continue;
57
+ drift++;
58
+ const label = APPLY_ACTION_LABELS[r.action] ?? r.action;
59
+ this.log(`${label} ${r.address}`);
60
+ if (r.diff && r.diff.length > 0) for (const change of r.diff) this.log(formatDiffLine(change));
61
+ }
62
+ if (drift === 0) this.log(chalk.dim("No drift. All resources match the API."));
63
+ }
64
+ };
65
+ //#endregion
66
+ export { Diff as default };
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-Cvazkjmu.mjs";
1
+ import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
2
2
  //#region src/adapters/oclif/commands/gservice-account-keys/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "gserviceAccountKeys",