@orq-ai/node 4.1.12 → 4.1.14
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/bin/mcp-server.js +220 -220
- package/bin/mcp-server.js.map +39 -39
- package/examples/package-lock.json +2 -2
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/components/conversationresponse.js +2 -2
- package/models/components/partdoneevent.js +2 -2
- package/models/components/reasoningpart.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createconversation.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createtool.js +12 -12
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/generateconversationname.js +2 -2
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getevals.js +28 -28
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrieveconversation.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.js +2 -2
- package/models/operations/streamrunagent.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updateconversation.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatetool.js +14 -14
- package/package.json +2 -2
- package/packages/orq-rc/examples/feedbackCreate.example.ts +32 -0
- package/packages/orq-rc/examples/package-lock.json +2 -2
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +6 -6
- package/packages/orq-rc/package.json +2 -2
- package/packages/orq-rc/src/funcs/contactsCreate.ts +2 -0
- package/packages/orq-rc/src/funcs/contactsDelete.ts +2 -0
- package/packages/orq-rc/src/funcs/contactsList.ts +2 -0
- package/packages/orq-rc/src/funcs/contactsRetrieve.ts +2 -0
- package/packages/orq-rc/src/funcs/contactsUpdate.ts +2 -0
- package/packages/orq-rc/src/funcs/identitiesCreate.ts +165 -0
- package/packages/orq-rc/src/funcs/identitiesDelete.ts +176 -0
- package/packages/orq-rc/src/funcs/identitiesList.ts +170 -0
- package/packages/orq-rc/src/funcs/identitiesRetrieve.ts +175 -0
- package/packages/orq-rc/src/funcs/identitiesUpdate.ts +176 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +11 -1
- package/packages/orq-rc/src/mcp-server/tools/identitiesCreate.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/identitiesDelete.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/identitiesList.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/identitiesRetrieve.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/identitiesUpdate.ts +37 -0
- package/packages/orq-rc/src/models/components/conversationresponse.ts +2 -2
- package/packages/orq-rc/src/models/components/conversationwithmessagesresponse.ts +2 -2
- package/packages/orq-rc/src/models/components/partdoneevent.ts +2 -2
- package/packages/orq-rc/src/models/components/reasoningpart.ts +2 -2
- package/packages/orq-rc/src/models/errors/deleteidentity.ts +78 -0
- package/packages/orq-rc/src/models/errors/index.ts +3 -0
- package/packages/orq-rc/src/models/errors/retrieveidentity.ts +78 -0
- package/packages/orq-rc/src/models/errors/updateidentity.ts +70 -0
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +132 -15
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createconversation.ts +2 -2
- package/packages/orq-rc/src/models/operations/createconversationresponse.ts +4 -4
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +8 -8
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/createidentity.ts +237 -0
- package/packages/orq-rc/src/models/operations/createtool.ts +33 -29
- package/packages/orq-rc/src/models/operations/deleteidentity.ts +54 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/generateconversationname.ts +2 -2
- package/packages/orq-rc/src/models/operations/getalltools.ts +12 -12
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/index.ts +5 -0
- package/packages/orq-rc/src/models/operations/listcontacts.ts +24 -20
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/listidentities.ts +432 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveidentity.ts +180 -0
- package/packages/orq-rc/src/models/operations/retrievetool.ts +12 -12
- package/packages/orq-rc/src/models/operations/runagent.ts +280 -36
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +323 -46
- package/packages/orq-rc/src/models/operations/updateagent.ts +138 -15
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateconversation.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/updateidentity.ts +281 -0
- package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
- package/packages/orq-rc/src/sdk/contacts.ts +10 -0
- package/packages/orq-rc/src/sdk/identities.ts +99 -0
- package/packages/orq-rc/src/sdk/sdk.ts +6 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/conversationresponse.ts +2 -2
- package/src/models/components/partdoneevent.ts +2 -2
- package/src/models/components/reasoningpart.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createconversation.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/generateconversationname.ts +2 -2
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrieveconversation.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +2 -2
- package/src/models/operations/streamrunagent.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updateconversation.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatetool.ts +14 -14
- package/packages/orq-rc/examples/contactsCreate.example.ts +0 -42
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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
|
+
* Create an identity
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Creates a new identity with a unique external_id. If an identity with the same external_id already exists, the operation will fail. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.
|
|
32
|
+
*/
|
|
33
|
+
export function identitiesCreate(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request?: operations.CreateIdentityRequestBody | undefined,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.CreateIdentityResponseBody,
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request?: operations.CreateIdentityRequestBody | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.CreateIdentityResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) =>
|
|
80
|
+
operations.CreateIdentityRequestBody$outboundSchema.optional().parse(
|
|
81
|
+
value,
|
|
82
|
+
),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = payload === undefined
|
|
90
|
+
? null
|
|
91
|
+
: encodeJSON("body", payload, { explode: true });
|
|
92
|
+
|
|
93
|
+
const path = pathToFunc("/v2/identities")();
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
101
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
102
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
103
|
+
|
|
104
|
+
const context = {
|
|
105
|
+
options: client._options,
|
|
106
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
107
|
+
operationID: "CreateIdentity",
|
|
108
|
+
oAuth2Scopes: null,
|
|
109
|
+
|
|
110
|
+
resolvedSecurity: requestSecurity,
|
|
111
|
+
|
|
112
|
+
securitySource: client._options.apiKey,
|
|
113
|
+
retryConfig: options?.retries
|
|
114
|
+
|| client._options.retryConfig
|
|
115
|
+
|| { strategy: "none" },
|
|
116
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const requestRes = client._createRequest(context, {
|
|
120
|
+
security: requestSecurity,
|
|
121
|
+
method: "POST",
|
|
122
|
+
baseURL: options?.serverURL,
|
|
123
|
+
path: path,
|
|
124
|
+
headers: headers,
|
|
125
|
+
body: body,
|
|
126
|
+
userAgent: client._options.userAgent,
|
|
127
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
128
|
+
}, options);
|
|
129
|
+
if (!requestRes.ok) {
|
|
130
|
+
return [requestRes, { status: "invalid" }];
|
|
131
|
+
}
|
|
132
|
+
const req = requestRes.value;
|
|
133
|
+
|
|
134
|
+
const doResult = await client._do(req, {
|
|
135
|
+
context,
|
|
136
|
+
errorCodes: ["4XX", "5XX"],
|
|
137
|
+
retryConfig: context.retryConfig,
|
|
138
|
+
retryCodes: context.retryCodes,
|
|
139
|
+
});
|
|
140
|
+
if (!doResult.ok) {
|
|
141
|
+
return [doResult, { status: "request-error", request: req }];
|
|
142
|
+
}
|
|
143
|
+
const response = doResult.value;
|
|
144
|
+
|
|
145
|
+
const [result] = await M.match<
|
|
146
|
+
operations.CreateIdentityResponseBody,
|
|
147
|
+
| OrqError
|
|
148
|
+
| ResponseValidationError
|
|
149
|
+
| ConnectionError
|
|
150
|
+
| RequestAbortedError
|
|
151
|
+
| RequestTimeoutError
|
|
152
|
+
| InvalidRequestError
|
|
153
|
+
| UnexpectedClientError
|
|
154
|
+
| SDKValidationError
|
|
155
|
+
>(
|
|
156
|
+
M.json(201, operations.CreateIdentityResponseBody$inboundSchema),
|
|
157
|
+
M.fail("4XX"),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, req);
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
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 an identity
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Permanently deletes an identity from your workspace and cleans up associated budget configurations. This action cannot be undone.
|
|
34
|
+
*/
|
|
35
|
+
export function identitiesDelete(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.DeleteIdentityRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
void,
|
|
42
|
+
| errors.DeleteIdentityResponseBody
|
|
43
|
+
| OrqError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: OrqCore,
|
|
62
|
+
request: operations.DeleteIdentityRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
void,
|
|
68
|
+
| errors.DeleteIdentityResponseBody
|
|
69
|
+
| OrqError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) => operations.DeleteIdentityRequest$outboundSchema.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = null;
|
|
91
|
+
|
|
92
|
+
const pathParams = {
|
|
93
|
+
id: encodeSimple("id", payload.id, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const path = pathToFunc("/v2/identities/{id}")(pathParams);
|
|
100
|
+
|
|
101
|
+
const headers = new Headers(compactMap({
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "DeleteIdentity",
|
|
113
|
+
oAuth2Scopes: null,
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "DELETE",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const responseFields = {
|
|
151
|
+
HttpMeta: { Response: response, Request: req },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
void,
|
|
156
|
+
| errors.DeleteIdentityResponseBody
|
|
157
|
+
| OrqError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.nil(204, z.void()),
|
|
167
|
+
M.jsonErr(404, errors.DeleteIdentityResponseBody$inboundSchema),
|
|
168
|
+
M.fail("4XX"),
|
|
169
|
+
M.fail("5XX"),
|
|
170
|
+
)(response, req, { extraFields: responseFields });
|
|
171
|
+
if (!result.ok) {
|
|
172
|
+
return [result, { status: "complete", request: req, response }];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
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 identities
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Retrieves a paginated list of identities in your workspace. Use pagination parameters to navigate through large identity lists efficiently.
|
|
32
|
+
*/
|
|
33
|
+
export function identitiesList(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request?: operations.ListIdentitiesRequest | undefined,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.ListIdentitiesResponseBody,
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request?: operations.ListIdentitiesRequest | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.ListIdentitiesResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) =>
|
|
80
|
+
operations.ListIdentitiesRequest$outboundSchema.optional().parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = null;
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v2/identities")();
|
|
90
|
+
|
|
91
|
+
const query = encodeFormQuery({
|
|
92
|
+
"ending_before": payload?.ending_before,
|
|
93
|
+
"filter_by": payload?.filter_by,
|
|
94
|
+
"include_metrics": payload?.include_metrics,
|
|
95
|
+
"limit": payload?.limit,
|
|
96
|
+
"search": payload?.search,
|
|
97
|
+
"starting_after": payload?.starting_after,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
105
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "ListIdentities",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.apiKey,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "GET",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
query: query,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["4XX", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
operations.ListIdentitiesResponseBody,
|
|
152
|
+
| OrqError
|
|
153
|
+
| ResponseValidationError
|
|
154
|
+
| ConnectionError
|
|
155
|
+
| RequestAbortedError
|
|
156
|
+
| RequestTimeoutError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| UnexpectedClientError
|
|
159
|
+
| SDKValidationError
|
|
160
|
+
>(
|
|
161
|
+
M.json(200, operations.ListIdentitiesResponseBody$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("5XX"),
|
|
164
|
+
)(response, req);
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
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 an identity
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieves detailed information about a specific identity using their identity ID or external ID from your system.
|
|
33
|
+
*/
|
|
34
|
+
export function identitiesRetrieve(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: operations.RetrieveIdentityRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.RetrieveIdentityResponseBody,
|
|
41
|
+
| errors.RetrieveIdentityResponseBody
|
|
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.RetrieveIdentityRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.RetrieveIdentityResponseBody,
|
|
67
|
+
| errors.RetrieveIdentityResponseBody
|
|
68
|
+
| OrqError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) => operations.RetrieveIdentityRequest$outboundSchema.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 pathParams = {
|
|
92
|
+
id: encodeSimple("id", payload.id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v2/identities/{id}")(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
105
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "RetrieveIdentity",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.apiKey,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "GET",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
141
|
+
retryConfig: context.retryConfig,
|
|
142
|
+
retryCodes: context.retryCodes,
|
|
143
|
+
});
|
|
144
|
+
if (!doResult.ok) {
|
|
145
|
+
return [doResult, { status: "request-error", request: req }];
|
|
146
|
+
}
|
|
147
|
+
const response = doResult.value;
|
|
148
|
+
|
|
149
|
+
const responseFields = {
|
|
150
|
+
HttpMeta: { Response: response, Request: req },
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const [result] = await M.match<
|
|
154
|
+
operations.RetrieveIdentityResponseBody,
|
|
155
|
+
| errors.RetrieveIdentityResponseBody
|
|
156
|
+
| OrqError
|
|
157
|
+
| ResponseValidationError
|
|
158
|
+
| ConnectionError
|
|
159
|
+
| RequestAbortedError
|
|
160
|
+
| RequestTimeoutError
|
|
161
|
+
| InvalidRequestError
|
|
162
|
+
| UnexpectedClientError
|
|
163
|
+
| SDKValidationError
|
|
164
|
+
>(
|
|
165
|
+
M.json(200, operations.RetrieveIdentityResponseBody$inboundSchema),
|
|
166
|
+
M.jsonErr(404, errors.RetrieveIdentityResponseBody$inboundSchema),
|
|
167
|
+
M.fail("4XX"),
|
|
168
|
+
M.fail("5XX"),
|
|
169
|
+
)(response, req, { extraFields: responseFields });
|
|
170
|
+
if (!result.ok) {
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
175
|
+
}
|