@revenexx/studio-integrations 0.2.0 → 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/README.md CHANGED
@@ -49,3 +49,34 @@ Adjust the relative paths to reach `node_modules` from your CSS file.
49
49
  `@revenexx/studio`, `@revenexx/studio-shared`, `nuxt` ^4, `vue` ^3.5,
50
50
  `@vue-flow/*` + `@dagrejs/dagre` (workflow editor), `lucide-vue-next`; register
51
51
  `@solar-icons/nuxt` in the host.
52
+
53
+ ## Develop
54
+
55
+ This repo is the source of truth for the module (it used to live in the
56
+ cockpit monorepo under `packages/studio-integrations`).
57
+
58
+ ```bash
59
+ pnpm install # runs the module `prepare` (nuxt-module-build)
60
+ pnpm test # vitest
61
+ pnpm build # dist/
62
+ ```
63
+
64
+ Hosts to develop against:
65
+
66
+ * **Playground** (`playground/`, in this repo): thin standalone Nuxt host that
67
+ loads the module from `src/` — see `playground/README.md` for the full
68
+ runbook against a local integrations service
69
+ (`docker compose -f playground/docker-compose.dev.yml up`).
70
+ * **Cockpit** (`../revenexx-cockpit`): its dev server loads this module from
71
+ the sibling checkout's `src/module.ts` automatically (dev-from-source, see
72
+ the cockpit's `nuxt.config.ts`). Edit `src/**` here, the cockpit HMRs.
73
+ * **Integrations service** (`../integrations`): the `studio-ui` dev host
74
+ consumes a packed tarball — `studio-ui/scripts/pack-vendor.sh` builds and
75
+ packs this repo into `studio-ui/vendor/`.
76
+
77
+ ## Release
78
+
79
+ Bump `version` in `package.json` and push to `main` — CI
80
+ (`.github/workflows/publish.yml`) publishes any version that isn't on npm
81
+ yet, via npm Trusted Publishing (the trusted publisher on npmjs is bound to
82
+ this repo + workflow file).
package/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import * as nuxt_schema from 'nuxt/schema';
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
2
  export * from '../dist/runtime/types/integrations.js';
3
3
 
4
- declare const _default: nuxt_schema.NuxtModule<nuxt_schema.ModuleOptions, nuxt_schema.ModuleOptions, false>;
4
+ declare const _default: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
5
5
 
6
6
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revenexx/studio-integrations",
3
3
  "configKey": "studioIntegrations",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
3
  import { Button } from "@revenexx/studio";
4
- import { IntegrationsApiError } from "../../composables/integrationsApi";
4
+ import { IntegrationsApiError } from "../../utils/apiError";
5
5
  const props = defineProps({
6
6
  slug: { type: String, required: true },
7
7
  version: { type: String, required: true },
@@ -3,7 +3,7 @@ import { computed, onUnmounted, ref, watch } from "vue";
3
3
  import { Download as DownloadIcon, RefreshCircle as RefreshIcon } from "#solar-icons";
4
4
  import { Badge, Button, Dialog, DialogContent, DialogHeader, DialogTitle } from "@revenexx/studio";
5
5
  import { runStatusLabel, statusClass } from "../../utils/statusStyle";
6
- import { IntegrationsApiError } from "../../composables/integrationsApi";
6
+ import { IntegrationsApiError } from "../../utils/apiError";
7
7
  const props = defineProps({
8
8
  run: { type: Object, required: true },
9
9
  view: { type: String, required: false, default: "details" }
@@ -1,8 +1,3 @@
1
- export declare class IntegrationsApiError extends Error {
2
- status: number;
3
- body: unknown;
4
- constructor(status: number, body: unknown, message: string);
5
- }
6
1
  export declare function useIntegrationsApi(): {
7
2
  baseUrl: import("vue").ComputedRef<string>;
8
3
  get: <T>(path: string, opts?: {
@@ -1,12 +1,5 @@
1
1
  import { computed } from "vue";
2
- export class IntegrationsApiError extends Error {
3
- constructor(status, body, message) {
4
- super(message);
5
- this.status = status;
6
- this.body = body;
7
- this.name = "IntegrationsApiError";
8
- }
9
- }
2
+ import { IntegrationsApiError } from "../utils/apiError.js";
10
3
  export function useIntegrationsApi() {
11
4
  const config = useRuntimeConfig();
12
5
  const { getToken } = usePlatformAuth();
@@ -1,4 +1,5 @@
1
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
1
+ import { useIntegrationsApi } from "./integrationsApi.js";
2
+ import { IntegrationsApiError } from "../utils/apiError.js";
2
3
  export function useCredentialTypes() {
3
4
  const types = useState("integrations.credentialTypes", () => []);
4
5
  const loading = useState("integrations.credentialTypes.loading", () => false);
@@ -1,4 +1,5 @@
1
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
1
+ import { useIntegrationsApi } from "./integrationsApi.js";
2
+ import { IntegrationsApiError } from "../utils/apiError.js";
2
3
  export function useIntegrationsAudit() {
3
4
  const api = useIntegrationsApi();
4
5
  const entries = useState("int.audit.entries", () => []);
@@ -1,5 +1,6 @@
1
1
  import { computed } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  export function useIntegrationsCredentials() {
4
5
  const credentials = useState("integrations.credentials", () => []);
5
6
  const loading = useState("integrations.credentials.loading", () => false);
@@ -1,6 +1,7 @@
1
1
  import { applyNodeCatalog, findManifest } from "../data/integrationNodeCatalog.js";
2
2
  import { resolveLocalized } from "../utils/localize.js";
3
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
3
+ import { useIntegrationsApi } from "./integrationsApi.js";
4
+ import { IntegrationsApiError } from "../utils/apiError.js";
4
5
  export function useIntegrationsNodes() {
5
6
  const loading = useState("integrations.nodes.loading", () => false);
6
7
  const error = useState("integrations.nodes.error", () => null);
@@ -1,5 +1,6 @@
1
1
  import { ref } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  export function useIntegrationsRevisions() {
4
5
  const api = useIntegrationsApi();
5
6
  const loading = ref(false);
@@ -1,5 +1,6 @@
1
1
  import { computed } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  function mapStatus(status) {
4
5
  switch (status) {
5
6
  case "completed":
@@ -1,5 +1,6 @@
1
1
  import { computed } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  const KEY_PATTERN = /^[A-Z0-9_]+$/;
4
5
  export function useIntegrationsSecrets() {
5
6
  const secrets = useState("integrations.secrets", () => []);
@@ -1,5 +1,6 @@
1
1
  import { computed } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  import { resolveLocalized } from "../utils/localize.js";
4
5
  const BLOB_VERSION = "v0-draft";
5
6
  const INDUSTRY_VALUES = ["mechanical-engineering", "chemicals", "wholesale", "manufacturing", "retail", "any"];
@@ -1,4 +1,5 @@
1
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
1
+ import { useIntegrationsApi } from "./integrationsApi.js";
2
+ import { IntegrationsApiError } from "../utils/apiError.js";
2
3
  export function useIntegrationsTriggers() {
3
4
  const all = useState("integrations.triggers.all", () => []);
4
5
  const loading = useState("integrations.triggers.loading", () => false);
@@ -1,5 +1,6 @@
1
1
  import { computed } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  const BLOB_VERSION = "v0-draft";
4
5
  function toCockpit(api) {
5
6
  const apiBlob = api.blob ?? {};
@@ -1,5 +1,6 @@
1
1
  import { computed, onScopeDispose, ref, toValue, watch } from "vue";
2
- import { IntegrationsApiError, useIntegrationsApi } from "./integrationsApi.js";
2
+ import { useIntegrationsApi } from "./integrationsApi.js";
3
+ import { IntegrationsApiError } from "../utils/apiError.js";
3
4
  export function isResolvableValue(v) {
4
5
  if (v === void 0 || v === null) return false;
5
6
  if (typeof v === "string") {
@@ -24,7 +24,7 @@ import WorkflowDuplicateDialog from "../../../components/Integrations/WorkflowDu
24
24
  import RunsTable from "../../../components/Integrations/RunsTable.vue";
25
25
  import RunDetailPanel from "../../../components/Integrations/RunDetailPanel.vue";
26
26
  import { toast } from "vue-sonner";
27
- import { IntegrationsApiError } from "../../../composables/integrationsApi";
27
+ import { IntegrationsApiError } from "../../../utils/apiError";
28
28
  import { payloadFieldsFromBlob } from "../../../data/payloadForm";
29
29
  import WorkflowIconView from "../../../components/Integrations/WorkflowIconView.vue";
30
30
  const route = useRoute();
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Error thrown by the Integrations API client.
3
+ *
4
+ * It lives here rather than next to `useIntegrationsApi` on purpose: the
5
+ * module auto-imports everything the `composables/` directory exports, and a
6
+ * class exported from there gets registered as an auto-import too. Consumed
7
+ * from the built `dist/` (any host that installs the package from npm) the
8
+ * auto-import resolver then injects the identifier back into the very file
9
+ * that declares it — "Identifier 'IntegrationsApiError' has already been
10
+ * declared" at runtime. Keeping non-composable exports out of that directory
11
+ * avoids the whole class of problem; callers import it explicitly.
12
+ */
13
+ export declare class IntegrationsApiError extends Error {
14
+ status: number;
15
+ body: unknown;
16
+ constructor(status: number, body: unknown, message: string);
17
+ }
@@ -0,0 +1,8 @@
1
+ export class IntegrationsApiError extends Error {
2
+ constructor(status, body, message) {
3
+ super(message);
4
+ this.status = status;
5
+ this.body = body;
6
+ this.name = "IntegrationsApiError";
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@revenexx/studio-integrations",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Integration Studio (core: workflows, node editor, runs, schedules, credentials, secrets, audit) as a standalone, publishable Nuxt module.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/revenexx/studio-integrations.git"
9
+ },
6
10
  "main": "./dist/module.mjs",
7
11
  "types": "./dist/types.d.mts",
8
12
  "exports": {
@@ -25,6 +29,7 @@
25
29
  "peerDependencies": {
26
30
  "@dagrejs/dagre": "^3.0.0",
27
31
  "@revenexx/studio": "*",
32
+ "@revenexx/studio-shared": "^0.1.2",
28
33
  "@solar-icons/nuxt": "^1.2.0",
29
34
  "@tiptap/core": "^3.28.0",
30
35
  "@tiptap/extension-document": "^3.28.0",
@@ -41,18 +46,20 @@
41
46
  "lucide-vue-next": "^1.0.0",
42
47
  "nuxt": "^4.0.0",
43
48
  "vue": "^3.5.0",
44
- "vue-sonner": "^2.0.0",
45
- "@revenexx/studio-shared": "0.1.2"
49
+ "vue-sonner": "^2.0.0"
46
50
  },
47
51
  "devDependencies": {
48
52
  "@nuxt/module-builder": "^1.0.2",
49
53
  "@nuxt/kit": "^4.0.0",
54
+ "@nuxt/schema": "^4.0.0",
50
55
  "nuxt": "^4.2.2",
56
+ "vitest": "^3.2.0",
51
57
  "vue": "^3.5.26",
52
58
  "vue-tsc": "^2.2.0"
53
59
  },
54
60
  "license": "SEE LICENSE IN LICENSE",
55
61
  "scripts": {
56
- "build": "nuxt-module-build build"
62
+ "build": "nuxt-module-build build",
63
+ "test": "vitest run"
57
64
  }
58
65
  }