@holocronlab/botruntime-chat 0.5.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.
Files changed (59) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +64 -0
  3. package/dist/client.d.ts +363 -0
  4. package/dist/consts.d.ts +1 -0
  5. package/dist/errors.d.ts +20 -0
  6. package/dist/event-emitter.d.ts +10 -0
  7. package/dist/eventsource.d.ts +32 -0
  8. package/dist/gen/client/errors.d.ts +229 -0
  9. package/dist/gen/client/index.d.ts +77 -0
  10. package/dist/gen/client/models.d.ts +212 -0
  11. package/dist/gen/client/operations/addParticipant.d.ts +55 -0
  12. package/dist/gen/client/operations/createConversation.d.ts +39 -0
  13. package/dist/gen/client/operations/createEvent.d.ts +55 -0
  14. package/dist/gen/client/operations/createMessage.d.ts +294 -0
  15. package/dist/gen/client/operations/createUser.d.ts +66 -0
  16. package/dist/gen/client/operations/deleteConversation.d.ts +22 -0
  17. package/dist/gen/client/operations/deleteMessage.d.ts +22 -0
  18. package/dist/gen/client/operations/deleteUser.d.ts +21 -0
  19. package/dist/gen/client/operations/getConversation.d.ts +36 -0
  20. package/dist/gen/client/operations/getEvent.d.ts +46 -0
  21. package/dist/gen/client/operations/getMessage.d.ts +167 -0
  22. package/dist/gen/client/operations/getOrCreateConversation.d.ts +39 -0
  23. package/dist/gen/client/operations/getOrCreateUser.d.ts +62 -0
  24. package/dist/gen/client/operations/getParticipant.d.ts +52 -0
  25. package/dist/gen/client/operations/getUser.d.ts +50 -0
  26. package/dist/gen/client/operations/listConversations.d.ts +42 -0
  27. package/dist/gen/client/operations/listMessages.d.ts +171 -0
  28. package/dist/gen/client/operations/listParticipants.d.ts +55 -0
  29. package/dist/gen/client/operations/listenConversation.d.ts +22 -0
  30. package/dist/gen/client/operations/removeParticipant.d.ts +23 -0
  31. package/dist/gen/client/operations/updateUser.d.ts +62 -0
  32. package/dist/gen/client/to-axios.d.ts +16 -0
  33. package/dist/gen/signals/eventCreated.j.d.ts +3 -0
  34. package/dist/gen/signals/eventCreated.t.d.ts +28 -0
  35. package/dist/gen/signals/eventCreated.z.d.ts +47 -0
  36. package/dist/gen/signals/index.d.ts +924 -0
  37. package/dist/gen/signals/messageCreated.j.d.ts +3 -0
  38. package/dist/gen/signals/messageCreated.t.d.ts +149 -0
  39. package/dist/gen/signals/messageCreated.z.d.ts +780 -0
  40. package/dist/gen/signals/messageDeleted.j.d.ts +3 -0
  41. package/dist/gen/signals/messageDeleted.t.d.ts +8 -0
  42. package/dist/gen/signals/messageDeleted.z.d.ts +32 -0
  43. package/dist/gen/signals/participantAdded.j.d.ts +3 -0
  44. package/dist/gen/signals/participantAdded.t.d.ts +7 -0
  45. package/dist/gen/signals/participantAdded.z.d.ts +27 -0
  46. package/dist/gen/signals/participantRemoved.j.d.ts +3 -0
  47. package/dist/gen/signals/participantRemoved.t.d.ts +7 -0
  48. package/dist/gen/signals/participantRemoved.z.d.ts +27 -0
  49. package/dist/index.cjs +1660 -0
  50. package/dist/index.cjs.map +7 -0
  51. package/dist/index.d.ts +5 -0
  52. package/dist/index.mjs +138836 -0
  53. package/dist/index.mjs.map +7 -0
  54. package/dist/jsonwebtoken.d.ts +3 -0
  55. package/dist/listing.d.ts +16 -0
  56. package/dist/signal-listener.d.ts +51 -0
  57. package/dist/types.d.ts +41 -0
  58. package/dist/watchdog.d.ts +11 -0
  59. package/package.json +35 -0
@@ -0,0 +1,39 @@
1
+ export interface GetOrCreateConversationRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface GetOrCreateConversationRequestQuery {
5
+ }
6
+ export interface GetOrCreateConversationRequestParams {
7
+ }
8
+ export interface GetOrCreateConversationRequestBody {
9
+ /**
10
+ * Identifier of the [Conversation](#schema_conversation)
11
+ */
12
+ id: string;
13
+ }
14
+ export type GetOrCreateConversationInput = GetOrCreateConversationRequestBody & GetOrCreateConversationRequestHeaders & GetOrCreateConversationRequestQuery & GetOrCreateConversationRequestParams;
15
+ export type GetOrCreateConversationRequest = {
16
+ headers: GetOrCreateConversationRequestHeaders;
17
+ query: GetOrCreateConversationRequestQuery;
18
+ params: GetOrCreateConversationRequestParams;
19
+ body: GetOrCreateConversationRequestBody;
20
+ };
21
+ export declare const parseReq: (input: GetOrCreateConversationInput) => GetOrCreateConversationRequest & {
22
+ path: string;
23
+ };
24
+ export interface GetOrCreateConversationResponse {
25
+ conversation: {
26
+ /**
27
+ * Identifier of the [Conversation](#schema_conversation)
28
+ */
29
+ id: string;
30
+ /**
31
+ * Creation date of the [Conversation](#schema_conversation) in ISO 8601 format
32
+ */
33
+ createdAt: string;
34
+ /**
35
+ * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
36
+ */
37
+ updatedAt: string;
38
+ };
39
+ }
@@ -0,0 +1,62 @@
1
+ export interface GetOrCreateUserRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface GetOrCreateUserRequestQuery {
5
+ }
6
+ export interface GetOrCreateUserRequestParams {
7
+ }
8
+ export interface GetOrCreateUserRequestBody {
9
+ /**
10
+ * Name of the [User](#schema_user) (not a unique identifier)
11
+ */
12
+ name?: string;
13
+ /**
14
+ * Picture url of the [User](#schema_user)
15
+ */
16
+ pictureUrl?: string;
17
+ /**
18
+ * Custom profile data of the [User](#schema_user) encoded as a string
19
+ */
20
+ profile?: string;
21
+ }
22
+ export type GetOrCreateUserInput = GetOrCreateUserRequestBody & GetOrCreateUserRequestHeaders & GetOrCreateUserRequestQuery & GetOrCreateUserRequestParams;
23
+ export type GetOrCreateUserRequest = {
24
+ headers: GetOrCreateUserRequestHeaders;
25
+ query: GetOrCreateUserRequestQuery;
26
+ params: GetOrCreateUserRequestParams;
27
+ body: GetOrCreateUserRequestBody;
28
+ };
29
+ export declare const parseReq: (input: GetOrCreateUserInput) => GetOrCreateUserRequest & {
30
+ path: string;
31
+ };
32
+ export interface GetOrCreateUserResponse {
33
+ /**
34
+ * The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
35
+ */
36
+ user: {
37
+ /**
38
+ * Identifier of the [User](#schema_user)
39
+ */
40
+ id: string;
41
+ /**
42
+ * Name of the [User](#schema_user)
43
+ */
44
+ name?: string;
45
+ /**
46
+ * Picture url of the [User](#schema_user)
47
+ */
48
+ pictureUrl?: string;
49
+ /**
50
+ * Custom profile data of the [User](#schema_user) encoded as a string
51
+ */
52
+ profile?: string;
53
+ /**
54
+ * Creation date of the [User](#schema_user) in ISO 8601 format
55
+ */
56
+ createdAt: string;
57
+ /**
58
+ * Updating date of the [User](#schema_user) in ISO 8601 format
59
+ */
60
+ updatedAt: string;
61
+ };
62
+ }
@@ -0,0 +1,52 @@
1
+ export interface GetParticipantRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface GetParticipantRequestQuery {
5
+ }
6
+ export interface GetParticipantRequestParams {
7
+ conversationId: string;
8
+ userId: string;
9
+ }
10
+ export interface GetParticipantRequestBody {
11
+ }
12
+ export type GetParticipantInput = GetParticipantRequestBody & GetParticipantRequestHeaders & GetParticipantRequestQuery & GetParticipantRequestParams;
13
+ export type GetParticipantRequest = {
14
+ headers: GetParticipantRequestHeaders;
15
+ query: GetParticipantRequestQuery;
16
+ params: GetParticipantRequestParams;
17
+ body: GetParticipantRequestBody;
18
+ };
19
+ export declare const parseReq: (input: GetParticipantInput) => GetParticipantRequest & {
20
+ path: string;
21
+ };
22
+ export interface GetParticipantResponse {
23
+ /**
24
+ * The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
25
+ */
26
+ participant: {
27
+ /**
28
+ * Identifier of the [User](#schema_user)
29
+ */
30
+ id: string;
31
+ /**
32
+ * Name of the [User](#schema_user)
33
+ */
34
+ name?: string;
35
+ /**
36
+ * Picture url of the [User](#schema_user)
37
+ */
38
+ pictureUrl?: string;
39
+ /**
40
+ * Custom profile data of the [User](#schema_user) encoded as a string
41
+ */
42
+ profile?: string;
43
+ /**
44
+ * Creation date of the [User](#schema_user) in ISO 8601 format
45
+ */
46
+ createdAt: string;
47
+ /**
48
+ * Updating date of the [User](#schema_user) in ISO 8601 format
49
+ */
50
+ updatedAt: string;
51
+ };
52
+ }
@@ -0,0 +1,50 @@
1
+ export interface GetUserRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface GetUserRequestQuery {
5
+ }
6
+ export interface GetUserRequestParams {
7
+ }
8
+ export interface GetUserRequestBody {
9
+ }
10
+ export type GetUserInput = GetUserRequestBody & GetUserRequestHeaders & GetUserRequestQuery & GetUserRequestParams;
11
+ export type GetUserRequest = {
12
+ headers: GetUserRequestHeaders;
13
+ query: GetUserRequestQuery;
14
+ params: GetUserRequestParams;
15
+ body: GetUserRequestBody;
16
+ };
17
+ export declare const parseReq: (input: GetUserInput) => GetUserRequest & {
18
+ path: string;
19
+ };
20
+ export interface GetUserResponse {
21
+ /**
22
+ * The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
23
+ */
24
+ user: {
25
+ /**
26
+ * Identifier of the [User](#schema_user)
27
+ */
28
+ id: string;
29
+ /**
30
+ * Name of the [User](#schema_user)
31
+ */
32
+ name?: string;
33
+ /**
34
+ * Picture url of the [User](#schema_user)
35
+ */
36
+ pictureUrl?: string;
37
+ /**
38
+ * Custom profile data of the [User](#schema_user) encoded as a string
39
+ */
40
+ profile?: string;
41
+ /**
42
+ * Creation date of the [User](#schema_user) in ISO 8601 format
43
+ */
44
+ createdAt: string;
45
+ /**
46
+ * Updating date of the [User](#schema_user) in ISO 8601 format
47
+ */
48
+ updatedAt: string;
49
+ };
50
+ }
@@ -0,0 +1,42 @@
1
+ export interface ListConversationsRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface ListConversationsRequestQuery {
5
+ nextToken?: string;
6
+ }
7
+ export interface ListConversationsRequestParams {
8
+ }
9
+ export interface ListConversationsRequestBody {
10
+ }
11
+ export type ListConversationsInput = ListConversationsRequestBody & ListConversationsRequestHeaders & ListConversationsRequestQuery & ListConversationsRequestParams;
12
+ export type ListConversationsRequest = {
13
+ headers: ListConversationsRequestHeaders;
14
+ query: ListConversationsRequestQuery;
15
+ params: ListConversationsRequestParams;
16
+ body: ListConversationsRequestBody;
17
+ };
18
+ export declare const parseReq: (input: ListConversationsInput) => ListConversationsRequest & {
19
+ path: string;
20
+ };
21
+ export interface ListConversationsResponse {
22
+ conversations: {
23
+ /**
24
+ * Identifier of the [Conversation](#schema_conversation)
25
+ */
26
+ id: string;
27
+ /**
28
+ * Creation date of the [Conversation](#schema_conversation) in ISO 8601 format
29
+ */
30
+ createdAt: string;
31
+ /**
32
+ * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
33
+ */
34
+ updatedAt: string;
35
+ }[];
36
+ meta: {
37
+ /**
38
+ * The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.
39
+ */
40
+ nextToken?: string;
41
+ };
42
+ }
@@ -0,0 +1,171 @@
1
+ export interface ListMessagesRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface ListMessagesRequestQuery {
5
+ nextToken?: string;
6
+ }
7
+ export interface ListMessagesRequestParams {
8
+ conversationId: string;
9
+ }
10
+ export interface ListMessagesRequestBody {
11
+ }
12
+ export type ListMessagesInput = ListMessagesRequestBody & ListMessagesRequestHeaders & ListMessagesRequestQuery & ListMessagesRequestParams;
13
+ export type ListMessagesRequest = {
14
+ headers: ListMessagesRequestHeaders;
15
+ query: ListMessagesRequestQuery;
16
+ params: ListMessagesRequestParams;
17
+ body: ListMessagesRequestBody;
18
+ };
19
+ export declare const parseReq: (input: ListMessagesInput) => ListMessagesRequest & {
20
+ path: string;
21
+ };
22
+ export interface ListMessagesResponse {
23
+ messages: {
24
+ /**
25
+ * Identifier of the [Message](#schema_message)
26
+ */
27
+ id: string;
28
+ /**
29
+ * Creation date of the [Message](#schema_message) in ISO 8601 format
30
+ */
31
+ createdAt: string;
32
+ /**
33
+ * Payload is the content type of the message.
34
+ */
35
+ payload: {
36
+ type: "audio";
37
+ audioUrl: string;
38
+ [k: string]: any;
39
+ } | {
40
+ type: "card";
41
+ title: string;
42
+ subtitle?: string;
43
+ imageUrl?: string;
44
+ actions: {
45
+ action: "postback" | "url" | "say";
46
+ label: string;
47
+ value: string;
48
+ [k: string]: any;
49
+ }[];
50
+ [k: string]: any;
51
+ } | {
52
+ type: "carousel";
53
+ items: {
54
+ type: "card";
55
+ title: string;
56
+ subtitle?: string;
57
+ imageUrl?: string;
58
+ actions: {
59
+ action: "postback" | "url" | "say";
60
+ label: string;
61
+ value: string;
62
+ [k: string]: any;
63
+ }[];
64
+ [k: string]: any;
65
+ }[];
66
+ [k: string]: any;
67
+ } | {
68
+ text: string;
69
+ options: {
70
+ label: string;
71
+ value: string;
72
+ [k: string]: any;
73
+ }[];
74
+ type: "choice";
75
+ [k: string]: any;
76
+ } | {
77
+ text: string;
78
+ options: {
79
+ label: string;
80
+ value: string;
81
+ [k: string]: any;
82
+ }[];
83
+ type: "dropdown";
84
+ [k: string]: any;
85
+ } | {
86
+ type: "file";
87
+ fileUrl: string;
88
+ title?: string;
89
+ [k: string]: any;
90
+ } | {
91
+ type: "image";
92
+ imageUrl: string;
93
+ [k: string]: any;
94
+ } | {
95
+ type: "location";
96
+ latitude: number;
97
+ longitude: number;
98
+ address?: string;
99
+ title?: string;
100
+ [k: string]: any;
101
+ } | {
102
+ type: "text";
103
+ text: string;
104
+ [k: string]: any;
105
+ } | {
106
+ type: "video";
107
+ videoUrl: string;
108
+ [k: string]: any;
109
+ } | {
110
+ type: "markdown";
111
+ markdown: string;
112
+ [k: string]: any;
113
+ } | {
114
+ type: "bloc";
115
+ items: ({
116
+ type: "text";
117
+ text: string;
118
+ [k: string]: any;
119
+ } | {
120
+ type: "markdown";
121
+ markdown: string;
122
+ [k: string]: any;
123
+ } | {
124
+ type: "image";
125
+ imageUrl: string;
126
+ [k: string]: any;
127
+ } | {
128
+ type: "audio";
129
+ audioUrl: string;
130
+ [k: string]: any;
131
+ } | {
132
+ type: "video";
133
+ videoUrl: string;
134
+ [k: string]: any;
135
+ } | {
136
+ type: "file";
137
+ fileUrl: string;
138
+ title?: string;
139
+ [k: string]: any;
140
+ } | {
141
+ type: "location";
142
+ latitude: number;
143
+ longitude: number;
144
+ address?: string;
145
+ title?: string;
146
+ [k: string]: any;
147
+ })[];
148
+ [k: string]: any;
149
+ };
150
+ /**
151
+ * ID of the [User](#schema_user)
152
+ */
153
+ userId: string;
154
+ /**
155
+ * ID of the [Conversation](#schema_conversation)
156
+ */
157
+ conversationId: string;
158
+ /**
159
+ * Metadata of the message
160
+ */
161
+ metadata?: {
162
+ [k: string]: any | null;
163
+ };
164
+ }[];
165
+ meta: {
166
+ /**
167
+ * The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.
168
+ */
169
+ nextToken?: string;
170
+ };
171
+ }
@@ -0,0 +1,55 @@
1
+ export interface ListParticipantsRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface ListParticipantsRequestQuery {
5
+ nextToken?: string;
6
+ }
7
+ export interface ListParticipantsRequestParams {
8
+ conversationId: string;
9
+ }
10
+ export interface ListParticipantsRequestBody {
11
+ }
12
+ export type ListParticipantsInput = ListParticipantsRequestBody & ListParticipantsRequestHeaders & ListParticipantsRequestQuery & ListParticipantsRequestParams;
13
+ export type ListParticipantsRequest = {
14
+ headers: ListParticipantsRequestHeaders;
15
+ query: ListParticipantsRequestQuery;
16
+ params: ListParticipantsRequestParams;
17
+ body: ListParticipantsRequestBody;
18
+ };
19
+ export declare const parseReq: (input: ListParticipantsInput) => ListParticipantsRequest & {
20
+ path: string;
21
+ };
22
+ export interface ListParticipantsResponse {
23
+ participants: {
24
+ /**
25
+ * Identifier of the [User](#schema_user)
26
+ */
27
+ id: string;
28
+ /**
29
+ * Name of the [User](#schema_user)
30
+ */
31
+ name?: string;
32
+ /**
33
+ * Picture url of the [User](#schema_user)
34
+ */
35
+ pictureUrl?: string;
36
+ /**
37
+ * Custom profile data of the [User](#schema_user) encoded as a string
38
+ */
39
+ profile?: string;
40
+ /**
41
+ * Creation date of the [User](#schema_user) in ISO 8601 format
42
+ */
43
+ createdAt: string;
44
+ /**
45
+ * Updating date of the [User](#schema_user) in ISO 8601 format
46
+ */
47
+ updatedAt: string;
48
+ }[];
49
+ meta: {
50
+ /**
51
+ * The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.
52
+ */
53
+ nextToken?: string;
54
+ };
55
+ }
@@ -0,0 +1,22 @@
1
+ export interface ListenConversationRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface ListenConversationRequestQuery {
5
+ }
6
+ export interface ListenConversationRequestParams {
7
+ id: string;
8
+ }
9
+ export interface ListenConversationRequestBody {
10
+ }
11
+ export type ListenConversationInput = ListenConversationRequestBody & ListenConversationRequestHeaders & ListenConversationRequestQuery & ListenConversationRequestParams;
12
+ export type ListenConversationRequest = {
13
+ headers: ListenConversationRequestHeaders;
14
+ query: ListenConversationRequestQuery;
15
+ params: ListenConversationRequestParams;
16
+ body: ListenConversationRequestBody;
17
+ };
18
+ export declare const parseReq: (input: ListenConversationInput) => ListenConversationRequest & {
19
+ path: string;
20
+ };
21
+ export interface ListenConversationResponse {
22
+ }
@@ -0,0 +1,23 @@
1
+ export interface RemoveParticipantRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface RemoveParticipantRequestQuery {
5
+ }
6
+ export interface RemoveParticipantRequestParams {
7
+ conversationId: string;
8
+ userId: string;
9
+ }
10
+ export interface RemoveParticipantRequestBody {
11
+ }
12
+ export type RemoveParticipantInput = RemoveParticipantRequestBody & RemoveParticipantRequestHeaders & RemoveParticipantRequestQuery & RemoveParticipantRequestParams;
13
+ export type RemoveParticipantRequest = {
14
+ headers: RemoveParticipantRequestHeaders;
15
+ query: RemoveParticipantRequestQuery;
16
+ params: RemoveParticipantRequestParams;
17
+ body: RemoveParticipantRequestBody;
18
+ };
19
+ export declare const parseReq: (input: RemoveParticipantInput) => RemoveParticipantRequest & {
20
+ path: string;
21
+ };
22
+ export interface RemoveParticipantResponse {
23
+ }
@@ -0,0 +1,62 @@
1
+ export interface UpdateUserRequestHeaders {
2
+ "x-user-key": string;
3
+ }
4
+ export interface UpdateUserRequestQuery {
5
+ }
6
+ export interface UpdateUserRequestParams {
7
+ }
8
+ export interface UpdateUserRequestBody {
9
+ /**
10
+ * Name of the [User](#schema_user) (not a unique identifier)
11
+ */
12
+ name?: string;
13
+ /**
14
+ * Picture url of the [User](#schema_user)
15
+ */
16
+ pictureUrl?: string;
17
+ /**
18
+ * Custom profile data of the [User](#schema_user) encoded as a string
19
+ */
20
+ profile?: string;
21
+ }
22
+ export type UpdateUserInput = UpdateUserRequestBody & UpdateUserRequestHeaders & UpdateUserRequestQuery & UpdateUserRequestParams;
23
+ export type UpdateUserRequest = {
24
+ headers: UpdateUserRequestHeaders;
25
+ query: UpdateUserRequestQuery;
26
+ params: UpdateUserRequestParams;
27
+ body: UpdateUserRequestBody;
28
+ };
29
+ export declare const parseReq: (input: UpdateUserInput) => UpdateUserRequest & {
30
+ path: string;
31
+ };
32
+ export interface UpdateUserResponse {
33
+ /**
34
+ * The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
35
+ */
36
+ user: {
37
+ /**
38
+ * Identifier of the [User](#schema_user)
39
+ */
40
+ id: string;
41
+ /**
42
+ * Name of the [User](#schema_user)
43
+ */
44
+ name?: string;
45
+ /**
46
+ * Picture url of the [User](#schema_user)
47
+ */
48
+ pictureUrl?: string;
49
+ /**
50
+ * Custom profile data of the [User](#schema_user) encoded as a string
51
+ */
52
+ profile?: string;
53
+ /**
54
+ * Creation date of the [User](#schema_user) in ISO 8601 format
55
+ */
56
+ createdAt: string;
57
+ /**
58
+ * Updating date of the [User](#schema_user) in ISO 8601 format
59
+ */
60
+ updatedAt: string;
61
+ };
62
+ }
@@ -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;
@@ -0,0 +1,3 @@
1
+ import type { JSONSchema7 } from 'json-schema';
2
+ declare const schema: JSONSchema7;
3
+ export default schema;
@@ -0,0 +1,28 @@
1
+ export interface EventCreated {
2
+ type: "event_created";
3
+ data: {
4
+ /**
5
+ * Creation date of the custom [Event](#schema_event) in ISO 8601 format
6
+ */
7
+ createdAt: string;
8
+ /**
9
+ * Payload is the content of the custom event.
10
+ */
11
+ payload: {
12
+ [k: string]: any;
13
+ };
14
+ /**
15
+ * ID of the [Conversation](#schema_conversation).
16
+ */
17
+ conversationId: string;
18
+ /**
19
+ * ID of the [User](#schema_user).
20
+ */
21
+ userId: string;
22
+ id: string | null;
23
+ /**
24
+ * Whether the event was created by the bot or not
25
+ */
26
+ isBot: boolean;
27
+ };
28
+ }
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+ declare const _default: z.ZodObject<{
3
+ type: z.ZodLiteral<"event_created">;
4
+ data: z.ZodObject<{
5
+ createdAt: z.ZodString;
6
+ payload: z.ZodRecord<z.ZodString, z.ZodAny>;
7
+ conversationId: z.ZodString;
8
+ userId: z.ZodString;
9
+ id: z.ZodUnion<[z.ZodString, z.ZodNull]>;
10
+ isBot: z.ZodBoolean;
11
+ }, "strip", z.ZodTypeAny, {
12
+ id: string | null;
13
+ conversationId: string;
14
+ userId: string;
15
+ payload: Record<string, any>;
16
+ createdAt: string;
17
+ isBot: boolean;
18
+ }, {
19
+ id: string | null;
20
+ conversationId: string;
21
+ userId: string;
22
+ payload: Record<string, any>;
23
+ createdAt: string;
24
+ isBot: boolean;
25
+ }>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ type: "event_created";
28
+ data: {
29
+ id: string | null;
30
+ conversationId: string;
31
+ userId: string;
32
+ payload: Record<string, any>;
33
+ createdAt: string;
34
+ isBot: boolean;
35
+ };
36
+ }, {
37
+ type: "event_created";
38
+ data: {
39
+ id: string | null;
40
+ conversationId: string;
41
+ userId: string;
42
+ payload: Record<string, any>;
43
+ createdAt: string;
44
+ isBot: boolean;
45
+ };
46
+ }>;
47
+ export default _default;