@openrouter/sdk 1.5.6 → 1.5.7
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/errors/index.d.ts +0 -2
- package/esm/models/errors/index.js +0 -2
- package/esm/models/index.d.ts +0 -40
- package/esm/models/index.js +0 -40
- package/esm/models/operations/index.d.ts +0 -15
- package/esm/models/operations/index.js +0 -15
- package/esm/sdk/sdk.d.ts +0 -3
- package/esm/sdk/sdk.js +0 -4
- package/jsr.json +1 -1
- package/package.json +9 -9
- package/esm/funcs/internsChat.d.ts +0 -42
- package/esm/funcs/internsChat.js +0 -109
- package/esm/funcs/internsCreateIntern.d.ts +0 -21
- package/esm/funcs/internsCreateIntern.js +0 -103
- package/esm/funcs/internsDeleteIntern.d.ts +0 -21
- package/esm/funcs/internsDeleteIntern.js +0 -108
- package/esm/funcs/internsGetIntern.d.ts +0 -21
- package/esm/funcs/internsGetIntern.js +0 -105
- package/esm/funcs/internsGetInternConnections.d.ts +0 -21
- package/esm/funcs/internsGetInternConnections.js +0 -105
- package/esm/funcs/internsGetInternDaemon.d.ts +0 -21
- package/esm/funcs/internsGetInternDaemon.js +0 -105
- package/esm/funcs/internsGetInternDaemonAccess.d.ts +0 -23
- package/esm/funcs/internsGetInternDaemonAccess.js +0 -107
- package/esm/funcs/internsGetInternIcon.d.ts +0 -20
- package/esm/funcs/internsGetInternIcon.js +0 -109
- package/esm/funcs/internsInvoke.d.ts +0 -26
- package/esm/funcs/internsInvoke.js +0 -119
- package/esm/funcs/internsListInterns.d.ts +0 -21
- package/esm/funcs/internsListInterns.js +0 -107
- package/esm/funcs/internsProvisionIntern.d.ts +0 -21
- package/esm/funcs/internsProvisionIntern.js +0 -105
- package/esm/funcs/internsSignInternDaemonAccessRequest.d.ts +0 -22
- package/esm/funcs/internsSignInternDaemonAccessRequest.js +0 -109
- package/esm/funcs/internsSignInternDaemonRequest.d.ts +0 -20
- package/esm/funcs/internsSignInternDaemonRequest.js +0 -109
- package/esm/funcs/internsSuspendIntern.d.ts +0 -21
- package/esm/funcs/internsSuspendIntern.js +0 -105
- package/esm/funcs/internsUpdateIntern.d.ts +0 -21
- package/esm/funcs/internsUpdateIntern.js +0 -108
- package/esm/models/createinternrequest.d.ts +0 -43
- package/esm/models/createinternrequest.js +0 -24
- package/esm/models/deleteinternrequest.d.ts +0 -18
- package/esm/models/deleteinternrequest.js +0 -18
- package/esm/models/deleteinternresponse.d.ts +0 -10
- package/esm/models/deleteinternresponse.js +0 -14
- package/esm/models/errors/internchaterrorresponse.d.ts +0 -31
- package/esm/models/errors/internchaterrorresponse.js +0 -35
- package/esm/models/errors/internlifecycleerror.d.ts +0 -25
- package/esm/models/errors/internlifecycleerror.js +0 -35
- package/esm/models/intern.d.ts +0 -120
- package/esm/models/intern.js +0 -74
- package/esm/models/internapprovalmode.d.ts +0 -16
- package/esm/models/internapprovalmode.js +0 -15
- package/esm/models/internchatassistantmessage.d.ts +0 -24
- package/esm/models/internchatassistantmessage.js +0 -22
- package/esm/models/internchatchoice.d.ts +0 -37
- package/esm/models/internchatchoice.js +0 -33
- package/esm/models/internchatcompletionchunk.d.ts +0 -48
- package/esm/models/internchatcompletionchunk.js +0 -34
- package/esm/models/internchatcompletionrequest.d.ts +0 -40
- package/esm/models/internchatcompletionrequest.js +0 -25
- package/esm/models/internchatdelta.d.ts +0 -24
- package/esm/models/internchatdelta.js +0 -28
- package/esm/models/internchatdevelopermessage.d.ts +0 -21
- package/esm/models/internchatdevelopermessage.js +0 -15
- package/esm/models/internchatechoedtoolcall.d.ts +0 -21
- package/esm/models/internchatechoedtoolcall.js +0 -15
- package/esm/models/internchatechoedtoolcallfunction.d.ts +0 -17
- package/esm/models/internchatechoedtoolcallfunction.js +0 -14
- package/esm/models/internchaterror.d.ts +0 -22
- package/esm/models/internchaterror.js +0 -17
- package/esm/models/internchaterrormetadata.d.ts +0 -48
- package/esm/models/internchaterrormetadata.js +0 -39
- package/esm/models/internchatmessage.d.ts +0 -16
- package/esm/models/internchatmessage.js +0 -22
- package/esm/models/internchatmessagecontent.d.ts +0 -12
- package/esm/models/internchatmessagecontent.js +0 -12
- package/esm/models/internchatprompttokensdetails.d.ts +0 -13
- package/esm/models/internchatprompttokensdetails.js +0 -19
- package/esm/models/internchatsteeredresponse.d.ts +0 -33
- package/esm/models/internchatsteeredresponse.js +0 -28
- package/esm/models/internchatstreamerror.d.ts +0 -22
- package/esm/models/internchatstreamerror.js +0 -17
- package/esm/models/internchatstreamingresponse.d.ts +0 -17
- package/esm/models/internchatstreamingresponse.js +0 -29
- package/esm/models/internchatsystemmessage.d.ts +0 -21
- package/esm/models/internchatsystemmessage.js +0 -15
- package/esm/models/internchattextpart.d.ts +0 -24
- package/esm/models/internchattextpart.js +0 -19
- package/esm/models/internchattoolcall.d.ts +0 -30
- package/esm/models/internchattoolcall.js +0 -23
- package/esm/models/internchattoolcallfunction.d.ts +0 -24
- package/esm/models/internchattoolcallfunction.js +0 -20
- package/esm/models/internchattoolmessage.d.ts +0 -23
- package/esm/models/internchattoolmessage.js +0 -21
- package/esm/models/internchatusage.d.ts +0 -24
- package/esm/models/internchatusage.js +0 -27
- package/esm/models/internchatusermessage.d.ts +0 -21
- package/esm/models/internchatusermessage.js +0 -15
- package/esm/models/internconnection.d.ts +0 -118
- package/esm/models/internconnection.js +0 -105
- package/esm/models/internconnectionlist.d.ts +0 -11
- package/esm/models/internconnectionlist.js +0 -15
- package/esm/models/interndaemonaccess.d.ts +0 -24
- package/esm/models/interndaemonaccess.js +0 -23
- package/esm/models/interninvokeacceptedresponse.d.ts +0 -34
- package/esm/models/interninvokeacceptedresponse.js +0 -30
- package/esm/models/interninvokerequest.d.ts +0 -23
- package/esm/models/interninvokerequest.js +0 -19
- package/esm/models/internlifecycleerror.d.ts +0 -23
- package/esm/models/internlifecycleerror.js +0 -32
- package/esm/models/internlistresponse.d.ts +0 -22
- package/esm/models/internlistresponse.js +0 -23
- package/esm/models/operations/createintern.d.ts +0 -61
- package/esm/models/operations/createintern.js +0 -25
- package/esm/models/operations/createinternchatcompletion.d.ts +0 -77
- package/esm/models/operations/createinternchatcompletion.js +0 -71
- package/esm/models/operations/deleteintern.d.ts +0 -61
- package/esm/models/operations/deleteintern.js +0 -24
- package/esm/models/operations/getintern.d.ts +0 -58
- package/esm/models/operations/getintern.js +0 -21
- package/esm/models/operations/getinternconnections.d.ts +0 -58
- package/esm/models/operations/getinternconnections.js +0 -21
- package/esm/models/operations/getinterndaemon.d.ts +0 -58
- package/esm/models/operations/getinterndaemon.js +0 -21
- package/esm/models/operations/getinterndaemonaccess.d.ts +0 -58
- package/esm/models/operations/getinterndaemonaccess.js +0 -21
- package/esm/models/operations/getinternicon.d.ts +0 -63
- package/esm/models/operations/getinternicon.js +0 -22
- package/esm/models/operations/invokeintern.d.ts +0 -72
- package/esm/models/operations/invokeintern.js +0 -38
- package/esm/models/operations/listinterns.d.ts +0 -87
- package/esm/models/operations/listinterns.js +0 -40
- package/esm/models/operations/provisionintern.d.ts +0 -58
- package/esm/models/operations/provisionintern.js +0 -21
- package/esm/models/operations/signinterndaemonaccessrequest.d.ts +0 -72
- package/esm/models/operations/signinterndaemonaccessrequest.js +0 -38
- package/esm/models/operations/signinterndaemonrequest.d.ts +0 -72
- package/esm/models/operations/signinterndaemonrequest.js +0 -38
- package/esm/models/operations/suspendintern.d.ts +0 -58
- package/esm/models/operations/suspendintern.js +0 -21
- package/esm/models/operations/updateintern.d.ts +0 -61
- package/esm/models/operations/updateintern.js +0 -24
- package/esm/models/provisioninternresponse.d.ts +0 -10
- package/esm/models/provisioninternresponse.js +0 -14
- package/esm/models/signinterndaemonrequest.d.ts +0 -54
- package/esm/models/signinterndaemonrequest.js +0 -30
- package/esm/models/signinterndaemonresponse.d.ts +0 -32
- package/esm/models/signinterndaemonresponse.js +0 -27
- package/esm/models/suspendinternresponse.d.ts +0 -10
- package/esm/models/suspendinternresponse.js +0 -14
- package/esm/models/updateinternrequest.d.ts +0 -33
- package/esm/models/updateinternrequest.js +0 -16
- package/esm/sdk/interns.d.ts +0 -143
- package/esm/sdk/interns.js +0 -163
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 74ff6cd8e4b0
|
|
4
|
-
*/
|
|
5
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
|
|
13
|
-
import { Intern$inboundSchema as models_Intern$inboundSchema } from "../models/intern.js";
|
|
14
|
-
import { CreateInternRequest$outboundSchema as operations_CreateInternRequest$outboundSchema } from "../models/operations/createintern.js";
|
|
15
|
-
import { APIPromise } from "../types/async.js";
|
|
16
|
-
/**
|
|
17
|
-
* Create an intern
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Creates an intern in an explicit workspace. The operation also creates its private vault. It can start provisioning immediately or wait for a later provision call. A retry with the same idempotency key and body resumes unfinished work. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
21
|
-
*
|
|
22
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
23
|
-
*/
|
|
24
|
-
export function internsCreateIntern(client, request, options) {
|
|
25
|
-
return new APIPromise($do(client, request, options));
|
|
26
|
-
}
|
|
27
|
-
async function $do(client, request, options) {
|
|
28
|
-
const parsed = safeParse(request, (value) => operations_CreateInternRequest$outboundSchema.parse(value), "Input validation failed");
|
|
29
|
-
if (!parsed.ok) {
|
|
30
|
-
return [parsed, { status: "invalid" }];
|
|
31
|
-
}
|
|
32
|
-
const payload = parsed.value;
|
|
33
|
-
const body = encodeJSON("body", payload.CreateInternRequest, {
|
|
34
|
-
explode: true,
|
|
35
|
-
});
|
|
36
|
-
const path = pathToFunc("/interns")();
|
|
37
|
-
const headers = new Headers(compactMap({
|
|
38
|
-
"Content-Type": "application/json",
|
|
39
|
-
Accept: "application/json",
|
|
40
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
-
"Idempotency-Key": encodeSimple("Idempotency-Key", payload["Idempotency-Key"], { explode: false, charEncoding: "none" }),
|
|
42
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
43
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
44
|
-
}));
|
|
45
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
46
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
47
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
48
|
-
const context = {
|
|
49
|
-
options: client._options,
|
|
50
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
51
|
-
operationID: "createIntern",
|
|
52
|
-
oAuth2Scopes: null,
|
|
53
|
-
resolvedSecurity: requestSecurity,
|
|
54
|
-
securitySource: client._options.apiKey,
|
|
55
|
-
retryConfig: options?.retries
|
|
56
|
-
|| client._options.retryConfig
|
|
57
|
-
|| {
|
|
58
|
-
strategy: "backoff",
|
|
59
|
-
backoff: {
|
|
60
|
-
initialInterval: 500,
|
|
61
|
-
maxInterval: 60000,
|
|
62
|
-
exponent: 1.5,
|
|
63
|
-
maxElapsedTime: 3600000,
|
|
64
|
-
},
|
|
65
|
-
retryConnectionErrors: true,
|
|
66
|
-
}
|
|
67
|
-
|| { strategy: "none" },
|
|
68
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
69
|
-
};
|
|
70
|
-
const requestRes = client._createRequest(context, {
|
|
71
|
-
security: requestSecurity,
|
|
72
|
-
method: "POST",
|
|
73
|
-
baseURL: options?.serverURL,
|
|
74
|
-
path: path,
|
|
75
|
-
headers: headers,
|
|
76
|
-
body: body,
|
|
77
|
-
userAgent: client._options.userAgent,
|
|
78
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
79
|
-
}, options);
|
|
80
|
-
if (!requestRes.ok) {
|
|
81
|
-
return [requestRes, { status: "invalid" }];
|
|
82
|
-
}
|
|
83
|
-
const req = requestRes.value;
|
|
84
|
-
const doResult = await client._do(req, {
|
|
85
|
-
context,
|
|
86
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
87
|
-
retryConfig: context.retryConfig,
|
|
88
|
-
retryCodes: context.retryCodes,
|
|
89
|
-
});
|
|
90
|
-
if (!doResult.ok) {
|
|
91
|
-
return [doResult, { status: "request-error", request: req }];
|
|
92
|
-
}
|
|
93
|
-
const response = doResult.value;
|
|
94
|
-
const responseFields = {
|
|
95
|
-
HttpMeta: { Response: response, Request: req },
|
|
96
|
-
};
|
|
97
|
-
const [result] = await M.match(M.json([200, 201], models_Intern$inboundSchema), M.jsonErr([400, 401, 403, 404, 408, 409, 413, 415], errors_InternLifecycleError$inboundSchema), M.jsonErr([500, 502], errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
98
|
-
if (!result.ok) {
|
|
99
|
-
return [result, { status: "complete", request: req, response }];
|
|
100
|
-
}
|
|
101
|
-
return [result, { status: "complete", request: req, response }];
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=internsCreateIntern.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as models from "../models/index.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
import { Result } from "../types/fp.js";
|
|
12
|
-
/**
|
|
13
|
-
* Delete an intern
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send `{"acknowledge_workspace_loss": true}` to delete a `destroy_failed` intern whose `last_failure_message` names `workspace_archive_failed`, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
17
|
-
*
|
|
18
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
19
|
-
*/
|
|
20
|
-
export declare function internsDeleteIntern(client: OpenRouterCore, request: operations.DeleteInternRequest, options?: RequestOptions): APIPromise<Result<models.DeleteInternResponse, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
21
|
-
//# sourceMappingURL=internsDeleteIntern.d.ts.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 7eb35f20da18
|
|
4
|
-
*/
|
|
5
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
|
|
13
|
-
import { DeleteInternResponse$inboundSchema as models_DeleteInternResponse$inboundSchema } from "../models/deleteinternresponse.js";
|
|
14
|
-
import { DeleteInternRequest$outboundSchema as operations_DeleteInternRequest$outboundSchema } from "../models/operations/deleteintern.js";
|
|
15
|
-
import { APIPromise } from "../types/async.js";
|
|
16
|
-
/**
|
|
17
|
-
* Delete an intern
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send `{"acknowledge_workspace_loss": true}` to delete a `destroy_failed` intern whose `last_failure_message` names `workspace_archive_failed`, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
21
|
-
*
|
|
22
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
23
|
-
*/
|
|
24
|
-
export function internsDeleteIntern(client, request, options) {
|
|
25
|
-
return new APIPromise($do(client, request, options));
|
|
26
|
-
}
|
|
27
|
-
async function $do(client, request, options) {
|
|
28
|
-
const parsed = safeParse(request, (value) => operations_DeleteInternRequest$outboundSchema.parse(value), "Input validation failed");
|
|
29
|
-
if (!parsed.ok) {
|
|
30
|
-
return [parsed, { status: "invalid" }];
|
|
31
|
-
}
|
|
32
|
-
const payload = parsed.value;
|
|
33
|
-
const body = encodeJSON("body", payload.DeleteInternRequest, {
|
|
34
|
-
explode: true,
|
|
35
|
-
});
|
|
36
|
-
const pathParams = {
|
|
37
|
-
internId: encodeSimple("internId", payload.internId, {
|
|
38
|
-
explode: false,
|
|
39
|
-
charEncoding: "percent",
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
const path = pathToFunc("/interns/{internId}")(pathParams);
|
|
43
|
-
const headers = new Headers(compactMap({
|
|
44
|
-
"Content-Type": "application/json",
|
|
45
|
-
Accept: "application/json",
|
|
46
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
47
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
48
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
49
|
-
}));
|
|
50
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
51
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
52
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
53
|
-
const context = {
|
|
54
|
-
options: client._options,
|
|
55
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
56
|
-
operationID: "deleteIntern",
|
|
57
|
-
oAuth2Scopes: null,
|
|
58
|
-
resolvedSecurity: requestSecurity,
|
|
59
|
-
securitySource: client._options.apiKey,
|
|
60
|
-
retryConfig: options?.retries
|
|
61
|
-
|| client._options.retryConfig
|
|
62
|
-
|| {
|
|
63
|
-
strategy: "backoff",
|
|
64
|
-
backoff: {
|
|
65
|
-
initialInterval: 500,
|
|
66
|
-
maxInterval: 60000,
|
|
67
|
-
exponent: 1.5,
|
|
68
|
-
maxElapsedTime: 3600000,
|
|
69
|
-
},
|
|
70
|
-
retryConnectionErrors: true,
|
|
71
|
-
}
|
|
72
|
-
|| { strategy: "none" },
|
|
73
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
74
|
-
};
|
|
75
|
-
const requestRes = client._createRequest(context, {
|
|
76
|
-
security: requestSecurity,
|
|
77
|
-
method: "DELETE",
|
|
78
|
-
baseURL: options?.serverURL,
|
|
79
|
-
path: path,
|
|
80
|
-
headers: headers,
|
|
81
|
-
body: body,
|
|
82
|
-
userAgent: client._options.userAgent,
|
|
83
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
84
|
-
}, options);
|
|
85
|
-
if (!requestRes.ok) {
|
|
86
|
-
return [requestRes, { status: "invalid" }];
|
|
87
|
-
}
|
|
88
|
-
const req = requestRes.value;
|
|
89
|
-
const doResult = await client._do(req, {
|
|
90
|
-
context,
|
|
91
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
92
|
-
retryConfig: context.retryConfig,
|
|
93
|
-
retryCodes: context.retryCodes,
|
|
94
|
-
});
|
|
95
|
-
if (!doResult.ok) {
|
|
96
|
-
return [doResult, { status: "request-error", request: req }];
|
|
97
|
-
}
|
|
98
|
-
const response = doResult.value;
|
|
99
|
-
const responseFields = {
|
|
100
|
-
HttpMeta: { Response: response, Request: req },
|
|
101
|
-
};
|
|
102
|
-
const [result] = await M.match(M.json(202, models_DeleteInternResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 408, 409, 413, 415], errors_InternLifecycleError$inboundSchema), M.jsonErr([500, 502], errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
103
|
-
if (!result.ok) {
|
|
104
|
-
return [result, { status: "complete", request: req, response }];
|
|
105
|
-
}
|
|
106
|
-
return [result, { status: "complete", request: req, response }];
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=internsDeleteIntern.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as models from "../models/index.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
import { Result } from "../types/fp.js";
|
|
12
|
-
/**
|
|
13
|
-
* Get an intern
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
17
|
-
*
|
|
18
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
19
|
-
*/
|
|
20
|
-
export declare function internsGetIntern(client: OpenRouterCore, request: operations.GetInternRequest, options?: RequestOptions): APIPromise<Result<models.Intern, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
21
|
-
//# sourceMappingURL=internsGetIntern.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 484b04c35876
|
|
4
|
-
*/
|
|
5
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
|
|
13
|
-
import { Intern$inboundSchema as models_Intern$inboundSchema } from "../models/intern.js";
|
|
14
|
-
import { GetInternRequest$outboundSchema as operations_GetInternRequest$outboundSchema } from "../models/operations/getintern.js";
|
|
15
|
-
import { APIPromise } from "../types/async.js";
|
|
16
|
-
/**
|
|
17
|
-
* Get an intern
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
21
|
-
*
|
|
22
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
23
|
-
*/
|
|
24
|
-
export function internsGetIntern(client, request, options) {
|
|
25
|
-
return new APIPromise($do(client, request, options));
|
|
26
|
-
}
|
|
27
|
-
async function $do(client, request, options) {
|
|
28
|
-
const parsed = safeParse(request, (value) => operations_GetInternRequest$outboundSchema.parse(value), "Input validation failed");
|
|
29
|
-
if (!parsed.ok) {
|
|
30
|
-
return [parsed, { status: "invalid" }];
|
|
31
|
-
}
|
|
32
|
-
const payload = parsed.value;
|
|
33
|
-
const body = null;
|
|
34
|
-
const pathParams = {
|
|
35
|
-
internId: encodeSimple("internId", payload.internId, {
|
|
36
|
-
explode: false,
|
|
37
|
-
charEncoding: "percent",
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
const path = pathToFunc("/interns/{internId}")(pathParams);
|
|
41
|
-
const headers = new Headers(compactMap({
|
|
42
|
-
Accept: "application/json",
|
|
43
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
44
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
45
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
46
|
-
}));
|
|
47
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
48
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
49
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
50
|
-
const context = {
|
|
51
|
-
options: client._options,
|
|
52
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
53
|
-
operationID: "getIntern",
|
|
54
|
-
oAuth2Scopes: null,
|
|
55
|
-
resolvedSecurity: requestSecurity,
|
|
56
|
-
securitySource: client._options.apiKey,
|
|
57
|
-
retryConfig: options?.retries
|
|
58
|
-
|| client._options.retryConfig
|
|
59
|
-
|| {
|
|
60
|
-
strategy: "backoff",
|
|
61
|
-
backoff: {
|
|
62
|
-
initialInterval: 500,
|
|
63
|
-
maxInterval: 60000,
|
|
64
|
-
exponent: 1.5,
|
|
65
|
-
maxElapsedTime: 3600000,
|
|
66
|
-
},
|
|
67
|
-
retryConnectionErrors: true,
|
|
68
|
-
}
|
|
69
|
-
|| { strategy: "none" },
|
|
70
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
71
|
-
};
|
|
72
|
-
const requestRes = client._createRequest(context, {
|
|
73
|
-
security: requestSecurity,
|
|
74
|
-
method: "GET",
|
|
75
|
-
baseURL: options?.serverURL,
|
|
76
|
-
path: path,
|
|
77
|
-
headers: headers,
|
|
78
|
-
body: body,
|
|
79
|
-
userAgent: client._options.userAgent,
|
|
80
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
81
|
-
}, options);
|
|
82
|
-
if (!requestRes.ok) {
|
|
83
|
-
return [requestRes, { status: "invalid" }];
|
|
84
|
-
}
|
|
85
|
-
const req = requestRes.value;
|
|
86
|
-
const doResult = await client._do(req, {
|
|
87
|
-
context,
|
|
88
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
89
|
-
retryConfig: context.retryConfig,
|
|
90
|
-
retryCodes: context.retryCodes,
|
|
91
|
-
});
|
|
92
|
-
if (!doResult.ok) {
|
|
93
|
-
return [doResult, { status: "request-error", request: req }];
|
|
94
|
-
}
|
|
95
|
-
const response = doResult.value;
|
|
96
|
-
const responseFields = {
|
|
97
|
-
HttpMeta: { Response: response, Request: req },
|
|
98
|
-
};
|
|
99
|
-
const [result] = await M.match(M.json(200, models_Intern$inboundSchema), M.jsonErr([401, 403, 404, 408], errors_InternLifecycleError$inboundSchema), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
100
|
-
if (!result.ok) {
|
|
101
|
-
return [result, { status: "complete", request: req, response }];
|
|
102
|
-
}
|
|
103
|
-
return [result, { status: "complete", request: req, response }];
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=internsGetIntern.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as models from "../models/index.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
import { Result } from "../types/fp.js";
|
|
12
|
-
/**
|
|
13
|
-
* List an intern's connections
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Returns the Slack, GitHub, Google Workspace and MCP connections one visible intern can reach, and the shared ones switched off for it or disabled for the workspace. An OAuth grant needs `vault:read`, because the list names members' personal accounts; without it the route answers 403 `insufficient_scope`. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
17
|
-
*
|
|
18
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
19
|
-
*/
|
|
20
|
-
export declare function internsGetInternConnections(client: OpenRouterCore, request: operations.GetInternConnectionsRequest, options?: RequestOptions): APIPromise<Result<models.InternConnectionList, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
21
|
-
//# sourceMappingURL=internsGetInternConnections.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 5be250841af7
|
|
4
|
-
*/
|
|
5
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
|
|
13
|
-
import { InternConnectionList$inboundSchema as models_InternConnectionList$inboundSchema } from "../models/internconnectionlist.js";
|
|
14
|
-
import { GetInternConnectionsRequest$outboundSchema as operations_GetInternConnectionsRequest$outboundSchema } from "../models/operations/getinternconnections.js";
|
|
15
|
-
import { APIPromise } from "../types/async.js";
|
|
16
|
-
/**
|
|
17
|
-
* List an intern's connections
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Returns the Slack, GitHub, Google Workspace and MCP connections one visible intern can reach, and the shared ones switched off for it or disabled for the workspace. An OAuth grant needs `vault:read`, because the list names members' personal accounts; without it the route answers 403 `insufficient_scope`. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
21
|
-
*
|
|
22
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
23
|
-
*/
|
|
24
|
-
export function internsGetInternConnections(client, request, options) {
|
|
25
|
-
return new APIPromise($do(client, request, options));
|
|
26
|
-
}
|
|
27
|
-
async function $do(client, request, options) {
|
|
28
|
-
const parsed = safeParse(request, (value) => operations_GetInternConnectionsRequest$outboundSchema.parse(value), "Input validation failed");
|
|
29
|
-
if (!parsed.ok) {
|
|
30
|
-
return [parsed, { status: "invalid" }];
|
|
31
|
-
}
|
|
32
|
-
const payload = parsed.value;
|
|
33
|
-
const body = null;
|
|
34
|
-
const pathParams = {
|
|
35
|
-
internId: encodeSimple("internId", payload.internId, {
|
|
36
|
-
explode: false,
|
|
37
|
-
charEncoding: "percent",
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
const path = pathToFunc("/interns/{internId}/connections")(pathParams);
|
|
41
|
-
const headers = new Headers(compactMap({
|
|
42
|
-
Accept: "application/json",
|
|
43
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
44
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
45
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
46
|
-
}));
|
|
47
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
48
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
49
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
50
|
-
const context = {
|
|
51
|
-
options: client._options,
|
|
52
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
53
|
-
operationID: "getInternConnections",
|
|
54
|
-
oAuth2Scopes: null,
|
|
55
|
-
resolvedSecurity: requestSecurity,
|
|
56
|
-
securitySource: client._options.apiKey,
|
|
57
|
-
retryConfig: options?.retries
|
|
58
|
-
|| client._options.retryConfig
|
|
59
|
-
|| {
|
|
60
|
-
strategy: "backoff",
|
|
61
|
-
backoff: {
|
|
62
|
-
initialInterval: 500,
|
|
63
|
-
maxInterval: 60000,
|
|
64
|
-
exponent: 1.5,
|
|
65
|
-
maxElapsedTime: 3600000,
|
|
66
|
-
},
|
|
67
|
-
retryConnectionErrors: true,
|
|
68
|
-
}
|
|
69
|
-
|| { strategy: "none" },
|
|
70
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
71
|
-
};
|
|
72
|
-
const requestRes = client._createRequest(context, {
|
|
73
|
-
security: requestSecurity,
|
|
74
|
-
method: "GET",
|
|
75
|
-
baseURL: options?.serverURL,
|
|
76
|
-
path: path,
|
|
77
|
-
headers: headers,
|
|
78
|
-
body: body,
|
|
79
|
-
userAgent: client._options.userAgent,
|
|
80
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
81
|
-
}, options);
|
|
82
|
-
if (!requestRes.ok) {
|
|
83
|
-
return [requestRes, { status: "invalid" }];
|
|
84
|
-
}
|
|
85
|
-
const req = requestRes.value;
|
|
86
|
-
const doResult = await client._do(req, {
|
|
87
|
-
context,
|
|
88
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
89
|
-
retryConfig: context.retryConfig,
|
|
90
|
-
retryCodes: context.retryCodes,
|
|
91
|
-
});
|
|
92
|
-
if (!doResult.ok) {
|
|
93
|
-
return [doResult, { status: "request-error", request: req }];
|
|
94
|
-
}
|
|
95
|
-
const response = doResult.value;
|
|
96
|
-
const responseFields = {
|
|
97
|
-
HttpMeta: { Response: response, Request: req },
|
|
98
|
-
};
|
|
99
|
-
const [result] = await M.match(M.json(200, models_InternConnectionList$inboundSchema), M.jsonErr([401, 403, 404, 408], errors_InternLifecycleError$inboundSchema), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
100
|
-
if (!result.ok) {
|
|
101
|
-
return [result, { status: "complete", request: req, response }];
|
|
102
|
-
}
|
|
103
|
-
return [result, { status: "complete", request: req, response }];
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=internsGetInternConnections.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as models from "../models/index.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
import { Result } from "../types/fp.js";
|
|
12
|
-
/**
|
|
13
|
-
* Get an intern's daemon access
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: only an OAuth-token caller (`ori login --oidc`) may read it, the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. API keys get 403 `personal_identity_required`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
17
|
-
*
|
|
18
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
19
|
-
*/
|
|
20
|
-
export declare function internsGetInternDaemon(client: OpenRouterCore, request: operations.GetInternDaemonRequest, options?: RequestOptions): APIPromise<Result<models.InternDaemonAccess, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
21
|
-
//# sourceMappingURL=internsGetInternDaemon.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 727cbeff5468
|
|
4
|
-
*/
|
|
5
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
|
|
13
|
-
import { InternDaemonAccess$inboundSchema as models_InternDaemonAccess$inboundSchema } from "../models/interndaemonaccess.js";
|
|
14
|
-
import { GetInternDaemonRequest$outboundSchema as operations_GetInternDaemonRequest$outboundSchema } from "../models/operations/getinterndaemon.js";
|
|
15
|
-
import { APIPromise } from "../types/async.js";
|
|
16
|
-
/**
|
|
17
|
-
* Get an intern's daemon access
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: only an OAuth-token caller (`ori login --oidc`) may read it, the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. API keys get 403 `personal_identity_required`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
21
|
-
*
|
|
22
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
23
|
-
*/
|
|
24
|
-
export function internsGetInternDaemon(client, request, options) {
|
|
25
|
-
return new APIPromise($do(client, request, options));
|
|
26
|
-
}
|
|
27
|
-
async function $do(client, request, options) {
|
|
28
|
-
const parsed = safeParse(request, (value) => operations_GetInternDaemonRequest$outboundSchema.parse(value), "Input validation failed");
|
|
29
|
-
if (!parsed.ok) {
|
|
30
|
-
return [parsed, { status: "invalid" }];
|
|
31
|
-
}
|
|
32
|
-
const payload = parsed.value;
|
|
33
|
-
const body = null;
|
|
34
|
-
const pathParams = {
|
|
35
|
-
internId: encodeSimple("internId", payload.internId, {
|
|
36
|
-
explode: false,
|
|
37
|
-
charEncoding: "percent",
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
const path = pathToFunc("/interns/{internId}/daemon")(pathParams);
|
|
41
|
-
const headers = new Headers(compactMap({
|
|
42
|
-
Accept: "application/json",
|
|
43
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
44
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
45
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
46
|
-
}));
|
|
47
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
48
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
49
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
50
|
-
const context = {
|
|
51
|
-
options: client._options,
|
|
52
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
53
|
-
operationID: "getInternDaemon",
|
|
54
|
-
oAuth2Scopes: null,
|
|
55
|
-
resolvedSecurity: requestSecurity,
|
|
56
|
-
securitySource: client._options.apiKey,
|
|
57
|
-
retryConfig: options?.retries
|
|
58
|
-
|| client._options.retryConfig
|
|
59
|
-
|| {
|
|
60
|
-
strategy: "backoff",
|
|
61
|
-
backoff: {
|
|
62
|
-
initialInterval: 500,
|
|
63
|
-
maxInterval: 60000,
|
|
64
|
-
exponent: 1.5,
|
|
65
|
-
maxElapsedTime: 3600000,
|
|
66
|
-
},
|
|
67
|
-
retryConnectionErrors: true,
|
|
68
|
-
}
|
|
69
|
-
|| { strategy: "none" },
|
|
70
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
71
|
-
};
|
|
72
|
-
const requestRes = client._createRequest(context, {
|
|
73
|
-
security: requestSecurity,
|
|
74
|
-
method: "GET",
|
|
75
|
-
baseURL: options?.serverURL,
|
|
76
|
-
path: path,
|
|
77
|
-
headers: headers,
|
|
78
|
-
body: body,
|
|
79
|
-
userAgent: client._options.userAgent,
|
|
80
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
81
|
-
}, options);
|
|
82
|
-
if (!requestRes.ok) {
|
|
83
|
-
return [requestRes, { status: "invalid" }];
|
|
84
|
-
}
|
|
85
|
-
const req = requestRes.value;
|
|
86
|
-
const doResult = await client._do(req, {
|
|
87
|
-
context,
|
|
88
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
89
|
-
retryConfig: context.retryConfig,
|
|
90
|
-
retryCodes: context.retryCodes,
|
|
91
|
-
});
|
|
92
|
-
if (!doResult.ok) {
|
|
93
|
-
return [doResult, { status: "request-error", request: req }];
|
|
94
|
-
}
|
|
95
|
-
const response = doResult.value;
|
|
96
|
-
const responseFields = {
|
|
97
|
-
HttpMeta: { Response: response, Request: req },
|
|
98
|
-
};
|
|
99
|
-
const [result] = await M.match(M.json(200, models_InternDaemonAccess$inboundSchema), M.jsonErr([401, 403, 404, 408, 409], errors_InternLifecycleError$inboundSchema), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
100
|
-
if (!result.ok) {
|
|
101
|
-
return [result, { status: "complete", request: req, response }];
|
|
102
|
-
}
|
|
103
|
-
return [result, { status: "complete", request: req, response }];
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=internsGetInternDaemon.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as models from "../models/index.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
import { Result } from "../types/fp.js";
|
|
12
|
-
/**
|
|
13
|
-
* Get an intern's daemon access (deprecated alias)
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Deprecated alias of `GET /interns/{internId}/daemon` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
17
|
-
*
|
|
18
|
-
* If set, this operation will use {@link Security.apiKey} from the global security.
|
|
19
|
-
*
|
|
20
|
-
* @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
21
|
-
*/
|
|
22
|
-
export declare function internsGetInternDaemonAccess(client: OpenRouterCore, request: operations.GetInternDaemonAccessRequest, options?: RequestOptions): APIPromise<Result<models.InternDaemonAccess, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
23
|
-
//# sourceMappingURL=internsGetInternDaemonAccess.d.ts.map
|