@ssiriuss/connectors 0.0.0-stage → 0.0.1

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 (172) hide show
  1. package/README.md +65 -2
  2. package/dist/boxes/connectors.d.ts +2 -0
  3. package/dist/boxes/connectors.js +1 -0
  4. package/dist/features/integration-studio/README.md +24 -0
  5. package/dist/features/integration-studio/assets/connectors/api.svg +5 -0
  6. package/dist/features/integration-studio/assets/connectors/arity.png +0 -0
  7. package/dist/features/integration-studio/assets/connectors/axle.png +0 -0
  8. package/dist/features/integration-studio/assets/connectors/canopy.png +0 -0
  9. package/dist/features/integration-studio/assets/connectors/ccc.png +0 -0
  10. package/dist/features/integration-studio/assets/connectors/cmt.png +0 -0
  11. package/dist/features/integration-studio/assets/connectors/cotality.png +0 -0
  12. package/dist/features/integration-studio/assets/connectors/csv.svg +5 -0
  13. package/dist/features/integration-studio/assets/connectors/dnb.png +0 -0
  14. package/dist/features/integration-studio/assets/connectors/eagleview.png +0 -0
  15. package/dist/features/integration-studio/assets/connectors/email.svg +4 -0
  16. package/dist/features/integration-studio/assets/connectors/equifax.png +0 -0
  17. package/dist/features/integration-studio/assets/connectors/esri.svg +19 -0
  18. package/dist/features/integration-studio/assets/connectors/examone.png +0 -0
  19. package/dist/features/integration-studio/assets/connectors/experian.svg +26 -0
  20. package/dist/features/integration-studio/assets/connectors/fema.png +0 -0
  21. package/dist/features/integration-studio/assets/connectors/file.svg +4 -0
  22. package/dist/features/integration-studio/assets/connectors/fmcsa.png +0 -0
  23. package/dist/features/integration-studio/assets/connectors/ftp.svg +5 -0
  24. package/dist/features/integration-studio/assets/connectors/google-maps.png +0 -0
  25. package/dist/features/integration-studio/assets/connectors/graphql.png +0 -0
  26. package/dist/features/integration-studio/assets/connectors/grpc.png +0 -0
  27. package/dist/features/integration-studio/assets/connectors/http.svg +5 -0
  28. package/dist/features/integration-studio/assets/connectors/jdpower.png +0 -0
  29. package/dist/features/integration-studio/assets/connectors/json.svg +5 -0
  30. package/dist/features/integration-studio/assets/connectors/kafka.png +0 -0
  31. package/dist/features/integration-studio/assets/connectors/lexisnexis.png +0 -0
  32. package/dist/features/integration-studio/assets/connectors/mcp.svg +5 -0
  33. package/dist/features/integration-studio/assets/connectors/melissa.png +0 -0
  34. package/dist/features/integration-studio/assets/connectors/mib.png +0 -0
  35. package/dist/features/integration-studio/assets/connectors/milliman.png +0 -0
  36. package/dist/features/integration-studio/assets/connectors/mitchell.png +0 -0
  37. package/dist/features/integration-studio/assets/connectors/moodys.png +0 -0
  38. package/dist/features/integration-studio/assets/connectors/ncci.png +0 -0
  39. package/dist/features/integration-studio/assets/connectors/nearmap.png +0 -0
  40. package/dist/features/integration-studio/assets/connectors/nhtsa.png +0 -0
  41. package/dist/features/integration-studio/assets/connectors/nicb.png +0 -0
  42. package/dist/features/integration-studio/assets/connectors/noaa.png +0 -0
  43. package/dist/features/integration-studio/assets/connectors/ofac.png +0 -0
  44. package/dist/features/integration-studio/assets/connectors/openai.svg +31 -0
  45. package/dist/features/integration-studio/assets/connectors/openapi.png +0 -0
  46. package/dist/features/integration-studio/assets/connectors/postman.png +0 -0
  47. package/dist/features/integration-studio/assets/connectors/precisely.png +0 -0
  48. package/dist/features/integration-studio/assets/connectors/rest.svg +5 -0
  49. package/dist/features/integration-studio/assets/connectors/salesforce.png +0 -0
  50. package/dist/features/integration-studio/assets/connectors/servicebus.png +0 -0
  51. package/dist/features/integration-studio/assets/connectors/servicenow.png +0 -0
  52. package/dist/features/integration-studio/assets/connectors/sftp.svg +5 -0
  53. package/dist/features/integration-studio/assets/connectors/soap.svg +5 -0
  54. package/dist/features/integration-studio/assets/connectors/solera.png +0 -0
  55. package/dist/features/integration-studio/assets/connectors/transunion.png +0 -0
  56. package/dist/features/integration-studio/assets/connectors/verisk.png +0 -0
  57. package/dist/features/integration-studio/assets/connectors/webhook.svg +4 -0
  58. package/dist/features/integration-studio/assets/connectors/websocket.svg +5 -0
  59. package/dist/features/integration-studio/assets/connectors/xml.svg +5 -0
  60. package/dist/features/integration-studio/components/ActionEditor.d.ts +20 -0
  61. package/dist/features/integration-studio/components/ActionEditor.js +3 -0
  62. package/dist/features/integration-studio/components/ActionPanels.d.ts +20 -0
  63. package/dist/features/integration-studio/components/ActionPanels.js +1 -0
  64. package/dist/features/integration-studio/components/ActionWorkspace.d.ts +14 -0
  65. package/dist/features/integration-studio/components/ActionWorkspace.js +1 -0
  66. package/dist/features/integration-studio/components/ActionsTab.d.ts +9 -0
  67. package/dist/features/integration-studio/components/ActionsTab.js +1 -0
  68. package/dist/features/integration-studio/components/AuthProfilesTab.d.ts +8 -0
  69. package/dist/features/integration-studio/components/AuthProfilesTab.js +1 -0
  70. package/dist/features/integration-studio/components/ConnectorTypePicker.d.ts +11 -0
  71. package/dist/features/integration-studio/components/ConnectorTypePicker.js +1 -0
  72. package/dist/features/integration-studio/components/DataSourcePanel.d.ts +10 -0
  73. package/dist/features/integration-studio/components/DataSourcePanel.js +1 -0
  74. package/dist/features/integration-studio/components/EditorForm.d.ts +27 -0
  75. package/dist/features/integration-studio/components/EditorForm.js +1 -0
  76. package/dist/features/integration-studio/components/ImportSystemDialog.d.ts +13 -0
  77. package/dist/features/integration-studio/components/ImportSystemDialog.js +1 -0
  78. package/dist/features/integration-studio/components/ImportSystemFileDialog.d.ts +10 -0
  79. package/dist/features/integration-studio/components/ImportSystemFileDialog.js +1 -0
  80. package/dist/features/integration-studio/components/LogoPicker.d.ts +6 -0
  81. package/dist/features/integration-studio/components/LogoPicker.js +1 -0
  82. package/dist/features/integration-studio/components/ProfileSignIn.d.ts +14 -0
  83. package/dist/features/integration-studio/components/ProfileSignIn.js +1 -0
  84. package/dist/features/integration-studio/components/ServerKeysTab.d.ts +8 -0
  85. package/dist/features/integration-studio/components/ServerKeysTab.js +1 -0
  86. package/dist/features/integration-studio/components/SystemIcon.d.ts +6 -0
  87. package/dist/features/integration-studio/components/SystemIcon.js +1 -0
  88. package/dist/features/integration-studio/components/SystemLabelsFields.d.ts +10 -0
  89. package/dist/features/integration-studio/components/SystemLabelsFields.js +1 -0
  90. package/dist/features/integration-studio/components/SystemPills.d.ts +15 -0
  91. package/dist/features/integration-studio/components/SystemPills.js +1 -0
  92. package/dist/features/integration-studio/components/TestPanel.d.ts +11 -0
  93. package/dist/features/integration-studio/components/TestPanel.js +1 -0
  94. package/dist/features/integration-studio/components/connector-picker.css +32 -0
  95. package/dist/features/integration-studio/components/mappings/MappingsUnavailable.d.ts +8 -0
  96. package/dist/features/integration-studio/components/mappings/MappingsUnavailable.js +1 -0
  97. package/dist/features/integration-studio/components/mappings/edges.d.ts +7 -0
  98. package/dist/features/integration-studio/components/mappings/edges.js +1 -0
  99. package/dist/features/integration-studio/components/mappings/nodes.d.ts +28 -0
  100. package/dist/features/integration-studio/components/mappings/nodes.js +1 -0
  101. package/dist/features/integration-studio/components/mappings/panels.d.ts +28 -0
  102. package/dist/features/integration-studio/components/mappings/panels.js +5 -0
  103. package/dist/features/integration-studio/components/parts.d.ts +77 -0
  104. package/dist/features/integration-studio/components/parts.js +1 -0
  105. package/dist/features/integration-studio/hooks/useDatabases.d.ts +40 -0
  106. package/dist/features/integration-studio/hooks/useDatabases.js +1 -0
  107. package/dist/features/integration-studio/hooks/useResourceSave.d.ts +26 -0
  108. package/dist/features/integration-studio/hooks/useResourceSave.js +1 -0
  109. package/dist/features/integration-studio/hooks/useStudio.d.ts +218 -0
  110. package/dist/features/integration-studio/hooks/useStudio.js +1 -0
  111. package/dist/features/integration-studio/index.d.ts +8 -0
  112. package/dist/features/integration-studio/index.js +1 -0
  113. package/dist/features/integration-studio/model/action-form.d.ts +64 -0
  114. package/dist/features/integration-studio/model/action-form.js +1 -0
  115. package/dist/features/integration-studio/model/api-document.d.ts +19 -0
  116. package/dist/features/integration-studio/model/api-document.js +1 -0
  117. package/dist/features/integration-studio/model/collection-install.d.ts +15 -0
  118. package/dist/features/integration-studio/model/collection-install.js +1 -0
  119. package/dist/features/integration-studio/model/connector-form.d.ts +29 -0
  120. package/dist/features/integration-studio/model/connector-form.js +2 -0
  121. package/dist/features/integration-studio/model/connector-types.d.ts +15 -0
  122. package/dist/features/integration-studio/model/connector-types.js +1 -0
  123. package/dist/features/integration-studio/model/mappings/function-help.d.ts +1 -0
  124. package/dist/features/integration-studio/model/mappings/function-help.js +1 -0
  125. package/dist/features/integration-studio/model/mappings/mapping-model.d.ts +40 -0
  126. package/dist/features/integration-studio/model/mappings/mapping-model.js +1 -0
  127. package/dist/features/integration-studio/model/mappings/samples.d.ts +85 -0
  128. package/dist/features/integration-studio/model/mappings/samples.js +1 -0
  129. package/dist/features/integration-studio/model/presentation.d.ts +48 -0
  130. package/dist/features/integration-studio/model/presentation.js +1 -0
  131. package/dist/features/integration-studio/model/problems.d.ts +11 -0
  132. package/dist/features/integration-studio/model/problems.js +1 -0
  133. package/dist/features/integration-studio/model/profile-form.d.ts +26 -0
  134. package/dist/features/integration-studio/model/profile-form.js +1 -0
  135. package/dist/features/integration-studio/model/query-form.d.ts +33 -0
  136. package/dist/features/integration-studio/model/query-form.js +2 -0
  137. package/dist/features/integration-studio/model/system-labels.d.ts +20 -0
  138. package/dist/features/integration-studio/model/system-labels.js +1 -0
  139. package/dist/features/integration-studio/model/system-logos.d.ts +7 -0
  140. package/dist/features/integration-studio/model/system-logos.js +1 -0
  141. package/dist/features/integration-studio/pages/ConnectorLibraryPage.d.ts +5 -0
  142. package/dist/features/integration-studio/pages/ConnectorLibraryPage.js +1 -0
  143. package/dist/features/integration-studio/pages/CredentialsPage.d.ts +6 -0
  144. package/dist/features/integration-studio/pages/CredentialsPage.js +1 -0
  145. package/dist/features/integration-studio/pages/DatabasesPage.d.ts +6 -0
  146. package/dist/features/integration-studio/pages/DatabasesPage.js +1 -0
  147. package/dist/features/integration-studio/pages/MappingDesignerPage.d.ts +8 -0
  148. package/dist/features/integration-studio/pages/MappingDesignerPage.js +1 -0
  149. package/dist/features/integration-studio/pages/MappingsPage.d.ts +2 -0
  150. package/dist/features/integration-studio/pages/MappingsPage.js +1 -0
  151. package/dist/features/integration-studio/pages/QueryPage.d.ts +3 -0
  152. package/dist/features/integration-studio/pages/QueryPage.js +1 -0
  153. package/dist/features/integration-studio/pages/SystemPage.d.ts +8 -0
  154. package/dist/features/integration-studio/pages/SystemPage.js +1 -0
  155. package/dist/features/integration-studio/pages/SystemsPage.d.ts +5 -0
  156. package/dist/features/integration-studio/pages/SystemsPage.js +1 -0
  157. package/dist/features/mailboxes/README.md +5 -0
  158. package/dist/features/mailboxes/components/MailboxCreate.d.ts +5 -0
  159. package/dist/features/mailboxes/components/MailboxCreate.js +1 -0
  160. package/dist/features/mailboxes/components/MailboxDirectory.d.ts +12 -0
  161. package/dist/features/mailboxes/components/MailboxDirectory.js +1 -0
  162. package/dist/features/mailboxes/components/MailboxEditor.d.ts +11 -0
  163. package/dist/features/mailboxes/components/MailboxEditor.js +1 -0
  164. package/dist/features/mailboxes/hooks/useMailboxes.d.ts +19 -0
  165. package/dist/features/mailboxes/hooks/useMailboxes.js +1 -0
  166. package/dist/features/mailboxes/index.d.ts +1 -0
  167. package/dist/features/mailboxes/index.js +1 -0
  168. package/dist/features/mailboxes/pages/MailboxesPage.d.ts +1 -0
  169. package/dist/features/mailboxes/pages/MailboxesPage.js +1 -0
  170. package/dist/shared/api/message-mappings.d.ts +121 -0
  171. package/dist/shared/api/message-mappings.js +1 -0
  172. package/package.json +24 -4
package/README.md CHANGED
@@ -1,3 +1,66 @@
1
- # Temporary Holding Version
1
+ # Sirius UI connectors
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Pages for calls to and from outside systems: Integration Studio and mailboxes.
4
+
5
+ `@ssiriuss/connectors` is one of the five Sirius UI packages.
6
+
7
+ ## What's inside
8
+
9
+ - **Integration Studio**: connectors, actions, auth profiles, data sources, queries, inbound webhooks and message mappings.
10
+ - **Mailboxes**: email account connections.
11
+
12
+ ## Install
13
+
14
+ React 19, Vite and Tailwind CSS 4. List core and every package you use (your code imports
15
+ core directly):
16
+
17
+ ```shell
18
+ npm install @ssiriuss/core @ssiriuss/connectors
19
+ npm install -D vite @vitejs/plugin-react @tailwindcss/vite typescript
20
+ ```
21
+
22
+ `vite.config.ts`:
23
+
24
+ ```ts
25
+ import tailwindcss from '@tailwindcss/vite'
26
+ import react from '@vitejs/plugin-react'
27
+ import { defineConfig } from 'vite'
28
+ import { siriusBoxes } from '@ssiriuss/core/vite'
29
+
30
+ export default defineConfig({ plugins: [siriusBoxes(import.meta.dirname), react(), tailwindcss()] })
31
+ ```
32
+
33
+ `src/main.tsx`:
34
+
35
+ ```ts
36
+ import { startSirius } from '@/app/start'
37
+
38
+ startSirius([]) // your own application modules: routes, page blocks, menu entries
39
+ ```
40
+
41
+ `siriusBoxes` finds the installed `@ssiriuss/*` packages, resolves `@/` imports across
42
+ them, and gives core's shell their pages. In `tsconfig.json`, map `@/*` to
43
+ `./node_modules/@ssiriuss/<package>/dist/*` for each installed package, then `./src/*`.
44
+ The app needs the Sirius API running (the `siriuss-*` Python packages).
45
+
46
+ ## The Sirius UI packages
47
+
48
+ Sirius is a platform for building business applications. The UI is a React app made of
49
+ five packages that match the Python packages of the Sirius API (`siriuss-*`) and talk to
50
+ its `/api/v1` only. Install only what you need; each package brings the ones it is built on.
51
+
52
+ | Package | What it adds | Built on |
53
+ | ---------------------- | ------------------------------------------------------------------------------ | -------- |
54
+ | `@ssiriuss/core` | the app shell, sign-in, users, tenants, access, events, menus, the Vite plugin | (base) |
55
+ | `@ssiriuss/connectors` | Integration Studio, mailboxes | core |
56
+ | `@ssiriuss/ai` | AI Studio, control tower, agent and analyzer designers | core |
57
+ | `@ssiriuss/builder` | component library, pages, playbooks, flows, tables, tasks, human tasks | core |
58
+ | `@ssiriuss/intake` | workbench, inbox, AI insights, document queue | all four |
59
+
60
+ Each package registers its own pages; core's shell shows the pages of the packages that
61
+ are installed, and nothing of the ones that are not.
62
+
63
+ ## Status
64
+
65
+ Pre-release (`0.0.x`): pages and extension points may still change between versions.
66
+ All five packages are released together with the same version.
@@ -0,0 +1,2 @@
1
+ import type { BoxModule } from '@/shared/extension-points/box-module';
2
+ export declare const BOX: BoxModule;
@@ -0,0 +1 @@
1
+ import{lazy as e}from"react";import{paths as t}from"@/app/paths";import{pageAccess as n}from"@/shared/auth/page-access";import{jsx as r}from"react/jsx-runtime";const i=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.ConnectorLibraryPage}))),a=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.SystemsPage}))),o=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.SystemPage}))),s=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.MappingsPage}))),c=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.MappingDesignerPage}))),l=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.DatabasesPage}))),u=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.QueryPage}))),d=e(()=>import(`@/features/integration-studio`).then(e=>({default:e.CredentialsPage}))),f=e(()=>import(`@/features/mailboxes`).then(e=>({default:e.MailboxesPage}))),p=n.integrations;export const BOX={name:`connectors`,order:10,routes:[{path:t.systems,page:r(a,{}),access:p},{path:t.connectorLibrary,page:r(i,{}),access:p},{path:`${t.systems}/:id/:tab?`,page:r(o,{}),access:p},{path:t.mappings,page:r(s,{}),access:p},{path:`${t.mappings}/:id`,page:r(c,{}),access:p},{path:t.credentials,page:r(d,{}),access:p},{path:t.databases,page:r(l,{}),access:p},{path:`${t.dbQueries}/:id`,page:r(u,{}),access:p},{path:t.mailboxes,page:r(f,{}),access:n.mailboxes}]};
@@ -0,0 +1,24 @@
1
+ # Integration studio
2
+
3
+ Routes import only `index.ts` (ConnectorLibraryPage, CredentialsPage, DatabasesPage,
4
+ QueryPage, SystemPage, SystemsPage, MappingsPage, MappingDesignerPage). Features never import
5
+ each other; shared code lives in `src/shared/`.
6
+
7
+ - **Systems:** each has its logo (a key into the logo library), access (Paid/Free), lines of
8
+ business and tags, shown as one row of pills. Export downloads the whole system as a
9
+ collection file; Publish shares it in the Connector Library.
10
+ - **Connector Library:** bundled and published systems to install (no credentials);
11
+ **Import file** installs a collection file (`components/ImportSystemFileDialog.tsx`,
12
+ parsed by `model/collection-install.ts`).
13
+ - **Databases:** the App DB is system-owned; queries are versioned like endpoints (save,
14
+ test, publish, retire).
15
+
16
+ | Folder | What lives there |
17
+ | ------------- | ------------------------------------------------------------------------- |
18
+ | `pages/` | Routed pages (exported through `index.ts`) |
19
+ | `components/` | The feature's UI parts, grouped in subfolders where they belong together |
20
+ | `model/` | Pure logic: data shapes, presentation, charts, forms, query keys |
21
+ | `hooks/` | React hooks: queries, mutations and feature state |
22
+ | `assets/` | Logo library (`assets/connectors/<key>`, read by `model/system-logos.ts`) |
23
+
24
+ Tests live in `src/test/features/integration-studio/`, mirroring these folders.
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="API">
2
+ <rect width="64" height="64" rx="14" fill="#0f766e"/>
3
+ <text x="32" y="39" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="20" font-weight="700" fill="#ffffff">API</text>
4
+
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="CSV">
2
+ <rect width="64" height="64" rx="14" fill="#15803d"/>
3
+ <text x="32" y="39" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="19" font-weight="700" fill="#ffffff">CSV</text>
4
+
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Email">
2
+ <rect width="64" height="64" rx="14" fill="#4f46e5"/>
3
+ <g fill="none" stroke="#ffffff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"><rect x="14" y="19" width="36" height="26" rx="4"/><path d="M15 21l17 13 17-13"/></g>
4
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <defs>
3
+ <style>
4
+ .cls-1 {
5
+ fill: none;
6
+ }
7
+
8
+ .cls-2 {
9
+ fill: #007ac2;
10
+ }
11
+
12
+ @media (prefers-color-scheme: dark) {
13
+ .cls-2 {fill: #00a0ff;}
14
+ }
15
+ </style>
16
+ </defs>
17
+ <rect class="cls-1" width="32" height="32" />
18
+ <path class="cls-2" d="M28.91613,13.86943h2.59268V24.243H28.91613ZM9.59947,22.96675A5.38714,5.38714,0,0,1,5.70128,24.5059a5.4495,5.4495,0,1,1,0-10.89243c2.89864,0,4.86415,2.03037,4.86415,5.64053v.713H2.65518a2.68954,2.68954,0,0,0,2.78911,2.4636,3.30867,3.30867,0,0,0,2.5188-1.10016ZM2.65518,18.02133H7.97333a2.38889,2.38889,0,0,0-2.6382-2.46418A2.58025,2.58025,0,0,0,2.65518,18.02133Zm11.52751-1.23122c0-.77866.82163-1.10249,1.51412-1.10249a2.35239,2.35239,0,0,1,2.02355,1.05015L19.36979,15.09a4.54977,4.54977,0,0,0-3.60929-1.47656c-2.09633,0-4.17159,1.03623-4.17159,3.34973,0,3.9556,5.59756,2.26891,5.59756,4.40815,0,.821-.97225,1.18831-1.72843,1.18831a3.1661,3.1661,0,0,1-2.45853-1.26906l-1.675,1.67446a5.09457,5.09457,0,0,0,3.98226,1.54084c2.11735,0,4.47464-.86483,4.47464-3.329C19.78142,17.1349,14.18269,18.6482,14.18269,16.79011Zm13.52494-3.03066a3.35254,3.35254,0,0,0-.92107-.149,3.30586,3.30586,0,0,0-3.07091,1.89989h-.04151V13.86943H21.08088V24.243h2.59326V18.68781A2.60757,2.60757,0,0,1,26.46185,16.073a4.96425,4.96425,0,0,1,1.14459.16855Zm.78208-3.3932a1.72521,1.72521,0,1,0,1.70114-1.65769A1.67716,1.67716,0,0,0,28.48971,10.36625Z" />
19
+ </svg>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg enable-background="new 0 0 96 96" version="1.1" viewBox="0 0 96 96" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
3
+ <style type="text/css">
4
+ .st0{fill:#426DA9;}
5
+ .st1{fill:#6D2077;}
6
+ .st2{fill:#AF1685;}
7
+ .st3{fill:#E63888;}
8
+ .st4{fill:#1D4F91;}
9
+ </style>
10
+
11
+
12
+
13
+ <path class="st0" d="m54.4 26.8h-8.9c-2.7 0-4.8-2.1-4.8-4.8v-8.9c0-2.6 2.1-4.8 4.8-4.8h8.9c2.6 0 4.8 2.1 4.8 4.8v8.9c0 2.6-2.1 4.8-4.8 4.8"/>
14
+ <path class="st1" d="m31.4 46.8h-10c-3 0-5.4-2.4-5.4-5.4v-10c0-3 2.4-5.4 5.4-5.4h10c3 0 5.4 2.4 5.4 5.4v10c0 2.9-2.4 5.4-5.4 5.4"/>
15
+ <path class="st2" d="m30.4 67.5h-6.1c-1.8 0-3.3-1.5-3.3-3.3v-6.1c0-1.8 1.5-3.3 3.3-3.3h6.1c1.8 0 3.3 1.5 3.3 3.3v6.1c0 1.9-1.4 3.3-3.3 3.3"/>
16
+ <path class="st3" d="m46.9 86.9h-7.2c-2.2 0-3.9-1.7-3.9-3.9v-7.2c0-2.2 1.7-3.9 3.9-3.9h7.2c2.2 0 3.9 1.7 3.9 3.9v7.2c0 2.1-1.8 3.9-3.9 3.9"/>
17
+ <path class="st3" d="m73.4 30.4h-5c-1.5 0-2.7-1.2-2.7-2.7v-5c0-1.5 1.2-2.7 2.7-2.7h5c1.5 0 2.7 1.2 2.7 2.7v5c0 1.5-1.2 2.7-2.7 2.7"/>
18
+ <path class="st4" d="m72 50.6c-0.1-7.3-6.6-13.6-14.4-13.6-8 0-14.5 6.4-14.5 14.4s6.4 14.5 14.5 14.5c3.9 0 7.4-1.5 10-4.1 0.5-0.4 0.8-1.1 0.8-1.8 0-1.3-1.1-2.4-2.4-2.4-0.7 0-1.4 0.4-1.9 0.9-1.6 1.7-4 2.5-6.5 2.5-4.8 0-8.7-3.3-9.5-7.9h21.7 0.1 0.2c1-0.2 1.9-1.2 1.9-2.5zm-14.4-8.8c4.3 0 7.9 2.8 9.2 6.7h-18.4c1.2-3.9 4.8-6.7 9.2-6.7z"/>
19
+
20
+
21
+
22
+ <path class="st4" d="m74.6 60.6c-1.5 0-2.7 1.2-2.7 2.6s1.2 2.6 2.7 2.6 2.7-1.2 2.7-2.6-1.2-2.6-2.7-2.6zm2.2 2.6c0 1.2-1 2.1-2.2 2.1s-2.2-0.9-2.2-2.1 1-2.1 2.2-2.1 2.2 1 2.2 2.1z"/>
23
+ <path class="st4" d="m75.1 63.5c0.3-0.2 0.5-0.5 0.5-0.8 0-0.5-0.4-1-1-1h-0.4c-0.2 0-0.4 0.2-0.4 0.4v2.4c0 0.1 0.1 0.3 0.3 0.3 0.1 0 0.3-0.1 0.3-0.3v-0.9h0.2l0.5 1c0 0.1 0.1 0.1 0.2 0.1h0.1c0.1 0 0.2-0.1 0.2-0.2v-0.1l-0.5-0.9zm-0.1-0.9s0 0.5-0.4 0.5h-0.2v-0.9h0.2c0.4 0 0.4 0.4 0.4 0.4z"/>
24
+
25
+
26
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="File">
2
+ <rect width="64" height="64" rx="14" fill="#64748b"/>
3
+ <g fill="none" stroke="#ffffff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"><path d="M22 13h14l10 10v26a3 3 0 0 1-3 3H22a3 3 0 0 1-3-3V16a3 3 0 0 1 3-3z"/><path d="M36 13v10h10"/></g>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="FTP">
2
+ <rect width="64" height="64" rx="14" fill="#0369a1"/>
3
+ <text x="32" y="34" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="19" font-weight="700" fill="#ffffff">FTP</text>
4
+ <text x="32" y="47" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="8" font-weight="600" fill="#ffffff" opacity="0.85">FILES</text>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="HTTP">
2
+ <rect width="64" height="64" rx="14" fill="#475569"/>
3
+ <text x="32" y="39" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="16" font-weight="700" fill="#ffffff">HTTP</text>
4
+
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="{ }">
2
+ <rect width="64" height="64" rx="14" fill="#ca8a04"/>
3
+ <text x="32" y="39" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="24" font-weight="700" fill="#ffffff">{ }</text>
4
+
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="MCP">
2
+ <rect width="64" height="64" rx="14" fill="#111827"/>
3
+ <text x="32" y="39" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="19" font-weight="700" fill="#ffffff">MCP</text>
4
+
5
+ </svg>
@@ -0,0 +1,31 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="180" height="180" fill="none">
2
+ <style>
3
+ :root {
4
+ --primary-fill: #fff;
5
+ --secondary-fill: #000;
6
+ }
7
+ @media (prefers-color-scheme: dark) {
8
+ :root {
9
+ --primary-fill: #000;
10
+ --secondary-fill: #fff;
11
+ }
12
+ }
13
+ </style>
14
+ <g clip-path="url(#a)">
15
+ <rect width="180" height="180" fill="var(--primary-fill)" rx="90" />
16
+ <g clip-path="url(#b)">
17
+ <path
18
+ fill="var(--secondary-fill)"
19
+ d="M75.91 73.628V62.232c0-.96.36-1.68 1.199-2.16l22.912-13.194c3.119-1.8 6.838-2.639 10.676-2.639 14.394 0 23.511 11.157 23.511 23.032 0 .839 0 1.799-.12 2.758l-23.752-13.914c-1.439-.84-2.879-.84-4.318 0L75.91 73.627Zm53.499 44.383v-27.23c0-1.68-.72-2.88-2.159-3.719L97.142 69.55l9.836-5.638c.839-.48 1.559-.48 2.399 0l22.912 13.195c6.598 3.839 11.035 11.995 11.035 19.912 0 9.116-5.397 17.513-13.915 20.992v.001Zm-60.577-23.99-9.836-5.758c-.84-.48-1.2-1.2-1.2-2.16v-26.39c0-12.834 9.837-22.55 23.152-22.55 5.039 0 9.716 1.679 13.676 4.678L70.993 55.516c-1.44.84-2.16 2.039-2.16 3.719v34.787-.002Zm21.173 12.234L75.91 98.339V81.546l14.095-7.917 14.094 7.917v16.793l-14.094 7.916Zm9.056 36.467c-5.038 0-9.716-1.68-13.675-4.678l23.631-13.676c1.439-.839 2.159-2.038 2.159-3.718V85.863l9.956 5.757c.84.48 1.2 1.2 1.2 2.16v26.389c0 12.835-9.957 22.552-23.27 22.552v.001Zm-28.43-26.75L47.72 102.778c-6.599-3.84-11.036-11.996-11.036-19.913 0-9.236 5.518-17.513 14.034-20.992v27.35c0 1.68.72 2.879 2.16 3.718l29.989 17.393-9.837 5.638c-.84.48-1.56.48-2.399 0Zm-1.318 19.673c-13.555 0-23.512-10.196-23.512-22.792 0-.959.12-1.919.24-2.879l23.63 13.675c1.44.84 2.88.84 4.32 0l30.108-17.392v11.395c0 .96-.361 1.68-1.2 2.16l-22.912 13.194c-3.119 1.8-6.837 2.639-10.675 2.639Zm29.748 14.274c14.515 0 26.63-10.316 29.39-23.991 13.434-3.479 22.071-16.074 22.071-28.91 0-8.396-3.598-16.553-10.076-22.43.6-2.52.96-5.039.96-7.557 0-17.153-13.915-29.99-29.989-29.99-3.239 0-6.358.48-9.477 1.56-5.398-5.278-12.835-8.637-20.992-8.637-14.515 0-26.63 10.316-29.39 23.991-13.434 3.48-22.07 16.074-22.07 28.91 0 8.396 3.598 16.553 10.075 22.431-.6 2.519-.96 5.038-.96 7.556 0 17.154 13.915 29.989 29.99 29.989 3.238 0 6.357-.479 9.476-1.559 5.397 5.278 12.835 8.637 20.992 8.637Z"
20
+ />
21
+ </g>
22
+ </g>
23
+ <defs>
24
+ <clipPath id="a">
25
+ <path d="M0 0h180v180H0z" />
26
+ </clipPath>
27
+ <clipPath id="b">
28
+ <path d="M29.487 29.964h121.035v119.954H29.487z" />
29
+ </clipPath>
30
+ </defs>
31
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="REST">
2
+ <rect width="64" height="64" rx="14" fill="#2563eb"/>
3
+ <text x="32" y="34" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="17" font-weight="700" fill="#ffffff">REST</text>
4
+ <text x="32" y="47" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="8" font-weight="600" fill="#ffffff" opacity="0.85">API</text>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="SFTP">
2
+ <rect width="64" height="64" rx="14" fill="#0e7490"/>
3
+ <text x="32" y="34" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="17" font-weight="700" fill="#ffffff">SFTP</text>
4
+ <text x="32" y="47" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="8" font-weight="600" fill="#ffffff" opacity="0.85">FILES</text>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="SOAP">
2
+ <rect width="64" height="64" rx="14" fill="#7c3aed"/>
3
+ <text x="32" y="34" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="16" font-weight="700" fill="#ffffff">SOAP</text>
4
+ <text x="32" y="47" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="8" font-weight="600" fill="#ffffff" opacity="0.85">WSDL</text>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Webhook">
2
+ <rect width="64" height="64" rx="14" fill="#db2777"/>
3
+ <g fill="none" stroke="#ffffff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="32" cy="20" r="6"/><circle cx="19" cy="42" r="6"/><circle cx="45" cy="42" r="6"/><path d="M29 25l-7 12M35 25l7 12M25 42h14"/></g>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="WS">
2
+ <rect width="64" height="64" rx="14" fill="#c2410c"/>
3
+ <text x="32" y="34" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="22" font-weight="700" fill="#ffffff">WS</text>
4
+ <text x="32" y="47" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="8" font-weight="600" fill="#ffffff" opacity="0.85">SOCKET</text>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="&lt;/&gt;">
2
+ <rect width="64" height="64" rx="14" fill="#b45309"/>
3
+ <text x="32" y="39" text-anchor="middle" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="20" font-weight="700" fill="#ffffff">&lt;/&gt;</text>
4
+
5
+ </svg>
@@ -0,0 +1,20 @@
1
+ import type { AuthProfile, Connector } from '@/shared/api/integrations';
2
+ import { type ActionDraft, type ActionField } from '../model/action-form';
3
+ /** `{{path | filter}}` syntax, allowlisted roots and filters, shown on demand. */
4
+ export declare function TemplateHelp(): import("react").JSX.Element;
5
+ /** The definition of one action version (presentational: the workspace owns the draft). */
6
+ export declare function ActionEditor({ draft, set, errorOf, creating, connectors, profiles, mappings, }: {
7
+ draft: ActionDraft;
8
+ set: (patch: Partial<ActionDraft>) => void;
9
+ errorOf: (field: ActionField) => string | undefined;
10
+ creating: boolean;
11
+ connectors: Connector[];
12
+ profiles: AuthProfile[];
13
+ /** The tenant's message mappings to pick from. */
14
+ mappings?: readonly {
15
+ name: string;
16
+ display_name?: string | null;
17
+ status: string;
18
+ version_no: number;
19
+ }[];
20
+ }): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import{useState as e}from"react";import{ChevronDown as t,Info as n}from"lucide-react";import{paths as r}from"@/app/paths";import{Input as i}from"@/shared/components/ui/input";import{Textarea as a}from"@/shared/components/ui/textarea";import{SegmentedControl as o}from"@/shared/components/workspace/SegmentedControl";import{unknownRoots as s}from"../model/action-form";import{Field as c,PairsEditor as l}from"./parts";import{described as u,fieldClass as d,methods as f,responseModeLabels as p,responseModes as m,roles as h,templateFilters as g,templateRoots as _}from"../model/presentation";import{jsx as v,jsxs as y,Fragment as b}from"react/jsx-runtime";const x=e=>e===`published`?``:e===`draft`?` (draft: publish before live use)`:` (retired)`;function S({draft:e,set:t,errorOf:n,mappings:i,noBody:a}){let o=e=>y(b,{children:[e&&!i.some(t=>t.name===e)&&v(`option`,{value:e,children:e}),i.map(e=>y(`option`,{value:e.name,children:[e.display_name??e.name,` · v`,e.version_no,x(e.status)]},e.name))]});return y(`fieldset`,{className:`grid gap-3 rounded-lg border p-3 sm:grid-cols-2`,children:[v(`legend`,{className:`px-1 text-sm font-medium`,children:`Message mappings`}),v(c,{id:`action-payload-mapping`,label:`Payload mapping (before sending)`,error:n(`payload_mapping`),hint:a?`A GET action sends no body.`:e.payload_mapping?`Builds the request body from the input; the body template is not used.`:`None: the body template below builds the body.`,children:y(`select`,{id:`action-payload-mapping`,className:d,disabled:a,value:a?``:e.payload_mapping,onChange:e=>t({payload_mapping:e.target.value}),children:[v(`option`,{value:``,children:`None (use the body template)`}),o(e.payload_mapping)]})}),v(c,{id:`action-response-mapping`,label:`Response mapping (after the response)`,error:n(`response_message_mapping`),hint:e.response_message_mapping?`Turns the response into the output; the response paths are not used.`:`None: the response paths below pick the output.`,children:y(`select`,{id:`action-response-mapping`,className:d,value:e.response_message_mapping,onChange:e=>t({response_message_mapping:e.target.value}),children:[v(`option`,{value:``,children:`None (use the response paths)`}),o(e.response_message_mapping)]})}),y(`p`,{className:`text-xs text-muted-foreground sm:col-span-2`,children:[`Draw mappings in`,` `,v(`a`,{href:r.mappings,className:`text-primary hover:underline`,children:`Integration › Message mappings`}),`. Live calls use the published version; tests may use a draft.`]})]})}export function TemplateHelp(){let[r,i]=e(!1);return y(`div`,{className:`rounded-lg border bg-muted/20 text-xs`,children:[y(`button`,{type:`button`,"aria-expanded":r,"aria-controls":`template-help`,className:`flex w-full items-center gap-2 px-2 py-1.5 text-left font-medium focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:()=>i(e=>!e),children:[v(n,{className:`size-3.5 text-primary`,"aria-hidden":`true`}),`Template syntax: `,v(`code`,{className:`rounded bg-muted px-1`,children:`{{ path | filter }}`}),v(t,{className:r?`ml-auto size-3.5 rotate-180`:`ml-auto size-3.5`,"aria-hidden":`true`})]}),r&&y(`div`,{id:`template-help`,className:`space-y-1.5 border-t px-2 py-2 leading-5 text-muted-foreground`,children:[y(`p`,{children:[v(`strong`,{className:`text-foreground`,children:`Roots`}),` `,_.map(e=>v(`code`,{className:`mr-1 rounded bg-muted px-1`,children:e},e))]}),y(`p`,{children:[v(`strong`,{className:`text-foreground`,children:`Filters`}),` `,g.map(e=>v(`code`,{className:`mr-1 rounded bg-muted px-1`,children:e},e))]}),y(`p`,{children:[`Paths and list indexes only: `,v(`code`,{children:`{{q.reference_number}}`}),`,`,` `,v(`code`,{children:`{{input.items[0].id | upper}}`}),`. No expressions or function calls; secrets are never in the context. URL values are percent-encoded (only`,` `,v(`code`,{children:`{{base}}`}),` is inserted as is). A body string that is exactly one placeholder keeps its JSON type; empty query values are left out.`]})]})]})}const C=[{value:`read`,label:`Read`},{value:`write`,label:`Write`}];export function ActionEditor({draft:e,set:t,errorOf:n,creating:r,connectors:g,profiles:_,mappings:x=[]}){let w=s(e),T=e.method===`GET`;return y(`div`,{className:`space-y-3`,children:[y(`div`,{className:`grid gap-3 sm:grid-cols-6`,children:[v(c,{id:`action-display-name`,label:`Display name`,error:n(`display_name`),className:`sm:col-span-3`,hint:`What people see in lists. Can change any time.`,children:v(i,{...u(`action-display-name`,n(`display_name`)),className:`h-8 bg-card text-sm`,maxLength:120,placeholder:`Search policies`,value:e.display_name,onChange:e=>t({display_name:e.target.value})})}),v(c,{id:`action-description`,label:`Description`,error:n(`description`),className:`sm:col-span-3`,children:v(i,{...u(`action-description`,n(`description`)),className:`h-8 bg-card text-sm`,maxLength:1e3,placeholder:`Finds policies by holder name or number.`,value:e.description,onChange:e=>t({description:e.target.value})})}),v(c,{id:`action-name`,label:`Name`,error:n(`name`),className:`sm:col-span-3`,hint:r?`Never changes after the first version.`:void 0,children:v(i,{...u(`action-name`,n(`name`),r),className:`h-8 bg-card text-sm`,maxLength:128,readOnly:!r,placeholder:`pas.policy.search`,value:e.name,onChange:e=>t({name:e.target.value})})}),v(c,{id:`action-role`,label:`Role`,error:n(`role`),className:`sm:col-span-3`,children:v(`select`,{id:`action-role`,className:d,value:e.role,onChange:e=>t({role:e.target.value}),children:h.map(e=>v(`option`,{value:e,children:e},e))})}),v(c,{id:`action-connector`,label:`Connector`,error:n(`connector_id`),className:`sm:col-span-3`,children:y(`select`,{...u(`action-connector`,n(`connector_id`)),className:d,value:e.connector_id,onChange:e=>t({connector_id:e.target.value}),children:[v(`option`,{value:``,children:`Choose a connector…`}),g.map(e=>y(`option`,{value:e.id,children:[e.display_name??e.name,e.enabled?``:` (disabled)`]},e.id))]})}),v(c,{id:`action-profile`,label:`Auth profile`,error:n(`auth_profile_id`),className:`sm:col-span-3`,children:y(`select`,{id:`action-profile`,className:d,value:e.auth_profile_id,onChange:e=>t({auth_profile_id:e.target.value}),children:[v(`option`,{value:``,children:`The connector’s profile`}),_.map(e=>v(`option`,{value:e.id,children:e.display_name??e.name},e.id))]})}),v(c,{id:`action-method`,label:`Method`,error:n(`method`),className:`sm:col-span-2`,children:v(`select`,{id:`action-method`,className:d,value:e.method,onChange:e=>{let n=e.target.value;t(n===`GET`?{method:n,side_effect:`read`}:{method:n})},children:f.map(e=>v(`option`,{value:e,children:e},e))})}),y(`div`,{className:`sm:col-span-4`,children:[v(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`Side effect`}),v(o,{label:`Side effect`,value:e.side_effect,segments:T?C.slice(0,1):C,onChange:e=>t({side_effect:e})}),n(`side_effect`)?v(`p`,{role:`alert`,className:`mt-1 text-xs text-destructive`,children:n(`side_effect`)}):v(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.side_effect===`read`?`Reads only; may later become an agent lookup tool.`:`Changes the target system; live tests need an explicit confirmation.`})]})]}),v(TemplateHelp,{}),v(c,{id:`action-url`,label:`URL template`,error:n(`url_template`),children:v(i,{...u(`action-url`,n(`url_template`)),className:`h-8 bg-card text-sm`,spellCheck:!1,maxLength:8e3,placeholder:`{{base}}/api/items/{{input.id}}`,value:e.url_template,onChange:e=>t({url_template:e.target.value})})}),w.length>0&&y(`output`,{className:`block text-xs text-warning-foreground`,children:[`Unknown template root`,w.length>1?`s`:``,`: `,w.join(`, `),`. The server will refuse `,w.length>1?`them`:`it`,`.`]}),y(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[v(l,{label:`Headers`,keyLabel:`Header name`,valueLabel:`Header template`,keyPlaceholder:`X-Correlation-ID`,valuePlaceholder:`{{flow.correlation_id}}`,rows:e.headers,error:n(`headers`),onChange:e=>t({headers:e})}),v(l,{label:`Query parameters`,keyLabel:`Query name`,valueLabel:`Query template`,keyPlaceholder:`number`,valuePlaceholder:`{{q.reference_number}}`,rows:e.query,error:n(`query`),onChange:e=>t({query:e})})]}),v(S,{draft:e,set:t,errorOf:n,mappings:x,noBody:T}),v(c,{id:`action-body`,label:`Body template (JSON)`,error:n(`body`),hint:T?`A GET action has no body.`:e.payload_mapping?`Not used: the payload mapping builds the body.`:`Leave empty for no body.`,children:v(a,{...u(`action-body`,n(`body`),!0),rows:5,spellCheck:!1,disabled:T||!!e.payload_mapping,className:`min-h-20 bg-card font-mono text-sm`,placeholder:`{
2
+ "short_description": "{{task.short_description}}"
3
+ }`,value:e.body,onChange:e=>t({body:e.target.value})})}),v(c,{id:`action-response-mode`,label:`Response`,error:n(`response_mode`),hint:p[e.response_mode].hint,children:v(`select`,{...u(`action-response-mode`,n(`response_mode`),!0),className:d,value:e.response_mode,onChange:e=>t({response_mode:e.target.value}),children:m.map(e=>v(`option`,{value:e,children:p[e].label},e))})}),v(l,{label:`Response mapping`,keyLabel:`Output name`,valueLabel:`Response path`,keyPlaceholder:`external_id`,valuePlaceholder:`$.result.id`,rows:e.mapping,error:n(`mapping`),hint:y(b,{children:[`Paths like `,v(`code`,{children:`$.a.b`}),`, `,v(`code`,{children:`$.items[0]`}),`, `,v(`code`,{children:`$.items[*].id`}),`. A name ending in `,v(`code`,{children:`[]`}),` is always a list.`]}),onChange:e=>t({mapping:e})}),y(`fieldset`,{className:`grid gap-3 rounded-lg border p-2 sm:grid-cols-4`,children:[v(`legend`,{className:`px-1 text-xs font-medium text-muted-foreground`,children:`Delivery`}),v(c,{id:`action-codes`,label:`Success codes`,error:n(`success_codes`),className:`sm:col-span-2`,children:v(i,{...u(`action-codes`,n(`success_codes`)),className:`h-8 bg-card text-sm`,placeholder:`200, 201`,value:e.success_codes,onChange:e=>t({success_codes:e.target.value})})}),v(c,{id:`action-timeout`,label:`Timeout (ms)`,error:n(`timeout_ms`),children:v(i,{...u(`action-timeout`,n(`timeout_ms`)),type:`number`,min:100,max:12e4,className:`h-8 bg-card text-sm`,value:e.timeout_ms,onChange:e=>t({timeout_ms:e.target.value})})}),v(c,{id:`action-rate`,label:`Rate limit / min`,error:n(`rate_limit`),children:v(i,{...u(`action-rate`,n(`rate_limit`)),type:`number`,min:1,max:6e3,placeholder:`None`,className:`h-8 bg-card text-sm`,value:e.rate_limit,onChange:e=>t({rate_limit:e.target.value})})}),v(c,{id:`action-idempotency`,label:`Idempotency key`,children:y(`select`,{id:`action-idempotency`,className:d,value:e.idempotency,onChange:e=>t({idempotency:e.target.value}),children:[v(`option`,{value:`none`,children:`None`}),v(`option`,{value:`header`,children:`In a header`}),v(`option`,{value:`body_field`,children:`In a body field`})]})}),v(c,{id:`action-idempotency-name`,label:e.idempotency===`body_field`?`Body field`:`Header name`,error:n(`idempotency_value`),children:v(i,{...u(`action-idempotency-name`,n(`idempotency_value`)),className:`h-8 bg-card text-sm`,disabled:e.idempotency===`none`,placeholder:e.idempotency===`body_field`?`correlation_id`:`Idempotency-Key`,value:e.idempotency_value,onChange:e=>t({idempotency_value:e.target.value})})}),v(c,{id:`action-attempts`,label:`Max attempts`,error:n(`max_attempts`),children:v(i,{...u(`action-attempts`,n(`max_attempts`)),type:`number`,min:1,max:10,placeholder:`1`,className:`h-8 bg-card text-sm`,value:e.max_attempts,onChange:e=>t({max_attempts:e.target.value})})}),v(c,{id:`action-backoff`,label:`Backoff`,children:y(`select`,{id:`action-backoff`,className:d,value:e.backoff,onChange:e=>t({backoff:e.target.value}),children:[v(`option`,{value:`exponential`,children:`Exponential`}),v(`option`,{value:`fixed`,children:`Fixed`})]})}),v(c,{id:`action-delay`,label:`Base delay (ms)`,error:n(`base_delay_ms`),children:v(i,{...u(`action-delay`,n(`base_delay_ms`)),type:`number`,min:0,max:6e4,placeholder:`500`,className:`h-8 bg-card text-sm`,value:e.base_delay_ms,onChange:e=>t({base_delay_ms:e.target.value})})}),v(`p`,{className:`text-xs text-muted-foreground sm:col-span-3`,children:`Only GET, PUT, DELETE and calls with an idempotency key are retried (timeouts, connection errors, 408, 425, 429, 5xx). A new key is generated per call.`})]}),v(c,{id:`action-pagination`,label:`Pagination (JSON, optional)`,error:n(`pagination`),hint:`Stored and versioned now; used by the paging step that follows.`,children:v(a,{...u(`action-pagination`,n(`pagination`),!0),rows:2,spellCheck:!1,className:`min-h-10 bg-card font-mono text-sm`,value:e.pagination,onChange:e=>t({pagination:e.target.value})})})]})}
@@ -0,0 +1,20 @@
1
+ import type { IntegrationAction } from '@/shared/api/integrations';
2
+ /** Where this version stands in draft → tested → published → retired, and what is live. */
3
+ export declare function DeployPanel({ action, live, latest, publishable, onOpen, }: {
4
+ action: IntegrationAction;
5
+ live: IntegrationAction | undefined;
6
+ latest: IntegrationAction | undefined;
7
+ publishable: boolean;
8
+ onOpen: (id: string) => void;
9
+ }): import("react").JSX.Element;
10
+ /** Every logged attempt of this version: hashes, status, duration and error, never bodies. */
11
+ export declare function CallLog({ action, active }: {
12
+ action: IntegrationAction;
13
+ active: boolean;
14
+ }): import("react").JSX.Element;
15
+ /** Every version of the action, newest first; one click opens a version. */
16
+ export declare function VersionsPanel({ versions, currentId, onOpen, }: {
17
+ versions: IntegrationAction[] | undefined;
18
+ currentId: string;
19
+ onOpen: (id: string) => void;
20
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{DataTable as e}from"@/shared/components/workspace/DataTable";import{ArrowRight as t,RefreshCw as n,Rocket as r}from"lucide-react";import{ErrorNotice as i}from"@/shared/components/layout/ErrorNotice";import{Button as a}from"@/shared/components/ui/button";import{PersonName as o}from"@/shared/components/workspace/PersonName";import{usePersonName as s,usePersonNames as c}from"@/shared/hooks/usePersonNames";import{cn as l}from"@/shared/lib/utils";import{Loading as u,MethodBadge as d,Pill as f,StatusPill as p}from"./parts";import{formatTime as m,shortHash as h,statusLabels as g,statusOrder as _}from"../model/presentation";import{useCalls as v}from"../hooks/useStudio";import{jsx as y,jsxs as b,Fragment as x}from"react/jsx-runtime";export function DeployPanel({action:e,live:n,latest:i,publishable:o,onOpen:c}){let u=s(n?.updated_by),d=e.status===`draft`?`Run a passing test (dry run or live) to move this draft to tested.`:e.status===`tested`?o?`Publish it from the header. The live version, if any, is retired in the same step.`:`Someone with admin.integration.publish can publish it.`:e.status===`published`?`This version is live. Save a change to start the next version as a draft.`:`Retired versions stay readable for audit and are never used again.`;return b(`div`,{className:`space-y-3 p-3 text-xs`,children:[y(`ol`,{"aria-label":`Lifecycle`,className:`flex flex-wrap items-center gap-1`,children:_.map((n,r)=>b(`li`,{className:`flex items-center gap-1`,children:[y(`span`,{"aria-current":e.status===n?`step`:void 0,className:l(`rounded-badge border px-2 py-0.5`,e.status===n?l(`border-primary font-semibold`,g[n].className):`text-muted-foreground`),children:g[n].label}),r<_.length-1&&y(t,{className:`size-3 text-muted-foreground`,"aria-hidden":`true`})]},n))}),y(`p`,{children:d}),b(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border p-2`,children:[y(`dt`,{className:`text-muted-foreground`,children:`Live version`}),y(`dd`,{className:`flex flex-wrap items-center gap-2`,children:n?b(x,{children:[y(r,{className:`size-3.5 text-success-foreground`,"aria-hidden":`true`}),b(`strong`,{children:[`v`,n.version_no]}),y(`code`,{title:n.content_hash,children:h(n.content_hash)}),y(`span`,{className:`text-muted-foreground`,children:u?`updated ${m(n.updated_at)} by ${u}`:`updated ${m(n.updated_at)}`}),n.id!==e.id&&b(a,{type:`button`,variant:`link`,size:`xs`,onClick:()=>c(n.id),children:[`Open v`,n.version_no]})]}):`Nothing is live. Flows cannot use this action yet.`}),y(`dt`,{className:`text-muted-foreground`,children:`This version`}),b(`dd`,{className:`flex flex-wrap items-center gap-2`,children:[b(`strong`,{children:[`v`,e.version_no]}),y(p,{status:e.status}),y(`code`,{title:e.content_hash,children:h(e.content_hash)})]}),i&&i.id!==e.id&&b(x,{children:[y(`dt`,{className:`text-muted-foreground`,children:`Latest version`}),b(`dd`,{className:`flex items-center gap-2`,children:[b(`strong`,{children:[`v`,i.version_no]}),y(p,{status:i.status}),b(a,{type:`button`,variant:`link`,size:`xs`,onClick:()=>c(i.id),children:[`Open v`,i.version_no]})]})]})]}),y(`p`,{className:`text-muted-foreground`,children:`The content hash (SHA-256 of the canonical content) identifies exactly what was tested and published. Published content never changes.`})]})}export function CallLog({action:t,active:r}){let s=v(t.id,r),l=c((s.data??[]).map(e=>e.created_by));return b(`section`,{"aria-label":`Call log`,className:`space-y-2 p-3`,children:[b(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[b(`p`,{children:[`Latest 50 attempts of v`,t.version_no,`. Bodies are never stored, only hashes.`]}),b(a,{type:`button`,variant:`outline`,size:`xs`,disabled:s.isFetching,onClick:()=>void s.refetch(),children:[y(n,{}),`Refresh`]})]}),s.isPending?y(u,{children:`Loading calls…`}):s.isError?y(i,{error:s.error,retry:()=>void s.refetch()}):y(`div`,{className:`overflow-x-auto rounded-lg border`,children:b(e,{searchInHeader:!0,empty:y(x,{children:`No calls yet. Live tests and flows log every attempt here.`}),className:`w-full text-left text-sm`,children:[b(`caption`,{className:`sr-only`,children:[`Calls of version `,t.version_no]}),y(`thead`,{className:`bg-muted/40 text-muted-foreground`,children:y(`tr`,{children:[`Time`,`Method`,`Status`,`Duration`,`Error`,`URL hash`,`Response hash`,`By`].map(e=>y(`th`,{scope:`col`,className:`px-2 py-1 font-medium whitespace-nowrap`,children:e},e))})}),y(`tbody`,{className:`divide-y`,children:s.data.map(e=>{let n=e.response_status!==null&&t.success_codes.includes(e.response_status)&&!e.error;return b(`tr`,{children:[y(`td`,{className:`px-2 py-2 whitespace-nowrap`,"data-grid-sort":e.called_at,children:m(e.called_at)}),y(`td`,{className:`px-2 py-2`,"data-grid-value":e.method,children:y(d,{method:e.method})}),y(`td`,{className:`px-2 py-2`,children:y(f,{className:n?`bg-success/10 text-success-foreground`:`bg-destructive/10 text-destructive`,children:e.response_status??`none`})}),y(`td`,{className:`px-2 py-2 whitespace-nowrap`,children:e.duration_ms===null?`—`:`${e.duration_ms} ms`}),y(`td`,{className:`max-w-48 truncate px-2 py-2`,title:e.error??void 0,children:e.error??`—`}),y(`td`,{className:`px-2 py-2`,title:e.url_hash,children:h(e.url_hash)}),y(`td`,{className:`px-2 py-2`,title:e.response_hash??void 0,children:h(e.response_hash)}),y(`td`,{className:`px-2 py-2`,"data-grid-value":l(e.created_by).text||`flow`,children:y(o,{subject:e.created_by,empty:`flow`})})]},e.id)})})]})})]})}export function VersionsPanel({versions:e,currentId:t,onOpen:n}){let r=c(e?.map(e=>e.updated_by??e.created_by)??[]);return e?y(`ol`,{"aria-label":`Versions`,className:`divide-y p-3 text-xs`,children:e.map(e=>b(`li`,{className:l(`flex flex-wrap items-center gap-2 px-1 py-1.5`,e.id===t&&`bg-primary/5`),children:[b(`button`,{type:`button`,"aria-current":e.id===t||void 0,className:`font-semibold text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:()=>n(e.id),children:[`v`,e.version_no]}),y(p,{status:e.status}),y(d,{method:e.method}),y(`code`,{title:e.content_hash,children:h(e.content_hash)}),y(`span`,{className:`ml-auto text-muted-foreground`,children:[m(e.updated_at??e.created_at),r(e.updated_by??e.created_by).text].filter(Boolean).join(` · `)})]},e.id))}):y(u,{children:`Loading versions…`})}
@@ -0,0 +1,14 @@
1
+ import { type IntegrationAction, type Versioned } from '@/shared/api/integrations';
2
+ import { type Studio } from '../hooks/useStudio';
3
+ /**
4
+ * One action version as a page: definition, test, deploy, call log and versions. Header
5
+ * actions keep a fixed order (Save, Publish, Retire); the way back is the page's BackLink.
6
+ * Saving never changes a stored version: it
7
+ * stores the next version as a draft (`PUT` with the latest version's ETag).
8
+ */
9
+ export declare function ActionWorkspace({ saved, studio, connector, }: {
10
+ saved?: Versioned<IntegrationAction>;
11
+ studio: Studio;
12
+ /** Connector a new action starts on (opened from a system's endpoints). */
13
+ connector?: string;
14
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{useState as e}from"react";import{useMutation as t}from"@tanstack/react-query";import{Archive as n,Rocket as ee,Save as r,Waypoints as i}from"lucide-react";import{createAction as a,createActionVersion as o,publishAction as s,relabelAction as c,retireAction as l}from"@/shared/api/integrations";import{Button as u}from"@/shared/components/ui/button";import{actionCodes as d,actionFields as f,actionProblems as p,contentKey as m,draftKey as h,fromAction as g,toWrite as te}from"../model/action-form";import{ActionEditor as _}from"./ActionEditor";import{CallLog as ne,DeployPanel as re,VersionsPanel as ie}from"./ActionPanels";import{SaveError as v}from"./EditorForm";import{Confirm as y,MethodBadge as b,StatusPill as x,Tabs as ae}from"./parts";import{ControlHeader as oe}from"@/shared/components/workspace/ControlHeader";import{fieldProblems as se}from"../model/problems";import{TestPanel as ce}from"./TestPanel";import{useConnectors as le,useMappingNames as ue,useProfiles as S,useRefreshActions as C,useVersions as w}from"../hooks/useStudio";import{notify as T}from"@/shared/lib/notify";import{jsx as E,jsxs as D,Fragment as O}from"react/jsx-runtime";const k=[{value:`definition`,label:`Definition`},{value:`test`,label:`Test`},{value:`deploy`,label:`Deploy`},{value:`calls`,label:`Call log`},{value:`versions`,label:`Versions`}];export function ActionWorkspace({saved:A,studio:j,connector:M}){let N=le(j),P=S(j),F=ue(j),I=w(A?.data.id??``),L=C(j.scope.tenantId),de=M??(N.data?.length===1?N.data[0]?.id??``:``),[R,z]=e(()=>g(A?.data,de)),[B,V]=e(null),H=A?.data,U=I.data?.[0],W=I.data?.find(e=>e.status===`published`),G=!H||!U||U.id===H.id,K=t({mutationFn:e=>A?X?c(A.data.id,{display_name:e.display_name,description:e.description},A.etag):o(A.data.id,e,A.etag):a(e,j.scope.tenantId),onSuccess:async e=>{await L(e),T.success(A?`Action saved.`:`Action created.`),j.select(e.data.id)}}),q=t({mutationFn:e=>{if(!A)throw Error(`Save the action first.`);return e===`publish`?s(A.data.id,A.etag):l(A.data.id,A.etag)},onSuccess:async(e,t)=>{V(null),await L(e),T.success(t===`publish`?`Action published.`:`Action retired.`)}}),fe=e=>void L({data:e.action,etag:`"${e.action.version}"`}),pe=e=>{z(t=>({...t,...e})),K.error&&K.reset()},J=p(R),Y=!H||h(R)!==h(g(H)),X=!!H&&Y&&m(R)===m(g(H)),Z=se(K.error,f,d),me=e=>Z.fields[e]??(Y?J[e]:void 0),he=Object.keys(J).length===0,Q=j.writable&&G&&Y&&he&&!K.isPending,$=H?j.view:`definition`;return D(`div`,{className:`flex min-h-0 flex-col`,children:[E(oe,{title:H?H.display_name||H.name:`New endpoint`,icon:i,description:H?H.description||`${H.name} · ${H.method} ${H.url_template}`:void 0,pills:H&&D(O,{children:[E(b,{method:H.method}),D(`span`,{className:`rounded-badge bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground tabular-nums ring-border`,children:[`v`,H.version_no]}),E(x,{status:H.status})]}),actions:D(O,{children:[j.writable&&D(u,{type:`submit`,form:`action-panel-definition`,disabled:!Q,title:G?void 0:`Open the latest version to change it`,children:[E(r,{}),K.isPending?`Saving…`:H?X?`Save`:`Save as v${(U?.version_no??H.version_no)+1}`:`Create draft`]}),H&&j.publishable&&D(O,{children:[D(u,{type:`button`,variant:`outline`,disabled:H.status!==`tested`||q.isPending,title:H.status===`tested`?void 0:`Only a tested version can be published`,onClick:()=>V(`publish`),children:[E(ee,{}),`Publish`]}),D(u,{type:`button`,variant:`outline`,className:`border-destructive/40 text-destructive`,disabled:H.status===`retired`||q.isPending,onClick:()=>V(`retire`),children:[E(n,{}),`Retire`]})]})]})}),H&&E(ae,{label:`Action views`,idPrefix:`action`,className:`mb-3`,value:$,items:k,onChange:e=>j.setView(e)}),D(`div`,{className:`rounded-xl border bg-card`,children:[D(`div`,{className:`space-y-2 px-3 pt-2 empty:hidden`,children:[B===`publish`&&H&&E(y,{title:D(O,{children:[`Publish `,D(`strong`,{children:[`v`,H.version_no]}),` of `,H.name,`?`]}),action:`Publish v${H.version_no}`,pending:q.isPending,onCancel:()=>V(null),onConfirm:()=>q.mutate(`publish`),children:W&&W.id!==H.id?`v${W.version_no} is live now and will be retired in the same step.`:`It becomes the version flows use.`}),B===`retire`&&H&&D(y,{destructive:!0,title:D(O,{children:[`Retire `,D(`strong`,{children:[`v`,H.version_no]}),`?`]}),action:`Retire v${H.version_no}`,pending:q.isPending,onCancel:()=>V(null),onConfirm:()=>q.mutate(`retire`),children:[`Flows stop using it; it stays readable for audit.`,H.status===`published`&&` Nothing of this action will be live afterwards.`]}),E(v,{error:q.error,onReload:()=>void L()}),!G&&U&&D(`output`,{className:`block rounded-md bg-muted p-2 text-xs`,children:[`You are viewing v`,H?.version_no,`. The latest is v`,U.version_no,`.`,` `,D(u,{type:`button`,variant:`link`,size:`xs`,onClick:()=>j.select(U.id),children:[`Open v`,U.version_no]})]})]}),D(`form`,{id:`action-panel-definition`,role:`tabpanel`,"aria-labelledby":H?`action-tab-definition`:void 0,"aria-label":H?void 0:`New action`,noValidate:!0,hidden:$!==`definition`,className:`p-3`,onSubmit:e=>{e.preventDefault(),Q&&K.mutate(te(R))},children:[E(v,{error:Z.rest}),D(`fieldset`,{disabled:!j.writable||!G,className:`mt-2`,children:[E(`legend`,{className:`sr-only`,children:`Definition`}),E(_,{draft:R,set:pe,errorOf:me,creating:!H,connectors:N.data??[],profiles:P.data??[],mappings:F.data??[]})]})]}),H&&D(O,{children:[E(`div`,{role:`tabpanel`,id:`action-panel-test`,"aria-labelledby":`action-tab-test`,hidden:$!==`test`,children:E(ce,{action:H,writable:j.writable,unsaved:Y,onTested:fe},H.id)}),E(`div`,{role:`tabpanel`,id:`action-panel-deploy`,"aria-labelledby":`action-tab-deploy`,hidden:$!==`deploy`,children:E(re,{action:H,live:W,latest:U,publishable:j.publishable,onOpen:e=>j.select(e,`deploy`)})}),E(`div`,{role:`tabpanel`,id:`action-panel-calls`,"aria-labelledby":`action-tab-calls`,hidden:$!==`calls`,children:E(ne,{action:H,active:$===`calls`})}),E(`div`,{role:`tabpanel`,id:`action-panel-versions`,"aria-labelledby":`action-tab-versions`,hidden:$!==`versions`,children:E(ie,{versions:I.data,currentId:H.id,onOpen:e=>j.select(e,`versions`)})})]})]})]})}
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type Studio } from '../hooks/useStudio';
3
+ /** Actions: one row per name with its latest version and the version that is live. */
4
+ export declare function ActionsTab({ studio, split, fixedConnector, }: {
5
+ studio: Studio;
6
+ split: (list: ReactNode, panel: ReactNode) => ReactNode;
7
+ /** Shows only this connector's actions (a system's endpoints); new ones default to it. */
8
+ fixedConnector?: string;
9
+ }): ReactNode;
@@ -0,0 +1 @@
1
+ import{GridHeader as e,GridHeaderSlot as t}from"@/shared/components/workspace/GridHeader";import{DataTable as n}from"@/shared/components/workspace/DataTable";import{useState as r}from"react";import{useMutation as i}from"@tanstack/react-query";import{FileUp as a,Rocket as o,Search as s}from"lucide-react";import{importOpenApi as c}from"@/shared/api/integrations";import{ErrorNotice as l}from"@/shared/components/layout/ErrorNotice";import{Button as u}from"@/shared/components/ui/button";import{Input as d}from"@/shared/components/ui/input";import{Textarea as f}from"@/shared/components/ui/textarea";import{cn as p}from"@/shared/lib/utils";import{notify as m}from"@/shared/lib/notify";import{problemMessage as h}from"../model/problems";import{apiFormatLabels as g,apiFormatOf as _,endpointPrefixOf as v,parseApiDocument as y}from"../model/api-document";import{ActionWorkspace as b}from"./ActionWorkspace";import{SaveError as x}from"./EditorForm";import{Field as S,Loading as C,MethodBadge as w,Pill as T,StatusPill as E}from"./parts";import{ControlHeader as D}from"@/shared/components/workspace/ControlHeader";import{described as O,fieldClass as k,formatTime as A}from"../model/presentation";import{useAction as j,useActionLines as M,useConnectors as N,useRefreshActions as P}from"../hooks/useStudio";import{jsx as F,jsxs as I}from"react/jsx-runtime";const L=/^[a-z0-9_]+(\.[a-z0-9_]+)*$/;function R({studio:e,initialConnector:t=``}){let n=N(e),o=P(e.scope.tenantId),[s,l]=r(t),[p,b]=r(null),[C,T]=r(``),E=(n.data??[]).find(e=>e.id===s),A=p??(E?v(E.name):``),j=i({mutationFn:t=>c(t,e.scope.tenantId),onSuccess:e=>{o();let t=e.created.length===1?`1 draft`:`${e.created.length} drafts`;m.success(e.skipped.length?`${t} created, ${e.skipped.length} skipped (name exists).`:`${t} created.`)},onError:e=>m.error(`Import failed: ${h(e)}`)}),M=C.trim()?y(C):null,R=M?_(M):null,z=R&&g[R],B=!!(s&&L.test(A.trim())&&z),V=C.trim()?M?z?void 0:`Not an OpenAPI 3, Swagger 2.0 or Postman collection document.`:`Not a JSON object.`:void 0;return I(`form`,{"aria-label":`Import endpoints`,onSubmit:e=>{e.preventDefault(),B&&M&&j.mutate({connector_id:s,prefix:A.trim(),document:M})},children:[F(D,{title:`Import Swagger / OpenAPI / Postman`,icon:a,description:`One endpoint draft per operation of the document.`,actions:I(u,{type:`submit`,disabled:!B||j.isPending,children:[F(a,{}),j.isPending?`Importing…`:`Create drafts`]})}),I(`div`,{className:`space-y-3 rounded-xl border bg-card p-3`,children:[I(`p`,{className:`text-xs text-muted-foreground`,children:[`Reads OpenAPI 3, Swagger 2.0 and Postman collections (v2.x), as JSON. One draft per operation or request: path parameters, `,F(`code`,{children:`:id`}),` and `,F(`code`,{children:`{{variables}}`}),` `,`become `,F(`code`,{children:`{{input.<name>}}`}),`, query and header parameters go to the templates, a request body is `,F(`code`,{children:`{{input.body}}`}),`, 2xx codes become success codes. The host is replaced by this system's base URL, and credential headers stay with its authentication. Existing names are skipped. Then add the role and response mapping, test and publish.`]}),I(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[F(S,{id:`import-connector`,label:`Connector`,children:I(`select`,{id:`import-connector`,className:k,value:s,onChange:e=>l(e.target.value),children:[F(`option`,{value:``,children:`Choose a connector…`}),(n.data??[]).map(e=>F(`option`,{value:e.id,children:e.display_name??e.name},e.id))]})}),F(S,{id:`import-prefix`,label:`Name prefix`,error:A&&!L.test(A.trim())?`Lower-case words of letters, digits and _, dot-separated.`:void 0,children:F(d,{...O(`import-prefix`),className:`h-8 bg-card text-sm`,maxLength:60,placeholder:`pas`,value:A,onChange:e=>b(e.target.value)})})]}),F(S,{id:`import-file`,label:`Swagger, OpenAPI or Postman file (JSON)`,hint:`Or paste the document below. It is read in the browser and sent to the API.`,children:F(`input`,{id:`import-file`,type:`file`,accept:`application/json,.json,.postman_collection`,className:`block w-full text-xs file:mr-2 file:rounded-md file:border file:bg-card file:px-2 file:py-1 file:text-xs`,onChange:e=>{let t=e.target.files?.[0];t&&t.text().then(T)}})}),F(S,{id:`import-document`,label:`Document (JSON)`,hint:z?`Detected: ${z}`:void 0,error:V,children:F(f,{...O(`import-document`,V,!!z),rows:8,spellCheck:!1,className:`min-h-32 bg-card font-mono text-sm`,placeholder:`{"openapi": "3.0.3", "paths": {...}}`,value:C,onChange:e=>T(e.target.value)})}),F(x,{error:j.error}),j.data&&I(`section`,{"aria-label":`Import result`,className:`space-y-1 rounded-lg border p-2 text-xs`,children:[I(`p`,{children:[F(`strong`,{children:j.data.created.length}),` draft(s) created`,j.data.skipped.length>0&&`, ${j.data.skipped.length} skipped (name exists)`,`.`]}),I(`ul`,{className:`space-y-0.5`,children:[j.data.created.map(t=>I(`li`,{className:`flex items-center gap-2`,children:[F(w,{method:t.method}),F(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>e.select(t.id),children:t.display_name||t.name})]},t.id)),j.data.skipped.map(e=>I(`li`,{className:`text-muted-foreground`,children:[`Skipped `,F(`code`,{children:e})]},e))]})]})]})]})}export function ActionsTab({studio:i,split:a,fixedConnector:c}){let[u,f]=r(null),m=M(i),h=N(i),[g,_]=r(``),v=c,y=i.selected===`new`||i.selected===`import`,x=j(y?``:i.selected),S=(m.data??[]).filter(e=>!v||e.latest.connector_id===v),D=S.filter(e=>!g.trim()||`${e.latest.name} ${e.latest.display_name??``} ${e.latest.description??``} ${e.latest.role}`.toLowerCase().includes(g.trim().toLowerCase())),O=e=>{let t=(h.data??[]).find(t=>t.id===e);return t?t.display_name??t.name:`—`},k=x.data?.data.name;return a(I(`section`,{"aria-label":`Actions`,className:`flex min-h-0 flex-col overflow-hidden rounded-xl border bg-card`,children:[I(e,{children:[I(`label`,{htmlFor:`integration-action-search`,className:`relative`,children:[F(`span`,{className:`sr-only`,children:`Search actions`}),F(s,{className:`pointer-events-none absolute top-2 left-2 size-4 text-muted-foreground`,"aria-hidden":`true`}),F(d,{id:`integration-action-search`,type:`search`,className:`h-8 w-48 bg-card pl-7 text-xs`,placeholder:`Name, description or role`,value:g,onChange:e=>_(e.target.value)})]}),F(t,{ref:f})]}),F(`div`,{className:`flex-1 overflow-x-auto`,children:m.isPending?F(C,{children:`Loading actions…`}):m.isError?F(l,{error:m.error,retry:()=>void m.refetch()}):I(n,{empty:S.length===0?`No actions yet. Create one or import an OpenAPI document.`:`No action matches these filters.`,columnsToolbar:u,externalSearch:!0,className:`w-full text-left text-sm`,children:[F(`caption`,{className:`sr-only`,children:`Actions`}),F(`thead`,{className:`sticky top-0 bg-muted/60 text-muted-foreground backdrop-blur`,children:F(`tr`,{children:(c?[`Endpoint`,`Role`,`Effect`,`Latest`,`Live`,`Updated`]:[`Action`,`Role`,`Effect`,`Connector`,`Latest`,`Live`,`Updated`]).map(e=>F(`th`,{scope:`col`,className:`px-3 py-1.5 font-medium`,children:e},e))})}),F(`tbody`,{className:`divide-y`,children:D.map(({latest:e,live:t})=>{let n=k===e.name;return I(`tr`,{className:p(n&&`bg-primary/5`),children:[F(`td`,{className:`px-3 py-2`,children:I(`span`,{className:`flex items-center gap-2`,children:[F(w,{method:e.method}),I(`span`,{className:`min-w-0`,children:[F(`button`,{type:`button`,"aria-current":n||void 0,title:e.name,className:`font-semibold text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:()=>i.select(e.id),children:e.display_name||e.name}),e.description?F(`span`,{className:`line-clamp-1 block max-w-xl text-xs text-muted-foreground`,children:e.description}):e.display_name&&F(`span`,{className:`block font-mono text-[11px] text-muted-foreground`,children:e.name})]})]})}),F(`td`,{className:`px-3 py-2`,children:e.role}),F(`td`,{className:`px-3 py-2`,children:F(T,{className:e.side_effect===`write`?`bg-warning/10 text-warning-foreground`:void 0,children:e.side_effect===`write`?`Write`:`Read`})}),!c&&F(`td`,{className:`px-3 py-2`,children:O(e.connector_id)}),I(`td`,{className:`px-3 py-2 whitespace-nowrap`,children:[I(`span`,{className:`mr-1`,children:[`v`,e.version_no]}),F(E,{status:e.status})]}),F(`td`,{className:`px-3 py-2 whitespace-nowrap`,children:t?I(`span`,{className:`inline-flex items-center gap-1 text-success-foreground`,children:[F(o,{className:`size-3`,"aria-hidden":`true`}),`v`,t.version_no]}):F(`span`,{className:`text-muted-foreground`,children:`—`})}),F(`td`,{className:`px-3 py-2 whitespace-nowrap`,"data-grid-sort":e.updated_at??e.created_at,children:A(e.updated_at??e.created_at)})]},e.name)})})]})})]}),i.selected?i.selected===`import`?F(R,{studio:i,initialConnector:c}):i.selected===`new`?F(b,{studio:i,connector:c},`new`):x.isPending?F(C,{children:`Loading…`}):x.isError?F(l,{error:x.error,retry:()=>void x.refetch()}):F(b,{saved:x.data,studio:i},x.data.data.id):null)}
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type Studio } from '../hooks/useStudio';
3
+ /** Auth profiles: how calls authenticate. Secrets are kept here (encrypted, never shown
4
+ * again) or named in Key Vault; OAuth sign-in profiles connect from the editor. */
5
+ export declare function AuthProfilesTab({ studio, split, }: {
6
+ studio: Studio;
7
+ split: (list: ReactNode, panel: ReactNode) => ReactNode;
8
+ }): ReactNode;
@@ -0,0 +1 @@
1
+ import{EnabledSwitch as e}from"@/shared/components/workspace/EnabledSwitch";import{DataTable as t}from"@/shared/components/workspace/DataTable";import{useState as n}from"react";import{useQueryClient as r}from"@tanstack/react-query";import{KeyRound as i,LockKeyhole as a,ShieldCheck as o}from"lucide-react";import{authProfiles as s,profileCredentials as c}from"@/shared/api/integrations";import{ErrorNotice as l}from"@/shared/components/layout/ErrorNotice";import{Input as u}from"@/shared/components/ui/input";import{PersonName as d}from"@/shared/components/workspace/PersonName";import{cn as f}from"@/shared/lib/utils";import{EditorForm as p}from"./EditorForm";import{ConnectionPill as m,ProfileSignIn as h}from"./ProfileSignIn";import{Field as g,Loading as _,Pill as v}from"./parts";import{authKinds as y,described as b,fieldClass as x,formatTime as S,kindLabel as C}from"../model/presentation";import{credentialName as w,fromProfile as T,profileProblems as E,toProfileWrite as D}from"../model/profile-form";import{fieldProblems as O}from"../model/problems";import{useResourceSave as k}from"../hooks/useResourceSave";import{detailKey as A,profilesKey as j,useConnectors as M,useDetail as N,useProfiles as P}from"../hooks/useStudio";import{jsx as F,jsxs as I,Fragment as L}from"react/jsx-runtime";const R=Object.entries(y).map(([e,t])=>({value:e,label:t.label}));function z({saved:e,studio:t,usedBy:l}){let f=T(e?.data),[m,_]=n(f),[v,C]=n(null),[M,N]=n(!1),P=r(),z=e?.data.credentials?.secret_stored??!1,{save:B,remove:V,reload:H}=k(`profile`,s,e,{tenantId:t.scope.tenantId,listKey:j(t.scope.tenantId),onSaved:e=>t.select(e),onDeleted:()=>t.select(``)}),U=e=>{_(t=>({...t,...e})),B.error&&B.reset()},W=E(m,z),G=!e||!!m.secret||JSON.stringify(D(m))!==JSON.stringify(D(f)),K=O(B.error,{name:`name`,kind:`kind`,secret_ref:`secret_ref`,"config.token_url":`config.token_url`,"config.client_id":`config.client_id`,"config.scope":`config.scope`,"config.username":`config.username`,"config.header":`config.header`},{AUTH_PROFILE_EXISTS:`name`}),q=e=>K.fields[e]??(G?W[e]:void 0),J=y[m.kind];async function Y(){C(null);let e=await B.mutateAsync(D(m)).catch(()=>null);if(e&&m.kept&&m.secret&&J?.secret){try{await c.storeSecret(e.data.id,m.secret)}catch(e){C(e instanceof Error?e:Error(`The secret was not stored.`))}await P.invalidateQueries({queryKey:A(`profile`,e.data.id)}),await P.invalidateQueries({queryKey:j(t.scope.tenantId)})}}return I(p,{id:`auth-profile`,title:e?e.data.display_name??e.data.name:`New credential`,icon:i,creating:!e,writable:t.writable,dirty:G,valid:Object.keys(W).length===0,busy:B.isPending||V.isPending,error:K.rest??V.error??v,onSubmit:()=>void Y(),onDelete:()=>V.mutate(),onReload:H,deleteHint:`Refused while a connector or action uses it.`,children:[I(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[F(g,{id:`profile-display-name`,label:`Display name`,children:F(u,{id:`profile-display-name`,className:`h-8 bg-card text-sm`,maxLength:120,placeholder:`CRM OAuth`,value:m.display_name,onChange:t=>U({display_name:t.target.value,...!e&&!M&&{name:w(t.target.value)}})})}),F(g,{id:`profile-name`,label:`Name`,error:q(`name`),children:F(u,{...b(`profile-name`,q(`name`)),className:`h-8 bg-card font-mono text-sm`,maxLength:64,placeholder:`crm-oauth`,value:m.name,onChange:e=>{N(!0),U({name:e.target.value})}})}),F(g,{id:`profile-kind`,label:`Kind`,error:K.fields.kind,children:F(`select`,{id:`profile-kind`,className:x,value:m.kind,onChange:e=>U({kind:e.target.value}),children:R.map(e=>F(`option`,{value:e.value,children:e.label},e.value))})}),(J?.config??[]).map(e=>{let t=`profile-config-${e.key}`,n=q(`config.${e.key}`);return F(g,{id:t,label:`${e.label}${e.required?``:` (optional)`}`,error:n,children:F(u,{...b(t,n),className:`h-8 bg-card text-sm`,autoComplete:`off`,placeholder:e.placeholder,value:m.config[e.key]??``,onChange:t=>U({config:{...m.config,[e.key]:t.target.value}})})},`${m.kind}-${e.key}`)})]}),J?.secret?I(`fieldset`,{className:`space-y-2 rounded-lg border p-3`,children:[I(`legend`,{className:`px-1 text-xs font-semibold`,children:[`Secret: `,J.secret]}),F(`div`,{className:`flex flex-wrap gap-3 text-xs`,role:`radiogroup`,"aria-label":`Where it is kept`,children:[[!0,`Kept here, encrypted`],[!1,`In Key Vault (by name)`]].map(([e,t])=>I(`label`,{className:`flex items-center gap-1.5`,children:[F(`input`,{type:`radio`,name:`profile-secret-place`,checked:m.kept===e,onChange:()=>U({kept:e})}),t]},t))}),m.kept?F(g,{id:`profile-secret-value`,label:z?`Replace the secret (optional)`:`Secret`,error:q(`secret`),hint:z?I(`span`,{className:`inline-flex items-center gap-1`,children:[F(a,{className:`size-3`,"aria-hidden":`true`}),`Stored, encrypted. It is never shown again; type a new one to replace it.`]}):`Encrypted when saved and never shown again.`,children:F(u,{...b(`profile-secret-value`,q(`secret`)),type:`password`,className:`h-8 bg-card text-sm`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,placeholder:z?`••••••••`:`Paste ${J.secret}`,value:m.secret,onChange:e=>U({secret:e.target.value})})}):F(g,{id:`profile-secret`,label:`Key Vault secret name`,error:q(`secret_ref`),hint:`The name of the Key Vault secret; it is resolved on the server for each call.`,children:F(u,{...b(`profile-secret`,q(`secret_ref`),!0),className:`h-8 bg-card text-sm`,autoComplete:`off`,spellCheck:!1,maxLength:255,placeholder:`crm-client-secret`,value:m.secret_ref,onChange:e=>U({secret_ref:e.target.value})})})]}):I(`p`,{className:`flex items-start gap-2 rounded-lg border border-primary/20 bg-primary/5 p-2 text-xs`,children:[F(o,{className:`mt-0.5 size-4 shrink-0 text-primary`,"aria-hidden":`true`}),`Keyless: the platform’s own Azure identity requests a token for this scope. No secret is stored or referenced.`]}),e?.data.kind===`oauth2_authorization_code`&&m.kind===e.data.kind&&F(h,{profile:e.data,writable:t.writable}),e&&I(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 border-t pt-2 text-xs text-muted-foreground`,children:[F(`dt`,{children:`Used by`}),F(`dd`,{children:l.length?l.join(`, `):`No connector`}),F(`dt`,{children:`Updated`}),I(`dd`,{children:[S(e.data.updated_at),e.data.updated_by&&I(L,{children:[` · `,F(d,{subject:e.data.updated_by})]})]})]})]})}function B({profile:e}){return e.secret_ref?e.secret_ref===`platform`?e.credentials?.secret_stored?I(v,{className:`bg-success/10 text-success-foreground`,children:[F(a,{className:`size-3`,"aria-hidden":`true`}),`Kept here`]}):F(v,{className:`bg-warning/10 text-warning-foreground`,children:`Not stored yet`}):I(`span`,{children:[`Key Vault · `,e.secret_ref]}):F(v,{children:`Keyless`})}export function AuthProfilesTab({studio:n,split:r}){let a=P(n),o=M(n),c=n.selected===`new`,u=N(`profile`,c?``:n.selected,s.get),d=e=>(o.data??[]).filter(t=>t.auth_profile_id===e).map(e=>e.display_name??e.name);return r(F(`section`,{"aria-label":`Auth profiles`,className:`overflow-x-auto rounded-xl border bg-card`,children:a.isPending?F(_,{children:`Loading auth profiles…`}):a.isError?F(l,{error:a.error,retry:()=>void a.refetch()}):I(t,{searchInHeader:!0,empty:F(L,{children:`No auth profiles yet. Create one, then pick it on a connector.`}),className:`w-full text-left text-sm`,children:[F(`caption`,{className:`sr-only`,children:`Auth profiles`}),F(`thead`,{className:`sticky top-0 bg-muted/60 text-muted-foreground backdrop-blur`,children:F(`tr`,{children:[`Name`,`Kind`,`Secret`,`Used by`,`Updated`,`Enabled`].map(e=>F(`th`,{scope:`col`,className:`px-3 py-1.5 font-medium`,children:e},e))})}),F(`tbody`,{className:`divide-y`,children:a.data.map(t=>{let r=d(t.id);return I(`tr`,{className:f(n.selected===t.id&&`bg-primary/5`),children:[I(`td`,{className:`px-3 py-2`,children:[I(`button`,{type:`button`,"aria-current":n.selected===t.id||void 0,className:`inline-flex items-center gap-1.5 font-semibold text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:()=>n.select(t.id),children:[F(i,{className:`size-3.5`,"aria-hidden":`true`}),t.display_name??t.name]}),t.display_name&&F(`span`,{className:`ml-5 block text-xs text-muted-foreground`,children:t.name})]}),F(`td`,{className:`px-3 py-2`,children:I(`span`,{className:`inline-flex items-center gap-1.5`,children:[C(t.kind),F(m,{profile:t})]})}),F(`td`,{className:`px-3 py-2`,children:F(B,{profile:t})}),F(`td`,{className:`px-3 py-2`,children:r.length?r.join(`, `):`—`}),F(`td`,{className:`px-3 py-2 whitespace-nowrap`,"data-grid-sort":t.updated_at,children:S(t.updated_at)}),F(`td`,{className:`px-3 py-2`,"data-grid-value":t.enabled?`Enabled`:`Disabled`,children:F(e,{name:t.display_name??t.name,what:`Credential`,enabled:t.enabled,disabled:!n.writable,save:e=>s.update(t.id,{name:t.name,display_name:t.display_name,kind:t.kind,config:t.config,secret_ref:t.secret_ref,enabled:e},`"${t.version}"`),refresh:[j(n.scope.tenantId),A(`profile`,t.id)]})})]},t.id)})})]})}),n.selected?c?F(z,{studio:n,usedBy:[]},`new`):u.isPending?F(_,{children:`Loading…`}):u.isError?F(l,{error:u.error,retry:()=>void u.refetch()}):F(z,{saved:u.data,studio:n,usedBy:d(u.data.data.id)},`${u.data.data.id}:${u.data.data.version}`):null)}