@botpress/client 0.18.0 → 0.19.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,4 +1,5 @@
1
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
1
+ import { AxiosInstance } from 'axios';
2
+ import { toAxiosRequest } from './to-axios';
2
3
  import * as createConversation from './operations/createConversation';
3
4
  import * as getConversation from './operations/getConversation';
4
5
  import * as listConversations from './operations/listConversations';
@@ -56,6 +57,7 @@ import * as deleteBot from './operations/deleteBot';
56
57
  import * as getBotLogs from './operations/getBotLogs';
57
58
  import * as getBotWebchat from './operations/getBotWebchat';
58
59
  import * as getBotAnalytics from './operations/getBotAnalytics';
60
+ import * as getBotIssue from './operations/getBotIssue';
59
61
  import * as listBotIssues from './operations/listBotIssues';
60
62
  import * as deleteBotIssue from './operations/deleteBotIssue';
61
63
  import * as listBotIssueEvents from './operations/listBotIssueEvents';
@@ -174,6 +176,7 @@ export * as deleteBot from './operations/deleteBot';
174
176
  export * as getBotLogs from './operations/getBotLogs';
175
177
  export * as getBotWebchat from './operations/getBotWebchat';
176
178
  export * as getBotAnalytics from './operations/getBotAnalytics';
179
+ export * as getBotIssue from './operations/getBotIssue';
177
180
  export * as listBotIssues from './operations/listBotIssues';
178
181
  export * as deleteBotIssue from './operations/deleteBotIssue';
179
182
  export * as listBotIssueEvents from './operations/listBotIssueEvents';
@@ -234,9 +237,13 @@ export * as createTableRows from './operations/createTableRows';
234
237
  export * as deleteTableRows from './operations/deleteTableRows';
235
238
  export * as updateTableRows from './operations/updateTableRows';
236
239
  export * as upsertTableRows from './operations/upsertTableRows';
240
+ export type ClientProps = {
241
+ toAxiosRequest: typeof toAxiosRequest;
242
+ };
237
243
  export declare class Client {
238
244
  private axiosInstance;
239
- constructor(axiosInstance: AxiosInstance);
245
+ private props;
246
+ constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps>);
240
247
  readonly createConversation: (input: createConversation.CreateConversationInput) => Promise<createConversation.CreateConversationResponse>;
241
248
  readonly getConversation: (input: getConversation.GetConversationInput) => Promise<getConversation.GetConversationResponse>;
242
249
  readonly listConversations: (input: listConversations.ListConversationsInput) => Promise<listConversations.ListConversationsResponse>;
@@ -294,6 +301,7 @@ export declare class Client {
294
301
  readonly getBotLogs: (input: getBotLogs.GetBotLogsInput) => Promise<getBotLogs.GetBotLogsResponse>;
295
302
  readonly getBotWebchat: (input: getBotWebchat.GetBotWebchatInput) => Promise<getBotWebchat.GetBotWebchatResponse>;
296
303
  readonly getBotAnalytics: (input: getBotAnalytics.GetBotAnalyticsInput) => Promise<getBotAnalytics.GetBotAnalyticsResponse>;
304
+ readonly getBotIssue: (input: getBotIssue.GetBotIssueInput) => Promise<getBotIssue.GetBotIssueResponse>;
297
305
  readonly listBotIssues: (input: listBotIssues.ListBotIssuesInput) => Promise<listBotIssues.ListBotIssuesResponse>;
298
306
  readonly deleteBotIssue: (input: deleteBotIssue.DeleteBotIssueInput) => Promise<deleteBotIssue.DeleteBotIssueResponse>;
299
307
  readonly listBotIssueEvents: (input: listBotIssueEvents.ListBotIssueEventsInput) => Promise<listBotIssueEvents.ListBotIssueEventsResponse>;
@@ -355,18 +363,3 @@ export declare class Client {
355
363
  readonly updateTableRows: (input: updateTableRows.UpdateTableRowsInput) => Promise<updateTableRows.UpdateTableRowsResponse>;
356
364
  readonly upsertTableRows: (input: upsertTableRows.UpsertTableRowsInput) => Promise<upsertTableRows.UpsertTableRowsResponse>;
357
365
  }
358
- type Primitive = string | number | boolean;
359
- type Value<P extends Primitive> = P | P[] | Record<string, P>;
360
- type QueryValue = Value<string> | Value<boolean> | Value<number> | undefined;
361
- type AnyQueryParams = Record<string, QueryValue>;
362
- type HeaderValue = string | undefined;
363
- type AnyHeaderParams = Record<string, HeaderValue>;
364
- type AnyBodyParams = Record<string, any>;
365
- type ParsedRequest = {
366
- method: string;
367
- path: string;
368
- query: AnyQueryParams;
369
- headers: AnyHeaderParams;
370
- body: AnyBodyParams;
371
- };
372
- export declare const toAxiosRequest: (req: ParsedRequest) => AxiosRequestConfig;
@@ -566,7 +566,6 @@ export interface Workspace {
566
566
  createdAt: string;
567
567
  updatedAt: string;
568
568
  botCount: number;
569
- accountType: "free" | "premium";
570
569
  billingVersion: "v1" | "v2";
571
570
  plan: "community" | "team" | "enterprise";
572
571
  blocked: boolean;
@@ -1144,17 +1143,17 @@ export interface File {
1144
1143
  */
1145
1144
  index: boolean;
1146
1145
  /**
1147
- * Status of the file. If the status is "UPLOAD_PENDING", the file content has not been uploaded yet. The status will be set to "UPLOAD_COMPLETED" once the file content has been uploaded successfully.
1146
+ * Status of the file. If the status is "upload_pending", the file content has not been uploaded yet. The status will be set to "upload_completed" once the file content has been uploaded successfully.
1148
1147
  *
1149
- * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "UPLOAD_FAILED" and the reason for the failure will be available in the `failedStatusReason` field of the file.
1148
+ * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "upload_failed" and the reason for the failure will be available in the `failedStatusReason` field of the file.
1150
1149
  *
1151
- * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "INDEXING_PENDING" status (the "UPLOAD_COMPLETED" status step will be skipped).
1150
+ * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "indexing_pending" status (the "upload_completed" status step will be skipped).
1152
1151
  *
1153
- * Once the indexing is completed and the file is ready to be used for searching its status will be set to "INDEXING_COMPLETED". If the indexing failed the status will be set to "INDEXING_FAILED" and the reason for the failure will be available in the `failedStatusReason` field.
1152
+ * Once the indexing is completed and the file is ready to be used for searching its status will be set to "indexing_completed". If the indexing failed the status will be set to "indexing_failed" and the reason for the failure will be available in the `failedStatusReason` field.
1154
1153
  */
1155
- status: "UPLOAD_PENDING" | "UPLOAD_FAILED" | "UPLOAD_COMPLETED" | "INDEXING_PENDING" | "INDEXING_FAILED" | "INDEXING_COMPLETED";
1154
+ status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
1156
1155
  /**
1157
- * If the file status is "UPLOAD_FAILED" or "INDEXING_FAILED" this will contain the reason of the failure.
1156
+ * If the file status is "upload_failed" or "indexing_failed" this will contain the reason of the failure.
1158
1157
  */
1159
1158
  failedStatusReason?: string;
1160
1159
  }
@@ -87,17 +87,17 @@ export interface CreateFileResponse {
87
87
  */
88
88
  index: boolean;
89
89
  /**
90
- * Status of the file. If the status is "UPLOAD_PENDING", the file content has not been uploaded yet. The status will be set to "UPLOAD_COMPLETED" once the file content has been uploaded successfully.
90
+ * Status of the file. If the status is "upload_pending", the file content has not been uploaded yet. The status will be set to "upload_completed" once the file content has been uploaded successfully.
91
91
  *
92
- * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "UPLOAD_FAILED" and the reason for the failure will be available in the `failedStatusReason` field of the file.
92
+ * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "upload_failed" and the reason for the failure will be available in the `failedStatusReason` field of the file.
93
93
  *
94
- * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "INDEXING_PENDING" status (the "UPLOAD_COMPLETED" status step will be skipped).
94
+ * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "indexing_pending" status (the "upload_completed" status step will be skipped).
95
95
  *
96
- * Once the indexing is completed and the file is ready to be used for searching its status will be set to "INDEXING_COMPLETED". If the indexing failed the status will be set to "INDEXING_FAILED" and the reason for the failure will be available in the `failedStatusReason` field.
96
+ * Once the indexing is completed and the file is ready to be used for searching its status will be set to "indexing_completed". If the indexing failed the status will be set to "indexing_failed" and the reason for the failure will be available in the `failedStatusReason` field.
97
97
  */
98
- status: "UPLOAD_PENDING" | "UPLOAD_FAILED" | "UPLOAD_COMPLETED" | "INDEXING_PENDING" | "INDEXING_FAILED" | "INDEXING_COMPLETED";
98
+ status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
99
99
  /**
100
- * If the file status is "UPLOAD_FAILED" or "INDEXING_FAILED" this will contain the reason of the failure.
100
+ * If the file status is "upload_failed" or "indexing_failed" this will contain the reason of the failure.
101
101
  */
102
102
  failedStatusReason?: string;
103
103
  /**
@@ -24,7 +24,6 @@ export interface CreateWorkspaceResponse {
24
24
  createdAt: string;
25
25
  updatedAt: string;
26
26
  botCount: number;
27
- accountType: "free" | "premium";
28
27
  billingVersion: "v1" | "v2";
29
28
  plan: "community" | "team" | "enterprise";
30
29
  blocked: boolean;
@@ -0,0 +1,39 @@
1
+ export interface GetBotIssueRequestHeaders {
2
+ }
3
+ export interface GetBotIssueRequestQuery {
4
+ }
5
+ export interface GetBotIssueRequestParams {
6
+ id: string;
7
+ issueId: string;
8
+ }
9
+ export interface GetBotIssueRequestBody {
10
+ }
11
+ export type GetBotIssueInput = GetBotIssueRequestBody & GetBotIssueRequestHeaders & GetBotIssueRequestQuery & GetBotIssueRequestParams;
12
+ export type GetBotIssueRequest = {
13
+ headers: GetBotIssueRequestHeaders;
14
+ query: GetBotIssueRequestQuery;
15
+ params: GetBotIssueRequestParams;
16
+ body: GetBotIssueRequestBody;
17
+ };
18
+ export declare const parseReq: (input: GetBotIssueInput) => GetBotIssueRequest & {
19
+ path: string;
20
+ };
21
+ export interface GetBotIssueResponse {
22
+ issue: {
23
+ id: string;
24
+ code: string;
25
+ createdAt: string;
26
+ lastSeenAt: string;
27
+ title: string;
28
+ description: string;
29
+ groupedData: {
30
+ [k: string]: {
31
+ raw: string;
32
+ pretty?: string;
33
+ };
34
+ };
35
+ eventsCount: number;
36
+ category: "user_code" | "limits" | "configuration" | "other";
37
+ resolutionLink: string | null;
38
+ };
39
+ }
@@ -68,17 +68,17 @@ export interface GetFileResponse {
68
68
  */
69
69
  index: boolean;
70
70
  /**
71
- * Status of the file. If the status is "UPLOAD_PENDING", the file content has not been uploaded yet. The status will be set to "UPLOAD_COMPLETED" once the file content has been uploaded successfully.
71
+ * Status of the file. If the status is "upload_pending", the file content has not been uploaded yet. The status will be set to "upload_completed" once the file content has been uploaded successfully.
72
72
  *
73
- * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "UPLOAD_FAILED" and the reason for the failure will be available in the `failedStatusReason` field of the file.
73
+ * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "upload_failed" and the reason for the failure will be available in the `failedStatusReason` field of the file.
74
74
  *
75
- * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "INDEXING_PENDING" status (the "UPLOAD_COMPLETED" status step will be skipped).
75
+ * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "indexing_pending" status (the "upload_completed" status step will be skipped).
76
76
  *
77
- * Once the indexing is completed and the file is ready to be used for searching its status will be set to "INDEXING_COMPLETED". If the indexing failed the status will be set to "INDEXING_FAILED" and the reason for the failure will be available in the `failedStatusReason` field.
77
+ * Once the indexing is completed and the file is ready to be used for searching its status will be set to "indexing_completed". If the indexing failed the status will be set to "indexing_failed" and the reason for the failure will be available in the `failedStatusReason` field.
78
78
  */
79
- status: "UPLOAD_PENDING" | "UPLOAD_FAILED" | "UPLOAD_COMPLETED" | "INDEXING_PENDING" | "INDEXING_FAILED" | "INDEXING_COMPLETED";
79
+ status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
80
80
  /**
81
- * If the file status is "UPLOAD_FAILED" or "INDEXING_FAILED" this will contain the reason of the failure.
81
+ * If the file status is "upload_failed" or "indexing_failed" this will contain the reason of the failure.
82
82
  */
83
83
  failedStatusReason?: string;
84
84
  };
@@ -24,7 +24,6 @@ export interface GetWorkspaceResponse {
24
24
  createdAt: string;
25
25
  updatedAt: string;
26
26
  botCount: number;
27
- accountType: "free" | "premium";
28
27
  billingVersion: "v1" | "v2";
29
28
  plan: "community" | "team" | "enterprise";
30
29
  blocked: boolean;
@@ -71,17 +71,17 @@ export interface ListFilesResponse {
71
71
  */
72
72
  index: boolean;
73
73
  /**
74
- * Status of the file. If the status is "UPLOAD_PENDING", the file content has not been uploaded yet. The status will be set to "UPLOAD_COMPLETED" once the file content has been uploaded successfully.
74
+ * Status of the file. If the status is "upload_pending", the file content has not been uploaded yet. The status will be set to "upload_completed" once the file content has been uploaded successfully.
75
75
  *
76
- * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "UPLOAD_FAILED" and the reason for the failure will be available in the `failedStatusReason` field of the file.
76
+ * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "upload_failed" and the reason for the failure will be available in the `failedStatusReason` field of the file.
77
77
  *
78
- * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "INDEXING_PENDING" status (the "UPLOAD_COMPLETED" status step will be skipped).
78
+ * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "indexing_pending" status (the "upload_completed" status step will be skipped).
79
79
  *
80
- * Once the indexing is completed and the file is ready to be used for searching its status will be set to "INDEXING_COMPLETED". If the indexing failed the status will be set to "INDEXING_FAILED" and the reason for the failure will be available in the `failedStatusReason` field.
80
+ * Once the indexing is completed and the file is ready to be used for searching its status will be set to "indexing_completed". If the indexing failed the status will be set to "indexing_failed" and the reason for the failure will be available in the `failedStatusReason` field.
81
81
  */
82
- status: "UPLOAD_PENDING" | "UPLOAD_FAILED" | "UPLOAD_COMPLETED" | "INDEXING_PENDING" | "INDEXING_FAILED" | "INDEXING_COMPLETED";
82
+ status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
83
83
  /**
84
- * If the file status is "UPLOAD_FAILED" or "INDEXING_FAILED" this will contain the reason of the failure.
84
+ * If the file status is "upload_failed" or "indexing_failed" this will contain the reason of the failure.
85
85
  */
86
86
  failedStatusReason?: string;
87
87
  }[];
@@ -33,7 +33,6 @@ export interface UpdateWorkspaceResponse {
33
33
  createdAt: string;
34
34
  updatedAt: string;
35
35
  botCount: number;
36
- accountType: "free" | "premium";
37
36
  billingVersion: "v1" | "v2";
38
37
  plan: "community" | "team" | "enterprise";
39
38
  blocked: boolean;
@@ -78,17 +78,17 @@ export interface UpdateFileResponse {
78
78
  */
79
79
  index: boolean;
80
80
  /**
81
- * Status of the file. If the status is "UPLOAD_PENDING", the file content has not been uploaded yet. The status will be set to "UPLOAD_COMPLETED" once the file content has been uploaded successfully.
81
+ * Status of the file. If the status is "upload_pending", the file content has not been uploaded yet. The status will be set to "upload_completed" once the file content has been uploaded successfully.
82
82
  *
83
- * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "UPLOAD_FAILED" and the reason for the failure will be available in the `failedStatusReason` field of the file.
83
+ * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to "upload_failed" and the reason for the failure will be available in the `failedStatusReason` field of the file.
84
84
  *
85
- * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "INDEXING_PENDING" status (the "UPLOAD_COMPLETED" status step will be skipped).
85
+ * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the "indexing_pending" status (the "upload_completed" status step will be skipped).
86
86
  *
87
- * Once the indexing is completed and the file is ready to be used for searching its status will be set to "INDEXING_COMPLETED". If the indexing failed the status will be set to "INDEXING_FAILED" and the reason for the failure will be available in the `failedStatusReason` field.
87
+ * Once the indexing is completed and the file is ready to be used for searching its status will be set to "indexing_completed". If the indexing failed the status will be set to "indexing_failed" and the reason for the failure will be available in the `failedStatusReason` field.
88
88
  */
89
- status: "UPLOAD_PENDING" | "UPLOAD_FAILED" | "UPLOAD_COMPLETED" | "INDEXING_PENDING" | "INDEXING_FAILED" | "INDEXING_COMPLETED";
89
+ status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
90
90
  /**
91
- * If the file status is "UPLOAD_FAILED" or "INDEXING_FAILED" this will contain the reason of the failure.
91
+ * If the file status is "upload_failed" or "indexing_failed" this will contain the reason of the failure.
92
92
  */
93
93
  failedStatusReason?: string;
94
94
  };
@@ -36,7 +36,6 @@ export interface UpdateWorkspaceResponse {
36
36
  createdAt: string;
37
37
  updatedAt: string;
38
38
  botCount: number;
39
- accountType: "free" | "premium";
40
39
  billingVersion: "v1" | "v2";
41
40
  plan: "community" | "team" | "enterprise";
42
41
  blocked: boolean;
@@ -0,0 +1,16 @@
1
+ import { AxiosRequestConfig } from "axios";
2
+ export type Primitive = string | number | boolean;
3
+ export type Value<P extends Primitive> = P | P[] | Record<string, P>;
4
+ export type QueryValue = Value<string> | Value<boolean> | Value<number> | undefined;
5
+ export type AnyQueryParams = Record<string, QueryValue>;
6
+ export type HeaderValue = string | undefined;
7
+ export type AnyHeaderParams = Record<string, HeaderValue>;
8
+ export type AnyBodyParams = Record<string, any>;
9
+ export type ParsedRequest = {
10
+ method: string;
11
+ path: string;
12
+ query: AnyQueryParams;
13
+ headers: AnyHeaderParams;
14
+ body: AnyBodyParams;
15
+ };
16
+ export declare const toAxiosRequest: (req: ParsedRequest) => AxiosRequestConfig;