@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,178 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeJSON, 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
|
-
* Update a contact
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Updates specific fields of an existing contact. Only the fields provided in the request body will be updated.
|
|
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 contactsUpdate(
|
|
37
|
-
client: OrqCore,
|
|
38
|
-
request: operations.UpdateContactRequest,
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
Result<
|
|
42
|
-
operations.UpdateContactResponseBody,
|
|
43
|
-
| errors.UpdateContactResponseBody
|
|
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.UpdateContactRequest,
|
|
64
|
-
options?: RequestOptions,
|
|
65
|
-
): Promise<
|
|
66
|
-
[
|
|
67
|
-
Result<
|
|
68
|
-
operations.UpdateContactResponseBody,
|
|
69
|
-
| errors.UpdateContactResponseBody
|
|
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.UpdateContactRequest$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 = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
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
|
-
"Content-Type": "application/json",
|
|
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: "UpdateContact",
|
|
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: "PATCH",
|
|
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
|
-
operations.UpdateContactResponseBody,
|
|
158
|
-
| errors.UpdateContactResponseBody
|
|
159
|
-
| OrqError
|
|
160
|
-
| ResponseValidationError
|
|
161
|
-
| ConnectionError
|
|
162
|
-
| RequestAbortedError
|
|
163
|
-
| RequestTimeoutError
|
|
164
|
-
| InvalidRequestError
|
|
165
|
-
| UnexpectedClientError
|
|
166
|
-
| SDKValidationError
|
|
167
|
-
>(
|
|
168
|
-
M.json(200, operations.UpdateContactResponseBody$inboundSchema),
|
|
169
|
-
M.jsonErr(404, errors.UpdateContactResponseBody$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,62 +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 { OrqError } from "./orqerror.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Contact not found
|
|
10
|
-
*/
|
|
11
|
-
export type DeleteContactResponseBodyData = {
|
|
12
|
-
/**
|
|
13
|
-
* Error message
|
|
14
|
-
*/
|
|
15
|
-
error: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Contact not found
|
|
20
|
-
*/
|
|
21
|
-
export class DeleteContactResponseBody extends OrqError {
|
|
22
|
-
/**
|
|
23
|
-
* Error message
|
|
24
|
-
*/
|
|
25
|
-
error: string;
|
|
26
|
-
|
|
27
|
-
/** The original data that was passed to this error instance. */
|
|
28
|
-
data$: DeleteContactResponseBodyData;
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
err: DeleteContactResponseBodyData,
|
|
32
|
-
httpMeta: { response: Response; request: Request; body: string },
|
|
33
|
-
) {
|
|
34
|
-
const message = "message" in err && typeof err.message === "string"
|
|
35
|
-
? err.message
|
|
36
|
-
: `API error occurred: ${JSON.stringify(err)}`;
|
|
37
|
-
super(message, httpMeta);
|
|
38
|
-
this.data$ = err;
|
|
39
|
-
this.error = err.error;
|
|
40
|
-
|
|
41
|
-
this.name = "DeleteContactResponseBody";
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** @internal */
|
|
46
|
-
export const DeleteContactResponseBody$inboundSchema: z.ZodType<
|
|
47
|
-
DeleteContactResponseBody,
|
|
48
|
-
z.ZodTypeDef,
|
|
49
|
-
unknown
|
|
50
|
-
> = z.object({
|
|
51
|
-
error: z.string(),
|
|
52
|
-
request$: z.instanceof(Request),
|
|
53
|
-
response$: z.instanceof(Response),
|
|
54
|
-
body$: z.string(),
|
|
55
|
-
})
|
|
56
|
-
.transform((v) => {
|
|
57
|
-
return new DeleteContactResponseBody(v, {
|
|
58
|
-
request: v.request$,
|
|
59
|
-
response: v.response$,
|
|
60
|
-
body: v.body$,
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,62 +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 { OrqError } from "./orqerror.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Contact not found
|
|
10
|
-
*/
|
|
11
|
-
export type RetrieveContactResponseBodyData = {
|
|
12
|
-
/**
|
|
13
|
-
* Error message
|
|
14
|
-
*/
|
|
15
|
-
error: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Contact not found
|
|
20
|
-
*/
|
|
21
|
-
export class RetrieveContactResponseBody extends OrqError {
|
|
22
|
-
/**
|
|
23
|
-
* Error message
|
|
24
|
-
*/
|
|
25
|
-
error: string;
|
|
26
|
-
|
|
27
|
-
/** The original data that was passed to this error instance. */
|
|
28
|
-
data$: RetrieveContactResponseBodyData;
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
err: RetrieveContactResponseBodyData,
|
|
32
|
-
httpMeta: { response: Response; request: Request; body: string },
|
|
33
|
-
) {
|
|
34
|
-
const message = "message" in err && typeof err.message === "string"
|
|
35
|
-
? err.message
|
|
36
|
-
: `API error occurred: ${JSON.stringify(err)}`;
|
|
37
|
-
super(message, httpMeta);
|
|
38
|
-
this.data$ = err;
|
|
39
|
-
this.error = err.error;
|
|
40
|
-
|
|
41
|
-
this.name = "RetrieveContactResponseBody";
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** @internal */
|
|
46
|
-
export const RetrieveContactResponseBody$inboundSchema: z.ZodType<
|
|
47
|
-
RetrieveContactResponseBody,
|
|
48
|
-
z.ZodTypeDef,
|
|
49
|
-
unknown
|
|
50
|
-
> = z.object({
|
|
51
|
-
error: z.string(),
|
|
52
|
-
request$: z.instanceof(Request),
|
|
53
|
-
response$: z.instanceof(Response),
|
|
54
|
-
body$: z.string(),
|
|
55
|
-
})
|
|
56
|
-
.transform((v) => {
|
|
57
|
-
return new RetrieveContactResponseBody(v, {
|
|
58
|
-
request: v.request$,
|
|
59
|
-
response: v.response$,
|
|
60
|
-
body: v.body$,
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,54 +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 { OrqError } from "./orqerror.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Contact not found
|
|
10
|
-
*/
|
|
11
|
-
export type UpdateContactResponseBodyData = {
|
|
12
|
-
/**
|
|
13
|
-
* Error message
|
|
14
|
-
*/
|
|
15
|
-
message: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Contact not found
|
|
20
|
-
*/
|
|
21
|
-
export class UpdateContactResponseBody extends OrqError {
|
|
22
|
-
/** The original data that was passed to this error instance. */
|
|
23
|
-
data$: UpdateContactResponseBodyData;
|
|
24
|
-
|
|
25
|
-
constructor(
|
|
26
|
-
err: UpdateContactResponseBodyData,
|
|
27
|
-
httpMeta: { response: Response; request: Request; body: string },
|
|
28
|
-
) {
|
|
29
|
-
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
30
|
-
super(message, httpMeta);
|
|
31
|
-
this.data$ = err;
|
|
32
|
-
|
|
33
|
-
this.name = "UpdateContactResponseBody";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const UpdateContactResponseBody$inboundSchema: z.ZodType<
|
|
39
|
-
UpdateContactResponseBody,
|
|
40
|
-
z.ZodTypeDef,
|
|
41
|
-
unknown
|
|
42
|
-
> = z.object({
|
|
43
|
-
message: z.string(),
|
|
44
|
-
request$: z.instanceof(Request),
|
|
45
|
-
response$: z.instanceof(Response),
|
|
46
|
-
body$: z.string(),
|
|
47
|
-
})
|
|
48
|
-
.transform((v) => {
|
|
49
|
-
return new UpdateContactResponseBody(v, {
|
|
50
|
-
request: v.request$,
|
|
51
|
-
response: v.response$,
|
|
52
|
-
body: v.body$,
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
|
|
7
|
-
export type DeleteContactRequest = {
|
|
8
|
-
/**
|
|
9
|
-
* Contact ID or External ID
|
|
10
|
-
*/
|
|
11
|
-
id: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** @internal */
|
|
15
|
-
export type DeleteContactRequest$Outbound = {
|
|
16
|
-
id: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const DeleteContactRequest$outboundSchema: z.ZodType<
|
|
21
|
-
DeleteContactRequest$Outbound,
|
|
22
|
-
z.ZodTypeDef,
|
|
23
|
-
DeleteContactRequest
|
|
24
|
-
> = z.object({
|
|
25
|
-
id: z.string(),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export function deleteContactRequestToJSON(
|
|
29
|
-
deleteContactRequest: DeleteContactRequest,
|
|
30
|
-
): string {
|
|
31
|
-
return JSON.stringify(
|
|
32
|
-
DeleteContactRequest$outboundSchema.parse(deleteContactRequest),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,274 +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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Filter contacts by tags. Can be provided as JSON object {"tags": ["premium", "beta-user"]} or as query format "tags=premium,beta-user"
|
|
14
|
-
*/
|
|
15
|
-
export type ListContactsQueryParamFilterBy = {
|
|
16
|
-
tags?: Array<string> | undefined;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type ListContactsRequest = {
|
|
20
|
-
/**
|
|
21
|
-
* A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10
|
|
22
|
-
*/
|
|
23
|
-
limit?: number | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list.
|
|
26
|
-
*/
|
|
27
|
-
startingAfter?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list.
|
|
30
|
-
*/
|
|
31
|
-
endingBefore?: string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Search contacts by display name or email address. Minimum 2 characters required.
|
|
34
|
-
*/
|
|
35
|
-
search?: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Filter contacts by tags. Can be provided as JSON object {"tags": ["premium", "beta-user"]} or as query format "tags=premium,beta-user"
|
|
38
|
-
*/
|
|
39
|
-
filterBy?: ListContactsQueryParamFilterBy | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Include usage metrics of the last 30 days for each contact.
|
|
42
|
-
*/
|
|
43
|
-
includeMetrics?: boolean | null | undefined;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const ObjectT = {
|
|
47
|
-
List: "list",
|
|
48
|
-
} as const;
|
|
49
|
-
export type ObjectT = ClosedEnum<typeof ObjectT>;
|
|
50
|
-
|
|
51
|
-
export type ListContactsMetrics = {
|
|
52
|
-
/**
|
|
53
|
-
* Total cost in dollars of the last 30 days
|
|
54
|
-
*/
|
|
55
|
-
totalCost: number;
|
|
56
|
-
/**
|
|
57
|
-
* Total tokens of the last 30 days
|
|
58
|
-
*/
|
|
59
|
-
totalTokens: number;
|
|
60
|
-
/**
|
|
61
|
-
* Total requests of the last 30 days
|
|
62
|
-
*/
|
|
63
|
-
totalRequests: number;
|
|
64
|
-
/**
|
|
65
|
-
* P50 error rate of the last 30 days
|
|
66
|
-
*/
|
|
67
|
-
errorRate: number;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type Data = {
|
|
71
|
-
/**
|
|
72
|
-
* Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
|
|
73
|
-
*/
|
|
74
|
-
id: string;
|
|
75
|
-
/**
|
|
76
|
-
* 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.
|
|
77
|
-
*/
|
|
78
|
-
externalId: string;
|
|
79
|
-
/**
|
|
80
|
-
* Display name or nickname of the contact user. This is typically shown in user interfaces.
|
|
81
|
-
*/
|
|
82
|
-
displayName?: string | null | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Email address of the contact user
|
|
85
|
-
*/
|
|
86
|
-
email?: string | null | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* URL linking to the contact user's avatar image
|
|
89
|
-
*/
|
|
90
|
-
avatarUrl?: string | null | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
|
|
93
|
-
*/
|
|
94
|
-
tags?: Array<string> | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
|
|
97
|
-
*/
|
|
98
|
-
metadata?: { [k: string]: any } | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* The date and time the resource was created
|
|
101
|
-
*/
|
|
102
|
-
created?: Date | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* The date and time the resource was last updated
|
|
105
|
-
*/
|
|
106
|
-
updated: Date;
|
|
107
|
-
metrics: ListContactsMetrics;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* List of contacts
|
|
112
|
-
*/
|
|
113
|
-
export type ListContactsResponseBody = {
|
|
114
|
-
object: ObjectT;
|
|
115
|
-
data: Array<Data>;
|
|
116
|
-
hasMore: boolean;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/** @internal */
|
|
120
|
-
export type ListContactsQueryParamFilterBy$Outbound = {
|
|
121
|
-
tags?: Array<string> | undefined;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
/** @internal */
|
|
125
|
-
export const ListContactsQueryParamFilterBy$outboundSchema: z.ZodType<
|
|
126
|
-
ListContactsQueryParamFilterBy$Outbound,
|
|
127
|
-
z.ZodTypeDef,
|
|
128
|
-
ListContactsQueryParamFilterBy
|
|
129
|
-
> = z.object({
|
|
130
|
-
tags: z.array(z.string()).optional(),
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
export function listContactsQueryParamFilterByToJSON(
|
|
134
|
-
listContactsQueryParamFilterBy: ListContactsQueryParamFilterBy,
|
|
135
|
-
): string {
|
|
136
|
-
return JSON.stringify(
|
|
137
|
-
ListContactsQueryParamFilterBy$outboundSchema.parse(
|
|
138
|
-
listContactsQueryParamFilterBy,
|
|
139
|
-
),
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/** @internal */
|
|
144
|
-
export type ListContactsRequest$Outbound = {
|
|
145
|
-
limit: number;
|
|
146
|
-
starting_after?: string | undefined;
|
|
147
|
-
ending_before?: string | undefined;
|
|
148
|
-
search?: string | undefined;
|
|
149
|
-
filter_by?: ListContactsQueryParamFilterBy$Outbound | undefined;
|
|
150
|
-
include_metrics: boolean | null;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/** @internal */
|
|
154
|
-
export const ListContactsRequest$outboundSchema: z.ZodType<
|
|
155
|
-
ListContactsRequest$Outbound,
|
|
156
|
-
z.ZodTypeDef,
|
|
157
|
-
ListContactsRequest
|
|
158
|
-
> = z.object({
|
|
159
|
-
limit: z.number().default(10),
|
|
160
|
-
startingAfter: z.string().optional(),
|
|
161
|
-
endingBefore: z.string().optional(),
|
|
162
|
-
search: z.string().optional(),
|
|
163
|
-
filterBy: z.lazy(() => ListContactsQueryParamFilterBy$outboundSchema)
|
|
164
|
-
.optional(),
|
|
165
|
-
includeMetrics: z.nullable(z.boolean().default(false)),
|
|
166
|
-
}).transform((v) => {
|
|
167
|
-
return remap$(v, {
|
|
168
|
-
startingAfter: "starting_after",
|
|
169
|
-
endingBefore: "ending_before",
|
|
170
|
-
filterBy: "filter_by",
|
|
171
|
-
includeMetrics: "include_metrics",
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
export function listContactsRequestToJSON(
|
|
176
|
-
listContactsRequest: ListContactsRequest,
|
|
177
|
-
): string {
|
|
178
|
-
return JSON.stringify(
|
|
179
|
-
ListContactsRequest$outboundSchema.parse(listContactsRequest),
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/** @internal */
|
|
184
|
-
export const ObjectT$inboundSchema: z.ZodNativeEnum<typeof ObjectT> = z
|
|
185
|
-
.nativeEnum(ObjectT);
|
|
186
|
-
|
|
187
|
-
/** @internal */
|
|
188
|
-
export const ListContactsMetrics$inboundSchema: z.ZodType<
|
|
189
|
-
ListContactsMetrics,
|
|
190
|
-
z.ZodTypeDef,
|
|
191
|
-
unknown
|
|
192
|
-
> = z.object({
|
|
193
|
-
total_cost: z.number(),
|
|
194
|
-
total_tokens: z.number(),
|
|
195
|
-
total_requests: z.number(),
|
|
196
|
-
error_rate: z.number(),
|
|
197
|
-
}).transform((v) => {
|
|
198
|
-
return remap$(v, {
|
|
199
|
-
"total_cost": "totalCost",
|
|
200
|
-
"total_tokens": "totalTokens",
|
|
201
|
-
"total_requests": "totalRequests",
|
|
202
|
-
"error_rate": "errorRate",
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
export function listContactsMetricsFromJSON(
|
|
207
|
-
jsonString: string,
|
|
208
|
-
): SafeParseResult<ListContactsMetrics, SDKValidationError> {
|
|
209
|
-
return safeParse(
|
|
210
|
-
jsonString,
|
|
211
|
-
(x) => ListContactsMetrics$inboundSchema.parse(JSON.parse(x)),
|
|
212
|
-
`Failed to parse 'ListContactsMetrics' from JSON`,
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/** @internal */
|
|
217
|
-
export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
|
|
218
|
-
.object({
|
|
219
|
-
_id: z.string(),
|
|
220
|
-
external_id: z.string(),
|
|
221
|
-
display_name: z.nullable(z.string()).optional(),
|
|
222
|
-
email: z.nullable(z.string()).optional(),
|
|
223
|
-
avatar_url: z.nullable(z.string()).optional(),
|
|
224
|
-
tags: z.array(z.string()).optional(),
|
|
225
|
-
metadata: z.record(z.any()).optional(),
|
|
226
|
-
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
227
|
-
.optional(),
|
|
228
|
-
updated: z.string().datetime({ offset: true }).default(
|
|
229
|
-
"2026-01-23T11:14:01.166Z",
|
|
230
|
-
).transform(v => new Date(v)),
|
|
231
|
-
metrics: z.lazy(() => ListContactsMetrics$inboundSchema),
|
|
232
|
-
}).transform((v) => {
|
|
233
|
-
return remap$(v, {
|
|
234
|
-
"_id": "id",
|
|
235
|
-
"external_id": "externalId",
|
|
236
|
-
"display_name": "displayName",
|
|
237
|
-
"avatar_url": "avatarUrl",
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
export function dataFromJSON(
|
|
242
|
-
jsonString: string,
|
|
243
|
-
): SafeParseResult<Data, SDKValidationError> {
|
|
244
|
-
return safeParse(
|
|
245
|
-
jsonString,
|
|
246
|
-
(x) => Data$inboundSchema.parse(JSON.parse(x)),
|
|
247
|
-
`Failed to parse 'Data' from JSON`,
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/** @internal */
|
|
252
|
-
export const ListContactsResponseBody$inboundSchema: z.ZodType<
|
|
253
|
-
ListContactsResponseBody,
|
|
254
|
-
z.ZodTypeDef,
|
|
255
|
-
unknown
|
|
256
|
-
> = z.object({
|
|
257
|
-
object: ObjectT$inboundSchema,
|
|
258
|
-
data: z.array(z.lazy(() => Data$inboundSchema)),
|
|
259
|
-
has_more: z.boolean(),
|
|
260
|
-
}).transform((v) => {
|
|
261
|
-
return remap$(v, {
|
|
262
|
-
"has_more": "hasMore",
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
export function listContactsResponseBodyFromJSON(
|
|
267
|
-
jsonString: string,
|
|
268
|
-
): SafeParseResult<ListContactsResponseBody, SDKValidationError> {
|
|
269
|
-
return safeParse(
|
|
270
|
-
jsonString,
|
|
271
|
-
(x) => ListContactsResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
272
|
-
`Failed to parse 'ListContactsResponseBody' from JSON`,
|
|
273
|
-
);
|
|
274
|
-
}
|