@botpress/sdk 4.6.0 → 4.6.1
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.
|
@@ -20,7 +20,3 @@ export type MessageTags<TIntegration extends common.BaseIntegration> = keyof uti
|
|
|
20
20
|
[TChannelName in keyof TIntegration['channels']]: TIntegration['channels'][TChannelName]['message']['tags'];
|
|
21
21
|
}>>;
|
|
22
22
|
export type TagsOfMessage<TIntegration extends common.BaseIntegration, TMessageName extends keyof EnumerateMessages<TIntegration>> = keyof utils.UnionToIntersection<GetMessageByName<TIntegration, TMessageName>['tags']>;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Integration's should no longer use their name as prefix for event types or tags.
|
|
25
|
-
*/
|
|
26
|
-
export type WithPrefix<TTags extends string, TPrefix extends string> = string extends TTags ? string : utils.Join<[TPrefix, ':', TTags]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as client from '@botpress/client';
|
|
2
2
|
import * as utils from '../../utils/type-utils';
|
|
3
3
|
import * as common from '../common';
|
|
4
|
-
import { EnumerateMessages, ConversationTags, GetChannelByName, GetMessageByName, MessageTags,
|
|
4
|
+
import { EnumerateMessages, ConversationTags, GetChannelByName, GetMessageByName, MessageTags, TagsOfMessage } from './sub-types';
|
|
5
5
|
type Arg<F extends (...args: any[]) => any> = Parameters<F>[number];
|
|
6
6
|
type Res<F extends (...args: any[]) => any> = ReturnType<F>;
|
|
7
7
|
type ConversationResponse<TIntegration extends common.BaseIntegration, ChannelName extends keyof TIntegration['channels'] = keyof TIntegration['channels']> = {
|
|
@@ -34,7 +34,7 @@ export type GetParticipant<_TIntegration extends common.BaseIntegration> = clien
|
|
|
34
34
|
export type RemoveParticipant<_TIntegration extends common.BaseIntegration> = client.Client['removeParticipant'];
|
|
35
35
|
type EventResponse<TIntegration extends common.BaseIntegration, TEvent extends keyof TIntegration['events']> = {
|
|
36
36
|
event: utils.Merge<Awaited<Res<client.Client['getEvent']>>['event'], {
|
|
37
|
-
type:
|
|
37
|
+
type: utils.Cast<TEvent, string>;
|
|
38
38
|
payload: TIntegration['events'][TEvent];
|
|
39
39
|
}>;
|
|
40
40
|
};
|