@orq-ai/node 4.2.0 → 4.2.4
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/FUNCTIONS.md +17 -7
- package/README.md +125 -70
- package/examples/contactsCreate.example.ts +42 -0
- package/examples/package-lock.json +1 -1
- package/funcs/contactsCreate.d.ts +3 -5
- package/funcs/contactsCreate.d.ts.map +1 -1
- package/funcs/contactsCreate.js +5 -9
- package/funcs/contactsCreate.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/conversationresponse.js +1 -1
- package/models/components/conversationwithmessagesresponse.js +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invokedeploymentrequest.d.ts +6 -0
- package/models/components/invokedeploymentrequest.d.ts.map +1 -1
- package/models/components/invokedeploymentrequest.js +2 -0
- package/models/components/invokedeploymentrequest.js.map +1 -1
- package/models/components/partdoneevent.js +1 -1
- package/models/components/publiccontact.d.ts +3 -1
- package/models/components/publiccontact.d.ts.map +1 -1
- package/models/components/publiccontact.js.map +1 -1
- package/models/components/publicidentity.d.ts +47 -0
- package/models/components/publicidentity.d.ts.map +1 -0
- package/models/{operations/deletecontact.js → components/publicidentity.js} +17 -6
- package/models/components/publicidentity.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/errors/index.d.ts +0 -3
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +0 -3
- package/models/errors/index.js.map +1 -1
- package/models/operations/createchatcompletion.d.ts +9 -51
- package/models/operations/createchatcompletion.d.ts.map +1 -1
- package/models/operations/createchatcompletion.js +5 -24
- package/models/operations/createchatcompletion.js.map +1 -1
- package/models/operations/createcompletion.d.ts +9 -51
- package/models/operations/createcompletion.d.ts.map +1 -1
- package/models/operations/createcompletion.js +4 -22
- package/models/operations/createcompletion.js.map +1 -1
- package/models/operations/createcontact.d.ts +2 -6
- package/models/operations/createcontact.d.ts.map +1 -1
- package/models/operations/createcontact.js +1 -3
- package/models/operations/createcontact.js.map +1 -1
- package/models/operations/createconversation.js +1 -1
- package/models/operations/createconversationresponse.js +2 -2
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createembedding.d.ts +9 -51
- package/models/operations/createembedding.d.ts.map +1 -1
- package/models/operations/createembedding.js +3 -21
- package/models/operations/createembedding.js.map +1 -1
- package/models/operations/createeval.js +14 -14
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createimage.d.ts +9 -51
- package/models/operations/createimage.d.ts.map +1 -1
- package/models/operations/createimage.js +3 -21
- package/models/operations/createimage.js.map +1 -1
- package/models/operations/createimageedit.d.ts +9 -51
- package/models/operations/createimageedit.d.ts.map +1 -1
- package/models/operations/createimageedit.js +3 -21
- package/models/operations/createimageedit.js.map +1 -1
- package/models/operations/createimagevariation.d.ts +9 -51
- package/models/operations/createimagevariation.d.ts.map +1 -1
- package/models/operations/createimagevariation.js +3 -21
- package/models/operations/createimagevariation.js.map +1 -1
- package/models/operations/creatererank.d.ts +9 -51
- package/models/operations/creatererank.d.ts.map +1 -1
- package/models/operations/creatererank.js +3 -21
- package/models/operations/creatererank.js.map +1 -1
- package/models/operations/createspeech.d.ts +9 -51
- package/models/operations/createspeech.d.ts.map +1 -1
- package/models/operations/createspeech.js +3 -21
- package/models/operations/createspeech.js.map +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/createtranscription.d.ts +9 -51
- package/models/operations/createtranscription.d.ts.map +1 -1
- package/models/operations/createtranscription.js +3 -21
- package/models/operations/createtranscription.js.map +1 -1
- package/models/operations/createtranslation.d.ts +9 -51
- package/models/operations/createtranslation.d.ts.map +1 -1
- package/models/operations/createtranslation.js +3 -21
- package/models/operations/createtranslation.js.map +1 -1
- package/models/operations/deploymentgetconfig.d.ts +5 -0
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +1 -0
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentstream.d.ts +5 -0
- package/models/operations/deploymentstream.d.ts.map +1 -1
- package/models/operations/deploymentstream.js +1 -0
- package/models/operations/deploymentstream.js.map +1 -1
- package/models/operations/fileget.js +1 -1
- package/models/operations/filelist.js +1 -1
- package/models/operations/fileupload.js +1 -1
- package/models/operations/generateconversationname.js +1 -1
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.d.ts +7 -7
- package/models/operations/getevals.d.ts.map +1 -1
- package/models/operations/getevals.js +25 -23
- package/models/operations/getevals.js.map +1 -1
- package/models/operations/index.d.ts +0 -4
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -4
- package/models/operations/index.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrieveidentity.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updateconversation.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.js +14 -14
- package/models/operations/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/packages/orq-rc/examples/contactsCreate.example.ts +42 -0
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/contactsCreate.ts +7 -14
- package/packages/orq-rc/src/lib/config.ts +2 -2
- package/packages/orq-rc/src/models/components/conversationresponse.ts +1 -1
- package/packages/orq-rc/src/models/components/conversationwithmessagesresponse.ts +1 -1
- package/packages/orq-rc/src/models/components/index.ts +1 -0
- package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +11 -0
- package/packages/orq-rc/src/models/components/partdoneevent.ts +1 -1
- package/packages/orq-rc/src/models/components/publiccontact.ts +3 -1
- package/packages/orq-rc/src/models/components/publicidentity.ts +69 -0
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/errors/index.ts +0 -3
- package/packages/orq-rc/src/models/operations/createchatcompletion.ts +11 -78
- package/packages/orq-rc/src/models/operations/createcompletion.ts +11 -75
- package/packages/orq-rc/src/models/operations/createcontact.ts +3 -9
- package/packages/orq-rc/src/models/operations/createconversation.ts +1 -1
- package/packages/orq-rc/src/models/operations/createconversationresponse.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
- package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/createembedding.ts +11 -75
- package/packages/orq-rc/src/models/operations/createeval.ts +14 -14
- package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/createimage.ts +11 -75
- package/packages/orq-rc/src/models/operations/createimageedit.ts +11 -75
- package/packages/orq-rc/src/models/operations/createimagevariation.ts +11 -77
- package/packages/orq-rc/src/models/operations/creatererank.ts +11 -75
- package/packages/orq-rc/src/models/operations/createspeech.ts +11 -75
- package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
- package/packages/orq-rc/src/models/operations/createtranscription.ts +11 -75
- package/packages/orq-rc/src/models/operations/createtranslation.ts +11 -75
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +6 -0
- package/packages/orq-rc/src/models/operations/deploymentstream.ts +6 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +1 -1
- package/packages/orq-rc/src/models/operations/filelist.ts +1 -1
- package/packages/orq-rc/src/models/operations/fileupload.ts +1 -1
- package/packages/orq-rc/src/models/operations/generateconversationname.ts +1 -1
- package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
- package/packages/orq-rc/src/models/operations/getevals.ts +35 -39
- package/packages/orq-rc/src/models/operations/index.ts +0 -4
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
- package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
- package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
- package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateconversation.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateeval.ts +14 -14
- package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
- package/packages/orq-rc/src/sdk/contacts.ts +3 -85
- package/sdk/contacts.d.ts +3 -41
- package/sdk/contacts.d.ts.map +1 -1
- package/sdk/contacts.js +2 -52
- package/sdk/contacts.js.map +1 -1
- package/src/funcs/contactsCreate.ts +7 -14
- package/src/lib/config.ts +2 -2
- package/src/models/components/conversationresponse.ts +1 -1
- package/src/models/components/conversationwithmessagesresponse.ts +1 -1
- package/src/models/components/index.ts +1 -0
- package/src/models/components/invokedeploymentrequest.ts +11 -0
- package/src/models/components/partdoneevent.ts +1 -1
- package/src/models/components/publiccontact.ts +3 -1
- package/src/models/components/publicidentity.ts +69 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/errors/index.ts +0 -3
- package/src/models/operations/createchatcompletion.ts +11 -78
- package/src/models/operations/createcompletion.ts +11 -75
- package/src/models/operations/createcontact.ts +3 -9
- package/src/models/operations/createconversation.ts +1 -1
- package/src/models/operations/createconversationresponse.ts +2 -2
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createembedding.ts +11 -75
- package/src/models/operations/createeval.ts +14 -14
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createimage.ts +11 -75
- package/src/models/operations/createimageedit.ts +11 -75
- package/src/models/operations/createimagevariation.ts +11 -77
- package/src/models/operations/creatererank.ts +11 -75
- package/src/models/operations/createspeech.ts +11 -75
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/createtranscription.ts +11 -75
- package/src/models/operations/createtranslation.ts +11 -75
- package/src/models/operations/deploymentgetconfig.ts +6 -0
- package/src/models/operations/deploymentstream.ts +6 -0
- package/src/models/operations/fileget.ts +1 -1
- package/src/models/operations/filelist.ts +1 -1
- package/src/models/operations/fileupload.ts +1 -1
- package/src/models/operations/generateconversationname.ts +1 -1
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +35 -39
- package/src/models/operations/index.ts +0 -4
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listidentities.ts +1 -1
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrieveidentity.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updateconversation.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +14 -14
- package/src/models/operations/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/contacts.ts +3 -85
- package/examples/feedbackCreate.example.ts +0 -32
- package/funcs/contactsDelete.d.ts +0 -20
- package/funcs/contactsDelete.d.ts.map +0 -1
- package/funcs/contactsDelete.js +0 -126
- package/funcs/contactsDelete.js.map +0 -1
- package/funcs/contactsList.d.ts +0 -19
- package/funcs/contactsList.d.ts.map +0 -1
- package/funcs/contactsList.js +0 -124
- package/funcs/contactsList.js.map +0 -1
- package/funcs/contactsRetrieve.d.ts +0 -20
- package/funcs/contactsRetrieve.d.ts.map +0 -1
- package/funcs/contactsRetrieve.js +0 -125
- package/funcs/contactsRetrieve.js.map +0 -1
- package/funcs/contactsUpdate.d.ts +0 -20
- package/funcs/contactsUpdate.d.ts.map +0 -1
- package/funcs/contactsUpdate.js +0 -126
- package/funcs/contactsUpdate.js.map +0 -1
- package/models/errors/deletecontact.d.ts +0 -30
- package/models/errors/deletecontact.d.ts.map +0 -1
- package/models/errors/deletecontact.js +0 -71
- package/models/errors/deletecontact.js.map +0 -1
- package/models/errors/retrievecontact.d.ts +0 -30
- package/models/errors/retrievecontact.d.ts.map +0 -1
- package/models/errors/retrievecontact.js +0 -71
- package/models/errors/retrievecontact.js.map +0 -1
- package/models/errors/updatecontact.d.ts +0 -26
- package/models/errors/updatecontact.d.ts.map +0 -1
- package/models/errors/updatecontact.js +0 -68
- package/models/errors/updatecontact.js.map +0 -1
- package/models/operations/deletecontact.d.ts +0 -15
- package/models/operations/deletecontact.d.ts.map +0 -1
- package/models/operations/deletecontact.js.map +0 -1
- package/models/operations/listcontacts.d.ts +0 -138
- package/models/operations/listcontacts.d.ts.map +0 -1
- package/models/operations/listcontacts.js +0 -136
- package/models/operations/listcontacts.js.map +0 -1
- package/models/operations/retrievecontact.d.ts +0 -63
- package/models/operations/retrievecontact.d.ts.map +0 -1
- package/models/operations/retrievecontact.js +0 -75
- package/models/operations/retrievecontact.js.map +0 -1
- package/models/operations/updatecontact.d.ts +0 -108
- package/models/operations/updatecontact.d.ts.map +0 -1
- package/models/operations/updatecontact.js +0 -97
- package/models/operations/updatecontact.js.map +0 -1
- package/packages/orq-rc/examples/feedbackCreate.example.ts +0 -32
- package/packages/orq-rc/src/funcs/contactsDelete.ts +0 -178
- package/packages/orq-rc/src/funcs/contactsList.ts +0 -172
- package/packages/orq-rc/src/funcs/contactsRetrieve.ts +0 -177
- package/packages/orq-rc/src/funcs/contactsUpdate.ts +0 -178
- package/packages/orq-rc/src/models/errors/deletecontact.ts +0 -62
- package/packages/orq-rc/src/models/errors/retrievecontact.ts +0 -62
- package/packages/orq-rc/src/models/errors/updatecontact.ts +0 -54
- package/packages/orq-rc/src/models/operations/deletecontact.ts +0 -34
- package/packages/orq-rc/src/models/operations/listcontacts.ts +0 -274
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +0 -117
- package/packages/orq-rc/src/models/operations/updatecontact.ts +0 -188
- package/src/funcs/contactsDelete.ts +0 -178
- package/src/funcs/contactsList.ts +0 -172
- package/src/funcs/contactsRetrieve.ts +0 -177
- package/src/funcs/contactsUpdate.ts +0 -178
- package/src/models/errors/deletecontact.ts +0 -62
- package/src/models/errors/retrievecontact.ts +0 -62
- package/src/models/errors/updatecontact.ts +0 -54
- package/src/models/operations/deletecontact.ts +0 -34
- package/src/models/operations/listcontacts.ts +0 -274
- package/src/models/operations/retrievecontact.ts +0 -117
- package/src/models/operations/updatecontact.ts +0 -188
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Contact fields to update
|
|
13
|
-
*/
|
|
14
|
-
export type UpdateContactRequestBody = {
|
|
15
|
-
/**
|
|
16
|
-
* Display name or nickname of the contact user. This is typically shown in user interfaces.
|
|
17
|
-
*/
|
|
18
|
-
displayName?: string | null | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Email address of the contact user
|
|
21
|
-
*/
|
|
22
|
-
email?: string | null | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* URL linking to the contact user's avatar image
|
|
25
|
-
*/
|
|
26
|
-
avatarUrl?: string | null | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
|
|
29
|
-
*/
|
|
30
|
-
tags?: Array<string> | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
|
|
33
|
-
*/
|
|
34
|
-
metadata?: { [k: string]: any } | undefined;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type UpdateContactRequest = {
|
|
38
|
-
/**
|
|
39
|
-
* Unique contact id or external id
|
|
40
|
-
*/
|
|
41
|
-
id: string;
|
|
42
|
-
/**
|
|
43
|
-
* Contact fields to update
|
|
44
|
-
*/
|
|
45
|
-
requestBody?: UpdateContactRequestBody | undefined;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Updated contact
|
|
50
|
-
*/
|
|
51
|
-
export type UpdateContactResponseBody = {
|
|
52
|
-
/**
|
|
53
|
-
* Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
|
|
54
|
-
*/
|
|
55
|
-
id: string;
|
|
56
|
-
/**
|
|
57
|
-
* Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user.
|
|
58
|
-
*/
|
|
59
|
-
externalId: string;
|
|
60
|
-
/**
|
|
61
|
-
* Display name or nickname of the contact user. This is typically shown in user interfaces.
|
|
62
|
-
*/
|
|
63
|
-
displayName?: string | null | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Email address of the contact user
|
|
66
|
-
*/
|
|
67
|
-
email?: string | null | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* URL linking to the contact user's avatar image
|
|
70
|
-
*/
|
|
71
|
-
avatarUrl?: string | null | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
|
|
74
|
-
*/
|
|
75
|
-
tags?: Array<string> | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
|
|
78
|
-
*/
|
|
79
|
-
metadata?: { [k: string]: any } | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* The date and time the resource was created
|
|
82
|
-
*/
|
|
83
|
-
created?: Date | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* The date and time the resource was last updated
|
|
86
|
-
*/
|
|
87
|
-
updated: Date;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/** @internal */
|
|
91
|
-
export type UpdateContactRequestBody$Outbound = {
|
|
92
|
-
display_name?: string | null | undefined;
|
|
93
|
-
email?: string | null | undefined;
|
|
94
|
-
avatar_url?: string | null | undefined;
|
|
95
|
-
tags?: Array<string> | undefined;
|
|
96
|
-
metadata?: { [k: string]: any } | undefined;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/** @internal */
|
|
100
|
-
export const UpdateContactRequestBody$outboundSchema: z.ZodType<
|
|
101
|
-
UpdateContactRequestBody$Outbound,
|
|
102
|
-
z.ZodTypeDef,
|
|
103
|
-
UpdateContactRequestBody
|
|
104
|
-
> = z.object({
|
|
105
|
-
displayName: z.nullable(z.string()).optional(),
|
|
106
|
-
email: z.nullable(z.string()).optional(),
|
|
107
|
-
avatarUrl: z.nullable(z.string()).optional(),
|
|
108
|
-
tags: z.array(z.string()).optional(),
|
|
109
|
-
metadata: z.record(z.any()).optional(),
|
|
110
|
-
}).transform((v) => {
|
|
111
|
-
return remap$(v, {
|
|
112
|
-
displayName: "display_name",
|
|
113
|
-
avatarUrl: "avatar_url",
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
export function updateContactRequestBodyToJSON(
|
|
118
|
-
updateContactRequestBody: UpdateContactRequestBody,
|
|
119
|
-
): string {
|
|
120
|
-
return JSON.stringify(
|
|
121
|
-
UpdateContactRequestBody$outboundSchema.parse(updateContactRequestBody),
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** @internal */
|
|
126
|
-
export type UpdateContactRequest$Outbound = {
|
|
127
|
-
id: string;
|
|
128
|
-
RequestBody?: UpdateContactRequestBody$Outbound | undefined;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/** @internal */
|
|
132
|
-
export const UpdateContactRequest$outboundSchema: z.ZodType<
|
|
133
|
-
UpdateContactRequest$Outbound,
|
|
134
|
-
z.ZodTypeDef,
|
|
135
|
-
UpdateContactRequest
|
|
136
|
-
> = z.object({
|
|
137
|
-
id: z.string(),
|
|
138
|
-
requestBody: z.lazy(() => UpdateContactRequestBody$outboundSchema).optional(),
|
|
139
|
-
}).transform((v) => {
|
|
140
|
-
return remap$(v, {
|
|
141
|
-
requestBody: "RequestBody",
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
export function updateContactRequestToJSON(
|
|
146
|
-
updateContactRequest: UpdateContactRequest,
|
|
147
|
-
): string {
|
|
148
|
-
return JSON.stringify(
|
|
149
|
-
UpdateContactRequest$outboundSchema.parse(updateContactRequest),
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/** @internal */
|
|
154
|
-
export const UpdateContactResponseBody$inboundSchema: z.ZodType<
|
|
155
|
-
UpdateContactResponseBody,
|
|
156
|
-
z.ZodTypeDef,
|
|
157
|
-
unknown
|
|
158
|
-
> = z.object({
|
|
159
|
-
_id: z.string(),
|
|
160
|
-
external_id: z.string(),
|
|
161
|
-
display_name: z.nullable(z.string()).optional(),
|
|
162
|
-
email: z.nullable(z.string()).optional(),
|
|
163
|
-
avatar_url: z.nullable(z.string()).optional(),
|
|
164
|
-
tags: z.array(z.string()).optional(),
|
|
165
|
-
metadata: z.record(z.any()).optional(),
|
|
166
|
-
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
167
|
-
.optional(),
|
|
168
|
-
updated: z.string().datetime({ offset: true }).default(
|
|
169
|
-
"2026-01-23T09:49:01.865Z",
|
|
170
|
-
).transform(v => new Date(v)),
|
|
171
|
-
}).transform((v) => {
|
|
172
|
-
return remap$(v, {
|
|
173
|
-
"_id": "id",
|
|
174
|
-
"external_id": "externalId",
|
|
175
|
-
"display_name": "displayName",
|
|
176
|
-
"avatar_url": "avatarUrl",
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
export function updateContactResponseBodyFromJSON(
|
|
181
|
-
jsonString: string,
|
|
182
|
-
): SafeParseResult<UpdateContactResponseBody, SDKValidationError> {
|
|
183
|
-
return safeParse(
|
|
184
|
-
jsonString,
|
|
185
|
-
(x) => UpdateContactResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
186
|
-
`Failed to parse 'UpdateContactResponseBody' from JSON`,
|
|
187
|
-
);
|
|
188
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { OrqCore } from "../core.js";
|
|
7
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
-
import * as M from "../lib/matchers.js";
|
|
9
|
-
import { compactMap } from "../lib/primitives.js";
|
|
10
|
-
import { safeParse } from "../lib/schemas.js";
|
|
11
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
-
import { pathToFunc } from "../lib/url.js";
|
|
14
|
-
import {
|
|
15
|
-
ConnectionError,
|
|
16
|
-
InvalidRequestError,
|
|
17
|
-
RequestAbortedError,
|
|
18
|
-
RequestTimeoutError,
|
|
19
|
-
UnexpectedClientError,
|
|
20
|
-
} from "../models/errors/httpclienterrors.js";
|
|
21
|
-
import * as errors from "../models/errors/index.js";
|
|
22
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
-
import { Result } from "../types/fp.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Delete a contact
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Permanently deletes a contact from your workspace and cleans up associated budget configurations. This action cannot be undone.
|
|
34
|
-
*
|
|
35
|
-
* @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
36
|
-
*/
|
|
37
|
-
export function contactsDelete(
|
|
38
|
-
client: OrqCore,
|
|
39
|
-
request: operations.DeleteContactRequest,
|
|
40
|
-
options?: RequestOptions,
|
|
41
|
-
): APIPromise<
|
|
42
|
-
Result<
|
|
43
|
-
void,
|
|
44
|
-
| errors.DeleteContactResponseBody
|
|
45
|
-
| OrqError
|
|
46
|
-
| ResponseValidationError
|
|
47
|
-
| ConnectionError
|
|
48
|
-
| RequestAbortedError
|
|
49
|
-
| RequestTimeoutError
|
|
50
|
-
| InvalidRequestError
|
|
51
|
-
| UnexpectedClientError
|
|
52
|
-
| SDKValidationError
|
|
53
|
-
>
|
|
54
|
-
> {
|
|
55
|
-
return new APIPromise($do(
|
|
56
|
-
client,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: OrqCore,
|
|
64
|
-
request: operations.DeleteContactRequest,
|
|
65
|
-
options?: RequestOptions,
|
|
66
|
-
): Promise<
|
|
67
|
-
[
|
|
68
|
-
Result<
|
|
69
|
-
void,
|
|
70
|
-
| errors.DeleteContactResponseBody
|
|
71
|
-
| OrqError
|
|
72
|
-
| ResponseValidationError
|
|
73
|
-
| ConnectionError
|
|
74
|
-
| RequestAbortedError
|
|
75
|
-
| RequestTimeoutError
|
|
76
|
-
| InvalidRequestError
|
|
77
|
-
| UnexpectedClientError
|
|
78
|
-
| SDKValidationError
|
|
79
|
-
>,
|
|
80
|
-
APICall,
|
|
81
|
-
]
|
|
82
|
-
> {
|
|
83
|
-
const parsed = safeParse(
|
|
84
|
-
request,
|
|
85
|
-
(value) => operations.DeleteContactRequest$outboundSchema.parse(value),
|
|
86
|
-
"Input validation failed",
|
|
87
|
-
);
|
|
88
|
-
if (!parsed.ok) {
|
|
89
|
-
return [parsed, { status: "invalid" }];
|
|
90
|
-
}
|
|
91
|
-
const payload = parsed.value;
|
|
92
|
-
const body = null;
|
|
93
|
-
|
|
94
|
-
const pathParams = {
|
|
95
|
-
id: encodeSimple("id", payload.id, {
|
|
96
|
-
explode: false,
|
|
97
|
-
charEncoding: "percent",
|
|
98
|
-
}),
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const path = pathToFunc("/v2/contacts/{id}")(pathParams);
|
|
102
|
-
|
|
103
|
-
const headers = new Headers(compactMap({
|
|
104
|
-
Accept: "application/json",
|
|
105
|
-
}));
|
|
106
|
-
|
|
107
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
108
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
109
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
-
|
|
111
|
-
const context = {
|
|
112
|
-
options: client._options,
|
|
113
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
-
operationID: "DeleteContact",
|
|
115
|
-
oAuth2Scopes: null,
|
|
116
|
-
|
|
117
|
-
resolvedSecurity: requestSecurity,
|
|
118
|
-
|
|
119
|
-
securitySource: client._options.apiKey,
|
|
120
|
-
retryConfig: options?.retries
|
|
121
|
-
|| client._options.retryConfig
|
|
122
|
-
|| { strategy: "none" },
|
|
123
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const requestRes = client._createRequest(context, {
|
|
127
|
-
security: requestSecurity,
|
|
128
|
-
method: "DELETE",
|
|
129
|
-
baseURL: options?.serverURL,
|
|
130
|
-
path: path,
|
|
131
|
-
headers: headers,
|
|
132
|
-
body: body,
|
|
133
|
-
userAgent: client._options.userAgent,
|
|
134
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
135
|
-
}, options);
|
|
136
|
-
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status: "invalid" }];
|
|
138
|
-
}
|
|
139
|
-
const req = requestRes.value;
|
|
140
|
-
|
|
141
|
-
const doResult = await client._do(req, {
|
|
142
|
-
context,
|
|
143
|
-
errorCodes: ["404", "4XX", "5XX"],
|
|
144
|
-
retryConfig: context.retryConfig,
|
|
145
|
-
retryCodes: context.retryCodes,
|
|
146
|
-
});
|
|
147
|
-
if (!doResult.ok) {
|
|
148
|
-
return [doResult, { status: "request-error", request: req }];
|
|
149
|
-
}
|
|
150
|
-
const response = doResult.value;
|
|
151
|
-
|
|
152
|
-
const responseFields = {
|
|
153
|
-
HttpMeta: { Response: response, Request: req },
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const [result] = await M.match<
|
|
157
|
-
void,
|
|
158
|
-
| errors.DeleteContactResponseBody
|
|
159
|
-
| OrqError
|
|
160
|
-
| ResponseValidationError
|
|
161
|
-
| ConnectionError
|
|
162
|
-
| RequestAbortedError
|
|
163
|
-
| RequestTimeoutError
|
|
164
|
-
| InvalidRequestError
|
|
165
|
-
| UnexpectedClientError
|
|
166
|
-
| SDKValidationError
|
|
167
|
-
>(
|
|
168
|
-
M.nil(204, z.void()),
|
|
169
|
-
M.jsonErr(404, errors.DeleteContactResponseBody$inboundSchema),
|
|
170
|
-
M.fail("4XX"),
|
|
171
|
-
M.fail("5XX"),
|
|
172
|
-
)(response, req, { extraFields: responseFields });
|
|
173
|
-
if (!result.ok) {
|
|
174
|
-
return [result, { status: "complete", request: req, response }];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return [result, { status: "complete", request: req, response }];
|
|
178
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import * as operations from "../models/operations/index.js";
|
|
24
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
-
import { Result } from "../types/fp.js";
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* List contacts
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Retrieves a paginated list of contacts in your workspace. Use pagination parameters to navigate through large contact lists efficiently.
|
|
32
|
-
*
|
|
33
|
-
* @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
34
|
-
*/
|
|
35
|
-
export function contactsList(
|
|
36
|
-
client: OrqCore,
|
|
37
|
-
request?: operations.ListContactsRequest | undefined,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
operations.ListContactsResponseBody,
|
|
42
|
-
| OrqError
|
|
43
|
-
| ResponseValidationError
|
|
44
|
-
| ConnectionError
|
|
45
|
-
| RequestAbortedError
|
|
46
|
-
| RequestTimeoutError
|
|
47
|
-
| InvalidRequestError
|
|
48
|
-
| UnexpectedClientError
|
|
49
|
-
| SDKValidationError
|
|
50
|
-
>
|
|
51
|
-
> {
|
|
52
|
-
return new APIPromise($do(
|
|
53
|
-
client,
|
|
54
|
-
request,
|
|
55
|
-
options,
|
|
56
|
-
));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function $do(
|
|
60
|
-
client: OrqCore,
|
|
61
|
-
request?: operations.ListContactsRequest | undefined,
|
|
62
|
-
options?: RequestOptions,
|
|
63
|
-
): Promise<
|
|
64
|
-
[
|
|
65
|
-
Result<
|
|
66
|
-
operations.ListContactsResponseBody,
|
|
67
|
-
| OrqError
|
|
68
|
-
| ResponseValidationError
|
|
69
|
-
| ConnectionError
|
|
70
|
-
| RequestAbortedError
|
|
71
|
-
| RequestTimeoutError
|
|
72
|
-
| InvalidRequestError
|
|
73
|
-
| UnexpectedClientError
|
|
74
|
-
| SDKValidationError
|
|
75
|
-
>,
|
|
76
|
-
APICall,
|
|
77
|
-
]
|
|
78
|
-
> {
|
|
79
|
-
const parsed = safeParse(
|
|
80
|
-
request,
|
|
81
|
-
(value) =>
|
|
82
|
-
operations.ListContactsRequest$outboundSchema.optional().parse(value),
|
|
83
|
-
"Input validation failed",
|
|
84
|
-
);
|
|
85
|
-
if (!parsed.ok) {
|
|
86
|
-
return [parsed, { status: "invalid" }];
|
|
87
|
-
}
|
|
88
|
-
const payload = parsed.value;
|
|
89
|
-
const body = null;
|
|
90
|
-
|
|
91
|
-
const path = pathToFunc("/v2/contacts")();
|
|
92
|
-
|
|
93
|
-
const query = encodeFormQuery({
|
|
94
|
-
"ending_before": payload?.ending_before,
|
|
95
|
-
"filter_by": payload?.filter_by,
|
|
96
|
-
"include_metrics": payload?.include_metrics,
|
|
97
|
-
"limit": payload?.limit,
|
|
98
|
-
"search": payload?.search,
|
|
99
|
-
"starting_after": payload?.starting_after,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
103
|
-
Accept: "application/json",
|
|
104
|
-
}));
|
|
105
|
-
|
|
106
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
107
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
108
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
-
|
|
110
|
-
const context = {
|
|
111
|
-
options: client._options,
|
|
112
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
-
operationID: "ListContacts",
|
|
114
|
-
oAuth2Scopes: null,
|
|
115
|
-
|
|
116
|
-
resolvedSecurity: requestSecurity,
|
|
117
|
-
|
|
118
|
-
securitySource: client._options.apiKey,
|
|
119
|
-
retryConfig: options?.retries
|
|
120
|
-
|| client._options.retryConfig
|
|
121
|
-
|| { strategy: "none" },
|
|
122
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const requestRes = client._createRequest(context, {
|
|
126
|
-
security: requestSecurity,
|
|
127
|
-
method: "GET",
|
|
128
|
-
baseURL: options?.serverURL,
|
|
129
|
-
path: path,
|
|
130
|
-
headers: headers,
|
|
131
|
-
query: query,
|
|
132
|
-
body: body,
|
|
133
|
-
userAgent: client._options.userAgent,
|
|
134
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
135
|
-
}, options);
|
|
136
|
-
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status: "invalid" }];
|
|
138
|
-
}
|
|
139
|
-
const req = requestRes.value;
|
|
140
|
-
|
|
141
|
-
const doResult = await client._do(req, {
|
|
142
|
-
context,
|
|
143
|
-
errorCodes: ["4XX", "5XX"],
|
|
144
|
-
retryConfig: context.retryConfig,
|
|
145
|
-
retryCodes: context.retryCodes,
|
|
146
|
-
});
|
|
147
|
-
if (!doResult.ok) {
|
|
148
|
-
return [doResult, { status: "request-error", request: req }];
|
|
149
|
-
}
|
|
150
|
-
const response = doResult.value;
|
|
151
|
-
|
|
152
|
-
const [result] = await M.match<
|
|
153
|
-
operations.ListContactsResponseBody,
|
|
154
|
-
| OrqError
|
|
155
|
-
| ResponseValidationError
|
|
156
|
-
| ConnectionError
|
|
157
|
-
| RequestAbortedError
|
|
158
|
-
| RequestTimeoutError
|
|
159
|
-
| InvalidRequestError
|
|
160
|
-
| UnexpectedClientError
|
|
161
|
-
| SDKValidationError
|
|
162
|
-
>(
|
|
163
|
-
M.json(200, operations.ListContactsResponseBody$inboundSchema),
|
|
164
|
-
M.fail("4XX"),
|
|
165
|
-
M.fail("5XX"),
|
|
166
|
-
)(response, req);
|
|
167
|
-
if (!result.ok) {
|
|
168
|
-
return [result, { status: "complete", request: req, response }];
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return [result, { status: "complete", request: req, response }];
|
|
172
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import * as errors from "../models/errors/index.js";
|
|
21
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
-
import * as operations from "../models/operations/index.js";
|
|
25
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
-
import { Result } from "../types/fp.js";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Retrieve a contact
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Retrieves detailed information about a specific contact using their contact ID or external ID from your system.
|
|
33
|
-
*
|
|
34
|
-
* @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
35
|
-
*/
|
|
36
|
-
export function contactsRetrieve(
|
|
37
|
-
client: OrqCore,
|
|
38
|
-
request: operations.RetrieveContactRequest,
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
Result<
|
|
42
|
-
operations.RetrieveContactResponseBody,
|
|
43
|
-
| errors.RetrieveContactResponseBody
|
|
44
|
-
| OrqError
|
|
45
|
-
| ResponseValidationError
|
|
46
|
-
| ConnectionError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| UnexpectedClientError
|
|
51
|
-
| SDKValidationError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
return new APIPromise($do(
|
|
55
|
-
client,
|
|
56
|
-
request,
|
|
57
|
-
options,
|
|
58
|
-
));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async function $do(
|
|
62
|
-
client: OrqCore,
|
|
63
|
-
request: operations.RetrieveContactRequest,
|
|
64
|
-
options?: RequestOptions,
|
|
65
|
-
): Promise<
|
|
66
|
-
[
|
|
67
|
-
Result<
|
|
68
|
-
operations.RetrieveContactResponseBody,
|
|
69
|
-
| errors.RetrieveContactResponseBody
|
|
70
|
-
| OrqError
|
|
71
|
-
| ResponseValidationError
|
|
72
|
-
| ConnectionError
|
|
73
|
-
| RequestAbortedError
|
|
74
|
-
| RequestTimeoutError
|
|
75
|
-
| InvalidRequestError
|
|
76
|
-
| UnexpectedClientError
|
|
77
|
-
| SDKValidationError
|
|
78
|
-
>,
|
|
79
|
-
APICall,
|
|
80
|
-
]
|
|
81
|
-
> {
|
|
82
|
-
const parsed = safeParse(
|
|
83
|
-
request,
|
|
84
|
-
(value) => operations.RetrieveContactRequest$outboundSchema.parse(value),
|
|
85
|
-
"Input validation failed",
|
|
86
|
-
);
|
|
87
|
-
if (!parsed.ok) {
|
|
88
|
-
return [parsed, { status: "invalid" }];
|
|
89
|
-
}
|
|
90
|
-
const payload = parsed.value;
|
|
91
|
-
const body = null;
|
|
92
|
-
|
|
93
|
-
const pathParams = {
|
|
94
|
-
id: encodeSimple("id", payload.id, {
|
|
95
|
-
explode: false,
|
|
96
|
-
charEncoding: "percent",
|
|
97
|
-
}),
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const path = pathToFunc("/v2/contacts/{id}")(pathParams);
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
103
|
-
Accept: "application/json",
|
|
104
|
-
}));
|
|
105
|
-
|
|
106
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
107
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
108
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
-
|
|
110
|
-
const context = {
|
|
111
|
-
options: client._options,
|
|
112
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
-
operationID: "RetrieveContact",
|
|
114
|
-
oAuth2Scopes: null,
|
|
115
|
-
|
|
116
|
-
resolvedSecurity: requestSecurity,
|
|
117
|
-
|
|
118
|
-
securitySource: client._options.apiKey,
|
|
119
|
-
retryConfig: options?.retries
|
|
120
|
-
|| client._options.retryConfig
|
|
121
|
-
|| { strategy: "none" },
|
|
122
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const requestRes = client._createRequest(context, {
|
|
126
|
-
security: requestSecurity,
|
|
127
|
-
method: "GET",
|
|
128
|
-
baseURL: options?.serverURL,
|
|
129
|
-
path: path,
|
|
130
|
-
headers: headers,
|
|
131
|
-
body: body,
|
|
132
|
-
userAgent: client._options.userAgent,
|
|
133
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
134
|
-
}, options);
|
|
135
|
-
if (!requestRes.ok) {
|
|
136
|
-
return [requestRes, { status: "invalid" }];
|
|
137
|
-
}
|
|
138
|
-
const req = requestRes.value;
|
|
139
|
-
|
|
140
|
-
const doResult = await client._do(req, {
|
|
141
|
-
context,
|
|
142
|
-
errorCodes: ["404", "4XX", "5XX"],
|
|
143
|
-
retryConfig: context.retryConfig,
|
|
144
|
-
retryCodes: context.retryCodes,
|
|
145
|
-
});
|
|
146
|
-
if (!doResult.ok) {
|
|
147
|
-
return [doResult, { status: "request-error", request: req }];
|
|
148
|
-
}
|
|
149
|
-
const response = doResult.value;
|
|
150
|
-
|
|
151
|
-
const responseFields = {
|
|
152
|
-
HttpMeta: { Response: response, Request: req },
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const [result] = await M.match<
|
|
156
|
-
operations.RetrieveContactResponseBody,
|
|
157
|
-
| errors.RetrieveContactResponseBody
|
|
158
|
-
| OrqError
|
|
159
|
-
| ResponseValidationError
|
|
160
|
-
| ConnectionError
|
|
161
|
-
| RequestAbortedError
|
|
162
|
-
| RequestTimeoutError
|
|
163
|
-
| InvalidRequestError
|
|
164
|
-
| UnexpectedClientError
|
|
165
|
-
| SDKValidationError
|
|
166
|
-
>(
|
|
167
|
-
M.json(200, operations.RetrieveContactResponseBody$inboundSchema),
|
|
168
|
-
M.jsonErr(404, errors.RetrieveContactResponseBody$inboundSchema),
|
|
169
|
-
M.fail("4XX"),
|
|
170
|
-
M.fail("5XX"),
|
|
171
|
-
)(response, req, { extraFields: responseFields });
|
|
172
|
-
if (!result.ok) {
|
|
173
|
-
return [result, { status: "complete", request: req, response }];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return [result, { status: "complete", request: req, response }];
|
|
177
|
-
}
|