@roarkanalytics/sdk 7.8.0 → 8.0.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 +28 -0
- package/client.d.mts +20 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -5
- package/client.d.ts.map +1 -1
- package/client.js +18 -3
- package/client.js.map +1 -1
- package/client.mjs +18 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent-connection.d.mts +1952 -0
- package/resources/agent-connection.d.mts.map +1 -0
- package/resources/agent-connection.d.ts +1952 -0
- package/resources/agent-connection.d.ts.map +1 -0
- package/resources/agent-connection.js +173 -0
- package/resources/agent-connection.js.map +1 -0
- package/resources/agent-connection.mjs +169 -0
- package/resources/agent-connection.mjs.map +1 -0
- package/resources/agent-conversation.d.mts +110 -0
- package/resources/agent-conversation.d.mts.map +1 -0
- package/resources/agent-conversation.d.ts +110 -0
- package/resources/agent-conversation.d.ts.map +1 -0
- package/resources/agent-conversation.js +41 -0
- package/resources/agent-conversation.js.map +1 -0
- package/resources/agent-conversation.mjs +37 -0
- package/resources/agent-conversation.mjs.map +1 -0
- package/resources/agent-draft.d.mts +101 -35
- package/resources/agent-draft.d.mts.map +1 -1
- package/resources/agent-draft.d.ts +101 -35
- package/resources/agent-draft.d.ts.map +1 -1
- package/resources/agent-endpoint.d.mts +4 -4
- package/resources/agent-endpoint.d.mts.map +1 -1
- package/resources/agent-endpoint.d.ts +4 -4
- package/resources/agent-endpoint.d.ts.map +1 -1
- package/resources/agent-setup.d.mts +1057 -0
- package/resources/agent-setup.d.mts.map +1 -0
- package/resources/agent-setup.d.ts +1057 -0
- package/resources/agent-setup.d.ts.map +1 -0
- package/resources/agent-setup.js +113 -0
- package/resources/agent-setup.js.map +1 -0
- package/resources/agent-setup.mjs +109 -0
- package/resources/agent-setup.mjs.map +1 -0
- package/resources/agent-version.d.mts +57 -18
- package/resources/agent-version.d.mts.map +1 -1
- package/resources/agent-version.d.ts +57 -18
- package/resources/agent-version.d.ts.map +1 -1
- package/resources/agent.d.mts +263 -4
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +263 -4
- package/resources/agent.d.ts.map +1 -1
- package/resources/calendar-connection.d.mts +834 -56
- package/resources/calendar-connection.d.mts.map +1 -1
- package/resources/calendar-connection.d.ts +834 -56
- package/resources/calendar-connection.d.ts.map +1 -1
- package/resources/calendar-connection.js +127 -8
- package/resources/calendar-connection.js.map +1 -1
- package/resources/calendar-connection.mjs +127 -8
- package/resources/calendar-connection.mjs.map +1 -1
- package/resources/call.d.mts +2 -2
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +2 -2
- package/resources/call.d.ts.map +1 -1
- package/resources/config.d.mts +78 -36
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +78 -36
- package/resources/config.d.ts.map +1 -1
- package/resources/conversation.d.mts +156 -0
- package/resources/conversation.d.mts.map +1 -0
- package/resources/conversation.d.ts +156 -0
- package/resources/conversation.d.ts.map +1 -0
- package/resources/conversation.js +40 -0
- package/resources/conversation.js.map +1 -0
- package/resources/conversation.mjs +36 -0
- package/resources/conversation.mjs.map +1 -0
- package/resources/customer-flow-edge-case.d.mts +637 -40
- package/resources/customer-flow-edge-case.d.mts.map +1 -1
- package/resources/customer-flow-edge-case.d.ts +637 -40
- package/resources/customer-flow-edge-case.d.ts.map +1 -1
- package/resources/customer-flow.d.mts +2583 -156
- package/resources/customer-flow.d.mts.map +1 -1
- package/resources/customer-flow.d.ts +2583 -156
- package/resources/customer-flow.d.ts.map +1 -1
- package/resources/{customer-profile.d.mts → customer.d.mts} +287 -98
- package/resources/customer.d.mts.map +1 -0
- package/resources/{customer-profile.d.ts → customer.d.ts} +287 -98
- package/resources/customer.d.ts.map +1 -0
- package/resources/customer.js +180 -0
- package/resources/customer.js.map +1 -0
- package/resources/customer.mjs +176 -0
- package/resources/customer.mjs.map +1 -0
- package/resources/index.d.mts +7 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp-server.d.mts +588 -0
- package/resources/mcp-server.d.mts.map +1 -0
- package/resources/mcp-server.d.ts +588 -0
- package/resources/mcp-server.d.ts.map +1 -0
- package/resources/mcp-server.js +109 -0
- package/resources/mcp-server.js.map +1 -0
- package/resources/mcp-server.mjs +105 -0
- package/resources/mcp-server.mjs.map +1 -0
- package/resources/metric-policy.d.mts +5 -4
- package/resources/metric-policy.d.mts.map +1 -1
- package/resources/metric-policy.d.ts +5 -4
- package/resources/metric-policy.d.ts.map +1 -1
- package/resources/metric-policy.js +1 -1
- package/resources/metric-policy.mjs +1 -1
- package/resources/metric-variant.d.mts +4 -1
- package/resources/metric-variant.d.mts.map +1 -1
- package/resources/metric-variant.d.ts +4 -1
- package/resources/metric-variant.d.ts.map +1 -1
- package/resources/metric.d.mts +7 -2
- package/resources/metric.d.mts.map +1 -1
- package/resources/metric.d.ts +7 -2
- package/resources/metric.d.ts.map +1 -1
- package/resources/simulation-environment.d.mts +366 -0
- package/resources/simulation-environment.d.mts.map +1 -1
- package/resources/simulation-environment.d.ts +366 -0
- package/resources/simulation-environment.d.ts.map +1 -1
- package/resources/simulation-job.d.mts +12 -8
- package/resources/simulation-job.d.mts.map +1 -1
- package/resources/simulation-job.d.ts +12 -8
- package/resources/simulation-job.d.ts.map +1 -1
- package/resources/simulation-persona.d.mts +25 -15
- package/resources/simulation-persona.d.mts.map +1 -1
- package/resources/simulation-persona.d.ts +25 -15
- package/resources/simulation-persona.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +32 -6
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +32 -6
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/resources/simulation-run-plan.d.mts +126 -13
- package/resources/simulation-run-plan.d.mts.map +1 -1
- package/resources/simulation-run-plan.d.ts +126 -13
- package/resources/simulation-run-plan.d.ts.map +1 -1
- package/resources/simulation-template.d.mts +1 -1
- package/resources/simulation-template.d.mts.map +1 -1
- package/resources/simulation-template.d.ts +1 -1
- package/resources/simulation-template.d.ts.map +1 -1
- package/resources/simulation.d.mts +35 -3
- package/resources/simulation.d.mts.map +1 -1
- package/resources/simulation.d.ts +35 -3
- package/resources/simulation.d.ts.map +1 -1
- package/resources/tool.d.mts +565 -6
- package/resources/tool.d.mts.map +1 -1
- package/resources/tool.d.ts +565 -6
- package/resources/tool.d.ts.map +1 -1
- package/resources/tool.js +9 -6
- package/resources/tool.js.map +1 -1
- package/resources/tool.mjs +9 -6
- package/resources/tool.mjs.map +1 -1
- package/resources/usage.d.mts +1 -1
- package/resources/usage.d.mts.map +1 -1
- package/resources/usage.d.ts +1 -1
- package/resources/usage.d.ts.map +1 -1
- package/resources/webhook.d.mts +4 -4
- package/resources/webhook.d.mts.map +1 -1
- package/resources/webhook.d.ts +4 -4
- package/resources/webhook.d.ts.map +1 -1
- package/src/client.ts +197 -34
- package/src/resources/agent-connection.ts +2523 -0
- package/src/resources/agent-conversation.ts +139 -0
- package/src/resources/agent-draft.ts +239 -35
- package/src/resources/agent-endpoint.ts +8 -4
- package/src/resources/agent-setup.ts +1685 -0
- package/src/resources/agent-version.ts +126 -18
- package/src/resources/agent.ts +506 -4
- package/src/resources/calendar-connection.ts +1035 -63
- package/src/resources/call.ts +12 -2
- package/src/resources/config.ts +198 -36
- package/src/resources/conversation.ts +205 -0
- package/src/resources/customer-flow-edge-case.ts +709 -40
- package/src/resources/customer-flow.ts +3141 -156
- package/src/resources/{customer-profile.ts → customer.ts} +406 -306
- package/src/resources/index.ts +91 -17
- package/src/resources/mcp-server.ts +786 -0
- package/src/resources/metric-policy.ts +5 -4
- package/src/resources/metric-variant.ts +4 -1
- package/src/resources/metric.ts +7 -2
- package/src/resources/simulation-environment.ts +414 -0
- package/src/resources/simulation-job.ts +14 -8
- package/src/resources/simulation-persona.ts +25 -15
- package/src/resources/simulation-run-plan-job.ts +47 -6
- package/src/resources/simulation-run-plan.ts +140 -0
- package/src/resources/simulation-template.ts +1 -0
- package/src/resources/simulation.ts +39 -0
- package/src/resources/tool.ts +697 -6
- package/src/resources/usage.ts +6 -1
- package/src/resources/webhook.ts +8 -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/customer-profile.d.mts.map +0 -1
- package/resources/customer-profile.d.ts.map +0 -1
- package/resources/customer-profile.js +0 -141
- package/resources/customer-profile.js.map +0 -1
- package/resources/customer-profile.mjs +0 -137
- package/resources/customer-profile.mjs.map +0 -1
|
@@ -5,7 +5,7 @@ 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
|
-
export class
|
|
8
|
+
export class Customer extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Returns the people who have talked to your agents in this project. Customers we
|
|
11
11
|
* hold nothing about beyond their identifier are left out unless includeNoData is
|
|
@@ -13,30 +13,30 @@ export class CustomerProfile extends APIResource {
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
|
-
* const
|
|
17
|
-
* await client.customerProfile.list();
|
|
16
|
+
* const customers = await client.customer.list();
|
|
18
17
|
* ```
|
|
19
18
|
*/
|
|
20
19
|
list(
|
|
21
|
-
query:
|
|
20
|
+
query: CustomerListParams | null | undefined = {},
|
|
22
21
|
options?: RequestOptions,
|
|
23
|
-
): APIPromise<
|
|
24
|
-
return this._client.get('/v1/customer
|
|
22
|
+
): APIPromise<CustomerListResponse> {
|
|
23
|
+
return this._client.get('/v1/customer', { query, ...options });
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
|
-
* Permanently removes the
|
|
29
|
-
* are kept. A new conversation from the same identifier
|
|
27
|
+
* Permanently removes the customer, with their fields, evidence and notes.
|
|
28
|
+
* Conversations are kept. A new conversation from the same identifier starts a new
|
|
29
|
+
* customer.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
|
33
|
-
* const
|
|
33
|
+
* const customer = await client.customer.delete(
|
|
34
34
|
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
35
35
|
* );
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
delete(customerProfileID: string, options?: RequestOptions): APIPromise<
|
|
39
|
-
return this._client.delete(path`/v1/customer
|
|
38
|
+
delete(customerProfileID: string, options?: RequestOptions): APIPromise<CustomerDeleteResponse> {
|
|
39
|
+
return this._client.delete(path`/v1/customer/${customerProfileID}`, options);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -44,48 +44,66 @@ export class CustomerProfile extends APIResource {
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
47
|
-
* const response =
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
51
|
-
* });
|
|
47
|
+
* const response = await client.customer.clearAttribute('x', {
|
|
48
|
+
* customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
49
|
+
* });
|
|
52
50
|
* ```
|
|
53
51
|
*/
|
|
54
52
|
clearAttribute(
|
|
55
|
-
key:
|
|
56
|
-
|
|
57
|
-
| 'PREFERRED_NAME'
|
|
58
|
-
| 'ACCOUNT_ID'
|
|
59
|
-
| 'COMPANY'
|
|
60
|
-
| 'JOB_TITLE'
|
|
61
|
-
| 'EMAIL'
|
|
62
|
-
| 'ALTERNATE_PHONE'
|
|
63
|
-
| 'AGE'
|
|
64
|
-
| 'GENDER'
|
|
65
|
-
| 'LANGUAGE'
|
|
66
|
-
| 'LOCATION'
|
|
67
|
-
| 'TIMEZONE'
|
|
68
|
-
| 'BEST_TIME_TO_REACH'
|
|
69
|
-
| 'PREFERRED_CHANNEL',
|
|
70
|
-
params: CustomerProfileClearAttributeParams,
|
|
53
|
+
key: string,
|
|
54
|
+
params: CustomerClearAttributeParams,
|
|
71
55
|
options?: RequestOptions,
|
|
72
|
-
): APIPromise<
|
|
56
|
+
): APIPromise<CustomerClearAttributeResponse> {
|
|
73
57
|
const { customerProfileId } = params;
|
|
74
|
-
return this._client.delete(path`/v1/customer
|
|
58
|
+
return this._client.delete(path`/v1/customer/${customerProfileId}/attributes/${key}`, options);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Adds a field of your project's own. With extract on, conversations fill it from
|
|
63
|
+
* what customers say, guided by its description.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const response = await client.customer.createField({
|
|
68
|
+
* extract: true,
|
|
69
|
+
* key: 'plan_tier',
|
|
70
|
+
* label: 'x',
|
|
71
|
+
* valueType: 'TEXT',
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
createField(
|
|
76
|
+
body: CustomerCreateFieldParams,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): APIPromise<CustomerCreateFieldResponse> {
|
|
79
|
+
return this._client.post('/v1/customer/fields', { body, ...options });
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
/**
|
|
78
|
-
*
|
|
83
|
+
* Deletes a field of your project's own. Its values stop showing on customers. A
|
|
84
|
+
* built-in field cannot be deleted; turn it off instead.
|
|
79
85
|
*
|
|
80
86
|
* @example
|
|
81
87
|
* ```ts
|
|
82
|
-
* const response = await client.
|
|
88
|
+
* const response = await client.customer.deleteField('x');
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
deleteField(key: string, options?: RequestOptions): APIPromise<CustomerDeleteFieldResponse> {
|
|
92
|
+
return this._client.delete(path`/v1/customer/fields/${key}`, options);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get a customer
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const response = await client.customer.getByID(
|
|
83
101
|
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
84
102
|
* );
|
|
85
103
|
* ```
|
|
86
104
|
*/
|
|
87
|
-
getByID(customerProfileID: string, options?: RequestOptions): APIPromise<
|
|
88
|
-
return this._client.get(path`/v1/customer
|
|
105
|
+
getByID(customerProfileID: string, options?: RequestOptions): APIPromise<CustomerGetByIDResponse> {
|
|
106
|
+
return this._client.get(path`/v1/customer/${customerProfileID}`, options);
|
|
89
107
|
}
|
|
90
108
|
|
|
91
109
|
/**
|
|
@@ -93,21 +111,30 @@ export class CustomerProfile extends APIResource {
|
|
|
93
111
|
*
|
|
94
112
|
* @example
|
|
95
113
|
* ```ts
|
|
96
|
-
* const response =
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* );
|
|
114
|
+
* const response = await client.customer.listConversations(
|
|
115
|
+
* 'customerProfileId',
|
|
116
|
+
* );
|
|
100
117
|
* ```
|
|
101
118
|
*/
|
|
102
119
|
listConversations(
|
|
103
120
|
customerProfileID: string,
|
|
104
|
-
query:
|
|
121
|
+
query: CustomerListConversationsParams | null | undefined = {},
|
|
105
122
|
options?: RequestOptions,
|
|
106
|
-
): APIPromise<
|
|
107
|
-
return this._client.get(path`/v1/customer
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
): APIPromise<CustomerListConversationsResponse> {
|
|
124
|
+
return this._client.get(path`/v1/customer/${customerProfileID}/conversations`, { query, ...options });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The fields this project's customers can hold, in display order. Use a field's
|
|
129
|
+
* key to filter, sort and set attributes.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* const response = await client.customer.listFields();
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
listFields(options?: RequestOptions): APIPromise<CustomerListFieldsResponse> {
|
|
137
|
+
return this._client.get('/v1/customer/fields', options);
|
|
111
138
|
}
|
|
112
139
|
|
|
113
140
|
/**
|
|
@@ -115,40 +142,19 @@ export class CustomerProfile extends APIResource {
|
|
|
115
142
|
*
|
|
116
143
|
* @example
|
|
117
144
|
* ```ts
|
|
118
|
-
* const response = await client.
|
|
119
|
-
* '
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
123
|
-
* value: 'x',
|
|
124
|
-
* },
|
|
125
|
-
* );
|
|
145
|
+
* const response = await client.customer.setAttribute('x', {
|
|
146
|
+
* customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
147
|
+
* value: 'x',
|
|
148
|
+
* });
|
|
126
149
|
* ```
|
|
127
150
|
*/
|
|
128
151
|
setAttribute(
|
|
129
|
-
key:
|
|
130
|
-
|
|
131
|
-
| 'PREFERRED_NAME'
|
|
132
|
-
| 'ACCOUNT_ID'
|
|
133
|
-
| 'COMPANY'
|
|
134
|
-
| 'JOB_TITLE'
|
|
135
|
-
| 'EMAIL'
|
|
136
|
-
| 'ALTERNATE_PHONE'
|
|
137
|
-
| 'AGE'
|
|
138
|
-
| 'GENDER'
|
|
139
|
-
| 'LANGUAGE'
|
|
140
|
-
| 'LOCATION'
|
|
141
|
-
| 'TIMEZONE'
|
|
142
|
-
| 'BEST_TIME_TO_REACH'
|
|
143
|
-
| 'PREFERRED_CHANNEL',
|
|
144
|
-
params: CustomerProfileSetAttributeParams,
|
|
152
|
+
key: string,
|
|
153
|
+
params: CustomerSetAttributeParams,
|
|
145
154
|
options?: RequestOptions,
|
|
146
|
-
): APIPromise<
|
|
155
|
+
): APIPromise<CustomerSetAttributeResponse> {
|
|
147
156
|
const { customerProfileId, ...body } = params;
|
|
148
|
-
return this._client.put(path`/v1/customer
|
|
149
|
-
body,
|
|
150
|
-
...options,
|
|
151
|
-
});
|
|
157
|
+
return this._client.put(path`/v1/customer/${customerProfileId}/attributes/${key}`, { body, ...options });
|
|
152
158
|
}
|
|
153
159
|
|
|
154
160
|
/**
|
|
@@ -157,40 +163,39 @@ export class CustomerProfile extends APIResource {
|
|
|
157
163
|
*
|
|
158
164
|
* @example
|
|
159
165
|
* ```ts
|
|
160
|
-
* const response =
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* );
|
|
166
|
+
* const response = await client.customer.unlockAttribute(
|
|
167
|
+
* 'x',
|
|
168
|
+
* {
|
|
169
|
+
* customerProfileId:
|
|
170
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
171
|
+
* },
|
|
172
|
+
* );
|
|
168
173
|
* ```
|
|
169
174
|
*/
|
|
170
175
|
unlockAttribute(
|
|
171
|
-
key:
|
|
172
|
-
|
|
173
|
-
| 'PREFERRED_NAME'
|
|
174
|
-
| 'ACCOUNT_ID'
|
|
175
|
-
| 'COMPANY'
|
|
176
|
-
| 'JOB_TITLE'
|
|
177
|
-
| 'EMAIL'
|
|
178
|
-
| 'ALTERNATE_PHONE'
|
|
179
|
-
| 'AGE'
|
|
180
|
-
| 'GENDER'
|
|
181
|
-
| 'LANGUAGE'
|
|
182
|
-
| 'LOCATION'
|
|
183
|
-
| 'TIMEZONE'
|
|
184
|
-
| 'BEST_TIME_TO_REACH'
|
|
185
|
-
| 'PREFERRED_CHANNEL',
|
|
186
|
-
params: CustomerProfileUnlockAttributeParams,
|
|
176
|
+
key: string,
|
|
177
|
+
params: CustomerUnlockAttributeParams,
|
|
187
178
|
options?: RequestOptions,
|
|
188
|
-
): APIPromise<
|
|
179
|
+
): APIPromise<CustomerUnlockAttributeResponse> {
|
|
189
180
|
const { customerProfileId } = params;
|
|
190
|
-
return this._client.post(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
return this._client.post(path`/v1/customer/${customerProfileId}/attributes/${key}/unlock`, options);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Changes a field. A built-in field can only be turned on or off for your project;
|
|
186
|
+
* any field of your project's own can change everything but its key.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* const response = await client.customer.updateField('x');
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
updateField(
|
|
194
|
+
key: string,
|
|
195
|
+
body: CustomerUpdateFieldParams | null | undefined = {},
|
|
196
|
+
options?: RequestOptions,
|
|
197
|
+
): APIPromise<CustomerUpdateFieldResponse> {
|
|
198
|
+
return this._client.patch(path`/v1/customer/fields/${key}`, { body, ...options });
|
|
194
199
|
}
|
|
195
200
|
|
|
196
201
|
/**
|
|
@@ -199,7 +204,7 @@ export class CustomerProfile extends APIResource {
|
|
|
199
204
|
*
|
|
200
205
|
* @example
|
|
201
206
|
* ```ts
|
|
202
|
-
* const response = await client.
|
|
207
|
+
* const response = await client.customer.updateNotes(
|
|
203
208
|
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
204
209
|
* { notes: 'notes' },
|
|
205
210
|
* );
|
|
@@ -207,18 +212,18 @@ export class CustomerProfile extends APIResource {
|
|
|
207
212
|
*/
|
|
208
213
|
updateNotes(
|
|
209
214
|
customerProfileID: string,
|
|
210
|
-
body:
|
|
215
|
+
body: CustomerUpdateNotesParams,
|
|
211
216
|
options?: RequestOptions,
|
|
212
|
-
): APIPromise<
|
|
213
|
-
return this._client.put(path`/v1/customer
|
|
217
|
+
): APIPromise<CustomerUpdateNotesResponse> {
|
|
218
|
+
return this._client.put(path`/v1/customer/${customerProfileID}/notes`, { body, ...options });
|
|
214
219
|
}
|
|
215
220
|
}
|
|
216
221
|
|
|
217
|
-
export interface
|
|
218
|
-
data:
|
|
222
|
+
export interface CustomerListResponse {
|
|
223
|
+
data: CustomerListResponse.Data;
|
|
219
224
|
}
|
|
220
225
|
|
|
221
|
-
export namespace
|
|
226
|
+
export namespace CustomerListResponse {
|
|
222
227
|
export interface Data {
|
|
223
228
|
items: Array<Data.Item>;
|
|
224
229
|
|
|
@@ -230,7 +235,7 @@ export namespace CustomerProfileListResponse {
|
|
|
230
235
|
export namespace Data {
|
|
231
236
|
export interface Item {
|
|
232
237
|
/**
|
|
233
|
-
* Unique identifier of the customer
|
|
238
|
+
* Unique identifier of the customer
|
|
234
239
|
*/
|
|
235
240
|
id: string;
|
|
236
241
|
|
|
@@ -260,8 +265,6 @@ export namespace CustomerProfileListResponse {
|
|
|
260
265
|
|
|
261
266
|
notesUpdatedAt: string | null;
|
|
262
267
|
|
|
263
|
-
openItems: string | null;
|
|
264
|
-
|
|
265
268
|
phoneNumberE164: string | null;
|
|
266
269
|
|
|
267
270
|
summary: string | null;
|
|
@@ -292,26 +295,18 @@ export namespace CustomerProfileListResponse {
|
|
|
292
295
|
*/
|
|
293
296
|
history: Array<Attribute.History>;
|
|
294
297
|
|
|
298
|
+
/**
|
|
299
|
+
* True when the value was inferred from the conversation, such as a gender read
|
|
300
|
+
* from a name, rather than stated. A stated value always replaces it.
|
|
301
|
+
*/
|
|
302
|
+
isInferred: boolean;
|
|
303
|
+
|
|
295
304
|
/**
|
|
296
305
|
* True when newer conversations cannot change this field
|
|
297
306
|
*/
|
|
298
307
|
isLocked: boolean;
|
|
299
308
|
|
|
300
|
-
key:
|
|
301
|
-
| 'FULL_NAME'
|
|
302
|
-
| 'PREFERRED_NAME'
|
|
303
|
-
| 'ACCOUNT_ID'
|
|
304
|
-
| 'COMPANY'
|
|
305
|
-
| 'JOB_TITLE'
|
|
306
|
-
| 'EMAIL'
|
|
307
|
-
| 'ALTERNATE_PHONE'
|
|
308
|
-
| 'AGE'
|
|
309
|
-
| 'GENDER'
|
|
310
|
-
| 'LANGUAGE'
|
|
311
|
-
| 'LOCATION'
|
|
312
|
-
| 'TIMEZONE'
|
|
313
|
-
| 'BEST_TIME_TO_REACH'
|
|
314
|
-
| 'PREFERRED_CHANNEL';
|
|
309
|
+
key: string;
|
|
315
310
|
|
|
316
311
|
observedAt: string;
|
|
317
312
|
|
|
@@ -377,24 +372,24 @@ export namespace CustomerProfileListResponse {
|
|
|
377
372
|
}
|
|
378
373
|
}
|
|
379
374
|
|
|
380
|
-
export interface
|
|
381
|
-
data:
|
|
375
|
+
export interface CustomerDeleteResponse {
|
|
376
|
+
data: CustomerDeleteResponse.Data;
|
|
382
377
|
}
|
|
383
378
|
|
|
384
|
-
export namespace
|
|
379
|
+
export namespace CustomerDeleteResponse {
|
|
385
380
|
export interface Data {
|
|
386
381
|
success: boolean;
|
|
387
382
|
}
|
|
388
383
|
}
|
|
389
384
|
|
|
390
|
-
export interface
|
|
391
|
-
data:
|
|
385
|
+
export interface CustomerClearAttributeResponse {
|
|
386
|
+
data: CustomerClearAttributeResponse.Data;
|
|
392
387
|
}
|
|
393
388
|
|
|
394
|
-
export namespace
|
|
389
|
+
export namespace CustomerClearAttributeResponse {
|
|
395
390
|
export interface Data {
|
|
396
391
|
/**
|
|
397
|
-
* Unique identifier of the customer
|
|
392
|
+
* Unique identifier of the customer
|
|
398
393
|
*/
|
|
399
394
|
id: string;
|
|
400
395
|
|
|
@@ -424,8 +419,6 @@ export namespace CustomerProfileClearAttributeResponse {
|
|
|
424
419
|
|
|
425
420
|
notesUpdatedAt: string | null;
|
|
426
421
|
|
|
427
|
-
openItems: string | null;
|
|
428
|
-
|
|
429
422
|
phoneNumberE164: string | null;
|
|
430
423
|
|
|
431
424
|
summary: string | null;
|
|
@@ -456,26 +449,18 @@ export namespace CustomerProfileClearAttributeResponse {
|
|
|
456
449
|
*/
|
|
457
450
|
history: Array<Attribute.History>;
|
|
458
451
|
|
|
452
|
+
/**
|
|
453
|
+
* True when the value was inferred from the conversation, such as a gender read
|
|
454
|
+
* from a name, rather than stated. A stated value always replaces it.
|
|
455
|
+
*/
|
|
456
|
+
isInferred: boolean;
|
|
457
|
+
|
|
459
458
|
/**
|
|
460
459
|
* True when newer conversations cannot change this field
|
|
461
460
|
*/
|
|
462
461
|
isLocked: boolean;
|
|
463
462
|
|
|
464
|
-
key:
|
|
465
|
-
| 'FULL_NAME'
|
|
466
|
-
| 'PREFERRED_NAME'
|
|
467
|
-
| 'ACCOUNT_ID'
|
|
468
|
-
| 'COMPANY'
|
|
469
|
-
| 'JOB_TITLE'
|
|
470
|
-
| 'EMAIL'
|
|
471
|
-
| 'ALTERNATE_PHONE'
|
|
472
|
-
| 'AGE'
|
|
473
|
-
| 'GENDER'
|
|
474
|
-
| 'LANGUAGE'
|
|
475
|
-
| 'LOCATION'
|
|
476
|
-
| 'TIMEZONE'
|
|
477
|
-
| 'BEST_TIME_TO_REACH'
|
|
478
|
-
| 'PREFERRED_CHANNEL';
|
|
463
|
+
key: string;
|
|
479
464
|
|
|
480
465
|
observedAt: string;
|
|
481
466
|
|
|
@@ -540,14 +525,70 @@ export namespace CustomerProfileClearAttributeResponse {
|
|
|
540
525
|
}
|
|
541
526
|
}
|
|
542
527
|
|
|
543
|
-
export interface
|
|
544
|
-
data:
|
|
528
|
+
export interface CustomerCreateFieldResponse {
|
|
529
|
+
data: CustomerCreateFieldResponse.Data;
|
|
545
530
|
}
|
|
546
531
|
|
|
547
|
-
export namespace
|
|
532
|
+
export namespace CustomerCreateFieldResponse {
|
|
548
533
|
export interface Data {
|
|
549
534
|
/**
|
|
550
|
-
*
|
|
535
|
+
* What extraction looks for in a conversation
|
|
536
|
+
*/
|
|
537
|
+
description: string | null;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Whether conversations fill this field on this project: the project's own setting
|
|
541
|
+
* where it made one
|
|
542
|
+
*/
|
|
543
|
+
extract: boolean;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* What filters, sorts and attribute routes name the field by
|
|
547
|
+
*/
|
|
548
|
+
key: string;
|
|
549
|
+
|
|
550
|
+
label: string;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* The project redaction setting that, when on, keeps conversations from filling
|
|
554
|
+
* this field
|
|
555
|
+
*/
|
|
556
|
+
redactedBy:
|
|
557
|
+
| 'redactName'
|
|
558
|
+
| 'redactEmail'
|
|
559
|
+
| 'redactPhone'
|
|
560
|
+
| 'redactDateOfBirth'
|
|
561
|
+
| 'redactAddress'
|
|
562
|
+
| 'redactBankAccountNumber'
|
|
563
|
+
| null;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* SYSTEM for a built-in field, CUSTOM for one your project defined
|
|
567
|
+
*/
|
|
568
|
+
source: 'SYSTEM' | 'CUSTOM';
|
|
569
|
+
|
|
570
|
+
valueType: 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'PHONE_NUMBER' | 'EMAIL' | 'CURRENCY';
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export interface CustomerDeleteFieldResponse {
|
|
575
|
+
data: CustomerDeleteFieldResponse.Data;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export namespace CustomerDeleteFieldResponse {
|
|
579
|
+
export interface Data {
|
|
580
|
+
success: boolean;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export interface CustomerGetByIDResponse {
|
|
585
|
+
data: CustomerGetByIDResponse.Data;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export namespace CustomerGetByIDResponse {
|
|
589
|
+
export interface Data {
|
|
590
|
+
/**
|
|
591
|
+
* Unique identifier of the customer
|
|
551
592
|
*/
|
|
552
593
|
id: string;
|
|
553
594
|
|
|
@@ -577,8 +618,6 @@ export namespace CustomerProfileGetByIDResponse {
|
|
|
577
618
|
|
|
578
619
|
notesUpdatedAt: string | null;
|
|
579
620
|
|
|
580
|
-
openItems: string | null;
|
|
581
|
-
|
|
582
621
|
phoneNumberE164: string | null;
|
|
583
622
|
|
|
584
623
|
summary: string | null;
|
|
@@ -609,26 +648,18 @@ export namespace CustomerProfileGetByIDResponse {
|
|
|
609
648
|
*/
|
|
610
649
|
history: Array<Attribute.History>;
|
|
611
650
|
|
|
651
|
+
/**
|
|
652
|
+
* True when the value was inferred from the conversation, such as a gender read
|
|
653
|
+
* from a name, rather than stated. A stated value always replaces it.
|
|
654
|
+
*/
|
|
655
|
+
isInferred: boolean;
|
|
656
|
+
|
|
612
657
|
/**
|
|
613
658
|
* True when newer conversations cannot change this field
|
|
614
659
|
*/
|
|
615
660
|
isLocked: boolean;
|
|
616
661
|
|
|
617
|
-
key:
|
|
618
|
-
| 'FULL_NAME'
|
|
619
|
-
| 'PREFERRED_NAME'
|
|
620
|
-
| 'ACCOUNT_ID'
|
|
621
|
-
| 'COMPANY'
|
|
622
|
-
| 'JOB_TITLE'
|
|
623
|
-
| 'EMAIL'
|
|
624
|
-
| 'ALTERNATE_PHONE'
|
|
625
|
-
| 'AGE'
|
|
626
|
-
| 'GENDER'
|
|
627
|
-
| 'LANGUAGE'
|
|
628
|
-
| 'LOCATION'
|
|
629
|
-
| 'TIMEZONE'
|
|
630
|
-
| 'BEST_TIME_TO_REACH'
|
|
631
|
-
| 'PREFERRED_CHANNEL';
|
|
662
|
+
key: string;
|
|
632
663
|
|
|
633
664
|
observedAt: string;
|
|
634
665
|
|
|
@@ -693,11 +724,11 @@ export namespace CustomerProfileGetByIDResponse {
|
|
|
693
724
|
}
|
|
694
725
|
}
|
|
695
726
|
|
|
696
|
-
export interface
|
|
697
|
-
data:
|
|
727
|
+
export interface CustomerListConversationsResponse {
|
|
728
|
+
data: CustomerListConversationsResponse.Data;
|
|
698
729
|
}
|
|
699
730
|
|
|
700
|
-
export namespace
|
|
731
|
+
export namespace CustomerListConversationsResponse {
|
|
701
732
|
export interface Data {
|
|
702
733
|
items: Array<Data.Item>;
|
|
703
734
|
|
|
@@ -710,7 +741,10 @@ export namespace CustomerProfileListConversationsResponse {
|
|
|
710
741
|
export interface Item {
|
|
711
742
|
id: string;
|
|
712
743
|
|
|
713
|
-
|
|
744
|
+
/**
|
|
745
|
+
* `voice` or `chat`.
|
|
746
|
+
*/
|
|
747
|
+
conversationType: 'voice' | 'chat';
|
|
714
748
|
|
|
715
749
|
durationMs: number | null;
|
|
716
750
|
|
|
@@ -723,14 +757,60 @@ export namespace CustomerProfileListConversationsResponse {
|
|
|
723
757
|
}
|
|
724
758
|
}
|
|
725
759
|
|
|
726
|
-
export interface
|
|
727
|
-
data:
|
|
760
|
+
export interface CustomerListFieldsResponse {
|
|
761
|
+
data: Array<CustomerListFieldsResponse.Data>;
|
|
728
762
|
}
|
|
729
763
|
|
|
730
|
-
export namespace
|
|
764
|
+
export namespace CustomerListFieldsResponse {
|
|
731
765
|
export interface Data {
|
|
732
766
|
/**
|
|
733
|
-
*
|
|
767
|
+
* What extraction looks for in a conversation
|
|
768
|
+
*/
|
|
769
|
+
description: string | null;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Whether conversations fill this field on this project: the project's own setting
|
|
773
|
+
* where it made one
|
|
774
|
+
*/
|
|
775
|
+
extract: boolean;
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* What filters, sorts and attribute routes name the field by
|
|
779
|
+
*/
|
|
780
|
+
key: string;
|
|
781
|
+
|
|
782
|
+
label: string;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* The project redaction setting that, when on, keeps conversations from filling
|
|
786
|
+
* this field
|
|
787
|
+
*/
|
|
788
|
+
redactedBy:
|
|
789
|
+
| 'redactName'
|
|
790
|
+
| 'redactEmail'
|
|
791
|
+
| 'redactPhone'
|
|
792
|
+
| 'redactDateOfBirth'
|
|
793
|
+
| 'redactAddress'
|
|
794
|
+
| 'redactBankAccountNumber'
|
|
795
|
+
| null;
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* SYSTEM for a built-in field, CUSTOM for one your project defined
|
|
799
|
+
*/
|
|
800
|
+
source: 'SYSTEM' | 'CUSTOM';
|
|
801
|
+
|
|
802
|
+
valueType: 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'PHONE_NUMBER' | 'EMAIL' | 'CURRENCY';
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export interface CustomerSetAttributeResponse {
|
|
807
|
+
data: CustomerSetAttributeResponse.Data;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export namespace CustomerSetAttributeResponse {
|
|
811
|
+
export interface Data {
|
|
812
|
+
/**
|
|
813
|
+
* Unique identifier of the customer
|
|
734
814
|
*/
|
|
735
815
|
id: string;
|
|
736
816
|
|
|
@@ -760,8 +840,6 @@ export namespace CustomerProfileSetAttributeResponse {
|
|
|
760
840
|
|
|
761
841
|
notesUpdatedAt: string | null;
|
|
762
842
|
|
|
763
|
-
openItems: string | null;
|
|
764
|
-
|
|
765
843
|
phoneNumberE164: string | null;
|
|
766
844
|
|
|
767
845
|
summary: string | null;
|
|
@@ -792,26 +870,18 @@ export namespace CustomerProfileSetAttributeResponse {
|
|
|
792
870
|
*/
|
|
793
871
|
history: Array<Attribute.History>;
|
|
794
872
|
|
|
873
|
+
/**
|
|
874
|
+
* True when the value was inferred from the conversation, such as a gender read
|
|
875
|
+
* from a name, rather than stated. A stated value always replaces it.
|
|
876
|
+
*/
|
|
877
|
+
isInferred: boolean;
|
|
878
|
+
|
|
795
879
|
/**
|
|
796
880
|
* True when newer conversations cannot change this field
|
|
797
881
|
*/
|
|
798
882
|
isLocked: boolean;
|
|
799
883
|
|
|
800
|
-
key:
|
|
801
|
-
| 'FULL_NAME'
|
|
802
|
-
| 'PREFERRED_NAME'
|
|
803
|
-
| 'ACCOUNT_ID'
|
|
804
|
-
| 'COMPANY'
|
|
805
|
-
| 'JOB_TITLE'
|
|
806
|
-
| 'EMAIL'
|
|
807
|
-
| 'ALTERNATE_PHONE'
|
|
808
|
-
| 'AGE'
|
|
809
|
-
| 'GENDER'
|
|
810
|
-
| 'LANGUAGE'
|
|
811
|
-
| 'LOCATION'
|
|
812
|
-
| 'TIMEZONE'
|
|
813
|
-
| 'BEST_TIME_TO_REACH'
|
|
814
|
-
| 'PREFERRED_CHANNEL';
|
|
884
|
+
key: string;
|
|
815
885
|
|
|
816
886
|
observedAt: string;
|
|
817
887
|
|
|
@@ -876,14 +946,14 @@ export namespace CustomerProfileSetAttributeResponse {
|
|
|
876
946
|
}
|
|
877
947
|
}
|
|
878
948
|
|
|
879
|
-
export interface
|
|
880
|
-
data:
|
|
949
|
+
export interface CustomerUnlockAttributeResponse {
|
|
950
|
+
data: CustomerUnlockAttributeResponse.Data;
|
|
881
951
|
}
|
|
882
952
|
|
|
883
|
-
export namespace
|
|
953
|
+
export namespace CustomerUnlockAttributeResponse {
|
|
884
954
|
export interface Data {
|
|
885
955
|
/**
|
|
886
|
-
* Unique identifier of the customer
|
|
956
|
+
* Unique identifier of the customer
|
|
887
957
|
*/
|
|
888
958
|
id: string;
|
|
889
959
|
|
|
@@ -913,8 +983,6 @@ export namespace CustomerProfileUnlockAttributeResponse {
|
|
|
913
983
|
|
|
914
984
|
notesUpdatedAt: string | null;
|
|
915
985
|
|
|
916
|
-
openItems: string | null;
|
|
917
|
-
|
|
918
986
|
phoneNumberE164: string | null;
|
|
919
987
|
|
|
920
988
|
summary: string | null;
|
|
@@ -945,26 +1013,18 @@ export namespace CustomerProfileUnlockAttributeResponse {
|
|
|
945
1013
|
*/
|
|
946
1014
|
history: Array<Attribute.History>;
|
|
947
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* True when the value was inferred from the conversation, such as a gender read
|
|
1018
|
+
* from a name, rather than stated. A stated value always replaces it.
|
|
1019
|
+
*/
|
|
1020
|
+
isInferred: boolean;
|
|
1021
|
+
|
|
948
1022
|
/**
|
|
949
1023
|
* True when newer conversations cannot change this field
|
|
950
1024
|
*/
|
|
951
1025
|
isLocked: boolean;
|
|
952
1026
|
|
|
953
|
-
key:
|
|
954
|
-
| 'FULL_NAME'
|
|
955
|
-
| 'PREFERRED_NAME'
|
|
956
|
-
| 'ACCOUNT_ID'
|
|
957
|
-
| 'COMPANY'
|
|
958
|
-
| 'JOB_TITLE'
|
|
959
|
-
| 'EMAIL'
|
|
960
|
-
| 'ALTERNATE_PHONE'
|
|
961
|
-
| 'AGE'
|
|
962
|
-
| 'GENDER'
|
|
963
|
-
| 'LANGUAGE'
|
|
964
|
-
| 'LOCATION'
|
|
965
|
-
| 'TIMEZONE'
|
|
966
|
-
| 'BEST_TIME_TO_REACH'
|
|
967
|
-
| 'PREFERRED_CHANNEL';
|
|
1027
|
+
key: string;
|
|
968
1028
|
|
|
969
1029
|
observedAt: string;
|
|
970
1030
|
|
|
@@ -1029,14 +1089,60 @@ export namespace CustomerProfileUnlockAttributeResponse {
|
|
|
1029
1089
|
}
|
|
1030
1090
|
}
|
|
1031
1091
|
|
|
1032
|
-
export interface
|
|
1033
|
-
data:
|
|
1092
|
+
export interface CustomerUpdateFieldResponse {
|
|
1093
|
+
data: CustomerUpdateFieldResponse.Data;
|
|
1034
1094
|
}
|
|
1035
1095
|
|
|
1036
|
-
export namespace
|
|
1096
|
+
export namespace CustomerUpdateFieldResponse {
|
|
1037
1097
|
export interface Data {
|
|
1038
1098
|
/**
|
|
1039
|
-
*
|
|
1099
|
+
* What extraction looks for in a conversation
|
|
1100
|
+
*/
|
|
1101
|
+
description: string | null;
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Whether conversations fill this field on this project: the project's own setting
|
|
1105
|
+
* where it made one
|
|
1106
|
+
*/
|
|
1107
|
+
extract: boolean;
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* What filters, sorts and attribute routes name the field by
|
|
1111
|
+
*/
|
|
1112
|
+
key: string;
|
|
1113
|
+
|
|
1114
|
+
label: string;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* The project redaction setting that, when on, keeps conversations from filling
|
|
1118
|
+
* this field
|
|
1119
|
+
*/
|
|
1120
|
+
redactedBy:
|
|
1121
|
+
| 'redactName'
|
|
1122
|
+
| 'redactEmail'
|
|
1123
|
+
| 'redactPhone'
|
|
1124
|
+
| 'redactDateOfBirth'
|
|
1125
|
+
| 'redactAddress'
|
|
1126
|
+
| 'redactBankAccountNumber'
|
|
1127
|
+
| null;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* SYSTEM for a built-in field, CUSTOM for one your project defined
|
|
1131
|
+
*/
|
|
1132
|
+
source: 'SYSTEM' | 'CUSTOM';
|
|
1133
|
+
|
|
1134
|
+
valueType: 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'PHONE_NUMBER' | 'EMAIL' | 'CURRENCY';
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
export interface CustomerUpdateNotesResponse {
|
|
1139
|
+
data: CustomerUpdateNotesResponse.Data;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export namespace CustomerUpdateNotesResponse {
|
|
1143
|
+
export interface Data {
|
|
1144
|
+
/**
|
|
1145
|
+
* Unique identifier of the customer
|
|
1040
1146
|
*/
|
|
1041
1147
|
id: string;
|
|
1042
1148
|
|
|
@@ -1066,8 +1172,6 @@ export namespace CustomerProfileUpdateNotesResponse {
|
|
|
1066
1172
|
|
|
1067
1173
|
notesUpdatedAt: string | null;
|
|
1068
1174
|
|
|
1069
|
-
openItems: string | null;
|
|
1070
|
-
|
|
1071
1175
|
phoneNumberE164: string | null;
|
|
1072
1176
|
|
|
1073
1177
|
summary: string | null;
|
|
@@ -1098,26 +1202,18 @@ export namespace CustomerProfileUpdateNotesResponse {
|
|
|
1098
1202
|
*/
|
|
1099
1203
|
history: Array<Attribute.History>;
|
|
1100
1204
|
|
|
1205
|
+
/**
|
|
1206
|
+
* True when the value was inferred from the conversation, such as a gender read
|
|
1207
|
+
* from a name, rather than stated. A stated value always replaces it.
|
|
1208
|
+
*/
|
|
1209
|
+
isInferred: boolean;
|
|
1210
|
+
|
|
1101
1211
|
/**
|
|
1102
1212
|
* True when newer conversations cannot change this field
|
|
1103
1213
|
*/
|
|
1104
1214
|
isLocked: boolean;
|
|
1105
1215
|
|
|
1106
|
-
key:
|
|
1107
|
-
| 'FULL_NAME'
|
|
1108
|
-
| 'PREFERRED_NAME'
|
|
1109
|
-
| 'ACCOUNT_ID'
|
|
1110
|
-
| 'COMPANY'
|
|
1111
|
-
| 'JOB_TITLE'
|
|
1112
|
-
| 'EMAIL'
|
|
1113
|
-
| 'ALTERNATE_PHONE'
|
|
1114
|
-
| 'AGE'
|
|
1115
|
-
| 'GENDER'
|
|
1116
|
-
| 'LANGUAGE'
|
|
1117
|
-
| 'LOCATION'
|
|
1118
|
-
| 'TIMEZONE'
|
|
1119
|
-
| 'BEST_TIME_TO_REACH'
|
|
1120
|
-
| 'PREFERRED_CHANNEL';
|
|
1216
|
+
key: string;
|
|
1121
1217
|
|
|
1122
1218
|
observedAt: string;
|
|
1123
1219
|
|
|
@@ -1182,28 +1278,14 @@ export namespace CustomerProfileUpdateNotesResponse {
|
|
|
1182
1278
|
}
|
|
1183
1279
|
}
|
|
1184
1280
|
|
|
1185
|
-
export interface
|
|
1281
|
+
export interface CustomerListParams {
|
|
1186
1282
|
agentId?: string;
|
|
1187
1283
|
|
|
1188
1284
|
/**
|
|
1189
|
-
* Filter by this field. Use with fieldOperator
|
|
1190
|
-
* fieldValue.
|
|
1285
|
+
* Filter by this field, a key from GET /v1/customer/fields. Use with fieldOperator
|
|
1286
|
+
* and, unless checking presence, fieldValue.
|
|
1191
1287
|
*/
|
|
1192
|
-
fieldKey?:
|
|
1193
|
-
| 'FULL_NAME'
|
|
1194
|
-
| 'PREFERRED_NAME'
|
|
1195
|
-
| 'ACCOUNT_ID'
|
|
1196
|
-
| 'COMPANY'
|
|
1197
|
-
| 'JOB_TITLE'
|
|
1198
|
-
| 'EMAIL'
|
|
1199
|
-
| 'ALTERNATE_PHONE'
|
|
1200
|
-
| 'AGE'
|
|
1201
|
-
| 'GENDER'
|
|
1202
|
-
| 'LANGUAGE'
|
|
1203
|
-
| 'LOCATION'
|
|
1204
|
-
| 'TIMEZONE'
|
|
1205
|
-
| 'BEST_TIME_TO_REACH'
|
|
1206
|
-
| 'PREFERRED_CHANNEL';
|
|
1288
|
+
fieldKey?: string;
|
|
1207
1289
|
|
|
1208
1290
|
/**
|
|
1209
1291
|
* How fieldValue is compared, ignoring case. NOT_EQUALS includes customers without
|
|
@@ -1221,53 +1303,55 @@ export interface CustomerProfileListParams {
|
|
|
1221
1303
|
|
|
1222
1304
|
limit?: number;
|
|
1223
1305
|
|
|
1224
|
-
modality?: '
|
|
1306
|
+
modality?: 'voice' | 'chat' | 'call';
|
|
1225
1307
|
|
|
1226
1308
|
page?: number;
|
|
1227
1309
|
|
|
1228
1310
|
search?: string;
|
|
1229
1311
|
|
|
1230
1312
|
/**
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1313
|
+
* lastSeenAt (the default), firstSeenAt, conversationCount, voiceCount, chatCount,
|
|
1314
|
+
* talkTimeMs or displayName, or field.<key> (for example field.COMPANY) to sort by
|
|
1315
|
+
* a field's value. Field keys come from GET /v1/customer/fields. Customers without
|
|
1316
|
+
* a value sort last.
|
|
1233
1317
|
*/
|
|
1234
|
-
sortBy?:
|
|
1235
|
-
| 'lastSeenAt'
|
|
1236
|
-
| 'firstSeenAt'
|
|
1237
|
-
| 'conversationCount'
|
|
1238
|
-
| 'voiceCount'
|
|
1239
|
-
| 'chatCount'
|
|
1240
|
-
| 'talkTimeMs'
|
|
1241
|
-
| 'displayName'
|
|
1242
|
-
| 'field.FULL_NAME'
|
|
1243
|
-
| 'field.PREFERRED_NAME'
|
|
1244
|
-
| 'field.ACCOUNT_ID'
|
|
1245
|
-
| 'field.COMPANY'
|
|
1246
|
-
| 'field.JOB_TITLE'
|
|
1247
|
-
| 'field.EMAIL'
|
|
1248
|
-
| 'field.ALTERNATE_PHONE'
|
|
1249
|
-
| 'field.AGE'
|
|
1250
|
-
| 'field.GENDER'
|
|
1251
|
-
| 'field.LANGUAGE'
|
|
1252
|
-
| 'field.LOCATION'
|
|
1253
|
-
| 'field.TIMEZONE'
|
|
1254
|
-
| 'field.BEST_TIME_TO_REACH'
|
|
1255
|
-
| 'field.PREFERRED_CHANNEL';
|
|
1318
|
+
sortBy?: string;
|
|
1256
1319
|
|
|
1257
1320
|
sortDirection?: 'asc' | 'desc';
|
|
1258
1321
|
}
|
|
1259
1322
|
|
|
1260
|
-
export interface
|
|
1323
|
+
export interface CustomerClearAttributeParams {
|
|
1261
1324
|
customerProfileId: string;
|
|
1262
1325
|
}
|
|
1263
1326
|
|
|
1264
|
-
export interface
|
|
1327
|
+
export interface CustomerCreateFieldParams {
|
|
1328
|
+
/**
|
|
1329
|
+
* Whether conversations fill this field
|
|
1330
|
+
*/
|
|
1331
|
+
extract: boolean;
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Starts with a letter; letters, numbers and underscores only. Fixed once created.
|
|
1335
|
+
*/
|
|
1336
|
+
key: string;
|
|
1337
|
+
|
|
1338
|
+
label: string;
|
|
1339
|
+
|
|
1340
|
+
valueType: 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'PHONE_NUMBER' | 'EMAIL' | 'CURRENCY';
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* What the agent listens for in a conversation. Required when extract is true.
|
|
1344
|
+
*/
|
|
1345
|
+
description?: string | null;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
export interface CustomerListConversationsParams {
|
|
1265
1349
|
limit?: number;
|
|
1266
1350
|
|
|
1267
1351
|
page?: number;
|
|
1268
1352
|
}
|
|
1269
1353
|
|
|
1270
|
-
export interface
|
|
1354
|
+
export interface CustomerSetAttributeParams {
|
|
1271
1355
|
/**
|
|
1272
1356
|
* Path param
|
|
1273
1357
|
*/
|
|
@@ -1280,32 +1364,48 @@ export interface CustomerProfileSetAttributeParams {
|
|
|
1280
1364
|
value: string;
|
|
1281
1365
|
}
|
|
1282
1366
|
|
|
1283
|
-
export interface
|
|
1367
|
+
export interface CustomerUnlockAttributeParams {
|
|
1284
1368
|
customerProfileId: string;
|
|
1285
1369
|
}
|
|
1286
1370
|
|
|
1287
|
-
export interface
|
|
1371
|
+
export interface CustomerUpdateFieldParams {
|
|
1372
|
+
description?: string | null;
|
|
1373
|
+
|
|
1374
|
+
extract?: boolean;
|
|
1375
|
+
|
|
1376
|
+
label?: string;
|
|
1377
|
+
|
|
1378
|
+
valueType?: 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'PHONE_NUMBER' | 'EMAIL' | 'CURRENCY';
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
export interface CustomerUpdateNotesParams {
|
|
1288
1382
|
/**
|
|
1289
1383
|
* Replaces the existing notes. Null or empty clears them.
|
|
1290
1384
|
*/
|
|
1291
1385
|
notes: string | null;
|
|
1292
1386
|
}
|
|
1293
1387
|
|
|
1294
|
-
export declare namespace
|
|
1388
|
+
export declare namespace Customer {
|
|
1295
1389
|
export {
|
|
1296
|
-
type
|
|
1297
|
-
type
|
|
1298
|
-
type
|
|
1299
|
-
type
|
|
1300
|
-
type
|
|
1301
|
-
type
|
|
1302
|
-
type
|
|
1303
|
-
type
|
|
1304
|
-
type
|
|
1305
|
-
type
|
|
1306
|
-
type
|
|
1307
|
-
type
|
|
1308
|
-
type
|
|
1309
|
-
type
|
|
1390
|
+
type CustomerListResponse as CustomerListResponse,
|
|
1391
|
+
type CustomerDeleteResponse as CustomerDeleteResponse,
|
|
1392
|
+
type CustomerClearAttributeResponse as CustomerClearAttributeResponse,
|
|
1393
|
+
type CustomerCreateFieldResponse as CustomerCreateFieldResponse,
|
|
1394
|
+
type CustomerDeleteFieldResponse as CustomerDeleteFieldResponse,
|
|
1395
|
+
type CustomerGetByIDResponse as CustomerGetByIDResponse,
|
|
1396
|
+
type CustomerListConversationsResponse as CustomerListConversationsResponse,
|
|
1397
|
+
type CustomerListFieldsResponse as CustomerListFieldsResponse,
|
|
1398
|
+
type CustomerSetAttributeResponse as CustomerSetAttributeResponse,
|
|
1399
|
+
type CustomerUnlockAttributeResponse as CustomerUnlockAttributeResponse,
|
|
1400
|
+
type CustomerUpdateFieldResponse as CustomerUpdateFieldResponse,
|
|
1401
|
+
type CustomerUpdateNotesResponse as CustomerUpdateNotesResponse,
|
|
1402
|
+
type CustomerListParams as CustomerListParams,
|
|
1403
|
+
type CustomerClearAttributeParams as CustomerClearAttributeParams,
|
|
1404
|
+
type CustomerCreateFieldParams as CustomerCreateFieldParams,
|
|
1405
|
+
type CustomerListConversationsParams as CustomerListConversationsParams,
|
|
1406
|
+
type CustomerSetAttributeParams as CustomerSetAttributeParams,
|
|
1407
|
+
type CustomerUnlockAttributeParams as CustomerUnlockAttributeParams,
|
|
1408
|
+
type CustomerUpdateFieldParams as CustomerUpdateFieldParams,
|
|
1409
|
+
type CustomerUpdateNotesParams as CustomerUpdateNotesParams,
|
|
1310
1410
|
};
|
|
1311
1411
|
}
|