@lorikeetai/node-sdk 2.2.0 → 2.3.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 +52 -0
- package/client.d.mts +7 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -1
- package/client.d.ts.map +1 -1
- package/client.js +25 -17
- package/client.js.map +1 -1
- package/client.mjs +25 -17
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/conversation/chat.d.mts +6 -3
- package/resources/conversation/chat.d.mts.map +1 -1
- package/resources/conversation/chat.d.ts +6 -3
- package/resources/conversation/chat.d.ts.map +1 -1
- package/resources/conversation/chat.js +3 -0
- package/resources/conversation/chat.js.map +1 -1
- package/resources/conversation/chat.mjs +3 -0
- package/resources/conversation/chat.mjs.map +1 -1
- package/resources/conversation/conversation.d.mts +2 -2
- package/resources/conversation/conversation.d.mts.map +1 -1
- package/resources/conversation/conversation.d.ts +2 -2
- package/resources/conversation/conversation.d.ts.map +1 -1
- package/resources/conversation/conversation.js.map +1 -1
- package/resources/conversation/conversation.mjs.map +1 -1
- package/resources/conversation/email.d.mts +6 -3
- package/resources/conversation/email.d.mts.map +1 -1
- package/resources/conversation/email.d.ts +6 -3
- package/resources/conversation/email.d.ts.map +1 -1
- package/resources/conversation/email.js +3 -0
- package/resources/conversation/email.js.map +1 -1
- package/resources/conversation/email.mjs +3 -0
- package/resources/conversation/email.mjs.map +1 -1
- package/resources/conversation/index.d.mts +1 -1
- package/resources/conversation/index.d.mts.map +1 -1
- package/resources/conversation/index.d.ts +1 -1
- package/resources/conversation/index.d.ts.map +1 -1
- package/resources/conversation/index.js.map +1 -1
- package/resources/conversation/index.mjs.map +1 -1
- package/resources/conversation/voice.d.mts +22 -4
- package/resources/conversation/voice.d.mts.map +1 -1
- package/resources/conversation/voice.d.ts +22 -4
- package/resources/conversation/voice.d.ts.map +1 -1
- package/resources/conversation/voice.js +5 -7
- package/resources/conversation/voice.js.map +1 -1
- package/resources/conversation/voice.mjs +5 -7
- package/resources/conversation/voice.mjs.map +1 -1
- package/resources/customer/customer.d.mts +11 -0
- package/resources/customer/customer.d.mts.map +1 -1
- package/resources/customer/customer.d.ts +11 -0
- package/resources/customer/customer.d.ts.map +1 -1
- package/resources/customer/customer.js +3 -0
- package/resources/customer/customer.js.map +1 -1
- package/resources/customer/customer.mjs +3 -0
- package/resources/customer/customer.mjs.map +1 -1
- package/resources/customer/profile.d.mts +3 -0
- package/resources/customer/profile.d.mts.map +1 -1
- package/resources/customer/profile.d.ts +3 -0
- package/resources/customer/profile.d.ts.map +1 -1
- package/resources/customer/profile.js +3 -0
- package/resources/customer/profile.js.map +1 -1
- package/resources/customer/profile.mjs +3 -0
- package/resources/customer/profile.mjs.map +1 -1
- package/resources/customer/remote.d.mts +4 -1
- package/resources/customer/remote.d.mts.map +1 -1
- package/resources/customer/remote.d.ts +4 -1
- package/resources/customer/remote.d.ts.map +1 -1
- package/resources/customer/remote.js +3 -0
- package/resources/customer/remote.js.map +1 -1
- package/resources/customer/remote.mjs +3 -0
- package/resources/customer/remote.mjs.map +1 -1
- package/resources/ingest.d.mts +3 -0
- package/resources/ingest.d.mts.map +1 -1
- package/resources/ingest.d.ts +3 -0
- package/resources/ingest.d.ts.map +1 -1
- package/resources/ingest.js +3 -0
- package/resources/ingest.js.map +1 -1
- package/resources/ingest.mjs +3 -0
- package/resources/ingest.mjs.map +1 -1
- package/src/client.ts +29 -22
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/conversation/chat.ts +42 -3
- package/src/resources/conversation/conversation.ts +6 -2
- package/src/resources/conversation/email.ts +42 -3
- package/src/resources/conversation/index.ts +1 -1
- package/src/resources/conversation/voice.ts +29 -10
- package/src/resources/customer/customer.ts +13 -0
- package/src/resources/customer/profile.ts +3 -0
- package/src/resources/customer/remote.ts +4 -1
- package/src/resources/ingest.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
12
12
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
13
13
|
import * as Shims from './internal/shims';
|
|
14
14
|
import * as Opts from './internal/request-options';
|
|
15
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
16
|
import { VERSION } from './version';
|
|
16
17
|
import * as Errors from './core/error';
|
|
17
18
|
import * as Uploads from './core/uploads';
|
|
@@ -206,6 +207,18 @@ export class Lorikeet {
|
|
|
206
207
|
this.fetch = options.fetch ?? Shims.getDefaultFetch();
|
|
207
208
|
this.#encoder = Opts.FallbackEncoder;
|
|
208
209
|
|
|
210
|
+
const customHeadersEnv = readEnv('LORIKEET_CUSTOM_HEADERS');
|
|
211
|
+
if (customHeadersEnv) {
|
|
212
|
+
const parsed: Record<string, string> = {};
|
|
213
|
+
for (const line of customHeadersEnv.split('\n')) {
|
|
214
|
+
const colon = line.indexOf(':');
|
|
215
|
+
if (colon >= 0) {
|
|
216
|
+
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
|
|
220
|
+
}
|
|
221
|
+
|
|
209
222
|
this._options = options;
|
|
210
223
|
|
|
211
224
|
this.clientID = clientID;
|
|
@@ -259,21 +272,8 @@ export class Lorikeet {
|
|
|
259
272
|
/**
|
|
260
273
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
261
274
|
*/
|
|
262
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
263
|
-
return
|
|
264
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
265
|
-
.map(([key, value]) => {
|
|
266
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
267
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
268
|
-
}
|
|
269
|
-
if (value === null) {
|
|
270
|
-
return `${encodeURIComponent(key)}=`;
|
|
271
|
-
}
|
|
272
|
-
throw new Errors.LorikeetError(
|
|
273
|
-
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
274
|
-
);
|
|
275
|
-
})
|
|
276
|
-
.join('&');
|
|
275
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
276
|
+
return stringifyQuery(query);
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
private getUserAgent(): string {
|
|
@@ -305,12 +305,13 @@ export class Lorikeet {
|
|
|
305
305
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
306
306
|
|
|
307
307
|
const defaultQuery = this.defaultQuery();
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
309
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
310
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
310
311
|
}
|
|
311
312
|
|
|
312
313
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
313
|
-
url.search = this.stringifyQuery(query
|
|
314
|
+
url.search = this.stringifyQuery(query);
|
|
314
315
|
}
|
|
315
316
|
|
|
316
317
|
return url.toString();
|
|
@@ -626,9 +627,9 @@ export class Lorikeet {
|
|
|
626
627
|
}
|
|
627
628
|
}
|
|
628
629
|
|
|
629
|
-
// If the API asks us to wait a certain amount of time
|
|
630
|
-
//
|
|
631
|
-
if (
|
|
630
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
631
|
+
// says, but otherwise calculate a default
|
|
632
|
+
if (timeoutMillis === undefined) {
|
|
632
633
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
633
634
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
634
635
|
}
|
|
@@ -760,7 +761,7 @@ export class Lorikeet {
|
|
|
760
761
|
) {
|
|
761
762
|
return {
|
|
762
763
|
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
763
|
-
body: this.stringifyQuery(body
|
|
764
|
+
body: this.stringifyQuery(body),
|
|
764
765
|
};
|
|
765
766
|
} else {
|
|
766
767
|
return this.#encoder({ body, headers });
|
|
@@ -787,7 +788,13 @@ export class Lorikeet {
|
|
|
787
788
|
static toFile = Uploads.toFile;
|
|
788
789
|
|
|
789
790
|
conversation: API.Conversation = new API.Conversation(this);
|
|
791
|
+
/**
|
|
792
|
+
* Endpoints related to customer data
|
|
793
|
+
*/
|
|
790
794
|
customer: API.Customer = new API.Customer(this);
|
|
795
|
+
/**
|
|
796
|
+
* Endpoints for ingesting subscriber data
|
|
797
|
+
*/
|
|
791
798
|
ingest: API.Ingest = new API.Ingest(this);
|
|
792
799
|
apiKeys: API.APIKeys = new API.APIKeys(this);
|
|
793
800
|
}
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { LorikeetError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
7
|
+
*/
|
|
8
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
9
|
+
return Object.entries(query)
|
|
10
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
11
|
+
.map(([key, value]) => {
|
|
12
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
13
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
14
|
+
}
|
|
15
|
+
if (value === null) {
|
|
16
|
+
return `${encodeURIComponent(key)}=`;
|
|
17
|
+
}
|
|
18
|
+
throw new LorikeetError(
|
|
19
|
+
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
20
|
+
);
|
|
21
|
+
})
|
|
22
|
+
.join('&');
|
|
23
|
+
}
|
package/src/internal/utils.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { pollUntil } from '../../lib/poll-until';
|
|
|
8
8
|
import { DeferredAsyncIterable } from '../../lib/promise';
|
|
9
9
|
import { EventSource } from 'eventsource';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Endpoints for managing conversations
|
|
13
|
+
*/
|
|
11
14
|
export class Chat extends APIResource {
|
|
12
15
|
/**
|
|
13
16
|
* @example
|
|
@@ -191,7 +194,19 @@ export interface ChatGenerateResponse {
|
|
|
191
194
|
/**
|
|
192
195
|
* The status of the conversation
|
|
193
196
|
*/
|
|
194
|
-
status:
|
|
197
|
+
status:
|
|
198
|
+
| 'Unprocessed'
|
|
199
|
+
| 'Processing'
|
|
200
|
+
| 'Unhandled'
|
|
201
|
+
| 'Triaged'
|
|
202
|
+
| 'DraftResponse'
|
|
203
|
+
| 'Responded'
|
|
204
|
+
| 'Error'
|
|
205
|
+
| 'Escalated'
|
|
206
|
+
| 'EscalatedFailed'
|
|
207
|
+
| 'Processed'
|
|
208
|
+
| 'Ignored'
|
|
209
|
+
| 'Tagged';
|
|
195
210
|
|
|
196
211
|
/**
|
|
197
212
|
* The tags of the conversation
|
|
@@ -239,7 +254,19 @@ export interface ChatGetResponse {
|
|
|
239
254
|
/**
|
|
240
255
|
* The status of the conversation
|
|
241
256
|
*/
|
|
242
|
-
status:
|
|
257
|
+
status:
|
|
258
|
+
| 'Unprocessed'
|
|
259
|
+
| 'Processing'
|
|
260
|
+
| 'Unhandled'
|
|
261
|
+
| 'Triaged'
|
|
262
|
+
| 'DraftResponse'
|
|
263
|
+
| 'Responded'
|
|
264
|
+
| 'Error'
|
|
265
|
+
| 'Escalated'
|
|
266
|
+
| 'EscalatedFailed'
|
|
267
|
+
| 'Processed'
|
|
268
|
+
| 'Ignored'
|
|
269
|
+
| 'Tagged';
|
|
243
270
|
|
|
244
271
|
/**
|
|
245
272
|
* The tags of the conversation
|
|
@@ -277,7 +304,19 @@ export interface ChatStartResponse {
|
|
|
277
304
|
/**
|
|
278
305
|
* The status of the conversation
|
|
279
306
|
*/
|
|
280
|
-
status:
|
|
307
|
+
status:
|
|
308
|
+
| 'Unprocessed'
|
|
309
|
+
| 'Processing'
|
|
310
|
+
| 'Unhandled'
|
|
311
|
+
| 'Triaged'
|
|
312
|
+
| 'DraftResponse'
|
|
313
|
+
| 'Responded'
|
|
314
|
+
| 'Error'
|
|
315
|
+
| 'Escalated'
|
|
316
|
+
| 'EscalatedFailed'
|
|
317
|
+
| 'Processed'
|
|
318
|
+
| 'Ignored'
|
|
319
|
+
| 'Tagged';
|
|
281
320
|
|
|
282
321
|
/**
|
|
283
322
|
* The tags of the conversation
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
EmailStartResponse,
|
|
23
23
|
} from './email';
|
|
24
24
|
import * as VoiceAPI from './voice';
|
|
25
|
-
import { Voice, VoiceOutboundParams } from './voice';
|
|
25
|
+
import { Voice, VoiceOutboundParams, VoiceOutboundResponse } from './voice';
|
|
26
26
|
|
|
27
27
|
export class Conversation extends APIResource {
|
|
28
28
|
email: EmailAPI.Email = new EmailAPI.Email(this._client);
|
|
@@ -140,5 +140,9 @@ export declare namespace Conversation {
|
|
|
140
140
|
type ChatStartParams as ChatStartParams,
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
export {
|
|
143
|
+
export {
|
|
144
|
+
Voice as Voice,
|
|
145
|
+
type VoiceOutboundResponse as VoiceOutboundResponse,
|
|
146
|
+
type VoiceOutboundParams as VoiceOutboundParams,
|
|
147
|
+
};
|
|
144
148
|
}
|
|
@@ -6,6 +6,9 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
7
|
import { pollUntil } from '../../lib/poll-until';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Endpoints for managing conversations
|
|
11
|
+
*/
|
|
9
12
|
export class Email extends APIResource {
|
|
10
13
|
/**
|
|
11
14
|
* @example
|
|
@@ -118,7 +121,19 @@ export interface EmailGenerateResponse {
|
|
|
118
121
|
/**
|
|
119
122
|
* The status of the conversation
|
|
120
123
|
*/
|
|
121
|
-
status:
|
|
124
|
+
status:
|
|
125
|
+
| 'Unprocessed'
|
|
126
|
+
| 'Processing'
|
|
127
|
+
| 'Unhandled'
|
|
128
|
+
| 'Triaged'
|
|
129
|
+
| 'DraftResponse'
|
|
130
|
+
| 'Responded'
|
|
131
|
+
| 'Error'
|
|
132
|
+
| 'Escalated'
|
|
133
|
+
| 'EscalatedFailed'
|
|
134
|
+
| 'Processed'
|
|
135
|
+
| 'Ignored'
|
|
136
|
+
| 'Tagged';
|
|
122
137
|
|
|
123
138
|
/**
|
|
124
139
|
* The tags of the conversation
|
|
@@ -166,7 +181,19 @@ export interface EmailGetResponse {
|
|
|
166
181
|
/**
|
|
167
182
|
* The status of the conversation
|
|
168
183
|
*/
|
|
169
|
-
status:
|
|
184
|
+
status:
|
|
185
|
+
| 'Unprocessed'
|
|
186
|
+
| 'Processing'
|
|
187
|
+
| 'Unhandled'
|
|
188
|
+
| 'Triaged'
|
|
189
|
+
| 'DraftResponse'
|
|
190
|
+
| 'Responded'
|
|
191
|
+
| 'Error'
|
|
192
|
+
| 'Escalated'
|
|
193
|
+
| 'EscalatedFailed'
|
|
194
|
+
| 'Processed'
|
|
195
|
+
| 'Ignored'
|
|
196
|
+
| 'Tagged';
|
|
170
197
|
|
|
171
198
|
/**
|
|
172
199
|
* The tags of the conversation
|
|
@@ -204,7 +231,19 @@ export interface EmailStartResponse {
|
|
|
204
231
|
/**
|
|
205
232
|
* The status of the conversation
|
|
206
233
|
*/
|
|
207
|
-
status:
|
|
234
|
+
status:
|
|
235
|
+
| 'Unprocessed'
|
|
236
|
+
| 'Processing'
|
|
237
|
+
| 'Unhandled'
|
|
238
|
+
| 'Triaged'
|
|
239
|
+
| 'DraftResponse'
|
|
240
|
+
| 'Responded'
|
|
241
|
+
| 'Error'
|
|
242
|
+
| 'Escalated'
|
|
243
|
+
| 'EscalatedFailed'
|
|
244
|
+
| 'Processed'
|
|
245
|
+
| 'Ignored'
|
|
246
|
+
| 'Tagged';
|
|
208
247
|
|
|
209
248
|
/**
|
|
210
249
|
* The tags of the conversation
|
|
@@ -2,27 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
-
import { buildHeaders } from '../../internal/headers';
|
|
6
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Endpoints for managing conversations
|
|
9
|
+
*/
|
|
8
10
|
export class Voice extends APIResource {
|
|
9
11
|
/**
|
|
10
12
|
* @example
|
|
11
13
|
* ```ts
|
|
12
|
-
* await client.conversation.voice.outbound({
|
|
14
|
+
* const response = await client.conversation.voice.outbound({
|
|
13
15
|
* phoneNumber: '+61400000000',
|
|
14
16
|
* });
|
|
15
17
|
* ```
|
|
16
18
|
*/
|
|
17
|
-
outbound(body: VoiceOutboundParams, options?: RequestOptions): APIPromise<
|
|
18
|
-
return this._client.post('/v1/conversation/voice/outbound', {
|
|
19
|
-
body,
|
|
20
|
-
...options,
|
|
21
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
22
|
-
});
|
|
19
|
+
outbound(body: VoiceOutboundParams, options?: RequestOptions): APIPromise<VoiceOutboundResponse> {
|
|
20
|
+
return this._client.post('/v1/conversation/voice/outbound', { body, ...options });
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
|
|
24
|
+
export interface VoiceOutboundResponse {
|
|
25
|
+
/**
|
|
26
|
+
* The ID of the conversation that was created
|
|
27
|
+
*/
|
|
28
|
+
conversationId: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
export interface VoiceOutboundParams {
|
|
27
32
|
/**
|
|
28
33
|
* The phone number to call in E.164 format. If a customer ID is not provided, the
|
|
@@ -31,11 +36,22 @@ export interface VoiceOutboundParams {
|
|
|
31
36
|
*/
|
|
32
37
|
phoneNumber: string;
|
|
33
38
|
|
|
39
|
+
/**
|
|
40
|
+
* The ID of the agent to use for the call. Cannot be combined with workflowId.
|
|
41
|
+
*/
|
|
42
|
+
agentId?: string;
|
|
43
|
+
|
|
34
44
|
/**
|
|
35
45
|
* The ID of the brand to make the call from
|
|
36
46
|
*/
|
|
37
47
|
brandId?: string;
|
|
38
48
|
|
|
49
|
+
/**
|
|
50
|
+
* The ID of the channel config to use for the call. If not provided, the first
|
|
51
|
+
* active voice channel config will be used.
|
|
52
|
+
*/
|
|
53
|
+
channelConfigId?: string;
|
|
54
|
+
|
|
39
55
|
/**
|
|
40
56
|
* The ID of the customer to call. If not provided, the customer will be looked up
|
|
41
57
|
* by phone number. If no customer is found, a new customer will be created.
|
|
@@ -50,11 +66,14 @@ export interface VoiceOutboundParams {
|
|
|
50
66
|
inputData?: unknown;
|
|
51
67
|
|
|
52
68
|
/**
|
|
53
|
-
* The ID of the workflow to use for the call
|
|
69
|
+
* The ID of the workflow to use for the call. Cannot be combined with agentId.
|
|
54
70
|
*/
|
|
55
71
|
workflowId?: string;
|
|
56
72
|
}
|
|
57
73
|
|
|
58
74
|
export declare namespace Voice {
|
|
59
|
-
export {
|
|
75
|
+
export {
|
|
76
|
+
type VoiceOutboundResponse as VoiceOutboundResponse,
|
|
77
|
+
type VoiceOutboundParams as VoiceOutboundParams,
|
|
78
|
+
};
|
|
60
79
|
}
|
|
@@ -9,6 +9,9 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
9
9
|
import { RequestOptions } from '../../internal/request-options';
|
|
10
10
|
import { path } from '../../internal/utils/path';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Endpoints related to customer data
|
|
14
|
+
*/
|
|
12
15
|
export class Customer extends APIResource {
|
|
13
16
|
remote: RemoteAPI.Remote = new RemoteAPI.Remote(this._client);
|
|
14
17
|
profile: ProfileAPI.Profile = new ProfileAPI.Profile(this._client);
|
|
@@ -346,6 +349,11 @@ export interface CustomerUpdateParams {
|
|
|
346
349
|
}
|
|
347
350
|
|
|
348
351
|
export interface CustomerGetParams {
|
|
352
|
+
/**
|
|
353
|
+
* The email address of the customer
|
|
354
|
+
*/
|
|
355
|
+
email?: string;
|
|
356
|
+
|
|
349
357
|
/**
|
|
350
358
|
* The phone number of the customer
|
|
351
359
|
*/
|
|
@@ -355,6 +363,11 @@ export interface CustomerGetParams {
|
|
|
355
363
|
* The remote id of the customer in your system
|
|
356
364
|
*/
|
|
357
365
|
remoteId?: string;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* The id of the customer in your own primary database or a unique identifier
|
|
369
|
+
*/
|
|
370
|
+
subscriberCustomerId?: string;
|
|
358
371
|
}
|
|
359
372
|
|
|
360
373
|
export interface CustomerTokenParams {
|
|
@@ -5,6 +5,9 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
6
6
|
import { path } from '../../internal/utils/path';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Endpoints related to customer data
|
|
10
|
+
*/
|
|
8
11
|
export class Profile extends APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* @example
|
|
@@ -5,6 +5,9 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
6
6
|
import { path } from '../../internal/utils/path';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Endpoints related to customer data
|
|
10
|
+
*/
|
|
8
11
|
export class Remote extends APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* @example
|
|
@@ -188,7 +191,7 @@ export interface RemoteUpdateParams {
|
|
|
188
191
|
* The id of the customer in the ticketing system. For the SDK this needs to be
|
|
189
192
|
* stable and unique
|
|
190
193
|
*/
|
|
191
|
-
|
|
194
|
+
remoteId?: string;
|
|
192
195
|
|
|
193
196
|
/**
|
|
194
197
|
* The id of the customer in your own primary database or a unique identifier, for
|
package/src/resources/ingest.ts
CHANGED
|
@@ -6,6 +6,9 @@ import { buildHeaders } from '../internal/headers';
|
|
|
6
6
|
import { RequestOptions } from '../internal/request-options';
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Endpoints for ingesting subscriber data
|
|
11
|
+
*/
|
|
9
12
|
export class Ingest extends APIResource {
|
|
10
13
|
submit(workflowID: string, params: IngestSubmitParams, options?: RequestOptions): APIPromise<void> {
|
|
11
14
|
const { toolId, ticketId, inputHash } = params;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.3.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.3.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|