@orq-ai/node 4.14.4 → 4.14.6

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 (128) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/evaluatorresponsefunction.js +2 -2
  5. package/models/components/evaluatorresponsehttp.js +2 -2
  6. package/models/components/evaluatorresponsejsonschema.js +2 -2
  7. package/models/components/evaluatorresponsellm.js +2 -2
  8. package/models/components/evaluatorresponsepython.js +2 -2
  9. package/models/components/evaluatorresponseragas.js +2 -2
  10. package/models/components/evaluatorresponsetypescript.js +2 -2
  11. package/models/components/reasoningpart.js +1 -1
  12. package/models/operations/createannotationqueue.js +1 -1
  13. package/models/operations/createdataset.js +1 -1
  14. package/models/operations/createdatasetitem.js +5 -5
  15. package/models/operations/createtool.js +4 -4
  16. package/models/operations/getalltools.js +4 -4
  17. package/models/operations/geteval.js +16 -16
  18. package/models/operations/getv2humanevalsets.js +2 -2
  19. package/models/operations/getv2humanevalsetsid.js +2 -2
  20. package/models/operations/listannotationqueues.js +1 -1
  21. package/models/operations/listdatasetdatapoints.js +5 -5
  22. package/models/operations/listdatasets.js +1 -1
  23. package/models/operations/patchv2humanevalsetsid.js +2 -2
  24. package/models/operations/postv2feedbackevaluation.js +4 -4
  25. package/models/operations/postv2humanevalsets.js +2 -2
  26. package/models/operations/retrieveannotationqueue.js +1 -1
  27. package/models/operations/retrievedatapoint.js +5 -5
  28. package/models/operations/retrievedataset.js +1 -1
  29. package/models/operations/retrievetool.js +4 -4
  30. package/models/operations/runagent.js +1 -1
  31. package/models/operations/streamrunagent.js +1 -1
  32. package/models/operations/updateannotationqueue.js +1 -1
  33. package/models/operations/updatedatapoint.js +5 -5
  34. package/models/operations/updatedataset.js +1 -1
  35. package/models/operations/updatetool.js +4 -4
  36. package/package.json +3 -3
  37. package/packages/orq-rc/src/funcs/auditLogsQuery.ts +162 -0
  38. package/packages/orq-rc/src/funcs/workspacesGet.ts +168 -0
  39. package/packages/orq-rc/src/funcs/workspacesList.ts +170 -0
  40. package/packages/orq-rc/src/funcs/workspacesUpdate.ts +171 -0
  41. package/packages/orq-rc/src/lib/config.ts +3 -3
  42. package/packages/orq-rc/src/models/components/auditlog.ts +122 -0
  43. package/packages/orq-rc/src/models/components/auditlogfilter.ts +51 -0
  44. package/packages/orq-rc/src/models/components/auditlogfilterquery.ts +54 -0
  45. package/packages/orq-rc/src/models/components/auditlogpagination.ts +55 -0
  46. package/packages/orq-rc/src/models/components/auditlogsort.ts +39 -0
  47. package/packages/orq-rc/src/models/components/budgetmatch.ts +1 -7
  48. package/packages/orq-rc/src/models/components/budgetscope.ts +1 -21
  49. package/packages/orq-rc/src/models/components/budgetscopekind.ts +0 -1
  50. package/packages/orq-rc/src/models/components/budgetscoperestresponse.ts +1 -17
  51. package/packages/orq-rc/src/models/components/getworkspaceresponse.ts +32 -0
  52. package/packages/orq-rc/src/models/components/index.ts +16 -3
  53. package/packages/orq-rc/src/models/components/listworkspacesresponse.ts +41 -0
  54. package/packages/orq-rc/src/models/components/piiredactionconfig.ts +7 -9
  55. package/packages/orq-rc/src/models/components/queryauditlogsrequest.ts +64 -0
  56. package/packages/orq-rc/src/models/components/queryauditlogsresponse.ts +55 -0
  57. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  58. package/packages/orq-rc/src/models/components/updateworkspacerequest.ts +81 -0
  59. package/packages/orq-rc/src/models/components/updateworkspaceresponse.ts +32 -0
  60. package/packages/orq-rc/src/models/components/updateworkspacesettingsrequest.ts +0 -9
  61. package/packages/orq-rc/src/models/components/value.ts +20 -0
  62. package/packages/orq-rc/src/models/components/workspace.ts +116 -0
  63. package/packages/orq-rc/src/models/components/workspacecapabilities.ts +33 -0
  64. package/packages/orq-rc/src/models/components/workspaceorganization.ts +33 -0
  65. package/packages/orq-rc/src/models/components/workspacesettings.ts +0 -3
  66. package/packages/orq-rc/src/models/components/workspacesettingsfields.ts +135 -0
  67. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  68. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +5 -5
  69. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  70. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  71. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  72. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  73. package/packages/orq-rc/src/models/operations/index.ts +3 -0
  74. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +5 -5
  75. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  76. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  77. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  78. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  79. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +5 -5
  80. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  81. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  82. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  83. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  84. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +5 -5
  85. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  86. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  87. package/packages/orq-rc/src/models/operations/workspaceget.ts +31 -0
  88. package/packages/orq-rc/src/models/operations/workspacelist.ts +43 -0
  89. package/packages/orq-rc/src/models/operations/workspaceupdate.ts +40 -0
  90. package/packages/orq-rc/src/sdk/auditlogs.ts +27 -0
  91. package/packages/orq-rc/src/sdk/sdk.ts +12 -0
  92. package/packages/orq-rc/src/sdk/workspaces.ts +64 -0
  93. package/src/lib/config.ts +2 -2
  94. package/src/models/components/evaluatorresponsefunction.ts +2 -2
  95. package/src/models/components/evaluatorresponsehttp.ts +2 -2
  96. package/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  97. package/src/models/components/evaluatorresponsellm.ts +2 -2
  98. package/src/models/components/evaluatorresponsepython.ts +2 -2
  99. package/src/models/components/evaluatorresponseragas.ts +2 -2
  100. package/src/models/components/evaluatorresponsetypescript.ts +2 -2
  101. package/src/models/components/reasoningpart.ts +1 -1
  102. package/src/models/operations/createannotationqueue.ts +1 -1
  103. package/src/models/operations/createdataset.ts +1 -1
  104. package/src/models/operations/createdatasetitem.ts +5 -5
  105. package/src/models/operations/createtool.ts +4 -4
  106. package/src/models/operations/getalltools.ts +4 -4
  107. package/src/models/operations/geteval.ts +16 -16
  108. package/src/models/operations/getv2humanevalsets.ts +2 -2
  109. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  110. package/src/models/operations/listannotationqueues.ts +1 -1
  111. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  112. package/src/models/operations/listdatasets.ts +1 -1
  113. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  114. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  115. package/src/models/operations/postv2humanevalsets.ts +2 -2
  116. package/src/models/operations/retrieveannotationqueue.ts +1 -1
  117. package/src/models/operations/retrievedatapoint.ts +5 -5
  118. package/src/models/operations/retrievedataset.ts +1 -1
  119. package/src/models/operations/retrievetool.ts +4 -4
  120. package/src/models/operations/runagent.ts +1 -1
  121. package/src/models/operations/streamrunagent.ts +1 -1
  122. package/src/models/operations/updateannotationqueue.ts +1 -1
  123. package/src/models/operations/updatedatapoint.ts +5 -5
  124. package/src/models/operations/updatedataset.ts +1 -1
  125. package/src/models/operations/updatetool.ts +4 -4
  126. package/packages/orq-rc/src/models/components/factorybudgetscope.ts +0 -66
  127. package/packages/orq-rc/src/models/components/factorybudgetscoperestresponse.ts +0 -37
  128. package/packages/orq-rc/src/models/components/policyprofileidlist.ts +0 -31
@@ -0,0 +1,171 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Update a workspace
31
+ *
32
+ * @remarks
33
+ * Partially updates a workspace. Omit a field to leave it unchanged. Set `archived` to true to archive, false to restore. The workspace key cannot be changed.
34
+ */
35
+ export function workspacesUpdate(
36
+ client: OrqCore,
37
+ request: operations.WorkspaceUpdateRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.UpdateWorkspaceResponse,
42
+ | OrqError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: OrqCore,
61
+ request: operations.WorkspaceUpdateRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.UpdateWorkspaceResponse,
67
+ | OrqError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) => operations.WorkspaceUpdateRequest$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = encodeJSON("body", payload.UpdateWorkspaceRequest, {
89
+ explode: true,
90
+ });
91
+
92
+ const pathParams = {
93
+ key: encodeSimple("key", payload.key, {
94
+ explode: false,
95
+ charEncoding: "percent",
96
+ }),
97
+ };
98
+ const path = pathToFunc("/v2/workspaces/{key}")(pathParams);
99
+
100
+ const headers = new Headers(compactMap({
101
+ "Content-Type": "application/json",
102
+ Accept: "application/json",
103
+ }));
104
+
105
+ const secConfig = await extractSecurity(client._options.apiKey);
106
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
107
+ const requestSecurity = resolveGlobalSecurity(securityInput);
108
+
109
+ const context = {
110
+ options: client._options,
111
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
112
+ operationID: "WorkspaceUpdate",
113
+ oAuth2Scopes: null,
114
+
115
+ resolvedSecurity: requestSecurity,
116
+
117
+ securitySource: client._options.apiKey,
118
+ retryConfig: options?.retries
119
+ || client._options.retryConfig
120
+ || { strategy: "none" },
121
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
122
+ };
123
+
124
+ const requestRes = client._createRequest(context, {
125
+ security: requestSecurity,
126
+ method: "PATCH",
127
+ baseURL: options?.serverURL,
128
+ path: path,
129
+ headers: headers,
130
+ body: body,
131
+ userAgent: client._options.userAgent,
132
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
133
+ }, options);
134
+ if (!requestRes.ok) {
135
+ return [requestRes, { status: "invalid" }];
136
+ }
137
+ const req = requestRes.value;
138
+
139
+ const doResult = await client._do(req, {
140
+ context,
141
+ isErrorStatusCode: (statusCode: number) =>
142
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
143
+ retryConfig: context.retryConfig,
144
+ retryCodes: context.retryCodes,
145
+ });
146
+ if (!doResult.ok) {
147
+ return [doResult, { status: "request-error", request: req }];
148
+ }
149
+ const response = doResult.value;
150
+
151
+ const [result] = await M.match<
152
+ components.UpdateWorkspaceResponse,
153
+ | OrqError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, components.UpdateWorkspaceResponse$inboundSchema),
163
+ M.fail("4XX"),
164
+ M.fail("5XX"),
165
+ )(response, req);
166
+ if (!result.ok) {
167
+ return [result, { status: "complete", request: req, response }];
168
+ }
169
+
170
+ return [result, { status: "complete", request: req, response }];
171
+ }
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
58
58
  export const SDK_METADATA = {
59
59
  language: "typescript",
60
60
  openapiDocVersion: "2.0",
61
- sdkVersion: "4.15.0-rc.6",
62
- genVersion: "2.932.15",
63
- userAgent: "speakeasy-sdk/typescript 4.15.0-rc.6 2.932.15 2.0 @orq-ai/node",
61
+ sdkVersion: "4.15.0-rc.8",
62
+ genVersion: "2.933.0",
63
+ userAgent: "speakeasy-sdk/typescript 4.15.0-rc.8 2.933.0 2.0 @orq-ai/node",
64
64
  } as const;
@@ -0,0 +1,122 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { Value, Value$inboundSchema } from "./value.js";
11
+
12
+ /**
13
+ * Additional event metadata. The exact shape depends on entity_type and action.
14
+ */
15
+ export type AuditLogMetadata = {};
16
+
17
+ /**
18
+ * An audit log entry for an entity event in the authenticated workspace.
19
+ */
20
+ export type AuditLog = {
21
+ /**
22
+ * Unique identifier for the audit log entry.
23
+ */
24
+ auditLogId: string;
25
+ /**
26
+ * Project associated with the event, when the audited entity belongs to a project.
27
+ */
28
+ projectId?: string | undefined;
29
+ /**
30
+ * Identifier of the entity that changed.
31
+ */
32
+ entityId: string;
33
+ entityType: Value;
34
+ action: Value;
35
+ /**
36
+ * User or system actor that caused the event, when available.
37
+ */
38
+ actorId?: string | undefined;
39
+ /**
40
+ * IP address observed for the actor, when available.
41
+ */
42
+ actorIp?: string | undefined;
43
+ actorType?: Value | undefined;
44
+ /**
45
+ * Human readable actor name captured when the action happened.
46
+ */
47
+ actorDisplay?: string | undefined;
48
+ origin?: Value | undefined;
49
+ /**
50
+ * Correlates the entry with the originating request.
51
+ */
52
+ requestId?: string | undefined;
53
+ /**
54
+ * Time when the audit log entry was created.
55
+ */
56
+ createdAt: Date;
57
+ /**
58
+ * Additional event metadata. The exact shape depends on entity_type and action.
59
+ */
60
+ metadata?: AuditLogMetadata | undefined;
61
+ };
62
+
63
+ /** @internal */
64
+ export const AuditLogMetadata$inboundSchema: z.ZodType<
65
+ AuditLogMetadata,
66
+ z.ZodTypeDef,
67
+ unknown
68
+ > = z.object({});
69
+
70
+ export function auditLogMetadataFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<AuditLogMetadata, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => AuditLogMetadata$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'AuditLogMetadata' from JSON`,
77
+ );
78
+ }
79
+
80
+ /** @internal */
81
+ export const AuditLog$inboundSchema: z.ZodType<
82
+ AuditLog,
83
+ z.ZodTypeDef,
84
+ unknown
85
+ > = z.object({
86
+ audit_log_id: z.string(),
87
+ project_id: z.string().optional(),
88
+ entity_id: z.string(),
89
+ entity_type: Value$inboundSchema,
90
+ action: Value$inboundSchema,
91
+ actor_id: z.string().optional(),
92
+ actor_ip: z.string().optional(),
93
+ actor_type: Value$inboundSchema.optional(),
94
+ actor_display: z.string().optional(),
95
+ origin: Value$inboundSchema.optional(),
96
+ request_id: z.string().optional(),
97
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
98
+ metadata: z.lazy(() => AuditLogMetadata$inboundSchema).optional(),
99
+ }).transform((v) => {
100
+ return remap$(v, {
101
+ "audit_log_id": "auditLogId",
102
+ "project_id": "projectId",
103
+ "entity_id": "entityId",
104
+ "entity_type": "entityType",
105
+ "actor_id": "actorId",
106
+ "actor_ip": "actorIp",
107
+ "actor_type": "actorType",
108
+ "actor_display": "actorDisplay",
109
+ "request_id": "requestId",
110
+ "created_at": "createdAt",
111
+ });
112
+ });
113
+
114
+ export function auditLogFromJSON(
115
+ jsonString: string,
116
+ ): SafeParseResult<AuditLog, SDKValidationError> {
117
+ return safeParse(
118
+ jsonString,
119
+ (x) => AuditLog$inboundSchema.parse(JSON.parse(x)),
120
+ `Failed to parse 'AuditLog' from JSON`,
121
+ );
122
+ }
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ /**
8
+ * A single advanced filter applied to audit logs.
9
+ */
10
+ export type AuditLogFilter = {
11
+ /**
12
+ * Filter value type, such as string, date, number, boolean, or array.
13
+ */
14
+ type: string;
15
+ /**
16
+ * Audit log field path to filter on. Supported paths include created_at, entity_id, entity_type, action, actor_id, and metadata.display_name.
17
+ */
18
+ path: string;
19
+ /**
20
+ * Filter operator supported by the selected field type.
21
+ */
22
+ operator: string;
23
+ /**
24
+ * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.
25
+ */
26
+ value?: any | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export type AuditLogFilter$Outbound = {
31
+ type: string;
32
+ path: string;
33
+ operator: string;
34
+ value?: any | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const AuditLogFilter$outboundSchema: z.ZodType<
39
+ AuditLogFilter$Outbound,
40
+ z.ZodTypeDef,
41
+ AuditLogFilter
42
+ > = z.object({
43
+ type: z.string(),
44
+ path: z.string(),
45
+ operator: z.string(),
46
+ value: z.any().optional(),
47
+ });
48
+
49
+ export function auditLogFilterToJSON(auditLogFilter: AuditLogFilter): string {
50
+ return JSON.stringify(AuditLogFilter$outboundSchema.parse(auditLogFilter));
51
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import {
7
+ AuditLogFilter,
8
+ AuditLogFilter$Outbound,
9
+ AuditLogFilter$outboundSchema,
10
+ } from "./auditlogfilter.js";
11
+
12
+ /**
13
+ * Search and advanced filters for querying audit logs.
14
+ */
15
+ export type AuditLogFilterQuery = {
16
+ /**
17
+ * Optional text search applied to supported display fields.
18
+ */
19
+ search?: string | undefined;
20
+ /**
21
+ * Logical operator used to combine filters.
22
+ */
23
+ operator: string;
24
+ /**
25
+ * Advanced filters applied to the query.
26
+ */
27
+ filters: Array<AuditLogFilter>;
28
+ };
29
+
30
+ /** @internal */
31
+ export type AuditLogFilterQuery$Outbound = {
32
+ search?: string | undefined;
33
+ operator: string;
34
+ filters: Array<AuditLogFilter$Outbound>;
35
+ };
36
+
37
+ /** @internal */
38
+ export const AuditLogFilterQuery$outboundSchema: z.ZodType<
39
+ AuditLogFilterQuery$Outbound,
40
+ z.ZodTypeDef,
41
+ AuditLogFilterQuery
42
+ > = z.object({
43
+ search: z.string().optional(),
44
+ operator: z.string(),
45
+ filters: z.array(AuditLogFilter$outboundSchema),
46
+ });
47
+
48
+ export function auditLogFilterQueryToJSON(
49
+ auditLogFilterQuery: AuditLogFilterQuery,
50
+ ): string {
51
+ return JSON.stringify(
52
+ AuditLogFilterQuery$outboundSchema.parse(auditLogFilterQuery),
53
+ );
54
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+
8
+ /**
9
+ * Cursor pagination settings for audit log queries.
10
+ */
11
+ export type AuditLogPagination = {
12
+ /**
13
+ * Maximum number of audit logs to return. Defaults to 50 when omitted.
14
+ */
15
+ limit?: number | undefined;
16
+ /**
17
+ * Cursor for the next page. Use the last audit_log_id from the previous page.
18
+ */
19
+ startingAfter?: string | undefined;
20
+ /**
21
+ * Cursor for the previous page. Use the first audit_log_id from the current page.
22
+ */
23
+ endingBefore?: string | undefined;
24
+ };
25
+
26
+ /** @internal */
27
+ export type AuditLogPagination$Outbound = {
28
+ limit?: number | undefined;
29
+ starting_after?: string | undefined;
30
+ ending_before?: string | undefined;
31
+ };
32
+
33
+ /** @internal */
34
+ export const AuditLogPagination$outboundSchema: z.ZodType<
35
+ AuditLogPagination$Outbound,
36
+ z.ZodTypeDef,
37
+ AuditLogPagination
38
+ > = z.object({
39
+ limit: z.number().int().optional(),
40
+ startingAfter: z.string().optional(),
41
+ endingBefore: z.string().optional(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ startingAfter: "starting_after",
45
+ endingBefore: "ending_before",
46
+ });
47
+ });
48
+
49
+ export function auditLogPaginationToJSON(
50
+ auditLogPagination: AuditLogPagination,
51
+ ): string {
52
+ return JSON.stringify(
53
+ AuditLogPagination$outboundSchema.parse(auditLogPagination),
54
+ );
55
+ }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ /**
8
+ * A sort expression for audit log queries.
9
+ */
10
+ export type AuditLogSort = {
11
+ /**
12
+ * Audit log field to sort by. Supported keys include _id, created_at, entity_type, entity_id, action, and actor_id.
13
+ */
14
+ key: string;
15
+ /**
16
+ * Sort direction. Defaults to desc when omitted or invalid.
17
+ */
18
+ direction?: string | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export type AuditLogSort$Outbound = {
23
+ key: string;
24
+ direction?: string | undefined;
25
+ };
26
+
27
+ /** @internal */
28
+ export const AuditLogSort$outboundSchema: z.ZodType<
29
+ AuditLogSort$Outbound,
30
+ z.ZodTypeDef,
31
+ AuditLogSort
32
+ > = z.object({
33
+ key: z.string(),
34
+ direction: z.string().optional(),
35
+ });
36
+
37
+ export function auditLogSortToJSON(auditLogSort: AuditLogSort): string {
38
+ return JSON.stringify(AuditLogSort$outboundSchema.parse(auditLogSort));
39
+ }
@@ -8,13 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  /**
11
- * BudgetMatch carries the CEL expression that decides whether a budget
12
- *
13
- * @remarks
14
- * applies to a request. Available variables: `model`, `provider`,
15
- * `model_id`, `api_key`, `api_key_labels` (map), `factory`, `identity`,
16
- * `project`, `metadata` (map), `headers` (map, lowercase keys). An empty
17
- * expression always matches. Expressions are syntax-validated at write time.
11
+ * CEL expression that decides whether a budget applies to a request. Available variables: `model`, `provider`, `model_id`, `api_key`, `api_key_labels` (map), `identity`, `project`, `metadata` (map), `headers` (map, lowercase keys). An empty expression always matches. Expressions are syntax-validated at write time.
18
12
  */
19
13
  export type BudgetMatch = {
20
14
  cel?: string | undefined;
@@ -13,12 +13,6 @@ import {
13
13
  ApiKeyBudgetScope$Outbound,
14
14
  ApiKeyBudgetScope$outboundSchema,
15
15
  } from "./apikeybudgetscope.js";
16
- import {
17
- FactoryBudgetScope,
18
- FactoryBudgetScope$inboundSchema,
19
- FactoryBudgetScope$Outbound,
20
- FactoryBudgetScope$outboundSchema,
21
- } from "./factorybudgetscope.js";
22
16
  import {
23
17
  IdentityBudgetScope,
24
18
  IdentityBudgetScope$inboundSchema,
@@ -51,11 +45,7 @@ import {
51
45
  } from "./workspacebudgetscope.js";
52
46
 
53
47
  /**
54
- * BudgetScope is a closed oneof. Exactly one variant must be set. The
55
- *
56
- * @remarks
57
- * variants are ordered by enforcement precedence (most specific to
58
- * most general) and mirror the BudgetScopeKind filter enum.
48
+ * Closed oneof of workspace, project, identity, api_key, provider, or model. Exactly one variant must be set. Variants are ordered by enforcement precedence (most specific to most general).
59
49
  */
60
50
  export type BudgetScope = {
61
51
  /**
@@ -95,13 +85,6 @@ export type BudgetScope = {
95
85
  * models), rather than an internal identifier.
96
86
  */
97
87
  model?: ModelBudgetScope | undefined;
98
- /**
99
- * Per-factory cap. Matches requests whose api key carries the label
100
- *
101
- * @remarks
102
- * `factory=<factory_id>` (keys minted for agent sessions of that factory).
103
- */
104
- factory?: FactoryBudgetScope | undefined;
105
88
  };
106
89
 
107
90
  /** @internal */
@@ -116,7 +99,6 @@ export const BudgetScope$inboundSchema: z.ZodType<
116
99
  api_key: ApiKeyBudgetScope$inboundSchema.optional(),
117
100
  provider: ProviderBudgetScope$inboundSchema.optional(),
118
101
  model: ModelBudgetScope$inboundSchema.optional(),
119
- factory: FactoryBudgetScope$inboundSchema.optional(),
120
102
  }).transform((v) => {
121
103
  return remap$(v, {
122
104
  "api_key": "apiKey",
@@ -130,7 +112,6 @@ export type BudgetScope$Outbound = {
130
112
  api_key?: ApiKeyBudgetScope$Outbound | undefined;
131
113
  provider?: ProviderBudgetScope$Outbound | undefined;
132
114
  model?: ModelBudgetScope$Outbound | undefined;
133
- factory?: FactoryBudgetScope$Outbound | undefined;
134
115
  };
135
116
 
136
117
  /** @internal */
@@ -145,7 +126,6 @@ export const BudgetScope$outboundSchema: z.ZodType<
145
126
  apiKey: ApiKeyBudgetScope$outboundSchema.optional(),
146
127
  provider: ProviderBudgetScope$outboundSchema.optional(),
147
128
  model: ModelBudgetScope$outboundSchema.optional(),
148
- factory: FactoryBudgetScope$outboundSchema.optional(),
149
129
  }).transform((v) => {
150
130
  return remap$(v, {
151
131
  apiKey: "api_key",
@@ -13,7 +13,6 @@ export const BudgetScopeKind = {
13
13
  BudgetScopeKindApiKey: "BUDGET_SCOPE_KIND_API_KEY",
14
14
  BudgetScopeKindProvider: "BUDGET_SCOPE_KIND_PROVIDER",
15
15
  BudgetScopeKindModel: "BUDGET_SCOPE_KIND_MODEL",
16
- BudgetScopeKindFactory: "BUDGET_SCOPE_KIND_FACTORY",
17
16
  } as const;
18
17
  export type BudgetScopeKind = ClosedEnum<typeof BudgetScopeKind>;
19
18
 
@@ -10,10 +10,6 @@ import {
10
10
  ApiKeyBudgetScopeRestResponse,
11
11
  ApiKeyBudgetScopeRestResponse$inboundSchema,
12
12
  } from "./apikeybudgetscoperestresponse.js";
13
- import {
14
- FactoryBudgetScopeRestResponse,
15
- FactoryBudgetScopeRestResponse$inboundSchema,
16
- } from "./factorybudgetscoperestresponse.js";
17
13
  import {
18
14
  IdentityBudgetScopeRestResponse,
19
15
  IdentityBudgetScopeRestResponse$inboundSchema,
@@ -36,11 +32,7 @@ import {
36
32
  } from "./workspacebudgetscope.js";
37
33
 
38
34
  /**
39
- * BudgetScope is a closed oneof. Exactly one variant must be set. The
40
- *
41
- * @remarks
42
- * variants are ordered by enforcement precedence (most specific to
43
- * most general) and mirror the BudgetScopeKind filter enum.
35
+ * Closed oneof of workspace, project, identity, api_key, provider, or model. Exactly one variant must be set. Variants are ordered by enforcement precedence (most specific to most general).
44
36
  */
45
37
  export type BudgetScopeRestResponse = {
46
38
  /**
@@ -80,13 +72,6 @@ export type BudgetScopeRestResponse = {
80
72
  * models), rather than an internal identifier.
81
73
  */
82
74
  model?: ModelBudgetScopeRestResponse | undefined;
83
- /**
84
- * Per-factory cap. Matches requests whose api key carries the label
85
- *
86
- * @remarks
87
- * `factory=<factory_id>` (keys minted for agent sessions of that factory).
88
- */
89
- factory?: FactoryBudgetScopeRestResponse | undefined;
90
75
  };
91
76
 
92
77
  /** @internal */
@@ -101,7 +86,6 @@ export const BudgetScopeRestResponse$inboundSchema: z.ZodType<
101
86
  apiKey: ApiKeyBudgetScopeRestResponse$inboundSchema.optional(),
102
87
  provider: ProviderBudgetScope$inboundSchema.optional(),
103
88
  model: ModelBudgetScopeRestResponse$inboundSchema.optional(),
104
- factory: FactoryBudgetScopeRestResponse$inboundSchema.optional(),
105
89
  });
106
90
 
107
91
  export function budgetScopeRestResponseFromJSON(
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import { Workspace, Workspace$inboundSchema } from "./workspace.js";
10
+
11
+ export type GetWorkspaceResponse = {
12
+ workspace: Workspace;
13
+ };
14
+
15
+ /** @internal */
16
+ export const GetWorkspaceResponse$inboundSchema: z.ZodType<
17
+ GetWorkspaceResponse,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ workspace: Workspace$inboundSchema,
22
+ });
23
+
24
+ export function getWorkspaceResponseFromJSON(
25
+ jsonString: string,
26
+ ): SafeParseResult<GetWorkspaceResponse, SDKValidationError> {
27
+ return safeParse(
28
+ jsonString,
29
+ (x) => GetWorkspaceResponse$inboundSchema.parse(JSON.parse(x)),
30
+ `Failed to parse 'GetWorkspaceResponse' from JSON`,
31
+ );
32
+ }