@bpinternal/integration-hub 0.3.0 → 0.4.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', (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;
@@ -46,7 +48,7 @@ export interface UseIntegrationHubOptions {
46
48
  botId: string;
47
49
  categoryResolver?: CategoryResolver;
48
50
  enabled?: boolean;
49
- installEnabled?: boolean;
51
+ transformIntegrationPatch?: IntegrationPatchTransformers;
50
52
  }
51
53
  export interface UseIntegrationHubResult {
52
54
  integrations: BotpressIntegrationHubItem[];
@@ -122,8 +124,8 @@ export interface BotpressIntegrationHubProps {
122
124
  bannerIconUrl?: string;
123
125
  noResultsDocumentationLink?: IntegrationHubNoResultsDocumentationLink;
124
126
  disableInstallation?: boolean;
125
- installEnabled?: boolean;
126
127
  hasWriteAccess?: boolean;
128
+ transformIntegrationPatch?: IntegrationPatchTransformers;
127
129
  categoryResolver?: CategoryResolver;
128
130
  filterMenuLabels?: IntegrationHubFilterMenuProps['labels'];
129
131
  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';