@botpress/client 0.0.9 → 0.0.11
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/bundle.cjs +7 -7
- package/dist/bundle.cjs.map +4 -4
- package/dist/config.d.ts +15 -28
- package/dist/gen/api.d.ts +5480 -5407
- package/dist/gen/base.d.ts +55 -55
- package/dist/gen/client.d.ts +109 -107
- package/dist/gen/common.d.ts +66 -66
- package/dist/gen/configuration.d.ts +83 -83
- package/dist/gen/errors.d.ts +144 -144
- package/dist/gen/index.d.ts +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +9 -9
- package/dist/index.mjs +1 -1
- package/dist/oauth.d.ts +24 -24
- package/package.json +10 -10
|
@@ -1,83 +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
|
-
}
|
|
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
|
+
}
|
package/dist/gen/errors.d.ts
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
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
|
-
readonly isApiError = true;
|
|
21
|
-
constructor(code: Code, description: Description, type: Type, message: string, error?: Error | undefined);
|
|
22
|
-
toJSON(): {
|
|
23
|
-
code: Code;
|
|
24
|
-
type: Type;
|
|
25
|
-
message: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export declare const isApiError: (thrown: unknown) => thrown is ApiError;
|
|
29
|
-
type UnknownType = 'Unknown';
|
|
30
|
-
/**
|
|
31
|
-
* An unknown error occurred
|
|
32
|
-
*/
|
|
33
|
-
export declare class UnknownError extends BaseApiError<500, UnknownType, 'An unknown error occurred'> {
|
|
34
|
-
constructor(message: string, error?: Error);
|
|
35
|
-
}
|
|
36
|
-
type InternalType = 'Internal';
|
|
37
|
-
/**
|
|
38
|
-
* An internal error occurred
|
|
39
|
-
*/
|
|
40
|
-
export declare class InternalError extends BaseApiError<500, InternalType, 'An internal error occurred'> {
|
|
41
|
-
constructor(message: string, error?: Error);
|
|
42
|
-
}
|
|
43
|
-
type UnauthorizedType = 'Unauthorized';
|
|
44
|
-
/**
|
|
45
|
-
* The request requires to be authenticated.
|
|
46
|
-
*/
|
|
47
|
-
export declare class UnauthorizedError extends BaseApiError<401, UnauthorizedType, 'The request requires to be authenticated.'> {
|
|
48
|
-
constructor(message: string, error?: Error);
|
|
49
|
-
}
|
|
50
|
-
type ForbiddenType = 'Forbidden';
|
|
51
|
-
/**
|
|
52
|
-
* The requested action can\'t be peform by this resource.
|
|
53
|
-
*/
|
|
54
|
-
export declare class ForbiddenError extends BaseApiError<403, ForbiddenType, 'The requested action can\'t be peform by this resource.'> {
|
|
55
|
-
constructor(message: string, error?: Error);
|
|
56
|
-
}
|
|
57
|
-
type PayloadTooLargeType = 'PayloadTooLarge';
|
|
58
|
-
/**
|
|
59
|
-
* The request payload is too large.
|
|
60
|
-
*/
|
|
61
|
-
export declare class PayloadTooLargeError extends BaseApiError<413, PayloadTooLargeType, 'The request payload is too large.'> {
|
|
62
|
-
constructor(message: string, error?: Error);
|
|
63
|
-
}
|
|
64
|
-
type InvalidPayloadType = 'InvalidPayload';
|
|
65
|
-
/**
|
|
66
|
-
* The request payload is invalid.
|
|
67
|
-
*/
|
|
68
|
-
export declare class InvalidPayloadError extends BaseApiError<400, InvalidPayloadType, 'The request payload is invalid.'> {
|
|
69
|
-
constructor(message: string, error?: Error);
|
|
70
|
-
}
|
|
71
|
-
type UnsupportedMediaTypeType = 'UnsupportedMediaType';
|
|
72
|
-
/**
|
|
73
|
-
* The request is invalid because the content-type is not supported.
|
|
74
|
-
*/
|
|
75
|
-
export declare class UnsupportedMediaTypeError extends BaseApiError<415, UnsupportedMediaTypeType, 'The request is invalid because the content-type is not supported.'> {
|
|
76
|
-
constructor(message: string, error?: Error);
|
|
77
|
-
}
|
|
78
|
-
type MethodNotFoundType = 'MethodNotFound';
|
|
79
|
-
/**
|
|
80
|
-
* The requested method does not exist.
|
|
81
|
-
*/
|
|
82
|
-
export declare class MethodNotFoundError extends BaseApiError<405, MethodNotFoundType, 'The requested method does not exist.'> {
|
|
83
|
-
constructor(message: string, error?: Error);
|
|
84
|
-
}
|
|
85
|
-
type ResourceNotFoundType = 'ResourceNotFound';
|
|
86
|
-
/**
|
|
87
|
-
* The requested resource does not exist.
|
|
88
|
-
*/
|
|
89
|
-
export declare class ResourceNotFoundError extends BaseApiError<404, ResourceNotFoundType, 'The requested resource does not exist.'> {
|
|
90
|
-
constructor(message: string, error?: Error);
|
|
91
|
-
}
|
|
92
|
-
type InvalidJsonSchemaType = 'InvalidJsonSchema';
|
|
93
|
-
/**
|
|
94
|
-
* The provided JSON schema is invalid.
|
|
95
|
-
*/
|
|
96
|
-
export declare class InvalidJsonSchemaError extends BaseApiError<400, InvalidJsonSchemaType, 'The provided JSON schema is invalid.'> {
|
|
97
|
-
constructor(message: string, error?: Error);
|
|
98
|
-
}
|
|
99
|
-
type InvalidDataFormatType = 'InvalidDataFormat';
|
|
100
|
-
/**
|
|
101
|
-
* The provided data doesn\'t respect the provided JSON schema.
|
|
102
|
-
*/
|
|
103
|
-
export declare class InvalidDataFormatError extends BaseApiError<400, InvalidDataFormatType, 'The provided data doesn\'t respect the provided JSON schema.'> {
|
|
104
|
-
constructor(message: string, error?: Error);
|
|
105
|
-
}
|
|
106
|
-
type InvalidIdentifierType = 'InvalidIdentifier';
|
|
107
|
-
/**
|
|
108
|
-
* 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.
|
|
109
|
-
*/
|
|
110
|
-
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.'> {
|
|
111
|
-
constructor(message: string, error?: Error);
|
|
112
|
-
}
|
|
113
|
-
type RelationConflictType = 'RelationConflict';
|
|
114
|
-
/**
|
|
115
|
-
* The resource is not related with another resource. This is usually caused when providing two resources that aren\'t linked together.
|
|
116
|
-
*/
|
|
117
|
-
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.'> {
|
|
118
|
-
constructor(message: string, error?: Error);
|
|
119
|
-
}
|
|
120
|
-
type ReferenceNotFoundType = 'ReferenceNotFound';
|
|
121
|
-
/**
|
|
122
|
-
* The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
|
|
123
|
-
*/
|
|
124
|
-
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.'> {
|
|
125
|
-
constructor(message: string, error?: Error);
|
|
126
|
-
}
|
|
127
|
-
type InvalidQueryType = 'InvalidQuery';
|
|
128
|
-
/**
|
|
129
|
-
* The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.
|
|
130
|
-
*/
|
|
131
|
-
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.'> {
|
|
132
|
-
constructor(message: string, error?: Error);
|
|
133
|
-
}
|
|
134
|
-
type RuntimeType = 'Runtime';
|
|
135
|
-
/**
|
|
136
|
-
* An error happened during the execution of a runtime (bot or integration).
|
|
137
|
-
*/
|
|
138
|
-
export declare class RuntimeError extends BaseApiError<400, RuntimeType, 'An error happened during the execution of a runtime (bot or integration).'> {
|
|
139
|
-
constructor(message: string, error?: Error);
|
|
140
|
-
}
|
|
141
|
-
export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime';
|
|
142
|
-
export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError;
|
|
143
|
-
export declare const errorFrom: (err: unknown) => ApiError;
|
|
144
|
-
export {};
|
|
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
|
+
readonly isApiError = true;
|
|
21
|
+
constructor(code: Code, description: Description, type: Type, message: string, error?: Error | undefined);
|
|
22
|
+
toJSON(): {
|
|
23
|
+
code: Code;
|
|
24
|
+
type: Type;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare const isApiError: (thrown: unknown) => thrown is ApiError;
|
|
29
|
+
type UnknownType = 'Unknown';
|
|
30
|
+
/**
|
|
31
|
+
* An unknown error occurred
|
|
32
|
+
*/
|
|
33
|
+
export declare class UnknownError extends BaseApiError<500, UnknownType, 'An unknown error occurred'> {
|
|
34
|
+
constructor(message: string, error?: Error);
|
|
35
|
+
}
|
|
36
|
+
type InternalType = 'Internal';
|
|
37
|
+
/**
|
|
38
|
+
* An internal error occurred
|
|
39
|
+
*/
|
|
40
|
+
export declare class InternalError extends BaseApiError<500, InternalType, 'An internal error occurred'> {
|
|
41
|
+
constructor(message: string, error?: Error);
|
|
42
|
+
}
|
|
43
|
+
type UnauthorizedType = 'Unauthorized';
|
|
44
|
+
/**
|
|
45
|
+
* The request requires to be authenticated.
|
|
46
|
+
*/
|
|
47
|
+
export declare class UnauthorizedError extends BaseApiError<401, UnauthorizedType, 'The request requires to be authenticated.'> {
|
|
48
|
+
constructor(message: string, error?: Error);
|
|
49
|
+
}
|
|
50
|
+
type ForbiddenType = 'Forbidden';
|
|
51
|
+
/**
|
|
52
|
+
* The requested action can\'t be peform by this resource.
|
|
53
|
+
*/
|
|
54
|
+
export declare class ForbiddenError extends BaseApiError<403, ForbiddenType, 'The requested action can\'t be peform by this resource.'> {
|
|
55
|
+
constructor(message: string, error?: Error);
|
|
56
|
+
}
|
|
57
|
+
type PayloadTooLargeType = 'PayloadTooLarge';
|
|
58
|
+
/**
|
|
59
|
+
* The request payload is too large.
|
|
60
|
+
*/
|
|
61
|
+
export declare class PayloadTooLargeError extends BaseApiError<413, PayloadTooLargeType, 'The request payload is too large.'> {
|
|
62
|
+
constructor(message: string, error?: Error);
|
|
63
|
+
}
|
|
64
|
+
type InvalidPayloadType = 'InvalidPayload';
|
|
65
|
+
/**
|
|
66
|
+
* The request payload is invalid.
|
|
67
|
+
*/
|
|
68
|
+
export declare class InvalidPayloadError extends BaseApiError<400, InvalidPayloadType, 'The request payload is invalid.'> {
|
|
69
|
+
constructor(message: string, error?: Error);
|
|
70
|
+
}
|
|
71
|
+
type UnsupportedMediaTypeType = 'UnsupportedMediaType';
|
|
72
|
+
/**
|
|
73
|
+
* The request is invalid because the content-type is not supported.
|
|
74
|
+
*/
|
|
75
|
+
export declare class UnsupportedMediaTypeError extends BaseApiError<415, UnsupportedMediaTypeType, 'The request is invalid because the content-type is not supported.'> {
|
|
76
|
+
constructor(message: string, error?: Error);
|
|
77
|
+
}
|
|
78
|
+
type MethodNotFoundType = 'MethodNotFound';
|
|
79
|
+
/**
|
|
80
|
+
* The requested method does not exist.
|
|
81
|
+
*/
|
|
82
|
+
export declare class MethodNotFoundError extends BaseApiError<405, MethodNotFoundType, 'The requested method does not exist.'> {
|
|
83
|
+
constructor(message: string, error?: Error);
|
|
84
|
+
}
|
|
85
|
+
type ResourceNotFoundType = 'ResourceNotFound';
|
|
86
|
+
/**
|
|
87
|
+
* The requested resource does not exist.
|
|
88
|
+
*/
|
|
89
|
+
export declare class ResourceNotFoundError extends BaseApiError<404, ResourceNotFoundType, 'The requested resource does not exist.'> {
|
|
90
|
+
constructor(message: string, error?: Error);
|
|
91
|
+
}
|
|
92
|
+
type InvalidJsonSchemaType = 'InvalidJsonSchema';
|
|
93
|
+
/**
|
|
94
|
+
* The provided JSON schema is invalid.
|
|
95
|
+
*/
|
|
96
|
+
export declare class InvalidJsonSchemaError extends BaseApiError<400, InvalidJsonSchemaType, 'The provided JSON schema is invalid.'> {
|
|
97
|
+
constructor(message: string, error?: Error);
|
|
98
|
+
}
|
|
99
|
+
type InvalidDataFormatType = 'InvalidDataFormat';
|
|
100
|
+
/**
|
|
101
|
+
* The provided data doesn\'t respect the provided JSON schema.
|
|
102
|
+
*/
|
|
103
|
+
export declare class InvalidDataFormatError extends BaseApiError<400, InvalidDataFormatType, 'The provided data doesn\'t respect the provided JSON schema.'> {
|
|
104
|
+
constructor(message: string, error?: Error);
|
|
105
|
+
}
|
|
106
|
+
type InvalidIdentifierType = 'InvalidIdentifier';
|
|
107
|
+
/**
|
|
108
|
+
* 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.
|
|
109
|
+
*/
|
|
110
|
+
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.'> {
|
|
111
|
+
constructor(message: string, error?: Error);
|
|
112
|
+
}
|
|
113
|
+
type RelationConflictType = 'RelationConflict';
|
|
114
|
+
/**
|
|
115
|
+
* The resource is not related with another resource. This is usually caused when providing two resources that aren\'t linked together.
|
|
116
|
+
*/
|
|
117
|
+
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.'> {
|
|
118
|
+
constructor(message: string, error?: Error);
|
|
119
|
+
}
|
|
120
|
+
type ReferenceNotFoundType = 'ReferenceNotFound';
|
|
121
|
+
/**
|
|
122
|
+
* The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
|
|
123
|
+
*/
|
|
124
|
+
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.'> {
|
|
125
|
+
constructor(message: string, error?: Error);
|
|
126
|
+
}
|
|
127
|
+
type InvalidQueryType = 'InvalidQuery';
|
|
128
|
+
/**
|
|
129
|
+
* The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.
|
|
130
|
+
*/
|
|
131
|
+
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.'> {
|
|
132
|
+
constructor(message: string, error?: Error);
|
|
133
|
+
}
|
|
134
|
+
type RuntimeType = 'Runtime';
|
|
135
|
+
/**
|
|
136
|
+
* An error happened during the execution of a runtime (bot or integration).
|
|
137
|
+
*/
|
|
138
|
+
export declare class RuntimeError extends BaseApiError<400, RuntimeType, 'An error happened during the execution of a runtime (bot or integration).'> {
|
|
139
|
+
constructor(message: string, error?: Error);
|
|
140
|
+
}
|
|
141
|
+
export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime';
|
|
142
|
+
export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError;
|
|
143
|
+
export declare const errorFrom: (err: unknown) => ApiError;
|
|
144
|
+
export {};
|
package/dist/gen/index.d.ts
CHANGED
|
@@ -1,13 +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";
|
|
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";
|