@burdenoff/microfe-botmanor 2026.1118.5 → 2026.1118.6

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.
@@ -9,26 +9,27 @@ function l() {
9
9
  if (!e) throw Error("useBotlit must be used within a BotlitProvider");
10
10
  return e;
11
11
  }
12
- var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f, productId: p, onBotSelect: m, onAgentSelect: h }) => {
13
- let g = s(), _ = r || "/", v = n((t) => e(_, t), [_]), y = n((t) => {
14
- let n = e(_, t);
15
- g(n);
16
- }, [_, g]), b = i(() => ({
17
- basePath: _,
12
+ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, organizationId: u, workspaceId: d, apiGatewayUrl: f, authToken: p, productId: m, onBotSelect: h, onAgentSelect: g }) => {
13
+ let _ = s(), v = r || "/", y = n((t) => e(v, t), [v]), b = n((t) => {
14
+ let n = e(v, t);
15
+ _(n);
16
+ }, [v, _]), x = i(() => ({
17
+ basePath: v,
18
18
  navigate: void 0,
19
19
  currentUser: o,
20
20
  tenantId: l,
21
- workspaceId: u,
22
- apiGatewayUrl: d,
23
- authToken: f,
24
- productId: p,
25
- onBotSelect: m,
26
- onAgentSelect: h,
21
+ organizationId: u,
22
+ workspaceId: d,
23
+ apiGatewayUrl: f,
24
+ authToken: p,
25
+ productId: m,
26
+ onBotSelect: h,
27
+ onAgentSelect: g,
27
28
  isStandalone: !0,
28
- navigateTo: y,
29
- getPath: v
29
+ navigateTo: b,
30
+ getPath: y
30
31
  }), [
31
- _,
32
+ v,
32
33
  o,
33
34
  l,
34
35
  u,
@@ -37,32 +38,34 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u
37
38
  p,
38
39
  m,
39
40
  h,
40
- y,
41
- v
41
+ g,
42
+ b,
43
+ y
42
44
  ]);
43
45
  return /* @__PURE__ */ a(c.Provider, {
44
- value: b,
46
+ value: x,
45
47
  children: t
46
48
  });
47
- }, d = ({ children: t, basePath: r, navigate: o, currentUser: s, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f, productId: p, onBotSelect: m, onAgentSelect: h }) => {
48
- let g = r || "/", _ = n((t) => e(g, t), [g]), v = n((t) => {
49
- o(e(g, t));
50
- }, [g, o]), y = i(() => ({
51
- basePath: g,
49
+ }, d = ({ children: t, basePath: r, navigate: o, currentUser: s, tenantId: l, organizationId: u, workspaceId: d, apiGatewayUrl: f, authToken: p, productId: m, onBotSelect: h, onAgentSelect: g }) => {
50
+ let _ = r || "/", v = n((t) => e(_, t), [_]), y = n((t) => {
51
+ o(e(_, t));
52
+ }, [_, o]), b = i(() => ({
53
+ basePath: _,
52
54
  navigate: o,
53
55
  currentUser: s,
54
56
  tenantId: l,
55
- workspaceId: u,
56
- apiGatewayUrl: d,
57
- authToken: f,
58
- productId: p,
59
- onBotSelect: m,
60
- onAgentSelect: h,
57
+ organizationId: u,
58
+ workspaceId: d,
59
+ apiGatewayUrl: f,
60
+ authToken: p,
61
+ productId: m,
62
+ onBotSelect: h,
63
+ onAgentSelect: g,
61
64
  isStandalone: !1,
62
- navigateTo: v,
63
- getPath: _
65
+ navigateTo: y,
66
+ getPath: v
64
67
  }), [
65
- g,
68
+ _,
66
69
  o,
67
70
  s,
68
71
  l,
@@ -72,11 +75,12 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u
72
75
  p,
73
76
  m,
74
77
  h,
75
- v,
76
- _
78
+ g,
79
+ y,
80
+ v
77
81
  ]);
78
82
  return /* @__PURE__ */ a(c.Provider, {
79
- value: y,
83
+ value: b,
80
84
  children: t
81
85
  });
82
86
  }, f = (e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"BotlitProvider.js","names":["useRouterNavigate","BotlitContext","createContext","useBotlit","context","useContext","StandaloneProviderInner","routerNavigate","useNavigate","effectiveBasePath","basePath","getPath","useCallback","joinPath","relativePath","navigateTo","fullPath","contextValue","useMemo","currentUser","tenantId","workspaceId","apiGatewayUrl","authToken","productId","onBotSelect","onAgentSelect","IntegratedProviderInner","navigate","BotlitProvider","props","MemoryRouter"],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAMC,IAAgBC,EAAyC,IAAI;AAMnE,SAAgBC,IAAgC;CAC9C,IAAMC,IAAUC,EAAWJ,CAAa;CACxC,IAAI,CAACG,GACH,MAAU,MAAM,gDAAgD;CAElE,OAAOA;AACT;AAWA,IAAME,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CAEJ,IAAMC,IAAiBP,EAAkB,GACnCS,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EACxB,IAAMI,IAAWH,EAASJ,GAAmBK,CAAY;EACzD,EAAeE,CAAQ;CACzB,GACA,CAACP,GAAmBF,CAAc,CACpC,GAEMU,IAAeC,SACZ;EACL,UAAUT;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAU;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAX;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAGMU,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CACJ,IAAMlB,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EAExB,EADiBC,EAASJ,GAAmBK,CACpC,CAAQ;CACnB,GACA,CAACL,GAAmBmB,CAAQ,CAC9B,GAEMX,IAAeC,SACZ;EACL,UAAUT;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAmB;EACAT;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAX;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAEaY,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,gBAAaC;CAiB/B,OAdsBF,IAepB,kBAACD,GAAD;EAAyB,GAAIG;EAAiB;EAAU,cAAc;EACnE;CACsB,CAAA,IAZvB,kBAACC,GAAD,EAAA,UACE,kBAACzB,GAAD;EAAyB,GAAIwB;EAAO,cAAc;EAC/C;CACsB,CAAA,EACb,CAAA;AAUpB"}
1
+ {"version":3,"file":"BotlitProvider.js","names":["useRouterNavigate","BotlitContext","createContext","useBotlit","context","useContext","StandaloneProviderInner","routerNavigate","useNavigate","effectiveBasePath","basePath","getPath","useCallback","joinPath","relativePath","navigateTo","fullPath","contextValue","useMemo","currentUser","tenantId","organizationId","workspaceId","apiGatewayUrl","authToken","productId","onBotSelect","onAgentSelect","IntegratedProviderInner","navigate","BotlitProvider","props","MemoryRouter"],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAMC,IAAgBC,EAAyC,IAAI;AAMnE,SAAgBC,IAAgC;CAC9C,IAAMC,IAAUC,EAAWJ,CAAa;CACxC,IAAI,CAACG,GACH,MAAU,MAAM,gDAAgD;CAElE,OAAOA;AACT;AAWA,IAAME,KAAiE,EACrE,aACA,aACA,gBACA,aACA,mBACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CAEJ,IAAMC,IAAiBP,EAAkB,GACnCS,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EACxB,IAAMI,IAAWH,EAASJ,GAAmBK,CAAY;EACzD,EAAeE,CAAQ;CACzB,GACA,CAACP,GAAmBF,CAAc,CACpC,GAEMU,IAAeC,SACZ;EACL,UAAUT;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAU;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAZ;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAGMW,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,mBACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CACJ,IAAMnB,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EAExB,EADiBC,EAASJ,GAAmBK,CACpC,CAAQ;CACnB,GACA,CAACL,GAAmBoB,CAAQ,CAC9B,GAEMZ,IAAeC,SACZ;EACL,UAAUT;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAoB;EACAV;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAZ;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAEaa,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,gBAAaC;CAiB/B,OAdsBF,IAepB,kBAACD,GAAD;EAAyB,GAAIG;EAAiB;EAAU,cAAc;EACnE;CACsB,CAAA,IAZvB,kBAACC,GAAD,EAAA,UACE,kBAAC1B,GAAD;EAAyB,GAAIyB;EAAO,cAAc;EAC/C;CACsB,CAAA,EACb,CAAA;AAUpB"}
@@ -38,6 +38,8 @@ export interface BotmanorRootProps {
38
38
  navigate: (path: string) => void;
39
39
  currentUser?: User;
40
40
  tenantId?: string;
41
+ /** Active organization (the shell's ActiveContext); global channels belong to it. */
42
+ organizationId?: string;
41
43
  workspaceId?: string;
42
44
  /**
43
45
  * Workspace-specific API gateway URL (e.g. http://localhost:4003).
@@ -0,0 +1,16 @@
1
+ import { ChannelConnectorRecord, CreateChannelConnectorVariables } from '../hooks/useChannels';
2
+ /** The global-channel fields a connector is derived from. */
3
+ export interface ConnectableChannel {
4
+ id: string;
5
+ name: string;
6
+ platform: string;
7
+ }
8
+ /**
9
+ * This workspace's connector for a global channel: `existing` (the one that
10
+ * already names it, made ACTIVE if it is not) or a new ACTIVE one named
11
+ * after the channel.
12
+ */
13
+ export declare function ensureActiveConnector(channel: ConnectableChannel, existing: ChannelConnectorRecord | null, actions: {
14
+ create: (input: CreateChannelConnectorVariables) => Promise<ChannelConnectorRecord>;
15
+ activate: (connectorId: string) => Promise<ChannelConnectorRecord>;
16
+ }): Promise<Pick<ChannelConnectorRecord, 'id'>>;
@@ -0,0 +1,24 @@
1
+ // src/botlit/utils/channelConnectors.ts
2
+ var e = {
3
+ SLACK: "SLACK",
4
+ TEAMS: "TEAMS",
5
+ DISCORD: "DISCORD",
6
+ WHATSAPP: "WHATSAPP",
7
+ WEBHOOK: "WEBHOOK",
8
+ EMAIL: "EMAIL",
9
+ SMS: "SMS"
10
+ };
11
+ async function t(t, n, r) {
12
+ if (n) return n.status !== "ACTIVE" && await r.activate(n.id), n;
13
+ let i = e[t.platform];
14
+ if (!i) throw Error(`${t.platform} channels cannot be routed to a bot`);
15
+ return r.create({
16
+ name: t.name,
17
+ type: i,
18
+ status: "ACTIVE",
19
+ credentialsRefId: t.id
20
+ });
21
+ }
22
+ export { t as ensureActiveConnector };
23
+
24
+ //# sourceMappingURL=channelConnectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channelConnectors.js","names":["CONNECTOR_TYPE_BY_PLATFORM","ensureActiveConnector","existing","actions","type","channel"],"sources":["../../../src/botlit/utils/channelConnectors.ts"],"sourcesContent":["/**\n * Channel connector helpers (BOFF-15360)\n * @module botlit/utils\n */\n\nimport type { ChannelConnectorRecord, CreateChannelConnectorVariables } from '../hooks/useChannels';\n\n/** The global-channel fields a connector is derived from. */\nexport interface ConnectableChannel {\n id: string;\n name: string;\n platform: string;\n}\n\n/** Global-channel platform → the connector type that routes it. */\nconst CONNECTOR_TYPE_BY_PLATFORM: Readonly<\n Record<string, CreateChannelConnectorVariables['type']>\n> = {\n SLACK: 'SLACK',\n TEAMS: 'TEAMS',\n DISCORD: 'DISCORD',\n WHATSAPP: 'WHATSAPP',\n WEBHOOK: 'WEBHOOK',\n EMAIL: 'EMAIL',\n SMS: 'SMS',\n};\n\n/**\n * This workspace's connector for a global channel: `existing` (the one that\n * already names it, made ACTIVE if it is not) or a new ACTIVE one named\n * after the channel.\n */\nexport async function ensureActiveConnector(\n channel: ConnectableChannel,\n existing: ChannelConnectorRecord | null,\n actions: {\n create: (input: CreateChannelConnectorVariables) => Promise<ChannelConnectorRecord>;\n activate: (connectorId: string) => Promise<ChannelConnectorRecord>;\n }\n): Promise<Pick<ChannelConnectorRecord, 'id'>> {\n if (existing) {\n if (existing.status !== 'ACTIVE') await actions.activate(existing.id);\n return existing;\n }\n const type = CONNECTOR_TYPE_BY_PLATFORM[channel.platform];\n if (!type) throw new Error(`${channel.platform} channels cannot be routed to a bot`);\n return actions.create({\n name: channel.name,\n type,\n status: 'ACTIVE',\n credentialsRefId: channel.id,\n });\n}\n"],"mappings":";AAeA,IAAMA,IAEF;CACF,OAAO;CACP,OAAO;CACP,SAAS;CACT,UAAU;CACV,SAAS;CACT,OAAO;CACP,KAAK;AACP;AAOA,eAAsBC,EACpB,GACA,GACA,GAI6C;CAC7C,IAAIC,GAEF,OADIA,EAAS,WAAW,YAAU,MAAMC,EAAQ,SAASD,EAAS,EAAE,GAC7DA;CAET,IAAME,IAAOJ,EAA2BK,EAAQ;CAChD,IAAI,CAACD,GAAM,MAAU,MAAM,GAAGC,EAAQ,SAAS,oCAAoC;CACnF,OAAOF,EAAQ,OAAO;EACpB,MAAME,EAAQ;EACd;EACA,QAAQ;EACR,kBAAkBA,EAAQ;CAC5B,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-botmanor",
3
- "version": "2026.1118.5",
3
+ "version": "2026.1118.6",
4
4
  "description": "Burdenoff BotManor Microfrontend - AI Agent platform interface for building, deploying and managing AI agents",
5
5
  "type": "module",
6
6
  "files": [