@openrouter/sdk 1.4.10 → 1.4.12
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/funcs/endUsersCreate.d.ts +19 -0
- package/esm/funcs/endUsersCreate.js +100 -0
- package/esm/funcs/endUsersDelete.d.ts +18 -0
- package/esm/funcs/endUsersDelete.js +103 -0
- package/esm/funcs/endUsersGet.d.ts +19 -0
- package/esm/funcs/endUsersGet.js +103 -0
- package/esm/funcs/endUsersList.d.ts +21 -0
- package/esm/funcs/endUsersList.js +135 -0
- package/esm/funcs/endUsersUpdate.d.ts +19 -0
- package/esm/funcs/endUsersUpdate.js +106 -0
- package/esm/funcs/organizationGetSettings.d.ts +18 -0
- package/esm/funcs/organizationGetSettings.js +96 -0
- package/esm/funcs/organizationUpdateSettings.d.ts +18 -0
- package/esm/funcs/organizationUpdateSettings.js +99 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/createenduserrequest.d.ts +15 -0
- package/esm/models/createenduserrequest.js +13 -0
- package/esm/models/enduser.d.ts +25 -0
- package/esm/models/enduser.js +24 -0
- package/esm/models/enduserresponse.d.ts +11 -0
- package/esm/models/enduserresponse.js +15 -0
- package/esm/models/index.d.ts +7 -0
- package/esm/models/index.js +7 -0
- package/esm/models/listendusersresponse.d.ts +15 -0
- package/esm/models/listendusersresponse.js +21 -0
- package/esm/models/operations/createenduser.d.ts +56 -0
- package/esm/models/operations/createenduser.js +23 -0
- package/esm/models/operations/deleteenduser.d.ts +58 -0
- package/esm/models/operations/deleteenduser.js +21 -0
- package/esm/models/operations/getenduser.d.ts +58 -0
- package/esm/models/operations/getenduser.js +21 -0
- package/esm/models/operations/getorganizationsettings.d.ts +65 -0
- package/esm/models/operations/getorganizationsettings.js +29 -0
- package/esm/models/operations/index.d.ts +7 -0
- package/esm/models/operations/index.js +7 -0
- package/esm/models/operations/listendusers.d.ts +82 -0
- package/esm/models/operations/listendusers.js +38 -0
- package/esm/models/operations/updateenduser.d.ts +61 -0
- package/esm/models/operations/updateenduser.js +24 -0
- package/esm/models/operations/updateorganizationsettings.d.ts +67 -0
- package/esm/models/operations/updateorganizationsettings.js +31 -0
- package/esm/models/organizationsettings.d.ts +17 -0
- package/esm/models/organizationsettings.js +20 -0
- package/esm/models/updateenduserrequest.d.ts +15 -0
- package/esm/models/updateenduserrequest.js +18 -0
- package/esm/models/updateorganizationsettingsrequest.d.ts +15 -0
- package/esm/models/updateorganizationsettingsrequest.js +18 -0
- package/esm/sdk/endusers.d.ts +44 -0
- package/esm/sdk/endusers.js +60 -0
- package/esm/sdk/organization.d.ts +14 -0
- package/esm/sdk/organization.js +21 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7fb2aab2b543
|
|
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 { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
|
+
import { EndUserResponse$inboundSchema as models_EndUserResponse$inboundSchema } from "../models/enduserresponse.js";
|
|
14
|
+
import { UpdateEndUserRequest$outboundSchema as operations_UpdateEndUserRequest$outboundSchema } from "../models/operations/updateenduser.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* Update a registered end user
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Update registration state without changing identity. State changes do not enforce inference access. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
|
+
*/
|
|
22
|
+
export function endUsersUpdate(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations_UpdateEndUserRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = encodeJSON("body", payload.UpdateEndUserRequest, {
|
|
32
|
+
explode: true,
|
|
33
|
+
});
|
|
34
|
+
const pathParams = {
|
|
35
|
+
user: encodeSimple("user", payload.user, {
|
|
36
|
+
explode: false,
|
|
37
|
+
charEncoding: "percent",
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
const path = pathToFunc("/end-users/{user}")(pathParams);
|
|
41
|
+
const headers = new Headers(compactMap({
|
|
42
|
+
"Content-Type": "application/json",
|
|
43
|
+
Accept: "application/json",
|
|
44
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
45
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
46
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
47
|
+
}));
|
|
48
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
49
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
50
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
51
|
+
const context = {
|
|
52
|
+
options: client._options,
|
|
53
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
54
|
+
operationID: "updateEndUser",
|
|
55
|
+
oAuth2Scopes: null,
|
|
56
|
+
resolvedSecurity: requestSecurity,
|
|
57
|
+
securitySource: client._options.apiKey,
|
|
58
|
+
retryConfig: options?.retries
|
|
59
|
+
|| client._options.retryConfig
|
|
60
|
+
|| {
|
|
61
|
+
strategy: "backoff",
|
|
62
|
+
backoff: {
|
|
63
|
+
initialInterval: 500,
|
|
64
|
+
maxInterval: 60000,
|
|
65
|
+
exponent: 1.5,
|
|
66
|
+
maxElapsedTime: 3600000,
|
|
67
|
+
},
|
|
68
|
+
retryConnectionErrors: true,
|
|
69
|
+
}
|
|
70
|
+
|| { strategy: "none" },
|
|
71
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
72
|
+
};
|
|
73
|
+
const requestRes = client._createRequest(context, {
|
|
74
|
+
security: requestSecurity,
|
|
75
|
+
method: "PATCH",
|
|
76
|
+
baseURL: options?.serverURL,
|
|
77
|
+
path: path,
|
|
78
|
+
headers: headers,
|
|
79
|
+
body: body,
|
|
80
|
+
userAgent: client._options.userAgent,
|
|
81
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
82
|
+
}, options);
|
|
83
|
+
if (!requestRes.ok) {
|
|
84
|
+
return [requestRes, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const req = requestRes.value;
|
|
87
|
+
const doResult = await client._do(req, {
|
|
88
|
+
context,
|
|
89
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
90
|
+
retryConfig: context.retryConfig,
|
|
91
|
+
retryCodes: context.retryCodes,
|
|
92
|
+
});
|
|
93
|
+
if (!doResult.ok) {
|
|
94
|
+
return [doResult, { status: "request-error", request: req }];
|
|
95
|
+
}
|
|
96
|
+
const response = doResult.value;
|
|
97
|
+
const responseFields = {
|
|
98
|
+
HttpMeta: { Response: response, Request: req },
|
|
99
|
+
};
|
|
100
|
+
const [result] = await M.match(M.json(200, models_EndUserResponse$inboundSchema), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
101
|
+
if (!result.ok) {
|
|
102
|
+
return [result, { status: "complete", request: req, response }];
|
|
103
|
+
}
|
|
104
|
+
return [result, { status: "complete", request: req, response }];
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=endUsersUpdate.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
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 operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Get organization settings
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Get the settings of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
*/
|
|
17
|
+
export declare function organizationGetSettings(client: OpenRouterCore, request?: operations.GetOrganizationSettingsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetOrganizationSettingsResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=organizationGetSettings.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e3ea6fbd3a31
|
|
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 { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
|
+
import { GetOrganizationSettingsRequest$outboundSchema as operations_GetOrganizationSettingsRequest$outboundSchema, GetOrganizationSettingsResponse$inboundSchema as operations_GetOrganizationSettingsResponse$inboundSchema } from "../models/operations/getorganizationsettings.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
/**
|
|
16
|
+
* Get organization settings
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Get the settings of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
|
+
*/
|
|
21
|
+
export function organizationGetSettings(client, request, options) {
|
|
22
|
+
return new APIPromise($do(client, request, options));
|
|
23
|
+
}
|
|
24
|
+
async function $do(client, request, options) {
|
|
25
|
+
const parsed = safeParse(request, (value) => operations_GetOrganizationSettingsRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
26
|
+
if (!parsed.ok) {
|
|
27
|
+
return [parsed, { status: "invalid" }];
|
|
28
|
+
}
|
|
29
|
+
const payload = parsed.value;
|
|
30
|
+
const body = null;
|
|
31
|
+
const path = pathToFunc("/organization/settings")();
|
|
32
|
+
const headers = new Headers(compactMap({
|
|
33
|
+
Accept: "application/json",
|
|
34
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
35
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload?.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
36
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload?.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
37
|
+
}));
|
|
38
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
39
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
40
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
41
|
+
const context = {
|
|
42
|
+
options: client._options,
|
|
43
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
44
|
+
operationID: "getOrganizationSettings",
|
|
45
|
+
oAuth2Scopes: null,
|
|
46
|
+
resolvedSecurity: requestSecurity,
|
|
47
|
+
securitySource: client._options.apiKey,
|
|
48
|
+
retryConfig: options?.retries
|
|
49
|
+
|| client._options.retryConfig
|
|
50
|
+
|| {
|
|
51
|
+
strategy: "backoff",
|
|
52
|
+
backoff: {
|
|
53
|
+
initialInterval: 500,
|
|
54
|
+
maxInterval: 60000,
|
|
55
|
+
exponent: 1.5,
|
|
56
|
+
maxElapsedTime: 3600000,
|
|
57
|
+
},
|
|
58
|
+
retryConnectionErrors: true,
|
|
59
|
+
}
|
|
60
|
+
|| { strategy: "none" },
|
|
61
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
62
|
+
};
|
|
63
|
+
const requestRes = client._createRequest(context, {
|
|
64
|
+
security: requestSecurity,
|
|
65
|
+
method: "GET",
|
|
66
|
+
baseURL: options?.serverURL,
|
|
67
|
+
path: path,
|
|
68
|
+
headers: headers,
|
|
69
|
+
body: body,
|
|
70
|
+
userAgent: client._options.userAgent,
|
|
71
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
72
|
+
}, options);
|
|
73
|
+
if (!requestRes.ok) {
|
|
74
|
+
return [requestRes, { status: "invalid" }];
|
|
75
|
+
}
|
|
76
|
+
const req = requestRes.value;
|
|
77
|
+
const doResult = await client._do(req, {
|
|
78
|
+
context,
|
|
79
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
80
|
+
retryConfig: context.retryConfig,
|
|
81
|
+
retryCodes: context.retryCodes,
|
|
82
|
+
});
|
|
83
|
+
if (!doResult.ok) {
|
|
84
|
+
return [doResult, { status: "request-error", request: req }];
|
|
85
|
+
}
|
|
86
|
+
const response = doResult.value;
|
|
87
|
+
const responseFields = {
|
|
88
|
+
HttpMeta: { Response: response, Request: req },
|
|
89
|
+
};
|
|
90
|
+
const [result] = await M.match(M.json(200, operations_GetOrganizationSettingsResponse$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
91
|
+
if (!result.ok) {
|
|
92
|
+
return [result, { status: "complete", request: req, response }];
|
|
93
|
+
}
|
|
94
|
+
return [result, { status: "complete", request: req, response }];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=organizationGetSettings.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
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 operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Update organization settings
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Update the settings of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
*/
|
|
17
|
+
export declare function organizationUpdateSettings(client: OpenRouterCore, request: operations.UpdateOrganizationSettingsRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateOrganizationSettingsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=organizationUpdateSettings.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2754b74e3bb3
|
|
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 { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
|
+
import { UpdateOrganizationSettingsRequest$outboundSchema as operations_UpdateOrganizationSettingsRequest$outboundSchema, UpdateOrganizationSettingsResponse$inboundSchema as operations_UpdateOrganizationSettingsResponse$inboundSchema } from "../models/operations/updateorganizationsettings.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
/**
|
|
16
|
+
* Update organization settings
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Update the settings of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
|
+
*/
|
|
21
|
+
export function organizationUpdateSettings(client, request, options) {
|
|
22
|
+
return new APIPromise($do(client, request, options));
|
|
23
|
+
}
|
|
24
|
+
async function $do(client, request, options) {
|
|
25
|
+
const parsed = safeParse(request, (value) => operations_UpdateOrganizationSettingsRequest$outboundSchema.parse(value), "Input validation failed");
|
|
26
|
+
if (!parsed.ok) {
|
|
27
|
+
return [parsed, { status: "invalid" }];
|
|
28
|
+
}
|
|
29
|
+
const payload = parsed.value;
|
|
30
|
+
const body = encodeJSON("body", payload.UpdateOrganizationSettingsRequest, {
|
|
31
|
+
explode: true,
|
|
32
|
+
});
|
|
33
|
+
const path = pathToFunc("/organization/settings")();
|
|
34
|
+
const headers = new Headers(compactMap({
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
38
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
39
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
40
|
+
}));
|
|
41
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
43
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
44
|
+
const context = {
|
|
45
|
+
options: client._options,
|
|
46
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
47
|
+
operationID: "updateOrganizationSettings",
|
|
48
|
+
oAuth2Scopes: null,
|
|
49
|
+
resolvedSecurity: requestSecurity,
|
|
50
|
+
securitySource: client._options.apiKey,
|
|
51
|
+
retryConfig: options?.retries
|
|
52
|
+
|| client._options.retryConfig
|
|
53
|
+
|| {
|
|
54
|
+
strategy: "backoff",
|
|
55
|
+
backoff: {
|
|
56
|
+
initialInterval: 500,
|
|
57
|
+
maxInterval: 60000,
|
|
58
|
+
exponent: 1.5,
|
|
59
|
+
maxElapsedTime: 3600000,
|
|
60
|
+
},
|
|
61
|
+
retryConnectionErrors: true,
|
|
62
|
+
}
|
|
63
|
+
|| { strategy: "none" },
|
|
64
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
65
|
+
};
|
|
66
|
+
const requestRes = client._createRequest(context, {
|
|
67
|
+
security: requestSecurity,
|
|
68
|
+
method: "PATCH",
|
|
69
|
+
baseURL: options?.serverURL,
|
|
70
|
+
path: path,
|
|
71
|
+
headers: headers,
|
|
72
|
+
body: body,
|
|
73
|
+
userAgent: client._options.userAgent,
|
|
74
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
75
|
+
}, options);
|
|
76
|
+
if (!requestRes.ok) {
|
|
77
|
+
return [requestRes, { status: "invalid" }];
|
|
78
|
+
}
|
|
79
|
+
const req = requestRes.value;
|
|
80
|
+
const doResult = await client._do(req, {
|
|
81
|
+
context,
|
|
82
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
83
|
+
retryConfig: context.retryConfig,
|
|
84
|
+
retryCodes: context.retryCodes,
|
|
85
|
+
});
|
|
86
|
+
if (!doResult.ok) {
|
|
87
|
+
return [doResult, { status: "request-error", request: req }];
|
|
88
|
+
}
|
|
89
|
+
const response = doResult.value;
|
|
90
|
+
const responseFields = {
|
|
91
|
+
HttpMeta: { Response: response, Request: req },
|
|
92
|
+
};
|
|
93
|
+
const [result] = await M.match(M.json(200, operations_UpdateOrganizationSettingsResponse$inboundSchema), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
94
|
+
if (!result.ok) {
|
|
95
|
+
return [result, { status: "complete", request: req, response }];
|
|
96
|
+
}
|
|
97
|
+
return [result, { status: "complete", request: req, response }];
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=organizationUpdateSettings.js.map
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.4.
|
|
53
|
+
readonly sdkVersion: "1.4.12";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.4.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.4.12 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.4.
|
|
32
|
+
sdkVersion: "1.4.12",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.4.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.4.12 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type CreateEndUserRequest = {
|
|
3
|
+
/**
|
|
4
|
+
* Immutable case-sensitive tracking string supplied as user on inference requests. URL-encode it in resource paths.
|
|
5
|
+
*/
|
|
6
|
+
user: string;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export type CreateEndUserRequest$Outbound = {
|
|
10
|
+
user: string;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const CreateEndUserRequest$outboundSchema: z.ZodType<CreateEndUserRequest$Outbound, CreateEndUserRequest>;
|
|
14
|
+
export declare function createEndUserRequestToJSON(createEndUserRequest: CreateEndUserRequest): string;
|
|
15
|
+
//# sourceMappingURL=createenduserrequest.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ff82d51467ad
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const CreateEndUserRequest$outboundSchema = z.object({
|
|
8
|
+
user: z.string(),
|
|
9
|
+
});
|
|
10
|
+
export function createEndUserRequestToJSON(createEndUserRequest) {
|
|
11
|
+
return JSON.stringify(CreateEndUserRequest$outboundSchema.parse(createEndUserRequest));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=createenduserrequest.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type EndUser = {
|
|
5
|
+
/**
|
|
6
|
+
* Registration creation time.
|
|
7
|
+
*/
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
/**
|
|
10
|
+
* Whether this registration is active. Not an inference authorization decision.
|
|
11
|
+
*/
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Last registration lifecycle update time.
|
|
15
|
+
*/
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Immutable case-sensitive tracking string supplied as user on inference requests. URL-encode it in resource paths.
|
|
19
|
+
*/
|
|
20
|
+
user: string;
|
|
21
|
+
};
|
|
22
|
+
/** @internal */
|
|
23
|
+
export declare const EndUser$inboundSchema: z.ZodType<EndUser, unknown>;
|
|
24
|
+
export declare function endUserFromJSON(jsonString: string): SafeParseResult<EndUser, SDKValidationError>;
|
|
25
|
+
//# sourceMappingURL=enduser.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f0f7f996359a
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const EndUser$inboundSchema = z.object({
|
|
10
|
+
created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
|
|
11
|
+
is_active: z.boolean(),
|
|
12
|
+
updated_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
|
|
13
|
+
user: z.string(),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"created_at": "createdAt",
|
|
17
|
+
"is_active": "isActive",
|
|
18
|
+
"updated_at": "updatedAt",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function endUserFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => EndUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EndUser' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=enduser.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { EndUser } from "./enduser.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export type EndUserResponse = {
|
|
6
|
+
data: EndUser;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const EndUserResponse$inboundSchema: z.ZodType<EndUserResponse, unknown>;
|
|
10
|
+
export declare function endUserResponseFromJSON(jsonString: string): SafeParseResult<EndUserResponse, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=enduserresponse.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8e60bf584de3
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { EndUser$inboundSchema } from "./enduser.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const EndUserResponse$inboundSchema = z.object({
|
|
10
|
+
data: EndUser$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
export function endUserResponseFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => EndUserResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EndUserResponse' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=enduserresponse.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -260,6 +260,7 @@ export * from "./contextcompressionplugin.js";
|
|
|
260
260
|
export * from "./costdetails.js";
|
|
261
261
|
export * from "./createbyokkeyrequest.js";
|
|
262
262
|
export * from "./createbyokkeyresponse.js";
|
|
263
|
+
export * from "./createenduserrequest.js";
|
|
263
264
|
export * from "./createguardrailrequest.js";
|
|
264
265
|
export * from "./createguardrailresponse.js";
|
|
265
266
|
export * from "./createinternrequest.js";
|
|
@@ -305,6 +306,8 @@ export * from "./edgenetworktimeoutresponseerrordata.js";
|
|
|
305
306
|
export * from "./endpointinfo.js";
|
|
306
307
|
export * from "./endpointsmetadata.js";
|
|
307
308
|
export * from "./endpointstatus.js";
|
|
309
|
+
export * from "./enduser.js";
|
|
310
|
+
export * from "./enduserresponse.js";
|
|
308
311
|
export * from "./enumcapability.js";
|
|
309
312
|
export * from "./errorevent.js";
|
|
310
313
|
export * from "./failabletoolcallstatus.js";
|
|
@@ -441,6 +444,7 @@ export * from "./legacychatcontentvideoinput.js";
|
|
|
441
444
|
export * from "./legacywebsearchservertool.js";
|
|
442
445
|
export * from "./listbyokkeysresponse.js";
|
|
443
446
|
export * from "./listendpointsresponse.js";
|
|
447
|
+
export * from "./listendusersresponse.js";
|
|
444
448
|
export * from "./listguardrailsresponse.js";
|
|
445
449
|
export * from "./listkeyassignmentsresponse.js";
|
|
446
450
|
export * from "./listmemberassignmentsresponse.js";
|
|
@@ -548,6 +552,7 @@ export * from "./oranthropicnullablecaller.js";
|
|
|
548
552
|
export * from "./oranthropicservertooluseblock.js";
|
|
549
553
|
export * from "./oranthropicshelltoolresult.js";
|
|
550
554
|
export * from "./oranthropicstopreason.js";
|
|
555
|
+
export * from "./organizationsettings.js";
|
|
551
556
|
export * from "./outputadvisorservertoolitem.js";
|
|
552
557
|
export * from "./outputapplypatchcallitem.js";
|
|
553
558
|
export * from "./outputapplypatchservertoolitem.js";
|
|
@@ -776,11 +781,13 @@ export * from "./unifiedbenchmarkssearchrunconfig.js";
|
|
|
776
781
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
777
782
|
export * from "./updatebyokkeyrequest.js";
|
|
778
783
|
export * from "./updatebyokkeyresponse.js";
|
|
784
|
+
export * from "./updateenduserrequest.js";
|
|
779
785
|
export * from "./updateguardrailrequest.js";
|
|
780
786
|
export * from "./updateguardrailresponse.js";
|
|
781
787
|
export * from "./updateinternrequest.js";
|
|
782
788
|
export * from "./updateobservabilitydestinationrequest.js";
|
|
783
789
|
export * from "./updateobservabilitydestinationresponse.js";
|
|
790
|
+
export * from "./updateorganizationsettingsrequest.js";
|
|
784
791
|
export * from "./updateprivateendpointpricingrequest.js";
|
|
785
792
|
export * from "./updateprivateendpointrequest.js";
|
|
786
793
|
export * from "./updatescimgroupmappingrequest.js";
|
package/esm/models/index.js
CHANGED
|
@@ -264,6 +264,7 @@ export * from "./contextcompressionplugin.js";
|
|
|
264
264
|
export * from "./costdetails.js";
|
|
265
265
|
export * from "./createbyokkeyrequest.js";
|
|
266
266
|
export * from "./createbyokkeyresponse.js";
|
|
267
|
+
export * from "./createenduserrequest.js";
|
|
267
268
|
export * from "./createguardrailrequest.js";
|
|
268
269
|
export * from "./createguardrailresponse.js";
|
|
269
270
|
export * from "./createinternrequest.js";
|
|
@@ -309,6 +310,8 @@ export * from "./edgenetworktimeoutresponseerrordata.js";
|
|
|
309
310
|
export * from "./endpointinfo.js";
|
|
310
311
|
export * from "./endpointsmetadata.js";
|
|
311
312
|
export * from "./endpointstatus.js";
|
|
313
|
+
export * from "./enduser.js";
|
|
314
|
+
export * from "./enduserresponse.js";
|
|
312
315
|
export * from "./enumcapability.js";
|
|
313
316
|
export * from "./errorevent.js";
|
|
314
317
|
export * from "./failabletoolcallstatus.js";
|
|
@@ -445,6 +448,7 @@ export * from "./legacychatcontentvideoinput.js";
|
|
|
445
448
|
export * from "./legacywebsearchservertool.js";
|
|
446
449
|
export * from "./listbyokkeysresponse.js";
|
|
447
450
|
export * from "./listendpointsresponse.js";
|
|
451
|
+
export * from "./listendusersresponse.js";
|
|
448
452
|
export * from "./listguardrailsresponse.js";
|
|
449
453
|
export * from "./listkeyassignmentsresponse.js";
|
|
450
454
|
export * from "./listmemberassignmentsresponse.js";
|
|
@@ -552,6 +556,7 @@ export * from "./oranthropicnullablecaller.js";
|
|
|
552
556
|
export * from "./oranthropicservertooluseblock.js";
|
|
553
557
|
export * from "./oranthropicshelltoolresult.js";
|
|
554
558
|
export * from "./oranthropicstopreason.js";
|
|
559
|
+
export * from "./organizationsettings.js";
|
|
555
560
|
export * from "./outputadvisorservertoolitem.js";
|
|
556
561
|
export * from "./outputapplypatchcallitem.js";
|
|
557
562
|
export * from "./outputapplypatchservertoolitem.js";
|
|
@@ -780,11 +785,13 @@ export * from "./unifiedbenchmarkssearchrunconfig.js";
|
|
|
780
785
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
781
786
|
export * from "./updatebyokkeyrequest.js";
|
|
782
787
|
export * from "./updatebyokkeyresponse.js";
|
|
788
|
+
export * from "./updateenduserrequest.js";
|
|
783
789
|
export * from "./updateguardrailrequest.js";
|
|
784
790
|
export * from "./updateguardrailresponse.js";
|
|
785
791
|
export * from "./updateinternrequest.js";
|
|
786
792
|
export * from "./updateobservabilitydestinationrequest.js";
|
|
787
793
|
export * from "./updateobservabilitydestinationresponse.js";
|
|
794
|
+
export * from "./updateorganizationsettingsrequest.js";
|
|
788
795
|
export * from "./updateprivateendpointpricingrequest.js";
|
|
789
796
|
export * from "./updateprivateendpointrequest.js";
|
|
790
797
|
export * from "./updatescimgroupmappingrequest.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { EndUser } from "./enduser.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export type ListEndUsersResponse = {
|
|
6
|
+
data: Array<EndUser>;
|
|
7
|
+
/**
|
|
8
|
+
* Number of registrations matching the filters before pagination.
|
|
9
|
+
*/
|
|
10
|
+
totalCount: number;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const ListEndUsersResponse$inboundSchema: z.ZodType<ListEndUsersResponse, unknown>;
|
|
14
|
+
export declare function listEndUsersResponseFromJSON(jsonString: string): SafeParseResult<ListEndUsersResponse, SDKValidationError>;
|
|
15
|
+
//# sourceMappingURL=listendusersresponse.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: dc07ec7c7cd3
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { EndUser$inboundSchema } from "./enduser.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const ListEndUsersResponse$inboundSchema = z.object({
|
|
11
|
+
data: z.array(EndUser$inboundSchema),
|
|
12
|
+
total_count: z.int(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
"total_count": "totalCount",
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
export function listEndUsersResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => ListEndUsersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListEndUsersResponse' from JSON`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=listendusersresponse.js.map
|