@botpress/sdk 6.9.0 → 6.9.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.
- package/.turbo/turbo-build.log +5 -5
- package/dist/common/types.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/integration/client/sub-types.d.ts +1 -2
- package/dist/integration/client/types.d.ts +11 -11
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { commonTypes } from '../../common';
|
|
2
1
|
import * as utils from '../../utils/type-utils';
|
|
3
2
|
import * as common from '../common';
|
|
4
3
|
export type EnumerateMessages<TIntegration extends common.BaseIntegration> = utils.UnionToIntersection<utils.ValueOf<{
|
|
@@ -24,5 +23,5 @@ export type ConversationTags<TIntegration extends common.BaseIntegration> = keyo
|
|
|
24
23
|
export type MessageTags<TIntegration extends common.BaseIntegration> = keyof utils.UnionToIntersection<utils.ValueOf<{
|
|
25
24
|
[TChannelName in keyof TIntegration['channels']]: TIntegration['channels'][TChannelName]['message']['tags'];
|
|
26
25
|
}>>;
|
|
27
|
-
export type UserTags<TIntegration extends common.BaseIntegration> =
|
|
26
|
+
export type UserTags<TIntegration extends common.BaseIntegration> = keyof TIntegration['user']['tags'];
|
|
28
27
|
export type TagsOfMessage<TIntegration extends common.BaseIntegration, TMessageName extends keyof EnumerateMessages<TIntegration>> = keyof utils.UnionToIntersection<GetMessageByName<TIntegration, TMessageName>['tags']>;
|
|
@@ -32,11 +32,11 @@ export type ListConversations<TIntegration extends common.BaseIntegration> = <Ch
|
|
|
32
32
|
}>) => Res<client.Client['listConversations']>;
|
|
33
33
|
export type GetOrCreateConversation<TIntegration extends common.BaseIntegration> = <ChannelName extends keyof TIntegration['channels'], TTags extends keyof GetChannelByName<TIntegration, ChannelName>['conversation']['tags']>(x: utils.Merge<Arg<client.Client['getOrCreateConversation']>, {
|
|
34
34
|
channel: utils.Cast<ChannelName, string>;
|
|
35
|
-
tags: commonTypes.
|
|
35
|
+
tags: commonTypes.ToNullableTags<TTags>;
|
|
36
36
|
discriminateByTags?: NoInfer<utils.Cast<TTags[], string[]>>;
|
|
37
37
|
}>) => Promise<GetOrCreateConversationResponse<TIntegration, ChannelName>>;
|
|
38
38
|
export type UpdateConversation<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['updateConversation']>, {
|
|
39
|
-
tags?: commonTypes.
|
|
39
|
+
tags?: commonTypes.ToNullableTags<ConversationTags<TIntegration>>;
|
|
40
40
|
}>) => Promise<ConversationResponse<TIntegration>>;
|
|
41
41
|
export type DeleteConversation<_TIntegration extends common.BaseIntegration> = client.Client['deleteConversation'];
|
|
42
42
|
export type ListParticipants<_TIntegration extends common.BaseIntegration> = client.Client['listParticipants'];
|
|
@@ -73,12 +73,12 @@ type GetOrCreateMessageResponse<TIntegration extends common.BaseIntegration, TMe
|
|
|
73
73
|
export type GetOrCreateMessage<TIntegration extends common.BaseIntegration> = <TMessage extends keyof EnumerateMessages<TIntegration>, TTags extends keyof GetMessageByName<TIntegration, TMessage>['tags']>(x: utils.Merge<Arg<client.Client['getOrCreateMessage']>, {
|
|
74
74
|
type: utils.Cast<TMessage, string>;
|
|
75
75
|
payload?: GetMessageByName<TIntegration, TMessage>['payload'];
|
|
76
|
-
tags: commonTypes.
|
|
76
|
+
tags: commonTypes.ToNullableTags<TTags>;
|
|
77
77
|
discriminateByTags?: NoInfer<utils.Cast<TTags[], string[]>>;
|
|
78
78
|
}>) => Promise<GetOrCreateMessageResponse<TIntegration, TMessage>>;
|
|
79
79
|
export type GetMessage<TIntegration extends common.BaseIntegration> = (x: Arg<client.Client['getMessage']>) => Promise<MessageResponse<TIntegration>>;
|
|
80
80
|
export type UpdateMessage<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['updateMessage']>, {
|
|
81
|
-
tags
|
|
81
|
+
tags?: commonTypes.ToNullableTags<MessageTags<TIntegration>>;
|
|
82
82
|
}>) => Promise<MessageResponse<TIntegration>>;
|
|
83
83
|
export type ListMessages<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['listMessages']>, {
|
|
84
84
|
tags?: commonTypes.ToTags<MessageTags<TIntegration>>;
|
|
@@ -86,32 +86,32 @@ export type ListMessages<TIntegration extends common.BaseIntegration> = (x: util
|
|
|
86
86
|
export type DeleteMessage<_TIntegration extends common.BaseIntegration> = client.Client['deleteMessage'];
|
|
87
87
|
type UserResponse<TIntegration extends common.BaseIntegration> = {
|
|
88
88
|
user: utils.Merge<Awaited<Res<client.Client['getUser']>>['user'], {
|
|
89
|
-
tags: UserTags<TIntegration
|
|
89
|
+
tags: commonTypes.ToTags<UserTags<TIntegration>>;
|
|
90
90
|
}>;
|
|
91
91
|
};
|
|
92
92
|
export type CreateUser<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['createUser']>, {
|
|
93
|
-
tags: UserTags<TIntegration
|
|
93
|
+
tags: commonTypes.ToTags<UserTags<TIntegration>>;
|
|
94
94
|
}>) => Promise<UserResponse<TIntegration>>;
|
|
95
95
|
export type GetUser<TIntegration extends common.BaseIntegration> = (x: Arg<client.Client['getUser']>) => Promise<UserResponse<TIntegration>>;
|
|
96
96
|
export type ListUsers<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['listUsers']>, {
|
|
97
|
-
tags?: UserTags<TIntegration
|
|
97
|
+
tags?: commonTypes.ToTags<UserTags<TIntegration>>;
|
|
98
98
|
}>) => Res<client.Client['listUsers']>;
|
|
99
99
|
type GetOrCreateUserResponse<TIntegration extends common.BaseIntegration> = utils.Merge<Awaited<Res<client.Client['getOrCreateUser']>>, {
|
|
100
100
|
user: utils.Merge<Awaited<Res<client.Client['getOrCreateUser']>>['user'], {
|
|
101
|
-
tags: UserTags<TIntegration
|
|
101
|
+
tags: commonTypes.ToTags<UserTags<TIntegration>>;
|
|
102
102
|
}>;
|
|
103
103
|
}>;
|
|
104
104
|
export type GetOrCreateUser<TIntegration extends common.BaseIntegration> = <TTags extends keyof TIntegration['user']['tags']>(x: utils.Merge<Arg<client.Client['getOrCreateUser']>, {
|
|
105
|
-
tags: commonTypes.
|
|
105
|
+
tags: commonTypes.ToNullableTags<TTags>;
|
|
106
106
|
discriminateByTags?: NoInfer<utils.Cast<TTags[], string[]>>;
|
|
107
107
|
}>) => Promise<GetOrCreateUserResponse<TIntegration>>;
|
|
108
108
|
export type UpdateUser<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['updateUser']>, {
|
|
109
|
-
tags?: UserTags<TIntegration
|
|
109
|
+
tags?: commonTypes.ToNullableTags<UserTags<TIntegration>>;
|
|
110
110
|
}>) => Promise<UserResponse<TIntegration>>;
|
|
111
111
|
export type DeleteUser<_TIntegration extends common.BaseIntegration> = client.Client['deleteUser'];
|
|
112
112
|
export type InitializeIncomingMessage<TIntegration extends common.BaseIntegration> = (x: utils.Merge<Arg<client.Client['initializeIncomingMessage']>, {
|
|
113
113
|
user?: utils.Merge<NonNullable<Arg<client.Client['initializeIncomingMessage']>['user']>, {
|
|
114
|
-
tags: UserTags<TIntegration
|
|
114
|
+
tags: commonTypes.ToTags<UserTags<TIntegration>>;
|
|
115
115
|
}>;
|
|
116
116
|
conversation?: utils.Merge<NonNullable<Arg<client.Client['initializeIncomingMessage']>['conversation']>, {
|
|
117
117
|
tags: commonTypes.ToTags<ConversationTags<TIntegration>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/sdk",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.1",
|
|
4
4
|
"description": "Botpress SDK",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@botpress/client": "1.
|
|
23
|
+
"@botpress/client": "1.44.0",
|
|
24
24
|
"browser-or-node": "^2.1.1",
|
|
25
25
|
"semver": "^7.3.8"
|
|
26
26
|
},
|