@burdenoff/microfe-integrations 2026.510.111

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 (197) hide show
  1. package/README.md +35 -0
  2. package/dist/dev/main.d.ts +2 -0
  3. package/dist/dev/main.d.ts.map +1 -0
  4. package/dist/generated/global-operations.d.ts +2 -0
  5. package/dist/generated/global-operations.d.ts.map +1 -0
  6. package/dist/generated/global-types.d.ts +20716 -0
  7. package/dist/generated/global-types.d.ts.map +1 -0
  8. package/dist/generated/wspace-operations.d.ts +1645 -0
  9. package/dist/generated/wspace-operations.d.ts.map +1 -0
  10. package/dist/generated/wspace-operations.js +561 -0
  11. package/dist/generated/wspace-operations.js.map +1 -0
  12. package/dist/generated/wspace-types.d.ts +53434 -0
  13. package/dist/generated/wspace-types.d.ts.map +1 -0
  14. package/dist/index.d.ts +6 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +8 -0
  17. package/dist/integrations/IntegrationsAdminRoot.d.ts +19 -0
  18. package/dist/integrations/IntegrationsAdminRoot.d.ts.map +1 -0
  19. package/dist/integrations/IntegrationsAdminRoot.js +50 -0
  20. package/dist/integrations/IntegrationsAdminRoot.js.map +1 -0
  21. package/dist/integrations/IntegrationsAdminRoutes.d.ts +8 -0
  22. package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +1 -0
  23. package/dist/integrations/IntegrationsAdminRoutes.js +110 -0
  24. package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -0
  25. package/dist/integrations/IntegrationsRoot.d.ts +33 -0
  26. package/dist/integrations/IntegrationsRoot.d.ts.map +1 -0
  27. package/dist/integrations/IntegrationsRoot.js +78 -0
  28. package/dist/integrations/IntegrationsRoot.js.map +1 -0
  29. package/dist/integrations/IntegrationsRoutes.d.ts +17 -0
  30. package/dist/integrations/IntegrationsRoutes.d.ts.map +1 -0
  31. package/dist/integrations/IntegrationsUserRoutes.d.ts +8 -0
  32. package/dist/integrations/IntegrationsUserRoutes.d.ts.map +1 -0
  33. package/dist/integrations/IntegrationsUserRoutes.js +116 -0
  34. package/dist/integrations/IntegrationsUserRoutes.js.map +1 -0
  35. package/dist/integrations/components/AddConnectionDialog.d.ts +22 -0
  36. package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -0
  37. package/dist/integrations/components/AddConnectionDialog.js +655 -0
  38. package/dist/integrations/components/AddConnectionDialog.js.map +1 -0
  39. package/dist/integrations/components/ConfirmDialog.d.ts +17 -0
  40. package/dist/integrations/components/ConfirmDialog.d.ts.map +1 -0
  41. package/dist/integrations/components/ConfirmDialog.js +55 -0
  42. package/dist/integrations/components/ConfirmDialog.js.map +1 -0
  43. package/dist/integrations/components/ConnectionCard.d.ts +14 -0
  44. package/dist/integrations/components/ConnectionCard.d.ts.map +1 -0
  45. package/dist/integrations/components/ConnectionCard.js +101 -0
  46. package/dist/integrations/components/ConnectionCard.js.map +1 -0
  47. package/dist/integrations/components/ConnectionStatusBadge.d.ts +14 -0
  48. package/dist/integrations/components/ConnectionStatusBadge.d.ts.map +1 -0
  49. package/dist/integrations/components/ConnectionStatusBadge.js +12 -0
  50. package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -0
  51. package/dist/integrations/components/CredentialStorageSelector.d.ts +16 -0
  52. package/dist/integrations/components/CredentialStorageSelector.d.ts.map +1 -0
  53. package/dist/integrations/components/CredentialStorageSelector.js +159 -0
  54. package/dist/integrations/components/CredentialStorageSelector.js.map +1 -0
  55. package/dist/integrations/components/ProviderCard.d.ts +16 -0
  56. package/dist/integrations/components/ProviderCard.d.ts.map +1 -0
  57. package/dist/integrations/components/ProviderCard.js +161 -0
  58. package/dist/integrations/components/ProviderCard.js.map +1 -0
  59. package/dist/integrations/components/ProviderIcon.d.ts +19 -0
  60. package/dist/integrations/components/ProviderIcon.d.ts.map +1 -0
  61. package/dist/integrations/components/ProviderIcon.js +92 -0
  62. package/dist/integrations/components/ProviderIcon.js.map +1 -0
  63. package/dist/integrations/components/ui.d.ts +6 -0
  64. package/dist/integrations/components/ui.d.ts.map +1 -0
  65. package/dist/integrations/constants/enums.d.ts +70 -0
  66. package/dist/integrations/constants/enums.d.ts.map +1 -0
  67. package/dist/integrations/constants/featureFlags.d.ts +7 -0
  68. package/dist/integrations/constants/featureFlags.d.ts.map +1 -0
  69. package/dist/integrations/constants/featureFlags.js +11 -0
  70. package/dist/integrations/constants/featureFlags.js.map +1 -0
  71. package/dist/integrations/constants/permissions.d.ts +22 -0
  72. package/dist/integrations/constants/permissions.d.ts.map +1 -0
  73. package/dist/integrations/constants/permissions.js +20 -0
  74. package/dist/integrations/constants/permissions.js.map +1 -0
  75. package/dist/integrations/events/integrations-events.d.ts +36 -0
  76. package/dist/integrations/events/integrations-events.d.ts.map +1 -0
  77. package/dist/integrations/events/useIntegrationsEventBus.d.ts +11 -0
  78. package/dist/integrations/events/useIntegrationsEventBus.d.ts.map +1 -0
  79. package/dist/integrations/events/useIntegrationsEventBus.js +23 -0
  80. package/dist/integrations/events/useIntegrationsEventBus.js.map +1 -0
  81. package/dist/integrations/hooks/useConnections.d.ts +84 -0
  82. package/dist/integrations/hooks/useConnections.d.ts.map +1 -0
  83. package/dist/integrations/hooks/useConnections.js +162 -0
  84. package/dist/integrations/hooks/useConnections.js.map +1 -0
  85. package/dist/integrations/hooks/useCredentialVaults.d.ts +15 -0
  86. package/dist/integrations/hooks/useCredentialVaults.d.ts.map +1 -0
  87. package/dist/integrations/hooks/useCredentialVaults.js +77 -0
  88. package/dist/integrations/hooks/useCredentialVaults.js.map +1 -0
  89. package/dist/integrations/hooks/useLogs.d.ts +27 -0
  90. package/dist/integrations/hooks/useLogs.d.ts.map +1 -0
  91. package/dist/integrations/hooks/useLogs.js +32 -0
  92. package/dist/integrations/hooks/useLogs.js.map +1 -0
  93. package/dist/integrations/hooks/useProviders.d.ts +97 -0
  94. package/dist/integrations/hooks/useProviders.d.ts.map +1 -0
  95. package/dist/integrations/hooks/useProviders.js +102 -0
  96. package/dist/integrations/hooks/useProviders.js.map +1 -0
  97. package/dist/integrations/index.d.ts +33 -0
  98. package/dist/integrations/index.d.ts.map +1 -0
  99. package/dist/integrations/index.js +6 -0
  100. package/dist/integrations/pages/AddConnectionWizard.d.ts +14 -0
  101. package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -0
  102. package/dist/integrations/pages/AddConnectionWizard.js +635 -0
  103. package/dist/integrations/pages/AddConnectionWizard.js.map +1 -0
  104. package/dist/integrations/pages/ConnectionDetail.d.ts +5 -0
  105. package/dist/integrations/pages/ConnectionDetail.d.ts.map +1 -0
  106. package/dist/integrations/pages/ConnectionDetail.js +469 -0
  107. package/dist/integrations/pages/ConnectionDetail.js.map +1 -0
  108. package/dist/integrations/pages/ConnectionLogs.d.ts +5 -0
  109. package/dist/integrations/pages/ConnectionLogs.d.ts.map +1 -0
  110. package/dist/integrations/pages/ConnectionLogs.js +394 -0
  111. package/dist/integrations/pages/ConnectionLogs.js.map +1 -0
  112. package/dist/integrations/pages/ConnectionsList.d.ts +5 -0
  113. package/dist/integrations/pages/ConnectionsList.d.ts.map +1 -0
  114. package/dist/integrations/pages/ConnectionsList.js +258 -0
  115. package/dist/integrations/pages/ConnectionsList.js.map +1 -0
  116. package/dist/integrations/pages/IntegrationsAdminLandingPage.d.ts +11 -0
  117. package/dist/integrations/pages/IntegrationsAdminLandingPage.d.ts.map +1 -0
  118. package/dist/integrations/pages/IntegrationsLandingPage.d.ts +9 -0
  119. package/dist/integrations/pages/IntegrationsLandingPage.d.ts.map +1 -0
  120. package/dist/integrations/pages/IntegrationsOverview.d.ts +5 -0
  121. package/dist/integrations/pages/IntegrationsOverview.d.ts.map +1 -0
  122. package/dist/integrations/pages/IntegrationsOverview.js +432 -0
  123. package/dist/integrations/pages/IntegrationsOverview.js.map +1 -0
  124. package/dist/integrations/pages/IntegrationsSettings.d.ts +5 -0
  125. package/dist/integrations/pages/IntegrationsSettings.d.ts.map +1 -0
  126. package/dist/integrations/pages/IntegrationsSettings.js +222 -0
  127. package/dist/integrations/pages/IntegrationsSettings.js.map +1 -0
  128. package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts +11 -0
  129. package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts.map +1 -0
  130. package/dist/integrations/pages/IntegrationsUserLandingPage.js +56 -0
  131. package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -0
  132. package/dist/integrations/pages/ProviderCatalog.d.ts +9 -0
  133. package/dist/integrations/pages/ProviderCatalog.d.ts.map +1 -0
  134. package/dist/integrations/pages/ProviderCatalog.js +337 -0
  135. package/dist/integrations/pages/ProviderCatalog.js.map +1 -0
  136. package/dist/integrations/pages/ProviderDetail.d.ts +5 -0
  137. package/dist/integrations/pages/ProviderDetail.d.ts.map +1 -0
  138. package/dist/integrations/pages/ProviderDetail.js +386 -0
  139. package/dist/integrations/pages/ProviderDetail.js.map +1 -0
  140. package/dist/integrations/pages/ProviderEditorPage.d.ts +2 -0
  141. package/dist/integrations/pages/ProviderEditorPage.d.ts.map +1 -0
  142. package/dist/integrations/pages/ProviderEditorPage.js +412 -0
  143. package/dist/integrations/pages/ProviderEditorPage.js.map +1 -0
  144. package/dist/integrations/providers/IntegrationsProvider.d.ts +13 -0
  145. package/dist/integrations/providers/IntegrationsProvider.d.ts.map +1 -0
  146. package/dist/integrations/providers/IntegrationsProvider.js +121 -0
  147. package/dist/integrations/providers/IntegrationsProvider.js.map +1 -0
  148. package/dist/integrations/store/integrationsStore.d.ts +21 -0
  149. package/dist/integrations/store/integrationsStore.d.ts.map +1 -0
  150. package/dist/integrations/store/integrationsStore.js +43 -0
  151. package/dist/integrations/store/integrationsStore.js.map +1 -0
  152. package/dist/integrations/types/index.d.ts +217 -0
  153. package/dist/integrations/types/index.d.ts.map +1 -0
  154. package/dist/integrations/utils/appearance.d.ts +14 -0
  155. package/dist/integrations/utils/appearance.d.ts.map +1 -0
  156. package/dist/integrations/utils/appearance.js +64 -0
  157. package/dist/integrations/utils/appearance.js.map +1 -0
  158. package/dist/integrations/utils/cn.d.ts +8 -0
  159. package/dist/integrations/utils/cn.d.ts.map +1 -0
  160. package/dist/integrations/utils/cn.js +10 -0
  161. package/dist/integrations/utils/cn.js.map +1 -0
  162. package/dist/integrations/utils/constants.d.ts +194 -0
  163. package/dist/integrations/utils/constants.d.ts.map +1 -0
  164. package/dist/integrations/utils/constants.js +200 -0
  165. package/dist/integrations/utils/constants.js.map +1 -0
  166. package/dist/integrations/utils/i18n.d.ts +6 -0
  167. package/dist/integrations/utils/i18n.d.ts.map +1 -0
  168. package/dist/integrations/utils/integrationsHelpers.d.ts +39 -0
  169. package/dist/integrations/utils/integrationsHelpers.d.ts.map +1 -0
  170. package/dist/integrations/utils/integrationsHelpers.js +82 -0
  171. package/dist/integrations/utils/integrationsHelpers.js.map +1 -0
  172. package/dist/integrations/utils/mappers.d.ts +15 -0
  173. package/dist/integrations/utils/mappers.d.ts.map +1 -0
  174. package/dist/integrations/utils/mappers.js +151 -0
  175. package/dist/integrations/utils/mappers.js.map +1 -0
  176. package/dist/integrations/utils/navigation.d.ts +18 -0
  177. package/dist/integrations/utils/navigation.d.ts.map +1 -0
  178. package/dist/integrations/utils/navigation.js +13 -0
  179. package/dist/integrations/utils/navigation.js.map +1 -0
  180. package/dist/integrations/utils/oauthPopup.d.ts +16 -0
  181. package/dist/integrations/utils/oauthPopup.d.ts.map +1 -0
  182. package/dist/integrations/utils/oauthPopup.js +62 -0
  183. package/dist/integrations/utils/oauthPopup.js.map +1 -0
  184. package/dist/integrations/utils/paths.d.ts +5 -0
  185. package/dist/integrations/utils/paths.d.ts.map +1 -0
  186. package/dist/integrations/utils/paths.js +6 -0
  187. package/dist/integrations/utils/paths.js.map +1 -0
  188. package/dist/node_modules/@iconify/react/dist/iconify.js +1005 -0
  189. package/dist/node_modules/@iconify/react/dist/iconify.js.map +1 -0
  190. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  191. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  192. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  193. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  194. package/dist/utils/nativeBridge.d.ts +3 -0
  195. package/dist/utils/nativeBridge.d.ts.map +1 -0
  196. package/dist/utils/nativeBridge.js +2 -0
  197. package/package.json +107 -0
@@ -0,0 +1,161 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { ProviderIcon as t } from "./ProviderIcon.js";
3
+ import { Link2 as n, Plug as r } from "lucide-react";
4
+ import { useI18n as i } from "@burdenoff/fe-libs/shared/providers/shell";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/integrations/components/ProviderCard.tsx
7
+ var s = ({ provider: s, displayMode: c = "grid", onConnect: l, onClick: u }) => {
8
+ let { t: d } = i(), f = (e, t, n) => {
9
+ let r = d(e, n);
10
+ return r === e ? n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)).replace(`{${t}}`, String(n)), t) : t : r;
11
+ }, p = (e) => {
12
+ e.stopPropagation(), l?.(s);
13
+ }, m = (e) => {
14
+ switch (e) {
15
+ case "available": return f("integrations.providerCard.pluginStatus.available", "Available");
16
+ case "installed": return f("integrations.providerCard.pluginStatus.installed", "Installed");
17
+ case "update_available": return f("integrations.providerCard.pluginStatus.updateAvailable", "Update");
18
+ case "deprecated": return f("integrations.providerCard.pluginStatus.deprecated", "Deprecated");
19
+ default: return e;
20
+ }
21
+ }, h = (e) => {
22
+ switch (e) {
23
+ case "communication": return f("integrations.providerCard.category.communication", "Communication");
24
+ case "project_management": return f("integrations.providerCard.category.projectManagement", "Project Management");
25
+ case "cloud_storage": return f("integrations.providerCard.category.cloudStorage", "Cloud Storage");
26
+ case "productivity": return f("integrations.providerCard.category.productivity", "Productivity");
27
+ case "crm": return f("integrations.providerCard.category.crm", "CRM");
28
+ case "analytics": return f("integrations.providerCard.category.analytics", "Analytics");
29
+ case "developer_tools": return f("integrations.providerCard.category.developerTools", "Developer Tools");
30
+ case "marketing": return f("integrations.providerCard.category.marketing", "Marketing");
31
+ case "finance": return f("integrations.providerCard.category.finance", "Finance");
32
+ case "hr": return f("integrations.providerCard.category.hr", "Human Resources");
33
+ case "support": return f("integrations.providerCard.category.support", "Support");
34
+ case "social": return f("integrations.providerCard.category.social", "Social");
35
+ case "ai": return f("integrations.providerCard.category.ai", "AI & ML");
36
+ case "email": return f("integrations.providerCard.category.email", "Email");
37
+ case "calendar": return f("integrations.providerCard.category.calendar", "Calendar");
38
+ case "other": return f("integrations.providerCard.category.other", "Other");
39
+ default: return e;
40
+ }
41
+ }, g = (e) => {
42
+ switch (e) {
43
+ case "oauth2": return f("integrations.providerCard.authType.oauth2", "OAuth 2.0");
44
+ case "api_key": return f("integrations.providerCard.authType.apiKey", "API Key");
45
+ case "basic_auth": return f("integrations.providerCard.authType.basicAuth", "Basic Auth");
46
+ case "bearer_token": return f("integrations.providerCard.authType.bearerToken", "Bearer Token");
47
+ default: return e;
48
+ }
49
+ }, _ = s.pluginStatus === "installed" ? "text-status-success-text bg-status-success-bg-subtle border-border-default" : s.pluginStatus === "update_available" ? "text-status-warning-text bg-status-warning-bg-subtle border-border-default" : s.pluginStatus === "deprecated" ? "text-status-error-text bg-status-error-bg-subtle border-border-default" : "text-text-secondary bg-bg-sunken border-border-subtle";
50
+ return c === "list" ? /* @__PURE__ */ o("div", {
51
+ className: e("group flex items-center gap-4 p-4 rounded-xl border border-border/50", "bg-card hover:bg-accent/30 hover:border-primary/30 hover:shadow-md", "cursor-pointer transition-all duration-200", "animate-in fade-in-0 slide-in-from-bottom-1"),
52
+ onClick: () => u?.(s),
53
+ role: "button",
54
+ tabIndex: 0,
55
+ onKeyDown: (e) => {
56
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u?.(s));
57
+ },
58
+ children: [
59
+ /* @__PURE__ */ a(t, {
60
+ provider: s,
61
+ size: 40
62
+ }),
63
+ /* @__PURE__ */ o("div", {
64
+ className: "flex-1 min-w-0",
65
+ children: [/* @__PURE__ */ o("div", {
66
+ className: "flex items-center gap-2",
67
+ children: [/* @__PURE__ */ a("h3", {
68
+ className: "font-semibold text-foreground truncate",
69
+ children: s.name
70
+ }), /* @__PURE__ */ a("span", {
71
+ className: e("text-xs px-2 py-0.5 rounded-full border", _),
72
+ children: m(s.pluginStatus)
73
+ })]
74
+ }), /* @__PURE__ */ a("p", {
75
+ className: "text-sm text-muted-foreground truncate mt-0.5",
76
+ children: s.description
77
+ })]
78
+ }),
79
+ /* @__PURE__ */ o("div", {
80
+ className: "flex items-center gap-3 flex-shrink-0",
81
+ children: [
82
+ /* @__PURE__ */ a("span", {
83
+ className: "text-xs text-muted-foreground",
84
+ children: h(s.category)
85
+ }),
86
+ /* @__PURE__ */ a("span", {
87
+ className: "text-xs text-muted-foreground",
88
+ children: g(s.authType)
89
+ }),
90
+ /* @__PURE__ */ o("span", {
91
+ className: "inline-flex items-center gap-1 text-xs text-muted-foreground",
92
+ children: [/* @__PURE__ */ a(n, { size: 12 }), s.connectionCount]
93
+ }),
94
+ l && s.pluginStatus === "installed" && s.isEnabled && /* @__PURE__ */ a("button", {
95
+ onClick: p,
96
+ className: "px-3 py-1.5 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
97
+ children: f("integrations.providerCard.actions.connect", "Connect")
98
+ })
99
+ ]
100
+ })
101
+ ]
102
+ }) : /* @__PURE__ */ o("div", {
103
+ className: e("group relative flex flex-col p-5 rounded-xl border border-border/50", "bg-card hover:bg-accent/30 hover:border-primary/30 hover:shadow-lg", "cursor-pointer transition-all duration-200", "animate-in fade-in-0 slide-in-from-bottom-2"),
104
+ onClick: () => u?.(s),
105
+ role: "button",
106
+ tabIndex: 0,
107
+ onKeyDown: (e) => {
108
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u?.(s));
109
+ },
110
+ children: [
111
+ /* @__PURE__ */ o("div", {
112
+ className: "flex items-start justify-between mb-3",
113
+ children: [/* @__PURE__ */ a(t, {
114
+ provider: s,
115
+ size: 48
116
+ }), /* @__PURE__ */ a("span", {
117
+ className: e("text-xs px-2 py-0.5 rounded-full border", _),
118
+ children: m(s.pluginStatus)
119
+ })]
120
+ }),
121
+ /* @__PURE__ */ a("h3", {
122
+ className: "font-semibold text-foreground mb-1 truncate",
123
+ children: s.name
124
+ }),
125
+ /* @__PURE__ */ a("p", {
126
+ className: "text-sm text-muted-foreground line-clamp-2 mb-3 flex-1",
127
+ children: s.description
128
+ }),
129
+ /* @__PURE__ */ o("div", {
130
+ className: "flex items-center gap-2 flex-wrap mb-3",
131
+ children: [/* @__PURE__ */ a("span", {
132
+ className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground",
133
+ children: h(s.category)
134
+ }), /* @__PURE__ */ a("span", {
135
+ className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground",
136
+ children: g(s.authType)
137
+ })]
138
+ }),
139
+ /* @__PURE__ */ o("div", {
140
+ className: "flex items-center justify-between mt-auto pt-3 border-t border-border/50",
141
+ children: [/* @__PURE__ */ o("span", {
142
+ className: "inline-flex items-center gap-1.5 text-sm text-muted-foreground",
143
+ children: [
144
+ /* @__PURE__ */ a(r, { size: 14 }),
145
+ s.connectionCount,
146
+ " ",
147
+ s.connectionCount === 1 ? f("integrations.providerCard.connectionCount.single", "connection") : f("integrations.providerCard.connectionCount.multiple", "connections")
148
+ ]
149
+ }), l && s.pluginStatus === "installed" && s.isEnabled && /* @__PURE__ */ a("button", {
150
+ onClick: p,
151
+ className: "px-3 py-1.5 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
152
+ children: f("integrations.providerCard.actions.connect", "Connect")
153
+ })]
154
+ })
155
+ ]
156
+ });
157
+ };
158
+ //#endregion
159
+ export { s as ProviderCard };
160
+
161
+ //# sourceMappingURL=ProviderCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderCard.js","names":[],"sources":["../../../src/integrations/components/ProviderCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Plug, Link2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { IntegrationProvider } from '../types';\nimport { ProviderIcon } from './ProviderIcon';\n\ninterface ProviderCardProps {\n provider: IntegrationProvider;\n displayMode?: 'grid' | 'list';\n onConnect?: (provider: IntegrationProvider) => void;\n onClick?: (provider: IntegrationProvider) => void;\n}\n\n/**\n * Card component showing provider info (icon, name, category, auth type, connection count).\n * Has a \"Connect\" button.\n */\nexport const ProviderCard: FC<ProviderCardProps> = ({\n provider,\n displayMode = 'grid',\n onConnect,\n onClick,\n}) => {\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n\n const handleConnect = (e: React.MouseEvent) => {\n e.stopPropagation();\n onConnect?.(provider);\n };\n\n const getPluginStatusLabel = (status: IntegrationProvider['pluginStatus']) => {\n switch (status) {\n case 'available':\n return tx('integrations.providerCard.pluginStatus.available', 'Available');\n case 'installed':\n return tx('integrations.providerCard.pluginStatus.installed', 'Installed');\n case 'update_available':\n return tx('integrations.providerCard.pluginStatus.updateAvailable', 'Update');\n case 'deprecated':\n return tx('integrations.providerCard.pluginStatus.deprecated', 'Deprecated');\n default:\n return status;\n }\n };\n\n const getCategoryLabel = (category: IntegrationProvider['category']) => {\n switch (category) {\n case 'communication':\n return tx('integrations.providerCard.category.communication', 'Communication');\n case 'project_management':\n return tx('integrations.providerCard.category.projectManagement', 'Project Management');\n case 'cloud_storage':\n return tx('integrations.providerCard.category.cloudStorage', 'Cloud Storage');\n case 'productivity':\n return tx('integrations.providerCard.category.productivity', 'Productivity');\n case 'crm':\n return tx('integrations.providerCard.category.crm', 'CRM');\n case 'analytics':\n return tx('integrations.providerCard.category.analytics', 'Analytics');\n case 'developer_tools':\n return tx('integrations.providerCard.category.developerTools', 'Developer Tools');\n case 'marketing':\n return tx('integrations.providerCard.category.marketing', 'Marketing');\n case 'finance':\n return tx('integrations.providerCard.category.finance', 'Finance');\n case 'hr':\n return tx('integrations.providerCard.category.hr', 'Human Resources');\n case 'support':\n return tx('integrations.providerCard.category.support', 'Support');\n case 'social':\n return tx('integrations.providerCard.category.social', 'Social');\n case 'ai':\n return tx('integrations.providerCard.category.ai', 'AI & ML');\n case 'email':\n return tx('integrations.providerCard.category.email', 'Email');\n case 'calendar':\n return tx('integrations.providerCard.category.calendar', 'Calendar');\n case 'other':\n return tx('integrations.providerCard.category.other', 'Other');\n default:\n return category;\n }\n };\n\n const getAuthTypeLabel = (authType: IntegrationProvider['authType']) => {\n switch (authType) {\n case 'oauth2':\n return tx('integrations.providerCard.authType.oauth2', 'OAuth 2.0');\n case 'api_key':\n return tx('integrations.providerCard.authType.apiKey', 'API Key');\n case 'basic_auth':\n return tx('integrations.providerCard.authType.basicAuth', 'Basic Auth');\n case 'bearer_token':\n return tx('integrations.providerCard.authType.bearerToken', 'Bearer Token');\n default:\n return authType;\n }\n };\n\n const pluginBadgeClass =\n provider.pluginStatus === 'installed'\n ? 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n : provider.pluginStatus === 'update_available'\n ? 'text-status-warning-text bg-status-warning-bg-subtle border-border-default'\n : provider.pluginStatus === 'deprecated'\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-text-secondary bg-bg-sunken border-border-subtle';\n\n if (displayMode === 'list') {\n return (\n <div\n className={cn(\n 'group flex items-center gap-4 p-4 rounded-xl border border-border/50',\n 'bg-card hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'cursor-pointer transition-all duration-200',\n 'animate-in fade-in-0 slide-in-from-bottom-1'\n )}\n onClick={() => onClick?.(provider)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(provider);\n }\n }}\n >\n <ProviderIcon provider={provider} size={40} />\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-foreground truncate\">{provider.name}</h3>\n <span className={cn('text-xs px-2 py-0.5 rounded-full border', pluginBadgeClass)}>\n {getPluginStatusLabel(provider.pluginStatus)}\n </span>\n </div>\n <p className=\"text-sm text-muted-foreground truncate mt-0.5\">{provider.description}</p>\n </div>\n\n <div className=\"flex items-center gap-3 flex-shrink-0\">\n <span className=\"text-xs text-muted-foreground\">\n {getCategoryLabel(provider.category)}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {getAuthTypeLabel(provider.authType)}\n </span>\n <span className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\">\n <Link2 size={12} />\n {provider.connectionCount}\n </span>\n {onConnect && provider.pluginStatus === 'installed' && provider.isEnabled && (\n <button\n onClick={handleConnect}\n className=\"px-3 py-1.5 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n {tx('integrations.providerCard.actions.connect', 'Connect')}\n </button>\n )}\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={cn(\n 'group relative flex flex-col p-5 rounded-xl border border-border/50',\n 'bg-card hover:bg-accent/30 hover:border-primary/30 hover:shadow-lg',\n 'cursor-pointer transition-all duration-200',\n 'animate-in fade-in-0 slide-in-from-bottom-2'\n )}\n onClick={() => onClick?.(provider)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(provider);\n }\n }}\n >\n <div className=\"flex items-start justify-between mb-3\">\n <ProviderIcon provider={provider} size={48} />\n <span className={cn('text-xs px-2 py-0.5 rounded-full border', pluginBadgeClass)}>\n {getPluginStatusLabel(provider.pluginStatus)}\n </span>\n </div>\n\n <h3 className=\"font-semibold text-foreground mb-1 truncate\">{provider.name}</h3>\n <p className=\"text-sm text-muted-foreground line-clamp-2 mb-3 flex-1\">\n {provider.description}\n </p>\n\n <div className=\"flex items-center gap-2 flex-wrap mb-3\">\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground\">\n {getCategoryLabel(provider.category)}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground\">\n {getAuthTypeLabel(provider.authType)}\n </span>\n </div>\n\n <div className=\"flex items-center justify-between mt-auto pt-3 border-t border-border/50\">\n <span className=\"inline-flex items-center gap-1.5 text-sm text-muted-foreground\">\n <Plug size={14} />\n {provider.connectionCount}{' '}\n {provider.connectionCount === 1\n ? tx('integrations.providerCard.connectionCount.single', 'connection')\n : tx('integrations.providerCard.connectionCount.multiple', 'connections')}\n </span>\n {onConnect && provider.pluginStatus === 'installed' && provider.isEnabled && (\n <button\n onClick={handleConnect}\n className=\"px-3 py-1.5 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n {tx('integrations.providerCard.actions.connect', 'Connect')}\n </button>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":"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"}
@@ -0,0 +1,19 @@
1
+ import { FC } from 'react';
2
+ import { IntegrationProvider } from '../types';
3
+
4
+ interface ProviderIconProps {
5
+ provider: IntegrationProvider;
6
+ size?: number;
7
+ className?: string;
8
+ }
9
+ /**
10
+ * Renders provider icon using @iconify/react — same icons as fluidgrids-fe-sdk.
11
+ *
12
+ * Priority:
13
+ * 1. If icon looks like a URL → render <img>
14
+ * 2. Match icon/key against PROVIDER_ICONS → render Iconify brand icon
15
+ * 3. Fallback → category-based Iconify icon
16
+ */
17
+ export declare const ProviderIcon: FC<ProviderIconProps>;
18
+ export {};
19
+ //# sourceMappingURL=ProviderIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderIcon.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/ProviderIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,mBAAmB,EAAoB,MAAM,UAAU,CAAC;AAGtE,UAAU,iBAAiB;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAiD9C,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { Icon as t } from "../../node_modules/@iconify/react/dist/iconify.js";
3
+ import { getAccentClasses as n, getProviderAccent as r } from "../utils/appearance.js";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ //#region src/integrations/components/ProviderIcon.tsx
6
+ var a = {
7
+ "google-gmail": "logos:google-gmail",
8
+ "google-drive": "logos:google-drive",
9
+ "google-calendar": "logos:google-calendar",
10
+ "google-sheets": "simple-icons:googlesheets",
11
+ "google-docs": "simple-icons:googledocs",
12
+ "microsoft-outlook": "vscode-icons:file-type-outlook",
13
+ "microsoft-onedrive": "simple-icons:onedrive",
14
+ "microsoft-teams": "logos:microsoft-teams",
15
+ "microsoft-excel": "vscode-icons:file-type-excel",
16
+ github: "mdi:github",
17
+ slack: "logos:slack-icon",
18
+ salesforce: "logos:salesforce",
19
+ hubspot: "simple-icons:hubspot",
20
+ notion: "simple-icons:notion",
21
+ airtable: "simple-icons:airtable",
22
+ openai: "simple-icons:openai",
23
+ anthropic: "simple-icons:anthropic",
24
+ sendgrid: "simple-icons:sendgrid",
25
+ twilio: "logos:twilio-icon",
26
+ "generic-oauth2": "mdi:key-chain",
27
+ "generic-api-key": "mdi:key-variant",
28
+ "generic-basic-auth": "mdi:lock-outline"
29
+ }, o = {
30
+ communication: "mdi:message-text-outline",
31
+ project_management: "mdi:view-dashboard-outline",
32
+ cloud_storage: "mdi:cloud-outline",
33
+ crm: "mdi:account-group-outline",
34
+ analytics: "mdi:chart-bar",
35
+ developer_tools: "mdi:code-braces",
36
+ finance: "mdi:currency-usd",
37
+ support: "mdi:headset",
38
+ social: "mdi:share-variant-outline",
39
+ ai: "mdi:brain",
40
+ email: "mdi:email-outline",
41
+ calendar: "mdi:calendar-outline",
42
+ productivity: "mdi:file-document-outline",
43
+ marketing: "mdi:bullhorn-outline",
44
+ hr: "mdi:account-tie-outline",
45
+ other: "mdi:puzzle-outline"
46
+ };
47
+ function s(e) {
48
+ return o[e] ?? o.other;
49
+ }
50
+ function c(e) {
51
+ return a[e.icon ?? e.key] ?? a[e.key] ?? s(e.category);
52
+ }
53
+ var l = ({ provider: a, size: o = 40, className: s }) => {
54
+ let l = Math.round(o * .55), u = n(r(a));
55
+ if (a.icon && (a.icon.startsWith("http") || a.icon.startsWith("/"))) return /* @__PURE__ */ i("div", {
56
+ className: e("flex items-center justify-center rounded-xl flex-shrink-0 overflow-hidden", u.surface, s),
57
+ style: {
58
+ width: o,
59
+ height: o
60
+ },
61
+ children: /* @__PURE__ */ i("img", {
62
+ src: a.icon,
63
+ alt: a.name,
64
+ className: "object-contain",
65
+ style: {
66
+ width: l,
67
+ height: l
68
+ },
69
+ onError: (e) => {
70
+ e.target.style.display = "none";
71
+ }
72
+ })
73
+ });
74
+ let d = c(a);
75
+ return /* @__PURE__ */ i("div", {
76
+ className: e("flex items-center justify-center rounded-xl flex-shrink-0", u.surface, s),
77
+ style: {
78
+ width: o,
79
+ height: o
80
+ },
81
+ children: /* @__PURE__ */ i(t, {
82
+ icon: d,
83
+ width: l,
84
+ height: l,
85
+ className: u.icon
86
+ })
87
+ });
88
+ };
89
+ //#endregion
90
+ export { l as ProviderIcon };
91
+
92
+ //# sourceMappingURL=ProviderIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderIcon.js","names":[],"sources":["../../../src/integrations/components/ProviderIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Icon } from '@iconify/react';\nimport { cn } from '../utils/cn';\nimport type { IntegrationProvider, ProviderCategory } from '../types';\nimport { getAccentClasses, getProviderAccent } from '../utils/appearance';\n\ninterface ProviderIconProps {\n provider: IntegrationProvider;\n size?: number;\n className?: string;\n}\n\n// ============================================================================\n// Provider icon mapping — same Iconify icon names as fluidgrids-fe-sdk\n// ============================================================================\n\nconst PROVIDER_ICONS: Record<string, string> = {\n // Google services\n 'google-gmail': 'logos:google-gmail',\n 'google-drive': 'logos:google-drive',\n 'google-calendar': 'logos:google-calendar',\n 'google-sheets': 'simple-icons:googlesheets',\n 'google-docs': 'simple-icons:googledocs',\n // Microsoft services\n 'microsoft-outlook': 'vscode-icons:file-type-outlook',\n 'microsoft-onedrive': 'simple-icons:onedrive',\n 'microsoft-teams': 'logos:microsoft-teams',\n 'microsoft-excel': 'vscode-icons:file-type-excel',\n // Other OAuth2\n github: 'mdi:github',\n slack: 'logos:slack-icon',\n salesforce: 'logos:salesforce',\n hubspot: 'simple-icons:hubspot',\n notion: 'simple-icons:notion',\n airtable: 'simple-icons:airtable',\n // API Key\n openai: 'simple-icons:openai',\n anthropic: 'simple-icons:anthropic',\n sendgrid: 'simple-icons:sendgrid',\n twilio: 'logos:twilio-icon',\n // Generic\n 'generic-oauth2': 'mdi:key-chain',\n 'generic-api-key': 'mdi:key-variant',\n 'generic-basic-auth': 'mdi:lock-outline',\n};\n\n/**\n * Fallback Iconify icons per category\n */\nconst CATEGORY_ICONS: Record<string, string> = {\n communication: 'mdi:message-text-outline',\n project_management: 'mdi:view-dashboard-outline',\n cloud_storage: 'mdi:cloud-outline',\n crm: 'mdi:account-group-outline',\n analytics: 'mdi:chart-bar',\n developer_tools: 'mdi:code-braces',\n finance: 'mdi:currency-usd',\n support: 'mdi:headset',\n social: 'mdi:share-variant-outline',\n ai: 'mdi:brain',\n email: 'mdi:email-outline',\n calendar: 'mdi:calendar-outline',\n productivity: 'mdi:file-document-outline',\n marketing: 'mdi:bullhorn-outline',\n hr: 'mdi:account-tie-outline',\n other: 'mdi:puzzle-outline',\n};\n\nfunction getCategoryIcon(category: ProviderCategory): string {\n return CATEGORY_ICONS[category] ?? CATEGORY_ICONS.other;\n}\n\nfunction getProviderIconName(provider: IntegrationProvider): string {\n const iconKey = provider.icon ?? provider.key;\n return (\n PROVIDER_ICONS[iconKey] ?? PROVIDER_ICONS[provider.key] ?? getCategoryIcon(provider.category)\n );\n}\n\n/**\n * Renders provider icon using @iconify/react — same icons as fluidgrids-fe-sdk.\n *\n * Priority:\n * 1. If icon looks like a URL → render <img>\n * 2. Match icon/key against PROVIDER_ICONS → render Iconify brand icon\n * 3. Fallback → category-based Iconify icon\n */\nexport const ProviderIcon: FC<ProviderIconProps> = ({ provider, size = 40, className }) => {\n const iconSize = Math.round(size * 0.55);\n const accent = getAccentClasses(getProviderAccent(provider));\n\n // 1. URL-based icon\n if (provider.icon && (provider.icon.startsWith('http') || provider.icon.startsWith('/'))) {\n return (\n <div\n className={cn(\n 'flex items-center justify-center rounded-xl flex-shrink-0 overflow-hidden',\n accent.surface,\n className\n )}\n style={{\n width: size,\n height: size,\n }}\n >\n <img\n src={provider.icon}\n alt={provider.name}\n className=\"object-contain\"\n style={{ width: iconSize, height: iconSize }}\n onError={(e) => {\n (e.target as HTMLImageElement).style.display = 'none';\n }}\n />\n </div>\n );\n }\n\n // 2 & 3. Iconify icon (provider-specific or category fallback)\n const iconName = getProviderIconName(provider);\n\n return (\n <div\n className={cn(\n 'flex items-center justify-center rounded-xl flex-shrink-0',\n accent.surface,\n className\n )}\n style={{\n width: size,\n height: size,\n }}\n >\n <Icon icon={iconName} width={iconSize} height={iconSize} className={accent.icon} />\n </div>\n );\n};\n"],"mappings":";;;;;AAgBA,IAAM,IAAyC;CAE7C,gBAAgB;CAChB,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CACjB,eAAe;CAEf,qBAAqB;CACrB,sBAAsB;CACtB,mBAAmB;CACnB,mBAAmB;CAEnB,QAAQ;CACR,OAAO;CACP,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CAEV,QAAQ;CACR,WAAW;CACX,UAAU;CACV,QAAQ;CAER,kBAAkB;CAClB,mBAAmB;CACnB,sBAAsB;CACvB,EAKK,IAAyC;CAC7C,eAAe;CACf,oBAAoB;CACpB,eAAe;CACf,KAAK;CACL,WAAW;CACX,iBAAiB;CACjB,SAAS;CACT,SAAS;CACT,QAAQ;CACR,IAAI;CACJ,OAAO;CACP,UAAU;CACV,cAAc;CACd,WAAW;CACX,IAAI;CACJ,OAAO;CACR;AAED,SAAS,EAAgB,GAAoC;AAC3D,QAAO,EAAe,MAAa,EAAe;;AAGpD,SAAS,EAAoB,GAAuC;AAElE,QACE,EAFc,EAAS,QAAQ,EAAS,QAEb,EAAe,EAAS,QAAQ,EAAgB,EAAS,SAAS;;AAYjG,IAAa,KAAuC,EAAE,aAAU,UAAO,IAAI,mBAAgB;CACzF,IAAM,IAAW,KAAK,MAAM,IAAO,IAAK,EAClC,IAAS,EAAiB,EAAkB,EAAS,CAAC;AAG5D,KAAI,EAAS,SAAS,EAAS,KAAK,WAAW,OAAO,IAAI,EAAS,KAAK,WAAW,IAAI,EACrF,QACE,kBAAC,OAAD;EACE,WAAW,EACT,6EACA,EAAO,SACP,EACD;EACD,OAAO;GACL,OAAO;GACP,QAAQ;GACT;YAED,kBAAC,OAAD;GACE,KAAK,EAAS;GACd,KAAK,EAAS;GACd,WAAU;GACV,OAAO;IAAE,OAAO;IAAU,QAAQ;IAAU;GAC5C,UAAU,MAAM;AACb,MAAE,OAA4B,MAAM,UAAU;;GAEjD,CAAA;EACE,CAAA;CAKV,IAAM,IAAW,EAAoB,EAAS;AAE9C,QACE,kBAAC,OAAD;EACE,WAAW,EACT,6DACA,EAAO,SACP,EACD;EACD,OAAO;GACL,OAAO;GACP,QAAQ;GACT;YAED,kBAAC,GAAD;GAAM,MAAM;GAAU,OAAO;GAAU,QAAQ;GAAU,WAAW,EAAO;GAAQ,CAAA;EAC/E,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * UI Component re-exports from @burdenoff/fe-libs
3
+ * All styled components are imported from the shared fe-libs package
4
+ */
5
+ export { Button, Badge, Card, CardContent, Input, Skeleton, Separator, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Tabs, TabsList, TabsTrigger, TabsContent, } from '@burdenoff/fe-libs/ui';
6
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/ui.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,WAAW,GACZ,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Mirror of GraphQL enums as JavaScript const objects with type exports.
3
+ * These match the server-side enum definitions in wspace-integrations-svc.
4
+ */
5
+ export declare const ProviderCategory: {
6
+ readonly COMMUNICATION: "communication";
7
+ readonly PROJECT_MANAGEMENT: "project_management";
8
+ readonly CLOUD_STORAGE: "cloud_storage";
9
+ readonly CRM: "crm";
10
+ readonly ANALYTICS: "analytics";
11
+ readonly DEVELOPER_TOOLS: "developer_tools";
12
+ readonly MARKETING: "marketing";
13
+ readonly FINANCE: "finance";
14
+ readonly HR: "hr";
15
+ readonly SUPPORT: "support";
16
+ readonly SOCIAL: "social";
17
+ readonly AI: "ai";
18
+ readonly OTHER: "other";
19
+ };
20
+ export type ProviderCategoryValue = (typeof ProviderCategory)[keyof typeof ProviderCategory];
21
+ export declare const AuthType: {
22
+ readonly OAUTH2: "oauth2";
23
+ readonly API_KEY: "api_key";
24
+ readonly BASIC_AUTH: "basic_auth";
25
+ readonly BEARER_TOKEN: "bearer_token";
26
+ };
27
+ export type AuthTypeValue = (typeof AuthType)[keyof typeof AuthType];
28
+ export declare const ConnectionStatus: {
29
+ readonly ACTIVE: "active";
30
+ readonly INACTIVE: "inactive";
31
+ readonly ERROR: "error";
32
+ readonly EXPIRED: "expired";
33
+ readonly PENDING_AUTH: "pending_auth";
34
+ readonly REVOKED: "revoked";
35
+ };
36
+ export type ConnectionStatusValue = (typeof ConnectionStatus)[keyof typeof ConnectionStatus];
37
+ export declare const PluginStatus: {
38
+ readonly AVAILABLE: "available";
39
+ readonly INSTALLED: "installed";
40
+ readonly UPDATE_AVAILABLE: "update_available";
41
+ readonly DEPRECATED: "deprecated";
42
+ };
43
+ export type PluginStatusValue = (typeof PluginStatus)[keyof typeof PluginStatus];
44
+ export declare const LogLevel: {
45
+ readonly DEBUG: "debug";
46
+ readonly INFO: "info";
47
+ readonly WARN: "warn";
48
+ readonly ERROR: "error";
49
+ };
50
+ export type LogLevelValue = (typeof LogLevel)[keyof typeof LogLevel];
51
+ export declare const LogAction: {
52
+ readonly CONNECTION_CREATED: "connection_created";
53
+ readonly CONNECTION_UPDATED: "connection_updated";
54
+ readonly CONNECTION_DELETED: "connection_deleted";
55
+ readonly CONNECTION_TESTED: "connection_tested";
56
+ readonly TOKEN_REFRESHED: "token_refreshed";
57
+ readonly TOKEN_REVOKED: "token_revoked";
58
+ readonly OAUTH_INITIATED: "oauth_initiated";
59
+ readonly OAUTH_COMPLETED: "oauth_completed";
60
+ readonly OAUTH_FAILED: "oauth_failed";
61
+ readonly API_REQUEST: "api_request";
62
+ readonly API_ERROR: "api_error";
63
+ readonly PLUGIN_INSTALLED: "plugin_installed";
64
+ readonly PLUGIN_UPDATED: "plugin_updated";
65
+ readonly PLUGIN_UNINSTALLED: "plugin_uninstalled";
66
+ readonly PROVIDER_ENABLED: "provider_enabled";
67
+ readonly PROVIDER_DISABLED: "provider_disabled";
68
+ };
69
+ export type LogActionValue = (typeof LogAction)[keyof typeof LogAction];
70
+ //# sourceMappingURL=enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/integrations/constants/enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;CAcnB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE7F,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAErE,eAAO,MAAM,gBAAgB;;;;;;;CAOnB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE7F,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEjF,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAErE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAiBZ,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const INTEGRATION_FEATURE_FLAGS: {
2
+ readonly CSV_EXPORT: "integrations.csv-export";
3
+ readonly OAUTH_REFRESH: "integrations.oauth-refresh";
4
+ readonly TAG_MANAGEMENT: "integrations.tag-management";
5
+ readonly MANAGED_CREDENTIALS: "integrations.managed-credentials";
6
+ };
7
+ //# sourceMappingURL=featureFlags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/integrations/constants/featureFlags.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ //#region src/integrations/constants/featureFlags.ts
2
+ var e = {
3
+ CSV_EXPORT: "integrations.csv-export",
4
+ OAUTH_REFRESH: "integrations.oauth-refresh",
5
+ TAG_MANAGEMENT: "integrations.tag-management",
6
+ MANAGED_CREDENTIALS: "integrations.managed-credentials"
7
+ };
8
+ //#endregion
9
+ export { e as INTEGRATION_FEATURE_FLAGS };
10
+
11
+ //# sourceMappingURL=featureFlags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"featureFlags.js","names":[],"sources":["../../../src/integrations/constants/featureFlags.ts"],"sourcesContent":["export const INTEGRATION_FEATURE_FLAGS = {\n CSV_EXPORT: 'integrations.csv-export',\n OAUTH_REFRESH: 'integrations.oauth-refresh',\n TAG_MANAGEMENT: 'integrations.tag-management',\n MANAGED_CREDENTIALS: 'integrations.managed-credentials',\n} as const;\n"],"mappings":";AAAA,IAAa,IAA4B;CACvC,YAAY;CACZ,eAAe;CACf,gBAAgB;CAChB,qBAAqB;CACtB"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Integrations Permission Constants
3
+ *
4
+ * Usage: hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE)
5
+ */
6
+ export declare const INTEGRATION_PERMISSIONS: {
7
+ readonly INTEGRATION_READ: "integration:read";
8
+ readonly INTEGRATION_CREATE: "integration:create";
9
+ readonly INTEGRATION_WRITE: "integration:write";
10
+ readonly INTEGRATION_DELETE: "integration:delete";
11
+ readonly CONNECTION_READ: "integration-connection:read";
12
+ readonly CONNECTION_CREATE: "integration-connection:create";
13
+ readonly CONNECTION_UPDATE: "integration-connection:update";
14
+ readonly CONNECTION_DELETE: "integration-connection:delete";
15
+ readonly PROVIDER_READ: "integration-provider:read";
16
+ readonly PROVIDER_CREATE: "integration-provider:create";
17
+ readonly PROVIDER_UPDATE: "integration-provider:update";
18
+ readonly PROVIDER_DELETE: "integration-provider:delete";
19
+ readonly LOG_READ: "integration-log:read";
20
+ };
21
+ export type IntegrationPermission = (typeof INTEGRATION_PERMISSIONS)[keyof typeof INTEGRATION_PERMISSIONS];
22
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/integrations/constants/permissions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;CAuB1B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ //#region src/integrations/constants/permissions.ts
2
+ var e = {
3
+ INTEGRATION_READ: "integration:read",
4
+ INTEGRATION_CREATE: "integration:create",
5
+ INTEGRATION_WRITE: "integration:write",
6
+ INTEGRATION_DELETE: "integration:delete",
7
+ CONNECTION_READ: "integration-connection:read",
8
+ CONNECTION_CREATE: "integration-connection:create",
9
+ CONNECTION_UPDATE: "integration-connection:update",
10
+ CONNECTION_DELETE: "integration-connection:delete",
11
+ PROVIDER_READ: "integration-provider:read",
12
+ PROVIDER_CREATE: "integration-provider:create",
13
+ PROVIDER_UPDATE: "integration-provider:update",
14
+ PROVIDER_DELETE: "integration-provider:delete",
15
+ LOG_READ: "integration-log:read"
16
+ };
17
+ //#endregion
18
+ export { e as INTEGRATION_PERMISSIONS };
19
+
20
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.js","names":[],"sources":["../../../src/integrations/constants/permissions.ts"],"sourcesContent":["/**\n * Integrations Permission Constants\n *\n * Usage: hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE)\n */\n\nexport const INTEGRATION_PERMISSIONS = {\n // integration (module-level)\n // Note: the backend RBAC seed defines `integration:write` (not `update`) for\n // module-level config changes. Sub-resources use standard CRUD `update`.\n INTEGRATION_READ: 'integration:read',\n INTEGRATION_CREATE: 'integration:create',\n INTEGRATION_WRITE: 'integration:write',\n INTEGRATION_DELETE: 'integration:delete',\n\n // integration-connection\n CONNECTION_READ: 'integration-connection:read',\n CONNECTION_CREATE: 'integration-connection:create',\n CONNECTION_UPDATE: 'integration-connection:update',\n CONNECTION_DELETE: 'integration-connection:delete',\n\n // integration-provider\n PROVIDER_READ: 'integration-provider:read',\n PROVIDER_CREATE: 'integration-provider:create',\n PROVIDER_UPDATE: 'integration-provider:update',\n PROVIDER_DELETE: 'integration-provider:delete',\n\n // integration-log\n LOG_READ: 'integration-log:read',\n} as const;\n\nexport type IntegrationPermission =\n (typeof INTEGRATION_PERMISSIONS)[keyof typeof INTEGRATION_PERMISSIONS];\n"],"mappings":";AAMA,IAAa,IAA0B;CAIrC,kBAAkB;CAClB,oBAAoB;CACpB,mBAAmB;CACnB,oBAAoB;CAGpB,iBAAiB;CACjB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CAGnB,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CAGjB,UAAU;CACX"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Integration domain events emitted by the MFE.
3
+ * Components can import this type to type-safely subscribe to integration events.
4
+ */
5
+ export interface IntegrationsEventMap {
6
+ 'integrations:connection-created': {
7
+ connectionId: string;
8
+ providerKey: string;
9
+ };
10
+ 'integrations:connection-updated': {
11
+ connectionId: string;
12
+ };
13
+ 'integrations:connection-deleted': {
14
+ connectionId: string;
15
+ };
16
+ 'integrations:oauth-started': {
17
+ connectionId: string;
18
+ providerKey: string;
19
+ };
20
+ 'integrations:oauth-completed': {
21
+ connectionId: string;
22
+ providerKey: string;
23
+ };
24
+ 'integrations:oauth-failed': {
25
+ connectionId: string;
26
+ providerKey: string;
27
+ error?: string;
28
+ };
29
+ 'integrations:token-refreshed': {
30
+ connectionId: string;
31
+ };
32
+ 'integrations:token-revoked': {
33
+ connectionId: string;
34
+ };
35
+ }
36
+ //# sourceMappingURL=integrations-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations-events.d.ts","sourceRoot":"","sources":["../../../src/integrations/events/integrations-events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,iCAAiC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACjF,iCAAiC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,iCAAiC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,4BAA4B,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,8BAA8B,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9E,2BAA2B,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3F,8BAA8B,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,4BAA4B,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD"}
@@ -0,0 +1,11 @@
1
+ import { IntegrationsEventMap } from './integrations-events';
2
+
3
+ type EventKey = keyof IntegrationsEventMap;
4
+ interface EventState {
5
+ subscribers: Partial<Record<EventKey, Set<(payload: IntegrationsEventMap[EventKey]) => void>>>;
6
+ emit<K extends EventKey>(event: K, payload: IntegrationsEventMap[K]): void;
7
+ on<K extends EventKey>(event: K, handler: (payload: IntegrationsEventMap[K]) => void): () => void;
8
+ }
9
+ export declare const useIntegrationsEventBus: import('zustand').UseBoundStore<import('zustand').StoreApi<EventState>>;
10
+ export {};
11
+ //# sourceMappingURL=useIntegrationsEventBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntegrationsEventBus.d.ts","sourceRoot":"","sources":["../../../src/integrations/events/useIntegrationsEventBus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,KAAK,QAAQ,GAAG,MAAM,oBAAoB,CAAC;AAE3C,UAAU,UAAU;IAClB,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,IAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC3E,EAAE,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACnG;AAED,eAAO,MAAM,uBAAuB,yEA4BjC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { create as e } from "zustand";
2
+ //#region src/integrations/events/useIntegrationsEventBus.ts
3
+ var t = e((e, t) => ({
4
+ subscribers: {},
5
+ emit(e, n) {
6
+ let { subscribers: r } = t(), i = r[e];
7
+ i && i.forEach((e) => e(n));
8
+ },
9
+ on(n, r) {
10
+ let { subscribers: i } = t();
11
+ return i[n] || e((e) => ({ subscribers: {
12
+ ...e.subscribers,
13
+ [n]: /* @__PURE__ */ new Set()
14
+ } })), t().subscribers[n].add(r), () => {
15
+ let e = t().subscribers[n];
16
+ e && e.delete(r);
17
+ };
18
+ }
19
+ }));
20
+ //#endregion
21
+ export { t as useIntegrationsEventBus };
22
+
23
+ //# sourceMappingURL=useIntegrationsEventBus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntegrationsEventBus.js","names":[],"sources":["../../../src/integrations/events/useIntegrationsEventBus.ts"],"sourcesContent":["import { create } from 'zustand';\nimport type { IntegrationsEventMap } from './integrations-events';\n\ntype EventKey = keyof IntegrationsEventMap;\n\ninterface EventState {\n subscribers: Partial<Record<EventKey, Set<(payload: IntegrationsEventMap[EventKey]) => void>>>;\n emit<K extends EventKey>(event: K, payload: IntegrationsEventMap[K]): void;\n on<K extends EventKey>(event: K, handler: (payload: IntegrationsEventMap[K]) => void): () => void;\n}\n\nexport const useIntegrationsEventBus = create<EventState>((set, get) => ({\n subscribers: {},\n\n emit(event, payload) {\n const { subscribers } = get();\n const handlers = subscribers[event];\n if (handlers) {\n handlers.forEach((handler) => handler(payload));\n }\n },\n\n on(event, handler) {\n const { subscribers } = get();\n if (!subscribers[event]) {\n set((state) => ({\n subscribers: { ...state.subscribers, [event]: new Set() },\n }));\n }\n (get().subscribers[event] as Set<(payload: IntegrationsEventMap[typeof event]) => void>).add(\n handler as (payload: IntegrationsEventMap[EventKey]) => void\n );\n return () => {\n const handlers = get().subscribers[event];\n if (handlers) {\n handlers.delete(handler as (payload: IntegrationsEventMap[EventKey]) => void);\n }\n };\n },\n}));\n"],"mappings":";;AAWA,IAAa,IAA0B,GAAoB,GAAK,OAAS;CACvE,aAAa,EAAE;CAEf,KAAK,GAAO,GAAS;EACnB,IAAM,EAAE,mBAAgB,GAAK,EACvB,IAAW,EAAY;AAC7B,EAAI,KACF,EAAS,SAAS,MAAY,EAAQ,EAAQ,CAAC;;CAInD,GAAG,GAAO,GAAS;EACjB,IAAM,EAAE,mBAAgB,GAAK;AAS7B,SARK,EAAY,MACf,GAAK,OAAW,EACd,aAAa;GAAE,GAAG,EAAM;IAAc,oBAAQ,IAAI,KAAK;GAAE,EAC1D,EAAE,EAEJ,GAAK,CAAC,YAAY,GAAsE,IACvF,EACD,QACY;GACX,IAAM,IAAW,GAAK,CAAC,YAAY;AACnC,GAAI,KACF,EAAS,OAAO,EAA6D;;;CAIpF,EAAE"}