@revos/cli 0.2.1 → 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 (157) hide show
  1. package/README.md +271 -71
  2. package/dist/adapters/oclif/commands/action-runs/get.mjs +1 -1
  3. package/dist/adapters/oclif/commands/action-runs/list.mjs +8 -2
  4. package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +2 -2
  5. package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +2 -2
  6. package/dist/adapters/oclif/commands/actions/get.mjs +1 -1
  7. package/dist/adapters/oclif/commands/actions/list.mjs +8 -4
  8. package/dist/adapters/oclif/commands/ai-instructions/create.mjs +1 -1
  9. package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +1 -1
  10. package/dist/adapters/oclif/commands/ai-instructions/get.mjs +1 -1
  11. package/dist/adapters/oclif/commands/ai-instructions/list.mjs +8 -2
  12. package/dist/adapters/oclif/commands/ai-instructions/update.mjs +1 -1
  13. package/dist/adapters/oclif/commands/api.d.mts +11 -0
  14. package/dist/adapters/oclif/commands/api.mjs +112 -0
  15. package/dist/adapters/oclif/commands/apply.d.mts +28 -0
  16. package/dist/adapters/oclif/commands/apply.mjs +77 -0
  17. package/dist/adapters/oclif/commands/auth/login.d.mts +5 -4
  18. package/dist/adapters/oclif/commands/auth/login.mjs +22 -11
  19. package/dist/adapters/oclif/commands/auth/logout.d.mts +1 -1
  20. package/dist/adapters/oclif/commands/auth/logout.mjs +2 -2
  21. package/dist/adapters/oclif/commands/auth/status.d.mts +2 -2
  22. package/dist/adapters/oclif/commands/auth/status.mjs +2 -2
  23. package/dist/adapters/oclif/commands/connections/create.d.mts +6 -0
  24. package/dist/adapters/oclif/commands/connections/create.mjs +8 -0
  25. package/dist/adapters/oclif/commands/connections/delete.d.mts +6 -0
  26. package/dist/adapters/oclif/commands/connections/delete.mjs +8 -0
  27. package/dist/adapters/oclif/commands/connections/get.d.mts +6 -0
  28. package/dist/adapters/oclif/commands/connections/get.mjs +8 -0
  29. package/dist/adapters/oclif/commands/connections/list.d.mts +6 -0
  30. package/dist/adapters/oclif/commands/connections/list.mjs +14 -0
  31. package/dist/adapters/oclif/commands/connections/update.d.mts +6 -0
  32. package/dist/adapters/oclif/commands/connections/update.mjs +8 -0
  33. package/dist/adapters/oclif/commands/cubes/create.d.mts +6 -0
  34. package/dist/adapters/oclif/commands/cubes/create.mjs +8 -0
  35. package/dist/adapters/oclif/commands/cubes/delete.d.mts +6 -0
  36. package/dist/adapters/oclif/commands/cubes/delete.mjs +8 -0
  37. package/dist/adapters/oclif/commands/cubes/get.d.mts +6 -0
  38. package/dist/adapters/oclif/commands/cubes/get.mjs +8 -0
  39. package/dist/adapters/oclif/commands/cubes/list.d.mts +6 -0
  40. package/dist/adapters/oclif/commands/cubes/list.mjs +13 -0
  41. package/dist/adapters/oclif/commands/cubes/update.d.mts +6 -0
  42. package/dist/adapters/oclif/commands/cubes/update.mjs +8 -0
  43. package/dist/adapters/oclif/commands/diff.d.mts +27 -0
  44. package/dist/adapters/oclif/commands/diff.mjs +66 -0
  45. package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +1 -1
  46. package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +2 -2
  47. package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +1 -1
  48. package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +1 -1
  49. package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +1 -1
  50. package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +7 -2
  51. package/dist/adapters/oclif/commands/init.d.mts +2 -1
  52. package/dist/adapters/oclif/commands/init.mjs +26 -23
  53. package/dist/adapters/oclif/commands/org/create.mjs +1 -1
  54. package/dist/adapters/oclif/commands/org/current.d.mts +2 -2
  55. package/dist/adapters/oclif/commands/org/current.mjs +2 -2
  56. package/dist/adapters/oclif/commands/org/get.mjs +1 -1
  57. package/dist/adapters/oclif/commands/org/list.d.mts +3 -11
  58. package/dist/adapters/oclif/commands/org/list.mjs +26 -26
  59. package/dist/adapters/oclif/commands/org/switch.d.mts +3 -2
  60. package/dist/adapters/oclif/commands/org/switch.mjs +10 -3
  61. package/dist/adapters/oclif/commands/pull.d.mts +28 -0
  62. package/dist/adapters/oclif/commands/pull.mjs +88 -0
  63. package/dist/adapters/oclif/commands/score-groups/create.mjs +3 -2
  64. package/dist/adapters/oclif/commands/score-groups/delete.mjs +1 -1
  65. package/dist/adapters/oclif/commands/score-groups/get.mjs +1 -1
  66. package/dist/adapters/oclif/commands/score-groups/list.mjs +3 -2
  67. package/dist/adapters/oclif/commands/score-groups/update.mjs +1 -1
  68. package/dist/adapters/oclif/commands/scores/create.mjs +3 -2
  69. package/dist/adapters/oclif/commands/scores/delete.mjs +1 -1
  70. package/dist/adapters/oclif/commands/scores/list.mjs +3 -2
  71. package/dist/adapters/oclif/commands/scores/update.mjs +1 -1
  72. package/dist/adapters/oclif/commands/segments/create.mjs +1 -1
  73. package/dist/adapters/oclif/commands/segments/delete.mjs +1 -1
  74. package/dist/adapters/oclif/commands/segments/evaluate.mjs +2 -2
  75. package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +2 -2
  76. package/dist/adapters/oclif/commands/segments/get-version.mjs +2 -2
  77. package/dist/adapters/oclif/commands/segments/get.mjs +1 -1
  78. package/dist/adapters/oclif/commands/segments/list-versions.mjs +16 -5
  79. package/dist/adapters/oclif/commands/segments/list.mjs +9 -2
  80. package/dist/adapters/oclif/commands/segments/restore-version.mjs +2 -2
  81. package/dist/adapters/oclif/commands/segments/update.mjs +1 -1
  82. package/dist/adapters/oclif/commands/sources/create.d.mts +11 -0
  83. package/dist/adapters/oclif/commands/sources/create.mjs +16 -0
  84. package/dist/adapters/oclif/commands/sources/delete.d.mts +6 -0
  85. package/dist/adapters/oclif/commands/sources/delete.mjs +8 -0
  86. package/dist/adapters/oclif/commands/sources/get.d.mts +6 -0
  87. package/dist/adapters/oclif/commands/sources/get.mjs +8 -0
  88. package/dist/adapters/oclif/commands/sources/list-streams.d.mts +6 -0
  89. package/dist/adapters/oclif/commands/sources/list-streams.mjs +31 -0
  90. package/dist/adapters/oclif/commands/sources/list.d.mts +6 -0
  91. package/dist/adapters/oclif/commands/sources/list.mjs +13 -0
  92. package/dist/adapters/oclif/commands/{integrations/get.d.mts → sources/update.d.mts} +4 -4
  93. package/dist/adapters/oclif/commands/sources/update.mjs +21 -0
  94. package/dist/adapters/oclif/commands/status.d.mts +26 -0
  95. package/dist/adapters/oclif/commands/status.mjs +77 -0
  96. package/dist/adapters/oclif/commands/table-views/create.mjs +3 -2
  97. package/dist/adapters/oclif/commands/table-views/delete.mjs +1 -1
  98. package/dist/adapters/oclif/commands/table-views/list.mjs +3 -2
  99. package/dist/adapters/oclif/commands/table-views/update.mjs +1 -1
  100. package/dist/adapters/oclif/commands/tables/create.mjs +1 -1
  101. package/dist/adapters/oclif/commands/tables/delete.mjs +1 -1
  102. package/dist/adapters/oclif/commands/tables/get.mjs +1 -1
  103. package/dist/adapters/oclif/commands/tables/list.mjs +3 -2
  104. package/dist/adapters/oclif/commands/tables/update.mjs +1 -1
  105. package/dist/{base.command-d7VW6WTp.d.mts → base.command-D7X3ZNtY.d.mts} +0 -1
  106. package/dist/{base.command-YiwlGlKs.mjs → base.command-cV5d65r8.mjs} +15 -12
  107. package/dist/chunk-CfYAbeIz.mjs +13 -0
  108. package/dist/core-CMrP5BQS.mjs +2378 -0
  109. package/dist/{factory-BrFKT8t-.mjs → factory-C6XLqhT9.mjs} +44 -10
  110. package/dist/iac-render-BSZZEP0n.mjs +17 -0
  111. package/dist/index-BqKwXXAo.d.mts +598 -0
  112. package/dist/index.d.mts +3 -4
  113. package/dist/index.mjs +2 -2
  114. package/dist/{presets-D9b6IWKy.mjs → presets-CJbFbHlw.mjs} +35 -8
  115. package/dist/templates/.claude/settings.json +39 -0
  116. package/dist/templates/.devcontainer/setup.sh +3 -0
  117. package/dist/templates/AGENTS.md +33 -20
  118. package/dist/templates/dbt/dbt_project.yml +2 -2
  119. package/dist/templates/skills/create-connections/SKILL.md +210 -0
  120. package/dist/templates/skills/create-connections/references/mappers.md +152 -0
  121. package/dist/templates/skills/{create-semantic-model → create-cubes}/SKILL.md +20 -18
  122. package/dist/templates/skills/create-cubes/references/bq-pk-fk-conventions.md +183 -0
  123. package/dist/templates/skills/{create-semantic-model → create-cubes}/references/cube-examples.md +2 -2
  124. package/dist/templates/skills/create-cubes/references/hubspot-entities.md +289 -0
  125. package/dist/templates/skills/create-cubes/references/jira-entities.md +201 -0
  126. package/dist/templates/skills/create-cubes/references/netsuite-entities.md +121 -0
  127. package/dist/templates/skills/create-cubes/references/stripe-entities.md +114 -0
  128. package/dist/templates/skills/create-dbt-transformations/SKILL.md +43 -22
  129. package/dist/templates/skills/create-dbt-transformations/references/edge-cases.md +20 -2
  130. package/dist/templates/skills/create-dbt-transformations/references/schema-conventions.md +21 -7
  131. package/dist/templates/skills/create-dbt-transformations/references/sql-templates.md +34 -20
  132. package/dist/templates/skills/explore-lakehouse/SKILL.md +3 -3
  133. package/dist/templates/skills/load-sample-data/SKILL.md +1 -1
  134. package/dist/templates/skills/visualize-semantic-model/SKILL.md +159 -0
  135. package/dist/templates/skills/visualize-semantic-model/scripts/render_graph.py +186 -0
  136. package/dist/{types-Y_ht_ja5.d.mts → types-CGjxcj4L.d.mts} +3 -0
  137. package/package.json +44 -7
  138. package/dist/adapters/oclif/commands/integrations/create.d.mts +0 -11
  139. package/dist/adapters/oclif/commands/integrations/create.mjs +0 -16
  140. package/dist/adapters/oclif/commands/integrations/get.mjs +0 -21
  141. package/dist/adapters/oclif/commands/integrations/list.d.mts +0 -11
  142. package/dist/adapters/oclif/commands/integrations/list.mjs +0 -16
  143. package/dist/adapters/oclif/commands/integrations/update.d.mts +0 -15
  144. package/dist/adapters/oclif/commands/integrations/update.mjs +0 -21
  145. package/dist/adapters/oclif/commands/overlays/diff.d.mts +0 -19
  146. package/dist/adapters/oclif/commands/overlays/diff.mjs +0 -80
  147. package/dist/adapters/oclif/commands/overlays/pull.d.mts +0 -15
  148. package/dist/adapters/oclif/commands/overlays/pull.mjs +0 -45
  149. package/dist/adapters/oclif/commands/overlays/push.d.mts +0 -18
  150. package/dist/adapters/oclif/commands/overlays/push.mjs +0 -59
  151. package/dist/adapters/oclif/commands/overlays/status.d.mts +0 -18
  152. package/dist/adapters/oclif/commands/overlays/status.mjs +0 -53
  153. package/dist/core-jpFPylBb.mjs +0 -997
  154. package/dist/index-DD2Vr-pu.d.mts +0 -193
  155. package/dist/types-C_p_6rkj.d.mts +0 -69
  156. /package/dist/templates/skills/{create-semantic-model → create-cubes}/references/key-patterns.md +0 -0
  157. /package/dist/templates/skills/{create-semantic-model → create-cubes}/references/validation-queries.md +0 -0
@@ -1,5 +1,5 @@
1
- import { b as getConfig, p as createApiClient } from "./core-jpFPylBb.mjs";
2
- import { t as BaseCommand } from "./base.command-YiwlGlKs.mjs";
1
+ import { f as createApiClient, v as getConfig } from "./core-CMrP5BQS.mjs";
2
+ import { t as BaseCommand } from "./base.command-cV5d65r8.mjs";
3
3
  import * as fs from "fs";
4
4
  import * as path from "path";
5
5
  import chalk from "chalk";
@@ -16,11 +16,13 @@ function defineApiCommand(spec) {
16
16
  static args = spec.args ?? {};
17
17
  static flags = spec.flags ?? {};
18
18
  async run() {
19
- const api = createApiClient(await getConfig());
19
+ const config = await getConfig();
20
+ const api = createApiClient(config);
20
21
  const flags = this.flags;
21
22
  const body = await parseBody(typeof flags.body === "string" ? flags.body : void 0);
22
23
  const result = await spec.call({
23
24
  api,
25
+ config,
24
26
  args: this.args,
25
27
  flags: this.flags,
26
28
  body,
@@ -61,12 +63,7 @@ async function readStdin() {
61
63
  function defaultRender(cmd, data) {
62
64
  if (data == null) return;
63
65
  if (Array.isArray(data)) {
64
- if (data.length === 0) {
65
- cmd.log("(no results)");
66
- return;
67
- }
68
- const rows = data.map((d) => toRow(d));
69
- cmd.table(rows);
66
+ renderList(cmd, data);
70
67
  return;
71
68
  }
72
69
  if (typeof data === "object") {
@@ -75,6 +72,43 @@ function defaultRender(cmd, data) {
75
72
  }
76
73
  cmd.log(String(data));
77
74
  }
75
+ /**
76
+ * Render an array of objects as a table. Honors a `columns` projection so
77
+ * resources can ship a curated default column set (gcloud-style) and users
78
+ * can narrow further with `--columns`.
79
+ */
80
+ function renderList(cmd, data, opts = {}) {
81
+ if (data.length === 0) {
82
+ cmd.log("(no results)");
83
+ return;
84
+ }
85
+ const fullRows = data.map((d) => toRow(d));
86
+ const columns = opts.columns?.length ? opts.columns.filter((c) => fullRows.some((r) => c in r)) : void 0;
87
+ const rows = columns ? fullRows.map((r) => Object.fromEntries(columns.map((c) => [c, r[c]]))) : fullRows;
88
+ cmd.table(rows, columns ? { columns: columns.map((c) => ({ key: c })) } : void 0);
89
+ }
90
+ /**
91
+ * Resolve the column projection from a `--columns` flag value and a
92
+ * resource-level default. `--columns` (comma-separated) wins; otherwise the
93
+ * default is used; otherwise undefined (caller renders every key).
94
+ */
95
+ function resolveColumns(flagValue, defaults) {
96
+ if (flagValue) return flagValue.split(",").map((c) => c.trim()).filter(Boolean);
97
+ return defaults;
98
+ }
99
+ /**
100
+ * Build a list-render function that resolves `--columns` against a
101
+ * resource-level default and delegates to `renderList`. Shared by the
102
+ * `listCommand` preset and any `defineApiCommand` caller that returns an
103
+ * array (e.g. `actions list`, `segments list-versions`).
104
+ */
105
+ function createListRender(defaultColumns) {
106
+ return (data, command) => {
107
+ if (!Array.isArray(data)) return;
108
+ const flags = command.flags;
109
+ renderList(command, data, { columns: resolveColumns(flags.columns, defaultColumns) });
110
+ };
111
+ }
78
112
  function toRow(d) {
79
113
  if (d == null || typeof d !== "object") return { value: d };
80
114
  const out = {};
@@ -87,4 +121,4 @@ function formatValue(v) {
87
121
  return String(v);
88
122
  }
89
123
  //#endregion
90
- export { defineApiCommand as n, bodyFlag as t };
124
+ export { resolveColumns as a, renderList as i, createListRender as n, defineApiCommand as r, bodyFlag as t };
@@ -0,0 +1,17 @@
1
+ import chalk from "chalk";
2
+ //#region src/adapters/oclif/iac-render.ts
3
+ const APPLY_ACTION_LABELS = {
4
+ create: chalk.green("create"),
5
+ update: chalk.yellow("update"),
6
+ unchanged: chalk.dim("unchanged"),
7
+ skipped: chalk.dim("skipped")
8
+ };
9
+ function renderIacErrors(errors, log) {
10
+ for (const e of errors) {
11
+ const loc = e.source ? `${e.source.file}${e.source.line ? `:${e.source.line}` : ""}` : "";
12
+ log(chalk.red(`error ${loc ? `[${loc}] ` : ""}${e.message}`));
13
+ if (e.hint) log(chalk.dim(` hint: ${e.hint}`));
14
+ }
15
+ }
16
+ //#endregion
17
+ export { renderIacErrors as n, APPLY_ACTION_LABELS as t };
@@ -0,0 +1,598 @@
1
+ import { c as StoredCredentials, i as OAuthCallbackResult, l as TokenResponse, r as ClerkUserInfo, s as OrganizationInfo } from "./types-CGjxcj4L.mjs";
2
+ import * as _$_revos_api_client0 from "@revos/api-client";
3
+ import { Client, ConnectionResponseDto, CreateConnectionDto, UpdateConnectionDto } from "@revos/api-client";
4
+ import * as _$yaml from "yaml";
5
+ import { Document } from "yaml";
6
+ import { ZodType, z } from "zod";
7
+
8
+ //#region src/core/types.d.ts
9
+ interface Config {
10
+ apiUrl: string;
11
+ token: string;
12
+ organizationId?: string;
13
+ }
14
+ //#endregion
15
+ //#region src/core/errors.d.ts
16
+ declare class ApiError extends Error {
17
+ readonly status: number;
18
+ readonly statusText: string;
19
+ readonly url: string;
20
+ readonly body: unknown;
21
+ name: string;
22
+ constructor(message: string, status: number, statusText: string, url: string, body: unknown);
23
+ }
24
+ //#endregion
25
+ //#region src/core/config.d.ts
26
+ declare const DEFAULT_API_URL = "https://api.revos.ai";
27
+ declare function getConfig(): Promise<Config>;
28
+ //#endregion
29
+ //#region src/core/auth/credentials-store.d.ts
30
+ declare function getCredentialsPath(): string;
31
+ declare function loadCredentials(): StoredCredentials | null;
32
+ declare function saveCredentials(credentials: StoredCredentials): void;
33
+ declare function deleteCredentials(): boolean;
34
+ declare function isTokenExpired(credentials: StoredCredentials): boolean;
35
+ //#endregion
36
+ //#region src/core/auth/oauth-server.d.ts
37
+ interface OAuthServerResult {
38
+ port: number;
39
+ waitForCallback: () => Promise<OAuthCallbackResult>;
40
+ shutdown: () => void;
41
+ }
42
+ declare function startOAuthServer(): Promise<OAuthServerResult>;
43
+ //#endregion
44
+ //#region src/core/auth/clerk-oauth.d.ts
45
+ declare const AUTH_ENVS: {
46
+ readonly production: {
47
+ readonly apiUrl: "https://api.revos.ai";
48
+ readonly authUrl: "https://clerk.revos.ai";
49
+ readonly authClientId: "Hkj5lEtyyF5DUQX6";
50
+ };
51
+ readonly development: {
52
+ readonly apiUrl: "https://api.revos.dev";
53
+ readonly authUrl: "https://strong-minnow-46.clerk.accounts.dev";
54
+ readonly authClientId: "o3eTaWPmeJAMfRPw";
55
+ };
56
+ };
57
+ type AuthEnv = keyof typeof AUTH_ENVS;
58
+ interface AuthConfig {
59
+ authUrl?: string;
60
+ authClientId?: string;
61
+ }
62
+ declare function setAuthConfig(config: AuthConfig): void;
63
+ declare function getActiveAuthConfig(): {
64
+ authUrl: string;
65
+ authClientId: string;
66
+ };
67
+ declare function setAuthEnv(env: AuthEnv): void;
68
+ interface PKCEChallenge {
69
+ codeVerifier: string;
70
+ codeChallenge: string;
71
+ state: string;
72
+ }
73
+ declare function generatePKCEChallenge(): PKCEChallenge;
74
+ declare function buildAuthorizationUrl(redirectUri: string, pkce: PKCEChallenge): string;
75
+ declare function exchangeCodeForTokens(code: string, redirectUri: string, codeVerifier: string): Promise<TokenResponse>;
76
+ declare function getUserInfo(accessToken: string): Promise<ClerkUserInfo>;
77
+ declare function tokenResponseToCredentials(tokenResponse: TokenResponse, userInfo: ClerkUserInfo): StoredCredentials;
78
+ declare function refreshAccessToken(refreshToken: string): Promise<TokenResponse>;
79
+ //#endregion
80
+ //#region src/core/utils.d.ts
81
+ declare function formatError(error: unknown): string;
82
+ declare function sanitizeFileName(name: string): string;
83
+ //#endregion
84
+ //#region src/core/url.d.ts
85
+ declare function resolveAppUrl(apiUrl: string): string;
86
+ //#endregion
87
+ //#region src/core/api/create-client.d.ts
88
+ type ApiClient = Client;
89
+ declare function createApiClient(config: {
90
+ apiUrl: string;
91
+ token: string;
92
+ organizationId?: string;
93
+ }): ApiClient;
94
+ declare function unwrap<T extends {
95
+ data: unknown;
96
+ }>(result: {
97
+ data?: T;
98
+ error?: unknown;
99
+ response?: Response;
100
+ request?: Request;
101
+ }): T["data"];
102
+ //#endregion
103
+ //#region src/core/iac/types.d.ts
104
+ declare const API_VERSION = "revos/v1";
105
+ interface SourceLocation {
106
+ file: string;
107
+ line?: number;
108
+ column?: number;
109
+ }
110
+ interface ProjectFile {
111
+ path: string;
112
+ metadata: {
113
+ name?: string;
114
+ orgId: string;
115
+ };
116
+ }
117
+ interface ResourceMetadata {
118
+ name: string;
119
+ id?: string;
120
+ }
121
+ type ResourceState = "ok" | "drifted" | "pending" | "tampered";
122
+ interface ResourceDoc<TSpec = unknown> {
123
+ kind: string;
124
+ metadata: ResourceMetadata;
125
+ spec: TSpec;
126
+ rawSpec: unknown;
127
+ source: SourceLocation;
128
+ docIndex: number;
129
+ document: Document;
130
+ }
131
+ type IacErrorCode = "apply" | "cycle" | "duplicate" | "env.missing" | "init.pull" | "invalid-name" | "pull" | "ref" | "schema" | "tampered" | "unknown-kind" | "yaml.parse";
132
+ interface IacError {
133
+ code: IacErrorCode;
134
+ message: string;
135
+ source?: SourceLocation;
136
+ hint?: string;
137
+ }
138
+ declare class IacAggregateError extends Error {
139
+ readonly errors: IacError[];
140
+ constructor(errors: IacError[]);
141
+ }
142
+ //#endregion
143
+ //#region src/core/iac/project.d.ts
144
+ declare const PROJECT_FILE = "revos.yaml";
145
+ declare const PROJECT_KIND = "Project";
146
+ declare class ProjectNotFoundError extends Error {
147
+ constructor(cwd: string);
148
+ }
149
+ interface DiscoverOptions {
150
+ cwd?: string;
151
+ projectPath?: string;
152
+ }
153
+ declare function discoverProject(opts?: DiscoverOptions): ProjectFile;
154
+ declare function projectRoot(project: ProjectFile): string;
155
+ declare function writeProjectFile(projectDir: string, metadata: {
156
+ name?: string;
157
+ orgId: string;
158
+ }): string;
159
+ //#endregion
160
+ //#region src/core/iac/parser/load.d.ts
161
+ interface LoadedFile {
162
+ path: string;
163
+ content: string;
164
+ }
165
+ interface ScanOptions {
166
+ root: string;
167
+ startPath?: string;
168
+ ignored?: ReadonlySet<string>;
169
+ }
170
+ declare function scanYamlFiles(opts: ScanOptions): LoadedFile[];
171
+ //#endregion
172
+ //#region src/core/iac/parser/documents.d.ts
173
+ interface ParsedDocument {
174
+ file: string;
175
+ index: number;
176
+ document: Document;
177
+ source: SourceLocation;
178
+ }
179
+ interface ParsedFile {
180
+ file: string;
181
+ documents: ParsedDocument[];
182
+ errors: IacError[];
183
+ }
184
+ declare function parseFiles(files: LoadedFile[]): ParsedFile[];
185
+ declare function parseFile(file: LoadedFile): ParsedFile;
186
+ declare function isResourceDocument(doc: Document): boolean;
187
+ declare function readResourceShape(doc: Document): {
188
+ apiVersion?: string;
189
+ kind?: string;
190
+ metadata?: {
191
+ name?: string;
192
+ id?: string;
193
+ };
194
+ spec?: unknown;
195
+ };
196
+ declare function locationFromOffset(content: string, offset: number | undefined, file: string): SourceLocation;
197
+ declare function asResourceDoc<TSpec>(parsed: ParsedDocument): ResourceDoc<TSpec> | null;
198
+ //#endregion
199
+ //#region src/core/iac/parser/index.d.ts
200
+ interface ResourceIndex {
201
+ byAddress: Map<string, ResourceDoc>;
202
+ all: ResourceDoc[];
203
+ errors: IacError[];
204
+ }
205
+ declare function buildIndex(resources: ResourceDoc[]): ResourceIndex;
206
+ declare function address(kind: string, name: string): string;
207
+ declare function isValidName(name: string): boolean;
208
+ //#endregion
209
+ //#region src/core/iac/providers/provider.d.ts
210
+ interface ResourceRef {
211
+ kind: string;
212
+ name: string;
213
+ }
214
+ interface ProviderCrudResult<TSpec> {
215
+ id: string;
216
+ spec: TSpec;
217
+ }
218
+ type RefResolver = (ref: ResourceRef) => string | undefined;
219
+ type IdResolver = (kind: string, id: string) => string | undefined;
220
+ interface ProviderContext {
221
+ orgId: string;
222
+ resolveRef: RefResolver;
223
+ resolveById: IdResolver;
224
+ }
225
+ interface Provider<TSpec = unknown> {
226
+ readonly kind: string;
227
+ readonly schema: ZodType<TSpec>;
228
+ readonly sensitivePaths: ReadonlyArray<string>;
229
+ readonly localOnlyPaths: ReadonlyArray<string>;
230
+ readonly dependsOn: ReadonlyArray<string>;
231
+ readonly computedPaths?: ReadonlyArray<string>;
232
+ extractRefs(spec: TSpec): ResourceRef[];
233
+ normalize(remoteSpec: unknown): TSpec;
234
+ inflateRemote(remoteSpec: unknown, ctx: ProviderContext): TSpec;
235
+ listRemote(ctx: ProviderContext): Promise<ReadonlyArray<{
236
+ id: string;
237
+ remote: unknown;
238
+ }>>;
239
+ deriveName(remoteSpec: unknown): string;
240
+ create(ctx: ProviderContext, spec: TSpec): Promise<ProviderCrudResult<TSpec>>;
241
+ read(ctx: ProviderContext, id: string): Promise<ProviderCrudResult<TSpec> | null>;
242
+ update(ctx: ProviderContext, id: string, spec: TSpec): Promise<ProviderCrudResult<TSpec>>;
243
+ delete(ctx: ProviderContext, id: string): Promise<void>;
244
+ }
245
+ //#endregion
246
+ //#region src/core/iac/providers/registry.d.ts
247
+ declare class ProviderRegistry {
248
+ private readonly providers;
249
+ register(provider: Provider): void;
250
+ get(kind: string): Provider | undefined;
251
+ has(kind: string): boolean;
252
+ kinds(): IterableIterator<string>;
253
+ }
254
+ //#endregion
255
+ //#region src/core/iac/validate/validate.d.ts
256
+ interface ValidationResult<TSpec> {
257
+ resource: ResourceDoc<TSpec>;
258
+ errors: IacError[];
259
+ }
260
+ declare function validateResource<TSpec>(resource: ResourceDoc, schema: ZodType<TSpec>): ValidationResult<TSpec>;
261
+ declare function validateAll(resources: ResourceDoc[], registry: ProviderRegistry): {
262
+ resources: ResourceDoc[];
263
+ errors: IacError[];
264
+ };
265
+ //#endregion
266
+ //#region src/core/iac/api/connections-client.d.ts
267
+ type RemoteConnection = ConnectionResponseDto["data"];
268
+ type ConnectionStatus = RemoteConnection["status"];
269
+ type ConnectionSchedule = RemoteConnection["schedule"];
270
+ type CreateConnectionBody = CreateConnectionDto;
271
+ type UpdateConnectionBody = UpdateConnectionDto;
272
+ interface ConnectionsClient {
273
+ list(): Promise<RemoteConnection[]>;
274
+ get(connectionId: string): Promise<RemoteConnection | null>;
275
+ create(body: CreateConnectionBody): Promise<RemoteConnection>;
276
+ update(connectionId: string, body: UpdateConnectionBody): Promise<RemoteConnection>;
277
+ delete(connectionId: string): Promise<void>;
278
+ }
279
+ declare function createSdkConnectionsClient(apiClient: ApiClient): ConnectionsClient;
280
+ //#endregion
281
+ //#region src/core/iac/providers/connection.provider.d.ts
282
+ declare const connectionSpecSchema: z.ZodObject<{
283
+ name: z.ZodString;
284
+ source: z.ZodObject<{
285
+ id: z.ZodString;
286
+ }, z.core.$strip>;
287
+ schedule: z.ZodDefault<z.ZodObject<{
288
+ units: z.ZodNumber;
289
+ timeUnit: z.ZodEnum<{
290
+ minutes: "minutes";
291
+ hours: "hours";
292
+ days: "days";
293
+ weeks: "weeks";
294
+ months: "months";
295
+ }>;
296
+ }, z.core.$strip>>;
297
+ streams: z.ZodDefault<z.ZodArray<z.ZodObject<{
298
+ name: z.ZodString;
299
+ namespace: z.ZodOptional<z.ZodString>;
300
+ syncMode: z.ZodOptional<z.ZodEnum<{
301
+ full_refresh_overwrite: "full_refresh_overwrite";
302
+ full_refresh_append: "full_refresh_append";
303
+ incremental_append: "incremental_append";
304
+ incremental_deduped_history: "incremental_deduped_history";
305
+ full_refresh_overwrite_deduped: "full_refresh_overwrite_deduped";
306
+ }>>;
307
+ cursorField: z.ZodOptional<z.ZodArray<z.ZodString>>;
308
+ primaryKey: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
309
+ selectedFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
310
+ fieldPath: z.ZodArray<z.ZodString>;
311
+ }, z.core.$strip>>>;
312
+ mappers: z.ZodOptional<z.ZodArray<z.ZodType<{
313
+ type: "hashing";
314
+ id?: string;
315
+ mapperConfiguration: {
316
+ targetField: string;
317
+ method: "MD2" | "MD5" | "SHA-1" | "SHA-224" | "SHA-256" | "SHA-384" | "SHA-512";
318
+ fieldNameSuffix: string;
319
+ };
320
+ } | {
321
+ type: "field-renaming";
322
+ id?: string;
323
+ mapperConfiguration: {
324
+ originalFieldName: string;
325
+ newFieldName: string;
326
+ };
327
+ } | {
328
+ type: "field-filtering";
329
+ id?: string;
330
+ mapperConfiguration: {
331
+ targetField: string;
332
+ };
333
+ } | {
334
+ type: "row-filtering";
335
+ id?: string;
336
+ mapperConfiguration: {
337
+ conditions: _$_revos_api_client0.ConnectionResponseDtoSchema0;
338
+ };
339
+ } | {
340
+ type: "encryption";
341
+ id?: string;
342
+ mapperConfiguration: {
343
+ algorithm: "RSA";
344
+ targetField: string;
345
+ fieldNameSuffix: string;
346
+ publicKey: string;
347
+ } | {
348
+ algorithm: "AES";
349
+ targetField: string;
350
+ fieldNameSuffix: string;
351
+ key: string;
352
+ mode: "CBC" | "CFB" | "OFB" | "CTR" | "GCM" | "ECB";
353
+ padding: "NoPadding" | "PKCS5Padding";
354
+ };
355
+ }, unknown, z.core.$ZodTypeInternals<{
356
+ type: "hashing";
357
+ id?: string;
358
+ mapperConfiguration: {
359
+ targetField: string;
360
+ method: "MD2" | "MD5" | "SHA-1" | "SHA-224" | "SHA-256" | "SHA-384" | "SHA-512";
361
+ fieldNameSuffix: string;
362
+ };
363
+ } | {
364
+ type: "field-renaming";
365
+ id?: string;
366
+ mapperConfiguration: {
367
+ originalFieldName: string;
368
+ newFieldName: string;
369
+ };
370
+ } | {
371
+ type: "field-filtering";
372
+ id?: string;
373
+ mapperConfiguration: {
374
+ targetField: string;
375
+ };
376
+ } | {
377
+ type: "row-filtering";
378
+ id?: string;
379
+ mapperConfiguration: {
380
+ conditions: _$_revos_api_client0.ConnectionResponseDtoSchema0;
381
+ };
382
+ } | {
383
+ type: "encryption";
384
+ id?: string;
385
+ mapperConfiguration: {
386
+ algorithm: "RSA";
387
+ targetField: string;
388
+ fieldNameSuffix: string;
389
+ publicKey: string;
390
+ } | {
391
+ algorithm: "AES";
392
+ targetField: string;
393
+ fieldNameSuffix: string;
394
+ key: string;
395
+ mode: "CBC" | "CFB" | "OFB" | "CTR" | "GCM" | "ECB";
396
+ padding: "NoPadding" | "PKCS5Padding";
397
+ };
398
+ }, unknown>>>>;
399
+ }, z.core.$strip>>>;
400
+ status: z.ZodDefault<z.ZodEnum<{
401
+ deprecated: "deprecated";
402
+ active: "active";
403
+ inactive: "inactive";
404
+ }>>;
405
+ prefix: z.ZodOptional<z.ZodString>;
406
+ }, z.core.$strip>;
407
+ type ConnectionSpec = z.infer<typeof connectionSpecSchema>;
408
+ declare function createConnectionProvider(client: ConnectionsClient): Provider<ConnectionSpec>;
409
+ //#endregion
410
+ //#region src/core/iac/api/cubes-client.d.ts
411
+ interface RemoteCube {
412
+ id: string;
413
+ name: string;
414
+ organizationId: string;
415
+ definition: Record<string, unknown>;
416
+ }
417
+ interface CreateCubeBody {
418
+ name: string;
419
+ definition: Record<string, unknown>;
420
+ }
421
+ interface UpdateCubeBody {
422
+ name?: string;
423
+ definition?: Record<string, unknown>;
424
+ }
425
+ interface CubesClient {
426
+ list(): Promise<RemoteCube[]>;
427
+ get(cubeId: string): Promise<RemoteCube | null>;
428
+ create(body: CreateCubeBody): Promise<RemoteCube>;
429
+ update(cubeId: string, body: UpdateCubeBody): Promise<RemoteCube>;
430
+ delete(cubeId: string): Promise<void>;
431
+ }
432
+ declare function createSdkCubesClient(apiClient: ApiClient): CubesClient;
433
+ //#endregion
434
+ //#region src/core/iac/providers/cube.provider.d.ts
435
+ declare const cubeSpecSchema: z.ZodObject<{
436
+ name: z.ZodString;
437
+ definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
438
+ }, z.core.$strip>;
439
+ type CubeSpec = z.infer<typeof cubeSpecSchema>;
440
+ declare function createCubeProvider(client: CubesClient): Provider<CubeSpec>;
441
+ //#endregion
442
+ //#region src/core/iac/providers/build-registry.d.ts
443
+ declare function buildIacRegistry(apiClient: ApiClient): ProviderRegistry;
444
+ //#endregion
445
+ //#region src/core/iac/ast/rewrite.d.ts
446
+ interface DocumentEdit {
447
+ docIndex: number;
448
+ mutate: (doc: _$yaml.Document) => void;
449
+ }
450
+ declare function rewriteYamlFile(filePath: string, edits: ReadonlyArray<DocumentEdit>): string;
451
+ declare function applyDocumentEdits(src: string, edits: ReadonlyArray<DocumentEdit>): string;
452
+ declare function setMetadataId(filePath: string, docIndex: number, id: string): string;
453
+ //#endregion
454
+ //#region src/core/iac/diff/diff.d.ts
455
+ type DiffChangeKind = "add" | "remove" | "change";
456
+ interface DiffChange {
457
+ kind: DiffChangeKind;
458
+ path: ReadonlyArray<string | number>;
459
+ before?: unknown;
460
+ after?: unknown;
461
+ sensitive: boolean;
462
+ }
463
+ declare function diffSpecs(before: unknown, after: unknown, sensitivePaths?: ReadonlyArray<string>): DiffChange[];
464
+ declare function formatDiffLine(c: DiffChange): string;
465
+ //#endregion
466
+ //#region src/core/iac/apply/apply.d.ts
467
+ interface ApplyOptions {
468
+ project: ProjectFile;
469
+ registry: ProviderRegistry;
470
+ startPath?: string;
471
+ dryRun?: boolean;
472
+ env?: NodeJS.ProcessEnv;
473
+ parallelism?: number;
474
+ }
475
+ type ApplyAction = "create" | "update" | "unchanged" | "skipped";
476
+ interface AppliedResource {
477
+ address: string;
478
+ kind: string;
479
+ name: string;
480
+ id?: string;
481
+ action: ApplyAction;
482
+ file: string;
483
+ diff?: DiffChange[];
484
+ }
485
+ interface ApplyResult {
486
+ applied: AppliedResource[];
487
+ errors: IacError[];
488
+ }
489
+ declare function apply(opts: ApplyOptions): Promise<ApplyResult>;
490
+ //#endregion
491
+ //#region src/core/iac/pull/pull.d.ts
492
+ type PullAction = "pulled" | "discovered" | "unchanged" | "skipped-dirty" | "skipped-no-id" | "skipped-not-found";
493
+ interface PulledResource {
494
+ address: string;
495
+ kind: string;
496
+ name: string;
497
+ id?: string;
498
+ action: PullAction;
499
+ file: string;
500
+ }
501
+ interface PullResult {
502
+ pulled: PulledResource[];
503
+ errors: IacError[];
504
+ }
505
+ interface PullOptions {
506
+ project: ProjectFile;
507
+ registry: ProviderRegistry;
508
+ startPath?: string;
509
+ force?: boolean;
510
+ dryRun?: boolean;
511
+ env?: NodeJS.ProcessEnv;
512
+ isDirty?: (filePath: string) => boolean;
513
+ }
514
+ declare function pull(opts: PullOptions): Promise<PullResult>;
515
+ //#endregion
516
+ //#region src/core/iac/refs/graph.d.ts
517
+ interface DependencyGraph {
518
+ levels: ResourceDoc[][];
519
+ errors: IacError[];
520
+ }
521
+ declare function buildDependencyGraph(resources: ResourceDoc[], registry: ProviderRegistry): DependencyGraph;
522
+ //#endregion
523
+ //#region src/core/iac/env/interpolate.d.ts
524
+ interface InterpolateResult<T> {
525
+ value: T;
526
+ errors: IacError[];
527
+ }
528
+ declare function interpolateSpec(spec: unknown, source: SourceLocation, env?: NodeJS.ProcessEnv): InterpolateResult<unknown>;
529
+ //#endregion
530
+ //#region src/core/iac/loader.d.ts
531
+ interface LoadOptions {
532
+ project: ProjectFile;
533
+ registry: ProviderRegistry;
534
+ startPath?: string;
535
+ env?: NodeJS.ProcessEnv;
536
+ validateSpecs?: boolean;
537
+ }
538
+ interface LoadResult {
539
+ index: ResourceIndex;
540
+ errors: IacError[];
541
+ }
542
+ declare function loadResources(opts: LoadOptions): LoadResult;
543
+ //#endregion
544
+ //#region src/core/iac/status.d.ts
545
+ interface ResourceStatus {
546
+ address: string;
547
+ kind: string;
548
+ name: string;
549
+ id?: string;
550
+ state: ResourceState;
551
+ details?: string;
552
+ source: {
553
+ file: string;
554
+ line?: number;
555
+ };
556
+ }
557
+ declare function resourceState(r: ResourceDoc): ResourceState;
558
+ declare function describeResources(load: LoadResult): ResourceStatus[];
559
+ declare namespace index_d_exports {
560
+ export { API_VERSION, AppliedResource, ApplyAction, ApplyOptions, ApplyResult, ConnectionSchedule, ConnectionSpec, ConnectionStatus, ConnectionsClient, CreateConnectionBody, CreateCubeBody, CubeSpec, CubesClient, DependencyGraph, DiffChange, DiffChangeKind, IacAggregateError, IacError, IacErrorCode, IdResolver, LoadOptions, LoadResult, LoadedFile, PROJECT_FILE, PROJECT_KIND, ProjectFile, ProjectNotFoundError, Provider, ProviderContext, ProviderCrudResult, ProviderRegistry, PullAction, PullOptions, PullResult, PulledResource, RefResolver, RemoteConnection, RemoteCube, ResourceDoc, ResourceIndex, ResourceMetadata, ResourceRef, ResourceState, ResourceStatus, SourceLocation, UpdateConnectionBody, UpdateCubeBody, address, apply, applyDocumentEdits, asResourceDoc, buildDependencyGraph, buildIacRegistry, buildIndex, connectionSpecSchema, createConnectionProvider, createCubeProvider, createSdkConnectionsClient, createSdkCubesClient, cubeSpecSchema, describeResources, diffSpecs, discoverProject, formatDiffLine, interpolateSpec, isResourceDocument, isValidName, loadResources, locationFromOffset, parseFile, parseFiles, projectRoot, pull, readResourceShape, resourceState, rewriteYamlFile, scanYamlFiles, setMetadataId, validateAll, validateResource, writeProjectFile };
561
+ }
562
+ //#endregion
563
+ //#region src/core/services/init.service.d.ts
564
+ interface InitOptions {
565
+ projectDir: string;
566
+ apiUrl: string;
567
+ token: string;
568
+ organizationId?: string;
569
+ organization?: OrganizationInfo;
570
+ allowExistingDir?: boolean;
571
+ pullIac?: boolean;
572
+ }
573
+ interface InitResult {
574
+ projectDir: string;
575
+ organization: OrganizationInfo;
576
+ createdFiles: string[];
577
+ pulledIac: PullResult;
578
+ }
579
+ declare class InitService {
580
+ private readonly templatesDir;
581
+ private static readonly PROJECT_DIRS;
582
+ private static readonly PROJECT_FILES;
583
+ constructor(templatesDir: string);
584
+ run(options: InitOptions): Promise<InitResult>;
585
+ private pullIacResources;
586
+ resolveOrganization(apiUrl: string, token: string, organizationId?: string): Promise<OrganizationInfo>;
587
+ private downloadGcpKey;
588
+ dryRun(projectDir: string): {
589
+ projectDir: string;
590
+ dirs: readonly string[];
591
+ files: readonly string[];
592
+ };
593
+ private scaffold;
594
+ private renderProjectMarker;
595
+ private renderTemplate;
596
+ }
597
+ //#endregion
598
+ export { deleteCredentials as A, getUserInfo as C, tokenResponseToCredentials as D, setAuthEnv as E, DEFAULT_API_URL as F, getConfig as I, ApiError as L, isTokenExpired as M, loadCredentials as N, OAuthServerResult as O, saveCredentials as P, Config as R, getActiveAuthConfig as S, setAuthConfig as T, AuthEnv as _, ResourceStatus as a, exchangeCodeForTokens as b, IacError as c, unwrap as d, resolveAppUrl as f, AuthConfig as g, AUTH_ENVS as h, index_d_exports as i, getCredentialsPath as j, startOAuthServer as k, ApiClient as l, sanitizeFileName as m, InitResult as n, PulledResource as o, formatError as p, InitService as r, AppliedResource as s, InitOptions as t, createApiClient as u, PKCEChallenge as v, refreshAccessToken as w, generatePKCEChallenge as x, buildAuthorizationUrl as y };