@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,71 @@
|
|
|
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 ListKeyAssignmentsRequest = {
|
|
5
|
+
/**
|
|
6
|
+
* Number of records to skip for pagination
|
|
7
|
+
*/
|
|
8
|
+
offset?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Maximum number of records to return (max 100)
|
|
11
|
+
*/
|
|
12
|
+
limit?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type ListKeyAssignmentsData = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier for the assignment
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* Hash of the assigned API key
|
|
21
|
+
*/
|
|
22
|
+
keyHash: string;
|
|
23
|
+
/**
|
|
24
|
+
* ID of the guardrail
|
|
25
|
+
*/
|
|
26
|
+
guardrailId: string;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the API key
|
|
29
|
+
*/
|
|
30
|
+
keyName: string;
|
|
31
|
+
/**
|
|
32
|
+
* Label of the API key
|
|
33
|
+
*/
|
|
34
|
+
keyLabel: 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 key assignments
|
|
46
|
+
*/
|
|
47
|
+
export type ListKeyAssignmentsResponse = {
|
|
48
|
+
/**
|
|
49
|
+
* List of key assignments
|
|
50
|
+
*/
|
|
51
|
+
data: Array<ListKeyAssignmentsData>;
|
|
52
|
+
/**
|
|
53
|
+
* Total number of key assignments for this guardrail
|
|
54
|
+
*/
|
|
55
|
+
totalCount: number;
|
|
56
|
+
};
|
|
57
|
+
/** @internal */
|
|
58
|
+
export type ListKeyAssignmentsRequest$Outbound = {
|
|
59
|
+
offset?: string | undefined;
|
|
60
|
+
limit?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
/** @internal */
|
|
63
|
+
export declare const ListKeyAssignmentsRequest$outboundSchema: z.ZodType<ListKeyAssignmentsRequest$Outbound, ListKeyAssignmentsRequest>;
|
|
64
|
+
export declare function listKeyAssignmentsRequestToJSON(listKeyAssignmentsRequest: ListKeyAssignmentsRequest): string;
|
|
65
|
+
/** @internal */
|
|
66
|
+
export declare const ListKeyAssignmentsData$inboundSchema: z.ZodType<ListKeyAssignmentsData, unknown>;
|
|
67
|
+
export declare function listKeyAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListKeyAssignmentsData, SDKValidationError>;
|
|
68
|
+
/** @internal */
|
|
69
|
+
export declare const ListKeyAssignmentsResponse$inboundSchema: z.ZodType<ListKeyAssignmentsResponse, unknown>;
|
|
70
|
+
export declare function listKeyAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListKeyAssignmentsResponse, SDKValidationError>;
|
|
71
|
+
//# sourceMappingURL=listkeyassignments.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: c4b0c0303428
|
|
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 ListKeyAssignmentsRequest$outboundSchema = z.object({
|
|
10
|
+
offset: z.string().optional(),
|
|
11
|
+
limit: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
export function listKeyAssignmentsRequestToJSON(listKeyAssignmentsRequest) {
|
|
14
|
+
return JSON.stringify(ListKeyAssignmentsRequest$outboundSchema.parse(listKeyAssignmentsRequest));
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ListKeyAssignmentsData$inboundSchema = z.object({
|
|
18
|
+
id: z.string(),
|
|
19
|
+
key_hash: z.string(),
|
|
20
|
+
guardrail_id: z.string(),
|
|
21
|
+
key_name: z.string(),
|
|
22
|
+
key_label: z.string(),
|
|
23
|
+
assigned_by: z.nullable(z.string()),
|
|
24
|
+
created_at: z.string(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"key_hash": "keyHash",
|
|
28
|
+
"guardrail_id": "guardrailId",
|
|
29
|
+
"key_name": "keyName",
|
|
30
|
+
"key_label": "keyLabel",
|
|
31
|
+
"assigned_by": "assignedBy",
|
|
32
|
+
"created_at": "createdAt",
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
export function listKeyAssignmentsDataFromJSON(jsonString) {
|
|
36
|
+
return safeParse(jsonString, (x) => ListKeyAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKeyAssignmentsData' from JSON`);
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const ListKeyAssignmentsResponse$inboundSchema = z.object({
|
|
40
|
+
data: z.array(z.lazy(() => ListKeyAssignmentsData$inboundSchema)),
|
|
41
|
+
total_count: z.number(),
|
|
42
|
+
}).transform((v) => {
|
|
43
|
+
return remap$(v, {
|
|
44
|
+
"total_count": "totalCount",
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
export function listKeyAssignmentsResponseFromJSON(jsonString) {
|
|
48
|
+
return safeParse(jsonString, (x) => ListKeyAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKeyAssignmentsResponse' from JSON`);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=listkeyassignments.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
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 ListMemberAssignmentsRequest = {
|
|
5
|
+
/**
|
|
6
|
+
* Number of records to skip for pagination
|
|
7
|
+
*/
|
|
8
|
+
offset?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Maximum number of records to return (max 100)
|
|
11
|
+
*/
|
|
12
|
+
limit?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type ListMemberAssignmentsData = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier for the assignment
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* Clerk user ID of the assigned member
|
|
21
|
+
*/
|
|
22
|
+
userId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Organization ID
|
|
25
|
+
*/
|
|
26
|
+
organizationId: string;
|
|
27
|
+
/**
|
|
28
|
+
* ID of the guardrail
|
|
29
|
+
*/
|
|
30
|
+
guardrailId: string;
|
|
31
|
+
/**
|
|
32
|
+
* User ID of who made the assignment
|
|
33
|
+
*/
|
|
34
|
+
assignedBy: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* ISO 8601 timestamp of when the assignment was created
|
|
37
|
+
*/
|
|
38
|
+
createdAt: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* List of member assignments
|
|
42
|
+
*/
|
|
43
|
+
export type ListMemberAssignmentsResponse = {
|
|
44
|
+
/**
|
|
45
|
+
* List of member assignments
|
|
46
|
+
*/
|
|
47
|
+
data: Array<ListMemberAssignmentsData>;
|
|
48
|
+
/**
|
|
49
|
+
* Total number of member assignments
|
|
50
|
+
*/
|
|
51
|
+
totalCount: number;
|
|
52
|
+
};
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type ListMemberAssignmentsRequest$Outbound = {
|
|
55
|
+
offset?: string | undefined;
|
|
56
|
+
limit?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare const ListMemberAssignmentsRequest$outboundSchema: z.ZodType<ListMemberAssignmentsRequest$Outbound, ListMemberAssignmentsRequest>;
|
|
60
|
+
export declare function listMemberAssignmentsRequestToJSON(listMemberAssignmentsRequest: ListMemberAssignmentsRequest): string;
|
|
61
|
+
/** @internal */
|
|
62
|
+
export declare const ListMemberAssignmentsData$inboundSchema: z.ZodType<ListMemberAssignmentsData, unknown>;
|
|
63
|
+
export declare function listMemberAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListMemberAssignmentsData, SDKValidationError>;
|
|
64
|
+
/** @internal */
|
|
65
|
+
export declare const ListMemberAssignmentsResponse$inboundSchema: z.ZodType<ListMemberAssignmentsResponse, unknown>;
|
|
66
|
+
export declare function listMemberAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListMemberAssignmentsResponse, SDKValidationError>;
|
|
67
|
+
//# sourceMappingURL=listmemberassignments.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7d02937e1a11
|
|
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 ListMemberAssignmentsRequest$outboundSchema = z.object({
|
|
10
|
+
offset: z.string().optional(),
|
|
11
|
+
limit: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
export function listMemberAssignmentsRequestToJSON(listMemberAssignmentsRequest) {
|
|
14
|
+
return JSON.stringify(ListMemberAssignmentsRequest$outboundSchema.parse(listMemberAssignmentsRequest));
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ListMemberAssignmentsData$inboundSchema = z.object({
|
|
18
|
+
id: z.string(),
|
|
19
|
+
user_id: z.string(),
|
|
20
|
+
organization_id: z.string(),
|
|
21
|
+
guardrail_id: z.string(),
|
|
22
|
+
assigned_by: z.nullable(z.string()),
|
|
23
|
+
created_at: z.string(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"user_id": "userId",
|
|
27
|
+
"organization_id": "organizationId",
|
|
28
|
+
"guardrail_id": "guardrailId",
|
|
29
|
+
"assigned_by": "assignedBy",
|
|
30
|
+
"created_at": "createdAt",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
export function listMemberAssignmentsDataFromJSON(jsonString) {
|
|
34
|
+
return safeParse(jsonString, (x) => ListMemberAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListMemberAssignmentsData' from JSON`);
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ListMemberAssignmentsResponse$inboundSchema = z.object({
|
|
38
|
+
data: z.array(z.lazy(() => ListMemberAssignmentsData$inboundSchema)),
|
|
39
|
+
total_count: z.number(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"total_count": "totalCount",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
export function listMemberAssignmentsResponseFromJSON(jsonString) {
|
|
46
|
+
return safeParse(jsonString, (x) => ListMemberAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListMemberAssignmentsResponse' from JSON`);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=listmemberassignments.js.map
|
|
@@ -0,0 +1,151 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
7
|
+
*/
|
|
8
|
+
export declare const UpdateGuardrailResetIntervalRequest: {
|
|
9
|
+
readonly Daily: "daily";
|
|
10
|
+
readonly Weekly: "weekly";
|
|
11
|
+
readonly Monthly: "monthly";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
15
|
+
*/
|
|
16
|
+
export type UpdateGuardrailResetIntervalRequest = OpenEnum<typeof UpdateGuardrailResetIntervalRequest>;
|
|
17
|
+
export type UpdateGuardrailRequestBody = {
|
|
18
|
+
/**
|
|
19
|
+
* New name for the guardrail
|
|
20
|
+
*/
|
|
21
|
+
name?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* New description for the guardrail
|
|
24
|
+
*/
|
|
25
|
+
description?: string | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* New spending limit in USD
|
|
28
|
+
*/
|
|
29
|
+
limitUsd?: number | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
32
|
+
*/
|
|
33
|
+
resetInterval?: UpdateGuardrailResetIntervalRequest | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* New list of allowed provider IDs
|
|
36
|
+
*/
|
|
37
|
+
allowedProviders?: Array<string> | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Array of model identifiers (slug or canonical_slug accepted)
|
|
40
|
+
*/
|
|
41
|
+
allowedModels?: Array<string> | null | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to enforce zero data retention
|
|
44
|
+
*/
|
|
45
|
+
enforceZdr?: boolean | null | undefined;
|
|
46
|
+
};
|
|
47
|
+
export type UpdateGuardrailRequest = {
|
|
48
|
+
/**
|
|
49
|
+
* The unique identifier of the guardrail to update
|
|
50
|
+
*/
|
|
51
|
+
id: string;
|
|
52
|
+
requestBody: UpdateGuardrailRequestBody;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
56
|
+
*/
|
|
57
|
+
export declare const UpdateGuardrailResetIntervalResponse: {
|
|
58
|
+
readonly Daily: "daily";
|
|
59
|
+
readonly Weekly: "weekly";
|
|
60
|
+
readonly Monthly: "monthly";
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
64
|
+
*/
|
|
65
|
+
export type UpdateGuardrailResetIntervalResponse = OpenEnum<typeof UpdateGuardrailResetIntervalResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* The updated guardrail
|
|
68
|
+
*/
|
|
69
|
+
export type UpdateGuardrailData = {
|
|
70
|
+
/**
|
|
71
|
+
* Unique identifier for the guardrail
|
|
72
|
+
*/
|
|
73
|
+
id: string;
|
|
74
|
+
/**
|
|
75
|
+
* Name of the guardrail
|
|
76
|
+
*/
|
|
77
|
+
name: string;
|
|
78
|
+
/**
|
|
79
|
+
* Description of the guardrail
|
|
80
|
+
*/
|
|
81
|
+
description?: string | null | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Spending limit in USD
|
|
84
|
+
*/
|
|
85
|
+
limitUsd?: number | null | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
88
|
+
*/
|
|
89
|
+
resetInterval?: UpdateGuardrailResetIntervalResponse | null | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* List of allowed provider IDs
|
|
92
|
+
*/
|
|
93
|
+
allowedProviders?: Array<string> | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Array of model canonical_slugs (immutable identifiers)
|
|
96
|
+
*/
|
|
97
|
+
allowedModels?: Array<string> | null | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Whether to enforce zero data retention
|
|
100
|
+
*/
|
|
101
|
+
enforceZdr?: boolean | null | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* ISO 8601 timestamp of when the guardrail was created
|
|
104
|
+
*/
|
|
105
|
+
createdAt: string;
|
|
106
|
+
/**
|
|
107
|
+
* ISO 8601 timestamp of when the guardrail was last updated
|
|
108
|
+
*/
|
|
109
|
+
updatedAt?: string | null | undefined;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Guardrail updated successfully
|
|
113
|
+
*/
|
|
114
|
+
export type UpdateGuardrailResponse = {
|
|
115
|
+
/**
|
|
116
|
+
* The updated guardrail
|
|
117
|
+
*/
|
|
118
|
+
data: UpdateGuardrailData;
|
|
119
|
+
};
|
|
120
|
+
/** @internal */
|
|
121
|
+
export declare const UpdateGuardrailResetIntervalRequest$outboundSchema: z.ZodType<string, UpdateGuardrailResetIntervalRequest>;
|
|
122
|
+
/** @internal */
|
|
123
|
+
export type UpdateGuardrailRequestBody$Outbound = {
|
|
124
|
+
name?: string | undefined;
|
|
125
|
+
description?: string | null | undefined;
|
|
126
|
+
limit_usd?: number | null | undefined;
|
|
127
|
+
reset_interval?: string | null | undefined;
|
|
128
|
+
allowed_providers?: Array<string> | null | undefined;
|
|
129
|
+
allowed_models?: Array<string> | null | undefined;
|
|
130
|
+
enforce_zdr?: boolean | null | undefined;
|
|
131
|
+
};
|
|
132
|
+
/** @internal */
|
|
133
|
+
export declare const UpdateGuardrailRequestBody$outboundSchema: z.ZodType<UpdateGuardrailRequestBody$Outbound, UpdateGuardrailRequestBody>;
|
|
134
|
+
export declare function updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody: UpdateGuardrailRequestBody): string;
|
|
135
|
+
/** @internal */
|
|
136
|
+
export type UpdateGuardrailRequest$Outbound = {
|
|
137
|
+
id: string;
|
|
138
|
+
RequestBody: UpdateGuardrailRequestBody$Outbound;
|
|
139
|
+
};
|
|
140
|
+
/** @internal */
|
|
141
|
+
export declare const UpdateGuardrailRequest$outboundSchema: z.ZodType<UpdateGuardrailRequest$Outbound, UpdateGuardrailRequest>;
|
|
142
|
+
export declare function updateGuardrailRequestToJSON(updateGuardrailRequest: UpdateGuardrailRequest): string;
|
|
143
|
+
/** @internal */
|
|
144
|
+
export declare const UpdateGuardrailResetIntervalResponse$inboundSchema: z.ZodType<UpdateGuardrailResetIntervalResponse, unknown>;
|
|
145
|
+
/** @internal */
|
|
146
|
+
export declare const UpdateGuardrailData$inboundSchema: z.ZodType<UpdateGuardrailData, unknown>;
|
|
147
|
+
export declare function updateGuardrailDataFromJSON(jsonString: string): SafeParseResult<UpdateGuardrailData, SDKValidationError>;
|
|
148
|
+
/** @internal */
|
|
149
|
+
export declare const UpdateGuardrailResponse$inboundSchema: z.ZodType<UpdateGuardrailResponse, unknown>;
|
|
150
|
+
export declare function updateGuardrailResponseFromJSON(jsonString: string): SafeParseResult<UpdateGuardrailResponse, SDKValidationError>;
|
|
151
|
+
//# sourceMappingURL=updateguardrail.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d4106fbc6dca
|
|
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 UpdateGuardrailResetIntervalRequest = {
|
|
13
|
+
Daily: "daily",
|
|
14
|
+
Weekly: "weekly",
|
|
15
|
+
Monthly: "monthly",
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Interval at which the limit resets (daily, weekly, monthly)
|
|
19
|
+
*/
|
|
20
|
+
export const UpdateGuardrailResetIntervalResponse = {
|
|
21
|
+
Daily: "daily",
|
|
22
|
+
Weekly: "weekly",
|
|
23
|
+
Monthly: "monthly",
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const UpdateGuardrailResetIntervalRequest$outboundSchema = openEnums.outboundSchema(UpdateGuardrailResetIntervalRequest);
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const UpdateGuardrailRequestBody$outboundSchema = z.object({
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
description: z.nullable(z.string()).optional(),
|
|
31
|
+
limitUsd: z.nullable(z.number()).optional(),
|
|
32
|
+
resetInterval: z.nullable(UpdateGuardrailResetIntervalRequest$outboundSchema)
|
|
33
|
+
.optional(),
|
|
34
|
+
allowedProviders: z.nullable(z.array(z.string())).optional(),
|
|
35
|
+
allowedModels: z.nullable(z.array(z.string())).optional(),
|
|
36
|
+
enforceZdr: z.nullable(z.boolean()).optional(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
limitUsd: "limit_usd",
|
|
40
|
+
resetInterval: "reset_interval",
|
|
41
|
+
allowedProviders: "allowed_providers",
|
|
42
|
+
allowedModels: "allowed_models",
|
|
43
|
+
enforceZdr: "enforce_zdr",
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
export function updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody) {
|
|
47
|
+
return JSON.stringify(UpdateGuardrailRequestBody$outboundSchema.parse(updateGuardrailRequestBody));
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const UpdateGuardrailRequest$outboundSchema = z.object({
|
|
51
|
+
id: z.string(),
|
|
52
|
+
requestBody: z.lazy(() => UpdateGuardrailRequestBody$outboundSchema),
|
|
53
|
+
}).transform((v) => {
|
|
54
|
+
return remap$(v, {
|
|
55
|
+
requestBody: "RequestBody",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
export function updateGuardrailRequestToJSON(updateGuardrailRequest) {
|
|
59
|
+
return JSON.stringify(UpdateGuardrailRequest$outboundSchema.parse(updateGuardrailRequest));
|
|
60
|
+
}
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const UpdateGuardrailResetIntervalResponse$inboundSchema = openEnums.inboundSchema(UpdateGuardrailResetIntervalResponse);
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const UpdateGuardrailData$inboundSchema = z.object({
|
|
65
|
+
id: z.string(),
|
|
66
|
+
name: z.string(),
|
|
67
|
+
description: z.nullable(z.string()).optional(),
|
|
68
|
+
limit_usd: z.nullable(z.number()).optional(),
|
|
69
|
+
reset_interval: z.nullable(UpdateGuardrailResetIntervalResponse$inboundSchema)
|
|
70
|
+
.optional(),
|
|
71
|
+
allowed_providers: z.nullable(z.array(z.string())).optional(),
|
|
72
|
+
allowed_models: z.nullable(z.array(z.string())).optional(),
|
|
73
|
+
enforce_zdr: z.nullable(z.boolean()).optional(),
|
|
74
|
+
created_at: z.string(),
|
|
75
|
+
updated_at: z.nullable(z.string()).optional(),
|
|
76
|
+
}).transform((v) => {
|
|
77
|
+
return remap$(v, {
|
|
78
|
+
"limit_usd": "limitUsd",
|
|
79
|
+
"reset_interval": "resetInterval",
|
|
80
|
+
"allowed_providers": "allowedProviders",
|
|
81
|
+
"allowed_models": "allowedModels",
|
|
82
|
+
"enforce_zdr": "enforceZdr",
|
|
83
|
+
"created_at": "createdAt",
|
|
84
|
+
"updated_at": "updatedAt",
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
export function updateGuardrailDataFromJSON(jsonString) {
|
|
88
|
+
return safeParse(jsonString, (x) => UpdateGuardrailData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateGuardrailData' from JSON`);
|
|
89
|
+
}
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const UpdateGuardrailResponse$inboundSchema = z.object({
|
|
92
|
+
data: z.lazy(() => UpdateGuardrailData$inboundSchema),
|
|
93
|
+
});
|
|
94
|
+
export function updateGuardrailResponseFromJSON(jsonString) {
|
|
95
|
+
return safeParse(jsonString, (x) => UpdateGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateGuardrailResponse' from JSON`);
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=updateguardrail.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: 04b7597c84f9
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { PercentileThroughputCutoffs$outboundSchema, } from "./percentilethroughputcutoffs.js";
|
|
@@ -0,0 +1,92 @@
|
|
|
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 declare const Schema4: {
|
|
6
|
+
readonly Unknown: "unknown";
|
|
7
|
+
readonly OpenaiResponsesV1: "openai-responses-v1";
|
|
8
|
+
readonly AzureOpenaiResponsesV1: "azure-openai-responses-v1";
|
|
9
|
+
readonly XaiResponsesV1: "xai-responses-v1";
|
|
10
|
+
readonly AnthropicClaudeV1: "anthropic-claude-v1";
|
|
11
|
+
readonly GoogleGeminiV1: "google-gemini-v1";
|
|
12
|
+
};
|
|
13
|
+
export type Schema4 = OpenEnum<typeof Schema4>;
|
|
14
|
+
export type Schema2ReasoningText = {
|
|
15
|
+
type: "reasoning.text";
|
|
16
|
+
text?: string | null | undefined;
|
|
17
|
+
signature?: string | null | undefined;
|
|
18
|
+
id?: string | null | undefined;
|
|
19
|
+
format?: Schema4 | null | undefined;
|
|
20
|
+
index?: number | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type Schema2ReasoningEncrypted = {
|
|
23
|
+
type: "reasoning.encrypted";
|
|
24
|
+
data: string;
|
|
25
|
+
id?: string | null | undefined;
|
|
26
|
+
format?: Schema4 | null | undefined;
|
|
27
|
+
index?: number | undefined;
|
|
28
|
+
};
|
|
29
|
+
export type Schema2ReasoningSummary = {
|
|
30
|
+
type: "reasoning.summary";
|
|
31
|
+
summary: string;
|
|
32
|
+
id?: string | null | undefined;
|
|
33
|
+
format?: Schema4 | null | undefined;
|
|
34
|
+
index?: number | undefined;
|
|
35
|
+
};
|
|
36
|
+
export type Schema2 = Schema2ReasoningSummary | Schema2ReasoningEncrypted | Schema2ReasoningText;
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const Schema4$inboundSchema: z.ZodType<Schema4, unknown>;
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const Schema4$outboundSchema: z.ZodType<string, Schema4>;
|
|
41
|
+
/** @internal */
|
|
42
|
+
export declare const Schema2ReasoningText$inboundSchema: z.ZodType<Schema2ReasoningText, unknown>;
|
|
43
|
+
/** @internal */
|
|
44
|
+
export type Schema2ReasoningText$Outbound = {
|
|
45
|
+
type: "reasoning.text";
|
|
46
|
+
text?: string | null | undefined;
|
|
47
|
+
signature?: string | null | undefined;
|
|
48
|
+
id?: string | null | undefined;
|
|
49
|
+
format?: string | null | undefined;
|
|
50
|
+
index?: number | undefined;
|
|
51
|
+
};
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare const Schema2ReasoningText$outboundSchema: z.ZodType<Schema2ReasoningText$Outbound, Schema2ReasoningText>;
|
|
54
|
+
export declare function schema2ReasoningTextToJSON(schema2ReasoningText: Schema2ReasoningText): string;
|
|
55
|
+
export declare function schema2ReasoningTextFromJSON(jsonString: string): SafeParseResult<Schema2ReasoningText, SDKValidationError>;
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare const Schema2ReasoningEncrypted$inboundSchema: z.ZodType<Schema2ReasoningEncrypted, unknown>;
|
|
58
|
+
/** @internal */
|
|
59
|
+
export type Schema2ReasoningEncrypted$Outbound = {
|
|
60
|
+
type: "reasoning.encrypted";
|
|
61
|
+
data: string;
|
|
62
|
+
id?: string | null | undefined;
|
|
63
|
+
format?: string | null | undefined;
|
|
64
|
+
index?: number | undefined;
|
|
65
|
+
};
|
|
66
|
+
/** @internal */
|
|
67
|
+
export declare const Schema2ReasoningEncrypted$outboundSchema: z.ZodType<Schema2ReasoningEncrypted$Outbound, Schema2ReasoningEncrypted>;
|
|
68
|
+
export declare function schema2ReasoningEncryptedToJSON(schema2ReasoningEncrypted: Schema2ReasoningEncrypted): string;
|
|
69
|
+
export declare function schema2ReasoningEncryptedFromJSON(jsonString: string): SafeParseResult<Schema2ReasoningEncrypted, SDKValidationError>;
|
|
70
|
+
/** @internal */
|
|
71
|
+
export declare const Schema2ReasoningSummary$inboundSchema: z.ZodType<Schema2ReasoningSummary, unknown>;
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type Schema2ReasoningSummary$Outbound = {
|
|
74
|
+
type: "reasoning.summary";
|
|
75
|
+
summary: string;
|
|
76
|
+
id?: string | null | undefined;
|
|
77
|
+
format?: string | null | undefined;
|
|
78
|
+
index?: number | undefined;
|
|
79
|
+
};
|
|
80
|
+
/** @internal */
|
|
81
|
+
export declare const Schema2ReasoningSummary$outboundSchema: z.ZodType<Schema2ReasoningSummary$Outbound, Schema2ReasoningSummary>;
|
|
82
|
+
export declare function schema2ReasoningSummaryToJSON(schema2ReasoningSummary: Schema2ReasoningSummary): string;
|
|
83
|
+
export declare function schema2ReasoningSummaryFromJSON(jsonString: string): SafeParseResult<Schema2ReasoningSummary, SDKValidationError>;
|
|
84
|
+
/** @internal */
|
|
85
|
+
export declare const Schema2$inboundSchema: z.ZodType<Schema2, unknown>;
|
|
86
|
+
/** @internal */
|
|
87
|
+
export type Schema2$Outbound = Schema2ReasoningSummary$Outbound | Schema2ReasoningEncrypted$Outbound | Schema2ReasoningText$Outbound;
|
|
88
|
+
/** @internal */
|
|
89
|
+
export declare const Schema2$outboundSchema: z.ZodType<Schema2$Outbound, Schema2>;
|
|
90
|
+
export declare function schema2ToJSON(schema2: Schema2): string;
|
|
91
|
+
export declare function schema2FromJSON(jsonString: string): SafeParseResult<Schema2, SDKValidationError>;
|
|
92
|
+
//# sourceMappingURL=schema2.d.ts.map
|