@orq-ai/node 3.7.0-rc.8 → 3.7.0-rc.9
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/README.md +24 -11
- package/bin/mcp-server.js +2228 -1371
- package/bin/mcp-server.js.map +53 -38
- package/docs/sdks/contacts/README.md +354 -3
- package/funcs/contactsCreate.d.ts +3 -3
- package/funcs/contactsCreate.d.ts.map +1 -1
- package/funcs/contactsCreate.js +7 -5
- package/funcs/contactsCreate.js.map +1 -1
- package/funcs/contactsDelete.d.ts +17 -0
- package/funcs/contactsDelete.d.ts.map +1 -0
- package/funcs/contactsDelete.js +124 -0
- package/funcs/contactsDelete.js.map +1 -0
- package/funcs/contactsList.d.ts +16 -0
- package/funcs/contactsList.d.ts.map +1 -0
- package/funcs/contactsList.js +121 -0
- package/funcs/contactsList.js.map +1 -0
- package/funcs/contactsRetrieve.d.ts +17 -0
- package/funcs/contactsRetrieve.d.ts.map +1 -0
- package/funcs/contactsRetrieve.js +123 -0
- package/funcs/contactsRetrieve.js.map +1 -0
- package/funcs/contactsUpdate.d.ts +17 -0
- package/funcs/contactsUpdate.d.ts.map +1 -0
- package/funcs/contactsUpdate.js +124 -0
- package/funcs/contactsUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +9 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/contactsCreate.d.ts +1 -1
- package/mcp-server/tools/contactsCreate.js +3 -3
- package/mcp-server/tools/contactsCreate.js.map +1 -1
- package/mcp-server/tools/contactsDelete.d.ts +8 -0
- package/mcp-server/tools/contactsDelete.d.ts.map +1 -0
- package/mcp-server/tools/contactsDelete.js +63 -0
- package/mcp-server/tools/contactsDelete.js.map +1 -0
- package/mcp-server/tools/contactsList.d.ts +8 -0
- package/mcp-server/tools/contactsList.d.ts.map +1 -0
- package/mcp-server/tools/contactsList.js +64 -0
- package/mcp-server/tools/contactsList.js.map +1 -0
- package/mcp-server/tools/contactsRetrieve.d.ts +8 -0
- package/mcp-server/tools/contactsRetrieve.d.ts.map +1 -0
- package/mcp-server/tools/contactsRetrieve.js +64 -0
- package/mcp-server/tools/contactsRetrieve.js.map +1 -0
- package/mcp-server/tools/contactsUpdate.d.ts +8 -0
- package/mcp-server/tools/contactsUpdate.d.ts.map +1 -0
- package/mcp-server/tools/contactsUpdate.js +64 -0
- package/mcp-server/tools/contactsUpdate.js.map +1 -0
- package/models/errors/deletecontact.d.ts +43 -0
- package/models/errors/deletecontact.d.ts.map +1 -0
- package/models/errors/deletecontact.js +80 -0
- package/models/errors/deletecontact.js.map +1 -0
- package/models/errors/index.d.ts +3 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +3 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/retrievecontact.d.ts +43 -0
- package/models/errors/retrievecontact.d.ts.map +1 -0
- package/models/errors/retrievecontact.js +80 -0
- package/models/errors/retrievecontact.js.map +1 -0
- package/models/errors/updatecontact.d.ts +39 -0
- package/models/errors/updatecontact.d.ts.map +1 -0
- package/models/errors/updatecontact.js +79 -0
- package/models/errors/updatecontact.js.map +1 -0
- package/models/operations/createcontact.d.ts +21 -16
- package/models/operations/createcontact.d.ts.map +1 -1
- package/models/operations/createcontact.js +9 -3
- package/models/operations/createcontact.js.map +1 -1
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +16 -16
- package/models/operations/deletecontact.d.ts +32 -0
- package/models/operations/deletecontact.d.ts.map +1 -0
- package/models/operations/deletecontact.js +69 -0
- package/models/operations/deletecontact.js.map +1 -0
- package/models/operations/deployments.d.ts +23 -23
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +31 -33
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listcontacts.d.ts +249 -0
- package/models/operations/listcontacts.d.ts.map +1 -0
- package/models/operations/listcontacts.js +286 -0
- package/models/operations/listcontacts.js.map +1 -0
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.d.ts +107 -0
- package/models/operations/retrievecontact.d.ts.map +1 -0
- package/models/operations/retrievecontact.js +129 -0
- package/models/operations/retrievecontact.js.map +1 -0
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/updatecontact.d.ts +167 -0
- package/models/operations/updatecontact.d.ts.map +1 -0
- package/models/operations/updatecontact.js +184 -0
- package/models/operations/updatecontact.js.map +1 -0
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/package.json +1 -1
- package/sdk/contacts.d.ts +31 -3
- package/sdk/contacts.d.ts.map +1 -1
- package/sdk/contacts.js +42 -2
- package/sdk/contacts.js.map +1 -1
- package/src/funcs/contactsCreate.ts +12 -7
- package/src/funcs/contactsDelete.ts +172 -0
- package/src/funcs/contactsList.ts +165 -0
- package/src/funcs/contactsRetrieve.ts +171 -0
- package/src/funcs/contactsUpdate.ts +172 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +9 -1
- package/src/mcp-server/tools/contactsCreate.ts +3 -3
- package/src/mcp-server/tools/contactsDelete.ts +35 -0
- package/src/mcp-server/tools/contactsList.ts +37 -0
- package/src/mcp-server/tools/contactsRetrieve.ts +37 -0
- package/src/mcp-server/tools/contactsUpdate.ts +37 -0
- package/src/models/errors/deletecontact.ts +81 -0
- package/src/models/errors/index.ts +3 -0
- package/src/models/errors/retrievecontact.ts +81 -0
- package/src/models/errors/updatecontact.ts +74 -0
- package/src/models/operations/createcontact.ts +30 -19
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/deletecontact.ts +69 -0
- package/src/models/operations/deployments.ts +69 -59
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listcontacts.ts +490 -0
- package/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +210 -0
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/updatecontact.ts +325 -0
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/sdk/contacts.ts +75 -3
|
@@ -5,11 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [create](#create) -
|
|
8
|
+
* [create](#create) - Create a contact
|
|
9
|
+
* [list](#list) - List contacts
|
|
10
|
+
* [retrieve](#retrieve) - Retrieve a contact
|
|
11
|
+
* [update](#update) - Update a contact
|
|
12
|
+
* [delete](#delete) - Delete a contact
|
|
9
13
|
|
|
10
14
|
## create
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
Creates a new contact or updates an existing one based on external_id. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.
|
|
13
17
|
|
|
14
18
|
### Example Usage
|
|
15
19
|
|
|
@@ -81,4 +85,351 @@ run();
|
|
|
81
85
|
|
|
82
86
|
| Error Type | Status Code | Content Type |
|
|
83
87
|
| --------------- | --------------- | --------------- |
|
|
84
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
88
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
89
|
+
|
|
90
|
+
## list
|
|
91
|
+
|
|
92
|
+
Retrieves a paginated list of contacts in your workspace. Use pagination parameters to navigate through large contact lists efficiently.
|
|
93
|
+
|
|
94
|
+
### Example Usage
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { Orq } from "@orq-ai/node";
|
|
98
|
+
|
|
99
|
+
const orq = new Orq({
|
|
100
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
async function run() {
|
|
104
|
+
const result = await orq.contacts.list({
|
|
105
|
+
filterBy: {
|
|
106
|
+
tags: [
|
|
107
|
+
"premium",
|
|
108
|
+
"beta-user",
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Handle the result
|
|
114
|
+
console.log(result);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
run();
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Standalone function
|
|
121
|
+
|
|
122
|
+
The standalone function version of this method:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
126
|
+
import { contactsList } from "@orq-ai/node/funcs/contactsList.js";
|
|
127
|
+
|
|
128
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
129
|
+
// You can create one instance of it to use across an application.
|
|
130
|
+
const orq = new OrqCore({
|
|
131
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
async function run() {
|
|
135
|
+
const res = await contactsList(orq, {
|
|
136
|
+
filterBy: {
|
|
137
|
+
tags: [
|
|
138
|
+
"premium",
|
|
139
|
+
"beta-user",
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
if (!res.ok) {
|
|
145
|
+
throw res.error;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const { value: result } = res;
|
|
149
|
+
|
|
150
|
+
// Handle the result
|
|
151
|
+
console.log(result);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
run();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Parameters
|
|
158
|
+
|
|
159
|
+
| Parameter | Type | Required | Description |
|
|
160
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
161
|
+
| `request` | [operations.ListContactsRequest](../../models/operations/listcontactsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
162
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
163
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
164
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
165
|
+
|
|
166
|
+
### Response
|
|
167
|
+
|
|
168
|
+
**Promise\<[operations.ListContactsResponseBody](../../models/operations/listcontactsresponsebody.md)\>**
|
|
169
|
+
|
|
170
|
+
### Errors
|
|
171
|
+
|
|
172
|
+
| Error Type | Status Code | Content Type |
|
|
173
|
+
| --------------- | --------------- | --------------- |
|
|
174
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
175
|
+
|
|
176
|
+
## retrieve
|
|
177
|
+
|
|
178
|
+
Retrieves detailed information about a specific contact using their contact ID or external ID from your system.
|
|
179
|
+
|
|
180
|
+
### Example Usage
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
import { Orq } from "@orq-ai/node";
|
|
184
|
+
|
|
185
|
+
const orq = new Orq({
|
|
186
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
async function run() {
|
|
190
|
+
const result = await orq.contacts.retrieve({
|
|
191
|
+
id: "<id>",
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// Handle the result
|
|
195
|
+
console.log(result);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
run();
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Standalone function
|
|
202
|
+
|
|
203
|
+
The standalone function version of this method:
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
207
|
+
import { contactsRetrieve } from "@orq-ai/node/funcs/contactsRetrieve.js";
|
|
208
|
+
|
|
209
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
210
|
+
// You can create one instance of it to use across an application.
|
|
211
|
+
const orq = new OrqCore({
|
|
212
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
async function run() {
|
|
216
|
+
const res = await contactsRetrieve(orq, {
|
|
217
|
+
id: "<id>",
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
if (!res.ok) {
|
|
221
|
+
throw res.error;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const { value: result } = res;
|
|
225
|
+
|
|
226
|
+
// Handle the result
|
|
227
|
+
console.log(result);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
run();
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Parameters
|
|
234
|
+
|
|
235
|
+
| Parameter | Type | Required | Description |
|
|
236
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
237
|
+
| `request` | [operations.RetrieveContactRequest](../../models/operations/retrievecontactrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
238
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
239
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
240
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
241
|
+
|
|
242
|
+
### Response
|
|
243
|
+
|
|
244
|
+
**Promise\<[operations.RetrieveContactResponseBody](../../models/operations/retrievecontactresponsebody.md)\>**
|
|
245
|
+
|
|
246
|
+
### Errors
|
|
247
|
+
|
|
248
|
+
| Error Type | Status Code | Content Type |
|
|
249
|
+
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
|
250
|
+
| errors.RetrieveContactResponseBody | 404 | application/json |
|
|
251
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
252
|
+
|
|
253
|
+
## update
|
|
254
|
+
|
|
255
|
+
Updates specific fields of an existing contact. Only the fields provided in the request body will be updated.
|
|
256
|
+
|
|
257
|
+
### Example Usage
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
import { Orq } from "@orq-ai/node";
|
|
261
|
+
|
|
262
|
+
const orq = new Orq({
|
|
263
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
async function run() {
|
|
267
|
+
const result = await orq.contacts.update({
|
|
268
|
+
id: "<id>",
|
|
269
|
+
requestBody: {
|
|
270
|
+
displayName: "Jane Smith",
|
|
271
|
+
email: "jane.smith@example.com",
|
|
272
|
+
avatarUrl: "https://example.com/avatars/jane-smith.jpg",
|
|
273
|
+
tags: [
|
|
274
|
+
"premium",
|
|
275
|
+
"beta-user",
|
|
276
|
+
"enterprise",
|
|
277
|
+
],
|
|
278
|
+
metadata: {
|
|
279
|
+
"department": "Engineering",
|
|
280
|
+
"role": "Senior Developer",
|
|
281
|
+
"subscription_tier": "premium",
|
|
282
|
+
"last_login": "2024-01-15T10:30:00Z",
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// Handle the result
|
|
288
|
+
console.log(result);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
run();
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Standalone function
|
|
295
|
+
|
|
296
|
+
The standalone function version of this method:
|
|
297
|
+
|
|
298
|
+
```typescript
|
|
299
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
300
|
+
import { contactsUpdate } from "@orq-ai/node/funcs/contactsUpdate.js";
|
|
301
|
+
|
|
302
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
303
|
+
// You can create one instance of it to use across an application.
|
|
304
|
+
const orq = new OrqCore({
|
|
305
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
async function run() {
|
|
309
|
+
const res = await contactsUpdate(orq, {
|
|
310
|
+
id: "<id>",
|
|
311
|
+
requestBody: {
|
|
312
|
+
displayName: "Jane Smith",
|
|
313
|
+
email: "jane.smith@example.com",
|
|
314
|
+
avatarUrl: "https://example.com/avatars/jane-smith.jpg",
|
|
315
|
+
tags: [
|
|
316
|
+
"premium",
|
|
317
|
+
"beta-user",
|
|
318
|
+
"enterprise",
|
|
319
|
+
],
|
|
320
|
+
metadata: {
|
|
321
|
+
"department": "Engineering",
|
|
322
|
+
"role": "Senior Developer",
|
|
323
|
+
"subscription_tier": "premium",
|
|
324
|
+
"last_login": "2024-01-15T10:30:00Z",
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
if (!res.ok) {
|
|
330
|
+
throw res.error;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const { value: result } = res;
|
|
334
|
+
|
|
335
|
+
// Handle the result
|
|
336
|
+
console.log(result);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
run();
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Parameters
|
|
343
|
+
|
|
344
|
+
| Parameter | Type | Required | Description |
|
|
345
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
346
|
+
| `request` | [operations.UpdateContactRequest](../../models/operations/updatecontactrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
347
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
348
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
349
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
350
|
+
|
|
351
|
+
### Response
|
|
352
|
+
|
|
353
|
+
**Promise\<[operations.UpdateContactResponseBody](../../models/operations/updatecontactresponsebody.md)\>**
|
|
354
|
+
|
|
355
|
+
### Errors
|
|
356
|
+
|
|
357
|
+
| Error Type | Status Code | Content Type |
|
|
358
|
+
| -------------------------------- | -------------------------------- | -------------------------------- |
|
|
359
|
+
| errors.UpdateContactResponseBody | 404 | application/json |
|
|
360
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
361
|
+
|
|
362
|
+
## delete
|
|
363
|
+
|
|
364
|
+
Permanently deletes a contact from your workspace. This action cannot be undone.
|
|
365
|
+
|
|
366
|
+
### Example Usage
|
|
367
|
+
|
|
368
|
+
```typescript
|
|
369
|
+
import { Orq } from "@orq-ai/node";
|
|
370
|
+
|
|
371
|
+
const orq = new Orq({
|
|
372
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
async function run() {
|
|
376
|
+
await orq.contacts.delete({
|
|
377
|
+
id: "<id>",
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
run();
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Standalone function
|
|
387
|
+
|
|
388
|
+
The standalone function version of this method:
|
|
389
|
+
|
|
390
|
+
```typescript
|
|
391
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
392
|
+
import { contactsDelete } from "@orq-ai/node/funcs/contactsDelete.js";
|
|
393
|
+
|
|
394
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
395
|
+
// You can create one instance of it to use across an application.
|
|
396
|
+
const orq = new OrqCore({
|
|
397
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
async function run() {
|
|
401
|
+
const res = await contactsDelete(orq, {
|
|
402
|
+
id: "<id>",
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
if (!res.ok) {
|
|
406
|
+
throw res.error;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const { value: result } = res;
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
run();
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Parameters
|
|
418
|
+
|
|
419
|
+
| Parameter | Type | Required | Description |
|
|
420
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
421
|
+
| `request` | [operations.DeleteContactRequest](../../models/operations/deletecontactrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
422
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
423
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
424
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
425
|
+
|
|
426
|
+
### Response
|
|
427
|
+
|
|
428
|
+
**Promise\<void\>**
|
|
429
|
+
|
|
430
|
+
### Errors
|
|
431
|
+
|
|
432
|
+
| Error Type | Status Code | Content Type |
|
|
433
|
+
| -------------------------------- | -------------------------------- | -------------------------------- |
|
|
434
|
+
| errors.DeleteContactResponseBody | 404 | application/json |
|
|
435
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
@@ -7,10 +7,10 @@ import * as operations from "../models/operations/index.js";
|
|
|
7
7
|
import { APIPromise } from "../types/async.js";
|
|
8
8
|
import { Result } from "../types/fp.js";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Create a contact
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
|
-
*
|
|
13
|
+
* Creates a new contact or updates an existing one based on external_id. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.
|
|
14
14
|
*/
|
|
15
|
-
export declare function contactsCreate(client: OrqCore, request
|
|
15
|
+
export declare function contactsCreate(client: OrqCore, request?: operations.CreateContactRequestBody | undefined, options?: RequestOptions): APIPromise<Result<operations.CreateContactResponseBody, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
16
16
|
//# sourceMappingURL=contactsCreate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsCreate.d.ts","sourceRoot":"","sources":["../src/funcs/contactsCreate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"contactsCreate.d.ts","sourceRoot":"","sources":["../src/funcs/contactsCreate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,CAAC,wBAAwB,GAAG,SAAS,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,yBAAyB,EAClC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}
|
package/funcs/contactsCreate.js
CHANGED
|
@@ -46,21 +46,23 @@ const url_js_1 = require("../lib/url.js");
|
|
|
46
46
|
const operations = __importStar(require("../models/operations/index.js"));
|
|
47
47
|
const async_js_1 = require("../types/async.js");
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Create a contact
|
|
50
50
|
*
|
|
51
51
|
* @remarks
|
|
52
|
-
*
|
|
52
|
+
* Creates a new contact or updates an existing one based on external_id. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.
|
|
53
53
|
*/
|
|
54
54
|
function contactsCreate(client, request, options) {
|
|
55
55
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
56
56
|
}
|
|
57
57
|
async function $do(client, request, options) {
|
|
58
|
-
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.CreateContactRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
58
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.CreateContactRequestBody$outboundSchema.optional().parse(value), "Input validation failed");
|
|
59
59
|
if (!parsed.ok) {
|
|
60
60
|
return [parsed, { status: "invalid" }];
|
|
61
61
|
}
|
|
62
62
|
const payload = parsed.value;
|
|
63
|
-
const body =
|
|
63
|
+
const body = payload === undefined
|
|
64
|
+
? null
|
|
65
|
+
: (0, encodings_js_1.encodeJSON)("body", payload, { explode: true });
|
|
64
66
|
const path = (0, url_js_1.pathToFunc)("/v2/contacts")();
|
|
65
67
|
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
66
68
|
"Content-Type": "application/json",
|
|
@@ -105,7 +107,7 @@ async function $do(client, request, options) {
|
|
|
105
107
|
return [doResult, { status: "request-error", request: req }];
|
|
106
108
|
}
|
|
107
109
|
const response = doResult.value;
|
|
108
|
-
const [result] = await M.match(M.json(
|
|
110
|
+
const [result] = await M.match(M.json(201, operations.CreateContactResponseBody$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response);
|
|
109
111
|
if (!result.ok) {
|
|
110
112
|
return [result, { status: "complete", request: req, response }];
|
|
111
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsCreate.js","sourceRoot":"","sources":["../src/funcs/contactsCreate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,wCAqBC;AA/CD,sDAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAU3C,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,MAAe,EACf,
|
|
1
|
+
{"version":3,"file":"contactsCreate.js","sourceRoot":"","sources":["../src/funcs/contactsCreate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,wCAqBC;AA/CD,sDAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAU3C,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,MAAe,EACf,OAAyD,EACzD,OAAwB;IAaxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAA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C,QAAQ,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,uCAAuC,CAAC,EAC/D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OrqCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import * as errors from "../models/errors/index.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* Delete a contact
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Permanently deletes a contact from your workspace. This action cannot be undone.
|
|
15
|
+
*/
|
|
16
|
+
export declare function contactsDelete(client: OrqCore, request: operations.DeleteContactRequest, options?: RequestOptions): APIPromise<Result<void, errors.DeleteContactResponseBody | APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
17
|
+
//# sourceMappingURL=contactsDelete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contactsDelete.d.ts","sourceRoot":"","sources":["../src/funcs/contactsDelete.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,IAAI,EACF,MAAM,CAAC,yBAAyB,GAChC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.contactsDelete = contactsDelete;
|
|
40
|
+
const z = __importStar(require("zod"));
|
|
41
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
42
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
43
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
44
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
45
|
+
const security_js_1 = require("../lib/security.js");
|
|
46
|
+
const url_js_1 = require("../lib/url.js");
|
|
47
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
48
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
49
|
+
const async_js_1 = require("../types/async.js");
|
|
50
|
+
/**
|
|
51
|
+
* Delete a contact
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Permanently deletes a contact from your workspace. This action cannot be undone.
|
|
55
|
+
*/
|
|
56
|
+
function contactsDelete(client, request, options) {
|
|
57
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
58
|
+
}
|
|
59
|
+
async function $do(client, request, options) {
|
|
60
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.DeleteContactRequest$outboundSchema.parse(value), "Input validation failed");
|
|
61
|
+
if (!parsed.ok) {
|
|
62
|
+
return [parsed, { status: "invalid" }];
|
|
63
|
+
}
|
|
64
|
+
const payload = parsed.value;
|
|
65
|
+
const body = null;
|
|
66
|
+
const pathParams = {
|
|
67
|
+
id: (0, encodings_js_1.encodeSimple)("id", payload.id, {
|
|
68
|
+
explode: false,
|
|
69
|
+
charEncoding: "percent",
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
const path = (0, url_js_1.pathToFunc)("/v2/contacts/{id}")(pathParams);
|
|
73
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
74
|
+
Accept: "application/json",
|
|
75
|
+
}));
|
|
76
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
|
|
77
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
78
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
79
|
+
const context = {
|
|
80
|
+
options: client._options,
|
|
81
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
82
|
+
operationID: "DeleteContact",
|
|
83
|
+
oAuth2Scopes: [],
|
|
84
|
+
resolvedSecurity: requestSecurity,
|
|
85
|
+
securitySource: client._options.apiKey,
|
|
86
|
+
retryConfig: options?.retries
|
|
87
|
+
|| client._options.retryConfig
|
|
88
|
+
|| { strategy: "none" },
|
|
89
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
90
|
+
};
|
|
91
|
+
const requestRes = client._createRequest(context, {
|
|
92
|
+
security: requestSecurity,
|
|
93
|
+
method: "DELETE",
|
|
94
|
+
baseURL: options?.serverURL,
|
|
95
|
+
path: path,
|
|
96
|
+
headers: headers,
|
|
97
|
+
body: body,
|
|
98
|
+
userAgent: client._options.userAgent,
|
|
99
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
100
|
+
}, options);
|
|
101
|
+
if (!requestRes.ok) {
|
|
102
|
+
return [requestRes, { status: "invalid" }];
|
|
103
|
+
}
|
|
104
|
+
const req = requestRes.value;
|
|
105
|
+
const doResult = await client._do(req, {
|
|
106
|
+
context,
|
|
107
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
108
|
+
retryConfig: context.retryConfig,
|
|
109
|
+
retryCodes: context.retryCodes,
|
|
110
|
+
});
|
|
111
|
+
if (!doResult.ok) {
|
|
112
|
+
return [doResult, { status: "request-error", request: req }];
|
|
113
|
+
}
|
|
114
|
+
const response = doResult.value;
|
|
115
|
+
const responseFields = {
|
|
116
|
+
HttpMeta: { Response: response, Request: req },
|
|
117
|
+
};
|
|
118
|
+
const [result] = await M.match(M.nil(204, z.void()), M.jsonErr(404, errors.DeleteContactResponseBody$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, { extraFields: responseFields });
|
|
119
|
+
if (!result.ok) {
|
|
120
|
+
return [result, { status: "complete", request: req, response }];
|
|
121
|
+
}
|
|
122
|
+
return [result, { status: "complete", request: req, response }];
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=contactsDelete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contactsDelete.js","sourceRoot":"","sources":["../src/funcs/contactsDelete.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BH,wCAsBC;AAnDD,uCAAyB;AAEzB,sDAAmD;AACnD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAS3C,kEAAoD;AAEpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,MAAe,EACf,OAAwC,EACxC,OAAwB;IAcxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAe,EACf,OAAwC,EACxC,OAAwB;IAiBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,mCAAmC,CAAC,KAAK,CAAC,KAAK,CAAC,EACtE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,MAAM,UAAU,GAAG;QACjB,EAAE,EAAE,IAAA,2BAAY,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE;YACjC,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,SAAS;SACxB,CAAC;KACH,CAAC;IAEF,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,mBAAmB,CAAC,CAAC,UAAU,CAAC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EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OrqCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import * as operations from "../models/operations/index.js";
|
|
7
|
+
import { APIPromise } from "../types/async.js";
|
|
8
|
+
import { Result } from "../types/fp.js";
|
|
9
|
+
/**
|
|
10
|
+
* List contacts
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Retrieves a paginated list of contacts in your workspace. Use pagination parameters to navigate through large contact lists efficiently.
|
|
14
|
+
*/
|
|
15
|
+
export declare function contactsList(client: OrqCore, request?: operations.ListContactsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListContactsResponseBody, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
16
|
+
//# sourceMappingURL=contactsList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contactsList.d.ts","sourceRoot":"","sources":["../src/funcs/contactsList.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,CAAC,mBAAmB,GAAG,SAAS,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,wBAAwB,EACjC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}
|