@bpinternal/integration-hub 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import type { BotpressIntegrationHubProps } from './botpressTypes.js';
2
- export declare const BotpressIntegrationHubScreen: ({ client, workspaceId, botId, initialView, categories, bannerSlides, bannerIconUrl, noResultsDocumentationLink, disableInstallation, installEnabled, hasWriteAccess, categoryResolver, filterMenuLabels, defaultVisibility, defaultVerification, defaultSortMethod, renderConfigurationForm, renderConnectionsContent, oauthTemplateData, renderDetailPanel, onInstall, onUninstall, onEnable, onDisable, onUpgrade, onError }: BotpressIntegrationHubProps) => import("react/jsx-runtime").JSX.Element;
3
- export declare const BotpressIntegrationHub: ({ client, workspaceId, botId, initialView, categories, bannerSlides, bannerIconUrl, noResultsDocumentationLink, disableInstallation, installEnabled, hasWriteAccess, categoryResolver, filterMenuLabels, defaultVisibility, defaultVerification, defaultSortMethod, renderConfigurationForm, renderConnectionsContent, oauthTemplateData, renderDetailPanel, onInstall, onUninstall, onEnable, onDisable, onUpgrade, onError }: BotpressIntegrationHubProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const BotpressIntegrationHubScreen: ({ client, workspaceId, botId, initialView, categories, bannerSlides, bannerIconUrl, noResultsDocumentationLink, disableInstallation, hasWriteAccess, transformIntegrationPatch, categoryResolver, filterMenuLabels, defaultVisibility, defaultVerification, defaultSortMethod, renderConfigurationForm, renderConnectionsContent, oauthTemplateData, renderDetailPanel, onInstall, onUninstall, onEnable, onDisable, onUpgrade, onError }: BotpressIntegrationHubProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const BotpressIntegrationHub: ({ client, workspaceId, botId, initialView, categories, bannerSlides, bannerIconUrl, noResultsDocumentationLink, disableInstallation, hasWriteAccess, transformIntegrationPatch, categoryResolver, filterMenuLabels, defaultVisibility, defaultVerification, defaultSortMethod, renderConfigurationForm, renderConnectionsContent, oauthTemplateData, renderDetailPanel, onInstall, onUninstall, onEnable, onDisable, onUpgrade, onError }: BotpressIntegrationHubProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { Client, ClientOutputs, Integration } from '@botpress/client';
1
+ import type { Client, ClientInputs, ClientOutputs, Integration } from '@botpress/client';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { IntegrationCapabilityCardItem, IntegrationConnectionMethod, IntegrationConnectionMethodOption, IntegrationHubBannerSlide, IntegrationHubCategory, IntegrationHubNoResultsDocumentationLink, IntegrationHubSortMethod, IntegrationHubVerificationFilter, IntegrationHubView, IntegrationHubVisibilityFilter, IntegrationSelectedCapabilityCard } from '../core/types.js';
4
4
  import type { IntegrationHubFilterMenuProps } from '../hub/IntegrationHubFilterMenu.js';
@@ -8,6 +8,8 @@ export type PrivateIntegrationSummary = ClientOutputs['listIntegrations']['integ
8
8
  export type IntegrationSummary = PublicIntegrationSummary | PrivateIntegrationSummary;
9
9
  export type BotIntegrationsMap = NonNullable<ClientOutputs['getBot']['bot']['integrations']>;
10
10
  export type BotIntegrationEntry = BotIntegrationsMap[string];
11
+ export type IntegrationPatch = NonNullable<ClientInputs['updateBot']['integrations']>[string] | null;
12
+ export type IntegrationPatchTransformers = Partial<Record<'install' | 'uninstall' | 'upgrade' | 'enable' | 'disable' | 'configure', (patch: Record<string, IntegrationPatch>) => Record<string, IntegrationPatch> | Promise<Record<string, IntegrationPatch>>>>;
11
13
  export interface BotpressInstalledIntegration extends BotIntegrationEntry {
12
14
  id: string;
13
15
  name: string;
@@ -15,6 +17,7 @@ export interface BotpressInstalledIntegration extends BotIntegrationEntry {
15
17
  }
16
18
  export interface BotpressIntegrationHubItem {
17
19
  id: string;
20
+ installedId?: string;
18
21
  name: string;
19
22
  title?: string | null;
20
23
  description?: string | null;
@@ -46,7 +49,7 @@ export interface UseIntegrationHubOptions {
46
49
  botId: string;
47
50
  categoryResolver?: CategoryResolver;
48
51
  enabled?: boolean;
49
- installEnabled?: boolean;
52
+ transformIntegrationPatch?: IntegrationPatchTransformers;
50
53
  }
51
54
  export interface UseIntegrationHubResult {
52
55
  integrations: BotpressIntegrationHubItem[];
@@ -71,6 +74,7 @@ export interface UseIntegrationDetailsOptions {
71
74
  botId: string;
72
75
  integrationId: string | null;
73
76
  enabled?: boolean;
77
+ transformIntegrationPatch?: IntegrationPatchTransformers;
74
78
  }
75
79
  export interface UseIntegrationDetailsResult {
76
80
  definition: Integration | null;
@@ -122,8 +126,8 @@ export interface BotpressIntegrationHubProps {
122
126
  bannerIconUrl?: string;
123
127
  noResultsDocumentationLink?: IntegrationHubNoResultsDocumentationLink;
124
128
  disableInstallation?: boolean;
125
- installEnabled?: boolean;
126
129
  hasWriteAccess?: boolean;
130
+ transformIntegrationPatch?: IntegrationPatchTransformers;
127
131
  categoryResolver?: CategoryResolver;
128
132
  filterMenuLabels?: IntegrationHubFilterMenuProps['labels'];
129
133
  defaultVisibility?: IntegrationHubVisibilityFilter;
@@ -8,4 +8,4 @@ export type { IntegrationOAuthButtonProps } from './IntegrationOAuthButton.js';
8
8
  export type { IntegrationStaticZuiConfigurationFormProps } from './IntegrationStaticZuiConfigurationForm.js';
9
9
  export type { OpenOAuthPopupOptions, OpenOAuthPopupResult } from './botpressOAuth.js';
10
10
  export { dedupeById, filterAndSortIntegrations, findInstalledIntegration, getInstalledIntegrations, getSelectedConnectionMethod, isOfficialWorkspace, resolveCategory, toCapabilityCards, toConnectionMethods, toError, toHubItem, toInstalledItem } from './botpressMappers.js';
11
- export type { BotpressInstalledIntegration, BotpressIntegrationHubItem, BotIntegrationsMap, BotIntegrationEntry, BotpressIntegrationHubProps, CategoryResolver, IntegrationHubClient, IntegrationSummary, PrivateIntegrationSummary, PublicIntegrationSummary, RenderConfigurationFormProps, RenderConnectionsContentProps, RenderDetailPanelProps, UseIntegrationDetailsOptions, UseIntegrationDetailsResult, UseIntegrationHubOptions, UseIntegrationHubResult } from './botpressTypes.js';
11
+ export type { BotpressInstalledIntegration, BotpressIntegrationHubItem, BotIntegrationsMap, BotIntegrationEntry, BotpressIntegrationHubProps, CategoryResolver, IntegrationHubClient, IntegrationPatch, IntegrationPatchTransformers, IntegrationSummary, PrivateIntegrationSummary, PublicIntegrationSummary, RenderConfigurationFormProps, RenderConnectionsContentProps, RenderDetailPanelProps, UseIntegrationDetailsOptions, UseIntegrationDetailsResult, UseIntegrationHubOptions, UseIntegrationHubResult } from './botpressTypes.js';