@openrouter/sdk 0.3.12 → 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.
Files changed (172) hide show
  1. package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
  2. package/esm/funcs/analyticsGetUserActivity.js +1 -1
  3. package/esm/funcs/apiKeysCreate.d.ts +3 -0
  4. package/esm/funcs/apiKeysCreate.js +3 -0
  5. package/esm/funcs/apiKeysDelete.d.ts +3 -0
  6. package/esm/funcs/apiKeysDelete.js +3 -0
  7. package/esm/funcs/apiKeysGet.d.ts +3 -0
  8. package/esm/funcs/apiKeysGet.js +3 -0
  9. package/esm/funcs/apiKeysList.d.ts +3 -0
  10. package/esm/funcs/apiKeysList.js +3 -0
  11. package/esm/funcs/apiKeysUpdate.d.ts +3 -0
  12. package/esm/funcs/apiKeysUpdate.js +3 -0
  13. package/esm/funcs/call-model.js +9 -6
  14. package/esm/funcs/creditsGetCredits.d.ts +1 -1
  15. package/esm/funcs/creditsGetCredits.js +1 -1
  16. package/esm/funcs/guardrailsBulkAssignKeys.d.ts +18 -0
  17. package/esm/funcs/guardrailsBulkAssignKeys.js +89 -0
  18. package/esm/funcs/guardrailsBulkAssignMembers.d.ts +18 -0
  19. package/esm/funcs/guardrailsBulkAssignMembers.js +89 -0
  20. package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +18 -0
  21. package/esm/funcs/guardrailsBulkUnassignKeys.js +89 -0
  22. package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +18 -0
  23. package/esm/funcs/guardrailsBulkUnassignMembers.js +89 -0
  24. package/esm/funcs/guardrailsCreate.d.ts +18 -0
  25. package/esm/funcs/guardrailsCreate.js +83 -0
  26. package/esm/funcs/guardrailsDelete.d.ts +18 -0
  27. package/esm/funcs/guardrailsDelete.js +88 -0
  28. package/esm/funcs/{parametersGetParameters.d.ts → guardrailsGet.d.ts} +6 -3
  29. package/esm/funcs/guardrailsGet.js +88 -0
  30. package/esm/funcs/guardrailsList.d.ts +18 -0
  31. package/esm/funcs/guardrailsList.js +87 -0
  32. package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +18 -0
  33. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +93 -0
  34. package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +18 -0
  35. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +93 -0
  36. package/esm/funcs/guardrailsListKeyAssignments.d.ts +18 -0
  37. package/esm/funcs/guardrailsListKeyAssignments.js +87 -0
  38. package/esm/funcs/guardrailsListMemberAssignments.d.ts +18 -0
  39. package/esm/funcs/guardrailsListMemberAssignments.js +87 -0
  40. package/esm/funcs/guardrailsUpdate.d.ts +18 -0
  41. package/esm/funcs/{parametersGetParameters.js → guardrailsUpdate.js} +24 -32
  42. package/esm/index.d.ts +4 -3
  43. package/esm/index.js +3 -1
  44. package/esm/lib/anthropic-compat.test.js +3 -0
  45. package/esm/lib/async-params.d.ts +46 -6
  46. package/esm/lib/async-params.js +10 -2
  47. package/esm/lib/chat-compat.test.js +3 -0
  48. package/esm/lib/config.d.ts +2 -4
  49. package/esm/lib/config.js +2 -2
  50. package/esm/lib/conversation-state.d.ts +61 -0
  51. package/esm/lib/conversation-state.js +207 -0
  52. package/esm/lib/model-result.d.ts +175 -2
  53. package/esm/lib/model-result.js +678 -181
  54. package/esm/lib/tool-types.d.ts +109 -1
  55. package/esm/lib/tool-types.js +13 -0
  56. package/esm/lib/tool.d.ts +21 -1
  57. package/esm/lib/tool.js +7 -0
  58. package/esm/models/assistantmessage.d.ts +31 -0
  59. package/esm/models/assistantmessage.js +43 -0
  60. package/esm/models/chatgenerationparams.d.ts +93 -12
  61. package/esm/models/chatgenerationparams.js +75 -6
  62. package/esm/models/chatgenerationtokenusage.d.ts +1 -0
  63. package/esm/models/chatgenerationtokenusage.js +2 -0
  64. package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
  65. package/esm/models/chatmessagecontentitemimage.js +8 -9
  66. package/esm/models/chatmessagetokenlogprob.d.ts +4 -4
  67. package/esm/models/chatmessagetokenlogprob.js +4 -5
  68. package/esm/models/chatresponsechoice.d.ts +0 -2
  69. package/esm/models/chatresponsechoice.js +0 -3
  70. package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
  71. package/esm/models/chatstreamingmessagechunk.js +2 -2
  72. package/esm/models/index.d.ts +8 -1
  73. package/esm/models/index.js +8 -1
  74. package/esm/models/model.d.ts +4 -0
  75. package/esm/models/model.js +2 -0
  76. package/esm/models/openairesponsesinputunion.d.ts +15 -5
  77. package/esm/models/openairesponsesinputunion.js +5 -5
  78. package/esm/models/openresponseseasyinputmessage.d.ts +41 -16
  79. package/esm/models/openresponseseasyinputmessage.js +38 -13
  80. package/esm/models/openresponsesinputmessageitem.d.ts +37 -12
  81. package/esm/models/openresponsesinputmessageitem.js +33 -9
  82. package/esm/models/openresponsesnonstreamingresponse.d.ts +5 -2
  83. package/esm/models/openresponsesnonstreamingresponse.js +8 -2
  84. package/esm/models/openresponsesreasoning.d.ts +1 -0
  85. package/esm/models/openresponsesreasoning.js +1 -0
  86. package/esm/models/openresponsesrequest.d.ts +61 -24
  87. package/esm/models/openresponsesrequest.js +39 -6
  88. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
  89. package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
  90. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
  91. package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
  92. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
  93. package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
  94. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
  95. package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
  96. package/esm/models/operations/createguardrail.d.ts +136 -0
  97. package/esm/models/operations/createguardrail.js +85 -0
  98. package/esm/models/operations/deleteguardrail.d.ts +29 -0
  99. package/esm/models/operations/deleteguardrail.js +21 -0
  100. package/esm/models/operations/getgeneration.d.ts +4 -0
  101. package/esm/models/operations/getgeneration.js +1 -0
  102. package/esm/models/operations/getguardrail.d.ts +92 -0
  103. package/esm/models/operations/getguardrail.js +60 -0
  104. package/esm/models/operations/getmodels.d.ts +28 -1
  105. package/esm/models/operations/getmodels.js +22 -1
  106. package/esm/models/operations/index.d.ts +13 -1
  107. package/esm/models/operations/index.js +13 -1
  108. package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
  109. package/esm/models/operations/listguardrailkeyassignments.js +51 -0
  110. package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
  111. package/esm/models/operations/listguardrailmemberassignments.js +49 -0
  112. package/esm/models/operations/listguardrails.d.ts +98 -0
  113. package/esm/models/operations/listguardrails.js +66 -0
  114. package/esm/models/operations/listkeyassignments.d.ts +71 -0
  115. package/esm/models/operations/listkeyassignments.js +50 -0
  116. package/esm/models/operations/listmemberassignments.d.ts +67 -0
  117. package/esm/models/operations/listmemberassignments.js +48 -0
  118. package/esm/models/operations/updateguardrail.d.ts +151 -0
  119. package/esm/models/operations/updateguardrail.js +97 -0
  120. package/esm/models/percentilelatencycutoffs.d.ts +33 -0
  121. package/esm/models/percentilelatencycutoffs.js +16 -0
  122. package/esm/models/percentilestats.d.ts +28 -0
  123. package/esm/models/percentilestats.js +17 -0
  124. package/esm/models/percentilethroughputcutoffs.d.ts +33 -0
  125. package/esm/models/percentilethroughputcutoffs.js +16 -0
  126. package/esm/models/preferredmaxlatency.d.ts +12 -0
  127. package/esm/models/preferredmaxlatency.js +12 -0
  128. package/esm/models/preferredminthroughput.d.ts +12 -0
  129. package/esm/models/preferredminthroughput.js +12 -0
  130. package/esm/models/providername.d.ts +3 -2
  131. package/esm/models/providername.js +3 -2
  132. package/esm/models/providerpreferences.d.ts +8 -20
  133. package/esm/models/providerpreferences.js +6 -6
  134. package/esm/models/publicendpoint.d.ts +6 -0
  135. package/esm/models/publicendpoint.js +5 -0
  136. package/esm/models/responseinputimage.d.ts +11 -3
  137. package/esm/models/responseinputimage.js +9 -2
  138. package/esm/models/responseinputvideo.d.ts +20 -0
  139. package/esm/models/responseinputvideo.js +19 -0
  140. package/esm/models/responseoutputtext.d.ts +38 -0
  141. package/esm/models/responseoutputtext.js +50 -0
  142. package/esm/models/responsesoutputitemreasoning.d.ts +30 -1
  143. package/esm/models/responsesoutputitemreasoning.js +22 -0
  144. package/esm/models/responsesoutputmodality.d.ts +10 -0
  145. package/esm/models/responsesoutputmodality.js +12 -0
  146. package/esm/models/schema0.d.ts +3 -2
  147. package/esm/models/schema0.js +3 -2
  148. package/esm/models/schema2.d.ts +92 -0
  149. package/esm/models/schema2.js +109 -0
  150. package/esm/sdk/analytics.d.ts +1 -1
  151. package/esm/sdk/analytics.js +1 -1
  152. package/esm/sdk/apikeys.d.ts +15 -0
  153. package/esm/sdk/apikeys.js +15 -0
  154. package/esm/sdk/credits.d.ts +1 -1
  155. package/esm/sdk/credits.js +1 -1
  156. package/esm/sdk/guardrails.d.ts +96 -0
  157. package/esm/sdk/guardrails.js +139 -0
  158. package/esm/sdk/sdk.d.ts +3 -3
  159. package/esm/sdk/sdk.js +4 -4
  160. package/esm/types/index.d.ts +2 -0
  161. package/esm/types/index.js +1 -0
  162. package/esm/types/models.d.ts +25 -0
  163. package/esm/types/models.js +10 -0
  164. package/jsr.json +1 -1
  165. package/package.json +12 -10
  166. package/scripts/check-types.js +127 -0
  167. package/esm/models/operations/getparameters.d.ts +0 -87
  168. package/esm/models/operations/getparameters.js +0 -73
  169. package/esm/models/schema3.d.ts +0 -50
  170. package/esm/models/schema3.js +0 -61
  171. package/esm/sdk/parameters.d.ts +0 -9
  172. package/esm/sdk/parameters.js +0 -16
@@ -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
@@ -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