@openrouter/sdk 0.3.14 → 0.3.15
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/apiKeysCreate.d.ts +3 -0
- package/esm/funcs/apiKeysCreate.js +3 -0
- package/esm/funcs/apiKeysDelete.d.ts +3 -0
- package/esm/funcs/apiKeysDelete.js +3 -0
- package/esm/funcs/apiKeysGet.d.ts +3 -0
- package/esm/funcs/apiKeysGet.js +3 -0
- package/esm/funcs/apiKeysList.d.ts +3 -0
- package/esm/funcs/apiKeysList.js +3 -0
- package/esm/funcs/apiKeysUpdate.d.ts +3 -0
- package/esm/funcs/apiKeysUpdate.js +3 -0
- package/esm/funcs/call-model.js +9 -6
- package/esm/funcs/creditsGetCredits.d.ts +1 -1
- package/esm/funcs/creditsGetCredits.js +1 -1
- package/esm/funcs/guardrailsBulkAssignKeys.d.ts +18 -0
- package/esm/funcs/guardrailsBulkAssignKeys.js +89 -0
- package/esm/funcs/guardrailsBulkAssignMembers.d.ts +18 -0
- package/esm/funcs/guardrailsBulkAssignMembers.js +89 -0
- package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +18 -0
- package/esm/funcs/guardrailsBulkUnassignKeys.js +89 -0
- package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +18 -0
- package/esm/funcs/guardrailsBulkUnassignMembers.js +89 -0
- package/esm/funcs/guardrailsCreate.d.ts +18 -0
- package/esm/funcs/guardrailsCreate.js +83 -0
- package/esm/funcs/guardrailsDelete.d.ts +18 -0
- package/esm/funcs/guardrailsDelete.js +88 -0
- package/esm/funcs/{parametersGetParameters.d.ts → guardrailsGet.d.ts} +6 -3
- package/esm/funcs/guardrailsGet.js +88 -0
- package/esm/funcs/guardrailsList.d.ts +18 -0
- package/esm/funcs/guardrailsList.js +87 -0
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +93 -0
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +93 -0
- package/esm/funcs/guardrailsListKeyAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListKeyAssignments.js +87 -0
- package/esm/funcs/guardrailsListMemberAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListMemberAssignments.js +87 -0
- package/esm/funcs/guardrailsUpdate.d.ts +18 -0
- package/esm/funcs/{parametersGetParameters.js → guardrailsUpdate.js} +24 -32
- package/esm/index.d.ts +4 -3
- package/esm/index.js +3 -1
- package/esm/lib/async-params.d.ts +46 -6
- package/esm/lib/async-params.js +10 -2
- package/esm/lib/config.d.ts +2 -4
- package/esm/lib/config.js +2 -2
- package/esm/lib/conversation-state.d.ts +61 -0
- package/esm/lib/conversation-state.js +207 -0
- package/esm/lib/model-result.d.ts +175 -2
- package/esm/lib/model-result.js +678 -181
- package/esm/lib/tool-types.d.ts +108 -0
- package/esm/lib/tool-types.js +13 -0
- package/esm/lib/tool.d.ts +21 -1
- package/esm/lib/tool.js +7 -0
- package/esm/models/assistantmessage.d.ts +31 -0
- package/esm/models/assistantmessage.js +43 -0
- package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
- package/esm/models/chatmessagecontentitemimage.js +8 -9
- package/esm/models/chatresponsechoice.d.ts +0 -2
- package/esm/models/chatresponsechoice.js +0 -3
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
- package/esm/models/chatstreamingmessagechunk.js +2 -2
- package/esm/models/index.d.ts +1 -1
- package/esm/models/index.js +1 -1
- package/esm/models/model.d.ts +4 -0
- package/esm/models/model.js +2 -0
- package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
- package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
- package/esm/models/operations/createguardrail.d.ts +136 -0
- package/esm/models/operations/createguardrail.js +85 -0
- package/esm/models/operations/deleteguardrail.d.ts +29 -0
- package/esm/models/operations/deleteguardrail.js +21 -0
- package/esm/models/operations/getguardrail.d.ts +92 -0
- package/esm/models/operations/getguardrail.js +60 -0
- package/esm/models/operations/getmodels.d.ts +28 -1
- package/esm/models/operations/getmodels.js +22 -1
- package/esm/models/operations/index.d.ts +13 -1
- package/esm/models/operations/index.js +13 -1
- package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
- package/esm/models/operations/listguardrailkeyassignments.js +51 -0
- package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
- package/esm/models/operations/listguardrailmemberassignments.js +49 -0
- package/esm/models/operations/listguardrails.d.ts +98 -0
- package/esm/models/operations/listguardrails.js +66 -0
- package/esm/models/operations/listkeyassignments.d.ts +71 -0
- package/esm/models/operations/listkeyassignments.js +50 -0
- package/esm/models/operations/listmemberassignments.d.ts +67 -0
- package/esm/models/operations/listmemberassignments.js +48 -0
- package/esm/models/operations/updateguardrail.d.ts +151 -0
- package/esm/models/operations/updateguardrail.js +97 -0
- package/esm/models/percentilelatencycutoffs.js +1 -1
- package/esm/models/percentilestats.js +1 -1
- package/esm/models/percentilethroughputcutoffs.js +1 -1
- package/esm/models/preferredmaxlatency.js +1 -1
- package/esm/models/preferredminthroughput.js +1 -1
- package/esm/models/responseinputvideo.js +1 -1
- package/esm/models/responsesoutputmodality.js +1 -1
- package/esm/models/schema2.d.ts +92 -0
- package/esm/models/schema2.js +109 -0
- package/esm/sdk/analytics.d.ts +1 -1
- package/esm/sdk/analytics.js +1 -1
- package/esm/sdk/apikeys.d.ts +15 -0
- package/esm/sdk/apikeys.js +15 -0
- package/esm/sdk/credits.d.ts +1 -1
- package/esm/sdk/credits.js +1 -1
- package/esm/sdk/guardrails.d.ts +96 -0
- package/esm/sdk/guardrails.js +139 -0
- package/esm/sdk/sdk.d.ts +3 -3
- package/esm/sdk/sdk.js +4 -4
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +1 -0
- package/esm/types/models.d.ts +25 -0
- package/esm/types/models.js +10 -0
- package/jsr.json +1 -1
- package/package.json +12 -10
- package/scripts/check-types.js +127 -0
- package/esm/models/operations/getparameters.d.ts +0 -87
- package/esm/models/operations/getparameters.js +0 -73
- package/esm/models/schema3.d.ts +0 -51
- package/esm/models/schema3.js +0 -62
- package/esm/sdk/parameters.d.ts +0 -9
- package/esm/sdk/parameters.js +0 -16
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5a16015b4d1f
|
|
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 * as openEnums from "../../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
11
|
+
*/
|
|
12
|
+
export const GetGuardrailResetInterval = {
|
|
13
|
+
Daily: "daily",
|
|
14
|
+
Weekly: "weekly",
|
|
15
|
+
Monthly: "monthly",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const GetGuardrailRequest$outboundSchema = z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
});
|
|
21
|
+
export function getGuardrailRequestToJSON(getGuardrailRequest) {
|
|
22
|
+
return JSON.stringify(GetGuardrailRequest$outboundSchema.parse(getGuardrailRequest));
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const GetGuardrailResetInterval$inboundSchema = openEnums.inboundSchema(GetGuardrailResetInterval);
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const GetGuardrailData$inboundSchema = z.object({
|
|
28
|
+
id: z.string(),
|
|
29
|
+
name: z.string(),
|
|
30
|
+
description: z.nullable(z.string()).optional(),
|
|
31
|
+
limit_usd: z.nullable(z.number()).optional(),
|
|
32
|
+
reset_interval: z.nullable(GetGuardrailResetInterval$inboundSchema)
|
|
33
|
+
.optional(),
|
|
34
|
+
allowed_providers: z.nullable(z.array(z.string())).optional(),
|
|
35
|
+
allowed_models: z.nullable(z.array(z.string())).optional(),
|
|
36
|
+
enforce_zdr: z.nullable(z.boolean()).optional(),
|
|
37
|
+
created_at: z.string(),
|
|
38
|
+
updated_at: z.nullable(z.string()).optional(),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
"limit_usd": "limitUsd",
|
|
42
|
+
"reset_interval": "resetInterval",
|
|
43
|
+
"allowed_providers": "allowedProviders",
|
|
44
|
+
"allowed_models": "allowedModels",
|
|
45
|
+
"enforce_zdr": "enforceZdr",
|
|
46
|
+
"created_at": "createdAt",
|
|
47
|
+
"updated_at": "updatedAt",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
export function getGuardrailDataFromJSON(jsonString) {
|
|
51
|
+
return safeParse(jsonString, (x) => GetGuardrailData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetGuardrailData' from JSON`);
|
|
52
|
+
}
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const GetGuardrailResponse$inboundSchema = z.object({
|
|
55
|
+
data: z.lazy(() => GetGuardrailData$inboundSchema),
|
|
56
|
+
});
|
|
57
|
+
export function getGuardrailResponseFromJSON(jsonString) {
|
|
58
|
+
return safeParse(jsonString, (x) => GetGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetGuardrailResponse' from JSON`);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=getguardrail.js.map
|
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Filter models by use case category
|
|
5
|
+
*/
|
|
6
|
+
export declare const Category: {
|
|
7
|
+
readonly Programming: "programming";
|
|
8
|
+
readonly Roleplay: "roleplay";
|
|
9
|
+
readonly Marketing: "marketing";
|
|
10
|
+
readonly MarketingSeo: "marketing/seo";
|
|
11
|
+
readonly Technology: "technology";
|
|
12
|
+
readonly Science: "science";
|
|
13
|
+
readonly Translation: "translation";
|
|
14
|
+
readonly Legal: "legal";
|
|
15
|
+
readonly Finance: "finance";
|
|
16
|
+
readonly Health: "health";
|
|
17
|
+
readonly Trivia: "trivia";
|
|
18
|
+
readonly Academia: "academia";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Filter models by use case category
|
|
22
|
+
*/
|
|
23
|
+
export type Category = OpenEnum<typeof Category>;
|
|
2
24
|
export type GetModelsRequest = {
|
|
3
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Filter models by use case category
|
|
27
|
+
*/
|
|
28
|
+
category?: Category | undefined;
|
|
4
29
|
supportedParameters?: string | undefined;
|
|
5
30
|
};
|
|
6
31
|
/** @internal */
|
|
32
|
+
export declare const Category$outboundSchema: z.ZodType<string, Category>;
|
|
33
|
+
/** @internal */
|
|
7
34
|
export type GetModelsRequest$Outbound = {
|
|
8
35
|
category?: string | undefined;
|
|
9
36
|
supported_parameters?: string | undefined;
|
|
@@ -4,9 +4,30 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
/**
|
|
9
|
+
* Filter models by use case category
|
|
10
|
+
*/
|
|
11
|
+
export const Category = {
|
|
12
|
+
Programming: "programming",
|
|
13
|
+
Roleplay: "roleplay",
|
|
14
|
+
Marketing: "marketing",
|
|
15
|
+
MarketingSeo: "marketing/seo",
|
|
16
|
+
Technology: "technology",
|
|
17
|
+
Science: "science",
|
|
18
|
+
Translation: "translation",
|
|
19
|
+
Legal: "legal",
|
|
20
|
+
Finance: "finance",
|
|
21
|
+
Health: "health",
|
|
22
|
+
Trivia: "trivia",
|
|
23
|
+
Academia: "academia",
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const Category$outboundSchema = openEnums
|
|
27
|
+
.outboundSchema(Category);
|
|
7
28
|
/** @internal */
|
|
8
29
|
export const GetModelsRequest$outboundSchema = z.object({
|
|
9
|
-
category:
|
|
30
|
+
category: Category$outboundSchema.optional(),
|
|
10
31
|
supportedParameters: z.string().optional(),
|
|
11
32
|
}).transform((v) => {
|
|
12
33
|
return remap$(v, {
|
|
@@ -1,22 +1,34 @@
|
|
|
1
|
+
export * from "./bulkassignkeystoguardrail.js";
|
|
2
|
+
export * from "./bulkassignmemberstoguardrail.js";
|
|
3
|
+
export * from "./bulkunassignkeysfromguardrail.js";
|
|
4
|
+
export * from "./bulkunassignmembersfromguardrail.js";
|
|
1
5
|
export * from "./createauthkeyscode.js";
|
|
2
6
|
export * from "./createcoinbasecharge.js";
|
|
3
7
|
export * from "./createembeddings.js";
|
|
8
|
+
export * from "./createguardrail.js";
|
|
4
9
|
export * from "./createkeys.js";
|
|
5
10
|
export * from "./createresponses.js";
|
|
11
|
+
export * from "./deleteguardrail.js";
|
|
6
12
|
export * from "./deletekeys.js";
|
|
7
13
|
export * from "./exchangeauthcodeforapikey.js";
|
|
8
14
|
export * from "./getcredits.js";
|
|
9
15
|
export * from "./getcurrentkey.js";
|
|
10
16
|
export * from "./getgeneration.js";
|
|
17
|
+
export * from "./getguardrail.js";
|
|
11
18
|
export * from "./getkey.js";
|
|
12
19
|
export * from "./getmodels.js";
|
|
13
|
-
export * from "./getparameters.js";
|
|
14
20
|
export * from "./getuseractivity.js";
|
|
15
21
|
export * from "./list.js";
|
|
16
22
|
export * from "./listendpoints.js";
|
|
17
23
|
export * from "./listendpointszdr.js";
|
|
24
|
+
export * from "./listguardrailkeyassignments.js";
|
|
25
|
+
export * from "./listguardrailmemberassignments.js";
|
|
26
|
+
export * from "./listguardrails.js";
|
|
27
|
+
export * from "./listkeyassignments.js";
|
|
28
|
+
export * from "./listmemberassignments.js";
|
|
18
29
|
export * from "./listmodelsuser.js";
|
|
19
30
|
export * from "./listproviders.js";
|
|
20
31
|
export * from "./sendchatcompletionrequest.js";
|
|
32
|
+
export * from "./updateguardrail.js";
|
|
21
33
|
export * from "./updatekeys.js";
|
|
22
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,25 +2,37 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: 0d9ffaf774d2
|
|
4
4
|
*/
|
|
5
|
+
export * from "./bulkassignkeystoguardrail.js";
|
|
6
|
+
export * from "./bulkassignmemberstoguardrail.js";
|
|
7
|
+
export * from "./bulkunassignkeysfromguardrail.js";
|
|
8
|
+
export * from "./bulkunassignmembersfromguardrail.js";
|
|
5
9
|
export * from "./createauthkeyscode.js";
|
|
6
10
|
export * from "./createcoinbasecharge.js";
|
|
7
11
|
export * from "./createembeddings.js";
|
|
12
|
+
export * from "./createguardrail.js";
|
|
8
13
|
export * from "./createkeys.js";
|
|
9
14
|
export * from "./createresponses.js";
|
|
15
|
+
export * from "./deleteguardrail.js";
|
|
10
16
|
export * from "./deletekeys.js";
|
|
11
17
|
export * from "./exchangeauthcodeforapikey.js";
|
|
12
18
|
export * from "./getcredits.js";
|
|
13
19
|
export * from "./getcurrentkey.js";
|
|
14
20
|
export * from "./getgeneration.js";
|
|
21
|
+
export * from "./getguardrail.js";
|
|
15
22
|
export * from "./getkey.js";
|
|
16
23
|
export * from "./getmodels.js";
|
|
17
|
-
export * from "./getparameters.js";
|
|
18
24
|
export * from "./getuseractivity.js";
|
|
19
25
|
export * from "./list.js";
|
|
20
26
|
export * from "./listendpoints.js";
|
|
21
27
|
export * from "./listendpointszdr.js";
|
|
28
|
+
export * from "./listguardrailkeyassignments.js";
|
|
29
|
+
export * from "./listguardrailmemberassignments.js";
|
|
30
|
+
export * from "./listguardrails.js";
|
|
31
|
+
export * from "./listkeyassignments.js";
|
|
32
|
+
export * from "./listmemberassignments.js";
|
|
22
33
|
export * from "./listmodelsuser.js";
|
|
23
34
|
export * from "./listproviders.js";
|
|
24
35
|
export * from "./sendchatcompletionrequest.js";
|
|
36
|
+
export * from "./updateguardrail.js";
|
|
25
37
|
export * from "./updatekeys.js";
|
|
26
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
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 ListGuardrailKeyAssignmentsRequest = {
|
|
5
|
+
/**
|
|
6
|
+
* The unique identifier of the guardrail
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Number of records to skip for pagination
|
|
11
|
+
*/
|
|
12
|
+
offset?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum number of records to return (max 100)
|
|
15
|
+
*/
|
|
16
|
+
limit?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type ListGuardrailKeyAssignmentsData = {
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier for the assignment
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Hash of the assigned API key
|
|
25
|
+
*/
|
|
26
|
+
keyHash: string;
|
|
27
|
+
/**
|
|
28
|
+
* ID of the guardrail
|
|
29
|
+
*/
|
|
30
|
+
guardrailId: string;
|
|
31
|
+
/**
|
|
32
|
+
* Name of the API key
|
|
33
|
+
*/
|
|
34
|
+
keyName: string;
|
|
35
|
+
/**
|
|
36
|
+
* Label of the API key
|
|
37
|
+
*/
|
|
38
|
+
keyLabel: string;
|
|
39
|
+
/**
|
|
40
|
+
* User ID of who made the assignment
|
|
41
|
+
*/
|
|
42
|
+
assignedBy: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* ISO 8601 timestamp of when the assignment was created
|
|
45
|
+
*/
|
|
46
|
+
createdAt: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* List of key assignments
|
|
50
|
+
*/
|
|
51
|
+
export type ListGuardrailKeyAssignmentsResponse = {
|
|
52
|
+
/**
|
|
53
|
+
* List of key assignments
|
|
54
|
+
*/
|
|
55
|
+
data: Array<ListGuardrailKeyAssignmentsData>;
|
|
56
|
+
/**
|
|
57
|
+
* Total number of key assignments for this guardrail
|
|
58
|
+
*/
|
|
59
|
+
totalCount: number;
|
|
60
|
+
};
|
|
61
|
+
/** @internal */
|
|
62
|
+
export type ListGuardrailKeyAssignmentsRequest$Outbound = {
|
|
63
|
+
id: string;
|
|
64
|
+
offset?: string | undefined;
|
|
65
|
+
limit?: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
/** @internal */
|
|
68
|
+
export declare const ListGuardrailKeyAssignmentsRequest$outboundSchema: z.ZodType<ListGuardrailKeyAssignmentsRequest$Outbound, ListGuardrailKeyAssignmentsRequest>;
|
|
69
|
+
export declare function listGuardrailKeyAssignmentsRequestToJSON(listGuardrailKeyAssignmentsRequest: ListGuardrailKeyAssignmentsRequest): string;
|
|
70
|
+
/** @internal */
|
|
71
|
+
export declare const ListGuardrailKeyAssignmentsData$inboundSchema: z.ZodType<ListGuardrailKeyAssignmentsData, unknown>;
|
|
72
|
+
export declare function listGuardrailKeyAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListGuardrailKeyAssignmentsData, SDKValidationError>;
|
|
73
|
+
/** @internal */
|
|
74
|
+
export declare const ListGuardrailKeyAssignmentsResponse$inboundSchema: z.ZodType<ListGuardrailKeyAssignmentsResponse, unknown>;
|
|
75
|
+
export declare function listGuardrailKeyAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListGuardrailKeyAssignmentsResponse, SDKValidationError>;
|
|
76
|
+
//# sourceMappingURL=listguardrailkeyassignments.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e616af13fd7a
|
|
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 ListGuardrailKeyAssignmentsRequest$outboundSchema = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
offset: z.string().optional(),
|
|
12
|
+
limit: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
export function listGuardrailKeyAssignmentsRequestToJSON(listGuardrailKeyAssignmentsRequest) {
|
|
15
|
+
return JSON.stringify(ListGuardrailKeyAssignmentsRequest$outboundSchema.parse(listGuardrailKeyAssignmentsRequest));
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ListGuardrailKeyAssignmentsData$inboundSchema = z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
key_hash: z.string(),
|
|
21
|
+
guardrail_id: z.string(),
|
|
22
|
+
key_name: z.string(),
|
|
23
|
+
key_label: z.string(),
|
|
24
|
+
assigned_by: z.nullable(z.string()),
|
|
25
|
+
created_at: z.string(),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"key_hash": "keyHash",
|
|
29
|
+
"guardrail_id": "guardrailId",
|
|
30
|
+
"key_name": "keyName",
|
|
31
|
+
"key_label": "keyLabel",
|
|
32
|
+
"assigned_by": "assignedBy",
|
|
33
|
+
"created_at": "createdAt",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export function listGuardrailKeyAssignmentsDataFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => ListGuardrailKeyAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailKeyAssignmentsData' from JSON`);
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const ListGuardrailKeyAssignmentsResponse$inboundSchema = z.object({
|
|
41
|
+
data: z.array(z.lazy(() => ListGuardrailKeyAssignmentsData$inboundSchema)),
|
|
42
|
+
total_count: z.number(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
"total_count": "totalCount",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
export function listGuardrailKeyAssignmentsResponseFromJSON(jsonString) {
|
|
49
|
+
return safeParse(jsonString, (x) => ListGuardrailKeyAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailKeyAssignmentsResponse' from JSON`);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=listguardrailkeyassignments.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
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 ListGuardrailMemberAssignmentsRequest = {
|
|
5
|
+
/**
|
|
6
|
+
* The unique identifier of the guardrail
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Number of records to skip for pagination
|
|
11
|
+
*/
|
|
12
|
+
offset?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum number of records to return (max 100)
|
|
15
|
+
*/
|
|
16
|
+
limit?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type ListGuardrailMemberAssignmentsData = {
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier for the assignment
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Clerk user ID of the assigned member
|
|
25
|
+
*/
|
|
26
|
+
userId: string;
|
|
27
|
+
/**
|
|
28
|
+
* Organization ID
|
|
29
|
+
*/
|
|
30
|
+
organizationId: string;
|
|
31
|
+
/**
|
|
32
|
+
* ID of the guardrail
|
|
33
|
+
*/
|
|
34
|
+
guardrailId: string;
|
|
35
|
+
/**
|
|
36
|
+
* User ID of who made the assignment
|
|
37
|
+
*/
|
|
38
|
+
assignedBy: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* ISO 8601 timestamp of when the assignment was created
|
|
41
|
+
*/
|
|
42
|
+
createdAt: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* List of member assignments
|
|
46
|
+
*/
|
|
47
|
+
export type ListGuardrailMemberAssignmentsResponse = {
|
|
48
|
+
/**
|
|
49
|
+
* List of member assignments
|
|
50
|
+
*/
|
|
51
|
+
data: Array<ListGuardrailMemberAssignmentsData>;
|
|
52
|
+
/**
|
|
53
|
+
* Total number of member assignments
|
|
54
|
+
*/
|
|
55
|
+
totalCount: number;
|
|
56
|
+
};
|
|
57
|
+
/** @internal */
|
|
58
|
+
export type ListGuardrailMemberAssignmentsRequest$Outbound = {
|
|
59
|
+
id: string;
|
|
60
|
+
offset?: string | undefined;
|
|
61
|
+
limit?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
/** @internal */
|
|
64
|
+
export declare const ListGuardrailMemberAssignmentsRequest$outboundSchema: z.ZodType<ListGuardrailMemberAssignmentsRequest$Outbound, ListGuardrailMemberAssignmentsRequest>;
|
|
65
|
+
export declare function listGuardrailMemberAssignmentsRequestToJSON(listGuardrailMemberAssignmentsRequest: ListGuardrailMemberAssignmentsRequest): string;
|
|
66
|
+
/** @internal */
|
|
67
|
+
export declare const ListGuardrailMemberAssignmentsData$inboundSchema: z.ZodType<ListGuardrailMemberAssignmentsData, unknown>;
|
|
68
|
+
export declare function listGuardrailMemberAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListGuardrailMemberAssignmentsData, SDKValidationError>;
|
|
69
|
+
/** @internal */
|
|
70
|
+
export declare const ListGuardrailMemberAssignmentsResponse$inboundSchema: z.ZodType<ListGuardrailMemberAssignmentsResponse, unknown>;
|
|
71
|
+
export declare function listGuardrailMemberAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListGuardrailMemberAssignmentsResponse, SDKValidationError>;
|
|
72
|
+
//# sourceMappingURL=listguardrailmemberassignments.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 37ee24c57c33
|
|
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 ListGuardrailMemberAssignmentsRequest$outboundSchema = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
offset: z.string().optional(),
|
|
12
|
+
limit: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
export function listGuardrailMemberAssignmentsRequestToJSON(listGuardrailMemberAssignmentsRequest) {
|
|
15
|
+
return JSON.stringify(ListGuardrailMemberAssignmentsRequest$outboundSchema.parse(listGuardrailMemberAssignmentsRequest));
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ListGuardrailMemberAssignmentsData$inboundSchema = z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
user_id: z.string(),
|
|
21
|
+
organization_id: z.string(),
|
|
22
|
+
guardrail_id: z.string(),
|
|
23
|
+
assigned_by: z.nullable(z.string()),
|
|
24
|
+
created_at: z.string(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"user_id": "userId",
|
|
28
|
+
"organization_id": "organizationId",
|
|
29
|
+
"guardrail_id": "guardrailId",
|
|
30
|
+
"assigned_by": "assignedBy",
|
|
31
|
+
"created_at": "createdAt",
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
export function listGuardrailMemberAssignmentsDataFromJSON(jsonString) {
|
|
35
|
+
return safeParse(jsonString, (x) => ListGuardrailMemberAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailMemberAssignmentsData' from JSON`);
|
|
36
|
+
}
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ListGuardrailMemberAssignmentsResponse$inboundSchema = z.object({
|
|
39
|
+
data: z.array(z.lazy(() => ListGuardrailMemberAssignmentsData$inboundSchema)),
|
|
40
|
+
total_count: z.number(),
|
|
41
|
+
}).transform((v) => {
|
|
42
|
+
return remap$(v, {
|
|
43
|
+
"total_count": "totalCount",
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
export function listGuardrailMemberAssignmentsResponseFromJSON(jsonString) {
|
|
47
|
+
return safeParse(jsonString, (x) => ListGuardrailMemberAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailMemberAssignmentsResponse' from JSON`);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=listguardrailmemberassignments.js.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
+
export type ListGuardrailsRequest = {
|
|
6
|
+
/**
|
|
7
|
+
* Number of records to skip for pagination
|
|
8
|
+
*/
|
|
9
|
+
offset?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum number of records to return (max 100)
|
|
12
|
+
*/
|
|
13
|
+
limit?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
17
|
+
*/
|
|
18
|
+
export declare const ListGuardrailsResetInterval: {
|
|
19
|
+
readonly Daily: "daily";
|
|
20
|
+
readonly Weekly: "weekly";
|
|
21
|
+
readonly Monthly: "monthly";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
25
|
+
*/
|
|
26
|
+
export type ListGuardrailsResetInterval = OpenEnum<typeof ListGuardrailsResetInterval>;
|
|
27
|
+
export type ListGuardrailsData = {
|
|
28
|
+
/**
|
|
29
|
+
* Unique identifier for the guardrail
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
/**
|
|
33
|
+
* Name of the guardrail
|
|
34
|
+
*/
|
|
35
|
+
name: string;
|
|
36
|
+
/**
|
|
37
|
+
* Description of the guardrail
|
|
38
|
+
*/
|
|
39
|
+
description?: string | null | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Spending limit in USD
|
|
42
|
+
*/
|
|
43
|
+
limitUsd?: number | null | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
46
|
+
*/
|
|
47
|
+
resetInterval?: ListGuardrailsResetInterval | null | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* List of allowed provider IDs
|
|
50
|
+
*/
|
|
51
|
+
allowedProviders?: Array<string> | null | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Array of model canonical_slugs (immutable identifiers)
|
|
54
|
+
*/
|
|
55
|
+
allowedModels?: Array<string> | null | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to enforce zero data retention
|
|
58
|
+
*/
|
|
59
|
+
enforceZdr?: boolean | null | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* ISO 8601 timestamp of when the guardrail was created
|
|
62
|
+
*/
|
|
63
|
+
createdAt: string;
|
|
64
|
+
/**
|
|
65
|
+
* ISO 8601 timestamp of when the guardrail was last updated
|
|
66
|
+
*/
|
|
67
|
+
updatedAt?: string | null | undefined;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* List of guardrails
|
|
71
|
+
*/
|
|
72
|
+
export type ListGuardrailsResponse = {
|
|
73
|
+
/**
|
|
74
|
+
* List of guardrails
|
|
75
|
+
*/
|
|
76
|
+
data: Array<ListGuardrailsData>;
|
|
77
|
+
/**
|
|
78
|
+
* Total number of guardrails
|
|
79
|
+
*/
|
|
80
|
+
totalCount: number;
|
|
81
|
+
};
|
|
82
|
+
/** @internal */
|
|
83
|
+
export type ListGuardrailsRequest$Outbound = {
|
|
84
|
+
offset?: string | undefined;
|
|
85
|
+
limit?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
/** @internal */
|
|
88
|
+
export declare const ListGuardrailsRequest$outboundSchema: z.ZodType<ListGuardrailsRequest$Outbound, ListGuardrailsRequest>;
|
|
89
|
+
export declare function listGuardrailsRequestToJSON(listGuardrailsRequest: ListGuardrailsRequest): string;
|
|
90
|
+
/** @internal */
|
|
91
|
+
export declare const ListGuardrailsResetInterval$inboundSchema: z.ZodType<ListGuardrailsResetInterval, unknown>;
|
|
92
|
+
/** @internal */
|
|
93
|
+
export declare const ListGuardrailsData$inboundSchema: z.ZodType<ListGuardrailsData, unknown>;
|
|
94
|
+
export declare function listGuardrailsDataFromJSON(jsonString: string): SafeParseResult<ListGuardrailsData, SDKValidationError>;
|
|
95
|
+
/** @internal */
|
|
96
|
+
export declare const ListGuardrailsResponse$inboundSchema: z.ZodType<ListGuardrailsResponse, unknown>;
|
|
97
|
+
export declare function listGuardrailsResponseFromJSON(jsonString: string): SafeParseResult<ListGuardrailsResponse, SDKValidationError>;
|
|
98
|
+
//# sourceMappingURL=listguardrails.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4c71cf4db173
|
|
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 * as openEnums from "../../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
11
|
+
*/
|
|
12
|
+
export const ListGuardrailsResetInterval = {
|
|
13
|
+
Daily: "daily",
|
|
14
|
+
Weekly: "weekly",
|
|
15
|
+
Monthly: "monthly",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ListGuardrailsRequest$outboundSchema = z.object({
|
|
19
|
+
offset: z.string().optional(),
|
|
20
|
+
limit: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
export function listGuardrailsRequestToJSON(listGuardrailsRequest) {
|
|
23
|
+
return JSON.stringify(ListGuardrailsRequest$outboundSchema.parse(listGuardrailsRequest));
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const ListGuardrailsResetInterval$inboundSchema = openEnums.inboundSchema(ListGuardrailsResetInterval);
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const ListGuardrailsData$inboundSchema = z.object({
|
|
29
|
+
id: z.string(),
|
|
30
|
+
name: z.string(),
|
|
31
|
+
description: z.nullable(z.string()).optional(),
|
|
32
|
+
limit_usd: z.nullable(z.number()).optional(),
|
|
33
|
+
reset_interval: z.nullable(ListGuardrailsResetInterval$inboundSchema)
|
|
34
|
+
.optional(),
|
|
35
|
+
allowed_providers: z.nullable(z.array(z.string())).optional(),
|
|
36
|
+
allowed_models: z.nullable(z.array(z.string())).optional(),
|
|
37
|
+
enforce_zdr: z.nullable(z.boolean()).optional(),
|
|
38
|
+
created_at: z.string(),
|
|
39
|
+
updated_at: z.nullable(z.string()).optional(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"limit_usd": "limitUsd",
|
|
43
|
+
"reset_interval": "resetInterval",
|
|
44
|
+
"allowed_providers": "allowedProviders",
|
|
45
|
+
"allowed_models": "allowedModels",
|
|
46
|
+
"enforce_zdr": "enforceZdr",
|
|
47
|
+
"created_at": "createdAt",
|
|
48
|
+
"updated_at": "updatedAt",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
export function listGuardrailsDataFromJSON(jsonString) {
|
|
52
|
+
return safeParse(jsonString, (x) => ListGuardrailsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailsData' from JSON`);
|
|
53
|
+
}
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const ListGuardrailsResponse$inboundSchema = z.object({
|
|
56
|
+
data: z.array(z.lazy(() => ListGuardrailsData$inboundSchema)),
|
|
57
|
+
total_count: z.number(),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
"total_count": "totalCount",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export function listGuardrailsResponseFromJSON(jsonString) {
|
|
64
|
+
return safeParse(jsonString, (x) => ListGuardrailsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailsResponse' from JSON`);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=listguardrails.js.map
|