@openrouter/sdk 1.5.83 → 1.5.85
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/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +1 -1
- package/esm/funcs/endpointsList.d.ts +1 -1
- package/esm/funcs/endpointsList.js +2 -2
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +1 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +2 -2
- package/esm/funcs/guardrailPoliciesListBudgetPolicies.d.ts +1 -1
- package/esm/funcs/guardrailPoliciesListBudgetPolicies.js +7 -7
- package/esm/funcs/guardrailPoliciesListModelAvailabilityPolicies.d.ts +1 -1
- package/esm/funcs/guardrailPoliciesListModelAvailabilityPolicies.js +8 -7
- package/esm/funcs/guardrailPoliciesListModerationPolicies.d.ts +1 -1
- package/esm/funcs/guardrailPoliciesListModerationPolicies.js +7 -7
- package/esm/funcs/guardrailsListKeyAssignments.js +1 -0
- package/esm/funcs/guardrailsListMemberAssignments.js +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/changeguardrailpolicyassignmentrequest.d.ts +3 -3
- package/esm/models/changeguardrailpolicyassignmentrequest.js +1 -1
- package/esm/models/createbudgetguardrailpolicyrequest.d.ts +3 -3
- package/esm/models/createbudgetguardrailpolicyrequest.js +1 -1
- package/esm/models/createmodelavailabilityguardrailpolicyrequest.d.ts +3 -3
- package/esm/models/createmodelavailabilityguardrailpolicyrequest.js +1 -1
- package/esm/models/createmoderationguardrailpolicyrequest.d.ts +3 -3
- package/esm/models/createmoderationguardrailpolicyrequest.js +1 -1
- package/esm/models/operations/deletebudgetpolicy.d.ts +3 -3
- package/esm/models/operations/deletebudgetpolicy.js +1 -1
- package/esm/models/operations/deletemodelavailabilitypolicy.d.ts +3 -3
- package/esm/models/operations/deletemodelavailabilitypolicy.js +1 -1
- package/esm/models/operations/deletemoderationpolicy.d.ts +3 -3
- package/esm/models/operations/deletemoderationpolicy.js +1 -1
- package/esm/models/operations/getapikeypolicyassignment.d.ts +3 -3
- package/esm/models/operations/getapikeypolicyassignment.js +1 -1
- package/esm/models/operations/getbudgetpolicy.d.ts +3 -3
- package/esm/models/operations/getbudgetpolicy.js +1 -1
- package/esm/models/operations/getmemberpolicyassignment.d.ts +3 -3
- package/esm/models/operations/getmemberpolicyassignment.js +1 -1
- package/esm/models/operations/getmodelavailabilitypolicy.d.ts +3 -3
- package/esm/models/operations/getmodelavailabilitypolicy.js +1 -1
- package/esm/models/operations/getmoderationpolicy.d.ts +3 -3
- package/esm/models/operations/getmoderationpolicy.js +1 -1
- package/esm/models/operations/listbudgetpolicies.d.ts +3 -3
- package/esm/models/operations/listbudgetpolicies.js +1 -1
- package/esm/models/operations/listkeyassignments.d.ts +5 -0
- package/esm/models/operations/listkeyassignments.js +2 -0
- package/esm/models/operations/listmemberassignments.d.ts +5 -0
- package/esm/models/operations/listmemberassignments.js +2 -0
- package/esm/models/operations/listmodelavailabilitypolicies.d.ts +3 -3
- package/esm/models/operations/listmodelavailabilitypolicies.js +1 -1
- package/esm/models/operations/listmoderationpolicies.d.ts +3 -3
- package/esm/models/operations/listmoderationpolicies.js +1 -1
- package/esm/models/operations/updatekeys.d.ts +1 -1
- package/esm/models/updatebudgetguardrailpolicyrequest.d.ts +3 -3
- package/esm/models/updatebudgetguardrailpolicyrequest.js +1 -1
- package/esm/models/updatemodelavailabilityguardrailpolicyrequest.d.ts +3 -3
- package/esm/models/updatemodelavailabilityguardrailpolicyrequest.js +1 -1
- package/esm/models/updatemoderationguardrailpolicyrequest.d.ts +3 -3
- package/esm/models/updatemoderationguardrailpolicyrequest.js +1 -1
- package/esm/sdk/analytics.d.ts +1 -1
- package/esm/sdk/analytics.js +1 -1
- package/esm/sdk/guardrailpolicies.d.ts +3 -3
- package/jsr.json +1 -1
- package/package.json +4 -4
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Get user activity grouped by endpoint
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function analyticsGetUserActivity(client: OpenRouterCore, request?: operations.GetUserActivityRequest | undefined, options?: RequestOptions): APIPromise<Result<models.ActivityResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=analyticsGetUserActivity.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
17
17
|
* Get user activity grouped by endpoint
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
|
+
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
21
|
*/
|
|
22
22
|
export function analyticsGetUserActivity(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
|
@@ -11,5 +11,5 @@ import { Result } from "../types/fp.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* List all endpoints for a model
|
|
13
13
|
*/
|
|
14
|
-
export declare function endpointsList(client: OpenRouterCore, request: operations.ListEndpointsRequest, options?: RequestOptions): APIPromise<Result<operations.ListEndpointsResponse, errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
export declare function endpointsList(client: OpenRouterCore, request: operations.ListEndpointsRequest, options?: RequestOptions): APIPromise<Result<operations.ListEndpointsResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
15
|
//# sourceMappingURL=endpointsList.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
|
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.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 { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js";
|
|
12
|
+
import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.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 { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
13
|
import { ListEndpointsRequest$outboundSchema as operations_ListEndpointsRequest$outboundSchema, ListEndpointsResponse$inboundSchema as operations_ListEndpointsResponse$inboundSchema } from "../models/operations/listendpoints.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
15
|
/**
|
|
@@ -94,7 +94,7 @@ async function $do(client, request, options) {
|
|
|
94
94
|
const responseFields = {
|
|
95
95
|
HttpMeta: { Response: response, Request: req },
|
|
96
96
|
};
|
|
97
|
-
const [result] = await M.match(M.json(200, operations_ListEndpointsResponse$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
97
|
+
const [result] = await M.match(M.json(200, operations_ListEndpointsResponse$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
98
98
|
if (!result.ok) {
|
|
99
99
|
return [result, { status: "complete", request: req, response }];
|
|
100
100
|
}
|
|
@@ -11,5 +11,5 @@ import { Result } from "../types/fp.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* Preview the impact of ZDR on the available endpoints
|
|
13
13
|
*/
|
|
14
|
-
export declare function endpointsListZdrEndpoints(client: OpenRouterCore, request?: operations.ListEndpointsZdrRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListEndpointsZdrResponse, errors.ForbiddenResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
export declare function endpointsListZdrEndpoints(client: OpenRouterCore, request?: operations.ListEndpointsZdrRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListEndpointsZdrResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
15
|
//# sourceMappingURL=endpointsListZdrEndpoints.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
|
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js";
|
|
12
|
+
import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
13
|
import { ListEndpointsZdrRequest$outboundSchema as operations_ListEndpointsZdrRequest$outboundSchema, ListEndpointsZdrResponse$inboundSchema as operations_ListEndpointsZdrResponse$inboundSchema } from "../models/operations/listendpointszdr.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
15
|
/**
|
|
@@ -84,7 +84,7 @@ async function $do(client, request, options) {
|
|
|
84
84
|
const responseFields = {
|
|
85
85
|
HttpMeta: { Response: response, Request: req },
|
|
86
86
|
};
|
|
87
|
-
const [result] = await M.match(M.json(200, operations_ListEndpointsZdrResponse$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
87
|
+
const [result] = await M.match(M.json(200, operations_ListEndpointsZdrResponse$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
88
88
|
if (!result.ok) {
|
|
89
89
|
return [result, { status: "complete", request: req, response }];
|
|
90
90
|
}
|
|
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
|
-
export declare function guardrailPoliciesListBudgetPolicies(client: OpenRouterCore, request
|
|
18
|
+
export declare function guardrailPoliciesListBudgetPolicies(client: OpenRouterCore, request?: operations.ListBudgetPoliciesRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListBudgetPoliciesResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
offset: number;
|
|
20
20
|
}>>;
|
|
21
21
|
//# sourceMappingURL=guardrailPoliciesListBudgetPolicies.d.ts.map
|
|
@@ -23,7 +23,7 @@ export function guardrailPoliciesListBudgetPolicies(client, request, options) {
|
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
|
24
24
|
}
|
|
25
25
|
async function $do(client, request, options) {
|
|
26
|
-
const parsed = safeParse(request, (value) => operations_ListBudgetPoliciesRequest$outboundSchema.parse(value), "Input validation failed");
|
|
26
|
+
const parsed = safeParse(request, (value) => operations_ListBudgetPoliciesRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
27
27
|
if (!parsed.ok) {
|
|
28
28
|
return [haltIterator(parsed), { status: "invalid" }];
|
|
29
29
|
}
|
|
@@ -31,15 +31,15 @@ async function $do(client, request, options) {
|
|
|
31
31
|
const body = null;
|
|
32
32
|
const path = pathToFunc("/guardrails/policies/budget")();
|
|
33
33
|
const query = encodeFormQuery({
|
|
34
|
-
"limit": payload
|
|
35
|
-
"offset": payload
|
|
36
|
-
"workspace_id": payload
|
|
34
|
+
"limit": payload?.limit,
|
|
35
|
+
"offset": payload?.offset,
|
|
36
|
+
"workspace_id": payload?.workspace_id,
|
|
37
37
|
});
|
|
38
38
|
const headers = new Headers(compactMap({
|
|
39
39
|
Accept: "application/json",
|
|
40
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload
|
|
42
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload?.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
42
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload?.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
43
43
|
}));
|
|
44
44
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
45
45
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* List the model availability policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
|
-
export declare function guardrailPoliciesListModelAvailabilityPolicies(client: OpenRouterCore, request
|
|
18
|
+
export declare function guardrailPoliciesListModelAvailabilityPolicies(client: OpenRouterCore, request?: operations.ListModelAvailabilityPoliciesRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListModelAvailabilityPoliciesResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
offset: number;
|
|
20
20
|
}>>;
|
|
21
21
|
//# sourceMappingURL=guardrailPoliciesListModelAvailabilityPolicies.d.ts.map
|
|
@@ -23,7 +23,8 @@ export function guardrailPoliciesListModelAvailabilityPolicies(client, request,
|
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
|
24
24
|
}
|
|
25
25
|
async function $do(client, request, options) {
|
|
26
|
-
const parsed = safeParse(request, (value) => operations_ListModelAvailabilityPoliciesRequest$outboundSchema.
|
|
26
|
+
const parsed = safeParse(request, (value) => operations_ListModelAvailabilityPoliciesRequest$outboundSchema.optional()
|
|
27
|
+
.parse(value), "Input validation failed");
|
|
27
28
|
if (!parsed.ok) {
|
|
28
29
|
return [haltIterator(parsed), { status: "invalid" }];
|
|
29
30
|
}
|
|
@@ -31,15 +32,15 @@ async function $do(client, request, options) {
|
|
|
31
32
|
const body = null;
|
|
32
33
|
const path = pathToFunc("/guardrails/policies/model-availability")();
|
|
33
34
|
const query = encodeFormQuery({
|
|
34
|
-
"limit": payload
|
|
35
|
-
"offset": payload
|
|
36
|
-
"workspace_id": payload
|
|
35
|
+
"limit": payload?.limit,
|
|
36
|
+
"offset": payload?.offset,
|
|
37
|
+
"workspace_id": payload?.workspace_id,
|
|
37
38
|
});
|
|
38
39
|
const headers = new Headers(compactMap({
|
|
39
40
|
Accept: "application/json",
|
|
40
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload
|
|
42
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload
|
|
41
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { 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" }),
|
|
43
44
|
}));
|
|
44
45
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
45
46
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* List the moderation policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
|
-
export declare function guardrailPoliciesListModerationPolicies(client: OpenRouterCore, request
|
|
18
|
+
export declare function guardrailPoliciesListModerationPolicies(client: OpenRouterCore, request?: operations.ListModerationPoliciesRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListModerationPoliciesResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
offset: number;
|
|
20
20
|
}>>;
|
|
21
21
|
//# sourceMappingURL=guardrailPoliciesListModerationPolicies.d.ts.map
|
|
@@ -23,7 +23,7 @@ export function guardrailPoliciesListModerationPolicies(client, request, options
|
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
|
24
24
|
}
|
|
25
25
|
async function $do(client, request, options) {
|
|
26
|
-
const parsed = safeParse(request, (value) => operations_ListModerationPoliciesRequest$outboundSchema.parse(value), "Input validation failed");
|
|
26
|
+
const parsed = safeParse(request, (value) => operations_ListModerationPoliciesRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
27
27
|
if (!parsed.ok) {
|
|
28
28
|
return [haltIterator(parsed), { status: "invalid" }];
|
|
29
29
|
}
|
|
@@ -31,15 +31,15 @@ async function $do(client, request, options) {
|
|
|
31
31
|
const body = null;
|
|
32
32
|
const path = pathToFunc("/guardrails/policies/moderation")();
|
|
33
33
|
const query = encodeFormQuery({
|
|
34
|
-
"limit": payload
|
|
35
|
-
"offset": payload
|
|
36
|
-
"workspace_id": payload
|
|
34
|
+
"limit": payload?.limit,
|
|
35
|
+
"offset": payload?.offset,
|
|
36
|
+
"workspace_id": payload?.workspace_id,
|
|
37
37
|
});
|
|
38
38
|
const headers = new Headers(compactMap({
|
|
39
39
|
Accept: "application/json",
|
|
40
|
-
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
-
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload
|
|
42
|
-
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload?.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
42
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload?.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
43
43
|
}));
|
|
44
44
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
45
45
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -33,6 +33,7 @@ async function $do(client, request, options) {
|
|
|
33
33
|
const query = encodeFormQuery({
|
|
34
34
|
"limit": payload?.limit,
|
|
35
35
|
"offset": payload?.offset,
|
|
36
|
+
"workspace_id": payload?.workspace_id,
|
|
36
37
|
});
|
|
37
38
|
const headers = new Headers(compactMap({
|
|
38
39
|
Accept: "application/json",
|
|
@@ -33,6 +33,7 @@ async function $do(client, request, options) {
|
|
|
33
33
|
const query = encodeFormQuery({
|
|
34
34
|
"limit": payload?.limit,
|
|
35
35
|
"offset": payload?.offset,
|
|
36
|
+
"workspace_id": payload?.workspace_id,
|
|
36
37
|
});
|
|
37
38
|
const headers = new Headers(compactMap({
|
|
38
39
|
Accept: "application/json",
|
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.5.
|
|
53
|
+
readonly sdkVersion: "1.5.85";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.85 2.950.13 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.5.
|
|
32
|
+
sdkVersion: "1.5.85",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.85 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -29,9 +29,9 @@ export type ChangeGuardrailPolicyAssignmentRequest = {
|
|
|
29
29
|
*/
|
|
30
30
|
policyType: ChangeGuardrailPolicyAssignmentRequestPolicyType;
|
|
31
31
|
/**
|
|
32
|
-
* Workspace the policy belongs to
|
|
32
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
33
33
|
*/
|
|
34
|
-
workspaceId
|
|
34
|
+
workspaceId?: string | undefined;
|
|
35
35
|
};
|
|
36
36
|
/** @internal */
|
|
37
37
|
export declare const ChangeGuardrailPolicyAssignmentRequestPolicyType$outboundSchema: z.ZodType<string, ChangeGuardrailPolicyAssignmentRequestPolicyType>;
|
|
@@ -41,7 +41,7 @@ export type ChangeGuardrailPolicyAssignmentRequest$Outbound = {
|
|
|
41
41
|
expected_assignment: GuardrailPolicyAssignmentState$Outbound;
|
|
42
42
|
policy_id: string;
|
|
43
43
|
policy_type: string;
|
|
44
|
-
workspace_id
|
|
44
|
+
workspace_id?: string | undefined;
|
|
45
45
|
};
|
|
46
46
|
/** @internal */
|
|
47
47
|
export declare const ChangeGuardrailPolicyAssignmentRequest$outboundSchema: z.ZodType<ChangeGuardrailPolicyAssignmentRequest$Outbound, ChangeGuardrailPolicyAssignmentRequest>;
|
|
@@ -23,7 +23,7 @@ export const ChangeGuardrailPolicyAssignmentRequest$outboundSchema = z.object({
|
|
|
23
23
|
expectedAssignment: GuardrailPolicyAssignmentState$outboundSchema,
|
|
24
24
|
policyId: z.string(),
|
|
25
25
|
policyType: ChangeGuardrailPolicyAssignmentRequestPolicyType$outboundSchema,
|
|
26
|
-
workspaceId: z.string(),
|
|
26
|
+
workspaceId: z.string().optional(),
|
|
27
27
|
}).transform((v) => {
|
|
28
28
|
return remap$(v, {
|
|
29
29
|
expectedAssignment: "expected_assignment",
|
|
@@ -33,9 +33,9 @@ export type CreateBudgetGuardrailPolicyRequest = {
|
|
|
33
33
|
optedOutMemberIds?: Array<string> | undefined;
|
|
34
34
|
policyType: CreateBudgetGuardrailPolicyRequestPolicyType;
|
|
35
35
|
/**
|
|
36
|
-
* Workspace the policy belongs to
|
|
36
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
37
37
|
*/
|
|
38
|
-
workspaceId
|
|
38
|
+
workspaceId?: string | undefined;
|
|
39
39
|
};
|
|
40
40
|
/** @internal */
|
|
41
41
|
export declare const CreateBudgetGuardrailPolicyRequestPolicyType$outboundSchema: z.ZodEnum<typeof CreateBudgetGuardrailPolicyRequestPolicyType>;
|
|
@@ -49,7 +49,7 @@ export type CreateBudgetGuardrailPolicyRequest$Outbound = {
|
|
|
49
49
|
opted_out_api_key_hashes?: Array<string> | undefined;
|
|
50
50
|
opted_out_member_ids?: Array<string> | undefined;
|
|
51
51
|
policy_type: string;
|
|
52
|
-
workspace_id
|
|
52
|
+
workspace_id?: string | undefined;
|
|
53
53
|
};
|
|
54
54
|
/** @internal */
|
|
55
55
|
export declare const CreateBudgetGuardrailPolicyRequest$outboundSchema: z.ZodType<CreateBudgetGuardrailPolicyRequest$Outbound, CreateBudgetGuardrailPolicyRequest>;
|
|
@@ -20,7 +20,7 @@ export const CreateBudgetGuardrailPolicyRequest$outboundSchema = z.object({
|
|
|
20
20
|
optedOutApiKeyHashes: z.array(z.string()).optional(),
|
|
21
21
|
optedOutMemberIds: z.array(z.string()).optional(),
|
|
22
22
|
policyType: CreateBudgetGuardrailPolicyRequestPolicyType$outboundSchema,
|
|
23
|
-
workspaceId: z.string(),
|
|
23
|
+
workspaceId: z.string().optional(),
|
|
24
24
|
}).transform((v) => {
|
|
25
25
|
return remap$(v, {
|
|
26
26
|
apiKeyHashes: "api_key_hashes",
|
|
@@ -33,9 +33,9 @@ export type CreateModelAvailabilityGuardrailPolicyRequest = {
|
|
|
33
33
|
optedOutMemberIds?: Array<string> | undefined;
|
|
34
34
|
policyType: CreateModelAvailabilityGuardrailPolicyRequestPolicyType;
|
|
35
35
|
/**
|
|
36
|
-
* Workspace the policy belongs to
|
|
36
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
37
37
|
*/
|
|
38
|
-
workspaceId
|
|
38
|
+
workspaceId?: string | undefined;
|
|
39
39
|
};
|
|
40
40
|
/** @internal */
|
|
41
41
|
export declare const CreateModelAvailabilityGuardrailPolicyRequestPolicyType$outboundSchema: z.ZodEnum<typeof CreateModelAvailabilityGuardrailPolicyRequestPolicyType>;
|
|
@@ -49,7 +49,7 @@ export type CreateModelAvailabilityGuardrailPolicyRequest$Outbound = {
|
|
|
49
49
|
opted_out_api_key_hashes?: Array<string> | undefined;
|
|
50
50
|
opted_out_member_ids?: Array<string> | undefined;
|
|
51
51
|
policy_type: string;
|
|
52
|
-
workspace_id
|
|
52
|
+
workspace_id?: string | undefined;
|
|
53
53
|
};
|
|
54
54
|
/** @internal */
|
|
55
55
|
export declare const CreateModelAvailabilityGuardrailPolicyRequest$outboundSchema: z.ZodType<CreateModelAvailabilityGuardrailPolicyRequest$Outbound, CreateModelAvailabilityGuardrailPolicyRequest>;
|
|
@@ -21,7 +21,7 @@ export const CreateModelAvailabilityGuardrailPolicyRequest$outboundSchema = z.ob
|
|
|
21
21
|
optedOutApiKeyHashes: z.array(z.string()).optional(),
|
|
22
22
|
optedOutMemberIds: z.array(z.string()).optional(),
|
|
23
23
|
policyType: CreateModelAvailabilityGuardrailPolicyRequestPolicyType$outboundSchema,
|
|
24
|
-
workspaceId: z.string(),
|
|
24
|
+
workspaceId: z.string().optional(),
|
|
25
25
|
}).transform((v) => {
|
|
26
26
|
return remap$(v, {
|
|
27
27
|
apiKeyHashes: "api_key_hashes",
|
|
@@ -33,9 +33,9 @@ export type CreateModerationGuardrailPolicyRequest = {
|
|
|
33
33
|
optedOutMemberIds?: Array<string> | undefined;
|
|
34
34
|
policyType: CreateModerationGuardrailPolicyRequestPolicyType;
|
|
35
35
|
/**
|
|
36
|
-
* Workspace the policy belongs to
|
|
36
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
37
37
|
*/
|
|
38
|
-
workspaceId
|
|
38
|
+
workspaceId?: string | undefined;
|
|
39
39
|
};
|
|
40
40
|
/** @internal */
|
|
41
41
|
export declare const CreateModerationGuardrailPolicyRequestPolicyType$outboundSchema: z.ZodEnum<typeof CreateModerationGuardrailPolicyRequestPolicyType>;
|
|
@@ -49,7 +49,7 @@ export type CreateModerationGuardrailPolicyRequest$Outbound = {
|
|
|
49
49
|
opted_out_api_key_hashes?: Array<string> | undefined;
|
|
50
50
|
opted_out_member_ids?: Array<string> | undefined;
|
|
51
51
|
policy_type: string;
|
|
52
|
-
workspace_id
|
|
52
|
+
workspace_id?: string | undefined;
|
|
53
53
|
};
|
|
54
54
|
/** @internal */
|
|
55
55
|
export declare const CreateModerationGuardrailPolicyRequest$outboundSchema: z.ZodType<CreateModerationGuardrailPolicyRequest$Outbound, CreateModerationGuardrailPolicyRequest>;
|
|
@@ -20,7 +20,7 @@ export const CreateModerationGuardrailPolicyRequest$outboundSchema = z.object({
|
|
|
20
20
|
optedOutApiKeyHashes: z.array(z.string()).optional(),
|
|
21
21
|
optedOutMemberIds: z.array(z.string()).optional(),
|
|
22
22
|
policyType: CreateModerationGuardrailPolicyRequestPolicyType$outboundSchema,
|
|
23
|
-
workspaceId: z.string(),
|
|
23
|
+
workspaceId: z.string().optional(),
|
|
24
24
|
}).transform((v) => {
|
|
25
25
|
return remap$(v, {
|
|
26
26
|
apiKeyHashes: "api_key_hashes",
|
|
@@ -45,9 +45,9 @@ export type DeleteBudgetPolicyRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
id: string;
|
|
47
47
|
/**
|
|
48
|
-
* Workspace the policy belongs to
|
|
48
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
49
49
|
*/
|
|
50
|
-
workspaceId
|
|
50
|
+
workspaceId?: string | undefined;
|
|
51
51
|
};
|
|
52
52
|
/** @internal */
|
|
53
53
|
export type DeleteBudgetPolicyRequest$Outbound = {
|
|
@@ -55,7 +55,7 @@ export type DeleteBudgetPolicyRequest$Outbound = {
|
|
|
55
55
|
appTitle?: string | undefined;
|
|
56
56
|
appCategories?: string | undefined;
|
|
57
57
|
id: string;
|
|
58
|
-
workspace_id
|
|
58
|
+
workspace_id?: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const DeleteBudgetPolicyRequest$outboundSchema: z.ZodType<DeleteBudgetPolicyRequest$Outbound, DeleteBudgetPolicyRequest>;
|
|
@@ -10,7 +10,7 @@ export const DeleteBudgetPolicyRequest$outboundSchema = z.object({
|
|
|
10
10
|
appTitle: z.string().optional(),
|
|
11
11
|
appCategories: z.string().optional(),
|
|
12
12
|
id: z.string(),
|
|
13
|
-
workspaceId: z.string(),
|
|
13
|
+
workspaceId: z.string().optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
httpReferer: "HTTP-Referer",
|
|
@@ -45,9 +45,9 @@ export type DeleteModelAvailabilityPolicyRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
id: string;
|
|
47
47
|
/**
|
|
48
|
-
* Workspace the policy belongs to
|
|
48
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
49
49
|
*/
|
|
50
|
-
workspaceId
|
|
50
|
+
workspaceId?: string | undefined;
|
|
51
51
|
};
|
|
52
52
|
/** @internal */
|
|
53
53
|
export type DeleteModelAvailabilityPolicyRequest$Outbound = {
|
|
@@ -55,7 +55,7 @@ export type DeleteModelAvailabilityPolicyRequest$Outbound = {
|
|
|
55
55
|
appTitle?: string | undefined;
|
|
56
56
|
appCategories?: string | undefined;
|
|
57
57
|
id: string;
|
|
58
|
-
workspace_id
|
|
58
|
+
workspace_id?: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const DeleteModelAvailabilityPolicyRequest$outboundSchema: z.ZodType<DeleteModelAvailabilityPolicyRequest$Outbound, DeleteModelAvailabilityPolicyRequest>;
|
|
@@ -10,7 +10,7 @@ export const DeleteModelAvailabilityPolicyRequest$outboundSchema = z.object({
|
|
|
10
10
|
appTitle: z.string().optional(),
|
|
11
11
|
appCategories: z.string().optional(),
|
|
12
12
|
id: z.string(),
|
|
13
|
-
workspaceId: z.string(),
|
|
13
|
+
workspaceId: z.string().optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
httpReferer: "HTTP-Referer",
|
|
@@ -45,9 +45,9 @@ export type DeleteModerationPolicyRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
id: string;
|
|
47
47
|
/**
|
|
48
|
-
* Workspace the policy belongs to
|
|
48
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
49
49
|
*/
|
|
50
|
-
workspaceId
|
|
50
|
+
workspaceId?: string | undefined;
|
|
51
51
|
};
|
|
52
52
|
/** @internal */
|
|
53
53
|
export type DeleteModerationPolicyRequest$Outbound = {
|
|
@@ -55,7 +55,7 @@ export type DeleteModerationPolicyRequest$Outbound = {
|
|
|
55
55
|
appTitle?: string | undefined;
|
|
56
56
|
appCategories?: string | undefined;
|
|
57
57
|
id: string;
|
|
58
|
-
workspace_id
|
|
58
|
+
workspace_id?: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const DeleteModerationPolicyRequest$outboundSchema: z.ZodType<DeleteModerationPolicyRequest$Outbound, DeleteModerationPolicyRequest>;
|
|
@@ -10,7 +10,7 @@ export const DeleteModerationPolicyRequest$outboundSchema = z.object({
|
|
|
10
10
|
appTitle: z.string().optional(),
|
|
11
11
|
appCategories: z.string().optional(),
|
|
12
12
|
id: z.string(),
|
|
13
|
-
workspaceId: z.string(),
|
|
13
|
+
workspaceId: z.string().optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
httpReferer: "HTTP-Referer",
|
|
@@ -59,9 +59,9 @@ export type GetApiKeyPolicyAssignmentRequest = {
|
|
|
59
59
|
*/
|
|
60
60
|
hash: string;
|
|
61
61
|
/**
|
|
62
|
-
* Workspace the policy belongs to
|
|
62
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
63
63
|
*/
|
|
64
|
-
workspaceId
|
|
64
|
+
workspaceId?: string | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* Policy type the assignment is read or changed for
|
|
67
67
|
*/
|
|
@@ -75,7 +75,7 @@ export type GetApiKeyPolicyAssignmentRequest$Outbound = {
|
|
|
75
75
|
appTitle?: string | undefined;
|
|
76
76
|
appCategories?: string | undefined;
|
|
77
77
|
hash: string;
|
|
78
|
-
workspace_id
|
|
78
|
+
workspace_id?: string | undefined;
|
|
79
79
|
policy_type: string;
|
|
80
80
|
};
|
|
81
81
|
/** @internal */
|
|
@@ -22,7 +22,7 @@ export const GetApiKeyPolicyAssignmentRequest$outboundSchema = z.object({
|
|
|
22
22
|
appTitle: z.string().optional(),
|
|
23
23
|
appCategories: z.string().optional(),
|
|
24
24
|
hash: z.string(),
|
|
25
|
-
workspaceId: z.string(),
|
|
25
|
+
workspaceId: z.string().optional(),
|
|
26
26
|
policyType: GetApiKeyPolicyAssignmentPolicyType$outboundSchema,
|
|
27
27
|
}).transform((v) => {
|
|
28
28
|
return remap$(v, {
|
|
@@ -45,9 +45,9 @@ export type GetBudgetPolicyRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
id: string;
|
|
47
47
|
/**
|
|
48
|
-
* Workspace the policy belongs to
|
|
48
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
49
49
|
*/
|
|
50
|
-
workspaceId
|
|
50
|
+
workspaceId?: string | undefined;
|
|
51
51
|
};
|
|
52
52
|
/** @internal */
|
|
53
53
|
export type GetBudgetPolicyRequest$Outbound = {
|
|
@@ -55,7 +55,7 @@ export type GetBudgetPolicyRequest$Outbound = {
|
|
|
55
55
|
appTitle?: string | undefined;
|
|
56
56
|
appCategories?: string | undefined;
|
|
57
57
|
id: string;
|
|
58
|
-
workspace_id
|
|
58
|
+
workspace_id?: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const GetBudgetPolicyRequest$outboundSchema: z.ZodType<GetBudgetPolicyRequest$Outbound, GetBudgetPolicyRequest>;
|
|
@@ -10,7 +10,7 @@ export const GetBudgetPolicyRequest$outboundSchema = z.object({
|
|
|
10
10
|
appTitle: z.string().optional(),
|
|
11
11
|
appCategories: z.string().optional(),
|
|
12
12
|
id: z.string(),
|
|
13
|
-
workspaceId: z.string(),
|
|
13
|
+
workspaceId: z.string().optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
httpReferer: "HTTP-Referer",
|
|
@@ -59,9 +59,9 @@ export type GetMemberPolicyAssignmentRequest = {
|
|
|
59
59
|
*/
|
|
60
60
|
memberId: string;
|
|
61
61
|
/**
|
|
62
|
-
* Workspace the policy belongs to
|
|
62
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
63
63
|
*/
|
|
64
|
-
workspaceId
|
|
64
|
+
workspaceId?: string | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* Policy type the assignment is read or changed for
|
|
67
67
|
*/
|
|
@@ -75,7 +75,7 @@ export type GetMemberPolicyAssignmentRequest$Outbound = {
|
|
|
75
75
|
appTitle?: string | undefined;
|
|
76
76
|
appCategories?: string | undefined;
|
|
77
77
|
member_id: string;
|
|
78
|
-
workspace_id
|
|
78
|
+
workspace_id?: string | undefined;
|
|
79
79
|
policy_type: string;
|
|
80
80
|
};
|
|
81
81
|
/** @internal */
|
|
@@ -22,7 +22,7 @@ export const GetMemberPolicyAssignmentRequest$outboundSchema = z.object({
|
|
|
22
22
|
appTitle: z.string().optional(),
|
|
23
23
|
appCategories: z.string().optional(),
|
|
24
24
|
memberId: z.string(),
|
|
25
|
-
workspaceId: z.string(),
|
|
25
|
+
workspaceId: z.string().optional(),
|
|
26
26
|
policyType: GetMemberPolicyAssignmentPolicyType$outboundSchema,
|
|
27
27
|
}).transform((v) => {
|
|
28
28
|
return remap$(v, {
|
|
@@ -45,9 +45,9 @@ export type GetModelAvailabilityPolicyRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
id: string;
|
|
47
47
|
/**
|
|
48
|
-
* Workspace the policy belongs to
|
|
48
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
49
49
|
*/
|
|
50
|
-
workspaceId
|
|
50
|
+
workspaceId?: string | undefined;
|
|
51
51
|
};
|
|
52
52
|
/** @internal */
|
|
53
53
|
export type GetModelAvailabilityPolicyRequest$Outbound = {
|
|
@@ -55,7 +55,7 @@ export type GetModelAvailabilityPolicyRequest$Outbound = {
|
|
|
55
55
|
appTitle?: string | undefined;
|
|
56
56
|
appCategories?: string | undefined;
|
|
57
57
|
id: string;
|
|
58
|
-
workspace_id
|
|
58
|
+
workspace_id?: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const GetModelAvailabilityPolicyRequest$outboundSchema: z.ZodType<GetModelAvailabilityPolicyRequest$Outbound, GetModelAvailabilityPolicyRequest>;
|
|
@@ -10,7 +10,7 @@ export const GetModelAvailabilityPolicyRequest$outboundSchema = z.object({
|
|
|
10
10
|
appTitle: z.string().optional(),
|
|
11
11
|
appCategories: z.string().optional(),
|
|
12
12
|
id: z.string(),
|
|
13
|
-
workspaceId: z.string(),
|
|
13
|
+
workspaceId: z.string().optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
httpReferer: "HTTP-Referer",
|
|
@@ -45,9 +45,9 @@ export type GetModerationPolicyRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
id: string;
|
|
47
47
|
/**
|
|
48
|
-
* Workspace the policy belongs to
|
|
48
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
49
49
|
*/
|
|
50
|
-
workspaceId
|
|
50
|
+
workspaceId?: string | undefined;
|
|
51
51
|
};
|
|
52
52
|
/** @internal */
|
|
53
53
|
export type GetModerationPolicyRequest$Outbound = {
|
|
@@ -55,7 +55,7 @@ export type GetModerationPolicyRequest$Outbound = {
|
|
|
55
55
|
appTitle?: string | undefined;
|
|
56
56
|
appCategories?: string | undefined;
|
|
57
57
|
id: string;
|
|
58
|
-
workspace_id
|
|
58
|
+
workspace_id?: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const GetModerationPolicyRequest$outboundSchema: z.ZodType<GetModerationPolicyRequest$Outbound, GetModerationPolicyRequest>;
|
|
@@ -10,7 +10,7 @@ export const GetModerationPolicyRequest$outboundSchema = z.object({
|
|
|
10
10
|
appTitle: z.string().optional(),
|
|
11
11
|
appCategories: z.string().optional(),
|
|
12
12
|
id: z.string(),
|
|
13
|
-
workspaceId: z.string(),
|
|
13
|
+
workspaceId: z.string().optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
httpReferer: "HTTP-Referer",
|
|
@@ -52,9 +52,9 @@ export type ListBudgetPoliciesRequest = {
|
|
|
52
52
|
*/
|
|
53
53
|
limit?: number | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* Workspace the policy belongs to
|
|
55
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
56
56
|
*/
|
|
57
|
-
workspaceId
|
|
57
|
+
workspaceId?: string | undefined;
|
|
58
58
|
};
|
|
59
59
|
export type ListBudgetPoliciesResponse = {
|
|
60
60
|
result: models.ListBudgetGuardrailPoliciesResponse;
|
|
@@ -66,7 +66,7 @@ export type ListBudgetPoliciesRequest$Outbound = {
|
|
|
66
66
|
appCategories?: string | undefined;
|
|
67
67
|
offset?: number | undefined;
|
|
68
68
|
limit?: number | undefined;
|
|
69
|
-
workspace_id
|
|
69
|
+
workspace_id?: string | undefined;
|
|
70
70
|
};
|
|
71
71
|
/** @internal */
|
|
72
72
|
export declare const ListBudgetPoliciesRequest$outboundSchema: z.ZodType<ListBudgetPoliciesRequest$Outbound, ListBudgetPoliciesRequest>;
|
|
@@ -13,7 +13,7 @@ export const ListBudgetPoliciesRequest$outboundSchema = z.object({
|
|
|
13
13
|
appCategories: z.string().optional(),
|
|
14
14
|
offset: z.int().optional(),
|
|
15
15
|
limit: z.int().optional(),
|
|
16
|
-
workspaceId: z.string(),
|
|
16
|
+
workspaceId: z.string().optional(),
|
|
17
17
|
}).transform((v) => {
|
|
18
18
|
return remap$(v, {
|
|
19
19
|
httpReferer: "HTTP-Referer",
|
|
@@ -51,6 +51,10 @@ export type ListKeyAssignmentsRequest = {
|
|
|
51
51
|
* Maximum number of records to return (max 100)
|
|
52
52
|
*/
|
|
53
53
|
limit?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.
|
|
56
|
+
*/
|
|
57
|
+
workspaceId?: string | undefined;
|
|
54
58
|
};
|
|
55
59
|
export type ListKeyAssignmentsResponse = {
|
|
56
60
|
result: models.ListKeyAssignmentsResponse;
|
|
@@ -62,6 +66,7 @@ export type ListKeyAssignmentsRequest$Outbound = {
|
|
|
62
66
|
appCategories?: string | undefined;
|
|
63
67
|
offset: number | null;
|
|
64
68
|
limit: number;
|
|
69
|
+
workspace_id?: string | undefined;
|
|
65
70
|
};
|
|
66
71
|
/** @internal */
|
|
67
72
|
export declare const ListKeyAssignmentsRequest$outboundSchema: z.ZodType<ListKeyAssignmentsRequest$Outbound, ListKeyAssignmentsRequest>;
|
|
@@ -13,9 +13,11 @@ export const ListKeyAssignmentsRequest$outboundSchema = z.object({
|
|
|
13
13
|
appCategories: z.string().optional(),
|
|
14
14
|
offset: z.nullable(z.int().default(0)),
|
|
15
15
|
limit: z.int().default(50),
|
|
16
|
+
workspaceId: z.string().optional(),
|
|
16
17
|
}).transform((v) => {
|
|
17
18
|
return remap$(v, {
|
|
18
19
|
httpReferer: "HTTP-Referer",
|
|
20
|
+
workspaceId: "workspace_id",
|
|
19
21
|
});
|
|
20
22
|
});
|
|
21
23
|
export function listKeyAssignmentsRequestToJSON(listKeyAssignmentsRequest) {
|
|
@@ -51,6 +51,10 @@ export type ListMemberAssignmentsRequest = {
|
|
|
51
51
|
* Maximum number of records to return (max 100)
|
|
52
52
|
*/
|
|
53
53
|
limit?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.
|
|
56
|
+
*/
|
|
57
|
+
workspaceId?: string | undefined;
|
|
54
58
|
};
|
|
55
59
|
export type ListMemberAssignmentsResponse = {
|
|
56
60
|
result: models.ListMemberAssignmentsResponse;
|
|
@@ -62,6 +66,7 @@ export type ListMemberAssignmentsRequest$Outbound = {
|
|
|
62
66
|
appCategories?: string | undefined;
|
|
63
67
|
offset: number | null;
|
|
64
68
|
limit: number;
|
|
69
|
+
workspace_id?: string | undefined;
|
|
65
70
|
};
|
|
66
71
|
/** @internal */
|
|
67
72
|
export declare const ListMemberAssignmentsRequest$outboundSchema: z.ZodType<ListMemberAssignmentsRequest$Outbound, ListMemberAssignmentsRequest>;
|
|
@@ -13,9 +13,11 @@ export const ListMemberAssignmentsRequest$outboundSchema = z.object({
|
|
|
13
13
|
appCategories: z.string().optional(),
|
|
14
14
|
offset: z.nullable(z.int().default(0)),
|
|
15
15
|
limit: z.int().default(50),
|
|
16
|
+
workspaceId: z.string().optional(),
|
|
16
17
|
}).transform((v) => {
|
|
17
18
|
return remap$(v, {
|
|
18
19
|
httpReferer: "HTTP-Referer",
|
|
20
|
+
workspaceId: "workspace_id",
|
|
19
21
|
});
|
|
20
22
|
});
|
|
21
23
|
export function listMemberAssignmentsRequestToJSON(listMemberAssignmentsRequest) {
|
|
@@ -52,9 +52,9 @@ export type ListModelAvailabilityPoliciesRequest = {
|
|
|
52
52
|
*/
|
|
53
53
|
limit?: number | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* Workspace the policy belongs to
|
|
55
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
56
56
|
*/
|
|
57
|
-
workspaceId
|
|
57
|
+
workspaceId?: string | undefined;
|
|
58
58
|
};
|
|
59
59
|
export type ListModelAvailabilityPoliciesResponse = {
|
|
60
60
|
result: models.ListModelAvailabilityGuardrailPoliciesResponse;
|
|
@@ -66,7 +66,7 @@ export type ListModelAvailabilityPoliciesRequest$Outbound = {
|
|
|
66
66
|
appCategories?: string | undefined;
|
|
67
67
|
offset?: number | undefined;
|
|
68
68
|
limit?: number | undefined;
|
|
69
|
-
workspace_id
|
|
69
|
+
workspace_id?: string | undefined;
|
|
70
70
|
};
|
|
71
71
|
/** @internal */
|
|
72
72
|
export declare const ListModelAvailabilityPoliciesRequest$outboundSchema: z.ZodType<ListModelAvailabilityPoliciesRequest$Outbound, ListModelAvailabilityPoliciesRequest>;
|
|
@@ -13,7 +13,7 @@ export const ListModelAvailabilityPoliciesRequest$outboundSchema = z.object({
|
|
|
13
13
|
appCategories: z.string().optional(),
|
|
14
14
|
offset: z.int().optional(),
|
|
15
15
|
limit: z.int().optional(),
|
|
16
|
-
workspaceId: z.string(),
|
|
16
|
+
workspaceId: z.string().optional(),
|
|
17
17
|
}).transform((v) => {
|
|
18
18
|
return remap$(v, {
|
|
19
19
|
httpReferer: "HTTP-Referer",
|
|
@@ -52,9 +52,9 @@ export type ListModerationPoliciesRequest = {
|
|
|
52
52
|
*/
|
|
53
53
|
limit?: number | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* Workspace the policy belongs to
|
|
55
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
56
56
|
*/
|
|
57
|
-
workspaceId
|
|
57
|
+
workspaceId?: string | undefined;
|
|
58
58
|
};
|
|
59
59
|
export type ListModerationPoliciesResponse = {
|
|
60
60
|
result: models.ListModerationGuardrailPoliciesResponse;
|
|
@@ -66,7 +66,7 @@ export type ListModerationPoliciesRequest$Outbound = {
|
|
|
66
66
|
appCategories?: string | undefined;
|
|
67
67
|
offset?: number | undefined;
|
|
68
68
|
limit?: number | undefined;
|
|
69
|
-
workspace_id
|
|
69
|
+
workspace_id?: string | undefined;
|
|
70
70
|
};
|
|
71
71
|
/** @internal */
|
|
72
72
|
export declare const ListModerationPoliciesRequest$outboundSchema: z.ZodType<ListModerationPoliciesRequest$Outbound, ListModerationPoliciesRequest>;
|
|
@@ -13,7 +13,7 @@ export const ListModerationPoliciesRequest$outboundSchema = z.object({
|
|
|
13
13
|
appCategories: z.string().optional(),
|
|
14
14
|
offset: z.int().optional(),
|
|
15
15
|
limit: z.int().optional(),
|
|
16
|
-
workspaceId: z.string(),
|
|
16
|
+
workspaceId: z.string().optional(),
|
|
17
17
|
}).transform((v) => {
|
|
18
18
|
return remap$(v, {
|
|
19
19
|
httpReferer: "HTTP-Referer",
|
|
@@ -57,7 +57,7 @@ export type UpdateKeysRequestBody = {
|
|
|
57
57
|
*/
|
|
58
58
|
name?: string | undefined;
|
|
59
59
|
/**
|
|
60
|
-
* Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op.
|
|
60
|
+
* Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op.
|
|
61
61
|
*/
|
|
62
62
|
workspaceId?: string | undefined;
|
|
63
63
|
};
|
|
@@ -27,9 +27,9 @@ export type UpdateBudgetGuardrailPolicyRequest = {
|
|
|
27
27
|
*/
|
|
28
28
|
optedOutMemberIds?: Array<string> | undefined;
|
|
29
29
|
/**
|
|
30
|
-
* Workspace the policy belongs to
|
|
30
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
31
31
|
*/
|
|
32
|
-
workspaceId
|
|
32
|
+
workspaceId?: string | undefined;
|
|
33
33
|
};
|
|
34
34
|
/** @internal */
|
|
35
35
|
export type UpdateBudgetGuardrailPolicyRequest$Outbound = {
|
|
@@ -40,7 +40,7 @@ export type UpdateBudgetGuardrailPolicyRequest$Outbound = {
|
|
|
40
40
|
name: string;
|
|
41
41
|
opted_out_api_key_hashes?: Array<string> | undefined;
|
|
42
42
|
opted_out_member_ids?: Array<string> | undefined;
|
|
43
|
-
workspace_id
|
|
43
|
+
workspace_id?: string | undefined;
|
|
44
44
|
};
|
|
45
45
|
/** @internal */
|
|
46
46
|
export declare const UpdateBudgetGuardrailPolicyRequest$outboundSchema: z.ZodType<UpdateBudgetGuardrailPolicyRequest$Outbound, UpdateBudgetGuardrailPolicyRequest>;
|
|
@@ -14,7 +14,7 @@ export const UpdateBudgetGuardrailPolicyRequest$outboundSchema = z.object({
|
|
|
14
14
|
name: z.string(),
|
|
15
15
|
optedOutApiKeyHashes: z.array(z.string()).optional(),
|
|
16
16
|
optedOutMemberIds: z.array(z.string()).optional(),
|
|
17
|
-
workspaceId: z.string(),
|
|
17
|
+
workspaceId: z.string().optional(),
|
|
18
18
|
}).transform((v) => {
|
|
19
19
|
return remap$(v, {
|
|
20
20
|
apiKeyHashes: "api_key_hashes",
|
|
@@ -27,9 +27,9 @@ export type UpdateModelAvailabilityGuardrailPolicyRequest = {
|
|
|
27
27
|
*/
|
|
28
28
|
optedOutMemberIds?: Array<string> | undefined;
|
|
29
29
|
/**
|
|
30
|
-
* Workspace the policy belongs to
|
|
30
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
31
31
|
*/
|
|
32
|
-
workspaceId
|
|
32
|
+
workspaceId?: string | undefined;
|
|
33
33
|
};
|
|
34
34
|
/** @internal */
|
|
35
35
|
export type UpdateModelAvailabilityGuardrailPolicyRequest$Outbound = {
|
|
@@ -40,7 +40,7 @@ export type UpdateModelAvailabilityGuardrailPolicyRequest$Outbound = {
|
|
|
40
40
|
name: string;
|
|
41
41
|
opted_out_api_key_hashes?: Array<string> | undefined;
|
|
42
42
|
opted_out_member_ids?: Array<string> | undefined;
|
|
43
|
-
workspace_id
|
|
43
|
+
workspace_id?: string | undefined;
|
|
44
44
|
};
|
|
45
45
|
/** @internal */
|
|
46
46
|
export declare const UpdateModelAvailabilityGuardrailPolicyRequest$outboundSchema: z.ZodType<UpdateModelAvailabilityGuardrailPolicyRequest$Outbound, UpdateModelAvailabilityGuardrailPolicyRequest>;
|
|
@@ -14,7 +14,7 @@ export const UpdateModelAvailabilityGuardrailPolicyRequest$outboundSchema = z.ob
|
|
|
14
14
|
name: z.string(),
|
|
15
15
|
optedOutApiKeyHashes: z.array(z.string()).optional(),
|
|
16
16
|
optedOutMemberIds: z.array(z.string()).optional(),
|
|
17
|
-
workspaceId: z.string(),
|
|
17
|
+
workspaceId: z.string().optional(),
|
|
18
18
|
}).transform((v) => {
|
|
19
19
|
return remap$(v, {
|
|
20
20
|
apiKeyHashes: "api_key_hashes",
|
|
@@ -27,9 +27,9 @@ export type UpdateModerationGuardrailPolicyRequest = {
|
|
|
27
27
|
*/
|
|
28
28
|
optedOutMemberIds?: Array<string> | undefined;
|
|
29
29
|
/**
|
|
30
|
-
* Workspace the policy belongs to
|
|
30
|
+
* Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
|
|
31
31
|
*/
|
|
32
|
-
workspaceId
|
|
32
|
+
workspaceId?: string | undefined;
|
|
33
33
|
};
|
|
34
34
|
/** @internal */
|
|
35
35
|
export type UpdateModerationGuardrailPolicyRequest$Outbound = {
|
|
@@ -40,7 +40,7 @@ export type UpdateModerationGuardrailPolicyRequest$Outbound = {
|
|
|
40
40
|
name: string;
|
|
41
41
|
opted_out_api_key_hashes?: Array<string> | undefined;
|
|
42
42
|
opted_out_member_ids?: Array<string> | undefined;
|
|
43
|
-
workspace_id
|
|
43
|
+
workspace_id?: string | undefined;
|
|
44
44
|
};
|
|
45
45
|
/** @internal */
|
|
46
46
|
export declare const UpdateModerationGuardrailPolicyRequest$outboundSchema: z.ZodType<UpdateModerationGuardrailPolicyRequest$Outbound, UpdateModerationGuardrailPolicyRequest>;
|
|
@@ -14,7 +14,7 @@ export const UpdateModerationGuardrailPolicyRequest$outboundSchema = z.object({
|
|
|
14
14
|
name: z.string(),
|
|
15
15
|
optedOutApiKeyHashes: z.array(z.string()).optional(),
|
|
16
16
|
optedOutMemberIds: z.array(z.string()).optional(),
|
|
17
|
-
workspaceId: z.string(),
|
|
17
|
+
workspaceId: z.string().optional(),
|
|
18
18
|
}).transform((v) => {
|
|
19
19
|
return remap$(v, {
|
|
20
20
|
apiKeyHashes: "api_key_hashes",
|
package/esm/sdk/analytics.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Analytics extends ClientSDK {
|
|
|
6
6
|
* Get user activity grouped by endpoint
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
9
|
+
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
10
10
|
*/
|
|
11
11
|
getUserActivity(request?: operations.GetUserActivityRequest | undefined, options?: RequestOptions): Promise<models.ActivityResponse>;
|
|
12
12
|
/**
|
package/esm/sdk/analytics.js
CHANGED
|
@@ -12,7 +12,7 @@ export class Analytics extends ClientSDK {
|
|
|
12
12
|
* Get user activity grouped by endpoint
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
15
|
+
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
async getUserActivity(request, options) {
|
|
18
18
|
return unwrapAsync(analyticsGetUserActivity(this, request, options));
|
|
@@ -67,7 +67,7 @@ export declare class GuardrailPolicies extends ClientSDK {
|
|
|
67
67
|
* @remarks
|
|
68
68
|
* List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
69
69
|
*/
|
|
70
|
-
listBudgetPolicies(request
|
|
70
|
+
listBudgetPolicies(request?: operations.ListBudgetPoliciesRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListBudgetPoliciesResponse, {
|
|
71
71
|
offset: number;
|
|
72
72
|
}>>;
|
|
73
73
|
/**
|
|
@@ -104,7 +104,7 @@ export declare class GuardrailPolicies extends ClientSDK {
|
|
|
104
104
|
* @remarks
|
|
105
105
|
* List the model availability policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
106
106
|
*/
|
|
107
|
-
listModelAvailabilityPolicies(request
|
|
107
|
+
listModelAvailabilityPolicies(request?: operations.ListModelAvailabilityPoliciesRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListModelAvailabilityPoliciesResponse, {
|
|
108
108
|
offset: number;
|
|
109
109
|
}>>;
|
|
110
110
|
/**
|
|
@@ -141,7 +141,7 @@ export declare class GuardrailPolicies extends ClientSDK {
|
|
|
141
141
|
* @remarks
|
|
142
142
|
* List the moderation policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
143
143
|
*/
|
|
144
|
-
listModerationPolicies(request
|
|
144
|
+
listModerationPolicies(request?: operations.ListModerationPoliciesRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListModerationPoliciesResponse, {
|
|
145
145
|
offset: number;
|
|
146
146
|
}>>;
|
|
147
147
|
/**
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.85",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
78
|
"test": "vitest --run --project unit",
|
|
79
|
-
"typecheck": "tsc --noEmit",
|
|
80
|
-
"prepare": "npm run build",
|
|
81
79
|
"test:e2e": "vitest --run --project e2e",
|
|
82
|
-
"test:transit": "exit 0",
|
|
83
80
|
"test:watch": "vitest --watch --project unit",
|
|
81
|
+
"prepare": "npm run build",
|
|
82
|
+
"test:transit": "exit 0",
|
|
83
|
+
"typecheck": "tsc --noEmit",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|