@xpert-ai/plugin-sdk 3.7.1 → 3.8.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.
Files changed (41) hide show
  1. package/index.cjs.js +851 -834
  2. package/index.esm.js +826 -837
  3. package/package.json +5 -1
  4. package/src/index.d.ts +2 -0
  5. package/src/lib/agent/handoff/agent-chat.contract.d.ts +20 -0
  6. package/src/lib/agent/handoff/handoff-processor.decorator.d.ts +11 -0
  7. package/src/lib/agent/handoff/handoff-processor.registry.d.ts +6 -0
  8. package/src/lib/agent/handoff/handoff.interface.d.ts +17 -0
  9. package/src/lib/agent/handoff/index.d.ts +6 -0
  10. package/src/lib/agent/handoff/message-type.d.ts +24 -0
  11. package/src/lib/agent/handoff/types.d.ts +110 -0
  12. package/src/lib/agent/index.d.ts +1 -0
  13. package/src/lib/agent/middleware/runtime.d.ts +2 -0
  14. package/src/lib/agent/middleware/strategy.interface.d.ts +5 -1
  15. package/src/lib/agent/middleware/types.d.ts +73 -8
  16. package/src/lib/ai-model/ai-model.d.ts +3 -1
  17. package/src/lib/ai-model/utils/index.d.ts +1 -0
  18. package/src/lib/ai-model/utils/limits.d.ts +4 -0
  19. package/src/lib/channel/cancel-conversation.command.d.ts +14 -0
  20. package/src/lib/channel/index.d.ts +4 -0
  21. package/src/lib/channel/strategy.decorator.d.ts +23 -0
  22. package/src/lib/channel/strategy.interface.d.ts +345 -0
  23. package/src/lib/channel/strategy.registry.d.ts +30 -0
  24. package/src/lib/core/permissions/analytics.d.ts +46 -0
  25. package/src/lib/core/{permissions.d.ts → permissions/general.d.ts} +9 -12
  26. package/src/lib/core/permissions/handoff.d.ts +36 -0
  27. package/src/lib/core/permissions/index.d.ts +24 -0
  28. package/src/lib/core/permissions/operation.d.ts +8 -0
  29. package/src/lib/core/permissions/user.d.ts +29 -0
  30. package/src/lib/core/utils.d.ts +6 -0
  31. package/src/lib/integration/strategy.interface.d.ts +3 -1
  32. package/src/lib/sandbox/index.d.ts +8 -0
  33. package/src/lib/sandbox/protocol.d.ts +265 -0
  34. package/src/lib/sandbox/sandbox.d.ts +70 -0
  35. package/src/lib/sandbox/sandbox.decorator.d.ts +2 -0
  36. package/src/lib/sandbox/sandbox.interface.d.ts +38 -0
  37. package/src/lib/sandbox/sandbox.registry.d.ts +6 -0
  38. package/src/lib/toolset/strategy.interface.d.ts +2 -6
  39. package/src/lib/types.d.ts +7 -1
  40. package/src/lib/workflow/node/strategy.interface.d.ts +4 -2
  41. package/src/lib/workflow/trigger/strategy.interface.d.ts +13 -0
@@ -0,0 +1,345 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { IIntegration } from '@metad/contracts';
4
+ import { Request, Response, NextFunction } from 'express';
5
+ /**
6
+ * Channel metadata
7
+ */
8
+ export type TChatChannelMeta = {
9
+ /**
10
+ * Channel type identifier
11
+ */
12
+ type: string;
13
+ /**
14
+ * Display name
15
+ */
16
+ label: string;
17
+ /**
18
+ * Description
19
+ */
20
+ description?: string;
21
+ /**
22
+ * Icon
23
+ */
24
+ icon?: string;
25
+ /**
26
+ * JSON Schema for integration configuration
27
+ */
28
+ configSchema?: Record<string, any>;
29
+ };
30
+ /**
31
+ * Channel capabilities declaration
32
+ */
33
+ export type TChatChannelCapabilities = {
34
+ /** Supports Markdown messages */
35
+ markdown: boolean;
36
+ /** Supports interactive cards */
37
+ card: boolean;
38
+ /** Supports card button interactions */
39
+ cardAction: boolean;
40
+ /** Supports editing/updating messages */
41
+ updateMessage: boolean;
42
+ /** Supports @mentions */
43
+ mention: boolean;
44
+ /** Supports group chat */
45
+ group: boolean;
46
+ /** Supports message threads/replies */
47
+ thread?: boolean;
48
+ /** Supports media messages (images, files) */
49
+ media?: boolean;
50
+ /** Maximum characters per message (auto-chunked if exceeded), e.g., Telegram 4096, Discord 2000 */
51
+ textChunkLimit?: number;
52
+ /** Supports streaming message updates (typewriter effect) */
53
+ streamingUpdate?: boolean;
54
+ };
55
+ /**
56
+ * Inbound message - unified format from different platforms
57
+ */
58
+ export type TChatInboundMessage = {
59
+ /** Platform message ID */
60
+ messageId: string;
61
+ /** Chat ID */
62
+ chatId: string;
63
+ /** Chat type: private, group, channel, thread */
64
+ chatType: 'private' | 'group' | 'channel' | 'thread';
65
+ /** Sender ID (platform user ID) */
66
+ senderId: string;
67
+ /** Sender name */
68
+ senderName?: string;
69
+ /** Message content (text) */
70
+ content: string;
71
+ /** Content type */
72
+ contentType: 'text' | 'image' | 'file' | 'card_action' | 'voice';
73
+ /** List of mentioned users */
74
+ mentions?: Array<{
75
+ id: string;
76
+ name?: string;
77
+ }>;
78
+ /** Reply-to message ID */
79
+ replyToMessageId?: string;
80
+ /** Thread ID (for threaded conversations) */
81
+ threadId?: string;
82
+ /** Timestamp */
83
+ timestamp: number;
84
+ /** Platform raw event data */
85
+ raw: any;
86
+ };
87
+ /**
88
+ * Card action event - triggered when user clicks card button
89
+ */
90
+ export type TChatCardAction<V = unknown> = {
91
+ /** Action type/tag */
92
+ type: string;
93
+ /** Action value */
94
+ value: V;
95
+ /** Message ID the card belongs to */
96
+ messageId: string;
97
+ /** Chat ID */
98
+ chatId: string;
99
+ /** User ID who triggered the action */
100
+ userId: string;
101
+ /** Raw event data */
102
+ raw: any;
103
+ };
104
+ /**
105
+ * Chat context - used for sending messages
106
+ */
107
+ export type TChatContext = {
108
+ /** Integration configuration */
109
+ integration: IIntegration;
110
+ /** Chat ID */
111
+ chatId: string;
112
+ /** Target user ID (for private chat) */
113
+ userId?: string;
114
+ /** Thread ID (for thread replies) */
115
+ threadId?: string;
116
+ /** Reply-to message ID */
117
+ replyToMessageId?: string;
118
+ };
119
+ /**
120
+ * Send result
121
+ */
122
+ export type TChatSendResult = {
123
+ /** Success status */
124
+ success: boolean;
125
+ /** Message ID */
126
+ messageId?: string;
127
+ /** Error message */
128
+ error?: string;
129
+ };
130
+ /**
131
+ * Event handling context
132
+ */
133
+ export type TChatEventContext<TConfig = any> = {
134
+ /** Integration configuration */
135
+ integration: IIntegration<TConfig>;
136
+ /** Tenant ID */
137
+ tenantId: string;
138
+ /** Organization ID */
139
+ organizationId: string;
140
+ };
141
+ /**
142
+ * Event handling callbacks
143
+ */
144
+ export type TChatEventHandlers = {
145
+ /** Called when message is received */
146
+ onMessage?: (message: TChatInboundMessage, ctx: TChatEventContext) => Promise<void>;
147
+ /** Called on card interaction */
148
+ onCardAction?: (action: TChatCardAction, ctx: TChatEventContext) => Promise<void>;
149
+ /** Called when @mentioned in group chat */
150
+ onMention?: (message: TChatInboundMessage, ctx: TChatEventContext) => Promise<void>;
151
+ };
152
+ /**
153
+ * Chat channel interface
154
+ *
155
+ * For bidirectional messaging platforms (Lark, WeCom, DingTalk, Slack, etc.)
156
+ * Supports: receive message → invoke Xpert → reply message
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * @Injectable()
161
+ * @ChatChannel('lark')
162
+ * export class LarkChatChannel implements IChatChannel {
163
+ * meta = { type: 'lark', label: 'Lark', ... }
164
+ *
165
+ * createEventHandler(ctx, handlers) {
166
+ * // Return Express middleware for handling Webhook
167
+ * }
168
+ *
169
+ * async sendText(ctx, content) {
170
+ * // Send text message via Lark API
171
+ * }
172
+ * }
173
+ * ```
174
+ */
175
+ export interface IChatChannel<TConfig = any, TEvent = any> {
176
+ /**
177
+ * Channel metadata
178
+ */
179
+ meta: TChatChannelMeta;
180
+ /**
181
+ * Channel capabilities declaration
182
+ */
183
+ capabilities: TChatChannelCapabilities;
184
+ /**
185
+ * Create Webhook/event handler
186
+ *
187
+ * Returns Express middleware for handling inbound Webhooks.
188
+ * The middleware should:
189
+ * 1. Verify request (signature, token)
190
+ * 2. Parse event
191
+ * 3. Call appropriate handler callbacks (onMessage, onCardAction, etc.)
192
+ *
193
+ * @param ctx - Event context containing integration configuration
194
+ * @param handlers - Callback functions for different event types
195
+ * @returns Express middleware
196
+ */
197
+ createEventHandler(ctx: TChatEventContext<TConfig>, handlers: TChatEventHandlers): (req: Request, res: Response, next?: NextFunction) => Promise<void>;
198
+ /**
199
+ * Parse inbound event to unified message format
200
+ *
201
+ * @param event - Platform raw event
202
+ * @param ctx - Event context
203
+ * @returns Parsed message, or null if not a message event
204
+ */
205
+ parseInboundMessage?(event: TEvent, ctx: TChatEventContext<TConfig>): TChatInboundMessage | null;
206
+ /**
207
+ * Parse card action event
208
+ *
209
+ * @param event - Platform raw event
210
+ * @param ctx - Event context
211
+ * @returns Parsed card action, or null if not a card action event
212
+ */
213
+ parseCardAction?(event: TEvent, ctx: TChatEventContext<TConfig>): TChatCardAction | null;
214
+ /**
215
+ * Check if bot is @mentioned in message
216
+ *
217
+ * @param message - Inbound message
218
+ * @param botId - Bot's user ID on the platform
219
+ * @returns True if bot is mentioned
220
+ */
221
+ isBotMentioned?(message: TChatInboundMessage, botId: string): boolean;
222
+ /**
223
+ * Send text message
224
+ *
225
+ * @param ctx - Chat context
226
+ * @param content - Text content
227
+ * @returns Send result
228
+ */
229
+ sendText(ctx: TChatContext, content: string): Promise<TChatSendResult>;
230
+ /**
231
+ * Send Markdown message
232
+ *
233
+ * @param ctx - Chat context
234
+ * @param content - Markdown content
235
+ * @returns Send result
236
+ */
237
+ sendMarkdown?(ctx: TChatContext, content: string): Promise<TChatSendResult>;
238
+ /**
239
+ * Send interactive card
240
+ *
241
+ * @param ctx - Chat context
242
+ * @param card - Card content (platform-specific format)
243
+ * @returns Send result
244
+ */
245
+ sendCard?(ctx: TChatContext, card: any): Promise<TChatSendResult>;
246
+ /**
247
+ * Send media message (image, file)
248
+ *
249
+ * @param ctx - Chat context
250
+ * @param media - Media info
251
+ * @returns Send result
252
+ */
253
+ sendMedia?(ctx: TChatContext, media: {
254
+ /** Media type */
255
+ type: 'image' | 'file' | 'audio' | 'video';
256
+ /** Media URL */
257
+ url?: string;
258
+ /** Media content (Buffer) */
259
+ content?: Buffer;
260
+ /** Filename */
261
+ filename?: string;
262
+ }): Promise<TChatSendResult>;
263
+ /**
264
+ * Update/edit sent message
265
+ *
266
+ * @param ctx - Chat context
267
+ * @param messageId - Message ID to update
268
+ * @param content - New content
269
+ * @returns Send result
270
+ */
271
+ updateMessage?(ctx: TChatContext, messageId: string, content: string | any): Promise<TChatSendResult>;
272
+ /**
273
+ * Get bot information
274
+ *
275
+ * @param integration - Integration configuration
276
+ * @returns Bot info (ID, name, avatar, etc.)
277
+ */
278
+ getBotInfo?(integration: IIntegration<TConfig>): Promise<{
279
+ /** Bot ID */
280
+ id: string;
281
+ /** Bot name */
282
+ name?: string;
283
+ /** Bot avatar URL */
284
+ avatar?: string;
285
+ }>;
286
+ /**
287
+ * Validate integration configuration
288
+ *
289
+ * @param config - Configuration to validate
290
+ * @returns Validation result
291
+ */
292
+ validateConfig?(config: TConfig): Promise<{
293
+ /** Is valid */
294
+ valid: boolean;
295
+ /** Error list */
296
+ errors?: string[];
297
+ }>;
298
+ /**
299
+ * Test connection
300
+ *
301
+ * @param integration - Integration to test
302
+ * @returns Test result
303
+ */
304
+ testConnection?(integration: IIntegration<TConfig>): Promise<{
305
+ /** Success status */
306
+ success: boolean;
307
+ /** Message */
308
+ message?: string;
309
+ }>;
310
+ /**
311
+ * Get channel runtime status (for monitoring and operations)
312
+ *
313
+ * @param integration - Integration configuration
314
+ * @returns Channel status
315
+ */
316
+ getStatus?(integration: IIntegration<TConfig>): Promise<TChatChannelStatus>;
317
+ }
318
+ /**
319
+ * Channel runtime status (for monitoring)
320
+ */
321
+ export type TChatChannelStatus = {
322
+ /** Is connected/running */
323
+ connected: boolean;
324
+ /** Last activity timestamp */
325
+ lastActivityAt?: number;
326
+ /** Last inbound message timestamp */
327
+ lastInboundAt?: number;
328
+ /** Last outbound message timestamp */
329
+ lastOutboundAt?: number;
330
+ /** Last error message */
331
+ error?: string;
332
+ };
333
+ /**
334
+ * Common platform message length limits
335
+ */
336
+ export declare const CHAT_CHANNEL_TEXT_LIMITS: Record<string, number>;
337
+ /**
338
+ * Chunk long text by specified length
339
+ *
340
+ * @param text - Text to chunk
341
+ * @param limit - Maximum characters per chunk
342
+ * @param mode - Chunking mode: 'text' splits by character, 'markdown' tries to preserve paragraphs
343
+ * @returns Array of chunked text
344
+ */
345
+ export declare function chunkText(text: string, limit: number, mode?: 'text' | 'markdown'): string[];
@@ -0,0 +1,30 @@
1
+ import { DiscoveryService, Reflector } from '@nestjs/core';
2
+ import { BaseStrategyRegistry } from '../strategy';
3
+ import { IChatChannel } from './strategy.interface';
4
+ /**
5
+ * Chat Channel Registry
6
+ *
7
+ * Manages all registered chat channel implementations.
8
+ * Channels are automatically discovered and registered via @ChatChannel decorator.
9
+ *
10
+ * Supports:
11
+ * - Organization-scoped channels
12
+ * - Global channels (fallback)
13
+ * - Plugin-based registration/removal
14
+ * - Dynamic channel lookup
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Get channel by type
19
+ * const channel = registry.get('lark')
20
+ *
21
+ * // List all available channels for an organization
22
+ * const channels = registry.list(organizationId)
23
+ *
24
+ * // Send message using a channel
25
+ * await channel.sendText(ctx, 'Hello!')
26
+ * ```
27
+ */
28
+ export declare class ChatChannelRegistry extends BaseStrategyRegistry<IChatChannel> {
29
+ constructor(discoveryService: DiscoveryService, reflector: Reflector);
30
+ }
@@ -0,0 +1,46 @@
1
+ import type { DSCoreService } from '@metad/ocap-core';
2
+ import type { BasePermission } from './general';
3
+ export type AnalyticsPermissionOperation = 'dscore' | 'query' | 'model' | 'indicator' | 'create_indicator';
4
+ /**
5
+ * Analytics Permission
6
+ * Example: { type: 'analytics', operations: ['dscore'] }
7
+ */
8
+ export interface AnalyticsPermission extends BasePermission {
9
+ type: 'analytics';
10
+ operations?: AnalyticsPermissionOperation[];
11
+ scope?: string[];
12
+ }
13
+ /**
14
+ * System token for resolving analytics permission service from plugin context.
15
+ */
16
+ export declare const ANALYTICS_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_ANALYTICS_PERMISSION_SERVICE";
17
+ export interface AnalyticsResolvedChatBIModel {
18
+ chatbiModelId: string;
19
+ modelId: string;
20
+ modelKey?: string;
21
+ cubeName: string;
22
+ entityCaption?: string;
23
+ entityDescription?: string;
24
+ prompts?: string[];
25
+ }
26
+ export interface AnalyticsDSCoreInput {
27
+ modelIds?: string[];
28
+ indicatorDraft?: boolean;
29
+ semanticModelDraft?: boolean;
30
+ }
31
+ export interface AnalyticsIndicatorValidationInput {
32
+ modelIds?: string[];
33
+ semanticModelId: string;
34
+ modelKey?: string;
35
+ statement: string;
36
+ }
37
+ /**
38
+ * Analytics service exposed to plugins under permission control.
39
+ */
40
+ export interface AnalyticsPermissionService {
41
+ resolveChatBIModels(modelIds: string[]): Promise<AnalyticsResolvedChatBIModel[]>;
42
+ getDSCoreService(input?: AnalyticsDSCoreInput): Promise<DSCoreService>;
43
+ visitChatBIModel(modelId: string, cubeName: string): Promise<void>;
44
+ ensureCreateIndicatorAccess(): Promise<void>;
45
+ validateIndicatorStatement(input: AnalyticsIndicatorValidationInput): Promise<void>;
46
+ }
@@ -1,10 +1,4 @@
1
- /**
2
- * ===============================
3
- * Unified Permissions Definition
4
- * ===============================
5
- * Used by Agent / Plugin developers to declare required capabilities.
6
- * Core system will check and inject allowed resources accordingly.
7
- */
1
+ import type { IIntegration } from '@metad/contracts';
8
2
  /**
9
3
  * Base Permission type
10
4
  */
@@ -12,6 +6,7 @@ export interface BasePermission {
12
6
  type: string;
13
7
  description?: string;
14
8
  }
9
+ export type IntegrationPermissionOperation = 'read' | 'write' | 'update' | 'delete';
15
10
  /**
16
11
  * 1. LLM Permission
17
12
  * Example: { type: 'llm', provider: 'openai', capability: 'vision' }
@@ -61,14 +56,16 @@ export interface FileSystemPermission extends BasePermission {
61
56
  export interface IntegrationPermission extends BasePermission {
62
57
  type: 'integration';
63
58
  service: string;
64
- operations?: Array<'read' | 'write' | 'update' | 'delete'>;
59
+ operations?: IntegrationPermissionOperation[];
65
60
  scope?: string[];
66
61
  }
67
62
  /**
68
- * Union type for all permissions
63
+ * System token for resolving integration read service from plugin context.
69
64
  */
70
- export type Permission = LLMPermission | VectorStorePermission | KnowledgePermission | FileSystemPermission | IntegrationPermission;
65
+ export declare const INTEGRATION_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_INTEGRATION_PERMISSION_SERVICE";
71
66
  /**
72
- * Permissions array type
67
+ * Read-only integration permission service exposed to plugins.
73
68
  */
74
- export type Permissions = Permission[];
69
+ export interface IntegrationPermissionService {
70
+ read<TIntegration = IIntegration>(id: string, options?: Record<string, any>): Promise<TIntegration | null>;
71
+ }
@@ -0,0 +1,36 @@
1
+ import type { HandoffMessage, ProcessResult } from '../../agent/handoff/types';
2
+ export type HandoffPermissionOperation = 'enqueue' | 'wait';
3
+ /**
4
+ * Handoff Queue Permission
5
+ * Example: { type: 'handoff', operations: ['enqueue', 'wait'] }
6
+ */
7
+ export interface HandoffPermission {
8
+ type: 'handoff';
9
+ operations?: HandoffPermissionOperation[];
10
+ scope?: string[];
11
+ description?: string;
12
+ }
13
+ /**
14
+ * System token for resolving handoff queue service from plugin context.
15
+ */
16
+ export declare const HANDOFF_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_HANDOFF_PERMISSION_SERVICE";
17
+ /**
18
+ * Internal system token used by core to expose the handoff queue bridge.
19
+ */
20
+ export declare const HANDOFF_QUEUE_SERVICE_TOKEN = "XPERT_HANDOFF_QUEUE_SERVICE";
21
+ export interface HandoffEnqueueOptions {
22
+ delayMs?: number;
23
+ }
24
+ export interface HandoffEnqueueAndWaitOptions extends HandoffEnqueueOptions {
25
+ timeoutMs?: number;
26
+ onEvent?: (event: unknown) => void;
27
+ }
28
+ /**
29
+ * Handoff queue service exposed to plugins under permission control.
30
+ */
31
+ export interface HandoffPermissionService {
32
+ enqueue(message: HandoffMessage, options?: HandoffEnqueueOptions): Promise<{
33
+ id: string;
34
+ }>;
35
+ enqueueAndWait(message: HandoffMessage, options?: HandoffEnqueueAndWaitOptions): Promise<ProcessResult>;
36
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ===============================
3
+ * Unified Permissions Definition
4
+ * ===============================
5
+ * Used by Agent / Plugin developers to declare required capabilities.
6
+ * Core system will check and inject allowed resources accordingly.
7
+ */
8
+ export * from './general';
9
+ export * from './analytics';
10
+ export * from './operation';
11
+ export * from './handoff';
12
+ export * from './user';
13
+ import type { FileSystemPermission, IntegrationPermission, KnowledgePermission, LLMPermission, VectorStorePermission } from './general';
14
+ import type { AnalyticsPermission } from './analytics';
15
+ import type { HandoffPermission } from './handoff';
16
+ import type { UserPermission } from './user';
17
+ /**
18
+ * Union type for all permissions
19
+ */
20
+ export type Permission = LLMPermission | VectorStorePermission | KnowledgePermission | FileSystemPermission | IntegrationPermission | AnalyticsPermission | UserPermission | HandoffPermission;
21
+ /**
22
+ * Permissions array type
23
+ */
24
+ export type Permissions = Permission[];
@@ -0,0 +1,8 @@
1
+ export interface PermissionOperationMetadata<TPermissionType extends string = string, TOperation extends string = string> {
2
+ permissionType: TPermissionType;
3
+ operation: TOperation;
4
+ }
5
+ export declare const PERMISSION_OPERATION_METADATA_KEY = "XPERT_PLUGIN_PERMISSION_OPERATION";
6
+ export declare function RequirePermissionOperation<TPermissionType extends string, TOperation extends string>(permissionType: TPermissionType, operation: TOperation): MethodDecorator;
7
+ export declare function getPermissionOperationMetadata(method: unknown): PermissionOperationMetadata | undefined;
8
+ export declare function getRequiredPermissionOperation<TOperation extends string = string>(method: unknown, permissionType: string): TOperation | undefined;
@@ -0,0 +1,29 @@
1
+ import type { IUser } from '@metad/contracts';
2
+ import type { BasePermission } from './general';
3
+ export type UserPermissionOperation = 'read' | 'write' | 'update' | 'delete';
4
+ /**
5
+ * User Permission
6
+ * Example: { type: 'user', operations: ['read'] }
7
+ */
8
+ export interface UserPermission extends BasePermission {
9
+ type: 'user';
10
+ operations?: UserPermissionOperation[];
11
+ scope?: string[];
12
+ }
13
+ /**
14
+ * System token for resolving user permission service from plugin context.
15
+ */
16
+ export declare const USER_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_USER_PERMISSION_SERVICE";
17
+ export interface UserProvisionByThirdPartyIdentityInput {
18
+ tenantId: string;
19
+ thirdPartyId: string;
20
+ profile?: Partial<Pick<IUser, 'username' | 'email' | 'mobile' | 'imageUrl' | 'firstName' | 'lastName' | 'preferredLanguage'>>;
21
+ defaults?: {
22
+ roleId?: string;
23
+ roleName?: string;
24
+ };
25
+ }
26
+ export interface UserPermissionService {
27
+ read<TUser = IUser>(criteria: Record<string, any>): Promise<TUser | null>;
28
+ provisionByThirdPartyIdentity<TUser = IUser>(input: UserProvisionByThirdPartyIdentityInput): Promise<TUser | null>;
29
+ }
@@ -1,4 +1,5 @@
1
1
  import { Logger } from '@nestjs/common';
2
+ import { JSONSchema4 } from 'json-schema';
2
3
  export declare function loadYamlFile<T>(filePath: string, logger?: Logger, ignoreError?: boolean, defaultValue?: T): T;
3
4
  /**
4
5
  * Get the mapping from name to index from a YAML file
@@ -10,3 +11,8 @@ export declare function loadYamlFile<T>(filePath: string, logger?: Logger, ignor
10
11
  export declare function getPositionMap(folderPath: string, fileName?: string, logger?: Logger): Record<string, number>;
11
12
  export declare function getPositionList(folderPath: string, fileName?: string, logger?: Logger): string[];
12
13
  export declare function getErrorMessage(err: any): string;
14
+ export declare class JsonSchemaValidator {
15
+ private ajv;
16
+ constructor();
17
+ parseAndValidate(schemaStr?: string): JSONSchema4 | undefined;
18
+ }
@@ -5,5 +5,7 @@ export type TIntegrationStrategyParams = {
5
5
  export interface IntegrationStrategy<T = unknown> {
6
6
  meta: TIntegrationProvider;
7
7
  execute(integration: IIntegration<T>, payload: TIntegrationStrategyParams): Promise<any>;
8
- validateConfig?(config: T): Promise<void>;
8
+ validateConfig?(config: T, integration?: IIntegration<T>): Promise<void | {
9
+ webhookUrl: string;
10
+ }>;
9
11
  }
@@ -0,0 +1,8 @@
1
+ export * from './protocol';
2
+ export * from './sandbox';
3
+ export * from './sandbox.decorator';
4
+ export * from './sandbox.interface';
5
+ export * from './sandbox.registry';
6
+ export * from './sandbox.interface';
7
+ export * from './sandbox.decorator';
8
+ export * from './sandbox.registry';