@lorikeetai/node-sdk 0.6.3 → 0.8.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/CHANGELOG.md +48 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/core.d.ts +1 -1
- package/core.d.ts.map +1 -1
- package/core.js +14 -5
- package/core.js.map +1 -1
- package/core.mjs +14 -5
- package/core.mjs.map +1 -1
- package/error.d.ts +18 -24
- package/error.d.ts.map +1 -1
- package/error.js +1 -31
- package/error.js.map +1 -1
- package/error.mjs +1 -31
- package/error.mjs.map +1 -1
- package/index.d.mts +5 -5
- package/index.d.ts +5 -5
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/resources/conversation/chat.d.ts +145 -4
- package/resources/conversation/chat.d.ts.map +1 -1
- package/resources/conversation/email.d.ts +145 -4
- package/resources/conversation/email.d.ts.map +1 -1
- package/resources/customer.d.ts.map +1 -1
- package/resources/customer.js +1 -5
- package/resources/customer.js.map +1 -1
- package/resources/customer.mjs +1 -5
- package/resources/customer.mjs.map +1 -1
- package/src/core.ts +15 -5
- package/src/error.ts +24 -40
- package/src/index.ts +5 -5
- package/src/resources/conversation/chat.ts +193 -4
- package/src/resources/conversation/email.ts +193 -4
- package/src/resources/customer.ts +1 -5
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -14,25 +14,56 @@ export interface EmailGenerateResponse {
|
|
|
14
14
|
* The timestamp of the when the conversation was created in our system.
|
|
15
15
|
*/
|
|
16
16
|
createdAt: string;
|
|
17
|
+
/**
|
|
18
|
+
* The events that have occurred in the conversation. Can be used for deriving more
|
|
19
|
+
* information about the conversation.
|
|
20
|
+
*/
|
|
21
|
+
events: Array<EmailGenerateResponse.Event>;
|
|
17
22
|
/**
|
|
18
23
|
* The latest message type - useful for polling
|
|
19
24
|
*/
|
|
20
|
-
latestMessageType: 'CUSTOMER' | '
|
|
25
|
+
latestMessageType: 'CUSTOMER' | 'BOT_RESPONSE' | 'PENDING_RESPONSE' | 'DRAFT_RESPONSE';
|
|
21
26
|
/**
|
|
22
27
|
* The full list of messages. This endpoint supports markdown.
|
|
23
28
|
*/
|
|
24
29
|
messages: Array<EmailGenerateResponse.Message>;
|
|
30
|
+
/**
|
|
31
|
+
* The status of the conversation
|
|
32
|
+
*/
|
|
33
|
+
status: 'Unprocessed' | 'Processing' | 'Unhandled' | 'Responded' | 'Error' | 'Escalated' | 'Processed';
|
|
25
34
|
/**
|
|
26
35
|
* The timestamp of when the ticket was last updated in our system.
|
|
27
36
|
*/
|
|
28
37
|
updatedAt: string;
|
|
29
38
|
}
|
|
30
39
|
export declare namespace EmailGenerateResponse {
|
|
40
|
+
interface Event {
|
|
41
|
+
/**
|
|
42
|
+
* The ID of the event
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
/**
|
|
46
|
+
* The timestamp of the event
|
|
47
|
+
*/
|
|
48
|
+
createdAt: string;
|
|
49
|
+
/**
|
|
50
|
+
* Any specific data associated with the event
|
|
51
|
+
*/
|
|
52
|
+
data: unknown;
|
|
53
|
+
/**
|
|
54
|
+
* The type of the event
|
|
55
|
+
*/
|
|
56
|
+
type: 'ASSIGNED' | 'CLOSED' | 'ESCALATED' | 'ESCALATION_REQUEST' | 'PROCESSING_CANCELLED' | 'HOSTILE_MESSAGE';
|
|
57
|
+
}
|
|
31
58
|
interface Message {
|
|
32
59
|
/**
|
|
33
60
|
* The ID of the conversation message
|
|
34
61
|
*/
|
|
35
62
|
id: string;
|
|
63
|
+
/**
|
|
64
|
+
* Attachments that were attached to the message
|
|
65
|
+
*/
|
|
66
|
+
attachments: Array<Message.Attachment>;
|
|
36
67
|
/**
|
|
37
68
|
* The content of the message. Markdown on plain text.
|
|
38
69
|
*/
|
|
@@ -48,7 +79,23 @@ export declare namespace EmailGenerateResponse {
|
|
|
48
79
|
/**
|
|
49
80
|
* The type of the message
|
|
50
81
|
*/
|
|
51
|
-
type: 'CUSTOMER' | '
|
|
82
|
+
type: 'CUSTOMER' | 'BOT_RESPONSE' | 'PENDING_RESPONSE' | 'DRAFT_RESPONSE';
|
|
83
|
+
}
|
|
84
|
+
namespace Message {
|
|
85
|
+
interface Attachment {
|
|
86
|
+
/**
|
|
87
|
+
* The name of the attachment
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
/**
|
|
91
|
+
* The type of the attachment
|
|
92
|
+
*/
|
|
93
|
+
type: string;
|
|
94
|
+
/**
|
|
95
|
+
* The URL of the attachment
|
|
96
|
+
*/
|
|
97
|
+
url: string;
|
|
98
|
+
}
|
|
52
99
|
}
|
|
53
100
|
}
|
|
54
101
|
export interface EmailGetResponse {
|
|
@@ -60,25 +107,56 @@ export interface EmailGetResponse {
|
|
|
60
107
|
* The timestamp of the when the conversation was created in our system.
|
|
61
108
|
*/
|
|
62
109
|
createdAt: string;
|
|
110
|
+
/**
|
|
111
|
+
* The events that have occurred in the conversation. Can be used for deriving more
|
|
112
|
+
* information about the conversation.
|
|
113
|
+
*/
|
|
114
|
+
events: Array<EmailGetResponse.Event>;
|
|
63
115
|
/**
|
|
64
116
|
* The latest message type - useful for polling
|
|
65
117
|
*/
|
|
66
|
-
latestMessageType: 'CUSTOMER' | '
|
|
118
|
+
latestMessageType: 'CUSTOMER' | 'BOT_RESPONSE' | 'PENDING_RESPONSE' | 'DRAFT_RESPONSE';
|
|
67
119
|
/**
|
|
68
120
|
* The full list of messages. This endpoint supports markdown.
|
|
69
121
|
*/
|
|
70
122
|
messages: Array<EmailGetResponse.Message>;
|
|
123
|
+
/**
|
|
124
|
+
* The status of the conversation
|
|
125
|
+
*/
|
|
126
|
+
status: 'Unprocessed' | 'Processing' | 'Unhandled' | 'Responded' | 'Error' | 'Escalated' | 'Processed';
|
|
71
127
|
/**
|
|
72
128
|
* The timestamp of when the ticket was last updated in our system.
|
|
73
129
|
*/
|
|
74
130
|
updatedAt: string;
|
|
75
131
|
}
|
|
76
132
|
export declare namespace EmailGetResponse {
|
|
133
|
+
interface Event {
|
|
134
|
+
/**
|
|
135
|
+
* The ID of the event
|
|
136
|
+
*/
|
|
137
|
+
id: string;
|
|
138
|
+
/**
|
|
139
|
+
* The timestamp of the event
|
|
140
|
+
*/
|
|
141
|
+
createdAt: string;
|
|
142
|
+
/**
|
|
143
|
+
* Any specific data associated with the event
|
|
144
|
+
*/
|
|
145
|
+
data: unknown;
|
|
146
|
+
/**
|
|
147
|
+
* The type of the event
|
|
148
|
+
*/
|
|
149
|
+
type: 'ASSIGNED' | 'CLOSED' | 'ESCALATED' | 'ESCALATION_REQUEST' | 'PROCESSING_CANCELLED' | 'HOSTILE_MESSAGE';
|
|
150
|
+
}
|
|
77
151
|
interface Message {
|
|
78
152
|
/**
|
|
79
153
|
* The ID of the conversation message
|
|
80
154
|
*/
|
|
81
155
|
id: string;
|
|
156
|
+
/**
|
|
157
|
+
* Attachments that were attached to the message
|
|
158
|
+
*/
|
|
159
|
+
attachments: Array<Message.Attachment>;
|
|
82
160
|
/**
|
|
83
161
|
* The content of the message. Markdown on plain text.
|
|
84
162
|
*/
|
|
@@ -94,7 +172,23 @@ export declare namespace EmailGetResponse {
|
|
|
94
172
|
/**
|
|
95
173
|
* The type of the message
|
|
96
174
|
*/
|
|
97
|
-
type: 'CUSTOMER' | '
|
|
175
|
+
type: 'CUSTOMER' | 'BOT_RESPONSE' | 'PENDING_RESPONSE' | 'DRAFT_RESPONSE';
|
|
176
|
+
}
|
|
177
|
+
namespace Message {
|
|
178
|
+
interface Attachment {
|
|
179
|
+
/**
|
|
180
|
+
* The name of the attachment
|
|
181
|
+
*/
|
|
182
|
+
name: string;
|
|
183
|
+
/**
|
|
184
|
+
* The type of the attachment
|
|
185
|
+
*/
|
|
186
|
+
type: string;
|
|
187
|
+
/**
|
|
188
|
+
* The URL of the attachment
|
|
189
|
+
*/
|
|
190
|
+
url: string;
|
|
191
|
+
}
|
|
98
192
|
}
|
|
99
193
|
}
|
|
100
194
|
export interface EmailStartResponse {
|
|
@@ -106,8 +200,41 @@ export interface EmailStartResponse {
|
|
|
106
200
|
* The timestamp of the when the conversation was created in our system.
|
|
107
201
|
*/
|
|
108
202
|
createdAt: string;
|
|
203
|
+
/**
|
|
204
|
+
* The events that have occurred in the conversation. Can be used for deriving more
|
|
205
|
+
* information about the conversation.
|
|
206
|
+
*/
|
|
207
|
+
events: Array<EmailStartResponse.Event>;
|
|
208
|
+
/**
|
|
209
|
+
* The status of the conversation
|
|
210
|
+
*/
|
|
211
|
+
status: 'Unprocessed' | 'Processing' | 'Unhandled' | 'Responded' | 'Error' | 'Escalated' | 'Processed';
|
|
212
|
+
}
|
|
213
|
+
export declare namespace EmailStartResponse {
|
|
214
|
+
interface Event {
|
|
215
|
+
/**
|
|
216
|
+
* The ID of the event
|
|
217
|
+
*/
|
|
218
|
+
id: string;
|
|
219
|
+
/**
|
|
220
|
+
* The timestamp of the event
|
|
221
|
+
*/
|
|
222
|
+
createdAt: string;
|
|
223
|
+
/**
|
|
224
|
+
* Any specific data associated with the event
|
|
225
|
+
*/
|
|
226
|
+
data: unknown;
|
|
227
|
+
/**
|
|
228
|
+
* The type of the event
|
|
229
|
+
*/
|
|
230
|
+
type: 'ASSIGNED' | 'CLOSED' | 'ESCALATED' | 'ESCALATION_REQUEST' | 'PROCESSING_CANCELLED' | 'HOSTILE_MESSAGE';
|
|
231
|
+
}
|
|
109
232
|
}
|
|
110
233
|
export interface EmailGenerateParams {
|
|
234
|
+
/**
|
|
235
|
+
* Attachments to be sent with the message
|
|
236
|
+
*/
|
|
237
|
+
attachments: Array<EmailGenerateParams.Attachment>;
|
|
111
238
|
/**
|
|
112
239
|
* The ID of the conversation
|
|
113
240
|
*/
|
|
@@ -123,6 +250,20 @@ export interface EmailGenerateParams {
|
|
|
123
250
|
customer?: EmailGenerateParams.Customer;
|
|
124
251
|
}
|
|
125
252
|
export declare namespace EmailGenerateParams {
|
|
253
|
+
interface Attachment {
|
|
254
|
+
/**
|
|
255
|
+
* The name of the attachment
|
|
256
|
+
*/
|
|
257
|
+
name: string;
|
|
258
|
+
/**
|
|
259
|
+
* The type of the attachment
|
|
260
|
+
*/
|
|
261
|
+
type: string;
|
|
262
|
+
/**
|
|
263
|
+
* The URL of the attachment
|
|
264
|
+
*/
|
|
265
|
+
url: string;
|
|
266
|
+
}
|
|
126
267
|
/**
|
|
127
268
|
* Any additional customer information, that has changed in the course of the
|
|
128
269
|
* conversation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/email.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,KAAM,SAAQ,WAAW;IACpC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAI1G,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;IAI5F,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;CAGlG;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,iBAAiB,EAAE,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/email.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,q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,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../src/resources/customer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAI1G,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAI1C,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAIpF,KAAK,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../src/resources/customer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAI1G,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,cA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,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/customer.js
CHANGED
|
@@ -14,11 +14,7 @@ class Customer extends resource_1.APIResource {
|
|
|
14
14
|
return this._client.get(`/v1/customer/${id}`, options);
|
|
15
15
|
}
|
|
16
16
|
token(body, options) {
|
|
17
|
-
return this._client.post('/v1/customer/token', {
|
|
18
|
-
body,
|
|
19
|
-
...options,
|
|
20
|
-
headers: { Accept: 'application/json', ...options?.headers },
|
|
21
|
-
});
|
|
17
|
+
return this._client.post('/v1/customer/token', { body, ...options });
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
exports.Customer = Customer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../src/resources/customer.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,QAAS,SAAQ,sBAAW;IACvC,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CACJ,EAAU,EACV,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAyB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE
|
|
1
|
+
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../src/resources/customer.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,QAAS,SAAQ,sBAAW;IACvC,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CACJ,EAAU,EACV,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAyB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AApBD,4BAoBC"}
|
package/resources/customer.mjs
CHANGED
|
@@ -11,11 +11,7 @@ export class Customer extends APIResource {
|
|
|
11
11
|
return this._client.get(`/v1/customer/${id}`, options);
|
|
12
12
|
}
|
|
13
13
|
token(body, options) {
|
|
14
|
-
return this._client.post('/v1/customer/token', {
|
|
15
|
-
body,
|
|
16
|
-
...options,
|
|
17
|
-
headers: { Accept: 'application/json', ...options?.headers },
|
|
18
|
-
});
|
|
14
|
+
return this._client.post('/v1/customer/token', { body, ...options });
|
|
19
15
|
}
|
|
20
16
|
}
|
|
21
17
|
//# sourceMappingURL=customer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.mjs","sourceRoot":"","sources":["../src/resources/customer.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CACJ,EAAU,EACV,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAyB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE
|
|
1
|
+
{"version":3,"file":"customer.mjs","sourceRoot":"","sources":["../src/resources/customer.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CACJ,EAAU,EACV,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAyB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
package/src/core.ts
CHANGED
|
@@ -163,7 +163,7 @@ export abstract class APIClient {
|
|
|
163
163
|
maxRetries = 2,
|
|
164
164
|
timeout = 60000, // 1 minute
|
|
165
165
|
httpAgent,
|
|
166
|
-
fetch:
|
|
166
|
+
fetch: overriddenFetch,
|
|
167
167
|
}: {
|
|
168
168
|
baseURL: string;
|
|
169
169
|
maxRetries?: number | undefined;
|
|
@@ -176,7 +176,7 @@ export abstract class APIClient {
|
|
|
176
176
|
this.timeout = validatePositiveInteger('timeout', timeout);
|
|
177
177
|
this.httpAgent = httpAgent;
|
|
178
178
|
|
|
179
|
-
this.fetch =
|
|
179
|
+
this.fetch = overriddenFetch ?? fetch;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
protected authHeaders(opts: FinalRequestOptions): Headers {
|
|
@@ -522,9 +522,19 @@ export abstract class APIClient {
|
|
|
522
522
|
|
|
523
523
|
const timeout = setTimeout(() => controller.abort(), ms);
|
|
524
524
|
|
|
525
|
+
const fetchOptions = {
|
|
526
|
+
signal: controller.signal as any,
|
|
527
|
+
...options,
|
|
528
|
+
};
|
|
529
|
+
if (fetchOptions.method) {
|
|
530
|
+
// Custom methods like 'patch' need to be uppercased
|
|
531
|
+
// See https://github.com/nodejs/undici/issues/2294
|
|
532
|
+
fetchOptions.method = fetchOptions.method.toUpperCase();
|
|
533
|
+
}
|
|
534
|
+
|
|
525
535
|
return (
|
|
526
536
|
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
|
|
527
|
-
this.fetch.call(undefined, url,
|
|
537
|
+
this.fetch.call(undefined, url, fetchOptions).finally(() => {
|
|
528
538
|
clearTimeout(timeout);
|
|
529
539
|
})
|
|
530
540
|
);
|
|
@@ -970,8 +980,8 @@ export const safeJSON = (text: string) => {
|
|
|
970
980
|
}
|
|
971
981
|
};
|
|
972
982
|
|
|
973
|
-
// https://
|
|
974
|
-
const startsWithSchemeRegexp =
|
|
983
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
984
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
975
985
|
const isAbsoluteURL = (url: string): boolean => {
|
|
976
986
|
return startsWithSchemeRegexp.test(url);
|
|
977
987
|
};
|
package/src/error.ts
CHANGED
|
@@ -4,17 +4,19 @@ import { castToError, Headers } from './core';
|
|
|
4
4
|
|
|
5
5
|
export class LorikeetError extends Error {}
|
|
6
6
|
|
|
7
|
-
export class APIError
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export class APIError<
|
|
8
|
+
TStatus extends number | undefined = number | undefined,
|
|
9
|
+
THeaders extends Headers | undefined = Headers | undefined,
|
|
10
|
+
TError extends Object | undefined = Object | undefined,
|
|
11
|
+
> extends LorikeetError {
|
|
12
|
+
/** HTTP status for the response that caused the error */
|
|
13
|
+
readonly status: TStatus;
|
|
14
|
+
/** HTTP headers for the response that caused the error */
|
|
15
|
+
readonly headers: THeaders;
|
|
16
|
+
/** JSON body of the response that caused the error */
|
|
17
|
+
readonly error: TError;
|
|
18
|
+
|
|
19
|
+
constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
|
|
18
20
|
super(`${APIError.makeMessage(status, error, message)}`);
|
|
19
21
|
this.status = status;
|
|
20
22
|
this.headers = headers;
|
|
@@ -48,7 +50,7 @@ export class APIError extends LorikeetError {
|
|
|
48
50
|
message: string | undefined,
|
|
49
51
|
headers: Headers | undefined,
|
|
50
52
|
): APIError {
|
|
51
|
-
if (!status) {
|
|
53
|
+
if (!status || !headers) {
|
|
52
54
|
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -90,17 +92,13 @@ export class APIError extends LorikeetError {
|
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
export class APIUserAbortError extends APIError {
|
|
94
|
-
override readonly status: undefined = undefined;
|
|
95
|
-
|
|
95
|
+
export class APIUserAbortError extends APIError<undefined, undefined, undefined> {
|
|
96
96
|
constructor({ message }: { message?: string } = {}) {
|
|
97
97
|
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export class APIConnectionError extends APIError {
|
|
102
|
-
override readonly status: undefined = undefined;
|
|
103
|
-
|
|
101
|
+
export class APIConnectionError extends APIError<undefined, undefined, undefined> {
|
|
104
102
|
constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
|
|
105
103
|
super(undefined, undefined, message || 'Connection error.', undefined);
|
|
106
104
|
// in some environments the 'cause' property is already declared
|
|
@@ -115,32 +113,18 @@ export class APIConnectionTimeoutError extends APIConnectionError {
|
|
|
115
113
|
}
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
export class BadRequestError extends APIError {
|
|
119
|
-
override readonly status: 400 = 400;
|
|
120
|
-
}
|
|
116
|
+
export class BadRequestError extends APIError<400, Headers> {}
|
|
121
117
|
|
|
122
|
-
export class AuthenticationError extends APIError {
|
|
123
|
-
override readonly status: 401 = 401;
|
|
124
|
-
}
|
|
118
|
+
export class AuthenticationError extends APIError<401, Headers> {}
|
|
125
119
|
|
|
126
|
-
export class PermissionDeniedError extends APIError {
|
|
127
|
-
override readonly status: 403 = 403;
|
|
128
|
-
}
|
|
120
|
+
export class PermissionDeniedError extends APIError<403, Headers> {}
|
|
129
121
|
|
|
130
|
-
export class NotFoundError extends APIError {
|
|
131
|
-
override readonly status: 404 = 404;
|
|
132
|
-
}
|
|
122
|
+
export class NotFoundError extends APIError<404, Headers> {}
|
|
133
123
|
|
|
134
|
-
export class ConflictError extends APIError {
|
|
135
|
-
override readonly status: 409 = 409;
|
|
136
|
-
}
|
|
124
|
+
export class ConflictError extends APIError<409, Headers> {}
|
|
137
125
|
|
|
138
|
-
export class UnprocessableEntityError extends APIError {
|
|
139
|
-
override readonly status: 422 = 422;
|
|
140
|
-
}
|
|
126
|
+
export class UnprocessableEntityError extends APIError<422, Headers> {}
|
|
141
127
|
|
|
142
|
-
export class RateLimitError extends APIError {
|
|
143
|
-
override readonly status: 429 = 429;
|
|
144
|
-
}
|
|
128
|
+
export class RateLimitError extends APIError<429, Headers> {}
|
|
145
129
|
|
|
146
|
-
export class InternalServerError extends APIError {}
|
|
130
|
+
export class InternalServerError extends APIError<number, Headers> {}
|
package/src/index.ts
CHANGED
|
@@ -45,7 +45,7 @@ export interface ClientOptions {
|
|
|
45
45
|
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
46
46
|
* much longer than this timeout before the promise succeeds or fails.
|
|
47
47
|
*/
|
|
48
|
-
timeout?: number;
|
|
48
|
+
timeout?: number | undefined;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* An HTTP agent used to manage HTTP(S) connections.
|
|
@@ -53,7 +53,7 @@ export interface ClientOptions {
|
|
|
53
53
|
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
54
54
|
* otherwise no agent is used.
|
|
55
55
|
*/
|
|
56
|
-
httpAgent?: Agent;
|
|
56
|
+
httpAgent?: Agent | undefined;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Specify a custom `fetch` function implementation.
|
|
@@ -69,7 +69,7 @@ export interface ClientOptions {
|
|
|
69
69
|
*
|
|
70
70
|
* @default 2
|
|
71
71
|
*/
|
|
72
|
-
maxRetries?: number;
|
|
72
|
+
maxRetries?: number | undefined;
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* Default headers to include with every request to the API.
|
|
@@ -77,7 +77,7 @@ export interface ClientOptions {
|
|
|
77
77
|
* These can be removed in individual requests by explicitly setting the
|
|
78
78
|
* header to `undefined` or `null` in request options.
|
|
79
79
|
*/
|
|
80
|
-
defaultHeaders?: Core.Headers;
|
|
80
|
+
defaultHeaders?: Core.Headers | undefined;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Default query parameters to include with every request to the API.
|
|
@@ -85,7 +85,7 @@ export interface ClientOptions {
|
|
|
85
85
|
* These can be removed in individual requests by explicitly setting the
|
|
86
86
|
* param to `undefined` in request options.
|
|
87
87
|
*/
|
|
88
|
-
defaultQuery?: Core.DefaultQuery;
|
|
88
|
+
defaultQuery?: Core.DefaultQuery | undefined;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/**
|