@orq-ai/node 4.2.3 → 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/examples/package-lock.json +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/partdoneevent.js +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createcontact.js +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/createeval.js +14 -14
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createtool.js +6 -6
- 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.js +14 -14
- 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/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/partdoneevent.ts +1 -1
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createcontact.ts +1 -1
- 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/createeval.ts +14 -14
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createtool.ts +6 -6
- 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 +14 -14
- 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/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
|
@@ -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
|
-
}
|
|
@@ -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
|
-
}
|