@revenexx/integrations-node-devkit 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -12,6 +12,11 @@ import http from 'node:http';
12
12
  * Loading happens before option parsing, because the CLI reads `PORT` for its
13
13
  * default port; a `.env` that sets `PORT` would otherwise be read too late.
14
14
  *
15
+ * Exactly one file is ever loaded: `.env` by default, or the one named by
16
+ * `--env`, which *replaces* the default rather than layering on top of it.
17
+ * "Use this env file" is what the flag reads like, so leaving `.env` in play
18
+ * would be the surprise. `--no-env` loads none.
19
+ *
15
20
  * `process.loadEnvFile` deliberately does not overwrite variables that are
16
21
  * already set, so a shell-provided value always beats the file:
17
22
  *
@@ -22,6 +27,11 @@ import http from 'node:http';
22
27
  * the script path. `node cli.js --env-file missing` therefore dies inside Node
23
28
  * with exit code 9 before this module is ever reached, so the devkit cannot own
24
29
  * that name. {@link nodeOwnedEnvFlag} spots the mistake and explains it.
30
+ *
31
+ * `--env` takes a path rather than Laravel's bare environment name, because it
32
+ * mirrors Node's flag and because a path can point outside the package. A value
33
+ * that looks like it was meant as a name still gets a pointed error — see
34
+ * {@link missingFileMessage}.
25
35
  */
26
36
  /** Minimum Node version shipping `process.loadEnvFile`. */
27
37
  declare const ENV_FILE_MIN_NODE = "20.12";
@@ -30,6 +40,8 @@ interface EnvFileChoice {
30
40
  path: string | null;
31
41
  /** True when the file was named with `--env` rather than defaulted to. */
32
42
  explicit: boolean;
43
+ /** The `--env` value exactly as typed, kept for {@link missingFileMessage}. */
44
+ raw?: string;
33
45
  }
34
46
  /**
35
47
  * Returns the Node-owned env flag present in `argv`, if any. Node has already
@@ -37,7 +49,13 @@ interface EnvFileChoice {
37
49
  * instead of leaving the user wondering why `--env-file` behaved oddly.
38
50
  */
39
51
  declare function nodeOwnedEnvFlag(argv: string[]): string | null;
40
- /** Decides which env file to load. Pure — touches neither disk nor `process.env`. */
52
+ /**
53
+ * Decides which env file to load. Pure — touches neither disk nor `process.env`.
54
+ *
55
+ * A repeated `--env` resolves to the last one, matching every other option in
56
+ * the CLI, whose parse loop simply overwrites. Every occurrence is still
57
+ * validated, so a malformed earlier one is reported rather than skipped.
58
+ */
41
59
  declare function resolveEnvFile(argv: string[], cwd?: string): EnvFileChoice;
42
60
  interface LoadEnvFileOptions {
43
61
  cwd?: string;
@@ -49,7 +67,8 @@ interface LoadEnvFileOptions {
49
67
  *
50
68
  * A missing *default* `.env` is fine — most packages do not have one. A file
51
69
  * asked for by name and missing is an error: ignoring it would hide a typo and
52
- * resurface much later as a puzzling `Seed references ${X}` failure.
70
+ * resurface much later as a puzzling `Seed references ${X}` failure. There is no
71
+ * fallback to `.env` in that case, since naming a file replaces the default.
53
72
  */
54
73
  declare function loadEnvFile(argv: string[], options?: LoadEnvFileOptions): string | null;
55
74
 
@@ -63,6 +82,12 @@ declare class DevApiError extends Error {
63
82
  constructor(status: number, message: string, errors?: Record<string, string[]> | undefined);
64
83
  }
65
84
 
85
+ /** Identity of the npm package the nodes came from, as `GET /nodes` reports it. */
86
+ interface PackageInfo {
87
+ name: string;
88
+ version: string;
89
+ label: string;
90
+ }
66
91
  /**
67
92
  * A node package loaded into the dev process: its live `NODES` / `CREDENTIALS`
68
93
  * / `TEMPLATES` instances (so author-time resolvers, `test`, and `resolve` can
@@ -74,6 +99,10 @@ interface LoadedPackage {
74
99
  credentials: ICredential[];
75
100
  templates: ITemplateDescription[];
76
101
  manifest: NodeManifest;
102
+ /** Reported as each node's `package`; the contract declares it non-null. */
103
+ packageInfo: PackageInfo;
104
+ /** Stands in for the service's per-node `created_at`/`updated_at`. */
105
+ loadedAt: string;
77
106
  }
78
107
  interface PackageExports {
79
108
  NODES?: unknown;
@@ -85,7 +114,7 @@ interface PackageExports {
85
114
  * Mirrors the checks in the SDK's `rvnxx-nodes manifest` CLI so the dev loop
86
115
  * and the build produce identical manifests.
87
116
  */
88
- declare function resolveExports(mod: PackageExports): LoadedPackage;
117
+ declare function resolveExports(mod: PackageExports, packageInfo?: PackageInfo): LoadedPackage;
89
118
  /**
90
119
  * Registers the `tsx` ESM loader once per process so `import()` can load
91
120
  * TypeScript sources directly. Idempotent.
@@ -118,6 +147,10 @@ interface CredentialRecord {
118
147
  config: Record<string, unknown>;
119
148
  /** System-managed long-lived secrets (e.g. an OAuth refresh token). */
120
149
  durableCreds: Record<string, unknown> | null;
150
+ /** Outcome of the last `POST /credentials/{id}/test`, which the contract reports. */
151
+ lastTestAt: string | null;
152
+ lastTestOk: boolean | null;
153
+ lastTestMessage: string | null;
121
154
  createdAt: string;
122
155
  updatedAt: string;
123
156
  }
@@ -127,10 +160,22 @@ interface SecretRecord {
127
160
  createdAt: string;
128
161
  updatedAt: string;
129
162
  }
163
+ /**
164
+ * Field names follow the service's contract: the graph is `blob`, tagged with the
165
+ * `blob_definition_version` it was written against. The mock used to call it
166
+ * `definition`, which meant a workflow saved from the real UI silently lost its
167
+ * graph — the UI sends `blob`, so `body.definition` was always undefined.
168
+ */
130
169
  interface WorkflowRecord {
131
170
  id: number;
132
171
  name: string;
133
- definition: Record<string, unknown>;
172
+ description: string | null;
173
+ blob: Record<string, unknown>;
174
+ blobDefinitionVersion: string;
175
+ active: boolean;
176
+ executionMode: string;
177
+ /** Bumped on every update, like the service's revision counter. */
178
+ revision: number;
134
179
  buildStatus: string;
135
180
  createdAt: string;
136
181
  updatedAt: string;
@@ -153,7 +198,13 @@ interface DevStoreSnapshot {
153
198
  triggers: TriggerRecord[];
154
199
  nextWorkflowId: number;
155
200
  }
156
- declare const STORE_SCHEMA_VERSION = 1;
201
+ /**
202
+ * Bumped to 2 when workflows moved from `definition` to the contract's `blob` /
203
+ * `blob_definition_version` / `active` / `execution_mode`. `loadState` discards an
204
+ * overlay whose version does not match, which is the migration: seeds are the
205
+ * source of truth, the overlay is disposable session state.
206
+ */
207
+ declare const STORE_SCHEMA_VERSION = 2;
157
208
  declare class DevStore {
158
209
  private onChange?;
159
210
  private credentials;
@@ -181,6 +232,14 @@ declare class DevStore {
181
232
  durableCreds?: Record<string, unknown> | null;
182
233
  }): CredentialRecord;
183
234
  updateCredential(id: string, patch: Partial<Pick<CredentialRecord, 'name' | 'config' | 'status' | 'durableCreds'>>): CredentialRecord | undefined;
235
+ /**
236
+ * Records the outcome of a credential test. The service persists this on the
237
+ * record and reports it back from `POST /credentials/{id}/test`.
238
+ */
239
+ recordCredentialTest(id: string, result: {
240
+ ok: boolean;
241
+ message?: string | null;
242
+ }): CredentialRecord | undefined;
184
243
  deleteCredential(id: string): boolean;
185
244
  listSecrets(): SecretRecord[];
186
245
  getSecret(key: string): SecretRecord | undefined;
@@ -190,9 +249,13 @@ declare class DevStore {
190
249
  getWorkflow(id: number): WorkflowRecord | undefined;
191
250
  createWorkflow(input: {
192
251
  name: string;
193
- definition: Record<string, unknown>;
252
+ blob: Record<string, unknown>;
253
+ blobDefinitionVersion?: string;
254
+ description?: string | null;
255
+ active?: boolean;
256
+ executionMode?: string;
194
257
  }): WorkflowRecord;
195
- updateWorkflow(id: number, patch: Partial<Pick<WorkflowRecord, 'name' | 'definition' | 'buildStatus'>>): WorkflowRecord | undefined;
258
+ updateWorkflow(id: number, patch: Partial<Pick<WorkflowRecord, 'name' | 'description' | 'blob' | 'blobDefinitionVersion' | 'active' | 'executionMode' | 'buildStatus'>>): WorkflowRecord | undefined;
196
259
  deleteWorkflow(id: number): boolean;
197
260
  listTriggers(workflowId: number): TriggerRecord[];
198
261
  getTrigger(id: string): TriggerRecord | undefined;
@@ -244,7 +307,16 @@ interface SecretSeed {
244
307
  }
245
308
  interface WorkflowSeed {
246
309
  name: string;
247
- definition: Record<string, unknown>;
310
+ /** The workflow graph, named as the service names it. */
311
+ blob?: Record<string, unknown>;
312
+ /**
313
+ * @deprecated The mock called this `definition` before it was aligned to the
314
+ * service contract. Still accepted so existing seed files keep working.
315
+ */
316
+ definition?: Record<string, unknown>;
317
+ description?: string | null;
318
+ active?: boolean;
319
+ executionMode?: string;
248
320
  }
249
321
  interface DevSeeds {
250
322
  credentials?: CredentialSeed[];
package/dist/index.d.ts CHANGED
@@ -12,6 +12,11 @@ import http from 'node:http';
12
12
  * Loading happens before option parsing, because the CLI reads `PORT` for its
13
13
  * default port; a `.env` that sets `PORT` would otherwise be read too late.
14
14
  *
15
+ * Exactly one file is ever loaded: `.env` by default, or the one named by
16
+ * `--env`, which *replaces* the default rather than layering on top of it.
17
+ * "Use this env file" is what the flag reads like, so leaving `.env` in play
18
+ * would be the surprise. `--no-env` loads none.
19
+ *
15
20
  * `process.loadEnvFile` deliberately does not overwrite variables that are
16
21
  * already set, so a shell-provided value always beats the file:
17
22
  *
@@ -22,6 +27,11 @@ import http from 'node:http';
22
27
  * the script path. `node cli.js --env-file missing` therefore dies inside Node
23
28
  * with exit code 9 before this module is ever reached, so the devkit cannot own
24
29
  * that name. {@link nodeOwnedEnvFlag} spots the mistake and explains it.
30
+ *
31
+ * `--env` takes a path rather than Laravel's bare environment name, because it
32
+ * mirrors Node's flag and because a path can point outside the package. A value
33
+ * that looks like it was meant as a name still gets a pointed error — see
34
+ * {@link missingFileMessage}.
25
35
  */
26
36
  /** Minimum Node version shipping `process.loadEnvFile`. */
27
37
  declare const ENV_FILE_MIN_NODE = "20.12";
@@ -30,6 +40,8 @@ interface EnvFileChoice {
30
40
  path: string | null;
31
41
  /** True when the file was named with `--env` rather than defaulted to. */
32
42
  explicit: boolean;
43
+ /** The `--env` value exactly as typed, kept for {@link missingFileMessage}. */
44
+ raw?: string;
33
45
  }
34
46
  /**
35
47
  * Returns the Node-owned env flag present in `argv`, if any. Node has already
@@ -37,7 +49,13 @@ interface EnvFileChoice {
37
49
  * instead of leaving the user wondering why `--env-file` behaved oddly.
38
50
  */
39
51
  declare function nodeOwnedEnvFlag(argv: string[]): string | null;
40
- /** Decides which env file to load. Pure — touches neither disk nor `process.env`. */
52
+ /**
53
+ * Decides which env file to load. Pure — touches neither disk nor `process.env`.
54
+ *
55
+ * A repeated `--env` resolves to the last one, matching every other option in
56
+ * the CLI, whose parse loop simply overwrites. Every occurrence is still
57
+ * validated, so a malformed earlier one is reported rather than skipped.
58
+ */
41
59
  declare function resolveEnvFile(argv: string[], cwd?: string): EnvFileChoice;
42
60
  interface LoadEnvFileOptions {
43
61
  cwd?: string;
@@ -49,7 +67,8 @@ interface LoadEnvFileOptions {
49
67
  *
50
68
  * A missing *default* `.env` is fine — most packages do not have one. A file
51
69
  * asked for by name and missing is an error: ignoring it would hide a typo and
52
- * resurface much later as a puzzling `Seed references ${X}` failure.
70
+ * resurface much later as a puzzling `Seed references ${X}` failure. There is no
71
+ * fallback to `.env` in that case, since naming a file replaces the default.
53
72
  */
54
73
  declare function loadEnvFile(argv: string[], options?: LoadEnvFileOptions): string | null;
55
74
 
@@ -63,6 +82,12 @@ declare class DevApiError extends Error {
63
82
  constructor(status: number, message: string, errors?: Record<string, string[]> | undefined);
64
83
  }
65
84
 
85
+ /** Identity of the npm package the nodes came from, as `GET /nodes` reports it. */
86
+ interface PackageInfo {
87
+ name: string;
88
+ version: string;
89
+ label: string;
90
+ }
66
91
  /**
67
92
  * A node package loaded into the dev process: its live `NODES` / `CREDENTIALS`
68
93
  * / `TEMPLATES` instances (so author-time resolvers, `test`, and `resolve` can
@@ -74,6 +99,10 @@ interface LoadedPackage {
74
99
  credentials: ICredential[];
75
100
  templates: ITemplateDescription[];
76
101
  manifest: NodeManifest;
102
+ /** Reported as each node's `package`; the contract declares it non-null. */
103
+ packageInfo: PackageInfo;
104
+ /** Stands in for the service's per-node `created_at`/`updated_at`. */
105
+ loadedAt: string;
77
106
  }
78
107
  interface PackageExports {
79
108
  NODES?: unknown;
@@ -85,7 +114,7 @@ interface PackageExports {
85
114
  * Mirrors the checks in the SDK's `rvnxx-nodes manifest` CLI so the dev loop
86
115
  * and the build produce identical manifests.
87
116
  */
88
- declare function resolveExports(mod: PackageExports): LoadedPackage;
117
+ declare function resolveExports(mod: PackageExports, packageInfo?: PackageInfo): LoadedPackage;
89
118
  /**
90
119
  * Registers the `tsx` ESM loader once per process so `import()` can load
91
120
  * TypeScript sources directly. Idempotent.
@@ -118,6 +147,10 @@ interface CredentialRecord {
118
147
  config: Record<string, unknown>;
119
148
  /** System-managed long-lived secrets (e.g. an OAuth refresh token). */
120
149
  durableCreds: Record<string, unknown> | null;
150
+ /** Outcome of the last `POST /credentials/{id}/test`, which the contract reports. */
151
+ lastTestAt: string | null;
152
+ lastTestOk: boolean | null;
153
+ lastTestMessage: string | null;
121
154
  createdAt: string;
122
155
  updatedAt: string;
123
156
  }
@@ -127,10 +160,22 @@ interface SecretRecord {
127
160
  createdAt: string;
128
161
  updatedAt: string;
129
162
  }
163
+ /**
164
+ * Field names follow the service's contract: the graph is `blob`, tagged with the
165
+ * `blob_definition_version` it was written against. The mock used to call it
166
+ * `definition`, which meant a workflow saved from the real UI silently lost its
167
+ * graph — the UI sends `blob`, so `body.definition` was always undefined.
168
+ */
130
169
  interface WorkflowRecord {
131
170
  id: number;
132
171
  name: string;
133
- definition: Record<string, unknown>;
172
+ description: string | null;
173
+ blob: Record<string, unknown>;
174
+ blobDefinitionVersion: string;
175
+ active: boolean;
176
+ executionMode: string;
177
+ /** Bumped on every update, like the service's revision counter. */
178
+ revision: number;
134
179
  buildStatus: string;
135
180
  createdAt: string;
136
181
  updatedAt: string;
@@ -153,7 +198,13 @@ interface DevStoreSnapshot {
153
198
  triggers: TriggerRecord[];
154
199
  nextWorkflowId: number;
155
200
  }
156
- declare const STORE_SCHEMA_VERSION = 1;
201
+ /**
202
+ * Bumped to 2 when workflows moved from `definition` to the contract's `blob` /
203
+ * `blob_definition_version` / `active` / `execution_mode`. `loadState` discards an
204
+ * overlay whose version does not match, which is the migration: seeds are the
205
+ * source of truth, the overlay is disposable session state.
206
+ */
207
+ declare const STORE_SCHEMA_VERSION = 2;
157
208
  declare class DevStore {
158
209
  private onChange?;
159
210
  private credentials;
@@ -181,6 +232,14 @@ declare class DevStore {
181
232
  durableCreds?: Record<string, unknown> | null;
182
233
  }): CredentialRecord;
183
234
  updateCredential(id: string, patch: Partial<Pick<CredentialRecord, 'name' | 'config' | 'status' | 'durableCreds'>>): CredentialRecord | undefined;
235
+ /**
236
+ * Records the outcome of a credential test. The service persists this on the
237
+ * record and reports it back from `POST /credentials/{id}/test`.
238
+ */
239
+ recordCredentialTest(id: string, result: {
240
+ ok: boolean;
241
+ message?: string | null;
242
+ }): CredentialRecord | undefined;
184
243
  deleteCredential(id: string): boolean;
185
244
  listSecrets(): SecretRecord[];
186
245
  getSecret(key: string): SecretRecord | undefined;
@@ -190,9 +249,13 @@ declare class DevStore {
190
249
  getWorkflow(id: number): WorkflowRecord | undefined;
191
250
  createWorkflow(input: {
192
251
  name: string;
193
- definition: Record<string, unknown>;
252
+ blob: Record<string, unknown>;
253
+ blobDefinitionVersion?: string;
254
+ description?: string | null;
255
+ active?: boolean;
256
+ executionMode?: string;
194
257
  }): WorkflowRecord;
195
- updateWorkflow(id: number, patch: Partial<Pick<WorkflowRecord, 'name' | 'definition' | 'buildStatus'>>): WorkflowRecord | undefined;
258
+ updateWorkflow(id: number, patch: Partial<Pick<WorkflowRecord, 'name' | 'description' | 'blob' | 'blobDefinitionVersion' | 'active' | 'executionMode' | 'buildStatus'>>): WorkflowRecord | undefined;
196
259
  deleteWorkflow(id: number): boolean;
197
260
  listTriggers(workflowId: number): TriggerRecord[];
198
261
  getTrigger(id: string): TriggerRecord | undefined;
@@ -244,7 +307,16 @@ interface SecretSeed {
244
307
  }
245
308
  interface WorkflowSeed {
246
309
  name: string;
247
- definition: Record<string, unknown>;
310
+ /** The workflow graph, named as the service names it. */
311
+ blob?: Record<string, unknown>;
312
+ /**
313
+ * @deprecated The mock called this `definition` before it was aligned to the
314
+ * service contract. Still accepted so existing seed files keep working.
315
+ */
316
+ definition?: Record<string, unknown>;
317
+ description?: string | null;
318
+ active?: boolean;
319
+ executionMode?: string;
248
320
  }
249
321
  interface DevSeeds {
250
322
  credentials?: CredentialSeed[];
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  testCredentialConfig,
31
31
  testCredentialInstance,
32
32
  validateNodeConfig
33
- } from "./chunk-UBYGZFB7.js";
33
+ } from "./chunk-PS3HCKE7.js";
34
34
  export {
35
35
  DEVKIT_VERSION,
36
36
  DEV_TENANT_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/integrations-node-devkit",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Local development kit for Revenexx integration node packages — a mock Integrations API for previewing nodes/credentials/templates in the Cockpit UI, plus a unit-testing harness. Dev/CI only, never bundled.",
5
5
  "keywords": [
6
6
  "revenexx",
@@ -43,7 +43,8 @@
43
43
  },
44
44
  "files": [
45
45
  "dist",
46
- "assets"
46
+ "assets",
47
+ "preview-host"
47
48
  ],
48
49
  "scripts": {
49
50
  "build": "tsup",
@@ -54,7 +55,8 @@
54
55
  "format": "biome format --write src tests",
55
56
  "typecheck": "tsc --noEmit -p tsconfig.test.json",
56
57
  "prepublishOnly": "npm run build",
57
- "release": "changeset publish"
58
+ "release": "changeset publish",
59
+ "refresh-contract": "node scripts/refresh-contract.mjs"
58
60
  },
59
61
  "dependencies": {
60
62
  "tsx": "^4.0.0"
@@ -66,7 +68,8 @@
66
68
  "@types/node": "^24.0.0",
67
69
  "tsup": "^8.0.0",
68
70
  "typescript": "^5.0.0",
69
- "vitest": "^2.1.0"
71
+ "vitest": "^2.1.0",
72
+ "yaml": "^2.9.0"
70
73
  },
71
74
  "peerDependencies": {
72
75
  "@revenexx/integrations-node-sdk": ">=0.13.0",
@@ -0,0 +1,22 @@
1
+ <!--
2
+ Shell mirrors services/integrations/studio-ui's app.vue (the official minimal
3
+ host for @revenexx/studio-integrations): the studio pages size themselves
4
+ against a definite height (h-svh), the brand background is #f3f1fa, and the
5
+ module's pages call toast.* (vue-sonner) so a global <Toaster> mount is
6
+ required. NuxtLoadingIndicator covers the on-demand route compile in dev.
7
+ -->
8
+ <script setup lang="ts">
9
+ import { Toaster } from '@revenexx/studio'
10
+
11
+ useHead({ title: 'Integration Studio — devkit preview' })
12
+ </script>
13
+
14
+ <template>
15
+ <div class="flex h-svh flex-col overflow-hidden bg-[#f3f1fa] text-foreground">
16
+ <NuxtLoadingIndicator color="var(--color-primary, #620DFF)" :height="3" />
17
+ <div class="min-h-0 flex-1 pt-3">
18
+ <NuxtPage />
19
+ </div>
20
+ <Toaster rich-colors position="bottom-right" :duration="3500" close-button />
21
+ </div>
22
+ </template>
@@ -0,0 +1,22 @@
1
+ /* Tailwind v4 wiring per @revenexx/studio's README. The @source globs are
2
+ relative to THIS file (../../ is the host root); they tell Tailwind's JIT to
3
+ scan the shipped component classes of studio + studio-shared +
4
+ studio-integrations, or those components render unstyled.
5
+ Note: tw-animate-css is deliberately NOT imported — it is not installed. */
6
+ @import "tailwindcss";
7
+ @import "@revenexx/studio/tokens";
8
+ @import "@revenexx/studio/fonts";
9
+
10
+ @source "../../node_modules/@revenexx/studio/dist";
11
+ @source "../../node_modules/@revenexx/studio-shared/components";
12
+ @source "../../node_modules/@revenexx/studio-integrations/dist/runtime";
13
+
14
+ /* Phase 1: workflow EXECUTION is not wired up in the devkit preview yet, so the
15
+ Workflows surface is hidden until phase 2. This hides the sidebar nav entry
16
+ and any deep links to the workflow editor; the routes are also redirected by
17
+ middleware/hide-workflows.global.ts. Hiding has to happen host-side because
18
+ studio-integrations' Sidebar nav items are hardcoded with no module option to
19
+ suppress them. To re-enable in phase 2, drop these two rules and the
20
+ middleware. */
21
+ a[href^="/integrations/workflows"] { display: none !important; }
22
+ li:has(> a[href^="/integrations/workflows"]) { display: none !important; }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Auto-imported no-op stubs for the full-cockpit "console" composables that some
3
+ * studio-integrations components reach for — notably `CredentialRevenexxSource`,
4
+ * the "Use revenexx managed source" picker rendered unconditionally in
5
+ * `CredentialCreateDialog` for the `revenexx:sftp` / `smtp` / `api` slugs.
6
+ *
7
+ * The slimmed preview has no console gateways (tenants, markets, managed SFTP /
8
+ * mail / API keys), so without these the picker throws "useConsoleTenants is not
9
+ * defined" at setup. That crashes the whole subtree and takes its sibling manual
10
+ * config fields (rendered with v-show) down with it — leaving the credential
11
+ * dialog with NO input fields at all. These stubs let the picker mount empty
12
+ * instead of crashing, so manual credential creation works.
13
+ *
14
+ * Mirrors `app/composables/consoleStubs.ts` in services/integrations/studio-ui.
15
+ *
16
+ * Caveat: `revenexx:api` managed sources still cannot be populated (no
17
+ * gateways) — seed such credentials via `dev/seeds` instead. Standard types
18
+ * (smtp/sftp/ftp/http-bearer/deepl) create fine.
19
+ */
20
+ import { ref } from 'vue'
21
+
22
+ export function useConsoleTenants() {
23
+ return { tenants: ref([]), onlyTenantSlug: ref(null), load: async () => {} }
24
+ }
25
+ export function useActiveMarket() {
26
+ return {
27
+ markets: ref([]),
28
+ activeCode: ref(''),
29
+ isGlobal: ref(true),
30
+ GLOBAL_MARKET_CODE: '__global__',
31
+ fetchMarkets: async () => {},
32
+ }
33
+ }
34
+ export function useConsoleSftp() {
35
+ return {
36
+ accounts: ref([]),
37
+ load: async () => {},
38
+ revealPassword: async () => ({}),
39
+ create: async () => ({}),
40
+ refresh: async () => ({}),
41
+ }
42
+ }
43
+ export function useMailAdmin() {
44
+ return {
45
+ listCredentials: async () => [],
46
+ getCredential: async () => ({}),
47
+ createCredential: async () => ({}),
48
+ }
49
+ }
50
+ export function useConsoleApiKeys() {
51
+ return { create: async () => ({ secret: '' }) }
52
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Phase 1: workflow execution isn't available in the devkit preview, so the
3
+ * Workflows editor pages are off-limits until phase 2. Any navigation to them
4
+ * (deep links from the dashboard, direct URLs) bounces back to the Integrations
5
+ * dashboard. The nav entry itself is hidden via assets/css/main.css.
6
+ *
7
+ * To re-enable in phase 2, delete this file and the two CSS rules.
8
+ */
9
+ export default defineNuxtRouteMiddleware((to) => {
10
+ if (to.path === '/integrations/workflows' || to.path.startsWith('/integrations/workflows/')) {
11
+ return navigateTo('/integrations')
12
+ }
13
+ })
@@ -0,0 +1,38 @@
1
+ import tailwindcss from '@tailwindcss/vite';
2
+
3
+ // Minimal preview host for local integration-node development.
4
+ //
5
+ // This file ships inside `@revenexx/integrations-node-devkit` and is copied into
6
+ // a version-keyed cache directory on every `integrations-devkit preview`. Do not
7
+ // edit the copy — it is replaced whenever the devkit version changes. To hack on
8
+ // the host, take an unmanaged copy with `integrations-devkit init-preview --dir
9
+ // ./my-preview`.
10
+ export default defineNuxtConfig({
11
+ compatibilityDate: '2025-01-01',
12
+ // One host directory is shared by every node package on this machine — that is
13
+ // the point, it is what makes the ~500 MB dependency tree a one-time cost. The
14
+ // BUILD however must not be shared: two repos running `preview` at the same time
15
+ // would otherwise compile into the same `.nuxt/`, and the second one to start
16
+ // would serve the first one's app. `preview` therefore points each repo at its
17
+ // own build dir; a manual `npm run dev` in here keeps the default.
18
+ ...(process.env.DEVKIT_NUXT_BUILD_DIR ? { buildDir: process.env.DEVKIT_NUXT_BUILD_DIR } : {}),
19
+ // SPA: no SSR, so the studio's browser-only composables (localStorage etc.)
20
+ // behave exactly as in the real cockpit, and boot is fast.
21
+ ssr: false,
22
+ // studio-shared 0.2.x ships as a Nuxt MODULE (not a layer) — it must be
23
+ // registered in 'modules', before studio-integrations which builds on it.
24
+ // @solar-icons/nuxt provides the #solar-icons alias the studio components import.
25
+ modules: ['@revenexx/studio-shared', '@solar-icons/nuxt', '@revenexx/studio-integrations'],
26
+ css: ['~/assets/css/main.css'],
27
+ vite: { plugins: [tailwindcss()] },
28
+ runtimeConfig: {
29
+ public: {
30
+ // Overridden at runtime by NUXT_PUBLIC_* env, which the `preview` command
31
+ // passes to the Nuxt child process; the generated `.env` carries the same
32
+ // values so a manual `npm run dev` in the host directory also works.
33
+ integrationsApi: '',
34
+ devToken: '',
35
+ devTenant: '',
36
+ },
37
+ },
38
+ });
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "integrations-preview-host",
3
+ "private": true,
4
+ "type": "module",
5
+ "description": "Nuxt host for the devkit preview. Shipped inside @revenexx/integrations-node-devkit and materialized into a version-keyed cache dir at run time — never edited in place.",
6
+ "scripts": {
7
+ "dev": "nuxt dev",
8
+ "build": "nuxt build"
9
+ },
10
+ "dependencies": {
11
+ "@dagrejs/dagre": "^3.0.0",
12
+ "@revenexx/studio": "^0.1.3",
13
+ "@revenexx/studio-integrations": "0.5.1",
14
+ "@revenexx/studio-shared": "^0.2.0",
15
+ "@solar-icons/nuxt": "^1.2.1",
16
+ "@tiptap/core": "^3.28.0",
17
+ "@tiptap/extension-document": "^3.28.0",
18
+ "@tiptap/extension-history": "^3.28.0",
19
+ "@tiptap/extension-paragraph": "^3.28.0",
20
+ "@tiptap/extension-text": "^3.28.0",
21
+ "@tiptap/pm": "^3.28.0",
22
+ "@tiptap/vue-3": "^3.28.0",
23
+ "@vue-flow/background": "^1.3.2",
24
+ "@vue-flow/controls": "^1.1.3",
25
+ "@vue-flow/core": "^1.48.2",
26
+ "@vue-flow/minimap": "^1.5.4",
27
+ "@vue-flow/node-toolbar": "^1.1.1",
28
+ "lucide-vue-next": "^1.0.0",
29
+ "nuxt": "^4.0.0",
30
+ "vue": "^3.5.0",
31
+ "vue-sonner": "^2.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@tailwindcss/vite": "^4.0.0",
35
+ "tailwindcss": "^4.0.0"
36
+ }
37
+ }
@@ -0,0 +1,63 @@
1
+ <!--
2
+ Landing page styled after services/integrations/studio-ui's pages/index.vue —
3
+ same studio design tokens (bg-card, text-mono, bg-primary, muted) so `/` looks
4
+ like the real dev host. No token gate: the devkit bakes a fixed dev token.
5
+ Workflows is deliberately absent from the quick links (phase 1).
6
+ -->
7
+ <template>
8
+ <div class="mx-auto flex min-h-full max-w-xl flex-col justify-center gap-6 px-6 py-12">
9
+ <div>
10
+ <p class="text-mono text-muted-foreground">Integrations · node devkit</p>
11
+ <h1 class="mt-1 text-2xl font-medium">Integration Studio — Preview</h1>
12
+ <p class="mt-2 text-sm text-muted-foreground">
13
+ Lokaler Host für <code>@revenexx/studio-integrations</code> gegen die Mock-API
14
+ deines Node-Pakets. Authentifizierung ist ein festes Dev-Token — nichts einzugeben.
15
+ </p>
16
+ </div>
17
+
18
+ <div class="rounded-lg border border-black/[0.06] bg-card p-5 text-sm shadow-sm">
19
+ <p class="text-mono text-muted-foreground">Session</p>
20
+ <dl class="mt-2 grid grid-cols-[7rem_1fr] gap-y-1">
21
+ <dt class="text-muted-foreground">Mock API</dt>
22
+ <dd class="truncate font-mono text-xs leading-5">{{ api }}</dd>
23
+ <dt class="text-muted-foreground">Tenant</dt>
24
+ <dd class="font-mono text-xs leading-5">{{ tenant }}</dd>
25
+ </dl>
26
+ </div>
27
+
28
+ <div class="rounded-lg border border-black/[0.06] bg-card p-5 shadow-sm">
29
+ <p class="text-mono text-muted-foreground">Einstieg</p>
30
+ <div class="mt-3 flex flex-col gap-4">
31
+ <NuxtLink
32
+ to="/nodes"
33
+ class="inline-flex w-fit items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:opacity-90"
34
+ >
35
+ Lokale Nodes öffnen — Preview + Validierung
36
+ </NuxtLink>
37
+ <div class="flex flex-wrap gap-x-4 gap-y-1.5">
38
+ <NuxtLink
39
+ v-for="link in quickLinks"
40
+ :key="link.to"
41
+ :to="link.to"
42
+ class="text-sm text-primary hover:underline"
43
+ >
44
+ {{ link.label }}
45
+ </NuxtLink>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <script setup lang="ts">
53
+ const rc = useRuntimeConfig().public
54
+ const api = rc.integrationsApi
55
+ const tenant = (rc.devTenant as string) || 'dev-tenant'
56
+
57
+ const quickLinks = [
58
+ { to: '/integrations', label: 'Overview' },
59
+ { to: '/integrations/credentials', label: 'Credentials' },
60
+ { to: '/integrations/secrets', label: 'Secrets' },
61
+ { to: '/nodes', label: 'Local nodes' },
62
+ ]
63
+ </script>