@revos/cli 0.2.1 → 0.2.3

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