@orq-ai/node 4.9.18 → 4.9.22

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 (139) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/reasoningpart.js +1 -1
  5. package/models/operations/createcontact.js +1 -1
  6. package/models/operations/createdataset.js +1 -1
  7. package/models/operations/createdatasetitem.js +4 -4
  8. package/models/operations/createdatasource.js +1 -1
  9. package/models/operations/createeval.js +16 -16
  10. package/models/operations/createidentity.js +1 -1
  11. package/models/operations/createtool.js +6 -6
  12. package/models/operations/getalltools.js +6 -6
  13. package/models/operations/getevals.js +16 -16
  14. package/models/operations/getv2humanevalsets.js +2 -2
  15. package/models/operations/getv2humanevalsetsid.js +2 -2
  16. package/models/operations/listdatasetdatapoints.js +4 -4
  17. package/models/operations/listdatasets.js +1 -1
  18. package/models/operations/listdatasources.js +1 -1
  19. package/models/operations/listidentities.js +1 -1
  20. package/models/operations/patchv2humanevalsetsid.js +2 -2
  21. package/models/operations/postv2feedbackevaluation.js +3 -3
  22. package/models/operations/postv2humanevalsets.js +2 -2
  23. package/models/operations/retrievedatapoint.js +4 -4
  24. package/models/operations/retrievedataset.js +1 -1
  25. package/models/operations/retrievedatasource.js +1 -1
  26. package/models/operations/retrieveidentity.js +1 -1
  27. package/models/operations/retrievetool.js +6 -6
  28. package/models/operations/runagent.js +1 -1
  29. package/models/operations/streamrunagent.js +1 -1
  30. package/models/operations/updatedatapoint.js +4 -4
  31. package/models/operations/updatedataset.js +1 -1
  32. package/models/operations/updatedatasource.js +1 -1
  33. package/models/operations/updateeval.js +16 -16
  34. package/models/operations/updateidentity.js +1 -1
  35. package/models/operations/updatetool.js +7 -7
  36. package/package.json +8 -8
  37. package/packages/orq-rc/src/funcs/apiKeysCreate.ts +162 -0
  38. package/packages/orq-rc/src/funcs/apiKeysDelete.ts +168 -0
  39. package/packages/orq-rc/src/funcs/apiKeysGet.ts +168 -0
  40. package/packages/orq-rc/src/funcs/apiKeysList.ts +175 -0
  41. package/packages/orq-rc/src/funcs/apiKeysListCapabilities.ts +144 -0
  42. package/packages/orq-rc/src/funcs/apiKeysUpdate.ts +171 -0
  43. package/packages/orq-rc/src/funcs/filesList.ts +1 -0
  44. package/packages/orq-rc/src/lib/config.ts +3 -3
  45. package/packages/orq-rc/src/models/components/allprojects.ts +39 -0
  46. package/packages/orq-rc/src/models/components/apikey.ts +178 -0
  47. package/packages/orq-rc/src/models/components/apikeyowner.ts +82 -0
  48. package/packages/orq-rc/src/models/components/apikeystatus.ts +21 -0
  49. package/packages/orq-rc/src/models/components/createapikeyrequest.ts +91 -0
  50. package/packages/orq-rc/src/models/components/createapikeyresponse.ts +49 -0
  51. package/packages/orq-rc/src/models/components/createfilerequest.ts +11 -3
  52. package/packages/orq-rc/src/models/components/deleteapikeyresponse.ts +27 -0
  53. package/packages/orq-rc/src/models/components/domain.ts +82 -0
  54. package/packages/orq-rc/src/models/components/domaingroup.ts +18 -0
  55. package/packages/orq-rc/src/models/components/file.ts +9 -2
  56. package/packages/orq-rc/src/models/components/filepurpose.ts +21 -0
  57. package/packages/orq-rc/src/models/components/getapikeyresponse.ts +40 -0
  58. package/packages/orq-rc/src/models/components/index.ts +23 -0
  59. package/packages/orq-rc/src/models/components/inputtokensdetails.ts +6 -0
  60. package/packages/orq-rc/src/models/components/legacytokenfamily.ts +19 -0
  61. package/packages/orq-rc/src/models/components/listapikeysresponse.ts +56 -0
  62. package/packages/orq-rc/src/models/components/listcapabilitiesresponse.ts +39 -0
  63. package/packages/orq-rc/src/models/components/ownertype.ts +17 -0
  64. package/packages/orq-rc/src/models/components/permissionmode.ts +23 -0
  65. package/packages/orq-rc/src/models/components/projectscope.ts +70 -0
  66. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  67. package/packages/orq-rc/src/models/components/scopemode.ts +17 -0
  68. package/packages/orq-rc/src/models/components/serviceaccountowner.ts +43 -0
  69. package/packages/orq-rc/src/models/components/singleproject.ts +56 -0
  70. package/packages/orq-rc/src/models/components/updateapikeyrequest.ts +99 -0
  71. package/packages/orq-rc/src/models/components/updateapikeyresponse.ts +40 -0
  72. package/packages/orq-rc/src/models/components/userowner.ts +56 -0
  73. package/packages/orq-rc/src/models/operations/apikeydelete.ts +39 -0
  74. package/packages/orq-rc/src/models/operations/apikeyget.ts +39 -0
  75. package/packages/orq-rc/src/models/operations/apikeylist.ts +107 -0
  76. package/packages/orq-rc/src/models/operations/apikeyupdate.ts +44 -0
  77. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  78. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  79. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  80. package/packages/orq-rc/src/models/operations/createeval.ts +70 -70
  81. package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
  82. package/packages/orq-rc/src/models/operations/filelist.ts +4 -0
  83. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  84. package/packages/orq-rc/src/models/operations/getevals.ts +40 -40
  85. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  86. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  87. package/packages/orq-rc/src/models/operations/index.ts +4 -0
  88. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  89. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  90. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  91. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  92. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
  93. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  94. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  95. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  96. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  97. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  98. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  99. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  100. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  101. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  102. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  103. package/packages/orq-rc/src/models/operations/updateeval.ts +46 -46
  104. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  105. package/packages/orq-rc/src/sdk/apikeys.ts +116 -0
  106. package/packages/orq-rc/src/sdk/sdk.ts +6 -0
  107. package/src/lib/config.ts +3 -3
  108. package/src/models/components/reasoningpart.ts +1 -1
  109. package/src/models/operations/createcontact.ts +1 -1
  110. package/src/models/operations/createdataset.ts +1 -1
  111. package/src/models/operations/createdatasetitem.ts +4 -4
  112. package/src/models/operations/createdatasource.ts +1 -1
  113. package/src/models/operations/createeval.ts +16 -16
  114. package/src/models/operations/createidentity.ts +1 -1
  115. package/src/models/operations/createtool.ts +6 -6
  116. package/src/models/operations/getalltools.ts +6 -6
  117. package/src/models/operations/getevals.ts +16 -16
  118. package/src/models/operations/getv2humanevalsets.ts +2 -2
  119. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  120. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  121. package/src/models/operations/listdatasets.ts +1 -1
  122. package/src/models/operations/listdatasources.ts +1 -1
  123. package/src/models/operations/listidentities.ts +1 -1
  124. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  125. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  126. package/src/models/operations/postv2humanevalsets.ts +2 -2
  127. package/src/models/operations/retrievedatapoint.ts +4 -4
  128. package/src/models/operations/retrievedataset.ts +1 -1
  129. package/src/models/operations/retrievedatasource.ts +1 -1
  130. package/src/models/operations/retrieveidentity.ts +1 -1
  131. package/src/models/operations/retrievetool.ts +6 -6
  132. package/src/models/operations/runagent.ts +1 -1
  133. package/src/models/operations/streamrunagent.ts +1 -1
  134. package/src/models/operations/updatedatapoint.ts +4 -4
  135. package/src/models/operations/updatedataset.ts +1 -1
  136. package/src/models/operations/updatedatasource.ts +1 -1
  137. package/src/models/operations/updateeval.ts +16 -16
  138. package/src/models/operations/updateidentity.ts +1 -1
  139. package/src/models/operations/updatetool.ts +7 -7
@@ -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
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type AllProjects = {};
11
+
12
+ /** @internal */
13
+ export const AllProjects$inboundSchema: z.ZodType<
14
+ AllProjects,
15
+ z.ZodTypeDef,
16
+ unknown
17
+ > = z.object({});
18
+ /** @internal */
19
+ export type AllProjects$Outbound = {};
20
+
21
+ /** @internal */
22
+ export const AllProjects$outboundSchema: z.ZodType<
23
+ AllProjects$Outbound,
24
+ z.ZodTypeDef,
25
+ AllProjects
26
+ > = z.object({});
27
+
28
+ export function allProjectsToJSON(allProjects: AllProjects): string {
29
+ return JSON.stringify(AllProjects$outboundSchema.parse(allProjects));
30
+ }
31
+ export function allProjectsFromJSON(
32
+ jsonString: string,
33
+ ): SafeParseResult<AllProjects, SDKValidationError> {
34
+ return safeParse(
35
+ jsonString,
36
+ (x) => AllProjects$inboundSchema.parse(JSON.parse(x)),
37
+ `Failed to parse 'AllProjects' from JSON`,
38
+ );
39
+ }
@@ -0,0 +1,178 @@
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 { ApiKeyOwner, ApiKeyOwner$inboundSchema } from "./apikeyowner.js";
11
+ import { ApiKeyStatus, ApiKeyStatus$inboundSchema } from "./apikeystatus.js";
12
+ import {
13
+ LegacyTokenFamily,
14
+ LegacyTokenFamily$inboundSchema,
15
+ } from "./legacytokenfamily.js";
16
+ import {
17
+ PermissionMode,
18
+ PermissionMode$inboundSchema,
19
+ } from "./permissionmode.js";
20
+ import { ProjectScope, ProjectScope$inboundSchema } from "./projectscope.js";
21
+
22
+ /**
23
+ * ApiKey is the canonical record stored in MongoDB `auth.apiKeys`.
24
+ *
25
+ * @remarks
26
+ * It is the source of truth for scope, permissions, owner, budget,
27
+ * expiration, and revocation (see ADR 0001).
28
+ */
29
+ export type ApiKey = {
30
+ /**
31
+ * Canonical key identifier (ULID). Embedded in opaque tokens as
32
+ *
33
+ * @remarks
34
+ * `sk-orq-<id>-<secret>`.
35
+ */
36
+ apiKeyId?: string | undefined;
37
+ /**
38
+ * Human-readable name shown in the dashboard.
39
+ */
40
+ name?: string | undefined;
41
+ /**
42
+ * Owner attribution (drives lifecycle).
43
+ */
44
+ owner?: ApiKeyOwner | undefined;
45
+ /**
46
+ * Project authorization scope.
47
+ */
48
+ projectScope?: ProjectScope | undefined;
49
+ permissionMode?: PermissionMode | undefined;
50
+ /**
51
+ * Per-domain access map. Only populated when `permission_mode` is
52
+ *
53
+ * @remarks
54
+ * `PERMISSION_MODE_RESTRICTED`. The authoritative list of valid
55
+ * keys and the per-domain read / write semantics are exposed at
56
+ * runtime via the `ListCapabilities` RPC.
57
+ *
58
+ * Valid keys (Domain.id) currently in the catalog:
59
+ * Workspace-admin: "api-key", "member", "billing", "sso", "group",
60
+ * "audit-log", "workspace"
61
+ * Platform: "agent", "agent-schedule", "annotation",
62
+ * "chunking", "dataset", "deployment", "eval",
63
+ * "file", "guardrail-rule", "identity",
64
+ * "knowledge", "memory-store", "policy",
65
+ * "project", "prompt", "routing-rule", "skill",
66
+ * "tool"
67
+ * Gateway: "chat_completions", "embeddings", "responses",
68
+ * "moderations", "images", "audio_speech",
69
+ * "audio_transcription", "realtime", "model"
70
+ *
71
+ * Values are AccessLevel enum names on the JSON wire:
72
+ * "ACCESS_LEVEL_NONE" — capability not granted
73
+ * "ACCESS_LEVEL_READ" — list / view verbs
74
+ * "ACCESS_LEVEL_WRITE" — list / view + mutating / execute verbs
75
+ */
76
+ access?: { [k: string]: number } | undefined;
77
+ /**
78
+ * Displayable prefix for UI listings (e.g. "sk-orq-01HXY..."). Safe
79
+ *
80
+ * @remarks
81
+ * to expose.
82
+ */
83
+ tokenPrefix?: string | undefined;
84
+ status?: ApiKeyStatus | undefined;
85
+ /**
86
+ * Audit: user who created the key. Optional. Distinct from
87
+ *
88
+ * @remarks
89
+ * `owner.user_id` — created_by is provenance only, while owner
90
+ * determines lifecycle binding.
91
+ */
92
+ createdById?: string | undefined;
93
+ /**
94
+ * Audit: user who last updated the key.
95
+ */
96
+ updatedById?: string | undefined;
97
+ /**
98
+ * Time the key was created.
99
+ */
100
+ createdAt?: Date | undefined;
101
+ /**
102
+ * Time the key was last updated.
103
+ */
104
+ updatedAt?: Date | undefined;
105
+ /**
106
+ * Last authenticated use. Updated via NATS debounce + 1% sampler.
107
+ */
108
+ lastUsedAt?: Date | undefined;
109
+ /**
110
+ * Optional expiration. The authenticate hot-path rejects keys whose
111
+ *
112
+ * @remarks
113
+ * `expires_at` is in the past. Unset means the key never expires.
114
+ */
115
+ expiresAt?: Date | undefined;
116
+ legacyTokenFamily?: LegacyTokenFamily | undefined;
117
+ /**
118
+ * Legacy MongoDB `_id` from before the canonical ULID was assigned.
119
+ *
120
+ * @remarks
121
+ * Used by the adapter to resolve a JWT back to this canonical record.
122
+ */
123
+ legacyKeyId?: string | undefined;
124
+ };
125
+
126
+ /** @internal */
127
+ export const ApiKey$inboundSchema: z.ZodType<ApiKey, z.ZodTypeDef, unknown> = z
128
+ .object({
129
+ api_key_id: z.string().optional(),
130
+ name: z.string().optional(),
131
+ owner: ApiKeyOwner$inboundSchema.optional(),
132
+ project_scope: ProjectScope$inboundSchema.optional(),
133
+ permission_mode: PermissionMode$inboundSchema.optional(),
134
+ access: z.record(z.number().int()).optional(),
135
+ token_prefix: z.string().optional(),
136
+ status: ApiKeyStatus$inboundSchema.optional(),
137
+ created_by_id: z.string().optional(),
138
+ updated_by_id: z.string().optional(),
139
+ created_at: z.string().datetime({ offset: true }).transform(v =>
140
+ new Date(v)
141
+ ).optional(),
142
+ updated_at: z.string().datetime({ offset: true }).transform(v =>
143
+ new Date(v)
144
+ ).optional(),
145
+ last_used_at: z.string().datetime({ offset: true }).transform(v =>
146
+ new Date(v)
147
+ ).optional(),
148
+ expires_at: z.string().datetime({ offset: true }).transform(v =>
149
+ new Date(v)
150
+ ).optional(),
151
+ legacy_token_family: LegacyTokenFamily$inboundSchema.optional(),
152
+ legacy_key_id: z.string().optional(),
153
+ }).transform((v) => {
154
+ return remap$(v, {
155
+ "api_key_id": "apiKeyId",
156
+ "project_scope": "projectScope",
157
+ "permission_mode": "permissionMode",
158
+ "token_prefix": "tokenPrefix",
159
+ "created_by_id": "createdById",
160
+ "updated_by_id": "updatedById",
161
+ "created_at": "createdAt",
162
+ "updated_at": "updatedAt",
163
+ "last_used_at": "lastUsedAt",
164
+ "expires_at": "expiresAt",
165
+ "legacy_token_family": "legacyTokenFamily",
166
+ "legacy_key_id": "legacyKeyId",
167
+ });
168
+ });
169
+
170
+ export function apiKeyFromJSON(
171
+ jsonString: string,
172
+ ): SafeParseResult<ApiKey, SDKValidationError> {
173
+ return safeParse(
174
+ jsonString,
175
+ (x) => ApiKey$inboundSchema.parse(JSON.parse(x)),
176
+ `Failed to parse 'ApiKey' from JSON`,
177
+ );
178
+ }
@@ -0,0 +1,82 @@
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 {
11
+ ServiceAccountOwner,
12
+ ServiceAccountOwner$inboundSchema,
13
+ ServiceAccountOwner$Outbound,
14
+ ServiceAccountOwner$outboundSchema,
15
+ } from "./serviceaccountowner.js";
16
+ import {
17
+ UserOwner,
18
+ UserOwner$inboundSchema,
19
+ UserOwner$Outbound,
20
+ UserOwner$outboundSchema,
21
+ } from "./userowner.js";
22
+
23
+ /**
24
+ * Owner attribution drives lifecycle.
25
+ *
26
+ * @remarks
27
+ *
28
+ * `service_account` keys are workspace-owned and outlive any individual
29
+ * user. `user` keys are bound to `user_id`: when the user is removed,
30
+ * disabled, or loses project access, the key is revoked / its scope
31
+ * shrinks per the cascade rules in ADR 0001.
32
+ */
33
+ export type ApiKeyOwner = {
34
+ user?: UserOwner | undefined;
35
+ serviceAccount?: ServiceAccountOwner | undefined;
36
+ };
37
+
38
+ /** @internal */
39
+ export const ApiKeyOwner$inboundSchema: z.ZodType<
40
+ ApiKeyOwner,
41
+ z.ZodTypeDef,
42
+ unknown
43
+ > = z.object({
44
+ user: UserOwner$inboundSchema.optional(),
45
+ service_account: ServiceAccountOwner$inboundSchema.optional(),
46
+ }).transform((v) => {
47
+ return remap$(v, {
48
+ "service_account": "serviceAccount",
49
+ });
50
+ });
51
+ /** @internal */
52
+ export type ApiKeyOwner$Outbound = {
53
+ user?: UserOwner$Outbound | undefined;
54
+ service_account?: ServiceAccountOwner$Outbound | undefined;
55
+ };
56
+
57
+ /** @internal */
58
+ export const ApiKeyOwner$outboundSchema: z.ZodType<
59
+ ApiKeyOwner$Outbound,
60
+ z.ZodTypeDef,
61
+ ApiKeyOwner
62
+ > = z.object({
63
+ user: UserOwner$outboundSchema.optional(),
64
+ serviceAccount: ServiceAccountOwner$outboundSchema.optional(),
65
+ }).transform((v) => {
66
+ return remap$(v, {
67
+ serviceAccount: "service_account",
68
+ });
69
+ });
70
+
71
+ export function apiKeyOwnerToJSON(apiKeyOwner: ApiKeyOwner): string {
72
+ return JSON.stringify(ApiKeyOwner$outboundSchema.parse(apiKeyOwner));
73
+ }
74
+ export function apiKeyOwnerFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<ApiKeyOwner, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => ApiKeyOwner$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'ApiKeyOwner' from JSON`,
81
+ );
82
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const ApiKeyStatus = {
9
+ ApiKeyStatusUnspecified: "API_KEY_STATUS_UNSPECIFIED",
10
+ ApiKeyStatusActive: "API_KEY_STATUS_ACTIVE",
11
+ ApiKeyStatusDisabled: "API_KEY_STATUS_DISABLED",
12
+ ApiKeyStatusRevoked: "API_KEY_STATUS_REVOKED",
13
+ } as const;
14
+ export type ApiKeyStatus = ClosedEnum<typeof ApiKeyStatus>;
15
+
16
+ /** @internal */
17
+ export const ApiKeyStatus$inboundSchema: z.ZodNativeEnum<typeof ApiKeyStatus> =
18
+ z.nativeEnum(ApiKeyStatus);
19
+ /** @internal */
20
+ export const ApiKeyStatus$outboundSchema: z.ZodNativeEnum<typeof ApiKeyStatus> =
21
+ ApiKeyStatus$inboundSchema;
@@ -0,0 +1,91 @@
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 {
8
+ ApiKeyOwner,
9
+ ApiKeyOwner$Outbound,
10
+ ApiKeyOwner$outboundSchema,
11
+ } from "./apikeyowner.js";
12
+ import {
13
+ PermissionMode,
14
+ PermissionMode$outboundSchema,
15
+ } from "./permissionmode.js";
16
+ import {
17
+ ProjectScope,
18
+ ProjectScope$Outbound,
19
+ ProjectScope$outboundSchema,
20
+ } from "./projectscope.js";
21
+
22
+ export type CreateApiKeyRequest = {
23
+ /**
24
+ * Human-readable name. Required.
25
+ */
26
+ name?: string | undefined;
27
+ /**
28
+ * Owner attribution. Defaults to service_account when omitted.
29
+ */
30
+ owner?: ApiKeyOwner | undefined;
31
+ /**
32
+ * Project authorization scope. Defaults to all-projects when omitted.
33
+ */
34
+ projectScope?: ProjectScope | undefined;
35
+ permissionMode?: PermissionMode | undefined;
36
+ /**
37
+ * Per-domain access map. Required when `permission_mode` =
38
+ *
39
+ * @remarks
40
+ * `PERMISSION_MODE_RESTRICTED`. See `ApiKey.access` for the full
41
+ * catalog of valid keys (Domain.id) and AccessLevel string values,
42
+ * or fetch the live catalog via the `ListCapabilities` RPC.
43
+ */
44
+ access?: { [k: string]: number } | undefined;
45
+ /**
46
+ * Optional expiration. When set, the authenticate hot-path rejects
47
+ *
48
+ * @remarks
49
+ * the key once `expires_at` is in the past. Unset means the key
50
+ * never expires.
51
+ */
52
+ expiresAt?: Date | undefined;
53
+ };
54
+
55
+ /** @internal */
56
+ export type CreateApiKeyRequest$Outbound = {
57
+ name?: string | undefined;
58
+ owner?: ApiKeyOwner$Outbound | undefined;
59
+ project_scope?: ProjectScope$Outbound | undefined;
60
+ permission_mode?: string | undefined;
61
+ access?: { [k: string]: number } | undefined;
62
+ expires_at?: string | undefined;
63
+ };
64
+
65
+ /** @internal */
66
+ export const CreateApiKeyRequest$outboundSchema: z.ZodType<
67
+ CreateApiKeyRequest$Outbound,
68
+ z.ZodTypeDef,
69
+ CreateApiKeyRequest
70
+ > = z.object({
71
+ name: z.string().optional(),
72
+ owner: ApiKeyOwner$outboundSchema.optional(),
73
+ projectScope: ProjectScope$outboundSchema.optional(),
74
+ permissionMode: PermissionMode$outboundSchema.optional(),
75
+ access: z.record(z.number().int()).optional(),
76
+ expiresAt: z.date().transform(v => v.toISOString()).optional(),
77
+ }).transform((v) => {
78
+ return remap$(v, {
79
+ projectScope: "project_scope",
80
+ permissionMode: "permission_mode",
81
+ expiresAt: "expires_at",
82
+ });
83
+ });
84
+
85
+ export function createApiKeyRequestToJSON(
86
+ createApiKeyRequest: CreateApiKeyRequest,
87
+ ): string {
88
+ return JSON.stringify(
89
+ CreateApiKeyRequest$outboundSchema.parse(createApiKeyRequest),
90
+ );
91
+ }
@@ -0,0 +1,49 @@
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 { ApiKey, ApiKey$inboundSchema } from "./apikey.js";
11
+
12
+ export type CreateApiKeyResponse = {
13
+ /**
14
+ * Newly minted api-key record.
15
+ */
16
+ apiKey?: ApiKey | undefined;
17
+ /**
18
+ * Raw bearer token in the form `sk-orq-<api_key_id>-<secret>`.
19
+ *
20
+ * @remarks
21
+ * Returned ONCE; the API never exposes this value again. Clients
22
+ * must persist it immediately on receipt.
23
+ */
24
+ token?: string | undefined;
25
+ };
26
+
27
+ /** @internal */
28
+ export const CreateApiKeyResponse$inboundSchema: z.ZodType<
29
+ CreateApiKeyResponse,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ api_key: ApiKey$inboundSchema.optional(),
34
+ token: z.string().optional(),
35
+ }).transform((v) => {
36
+ return remap$(v, {
37
+ "api_key": "apiKey",
38
+ });
39
+ });
40
+
41
+ export function createApiKeyResponseFromJSON(
42
+ jsonString: string,
43
+ ): SafeParseResult<CreateApiKeyResponse, SDKValidationError> {
44
+ return safeParse(
45
+ jsonString,
46
+ (x) => CreateApiKeyResponse$inboundSchema.parse(JSON.parse(x)),
47
+ `Failed to parse 'CreateApiKeyResponse' from JSON`,
48
+ );
49
+ }
@@ -4,20 +4,26 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { FilePurpose, FilePurpose$outboundSchema } from "./filepurpose.js";
7
8
 
8
9
  export type CreateFileRequest = {
9
10
  filename?: string | undefined;
10
11
  content?: string | undefined;
11
- purpose?: number | undefined;
12
+ purpose?: FilePurpose | undefined;
12
13
  contentType?: string | undefined;
14
+ /**
15
+ * Project the file is created in. Optional for project-scoped API keys (defaults to the key's bound project); required for workspace-scoped callers.
16
+ */
17
+ projectId?: string | undefined;
13
18
  };
14
19
 
15
20
  /** @internal */
16
21
  export type CreateFileRequest$Outbound = {
17
22
  filename?: string | undefined;
18
23
  content?: string | undefined;
19
- purpose?: number | undefined;
24
+ purpose?: string | undefined;
20
25
  content_type?: string | undefined;
26
+ project_id?: string | undefined;
21
27
  };
22
28
 
23
29
  /** @internal */
@@ -28,11 +34,13 @@ export const CreateFileRequest$outboundSchema: z.ZodType<
28
34
  > = z.object({
29
35
  filename: z.string().optional(),
30
36
  content: z.string().optional(),
31
- purpose: z.number().int().optional(),
37
+ purpose: FilePurpose$outboundSchema.optional(),
32
38
  contentType: z.string().optional(),
39
+ projectId: z.string().optional(),
33
40
  }).transform((v) => {
34
41
  return remap$(v, {
35
42
  contentType: "content_type",
43
+ projectId: "project_id",
36
44
  });
37
45
  });
38
46
 
@@ -0,0 +1,27 @@
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
+
10
+ export type DeleteApiKeyResponse = {};
11
+
12
+ /** @internal */
13
+ export const DeleteApiKeyResponse$inboundSchema: z.ZodType<
14
+ DeleteApiKeyResponse,
15
+ z.ZodTypeDef,
16
+ unknown
17
+ > = z.object({});
18
+
19
+ export function deleteApiKeyResponseFromJSON(
20
+ jsonString: string,
21
+ ): SafeParseResult<DeleteApiKeyResponse, SDKValidationError> {
22
+ return safeParse(
23
+ jsonString,
24
+ (x) => DeleteApiKeyResponse$inboundSchema.parse(JSON.parse(x)),
25
+ `Failed to parse 'DeleteApiKeyResponse' from JSON`,
26
+ );
27
+ }
@@ -0,0 +1,82 @@
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 { DomainGroup, DomainGroup$inboundSchema } from "./domaingroup.js";
11
+ import { ScopeMode, ScopeMode$inboundSchema } from "./scopemode.js";
12
+
13
+ /**
14
+ * Domain describes a permission domain that can be granted to an API
15
+ *
16
+ * @remarks
17
+ * key. The capability catalog is the registry consulted by
18
+ * ResolvePermissions() at authorize() time. Verbs are derived by
19
+ * convention from `id` + `group` + `readable` / `writable` flags.
20
+ */
21
+ export type Domain = {
22
+ /**
23
+ * Stable domain identifier (e.g. "agent", "chat_completions"). Used
24
+ *
25
+ * @remarks
26
+ * as the key in ApiKey.access and as the verb prefix in resolved
27
+ * permissions (e.g. agent.list, agent.view, agent.create).
28
+ */
29
+ id?: string | undefined;
30
+ /**
31
+ * Human-readable label for UI.
32
+ */
33
+ displayName?: string | undefined;
34
+ group?: DomainGroup | undefined;
35
+ /**
36
+ * Project scopes this domain may be granted under. A workspace-admin
37
+ *
38
+ * @remarks
39
+ * domain like `member` is typically SCOPE_MODE_ALL only.
40
+ */
41
+ allowedScopes?: Array<ScopeMode> | undefined;
42
+ /**
43
+ * Whether this domain can be granted read access. When false the UI
44
+ *
45
+ * @remarks
46
+ * disables the Read segment (e.g. write-only gateway endpoints).
47
+ */
48
+ readable?: boolean | undefined;
49
+ /**
50
+ * Whether this domain can be granted write access. When false the UI
51
+ *
52
+ * @remarks
53
+ * disables the Write segment (e.g. read-only `model` listing).
54
+ */
55
+ writable?: boolean | undefined;
56
+ };
57
+
58
+ /** @internal */
59
+ export const Domain$inboundSchema: z.ZodType<Domain, z.ZodTypeDef, unknown> = z
60
+ .object({
61
+ id: z.string().optional(),
62
+ display_name: z.string().optional(),
63
+ group: DomainGroup$inboundSchema.optional(),
64
+ allowed_scopes: z.array(ScopeMode$inboundSchema).optional(),
65
+ readable: z.boolean().optional(),
66
+ writable: z.boolean().optional(),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ "display_name": "displayName",
70
+ "allowed_scopes": "allowedScopes",
71
+ });
72
+ });
73
+
74
+ export function domainFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<Domain, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => Domain$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'Domain' from JSON`,
81
+ );
82
+ }
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const DomainGroup = {
9
+ DomainGroupUnspecified: "DOMAIN_GROUP_UNSPECIFIED",
10
+ DomainGroupWorkspaceAdmin: "DOMAIN_GROUP_WORKSPACE_ADMIN",
11
+ DomainGroupPlatform: "DOMAIN_GROUP_PLATFORM",
12
+ DomainGroupGateway: "DOMAIN_GROUP_GATEWAY",
13
+ } as const;
14
+ export type DomainGroup = ClosedEnum<typeof DomainGroup>;
15
+
16
+ /** @internal */
17
+ export const DomainGroup$inboundSchema: z.ZodNativeEnum<typeof DomainGroup> = z
18
+ .nativeEnum(DomainGroup);
@@ -7,30 +7,37 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { FilePurpose, FilePurpose$inboundSchema } from "./filepurpose.js";
10
11
 
11
12
  export type FileT = {
12
13
  fileId?: string | undefined;
13
- purpose?: number | undefined;
14
+ purpose?: FilePurpose | undefined;
14
15
  fileName?: string | undefined;
15
16
  bytes?: string | undefined;
16
17
  createdAt?: Date | undefined;
18
+ /**
19
+ * Identifier of the project the file belongs to. Files are project-scoped; an API key may only access files in projects it is authorized for.
20
+ */
21
+ projectId?: string | undefined;
17
22
  };
18
23
 
19
24
  /** @internal */
20
25
  export const FileT$inboundSchema: z.ZodType<FileT, z.ZodTypeDef, unknown> = z
21
26
  .object({
22
27
  file_id: z.string().optional(),
23
- purpose: z.number().int().optional(),
28
+ purpose: FilePurpose$inboundSchema.optional(),
24
29
  file_name: z.string().optional(),
25
30
  bytes: z.string().optional(),
26
31
  created_at: z.string().datetime({ offset: true }).transform(v =>
27
32
  new Date(v)
28
33
  ).optional(),
34
+ project_id: z.string().optional(),
29
35
  }).transform((v) => {
30
36
  return remap$(v, {
31
37
  "file_id": "fileId",
32
38
  "file_name": "fileName",
33
39
  "created_at": "createdAt",
40
+ "project_id": "projectId",
34
41
  });
35
42
  });
36
43