@botpress/webchat 1.1.1 → 1.2.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.
- package/dist/App.d.ts +4 -4
- package/dist/client/MessagingClient/client.d.ts +2 -16
- package/dist/client/{ChatClient → PushpinClient}/index.d.ts +4 -4
- package/dist/client/PushpinClient/inner-client/event-emitter.d.ts +10 -0
- package/dist/client/PushpinClient/inner-client/eventsource.d.ts +22 -0
- package/dist/client/PushpinClient/inner-client/index.d.ts +39 -0
- package/dist/client/PushpinClient/inner-client/signal-listener.d.ts +47 -0
- package/dist/client/{ChatClient → PushpinClient}/state-machine.d.ts +13 -13
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.d.ts +4 -1
- package/dist/components/Block.d.ts +1 -1
- package/dist/components/Composer.d.ts +1 -1
- package/dist/components/Header.d.ts +1 -1
- package/dist/components/LoadingIndicator.d.ts +1 -1
- package/dist/components/MessageList.d.ts +1 -1
- package/dist/components/Modal.d.ts +2 -2
- package/dist/components/RestartConversation.d.ts +1 -1
- package/dist/components/Webchat.d.ts +1 -1
- package/dist/components/dev-tools/DevTools.d.ts +1 -1
- package/dist/components/renderers/Button.d.ts +1 -1
- package/dist/components/renderers/Dropdown.d.ts +1 -1
- package/dist/components/renderers/Text.d.ts +1 -1
- package/dist/contexts/WebchatContext.d.ts +4 -4
- package/dist/gen/client/api.d.ts +1694 -0
- package/dist/gen/client/base.d.ts +54 -0
- package/dist/gen/client/client.d.ts +57 -0
- package/dist/gen/client/common.d.ts +65 -0
- package/dist/gen/client/configuration.d.ts +83 -0
- package/dist/gen/client/errors.d.ts +197 -0
- package/dist/gen/client/index.d.ts +13 -0
- package/dist/gen/models/conversation.j.d.ts +20 -0
- package/dist/gen/models/conversation.t.d.ts +10 -0
- package/dist/gen/models/conversation.z.d.ts +15 -0
- package/dist/gen/models/index.d.ts +851 -0
- package/dist/gen/models/message.j.d.ts +388 -0
- package/dist/gen/models/message.t.d.ts +73 -0
- package/dist/gen/models/message.z.d.ts +372 -0
- package/dist/gen/models/user.j.d.ts +29 -0
- package/dist/gen/models/user.t.d.ts +13 -0
- package/dist/gen/models/user.z.d.ts +24 -0
- package/dist/gen/signals/customSignal.j.d.ts +24 -0
- package/dist/gen/signals/customSignal.t.d.ts +13 -0
- package/dist/gen/signals/customSignal.z.d.ts +22 -0
- package/dist/gen/signals/index.d.ts +1054 -0
- package/dist/gen/signals/messageCreatedSignal.j.d.ts +399 -0
- package/dist/gen/signals/messageCreatedSignal.t.d.ts +76 -0
- package/dist/gen/signals/messageCreatedSignal.z.d.ts +515 -0
- package/dist/gen/signals/webchatConfigSignal.j.d.ts +24 -0
- package/dist/gen/signals/webchatConfigSignal.t.d.ts +13 -0
- package/dist/gen/signals/webchatConfigSignal.z.d.ts +22 -0
- package/dist/gen/signals/webchatVisibilitySignal.j.d.ts +24 -0
- package/dist/gen/signals/webchatVisibilitySignal.t.d.ts +11 -0
- package/dist/gen/signals/webchatVisibilitySignal.z.d.ts +22 -0
- package/dist/hooks/useClient.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27937 -73852
- package/dist/index.umd.cjs +113 -154
- package/dist/options.d.ts +3 -3
- package/dist/providers/ModalProvider.d.ts +1 -1
- package/dist/providers/WebchatProvider.d.ts +3 -3
- package/openapi/index.ts +31 -0
- package/openapi/package.json +5 -0
- package/openapi/readme.md +1 -0
- package/package.json +10 -4
- package/dist/client/MessagingClient/adapters/Trigger.d.ts +0 -33
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webchat API
|
|
3
|
+
* API for the Webchat Integration
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.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 type { Configuration } from './configuration';
|
|
13
|
+
import type { 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
|
+
constructor(field: string, msg?: string);
|
|
54
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Configuration, DefaultApiGetConversationRequest, DefaultApiCreateConversationRequest, DefaultApiDeleteConversationRequest, DefaultApiListConversationsRequest, DefaultApiListenConversationRequest, DefaultApiListConversationMessagesRequest, DefaultApiAddParticipantRequest, DefaultApiRemoveParticipantRequest, DefaultApiGetParticipantRequest, DefaultApiListParticipantsRequest, DefaultApiGetMessageRequest, DefaultApiCreateMessageRequest, DefaultApiDeleteMessageRequest, DefaultApiGetUserRequest, DefaultApiCreateUserRequest, DefaultApiUpdateUserRequest, DefaultApiDeleteUserRequest } from '.';
|
|
3
|
+
type SimplifyOptions = {
|
|
4
|
+
deep?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type Flatten<AnyType, Options extends SimplifyOptions = {}> = Options['deep'] extends true ? {
|
|
7
|
+
[KeyType in keyof AnyType]: Simplify<AnyType[KeyType], Options>;
|
|
8
|
+
} : {
|
|
9
|
+
[KeyType in keyof AnyType]: AnyType[KeyType];
|
|
10
|
+
};
|
|
11
|
+
type Simplify<AnyType, Options extends SimplifyOptions = {}> = Flatten<AnyType> extends AnyType ? Flatten<AnyType, Options> : AnyType;
|
|
12
|
+
type Merge_<FirstType, SecondType> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;
|
|
13
|
+
type IsEqual<T, U> = (<G>() => G extends T ? 1 : 2) extends (<G>() => G extends U ? 1 : 2) ? true : false;
|
|
14
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
15
|
+
type Merge<FirstType, SecondType> = Simplify<Merge_<FirstType, SecondType>>;
|
|
16
|
+
type Except<ObjectType, KeysType extends keyof ObjectType> = {
|
|
17
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
18
|
+
};
|
|
19
|
+
export declare class ApiClient {
|
|
20
|
+
private _innerClient;
|
|
21
|
+
constructor(configuration?: Configuration, basePath?: string, axiosInstance?: AxiosInstance);
|
|
22
|
+
getConversation: (props: GetConversationProps) => Promise<import("./api").GetConversationResponse>;
|
|
23
|
+
createConversation: ({ xUserKey, ...createConversationBody }: CreateConversationProps) => Promise<import("./api").CreateConversationResponse>;
|
|
24
|
+
deleteConversation: (props: DeleteConversationProps) => Promise<object>;
|
|
25
|
+
listConversations: (props: ListConversationsProps) => Promise<import("./api").ListConversationsResponse>;
|
|
26
|
+
listenConversation: (props: ListenConversationProps) => Promise<object>;
|
|
27
|
+
listConversationMessages: (props: ListConversationMessagesProps) => Promise<import("./api").ListConversationMessagesResponse>;
|
|
28
|
+
addParticipant: ({ id, xUserKey, ...addParticipantBody }: AddParticipantProps) => Promise<import("./api").AddParticipantResponse>;
|
|
29
|
+
removeParticipant: (props: RemoveParticipantProps) => Promise<object>;
|
|
30
|
+
getParticipant: (props: GetParticipantProps) => Promise<import("./api").GetParticipantResponse>;
|
|
31
|
+
listParticipants: (props: ListParticipantsProps) => Promise<import("./api").ListParticipantsResponse>;
|
|
32
|
+
getMessage: (props: GetMessageProps) => Promise<import("./api").GetMessageResponse>;
|
|
33
|
+
createMessage: ({ xUserKey, ...createMessageBody }: CreateMessageProps) => Promise<import("./api").CreateMessageResponse>;
|
|
34
|
+
deleteMessage: (props: DeleteMessageProps) => Promise<object>;
|
|
35
|
+
getUser: (props: GetUserProps) => Promise<import("./api").GetUserResponse>;
|
|
36
|
+
createUser: (createUserBody: CreateUserProps) => Promise<import("./api").CreateUserResponse>;
|
|
37
|
+
updateUser: ({ xUserKey, ...updateUserBody }: UpdateUserProps) => Promise<import("./api").UpdateUserResponse>;
|
|
38
|
+
deleteUser: (props: DeleteUserProps) => Promise<object>;
|
|
39
|
+
}
|
|
40
|
+
export type GetConversationProps = Merge<DefaultApiGetConversationRequest, {}>;
|
|
41
|
+
export type CreateConversationProps = Merge<Except<DefaultApiCreateConversationRequest, 'createConversationBody'>, NonNullable<DefaultApiCreateConversationRequest['createConversationBody']>>;
|
|
42
|
+
export type DeleteConversationProps = Merge<DefaultApiDeleteConversationRequest, {}>;
|
|
43
|
+
export type ListConversationsProps = Merge<DefaultApiListConversationsRequest, {}>;
|
|
44
|
+
export type ListenConversationProps = Merge<DefaultApiListenConversationRequest, {}>;
|
|
45
|
+
export type ListConversationMessagesProps = Merge<DefaultApiListConversationMessagesRequest, {}>;
|
|
46
|
+
export type AddParticipantProps = Merge<Except<DefaultApiAddParticipantRequest, 'addParticipantBody'>, NonNullable<DefaultApiAddParticipantRequest['addParticipantBody']>>;
|
|
47
|
+
export type RemoveParticipantProps = Merge<DefaultApiRemoveParticipantRequest, {}>;
|
|
48
|
+
export type GetParticipantProps = Merge<DefaultApiGetParticipantRequest, {}>;
|
|
49
|
+
export type ListParticipantsProps = Merge<DefaultApiListParticipantsRequest, {}>;
|
|
50
|
+
export type GetMessageProps = Merge<DefaultApiGetMessageRequest, {}>;
|
|
51
|
+
export type CreateMessageProps = Merge<Except<DefaultApiCreateMessageRequest, 'createMessageBody'>, NonNullable<DefaultApiCreateMessageRequest['createMessageBody']>>;
|
|
52
|
+
export type DeleteMessageProps = Merge<DefaultApiDeleteMessageRequest, {}>;
|
|
53
|
+
export type GetUserProps = Merge<DefaultApiGetUserRequest, {}>;
|
|
54
|
+
export type CreateUserProps = Merge<Except<DefaultApiCreateUserRequest, 'createUserBody'>, NonNullable<DefaultApiCreateUserRequest['createUserBody']>>;
|
|
55
|
+
export type UpdateUserProps = Merge<Except<DefaultApiUpdateUserRequest, 'updateUserBody'>, NonNullable<DefaultApiUpdateUserRequest['updateUserBody']>>;
|
|
56
|
+
export type DeleteUserProps = Merge<DefaultApiDeleteUserRequest, {}>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webchat API
|
|
3
|
+
* API for the Webchat Integration
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.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 type { Configuration } from "./configuration";
|
|
13
|
+
import type { RequestArgs } from "./base";
|
|
14
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const toPathString: (url: URL) => string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
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
|
+
* Webchat API
|
|
3
|
+
* API for the Webchat Integration
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.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,197 @@
|
|
|
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_REQUEST_TIMEOUT: 408;
|
|
9
|
+
readonly HTTP_STATUS_CONFLICT: 409;
|
|
10
|
+
readonly HTTP_STATUS_PAYLOAD_TOO_LARGE: 413;
|
|
11
|
+
readonly HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415;
|
|
12
|
+
readonly HTTP_STATUS_TOO_MANY_REQUESTS: 429;
|
|
13
|
+
readonly HTTP_STATUS_INTERNAL_SERVER_ERROR: 500;
|
|
14
|
+
readonly HTTP_STATUS_NOT_IMPLEMENTED: 501;
|
|
15
|
+
readonly HTTP_STATUS_BAD_GATEWAY: 502;
|
|
16
|
+
readonly HTTP_STATUS_SERVICE_UNAVAILABLE: 503;
|
|
17
|
+
readonly HTTP_STATUS_GATEWAY_TIMEOUT: 504;
|
|
18
|
+
};
|
|
19
|
+
type ErrorCode = typeof codes[keyof typeof codes];
|
|
20
|
+
declare abstract class BaseApiError<Code extends ErrorCode, Type extends string, Description extends string> extends Error {
|
|
21
|
+
readonly code: Code;
|
|
22
|
+
readonly description: Description;
|
|
23
|
+
readonly type: Type;
|
|
24
|
+
readonly message: string;
|
|
25
|
+
readonly error?: Error | undefined;
|
|
26
|
+
readonly id?: string | undefined;
|
|
27
|
+
readonly isApiError = true;
|
|
28
|
+
constructor(code: Code, description: Description, type: Type, message: string, error?: Error | undefined, id?: string | undefined);
|
|
29
|
+
format(): string;
|
|
30
|
+
toJSON(): {
|
|
31
|
+
id: string | undefined;
|
|
32
|
+
code: Code;
|
|
33
|
+
type: Type;
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
static generateId(): string;
|
|
37
|
+
private static getPrefix;
|
|
38
|
+
}
|
|
39
|
+
export declare const isApiError: (thrown: unknown) => thrown is ApiError;
|
|
40
|
+
type UnknownType = 'Unknown';
|
|
41
|
+
/**
|
|
42
|
+
* An unknown error occurred
|
|
43
|
+
*/
|
|
44
|
+
export declare class UnknownError extends BaseApiError<500, UnknownType, 'An unknown error occurred'> {
|
|
45
|
+
constructor(message: string, error?: Error, id?: string);
|
|
46
|
+
}
|
|
47
|
+
type InternalType = 'Internal';
|
|
48
|
+
/**
|
|
49
|
+
* An internal error occurred
|
|
50
|
+
*/
|
|
51
|
+
export declare class InternalError extends BaseApiError<500, InternalType, 'An internal error occurred'> {
|
|
52
|
+
constructor(message: string, error?: Error, id?: string);
|
|
53
|
+
}
|
|
54
|
+
type UnauthorizedType = 'Unauthorized';
|
|
55
|
+
/**
|
|
56
|
+
* The request requires to be authenticated.
|
|
57
|
+
*/
|
|
58
|
+
export declare class UnauthorizedError extends BaseApiError<401, UnauthorizedType, 'The request requires to be authenticated.'> {
|
|
59
|
+
constructor(message: string, error?: Error, id?: string);
|
|
60
|
+
}
|
|
61
|
+
type ForbiddenType = 'Forbidden';
|
|
62
|
+
/**
|
|
63
|
+
* The requested action can\'t be peform by this resource.
|
|
64
|
+
*/
|
|
65
|
+
export declare class ForbiddenError extends BaseApiError<403, ForbiddenType, 'The requested action can\'t be peform by this resource.'> {
|
|
66
|
+
constructor(message: string, error?: Error, id?: string);
|
|
67
|
+
}
|
|
68
|
+
type PayloadTooLargeType = 'PayloadTooLarge';
|
|
69
|
+
/**
|
|
70
|
+
* The request payload is too large.
|
|
71
|
+
*/
|
|
72
|
+
export declare class PayloadTooLargeError extends BaseApiError<413, PayloadTooLargeType, 'The request payload is too large.'> {
|
|
73
|
+
constructor(message: string, error?: Error, id?: string);
|
|
74
|
+
}
|
|
75
|
+
type InvalidPayloadType = 'InvalidPayload';
|
|
76
|
+
/**
|
|
77
|
+
* The request payload is invalid.
|
|
78
|
+
*/
|
|
79
|
+
export declare class InvalidPayloadError extends BaseApiError<400, InvalidPayloadType, 'The request payload is invalid.'> {
|
|
80
|
+
constructor(message: string, error?: Error, id?: string);
|
|
81
|
+
}
|
|
82
|
+
type UnsupportedMediaTypeType = 'UnsupportedMediaType';
|
|
83
|
+
/**
|
|
84
|
+
* The request is invalid because the content-type is not supported.
|
|
85
|
+
*/
|
|
86
|
+
export declare class UnsupportedMediaTypeError extends BaseApiError<415, UnsupportedMediaTypeType, 'The request is invalid because the content-type is not supported.'> {
|
|
87
|
+
constructor(message: string, error?: Error, id?: string);
|
|
88
|
+
}
|
|
89
|
+
type MethodNotFoundType = 'MethodNotFound';
|
|
90
|
+
/**
|
|
91
|
+
* The requested method does not exist.
|
|
92
|
+
*/
|
|
93
|
+
export declare class MethodNotFoundError extends BaseApiError<405, MethodNotFoundType, 'The requested method does not exist.'> {
|
|
94
|
+
constructor(message: string, error?: Error, id?: string);
|
|
95
|
+
}
|
|
96
|
+
type ResourceNotFoundType = 'ResourceNotFound';
|
|
97
|
+
/**
|
|
98
|
+
* The requested resource does not exist.
|
|
99
|
+
*/
|
|
100
|
+
export declare class ResourceNotFoundError extends BaseApiError<404, ResourceNotFoundType, 'The requested resource does not exist.'> {
|
|
101
|
+
constructor(message: string, error?: Error, id?: string);
|
|
102
|
+
}
|
|
103
|
+
type InvalidJsonSchemaType = 'InvalidJsonSchema';
|
|
104
|
+
/**
|
|
105
|
+
* The provided JSON schema is invalid.
|
|
106
|
+
*/
|
|
107
|
+
export declare class InvalidJsonSchemaError extends BaseApiError<400, InvalidJsonSchemaType, 'The provided JSON schema is invalid.'> {
|
|
108
|
+
constructor(message: string, error?: Error, id?: string);
|
|
109
|
+
}
|
|
110
|
+
type InvalidDataFormatType = 'InvalidDataFormat';
|
|
111
|
+
/**
|
|
112
|
+
* The provided data doesn\'t respect the provided JSON schema.
|
|
113
|
+
*/
|
|
114
|
+
export declare class InvalidDataFormatError extends BaseApiError<400, InvalidDataFormatType, 'The provided data doesn\'t respect the provided JSON schema.'> {
|
|
115
|
+
constructor(message: string, error?: Error, id?: string);
|
|
116
|
+
}
|
|
117
|
+
type InvalidIdentifierType = 'InvalidIdentifier';
|
|
118
|
+
/**
|
|
119
|
+
* 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.
|
|
120
|
+
*/
|
|
121
|
+
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.'> {
|
|
122
|
+
constructor(message: string, error?: Error, id?: string);
|
|
123
|
+
}
|
|
124
|
+
type RelationConflictType = 'RelationConflict';
|
|
125
|
+
/**
|
|
126
|
+
* The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren\'t linked together.
|
|
127
|
+
*/
|
|
128
|
+
export declare class RelationConflictError extends BaseApiError<409, RelationConflictType, 'The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren\'t linked together.'> {
|
|
129
|
+
constructor(message: string, error?: Error, id?: string);
|
|
130
|
+
}
|
|
131
|
+
type ReferenceConstraintType = 'ReferenceConstraint';
|
|
132
|
+
/**
|
|
133
|
+
* The resource cannot be deleted because it\'s referenced by another resource
|
|
134
|
+
*/
|
|
135
|
+
export declare class ReferenceConstraintError extends BaseApiError<409, ReferenceConstraintType, 'The resource cannot be deleted because it\'s referenced by another resource'> {
|
|
136
|
+
constructor(message: string, error?: Error, id?: string);
|
|
137
|
+
}
|
|
138
|
+
type ReferenceNotFoundType = 'ReferenceNotFound';
|
|
139
|
+
/**
|
|
140
|
+
* The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
|
|
141
|
+
*/
|
|
142
|
+
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.'> {
|
|
143
|
+
constructor(message: string, error?: Error, id?: string);
|
|
144
|
+
}
|
|
145
|
+
type InvalidQueryType = 'InvalidQuery';
|
|
146
|
+
/**
|
|
147
|
+
* The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.
|
|
148
|
+
*/
|
|
149
|
+
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.'> {
|
|
150
|
+
constructor(message: string, error?: Error, id?: string);
|
|
151
|
+
}
|
|
152
|
+
type RuntimeType = 'Runtime';
|
|
153
|
+
/**
|
|
154
|
+
* An error happened during the execution of a runtime (bot or integration).
|
|
155
|
+
*/
|
|
156
|
+
export declare class RuntimeError extends BaseApiError<400, RuntimeType, 'An error happened during the execution of a runtime (bot or integration).'> {
|
|
157
|
+
constructor(message: string, error?: Error, id?: string);
|
|
158
|
+
}
|
|
159
|
+
type AlreadyExistsType = 'AlreadyExists';
|
|
160
|
+
/**
|
|
161
|
+
* The record attempted to be created already exists.
|
|
162
|
+
*/
|
|
163
|
+
export declare class AlreadyExistsError extends BaseApiError<409, AlreadyExistsType, 'The record attempted to be created already exists.'> {
|
|
164
|
+
constructor(message: string, error?: Error, id?: string);
|
|
165
|
+
}
|
|
166
|
+
type RateLimitedType = 'RateLimited';
|
|
167
|
+
/**
|
|
168
|
+
* The request has been rate limited.
|
|
169
|
+
*/
|
|
170
|
+
export declare class RateLimitedError extends BaseApiError<429, RateLimitedType, 'The request has been rate limited.'> {
|
|
171
|
+
constructor(message: string, error?: Error, id?: string);
|
|
172
|
+
}
|
|
173
|
+
type PaymentRequiredType = 'PaymentRequired';
|
|
174
|
+
/**
|
|
175
|
+
* A payment is required to perform this request.
|
|
176
|
+
*/
|
|
177
|
+
export declare class PaymentRequiredError extends BaseApiError<402, PaymentRequiredType, 'A payment is required to perform this request.'> {
|
|
178
|
+
constructor(message: string, error?: Error, id?: string);
|
|
179
|
+
}
|
|
180
|
+
type QuotaExceededType = 'QuotaExceeded';
|
|
181
|
+
/**
|
|
182
|
+
* The request exceeds the allowed quota. Quotas are a soft limit that can be increased.
|
|
183
|
+
*/
|
|
184
|
+
export declare class QuotaExceededError extends BaseApiError<403, QuotaExceededType, 'The request exceeds the allowed quota. Quotas are a soft limit that can be increased.'> {
|
|
185
|
+
constructor(message: string, error?: Error, id?: string);
|
|
186
|
+
}
|
|
187
|
+
type LimitExceededType = 'LimitExceeded';
|
|
188
|
+
/**
|
|
189
|
+
* The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.
|
|
190
|
+
*/
|
|
191
|
+
export declare class LimitExceededError extends BaseApiError<413, LimitExceededType, 'The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.'> {
|
|
192
|
+
constructor(message: string, error?: Error, id?: string);
|
|
193
|
+
}
|
|
194
|
+
export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceConstraint' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited' | 'PaymentRequired' | 'QuotaExceeded' | 'LimitExceeded';
|
|
195
|
+
export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceConstraintError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError | PaymentRequiredError | QuotaExceededError | LimitExceededError;
|
|
196
|
+
export declare const errorFrom: (err: unknown) => ApiError;
|
|
197
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webchat API
|
|
3
|
+
* API for the Webchat Integration
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.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";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
properties: {
|
|
4
|
+
id: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
createdAt: {
|
|
8
|
+
type: string;
|
|
9
|
+
format: string;
|
|
10
|
+
};
|
|
11
|
+
updatedAt: {
|
|
12
|
+
type: string;
|
|
13
|
+
format: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
required: string[];
|
|
17
|
+
additionalProperties: boolean;
|
|
18
|
+
$schema: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
3
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
5
|
+
*/
|
|
6
|
+
export interface Conversation {
|
|
7
|
+
id: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const _default: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
createdAt: z.ZodString;
|
|
5
|
+
updatedAt: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
id: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
}, {
|
|
11
|
+
id: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}>;
|
|
15
|
+
export default _default;
|