@chatbotkit/sdk 1.21.7 → 1.21.9
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/README.md +1 -2
- package/dist/cjs/index.cjs +21 -18
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/platform/index.cjs +4 -2
- package/dist/cjs/platform/index.d.ts +3 -1
- package/dist/cjs/platform/report/index.cjs +15 -0
- package/dist/cjs/platform/report/index.d.ts +6 -0
- package/dist/cjs/platform/report/v1.cjs +8 -0
- package/dist/cjs/platform/report/v1.d.ts +12 -0
- package/dist/cjs/report/index.cjs +18 -0
- package/dist/cjs/report/index.d.ts +6 -0
- package/dist/cjs/report/v1.cjs +22 -0
- package/dist/cjs/report/v1.d.ts +9 -0
- package/dist/cjs/types/api/v1.d.ts +20788 -0
- package/dist/cjs/types/report.d.ts +284 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/platform/index.d.ts +3 -1
- package/dist/esm/platform/index.js +3 -1
- package/dist/esm/platform/report/index.d.ts +6 -0
- package/dist/esm/platform/report/index.js +11 -0
- package/dist/esm/platform/report/v1.d.ts +12 -0
- package/dist/esm/platform/report/v1.js +5 -0
- package/dist/esm/report/index.d.ts +6 -0
- package/dist/esm/report/index.js +14 -0
- package/dist/esm/report/v1.d.ts +9 -0
- package/dist/esm/report/v1.js +18 -0
- package/dist/esm/types/api/v1.d.ts +20788 -0
- package/dist/esm/types/report.d.ts +284 -0
- package/package.json +142 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated. Do not edit manually.
|
|
3
|
+
* Generated from report registry schemas.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type ReportId = 'clr3m5n8k000008jq7h9e5b1a' | 'clr3m5n8k000108jq3c4d7f2b' | 'clr3m5n8k000208jq8e5f6g3c' | 'clr3m5n8k000308jq1h7i8j4d' | 'clr3m5n8k000408jq9i8j9k5e' | 'clr3m5n8k000508jq2j9k0l6f' | 'clr3m5n8k000608jq3k0l1m7g' | 'clr3m5n8k000708jq4l1m2n8h' | 'clr3m5n8k000808jq5m2n3o9i' | 'clr3m5n8k000908jq6n3o4p0j' | 'clr3m5n8k000a08jq7o4p5q1k' | 'clr3m5n8k000b08jq8p5q6r2l' | 'clr3m5n8k000c08jq9q6r7s3m'
|
|
7
|
+
|
|
8
|
+
export interface ReportMetadata {
|
|
9
|
+
id: string
|
|
10
|
+
name: string
|
|
11
|
+
description: string
|
|
12
|
+
createdAt: string
|
|
13
|
+
updatedAt: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ReportRegistry {
|
|
17
|
+
'clr3m5n8k000008jq7h9e5b1a': {
|
|
18
|
+
name: string
|
|
19
|
+
description: string
|
|
20
|
+
input: TotalRatingsInput
|
|
21
|
+
output: TotalRatingsOutput
|
|
22
|
+
}
|
|
23
|
+
'clr3m5n8k000108jq3c4d7f2b': {
|
|
24
|
+
name: string
|
|
25
|
+
description: string
|
|
26
|
+
input: ThumbsUpInput
|
|
27
|
+
output: ThumbsUpOutput
|
|
28
|
+
}
|
|
29
|
+
'clr3m5n8k000208jq8e5f6g3c': {
|
|
30
|
+
name: string
|
|
31
|
+
description: string
|
|
32
|
+
input: ThumbsDownInput
|
|
33
|
+
output: ThumbsDownOutput
|
|
34
|
+
}
|
|
35
|
+
'clr3m5n8k000308jq1h7i8j4d': {
|
|
36
|
+
name: string
|
|
37
|
+
description: string
|
|
38
|
+
input: TotalContactsInput
|
|
39
|
+
output: TotalContactsOutput
|
|
40
|
+
}
|
|
41
|
+
'clr3m5n8k000408jq9i8j9k5e': {
|
|
42
|
+
name: string
|
|
43
|
+
description: string
|
|
44
|
+
input: ActiveContactsInput
|
|
45
|
+
output: ActiveContactsOutput
|
|
46
|
+
}
|
|
47
|
+
'clr3m5n8k000508jq2j9k0l6f': {
|
|
48
|
+
name: string
|
|
49
|
+
description: string
|
|
50
|
+
input: TotalConversationsInput
|
|
51
|
+
output: TotalConversationsOutput
|
|
52
|
+
}
|
|
53
|
+
'clr3m5n8k000608jq3k0l1m7g': {
|
|
54
|
+
name: string
|
|
55
|
+
description: string
|
|
56
|
+
input: TotalMessagesInput
|
|
57
|
+
output: TotalMessagesOutput
|
|
58
|
+
}
|
|
59
|
+
'clr3m5n8k000708jq4l1m2n8h': {
|
|
60
|
+
name: string
|
|
61
|
+
description: string
|
|
62
|
+
input: UserMessagesInput
|
|
63
|
+
output: UserMessagesOutput
|
|
64
|
+
}
|
|
65
|
+
'clr3m5n8k000808jq5m2n3o9i': {
|
|
66
|
+
name: string
|
|
67
|
+
description: string
|
|
68
|
+
input: BotMessagesInput
|
|
69
|
+
output: BotMessagesOutput
|
|
70
|
+
}
|
|
71
|
+
'clr3m5n8k000908jq6n3o4p0j': {
|
|
72
|
+
name: string
|
|
73
|
+
description: string
|
|
74
|
+
input: ActivityMessagesInput
|
|
75
|
+
output: ActivityMessagesOutput
|
|
76
|
+
}
|
|
77
|
+
'clr3m5n8k000a08jq7o4p5q1k': {
|
|
78
|
+
name: string
|
|
79
|
+
description: string
|
|
80
|
+
input: AverageUserMessagesPerConversationInput
|
|
81
|
+
output: AverageUserMessagesPerConversationOutput
|
|
82
|
+
}
|
|
83
|
+
'clr3m5n8k000b08jq8p5q6r2l': {
|
|
84
|
+
name: string
|
|
85
|
+
description: string
|
|
86
|
+
input: AverageBotMessagesPerConversationInput
|
|
87
|
+
output: AverageBotMessagesPerConversationOutput
|
|
88
|
+
}
|
|
89
|
+
'clr3m5n8k000c08jq9q6r7s3m': {
|
|
90
|
+
name: string
|
|
91
|
+
description: string
|
|
92
|
+
input: AverageActionsPerConversationInput
|
|
93
|
+
output: AverageActionsPerConversationOutput
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Input and Output Types for each report
|
|
98
|
+
export type TotalRatingsInput = {
|
|
99
|
+
userId: string
|
|
100
|
+
periodDays?: number
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type ThumbsUpInput = {
|
|
104
|
+
userId: string
|
|
105
|
+
periodDays?: number
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type ThumbsDownInput = {
|
|
109
|
+
userId: string
|
|
110
|
+
periodDays?: number
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type TotalContactsInput = {
|
|
114
|
+
userId: string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type ActiveContactsInput = {
|
|
118
|
+
userId: string
|
|
119
|
+
periodDays?: number
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type TotalConversationsInput = {
|
|
123
|
+
userId: string
|
|
124
|
+
periodDays?: number
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type TotalMessagesInput = {
|
|
128
|
+
userId: string
|
|
129
|
+
periodDays?: number
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type UserMessagesInput = {
|
|
133
|
+
userId: string
|
|
134
|
+
periodDays?: number
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type BotMessagesInput = {
|
|
138
|
+
userId: string
|
|
139
|
+
periodDays?: number
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type ActivityMessagesInput = {
|
|
143
|
+
userId: string
|
|
144
|
+
periodDays?: number
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type AverageUserMessagesPerConversationInput = {
|
|
148
|
+
userId: string
|
|
149
|
+
periodDays?: number
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export type AverageBotMessagesPerConversationInput = {
|
|
153
|
+
userId: string
|
|
154
|
+
periodDays?: number
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type AverageActionsPerConversationInput = {
|
|
158
|
+
userId: string
|
|
159
|
+
periodDays?: number
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type TotalRatingsOutput = {
|
|
163
|
+
value: number
|
|
164
|
+
change?: number
|
|
165
|
+
period: string
|
|
166
|
+
breakdown?: { date: string; total: number }[]
|
|
167
|
+
thumbsUp?: number
|
|
168
|
+
thumbsDown?: number
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type ThumbsUpOutput = {
|
|
172
|
+
value: number
|
|
173
|
+
change?: number
|
|
174
|
+
period: string
|
|
175
|
+
breakdown?: { date: string; total: number }[]
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export type ThumbsDownOutput = {
|
|
179
|
+
value: number
|
|
180
|
+
change?: number
|
|
181
|
+
period: string
|
|
182
|
+
breakdown?: { date: string; total: number }[]
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type TotalContactsOutput = {
|
|
186
|
+
value: number
|
|
187
|
+
period: string
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type ActiveContactsOutput = {
|
|
191
|
+
value: number
|
|
192
|
+
change?: number
|
|
193
|
+
period: string
|
|
194
|
+
breakdown?: { date: string; total: number }[]
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type TotalConversationsOutput = {
|
|
198
|
+
value: number
|
|
199
|
+
change?: number
|
|
200
|
+
period: string
|
|
201
|
+
breakdown?: { date: string; total: number }[]
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export type TotalMessagesOutput = {
|
|
205
|
+
value: number
|
|
206
|
+
change?: number
|
|
207
|
+
period: string
|
|
208
|
+
breakdown?: { date: string; total: number }[]
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export type UserMessagesOutput = {
|
|
212
|
+
value: number
|
|
213
|
+
change?: number
|
|
214
|
+
period: string
|
|
215
|
+
breakdown?: { date: string; total: number }[]
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export type BotMessagesOutput = {
|
|
219
|
+
value: number
|
|
220
|
+
change?: number
|
|
221
|
+
period: string
|
|
222
|
+
breakdown?: { date: string; total: number }[]
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type ActivityMessagesOutput = {
|
|
226
|
+
value: number
|
|
227
|
+
change?: number
|
|
228
|
+
period: string
|
|
229
|
+
breakdown?: { date: string; total: number }[]
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type AverageUserMessagesPerConversationOutput = {
|
|
233
|
+
value: number
|
|
234
|
+
period: string
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export type AverageBotMessagesPerConversationOutput = {
|
|
238
|
+
value: number
|
|
239
|
+
period: string
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export type AverageActionsPerConversationOutput = {
|
|
243
|
+
value: number
|
|
244
|
+
period: string
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Mapping report IDs to their input/output types
|
|
248
|
+
export type ReportInputTypes = {
|
|
249
|
+
'clr3m5n8k000008jq7h9e5b1a': TotalRatingsInput
|
|
250
|
+
'clr3m5n8k000108jq3c4d7f2b': ThumbsUpInput
|
|
251
|
+
'clr3m5n8k000208jq8e5f6g3c': ThumbsDownInput
|
|
252
|
+
'clr3m5n8k000308jq1h7i8j4d': TotalContactsInput
|
|
253
|
+
'clr3m5n8k000408jq9i8j9k5e': ActiveContactsInput
|
|
254
|
+
'clr3m5n8k000508jq2j9k0l6f': TotalConversationsInput
|
|
255
|
+
'clr3m5n8k000608jq3k0l1m7g': TotalMessagesInput
|
|
256
|
+
'clr3m5n8k000708jq4l1m2n8h': UserMessagesInput
|
|
257
|
+
'clr3m5n8k000808jq5m2n3o9i': BotMessagesInput
|
|
258
|
+
'clr3m5n8k000908jq6n3o4p0j': ActivityMessagesInput
|
|
259
|
+
'clr3m5n8k000a08jq7o4p5q1k': AverageUserMessagesPerConversationInput
|
|
260
|
+
'clr3m5n8k000b08jq8p5q6r2l': AverageBotMessagesPerConversationInput
|
|
261
|
+
'clr3m5n8k000c08jq9q6r7s3m': AverageActionsPerConversationInput
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type ReportOutputTypes = {
|
|
265
|
+
'clr3m5n8k000008jq7h9e5b1a': TotalRatingsOutput
|
|
266
|
+
'clr3m5n8k000108jq3c4d7f2b': ThumbsUpOutput
|
|
267
|
+
'clr3m5n8k000208jq8e5f6g3c': ThumbsDownOutput
|
|
268
|
+
'clr3m5n8k000308jq1h7i8j4d': TotalContactsOutput
|
|
269
|
+
'clr3m5n8k000408jq9i8j9k5e': ActiveContactsOutput
|
|
270
|
+
'clr3m5n8k000508jq2j9k0l6f': TotalConversationsOutput
|
|
271
|
+
'clr3m5n8k000608jq3k0l1m7g': TotalMessagesOutput
|
|
272
|
+
'clr3m5n8k000708jq4l1m2n8h': UserMessagesOutput
|
|
273
|
+
'clr3m5n8k000808jq5m2n3o9i': BotMessagesOutput
|
|
274
|
+
'clr3m5n8k000908jq6n3o4p0j': ActivityMessagesOutput
|
|
275
|
+
'clr3m5n8k000a08jq7o4p5q1k': AverageUserMessagesPerConversationOutput
|
|
276
|
+
'clr3m5n8k000b08jq8p5q6r2l': AverageBotMessagesPerConversationOutput
|
|
277
|
+
'clr3m5n8k000c08jq9q6r7s3m': AverageActionsPerConversationOutput
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Helper type to get input type by report ID
|
|
281
|
+
export type GetReportInput<T extends ReportId> = ReportInputTypes[T]
|
|
282
|
+
|
|
283
|
+
// Helper type to get output type by report ID
|
|
284
|
+
export type GetReportOutput<T extends ReportId> = ReportOutputTypes[T]
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export class ChatBotKit extends ChatBotKitClient {
|
|
|
18
18
|
memory: MemoryClient;
|
|
19
19
|
policy: PolicyClient;
|
|
20
20
|
portal: PortalClient;
|
|
21
|
+
report: ReportClient;
|
|
21
22
|
usage: UsageClient;
|
|
22
23
|
graphql: GraphqlClient;
|
|
23
24
|
}
|
|
@@ -38,10 +39,11 @@ import { TeamClient } from './team/index.js';
|
|
|
38
39
|
import { MemoryClient } from './memory/index.js';
|
|
39
40
|
import { PolicyClient } from './policy/index.js';
|
|
40
41
|
import { PortalClient } from './portal/index.js';
|
|
42
|
+
import { ReportClient } from './report/index.js';
|
|
41
43
|
import { GraphqlClient } from './graphql/index.js';
|
|
42
44
|
import { SpaceClient } from './space/index.js';
|
|
43
45
|
import { UsageClient } from './usage/index.js';
|
|
44
46
|
import { ChatBotKitClient } from './client.js';
|
|
45
47
|
import { PlatformClient } from './platform/index.js';
|
|
46
48
|
import { TaskClient } from './task/index.js';
|
|
47
|
-
export { BlueprintClient, BotClient, ChannelClient, FileClient, MagicClient, PartnerClient, DatasetClient, SkillsetClient, IntegrationClient, ConversationClient, ContactClient, SecretClient, TeamClient, MemoryClient, PolicyClient, PortalClient, GraphqlClient, SpaceClient, UsageClient };
|
|
49
|
+
export { BlueprintClient, BotClient, ChannelClient, FileClient, MagicClient, PartnerClient, DatasetClient, SkillsetClient, IntegrationClient, ConversationClient, ContactClient, SecretClient, TeamClient, MemoryClient, PolicyClient, PortalClient, ReportClient, GraphqlClient, SpaceClient, UsageClient };
|
package/dist/esm/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { PartnerClient } from './partner/index.js';
|
|
|
14
14
|
import { PlatformClient } from './platform/index.js';
|
|
15
15
|
import { PolicyClient } from './policy/index.js';
|
|
16
16
|
import { PortalClient } from './portal/index.js';
|
|
17
|
+
import { ReportClient } from './report/index.js';
|
|
17
18
|
import { SecretClient } from './secret/index.js';
|
|
18
19
|
import { SkillsetClient } from './skillset/index.js';
|
|
19
20
|
import { SpaceClient } from './space/index.js';
|
|
@@ -36,6 +37,7 @@ export { TeamClient };
|
|
|
36
37
|
export { MemoryClient };
|
|
37
38
|
export { PolicyClient };
|
|
38
39
|
export { PortalClient };
|
|
40
|
+
export { ReportClient };
|
|
39
41
|
export { GraphqlClient };
|
|
40
42
|
export { SpaceClient };
|
|
41
43
|
export { UsageClient };
|
|
@@ -61,6 +63,7 @@ export class ChatBotKit extends ChatBotKitClient {
|
|
|
61
63
|
this.memory = new MemoryClient(options);
|
|
62
64
|
this.policy = new PolicyClient(options);
|
|
63
65
|
this.portal = new PortalClient(options);
|
|
66
|
+
this.report = new ReportClient(options);
|
|
64
67
|
this.usage = new UsageClient(options);
|
|
65
68
|
this.graphql = new GraphqlClient(options);
|
|
66
69
|
}
|
|
@@ -3,8 +3,9 @@ export class PlatformClient extends ChatBotKitClient {
|
|
|
3
3
|
ability: PlatformAbilityClient;
|
|
4
4
|
action: PlatformActionClient;
|
|
5
5
|
content: PlatformContentClient;
|
|
6
|
-
|
|
6
|
+
secret: PlatformSecretClient;
|
|
7
7
|
example: PlatformExampleClient;
|
|
8
|
+
report: PlatformReportClient;
|
|
8
9
|
}
|
|
9
10
|
export default PlatformClient;
|
|
10
11
|
import { ChatBotKitClient } from '../client.js';
|
|
@@ -14,3 +15,4 @@ import { PlatformActionClient } from './action/index.js';
|
|
|
14
15
|
import { PlatformContentClient } from './content/index.js';
|
|
15
16
|
import { PlatformSecretClient } from './secret/index.js';
|
|
16
17
|
import { PlatformExampleClient } from './example/index.js';
|
|
18
|
+
import { PlatformReportClient } from './report/index.js';
|
|
@@ -4,6 +4,7 @@ import { PlatformActionClient } from './action/index.js';
|
|
|
4
4
|
import { PlatformContentClient } from './content/index.js';
|
|
5
5
|
import { PlatformExampleClient } from './example/index.js';
|
|
6
6
|
import { PlatformModelClient } from './model/index.js';
|
|
7
|
+
import { PlatformReportClient } from './report/index.js';
|
|
7
8
|
import { PlatformSecretClient } from './secret/index.js';
|
|
8
9
|
export class PlatformClient extends ChatBotKitClient {
|
|
9
10
|
constructor(options) {
|
|
@@ -12,8 +13,9 @@ export class PlatformClient extends ChatBotKitClient {
|
|
|
12
13
|
this.ability = new PlatformAbilityClient(options);
|
|
13
14
|
this.action = new PlatformActionClient(options);
|
|
14
15
|
this.content = new PlatformContentClient(options);
|
|
15
|
-
this.
|
|
16
|
+
this.secret = new PlatformSecretClient(options);
|
|
16
17
|
this.example = new PlatformExampleClient(options);
|
|
18
|
+
this.report = new PlatformReportClient(options);
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
export default PlatformClient;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class PlatformReportClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").PlatformReportListRequest): ResponsePromise<import("./v1.js").PlatformReportListResponse, import("./v1.js").PlatformReportListStreamType>;
|
|
3
|
+
}
|
|
4
|
+
export default PlatformReportClient;
|
|
5
|
+
export type ResponsePromise<T, U> = import("../../client.js").ResponsePromise<T, U>;
|
|
6
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
2
|
+
import { listPlatformReports } from './v1.js';
|
|
3
|
+
export class PlatformReportClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listPlatformReports(this, request);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export default PlatformReportClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function listPlatformReports(client: ChatBotKitClient, request?: PlatformReportListRequest): ResponsePromise<PlatformReportListResponse, PlatformReportListStreamType>;
|
|
2
|
+
export type ChatBotKitClient = import("../../client.js").ChatBotKitClient;
|
|
3
|
+
export type ResponsePromise<T, U> = import("../../client.js").ResponsePromise<T, U>;
|
|
4
|
+
export type PlatformReportListRequest = {
|
|
5
|
+
cursor?: string;
|
|
6
|
+
order?: "desc" | "asc";
|
|
7
|
+
take?: number;
|
|
8
|
+
meta?: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
export type PlatformReportListResponse = import("../../types/api/v1.js").operations["listPlatformReports"]["responses"]["200"]["content"]["application/json"];
|
|
11
|
+
export type PlatformReportListItem = PlatformReportListResponse["items"][number];
|
|
12
|
+
export type PlatformReportListStreamType = import("../../types/api/v1.js").operations["listPlatformReports"]["responses"]["200"]["content"]["application/jsonl"];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class ReportClient extends ChatBotKitClient {
|
|
2
|
+
fetch(reportId: string, request: import("./v1.js").ReportFetchRequest): Promise<import("./v1.js").ReportFetchResponse>;
|
|
3
|
+
fetchTyped<T extends import("./v1.js").ReportId>(reportId: T, request: import("./v1.js").ReportInputTypes[T]): Promise<import("./v1.js").ReportOutputTypes[T]>;
|
|
4
|
+
}
|
|
5
|
+
export default ReportClient;
|
|
6
|
+
import { ChatBotKitClient } from '../client.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../client.js';
|
|
2
|
+
import { fetchReport, fetchTypedReport } from './v1.js';
|
|
3
|
+
export class ReportClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
fetch(reportId, request) {
|
|
8
|
+
return fetchReport(this, reportId, request);
|
|
9
|
+
}
|
|
10
|
+
fetchTyped(reportId, request) {
|
|
11
|
+
return fetchTypedReport(this, reportId, request);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export default ReportClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function fetchReport(client: ChatBotKitClient, reportId: string, request: ReportFetchRequest): Promise<ReportFetchResponse>;
|
|
2
|
+
export function fetchTypedReport<T extends ReportId>(client: ChatBotKitClient, reportId: T, request: ReportInputTypes[T]): Promise<ReportOutputTypes[T]>;
|
|
3
|
+
export type ChatBotKitClient = import("../client.js").ChatBotKitClient;
|
|
4
|
+
export type ReportFetchRequestBody = import("../types/api/v1.js").operations["fetchReport"]["requestBody"]["content"]["application/json"];
|
|
5
|
+
export type ReportFetchRequest = ReportFetchRequestBody;
|
|
6
|
+
export type ReportFetchResponse = import("../types/api/v1.js").operations["fetchReport"]["responses"]["200"]["content"]["application/json"];
|
|
7
|
+
export type ReportId = import("../types/report.js").ReportId;
|
|
8
|
+
export type ReportInputTypes = import("../types/report.js").ReportInputTypes;
|
|
9
|
+
export type ReportOutputTypes = import("../types/report.js").ReportOutputTypes;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export async function fetchReport(client, reportId, request) {
|
|
2
|
+
const url = `/api/v1/report/${reportId}/fetch`;
|
|
3
|
+
const response = await client.clientFetch(url, {
|
|
4
|
+
record: {
|
|
5
|
+
...request,
|
|
6
|
+
},
|
|
7
|
+
});
|
|
8
|
+
return response;
|
|
9
|
+
}
|
|
10
|
+
export async function fetchTypedReport(client, reportId, request) {
|
|
11
|
+
const url = `/api/v1/report/${reportId}/fetch`;
|
|
12
|
+
const response = await client.clientFetch(url, {
|
|
13
|
+
record: {
|
|
14
|
+
...request,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
return response;
|
|
18
|
+
}
|