retell-sdk 6.0.0 → 6.1.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 +20 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent.d.mts +3222 -526
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +3222 -526
- package/resources/agent.d.ts.map +1 -1
- package/resources/app.d.mts +122 -5
- package/resources/app.d.mts.map +1 -1
- package/resources/app.d.ts +122 -5
- package/resources/app.d.ts.map +1 -1
- package/resources/app.js +17 -1
- package/resources/app.js.map +1 -1
- package/resources/app.mjs +17 -1
- package/resources/app.mjs.map +1 -1
- package/resources/batch-call.d.mts +912 -13
- package/resources/batch-call.d.mts.map +1 -1
- package/resources/batch-call.d.ts +912 -13
- package/resources/batch-call.d.ts.map +1 -1
- package/resources/call.d.mts +7843 -3792
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +7843 -3792
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +1 -1
- package/resources/call.mjs +1 -1
- package/resources/chat-agent.d.mts +3125 -453
- package/resources/chat-agent.d.mts.map +1 -1
- package/resources/chat-agent.d.ts +3125 -453
- package/resources/chat-agent.d.ts.map +1 -1
- package/resources/chat.d.mts +892 -26
- package/resources/chat.d.mts.map +1 -1
- package/resources/chat.d.ts +892 -26
- package/resources/chat.d.ts.map +1 -1
- package/resources/contact.d.mts +162 -20
- package/resources/contact.d.mts.map +1 -1
- package/resources/contact.d.ts +162 -20
- package/resources/contact.d.ts.map +1 -1
- package/resources/contact.js +98 -4
- package/resources/contact.js.map +1 -1
- package/resources/contact.mjs +98 -4
- package/resources/contact.mjs.map +1 -1
- package/resources/conversation-flow-component.d.mts +3282 -243
- package/resources/conversation-flow-component.d.mts.map +1 -1
- package/resources/conversation-flow-component.d.ts +3282 -243
- package/resources/conversation-flow-component.d.ts.map +1 -1
- package/resources/conversation-flow.d.mts +7347 -1269
- package/resources/conversation-flow.d.mts.map +1 -1
- package/resources/conversation-flow.d.ts +7347 -1269
- package/resources/conversation-flow.d.ts.map +1 -1
- package/resources/crm.d.mts +37 -5
- package/resources/crm.d.mts.map +1 -1
- package/resources/crm.d.ts +37 -5
- package/resources/crm.d.ts.map +1 -1
- package/resources/identity.d.mts +4 -0
- package/resources/identity.d.mts.map +1 -1
- package/resources/identity.d.ts +4 -0
- package/resources/identity.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/llm.d.mts +867 -9
- package/resources/llm.d.mts.map +1 -1
- package/resources/llm.d.ts +867 -9
- package/resources/llm.d.ts.map +1 -1
- package/resources/tests.d.mts +3 -3
- package/resources/tests.d.mts.map +1 -1
- package/resources/tests.d.ts +3 -3
- package/resources/tests.d.ts.map +1 -1
- package/src/client.ts +4 -0
- package/src/resources/agent.ts +4786 -1504
- package/src/resources/app.ts +144 -4
- package/src/resources/batch-call.ts +1115 -10
- package/src/resources/call.ts +9825 -4806
- package/src/resources/chat-agent.ts +3958 -698
- package/src/resources/chat.ts +1133 -50
- package/src/resources/contact.ts +168 -20
- package/src/resources/conversation-flow-component.ts +4466 -191
- package/src/resources/conversation-flow.ts +9084 -525
- package/src/resources/crm.ts +44 -5
- package/src/resources/identity.ts +5 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/llm.ts +1045 -46
- package/src/resources/tests.ts +21 -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/resources/contact.mjs
CHANGED
|
@@ -6,21 +6,40 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
6
6
|
export class Contact extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Create a new contact.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const contactResponse = await client.contact.create({
|
|
13
|
+
* phone_number: 'phone_number',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
9
16
|
*/
|
|
10
17
|
create(body, options) {
|
|
11
18
|
return this._client.post('/create-contact', { body, ...options });
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* Update an existing contact.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const contactResponse = await client.contact.update(
|
|
26
|
+
* 'contact_id',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
15
29
|
*/
|
|
16
30
|
update(contactID, body, options) {
|
|
17
31
|
return this._client.patch(path `/update-contact/${contactID}`, { body, ...options });
|
|
18
32
|
}
|
|
19
33
|
/**
|
|
20
|
-
* List contacts, newest
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* repeat or miss rows as contacts are
|
|
34
|
+
* List contacts, newest created first by default, with the total count of matches
|
|
35
|
+
* alongside the page. Page through results with `pagination_key`; `skip` is
|
|
36
|
+
* available for offset-style paging but is slower on large contact sets and can
|
|
37
|
+
* repeat or miss rows as contacts are added or deleted.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const contacts = await client.contact.list();
|
|
42
|
+
* ```
|
|
24
43
|
*/
|
|
25
44
|
list(body = {}, options) {
|
|
26
45
|
return this._client.post('/list-contacts', { body, ...options });
|
|
@@ -29,6 +48,11 @@ export class Contact extends APIResource {
|
|
|
29
48
|
* Delete a contact. A contact linked to a record in a connected CRM cannot be
|
|
30
49
|
* deleted while two-way sync is active — unlink the CRM app first, otherwise the
|
|
31
50
|
* next sync would recreate it.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* await client.contact.delete('contact_id');
|
|
55
|
+
* ```
|
|
32
56
|
*/
|
|
33
57
|
delete(contactID, options) {
|
|
34
58
|
return this._client.delete(path `/delete-contact/${contactID}`, {
|
|
@@ -36,6 +60,24 @@ export class Contact extends APIResource {
|
|
|
36
60
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
37
61
|
});
|
|
38
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Trigger a backfill job that re-applies analysis data mappings to contacts using
|
|
65
|
+
* historical call and SMS chat data. Only one backfill job can run per
|
|
66
|
+
* organization at a time. Select contact_memory to rewrite memory from matching
|
|
67
|
+
* ended phone calls and SMS chats in chronological order, one conversation at a
|
|
68
|
+
* time, with no conversation-count cap. Backfill starts with the contact's
|
|
69
|
+
* existing memory. Each rewrite builds on the previous result, and the final
|
|
70
|
+
* successful result is saved once per contact. When mapped analysis fields and
|
|
71
|
+
* contact_memory are selected together, they are saved together in one contact
|
|
72
|
+
* update. Memory rewrites use the currently stored contact fields.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const response = await client.contact.backfillAnalysisData({
|
|
77
|
+
* backfill_attributes: ['contact_memory'],
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
39
81
|
backfillAnalysisData(body, options) {
|
|
40
82
|
return this._client.post('/backfill-contact-analysis-data', { body, ...options });
|
|
41
83
|
}
|
|
@@ -44,18 +86,44 @@ export class Contact extends APIResource {
|
|
|
44
86
|
* and updates existing ones matched by phone number. Mapped columns overwrite the
|
|
45
87
|
* matched contact's fields; unmapped columns are ignored. Runs asynchronously —
|
|
46
88
|
* poll get-contact-import for progress.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const response = await client.contact.createImport({
|
|
93
|
+
* column_mapping: [
|
|
94
|
+
* {
|
|
95
|
+
* external_field_name: 'external_field_name',
|
|
96
|
+
* field_name: 'field_name',
|
|
97
|
+
* },
|
|
98
|
+
* ],
|
|
99
|
+
* upload_id: 'upload_26f1cbdf5713',
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
47
102
|
*/
|
|
48
103
|
createImport(body, options) {
|
|
49
104
|
return this._client.post('/create-contact-import', { body, ...options });
|
|
50
105
|
}
|
|
51
106
|
/**
|
|
52
107
|
* Retrieve a contact by ID.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const contactResponse = await client.contact.get(
|
|
112
|
+
* 'contact_id',
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
53
115
|
*/
|
|
54
116
|
get(contactID, options) {
|
|
55
117
|
return this._client.get(path `/get-contact/${contactID}`, options);
|
|
56
118
|
}
|
|
57
119
|
/**
|
|
58
120
|
* Get the status of the contact analysis data backfill job.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const response =
|
|
125
|
+
* await client.contact.getBackfillJobStatus();
|
|
126
|
+
* ```
|
|
59
127
|
*/
|
|
60
128
|
getBackfillJobStatus(options) {
|
|
61
129
|
return this._client.get('/get-backfill-contact-job-status', options);
|
|
@@ -63,12 +131,24 @@ export class Contact extends APIResource {
|
|
|
63
131
|
/**
|
|
64
132
|
* Retrieve a contact by phone number. At most one contact exists per phone number
|
|
65
133
|
* in an organization.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* const contactResponse = await client.contact.getByPhone(
|
|
138
|
+
* 'phone_number',
|
|
139
|
+
* );
|
|
140
|
+
* ```
|
|
66
141
|
*/
|
|
67
142
|
getByPhone(phoneNumber, options) {
|
|
68
143
|
return this._client.get(path `/get-contact-by-phone/${phoneNumber}`, options);
|
|
69
144
|
}
|
|
70
145
|
/**
|
|
71
146
|
* Status and counts for the org's current or latest contact import.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const response = await client.contact.getImport();
|
|
151
|
+
* ```
|
|
72
152
|
*/
|
|
73
153
|
getImport(options) {
|
|
74
154
|
return this._client.get('/get-contact-import', options);
|
|
@@ -77,6 +157,13 @@ export class Contact extends APIResource {
|
|
|
77
157
|
* List a contact's conversations (inbound calls, outbound calls, and chats) merged
|
|
78
158
|
* into a single timeline, most recent first. Results are matched by the contact's
|
|
79
159
|
* phone number. Use the returned `pagination_key` to fetch the next page.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* const response = await client.contact.listConversations(
|
|
164
|
+
* 'contact_id',
|
|
165
|
+
* );
|
|
166
|
+
* ```
|
|
80
167
|
*/
|
|
81
168
|
listConversations(contactID, query = {}, options) {
|
|
82
169
|
return this._client.get(path `/list-contact-conversations/${contactID}`, { query, ...options });
|
|
@@ -84,6 +171,13 @@ export class Contact extends APIResource {
|
|
|
84
171
|
/**
|
|
85
172
|
* Upload a CSV file for a contact import. The file is stored privately and
|
|
86
173
|
* referenced by the returned upload_id in create-contact-import.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* const response = await client.contact.uploadImportFile({
|
|
178
|
+
* file: fs.createReadStream('path/to/file'),
|
|
179
|
+
* });
|
|
180
|
+
* ```
|
|
87
181
|
*/
|
|
88
182
|
uploadImportFile(body, options) {
|
|
89
183
|
return this._client.post('/upload-contact-import-file', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact.mjs","sourceRoot":"","sources":["../src/resources/contact.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,2BAA2B,EAAE,gCAA4B;AAClE,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"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