@botpress/client 0.0.5
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/dist/config.d.ts +27 -0
- package/dist/gen/api.d.ts +5131 -0
- package/dist/gen/base.d.ts +55 -0
- package/dist/gen/client.d.ts +105 -0
- package/dist/gen/common.d.ts +66 -0
- package/dist/gen/configuration.d.ts +83 -0
- package/dist/gen/errors.d.ts +115 -0
- package/dist/gen/index.d.ts +13 -0
- package/dist/index.cjs.js +26 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +3 -0
- package/dist/oauth.d.ts +24 -0
- package/package.json +23 -0
- package/readme.md +37 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Botpress API
|
|
3
|
+
* API for Botpress Cloud
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.2.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { Configuration } from "./configuration";
|
|
13
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLLECTION_FORMATS: {
|
|
20
|
+
csv: string;
|
|
21
|
+
ssv: string;
|
|
22
|
+
tsv: string;
|
|
23
|
+
pipes: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface RequestArgs
|
|
29
|
+
*/
|
|
30
|
+
export interface RequestArgs {
|
|
31
|
+
url: string;
|
|
32
|
+
options: AxiosRequestConfig;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @class BaseAPI
|
|
38
|
+
*/
|
|
39
|
+
export declare class BaseAPI {
|
|
40
|
+
protected basePath: string;
|
|
41
|
+
protected axios: AxiosInstance;
|
|
42
|
+
protected configuration: Configuration | undefined;
|
|
43
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class RequiredError
|
|
49
|
+
* @extends {Error}
|
|
50
|
+
*/
|
|
51
|
+
export declare class RequiredError extends Error {
|
|
52
|
+
field: string;
|
|
53
|
+
name: "RequiredError";
|
|
54
|
+
constructor(field: string, msg?: string);
|
|
55
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import type { Merge, Except } from 'type-fest';
|
|
3
|
+
import { Configuration, DefaultApiCreateConversationRequest, DefaultApiGetConversationRequest, DefaultApiListConversationsRequest, DefaultApiGetOrCreateConversationRequest, DefaultApiUpdateConversationRequest, DefaultApiDeleteConversationRequest, DefaultApiCreateEventRequest, DefaultApiGetEventRequest, DefaultApiListEventsRequest, DefaultApiCreateMessageRequest, DefaultApiGetOrCreateMessageRequest, DefaultApiGetMessageRequest, DefaultApiUpdateMessageRequest, DefaultApiListMessagesRequest, DefaultApiDeleteMessageRequest, DefaultApiCreateUserRequest, DefaultApiGetUserRequest, DefaultApiListUsersRequest, DefaultApiGetOrCreateUserRequest, DefaultApiUpdateUserRequest, DefaultApiDeleteUserRequest, DefaultApiGetStateRequest, DefaultApiSetStateRequest, DefaultApiPatchStateRequest, DefaultApiCallActionRequest, DefaultApiConfigureIntegrationRequest, DefaultApiListPublicIntegrationsRequest, DefaultApiGetPublicIntegrationByIdRequest, DefaultApiGetPublicIntegrationRequest, DefaultApiCreateBotRequest, DefaultApiUpdateBotRequest, DefaultApiListBotsRequest, DefaultApiGetBotRequest, DefaultApiDeleteBotRequest, DefaultApiGetBotLogsRequest, DefaultApiGetBotWebchatRequest, DefaultApiGetBotAnalyticsRequest, DefaultApiCreateIntegrationRequest, DefaultApiUpdateIntegrationRequest, DefaultApiListIntegrationsRequest, DefaultApiGetIntegrationRequest, DefaultApiGetIntegrationByNameRequest, DefaultApiDeleteIntegrationRequest, DefaultApiIntrospectRequest, DefaultApiCreateFileRequest, DefaultApiGetFileRequest, DefaultApiDownloadFileRequest, DefaultApiDeleteFileRequest, DefaultApiListFilesRequest } from '.';
|
|
4
|
+
export declare class ApiClient {
|
|
5
|
+
private _innerClient;
|
|
6
|
+
constructor(configuration?: Configuration, basePath?: string, axiosInstance?: AxiosInstance);
|
|
7
|
+
createConversation: (createConversationBody: CreateConversationProps) => Promise<import("./api").CreateConversationResponse>;
|
|
8
|
+
getConversation: (props: GetConversationProps) => Promise<import("./api").GetConversationResponse>;
|
|
9
|
+
listConversations: (props: ListConversationsProps) => Promise<import("./api").ListConversationsResponse>;
|
|
10
|
+
getOrCreateConversation: (getOrCreateConversationBody: GetOrCreateConversationProps) => Promise<import("./api").GetOrCreateConversationResponse>;
|
|
11
|
+
updateConversation: ({ id, ...updateConversationBody }: UpdateConversationProps) => Promise<import("./api").UpdateConversationResponse>;
|
|
12
|
+
deleteConversation: (props: DeleteConversationProps) => Promise<object>;
|
|
13
|
+
createEvent: (createEventBody: CreateEventProps) => Promise<import("./api").CreateEventResponse>;
|
|
14
|
+
getEvent: (props: GetEventProps) => Promise<import("./api").GetEventResponse>;
|
|
15
|
+
listEvents: (props: ListEventsProps) => Promise<import("./api").ListEventsResponse>;
|
|
16
|
+
createMessage: (createMessageBody: CreateMessageProps) => Promise<import("./api").CreateMessageResponse>;
|
|
17
|
+
getOrCreateMessage: (getOrCreateMessageBody: GetOrCreateMessageProps) => Promise<import("./api").GetOrCreateMessageResponse>;
|
|
18
|
+
getMessage: (props: GetMessageProps) => Promise<import("./api").GetMessageResponse>;
|
|
19
|
+
updateMessage: ({ id, ...updateMessageBody }: UpdateMessageProps) => Promise<import("./api").UpdateMessageResponse>;
|
|
20
|
+
listMessages: (props: ListMessagesProps) => Promise<import("./api").ListMessagesResponse>;
|
|
21
|
+
deleteMessage: (props: DeleteMessageProps) => Promise<object>;
|
|
22
|
+
createUser: (createUserBody: CreateUserProps) => Promise<import("./api").CreateUserResponse>;
|
|
23
|
+
getUser: (props: GetUserProps) => Promise<import("./api").GetUserResponse>;
|
|
24
|
+
listUsers: (props: ListUsersProps) => Promise<import("./api").ListUsersResponse>;
|
|
25
|
+
getOrCreateUser: (getOrCreateUserBody: GetOrCreateUserProps) => Promise<import("./api").GetOrCreateUserResponse>;
|
|
26
|
+
updateUser: ({ id, ...updateUserBody }: UpdateUserProps) => Promise<import("./api").UpdateUserResponse>;
|
|
27
|
+
deleteUser: (props: DeleteUserProps) => Promise<object>;
|
|
28
|
+
getState: (props: GetStateProps) => Promise<import("./api").GetStateResponse>;
|
|
29
|
+
setState: ({ type, id, name, ...setStateBody }: SetStateProps) => Promise<import("./api").SetStateResponse>;
|
|
30
|
+
patchState: ({ type, id, name, ...patchStateBody }: PatchStateProps) => Promise<import("./api").PatchStateResponse>;
|
|
31
|
+
callAction: (callActionBody: CallActionProps) => Promise<import("./api").CallActionResponse>;
|
|
32
|
+
configureIntegration: (configureIntegrationBody: ConfigureIntegrationProps) => Promise<object>;
|
|
33
|
+
listPublicIntegrations: (props: ListPublicIntegrationsProps) => Promise<import("./api").ListPublicIntegrationsResponse>;
|
|
34
|
+
getPublicIntegrationById: (props: GetPublicIntegrationByIdProps) => Promise<import("./api").GetPublicIntegrationByIdResponse>;
|
|
35
|
+
getPublicIntegration: (props: GetPublicIntegrationProps) => Promise<import("./api").GetPublicIntegrationResponse>;
|
|
36
|
+
createBot: (createBotBody: CreateBotProps) => Promise<import("./api").CreateBotResponse>;
|
|
37
|
+
updateBot: ({ id, ...updateBotBody }: UpdateBotProps) => Promise<import("./api").UpdateBotResponse>;
|
|
38
|
+
listBots: (props: ListBotsProps) => Promise<import("./api").ListBotsResponse>;
|
|
39
|
+
getBot: (props: GetBotProps) => Promise<import("./api").GetBotResponse>;
|
|
40
|
+
deleteBot: (props: DeleteBotProps) => Promise<object>;
|
|
41
|
+
getBotLogs: (props: GetBotLogsProps) => Promise<import("./api").GetBotLogsResponse>;
|
|
42
|
+
getBotWebchat: (props: GetBotWebchatProps) => Promise<import("./api").GetBotWebchatResponse>;
|
|
43
|
+
getBotAnalytics: (props: GetBotAnalyticsProps) => Promise<import("./api").GetBotAnalyticsResponse>;
|
|
44
|
+
createIntegration: (createIntegrationBody: CreateIntegrationProps) => Promise<import("./api").CreateIntegrationResponse>;
|
|
45
|
+
updateIntegration: ({ id, ...updateIntegrationBody }: UpdateIntegrationProps) => Promise<import("./api").UpdateIntegrationResponse>;
|
|
46
|
+
listIntegrations: (props: ListIntegrationsProps) => Promise<import("./api").ListIntegrationsResponse>;
|
|
47
|
+
getIntegration: (props: GetIntegrationProps) => Promise<import("./api").GetIntegrationResponse>;
|
|
48
|
+
getIntegrationByName: (props: GetIntegrationByNameProps) => Promise<import("./api").GetIntegrationByNameResponse>;
|
|
49
|
+
deleteIntegration: (props: DeleteIntegrationProps) => Promise<object>;
|
|
50
|
+
introspect: (introspectBody: IntrospectProps) => Promise<import("./api").IntrospectResponse>;
|
|
51
|
+
createFile: (createFileBody: CreateFileProps) => Promise<import("./api").CreateFileResponse>;
|
|
52
|
+
getFile: (props: GetFileProps) => Promise<import("./api").GetFileResponse>;
|
|
53
|
+
downloadFile: (props: DownloadFileProps) => Promise<any>;
|
|
54
|
+
deleteFile: (props: DeleteFileProps) => Promise<object>;
|
|
55
|
+
listFiles: (props: ListFilesProps) => Promise<import("./api").ListFilesResponse>;
|
|
56
|
+
}
|
|
57
|
+
export type CreateConversationProps = Merge<Except<DefaultApiCreateConversationRequest, 'createConversationBody'>, NonNullable<DefaultApiCreateConversationRequest['createConversationBody']>>;
|
|
58
|
+
export type GetConversationProps = Merge<DefaultApiGetConversationRequest, {}>;
|
|
59
|
+
export type ListConversationsProps = Merge<DefaultApiListConversationsRequest, {}>;
|
|
60
|
+
export type GetOrCreateConversationProps = Merge<Except<DefaultApiGetOrCreateConversationRequest, 'getOrCreateConversationBody'>, NonNullable<DefaultApiGetOrCreateConversationRequest['getOrCreateConversationBody']>>;
|
|
61
|
+
export type UpdateConversationProps = Merge<Except<DefaultApiUpdateConversationRequest, 'updateConversationBody'>, NonNullable<DefaultApiUpdateConversationRequest['updateConversationBody']>>;
|
|
62
|
+
export type DeleteConversationProps = Merge<DefaultApiDeleteConversationRequest, {}>;
|
|
63
|
+
export type CreateEventProps = Merge<Except<DefaultApiCreateEventRequest, 'createEventBody'>, NonNullable<DefaultApiCreateEventRequest['createEventBody']>>;
|
|
64
|
+
export type GetEventProps = Merge<DefaultApiGetEventRequest, {}>;
|
|
65
|
+
export type ListEventsProps = Merge<DefaultApiListEventsRequest, {}>;
|
|
66
|
+
export type CreateMessageProps = Merge<Except<DefaultApiCreateMessageRequest, 'createMessageBody'>, NonNullable<DefaultApiCreateMessageRequest['createMessageBody']>>;
|
|
67
|
+
export type GetOrCreateMessageProps = Merge<Except<DefaultApiGetOrCreateMessageRequest, 'getOrCreateMessageBody'>, NonNullable<DefaultApiGetOrCreateMessageRequest['getOrCreateMessageBody']>>;
|
|
68
|
+
export type GetMessageProps = Merge<DefaultApiGetMessageRequest, {}>;
|
|
69
|
+
export type UpdateMessageProps = Merge<Except<DefaultApiUpdateMessageRequest, 'updateMessageBody'>, NonNullable<DefaultApiUpdateMessageRequest['updateMessageBody']>>;
|
|
70
|
+
export type ListMessagesProps = Merge<DefaultApiListMessagesRequest, {}>;
|
|
71
|
+
export type DeleteMessageProps = Merge<DefaultApiDeleteMessageRequest, {}>;
|
|
72
|
+
export type CreateUserProps = Merge<Except<DefaultApiCreateUserRequest, 'createUserBody'>, NonNullable<DefaultApiCreateUserRequest['createUserBody']>>;
|
|
73
|
+
export type GetUserProps = Merge<DefaultApiGetUserRequest, {}>;
|
|
74
|
+
export type ListUsersProps = Merge<DefaultApiListUsersRequest, {}>;
|
|
75
|
+
export type GetOrCreateUserProps = Merge<Except<DefaultApiGetOrCreateUserRequest, 'getOrCreateUserBody'>, NonNullable<DefaultApiGetOrCreateUserRequest['getOrCreateUserBody']>>;
|
|
76
|
+
export type UpdateUserProps = Merge<Except<DefaultApiUpdateUserRequest, 'updateUserBody'>, NonNullable<DefaultApiUpdateUserRequest['updateUserBody']>>;
|
|
77
|
+
export type DeleteUserProps = Merge<DefaultApiDeleteUserRequest, {}>;
|
|
78
|
+
export type GetStateProps = Merge<DefaultApiGetStateRequest, {}>;
|
|
79
|
+
export type SetStateProps = Merge<Except<DefaultApiSetStateRequest, 'setStateBody'>, NonNullable<DefaultApiSetStateRequest['setStateBody']>>;
|
|
80
|
+
export type PatchStateProps = Merge<Except<DefaultApiPatchStateRequest, 'patchStateBody'>, NonNullable<DefaultApiPatchStateRequest['patchStateBody']>>;
|
|
81
|
+
export type CallActionProps = Merge<Except<DefaultApiCallActionRequest, 'callActionBody'>, NonNullable<DefaultApiCallActionRequest['callActionBody']>>;
|
|
82
|
+
export type ConfigureIntegrationProps = Merge<Except<DefaultApiConfigureIntegrationRequest, 'configureIntegrationBody'>, NonNullable<DefaultApiConfigureIntegrationRequest['configureIntegrationBody']>>;
|
|
83
|
+
export type ListPublicIntegrationsProps = Merge<DefaultApiListPublicIntegrationsRequest, {}>;
|
|
84
|
+
export type GetPublicIntegrationByIdProps = Merge<DefaultApiGetPublicIntegrationByIdRequest, {}>;
|
|
85
|
+
export type GetPublicIntegrationProps = Merge<DefaultApiGetPublicIntegrationRequest, {}>;
|
|
86
|
+
export type CreateBotProps = Merge<Except<DefaultApiCreateBotRequest, 'createBotBody'>, NonNullable<DefaultApiCreateBotRequest['createBotBody']>>;
|
|
87
|
+
export type UpdateBotProps = Merge<Except<DefaultApiUpdateBotRequest, 'updateBotBody'>, NonNullable<DefaultApiUpdateBotRequest['updateBotBody']>>;
|
|
88
|
+
export type ListBotsProps = Merge<DefaultApiListBotsRequest, {}>;
|
|
89
|
+
export type GetBotProps = Merge<DefaultApiGetBotRequest, {}>;
|
|
90
|
+
export type DeleteBotProps = Merge<DefaultApiDeleteBotRequest, {}>;
|
|
91
|
+
export type GetBotLogsProps = Merge<DefaultApiGetBotLogsRequest, {}>;
|
|
92
|
+
export type GetBotWebchatProps = Merge<DefaultApiGetBotWebchatRequest, {}>;
|
|
93
|
+
export type GetBotAnalyticsProps = Merge<DefaultApiGetBotAnalyticsRequest, {}>;
|
|
94
|
+
export type CreateIntegrationProps = Merge<Except<DefaultApiCreateIntegrationRequest, 'createIntegrationBody'>, NonNullable<DefaultApiCreateIntegrationRequest['createIntegrationBody']>>;
|
|
95
|
+
export type UpdateIntegrationProps = Merge<Except<DefaultApiUpdateIntegrationRequest, 'updateIntegrationBody'>, NonNullable<DefaultApiUpdateIntegrationRequest['updateIntegrationBody']>>;
|
|
96
|
+
export type ListIntegrationsProps = Merge<DefaultApiListIntegrationsRequest, {}>;
|
|
97
|
+
export type GetIntegrationProps = Merge<DefaultApiGetIntegrationRequest, {}>;
|
|
98
|
+
export type GetIntegrationByNameProps = Merge<DefaultApiGetIntegrationByNameRequest, {}>;
|
|
99
|
+
export type DeleteIntegrationProps = Merge<DefaultApiDeleteIntegrationRequest, {}>;
|
|
100
|
+
export type IntrospectProps = Merge<Except<DefaultApiIntrospectRequest, 'introspectBody'>, NonNullable<DefaultApiIntrospectRequest['introspectBody']>>;
|
|
101
|
+
export type CreateFileProps = Merge<Except<DefaultApiCreateFileRequest, 'createFileBody'>, NonNullable<DefaultApiCreateFileRequest['createFileBody']>>;
|
|
102
|
+
export type GetFileProps = Merge<DefaultApiGetFileRequest, {}>;
|
|
103
|
+
export type DownloadFileProps = Merge<DefaultApiDownloadFileRequest, {}>;
|
|
104
|
+
export type DeleteFileProps = Merge<DefaultApiDeleteFileRequest, {}>;
|
|
105
|
+
export type ListFilesProps = Merge<DefaultApiListFilesRequest, {}>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Botpress API
|
|
3
|
+
* API for Botpress Cloud
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.2.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/// <reference types="node" />
|
|
13
|
+
import { Configuration } from "./configuration";
|
|
14
|
+
import { RequestArgs } from "./base";
|
|
15
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @throws {RequiredError}
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @export
|
|
35
|
+
*/
|
|
36
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @export
|
|
40
|
+
*/
|
|
41
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
*/
|
|
51
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @export
|
|
55
|
+
*/
|
|
56
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @export
|
|
60
|
+
*/
|
|
61
|
+
export declare const toPathString: (url: URL) => string;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @export
|
|
65
|
+
*/
|
|
66
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Botpress API
|
|
3
|
+
* API for Botpress Cloud
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.2.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export interface ConfigurationParameters {
|
|
13
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
14
|
+
username?: string;
|
|
15
|
+
password?: string;
|
|
16
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
17
|
+
basePath?: string;
|
|
18
|
+
baseOptions?: any;
|
|
19
|
+
formDataCtor?: new () => any;
|
|
20
|
+
}
|
|
21
|
+
export declare class Configuration {
|
|
22
|
+
/**
|
|
23
|
+
* parameter for apiKey security
|
|
24
|
+
* @param name security name
|
|
25
|
+
* @memberof Configuration
|
|
26
|
+
*/
|
|
27
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
28
|
+
/**
|
|
29
|
+
* parameter for basic security
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof Configuration
|
|
33
|
+
*/
|
|
34
|
+
username?: string;
|
|
35
|
+
/**
|
|
36
|
+
* parameter for basic security
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof Configuration
|
|
40
|
+
*/
|
|
41
|
+
password?: string;
|
|
42
|
+
/**
|
|
43
|
+
* parameter for oauth2 security
|
|
44
|
+
* @param name security name
|
|
45
|
+
* @param scopes oauth2 scope
|
|
46
|
+
* @memberof Configuration
|
|
47
|
+
*/
|
|
48
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
49
|
+
/**
|
|
50
|
+
* override base path
|
|
51
|
+
*
|
|
52
|
+
* @type {string}
|
|
53
|
+
* @memberof Configuration
|
|
54
|
+
*/
|
|
55
|
+
basePath?: string;
|
|
56
|
+
/**
|
|
57
|
+
* base options for axios calls
|
|
58
|
+
*
|
|
59
|
+
* @type {any}
|
|
60
|
+
* @memberof Configuration
|
|
61
|
+
*/
|
|
62
|
+
baseOptions?: any;
|
|
63
|
+
/**
|
|
64
|
+
* The FormData constructor that will be used to create multipart form data
|
|
65
|
+
* requests. You can inject this here so that execution environments that
|
|
66
|
+
* do not support the FormData class can still run the generated client.
|
|
67
|
+
*
|
|
68
|
+
* @type {new () => FormData}
|
|
69
|
+
*/
|
|
70
|
+
formDataCtor?: new () => any;
|
|
71
|
+
constructor(param?: ConfigurationParameters);
|
|
72
|
+
/**
|
|
73
|
+
* Check if the given MIME is a JSON MIME.
|
|
74
|
+
* JSON MIME examples:
|
|
75
|
+
* application/json
|
|
76
|
+
* application/json; charset=UTF8
|
|
77
|
+
* APPLICATION/JSON
|
|
78
|
+
* application/vnd.company+json
|
|
79
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
80
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
81
|
+
*/
|
|
82
|
+
isJsonMime(mime: string): boolean;
|
|
83
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
declare const codes: {
|
|
2
|
+
readonly HTTP_STATUS_BAD_REQUEST: 400;
|
|
3
|
+
readonly HTTP_STATUS_UNAUTHORIZED: 401;
|
|
4
|
+
readonly HTTP_STATUS_PAYMENT_REQUIRED: 402;
|
|
5
|
+
readonly HTTP_STATUS_FORBIDDEN: 403;
|
|
6
|
+
readonly HTTP_STATUS_NOT_FOUND: 404;
|
|
7
|
+
readonly HTTP_STATUS_METHOD_NOT_ALLOWED: 405;
|
|
8
|
+
readonly HTTP_STATUS_CONFLICT: 409;
|
|
9
|
+
readonly HTTP_STATUS_PAYLOAD_TOO_LARGE: 413;
|
|
10
|
+
readonly HTTP_STATUS_TOO_MANY_REQUESTS: 429;
|
|
11
|
+
readonly HTTP_STATUS_INTERNAL_SERVER_ERROR: 500;
|
|
12
|
+
};
|
|
13
|
+
type ErrorCode = typeof codes[keyof typeof codes];
|
|
14
|
+
declare abstract class BaseApiError<Code extends ErrorCode, Type extends string, Description extends string> extends Error {
|
|
15
|
+
readonly code: Code;
|
|
16
|
+
readonly description: Description;
|
|
17
|
+
readonly type: Type;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly error?: Error | undefined;
|
|
20
|
+
constructor(code: Code, description: Description, type: Type, message: string, error?: Error | undefined);
|
|
21
|
+
toJSON(): {
|
|
22
|
+
code: Code;
|
|
23
|
+
type: Type;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare const isApiError: (thrown: unknown) => thrown is ApiError;
|
|
28
|
+
type UnknownType = 'Unknown';
|
|
29
|
+
/**
|
|
30
|
+
* An unknown error occurred
|
|
31
|
+
*/
|
|
32
|
+
export declare class UnknownError extends BaseApiError<500, UnknownType, 'An unknown error occurred'> {
|
|
33
|
+
constructor(message: string, error?: Error);
|
|
34
|
+
}
|
|
35
|
+
type InternalType = 'Internal';
|
|
36
|
+
/**
|
|
37
|
+
* An internal error occurred
|
|
38
|
+
*/
|
|
39
|
+
export declare class InternalError extends BaseApiError<500, InternalType, 'An internal error occurred'> {
|
|
40
|
+
constructor(message: string, error?: Error);
|
|
41
|
+
}
|
|
42
|
+
type ForbiddenType = 'Forbidden';
|
|
43
|
+
/**
|
|
44
|
+
* The requested action can\'t be peform by this resource.
|
|
45
|
+
*/
|
|
46
|
+
export declare class ForbiddenError extends BaseApiError<403, ForbiddenType, 'The requested action can\'t be peform by this resource.'> {
|
|
47
|
+
constructor(message: string, error?: Error);
|
|
48
|
+
}
|
|
49
|
+
type InvalidPayloadType = 'InvalidPayload';
|
|
50
|
+
/**
|
|
51
|
+
* The request payload isn\'t invalid.
|
|
52
|
+
*/
|
|
53
|
+
export declare class InvalidPayloadError extends BaseApiError<400, InvalidPayloadType, 'The request payload isn\'t invalid.'> {
|
|
54
|
+
constructor(message: string, error?: Error);
|
|
55
|
+
}
|
|
56
|
+
type MethodNotFoundType = 'MethodNotFound';
|
|
57
|
+
/**
|
|
58
|
+
* The requested method does not exist.
|
|
59
|
+
*/
|
|
60
|
+
export declare class MethodNotFoundError extends BaseApiError<405, MethodNotFoundType, 'The requested method does not exist.'> {
|
|
61
|
+
constructor(message: string, error?: Error);
|
|
62
|
+
}
|
|
63
|
+
type ResourceNotFoundType = 'ResourceNotFound';
|
|
64
|
+
/**
|
|
65
|
+
* The requested resource does not exist.
|
|
66
|
+
*/
|
|
67
|
+
export declare class ResourceNotFoundError extends BaseApiError<404, ResourceNotFoundType, 'The requested resource does not exist.'> {
|
|
68
|
+
constructor(message: string, error?: Error);
|
|
69
|
+
}
|
|
70
|
+
type InvalidJsonSchemaType = 'InvalidJsonSchema';
|
|
71
|
+
/**
|
|
72
|
+
* The provided JSON schema is invalid.
|
|
73
|
+
*/
|
|
74
|
+
export declare class InvalidJsonSchemaError extends BaseApiError<400, InvalidJsonSchemaType, 'The provided JSON schema is invalid.'> {
|
|
75
|
+
constructor(message: string, error?: Error);
|
|
76
|
+
}
|
|
77
|
+
type InvalidDataFormatType = 'InvalidDataFormat';
|
|
78
|
+
/**
|
|
79
|
+
* The provided data doesn\'t respect the provided JSON schema.
|
|
80
|
+
*/
|
|
81
|
+
export declare class InvalidDataFormatError extends BaseApiError<400, InvalidDataFormatType, 'The provided data doesn\'t respect the provided JSON schema.'> {
|
|
82
|
+
constructor(message: string, error?: Error);
|
|
83
|
+
}
|
|
84
|
+
type InvalidIdentifierType = 'InvalidIdentifier';
|
|
85
|
+
/**
|
|
86
|
+
* The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.
|
|
87
|
+
*/
|
|
88
|
+
export declare class InvalidIdentifierError extends BaseApiError<400, InvalidIdentifierType, 'The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.'> {
|
|
89
|
+
constructor(message: string, error?: Error);
|
|
90
|
+
}
|
|
91
|
+
type RelationConflictType = 'RelationConflict';
|
|
92
|
+
/**
|
|
93
|
+
* The resource is not related with another resource. This is usually caused when providing two resources that aren\'t linked together.
|
|
94
|
+
*/
|
|
95
|
+
export declare class RelationConflictError extends BaseApiError<409, RelationConflictType, 'The resource is not related with another resource. This is usually caused when providing two resources that aren\'t linked together.'> {
|
|
96
|
+
constructor(message: string, error?: Error);
|
|
97
|
+
}
|
|
98
|
+
type ReferenceNotFoundType = 'ReferenceNotFound';
|
|
99
|
+
/**
|
|
100
|
+
* The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
|
|
101
|
+
*/
|
|
102
|
+
export declare class ReferenceNotFoundError extends BaseApiError<400, ReferenceNotFoundType, 'The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.'> {
|
|
103
|
+
constructor(message: string, error?: Error);
|
|
104
|
+
}
|
|
105
|
+
type InvalidQueryType = 'InvalidQuery';
|
|
106
|
+
/**
|
|
107
|
+
* The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.
|
|
108
|
+
*/
|
|
109
|
+
export declare class InvalidQueryError extends BaseApiError<400, InvalidQueryType, 'The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.'> {
|
|
110
|
+
constructor(message: string, error?: Error);
|
|
111
|
+
}
|
|
112
|
+
export type ErrorType = 'Unknown' | 'Internal' | 'Forbidden' | 'InvalidPayload' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceNotFound' | 'InvalidQuery';
|
|
113
|
+
export type ApiError = UnknownError | InternalError | ForbiddenError | InvalidPayloadError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceNotFoundError | InvalidQueryError;
|
|
114
|
+
export declare const errorFrom: (err: unknown) => ApiError;
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Botpress API
|
|
3
|
+
* API for Botpress Cloud
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.2.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export * from "./api";
|
|
13
|
+
export * from "./configuration";
|