@buddy-works/sandbox-sdk 0.1.2 → 0.1.3-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -23,6 +23,44 @@ type UserPermissionView = {
23
23
  */
24
24
  access_level?: "DENIED" | "READ_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT" | "USE_ONLY";
25
25
  };
26
+ type IdsView = {
27
+ /**
28
+ * API endpoint to GET this object
29
+ */
30
+ readonly url?: string;
31
+ /**
32
+ * Web URL to view this object in Buddy.works
33
+ */
34
+ readonly html_url?: string;
35
+ /**
36
+ * The human-readable ID of the workspace
37
+ */
38
+ domain?: string;
39
+ /**
40
+ * The human-readable ID of the project
41
+ */
42
+ project_identifier?: string;
43
+ /**
44
+ * The ID of the pipeline
45
+ */
46
+ pipeline_id?: number;
47
+ /**
48
+ * The ID of the environment
49
+ */
50
+ environment_id?: string;
51
+ /**
52
+ * The ID of the package
53
+ */
54
+ pkg_id?: string;
55
+ /**
56
+ * The ID of the package version
57
+ */
58
+ pkg_version_id?: string;
59
+ /**
60
+ * The ID of the sandbox
61
+ */
62
+ sandbox_id?: string;
63
+ };
26
64
  /**
27
65
  * Sandbox reference
28
66
  */
@@ -938,6 +976,42 @@ type CreateFromSnapshotRequestWritable = {
938
976
  */
939
977
  variables?: Array<EnvironmentVariableView>;
940
978
  };
979
+ type GetIdentifiersData = {
980
+ body?: never;
981
+ path: {
982
+ /**
983
+ * The human-readable ID of the workspace
984
+ */
985
+ workspace_domain: string;
986
+ };
987
+ query?: {
988
+ /**
989
+ * The human-readable ID of the project
990
+ */
991
+ project?: string;
992
+ /**
993
+ * The human-readable ID of the pipeline
994
+ */
995
+ pipeline?: string;
996
+ /**
997
+ * The human-readable ID of the environment
998
+ */
999
+ environment?: string;
1000
+ /**
1001
+ * The human-readable ID of the package
1002
+ */
1003
+ package?: string;
1004
+ /**
1005
+ * The version of the package
1006
+ */
1007
+ package_version?: string;
1008
+ /**
1009
+ * The human-readable ID of the sandbox
1010
+ */
1011
+ sandbox?: string;
1012
+ };
1013
+ url: "/workspaces/{workspace_domain}/identifiers";
1014
+ };
941
1015
  type GetSandboxesData = {
942
1016
  body?: never;
943
1017
  path: {
@@ -1315,6 +1389,8 @@ declare class BuddyApiClient extends HttpClient {
1315
1389
  addSandbox<const Data$1 extends AddSandboxData>(data: ClientData<Data$1>): Promise<SandboxResponse>;
1316
1390
  /** Get a specific sandbox by its ID */
1317
1391
  getSandboxById<const Data$1 extends GetSandboxData>(data: ClientData<Data$1>): Promise<SandboxResponse>;
1392
+ /** Get a specific sandbox by its ID */
1393
+ getIdentifiers<const Data$1 extends GetIdentifiersData>(data: ClientData<Data$1>): Promise<IdsView>;
1318
1394
  /** Execute a command in a sandbox */
1319
1395
  executeCommand<const Data$1 extends ExecuteSandboxCommandData>(data: ClientData<Data$1>): Promise<SandboxCommandView>;
1320
1396
  /** Get a specific command execution details */
package/dist/index.mjs CHANGED
@@ -55,6 +55,30 @@ const stopSandboxResponseTransformer = async (data) => {
55
55
 
56
56
  //#endregion
57
57
  //#region src/api/openapi/zod.gen.ts
58
+ const zUpdateWorkspaceMemberRequest = z.object({
59
+ admin: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the user has admin privileges" })),
60
+ auto_assign_to_new_projects: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether user is automatically assigned to new projects" })),
61
+ auto_assign_permission_set_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "ID of permission set to automatically assign to new projects" }))
62
+ });
63
+ const zUpdateSsoRequest = z.object({
64
+ type: z.optional(z.enum(["SAML", "OIDC"]).register(z.globalRegistry, { description: "The type of the SSO to be set" })),
65
+ sso_provider_type: z.optional(z.enum([
66
+ "OKTA",
67
+ "ONE_LOGIN",
68
+ "GOOGLE",
69
+ "AZURE",
70
+ "AWS",
71
+ "CUSTOM"
72
+ ]).register(z.globalRegistry, { description: "The provider type for SSO configuration" })),
73
+ sso_url: z.optional(z.string().register(z.globalRegistry, { description: "The SSO URL / SAML endpoint / Identity provider Single sign-on URL. Set when type is `SAML`." })),
74
+ issuer: z.optional(z.string().register(z.globalRegistry, { description: "Issuer URI, IDP Entity ID, SSO issuer, provider issuer, AD identifier or the base URL of the OpenID Connect (OIDC) server." })),
75
+ certificate: z.optional(z.string().register(z.globalRegistry, { description: "The x509 certificate content. Set when type is `SAML`." })),
76
+ signature_method: z.optional(z.string().register(z.globalRegistry, { description: "Set when type is `SAML`. Examples: `sha1`, `sha256`, `sha512`" })),
77
+ digest_method: z.optional(z.string().register(z.globalRegistry, { description: "Set when type is `SAML`. Examples: `sha1`, `sha256`, `sha512`" })),
78
+ client_id: z.optional(z.string().register(z.globalRegistry, { description: "The client ID of the identity provider application." })),
79
+ client_secret: z.optional(z.string().register(z.globalRegistry, { description: "The client secret of the identity provider application." })),
80
+ require_sso_for_all_members: z.optional(z.boolean().register(z.globalRegistry, { description: "Require SSO authentication." }))
81
+ });
58
82
  const zGroupPermissionView = z.object({
59
83
  id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the group" })),
60
84
  access_level: z.optional(z.enum([
@@ -88,6 +112,529 @@ const zUserPermissionView = z.object({
88
112
  ]).register(z.globalRegistry, { description: "The access level for the user" }))
89
113
  });
90
114
  /**
115
+ * Permission settings defining who can use this integration
116
+ */
117
+ const zIntegrationPermissionsView = z.object({
118
+ others: z.optional(z.enum([
119
+ "DENIED",
120
+ "READ_ONLY",
121
+ "BLIND",
122
+ "RUN_ONLY",
123
+ "READ_WRITE",
124
+ "MANAGE",
125
+ "DEFAULT",
126
+ "ALLOWED",
127
+ "STAGE",
128
+ "COMMIT",
129
+ "USE_ONLY"
130
+ ]).register(z.globalRegistry, { description: "Access level for other workspace members" })),
131
+ users: z.optional(z.array(zUserPermissionView).register(z.globalRegistry, { description: "List of specific users with their access levels" })),
132
+ groups: z.optional(z.array(zGroupPermissionView).register(z.globalRegistry, { description: "List of user groups with their access levels" })),
133
+ admins: z.optional(z.enum([
134
+ "DENIED",
135
+ "READ_ONLY",
136
+ "BLIND",
137
+ "RUN_ONLY",
138
+ "READ_WRITE",
139
+ "MANAGE",
140
+ "DEFAULT",
141
+ "ALLOWED",
142
+ "STAGE",
143
+ "COMMIT",
144
+ "USE_ONLY"
145
+ ]).register(z.globalRegistry, { description: "Access level for workspace administrators" }))
146
+ }).register(z.globalRegistry, { description: "Permission settings defining who can use this integration" });
147
+ /**
148
+ * Pipeline reference
149
+ */
150
+ const zPipelineIdView = z.object({ id: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The unique identifier of the pipeline" }) }).register(z.globalRegistry, { description: "Pipeline reference" });
151
+ const zRoleAssumptionView = z.object({
152
+ arn: z.optional(z.string().register(z.globalRegistry, { description: "The Amazon Resource Name (ARN) of the AWS IAM role to assume" })),
153
+ external_id: z.optional(z.string().register(z.globalRegistry, { description: "The external ID used for additional security when assuming the AWS role" })),
154
+ duration: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The duration of the assumed role session in seconds" }))
155
+ });
156
+ const zUpdateIntegrationRequest = z.object({
157
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of the integration" })),
158
+ name: z.string().register(z.globalRegistry, { description: "The name of the integration" }),
159
+ token: z.optional(z.string().register(z.globalRegistry, { description: "The authentication token for services like GitHub, GitLab, DigitalOcean" })),
160
+ email: z.optional(z.string().register(z.globalRegistry, { description: "Email address associated with the integration" })),
161
+ api_key: z.optional(z.string().register(z.globalRegistry, { description: "The API key for services that use key-based authentication" })),
162
+ access_key: z.optional(z.string().register(z.globalRegistry, { description: "The access key ID for AWS or DigitalOcean Spaces" })),
163
+ secret_key: z.optional(z.string().register(z.globalRegistry, { description: "The secret access key for AWS or DigitalOcean Spaces" })),
164
+ partner_token: z.optional(z.string().register(z.globalRegistry, { description: "Partner token for specific integrations" })),
165
+ shop: z.optional(z.string().register(z.globalRegistry, { description: "The shop name for Shopify integrations" })),
166
+ url: z.optional(z.string().register(z.globalRegistry, { description: "The integration URL" })),
167
+ chat_id: z.optional(z.string().register(z.globalRegistry, { description: "The chat ID for messaging integrations" })),
168
+ git_hub_user_id: z.optional(z.string().register(z.globalRegistry, { description: "The GitHub user ID" })),
169
+ git_hub_user_name: z.optional(z.string().register(z.globalRegistry, { description: "The GitHub username" })),
170
+ username: z.optional(z.string().register(z.globalRegistry, { description: "The username for authentication" })),
171
+ password: z.optional(z.string().register(z.globalRegistry, { description: "The password for Azure Cloud, UpCloud, or DockerHub" })),
172
+ app_id: z.optional(z.string().register(z.globalRegistry, { description: "The application ID for Azure Cloud integrations" })),
173
+ tenant_id: z.optional(z.string().register(z.globalRegistry, { description: "The tenant ID for Azure Cloud integrations" })),
174
+ client_id: z.optional(z.string().register(z.globalRegistry, { description: "The client ID for OAuth-based integrations" })),
175
+ client_token: z.optional(z.string().register(z.globalRegistry, { description: "The client token for authentication" })),
176
+ server_id: z.optional(z.string().register(z.globalRegistry, { description: "The server ID for Discord integrations" })),
177
+ server_token: z.optional(z.string().register(z.globalRegistry, { description: "The server token for authentication" })),
178
+ key_id: z.optional(z.string().register(z.globalRegistry, { description: "The key ID for various integrations" })),
179
+ application_key: z.optional(z.string().register(z.globalRegistry, { description: "The application key for Datadog integrations" })),
180
+ host_url: z.optional(z.string().register(z.globalRegistry, { description: "The host URL for custom integrations" })),
181
+ webhook_address: z.optional(z.string().register(z.globalRegistry, { description: "The webhook URL for receiving notifications" })),
182
+ slack_user_id: z.optional(z.string().register(z.globalRegistry, { description: "The Slack user ID" })),
183
+ region: z.optional(z.string().register(z.globalRegistry, { description: "The cloud region (e.g., us-east-1, eu-west-1)" })),
184
+ role_assumptions: z.optional(z.array(zRoleAssumptionView).register(z.globalRegistry, { description: "AWS IAM role assumptions for cross-account access" })),
185
+ all_pipelines_allowed: z.optional(z.boolean().register(z.globalRegistry, { description: "Set to `true` to allow all pipelines to use this integration" })),
186
+ allowed_pipelines: z.optional(z.array(zPipelineIdView).register(z.globalRegistry, { description: "List of specific pipelines allowed to use this integration" })),
187
+ permissions: z.optional(zIntegrationPermissionsView),
188
+ auth_type: z.optional(z.enum([
189
+ "OAUTH",
190
+ "TOKEN",
191
+ "API_KEY",
192
+ "APP",
193
+ "APP_SPRYKER",
194
+ "TOKEN_APP_EXTENSION",
195
+ "DEFAULT",
196
+ "OIDC",
197
+ "TRUSTED",
198
+ "APP_RW"
199
+ ]).register(z.globalRegistry, { description: "The authentication method used by the integration" })),
200
+ target_url: z.optional(z.string().register(z.globalRegistry, { description: "The target URL for webhook-based integrations" })),
201
+ refresh_token: z.optional(z.string().register(z.globalRegistry, { description: "The refresh token for OAuth flows" })),
202
+ audience: z.optional(z.string().register(z.globalRegistry, { description: "The JWT audience for token validation" })),
203
+ config: z.optional(z.string().register(z.globalRegistry, { description: "Additional configuration data in JSON format" })),
204
+ google_project: z.optional(z.string().register(z.globalRegistry, { description: "The Google Cloud project ID" })),
205
+ atop_url: z.optional(z.string().register(z.globalRegistry, { description: "The ATOP service URL" }))
206
+ });
207
+ const zShortWorkspaceView = z.object({
208
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
209
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
210
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the workspace" })),
211
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the workspace" })),
212
+ domain: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end)." }))
213
+ });
214
+ const zWorkspacesView = z.object({
215
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
216
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
217
+ workspaces: z.optional(z.array(zShortWorkspaceView))
218
+ });
219
+ const zWorkspaceMemberView = z.object({
220
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
221
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
222
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the user" })),
223
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the user" })),
224
+ avatar_url: z.optional(z.string().register(z.globalRegistry, { description: "The avatar URL of the user" })),
225
+ email: z.optional(z.string().register(z.globalRegistry, { description: "The email address of the user" })),
226
+ admin: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the user has admin privileges" })),
227
+ workspace_owner: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the user is workspace owner" })),
228
+ auto_assign_to_new_projects: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether user is automatically assigned to new projects" })),
229
+ auto_assign_permission_set_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "ID of permission set to automatically assign to new projects" }))
230
+ });
231
+ const zWorkspaceMembersView = z.object({
232
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
233
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
234
+ members: z.optional(z.array(zWorkspaceMemberView))
235
+ });
236
+ const zWorkspaceView = z.object({
237
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
238
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
239
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the workspace" })),
240
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the workspace" })),
241
+ domain: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end)." })),
242
+ owner_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the workspace owner" })),
243
+ frozen: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the workspace is frozen" })),
244
+ create_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The date and time when the workspace was created" })),
245
+ default_pipeline_resource: z.optional(z.enum([
246
+ "DEFAULT",
247
+ "NANO",
248
+ "SMALL",
249
+ "MEDIUM",
250
+ "LARGE",
251
+ "XLARGE",
252
+ "CUSTOM",
253
+ "X2LARGE"
254
+ ]).register(z.globalRegistry, { description: "Default pipeline resource allocation for the workspace" })),
255
+ sso_enabled: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether Single Sign-On (SSO) is enabled for the workspace" })),
256
+ public_pipelines_disabled: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether public pipelines are disabled in the workspace" }))
257
+ });
258
+ const zSsoView = z.object({
259
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
260
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
261
+ type: z.optional(z.enum(["SAML", "OIDC"]).register(z.globalRegistry, { description: "The type of the SSO to be set" })),
262
+ sso_provider_type: z.optional(z.enum([
263
+ "OKTA",
264
+ "ONE_LOGIN",
265
+ "GOOGLE",
266
+ "AZURE",
267
+ "AWS",
268
+ "CUSTOM"
269
+ ]).register(z.globalRegistry, { description: "The provider type for SSO configuration" })),
270
+ sso_url: z.optional(z.string().register(z.globalRegistry, { description: "The SSO URL / SAML endpoint / Identity provider Single sign-on URL. Set when type is `SAML`." })),
271
+ issuer: z.optional(z.string().register(z.globalRegistry, { description: "Issuer URI, IDP Entity ID, SSO issuer, provider issuer, AD identifier or the base URL of the OpenID Connect (OIDC) server." })),
272
+ certificate: z.optional(z.string().register(z.globalRegistry, { description: "The x509 certificate content. Set when type is `SAML`." })),
273
+ signature_method: z.optional(z.string().register(z.globalRegistry, { description: "Set when type is `SAML`. Examples: `sha1`, `sha256`, `sha512`" })),
274
+ digest_method: z.optional(z.string().register(z.globalRegistry, { description: "Set when type is `SAML`. Examples: `sha1`, `sha256`, `sha512`" })),
275
+ require_sso_for_all_members: z.optional(z.boolean().register(z.globalRegistry, { description: "Require SSO authentication." }))
276
+ });
277
+ /**
278
+ * YAML pipeline definition configuration
279
+ */
280
+ const zYamlDefinitionView = z.object({
281
+ path: z.optional(z.string().register(z.globalRegistry, { description: "The file path to the YAML definition" })),
282
+ branch: z.optional(z.string().register(z.globalRegistry, { description: "The git ref (branch/tag) where the YAML definition is located" })),
283
+ project: z.optional(z.string().register(z.globalRegistry, { description: "The project name where the YAML definition is located" }))
284
+ }).register(z.globalRegistry, { description: "YAML pipeline definition configuration" });
285
+ /**
286
+ * The parameters passed to the remote pipeline definition
287
+ */
288
+ const zPipelinePropertyView = z.object({
289
+ key: z.optional(z.string().register(z.globalRegistry, { description: "The key of the pipeline property" })),
290
+ value: z.optional(z.string().register(z.globalRegistry, { description: "The value of the pipeline property" }))
291
+ }).register(z.globalRegistry, { description: "The parameters passed to the remote pipeline definition" });
292
+ const zPipelinePkgContextView = z.object({
293
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of package" })),
294
+ scope: z.optional(z.enum([
295
+ "WORKSPACE",
296
+ "PROJECT",
297
+ "ENVIRONMENT",
298
+ "ANY"
299
+ ]).register(z.globalRegistry, { description: "The scope of the package" }))
300
+ });
301
+ /**
302
+ * The list of events that trigger the pipeline run
303
+ */
304
+ const zPipelineEventView = z.object({
305
+ type: z.optional(z.enum([
306
+ "PUSH",
307
+ "CREATE_REF",
308
+ "DELETE_REF",
309
+ "PULL_REQUEST",
310
+ "SCHEDULE",
311
+ "PUBLISH_PACKAGE_VERSION",
312
+ "DELETE_PACKAGE_VERSION",
313
+ "WEBHOOK",
314
+ "EMAIL",
315
+ "CREATE_PACKAGE_VERSION"
316
+ ]).register(z.globalRegistry, { description: "The type of event that triggers the pipeline" })),
317
+ refs: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The list of refs (branches/tags) that trigger the pipeline for push/ref events" })),
318
+ events: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The list of pull request events that trigger the pipeline. Examples: `OPENED`, `EDITED`, `CLOSED`, `LABELED`, `UNLABELED`, `REVIEW_REQUESTED`, `REVIEW_REQUESTED_REMOVED`, `SYNCHRONIZED`" })),
319
+ branches: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The list of branches for pull request events" })),
320
+ packages: z.optional(z.array(zPipelinePkgContextView).register(z.globalRegistry, { description: "The list of packages that trigger the pipeline" })),
321
+ start_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The start date for scheduled events (type `SCHEDULE`)" })),
322
+ delay: z.optional(z.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }).register(z.globalRegistry, { description: "The delay in minutes between scheduled runs (type `SCHEDULE`)" })),
323
+ cron: z.optional(z.string().register(z.globalRegistry, { description: "The cron expression for scheduled (type `SCHEDULE`) events e.g., '0 9 * * 1-5' for weekdays at 9 AM" })),
324
+ timezone: z.optional(z.string().register(z.globalRegistry, { description: "The timezone for scheduled events (type `SCHEDULE`) e.g., 'UTC', 'Europe/Warsaw'" })),
325
+ totp: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether TOTP (Time-based One-Time Password) is enabled for webhook events (type `WEBHOOK`)" })),
326
+ prefix: z.optional(z.string().register(z.globalRegistry, { description: "The email subject prefix for email trigger events (type `EMAIL`)" })),
327
+ whitelist: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The list of allowed email addresses that can trigger the pipeline via email (type `EMAIL`)" }))
328
+ }).register(z.globalRegistry, { description: "The list of events that trigger the pipeline run" });
329
+ /**
330
+ * Short representation of a pipeline
331
+ */
332
+ const zShortPipelineView = z.object({
333
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
334
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
335
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The unique identifier of the pipeline" })),
336
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of pipeline" })),
337
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the pipeline" })),
338
+ definition_source: z.optional(z.enum(["LOCAL", "REMOTE"]).register(z.globalRegistry, { description: "The source of the pipeline definition" })),
339
+ git_config_ref: z.optional(z.enum([
340
+ "NONE",
341
+ "DYNAMIC",
342
+ "FIXED"
343
+ ]).register(z.globalRegistry, { description: "The git configuration reference type" })),
344
+ refs: z.optional(z.array(z.string().register(z.globalRegistry, { description: "Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless" })).register(z.globalRegistry, { description: "Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless" })),
345
+ events: z.optional(z.array(zPipelineEventView).register(z.globalRegistry, { description: "The list of events that trigger the pipeline run" })),
346
+ loop: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The loop configuration for the pipeline" })),
347
+ priority: z.optional(z.enum([
348
+ "LOW",
349
+ "NORMAL",
350
+ "HIGH"
351
+ ]).register(z.globalRegistry, { description: "The priority of the pipeline" })),
352
+ disabled: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates if the pipeline is disabled" })),
353
+ disabled_reason: z.optional(z.string().register(z.globalRegistry, { description: "The reason why the pipeline is disabled" })),
354
+ last_execution_status: z.optional(z.enum([
355
+ "INPROGRESS",
356
+ "ENQUEUED",
357
+ "TERMINATED",
358
+ "SUCCESSFUL",
359
+ "FAILED",
360
+ "INITIAL",
361
+ "NOT_EXECUTED",
362
+ "SKIPPED",
363
+ "TERMINATING",
364
+ "WAITING_FOR_APPLY",
365
+ "WAITING_FOR_VARIABLES",
366
+ "WAITING_FOR_SETTABLE_VARIABLES",
367
+ "WAITING_FOR_VT_SESSION"
368
+ ]).register(z.globalRegistry, { description: "The status of the last run" })),
369
+ last_execution_revision: z.optional(z.string().register(z.globalRegistry, { description: "The git revision of the last run" })),
370
+ target_site_url: z.optional(z.string().register(z.globalRegistry, { description: "The URL to the target site after deployment" })),
371
+ execution_message_template: z.optional(z.string().register(z.globalRegistry, { description: "The template for commit status messages" })),
372
+ create_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The creation date of the pipeline" })),
373
+ always_from_scratch: z.optional(z.boolean().register(z.globalRegistry, { description: "Defines whether to upload everything from scratch on every run" })),
374
+ ignore_fail_on_project_status: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the status of a given pipeline will not impact the project status on the dashboard" })),
375
+ no_skip_to_most_recent: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the pipeline will not skip queued runs to execute the most recent one" })),
376
+ terminate_stale_runs: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, stale runs will be automatically terminated" })),
377
+ auto_clear_cache: z.optional(z.boolean().register(z.globalRegistry, { description: "Defines whether to automatically clear cache before running the pipeline" })),
378
+ paused: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates if the pipeline is paused" })),
379
+ pause_on_repeated_failures: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "Defines how many repeated failures are required to pause the pipeline" })),
380
+ fetch_all_refs: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, all refs will be fetched from the repository" })),
381
+ fail_on_prepare_env_warning: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the pipeline will fail on environment preparation warnings" })),
382
+ concurrent_pipeline_runs: z.optional(z.boolean().register(z.globalRegistry, { description: "Defines whether the pipeline can be run concurrently" })),
383
+ clone_depth: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "Defines the depth of the git clone operation for shallow clones" })),
384
+ do_not_create_commit_status: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, commit statuses will not be created in the repository" })),
385
+ stale: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates that pipeline definition was probably removed on particular Git ref and pipeline won't be run on events" })),
386
+ waiting_for_push: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates if the pipeline is waiting for the first push to the repository" })),
387
+ resources: z.optional(z.enum([
388
+ "DEFAULT",
389
+ "NANO",
390
+ "SMALL",
391
+ "MEDIUM",
392
+ "LARGE",
393
+ "XLARGE",
394
+ "CUSTOM",
395
+ "X2LARGE"
396
+ ]).register(z.globalRegistry, { description: "The resource configuration for the pipeline run" })),
397
+ remote_path: z.optional(z.string().register(z.globalRegistry, { description: "The path to the remote pipeline definition file" })),
398
+ remote_ref: z.optional(z.string().register(z.globalRegistry, { description: "The ref of the remote pipeline definition" })),
399
+ remote_project_name: z.optional(z.string().register(z.globalRegistry, { description: "The project name of the remote pipeline definition" })),
400
+ remote_parameters: z.optional(z.array(zPipelinePropertyView).register(z.globalRegistry, { description: "The parameters passed to the remote pipeline definition" })),
401
+ git_config: z.optional(zYamlDefinitionView),
402
+ tags: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The list of tags associated with the pipeline for organization" })),
403
+ git_changeset_base: z.optional(z.enum([
404
+ "LATEST_RUN",
405
+ "LATEST_RUN_MATCHING_REF",
406
+ "PULL_REQUEST"
407
+ ]).register(z.globalRegistry, { description: "The base for git changeset calculation. Determines which changes trigger the pipeline" })),
408
+ filesystem_changeset_base: z.optional(z.enum(["DATE_MODIFIED", "CONTENTS"]).register(z.globalRegistry, { description: "The base for filesystem changeset calculation. Determines which file changes trigger the pipeline" })),
409
+ cpu: z.optional(z.enum([
410
+ "X64",
411
+ "ARM",
412
+ "X86"
413
+ ]).register(z.globalRegistry, { description: "The CPU architecture for the pipeline run" })),
414
+ description_required: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, a description is required when executing the pipeline manually" })),
415
+ folder: z.optional(z.string().register(z.globalRegistry, { description: "The folder name where the pipeline is organized" }))
416
+ }).register(z.globalRegistry, { description: "Short representation of a pipeline" });
417
+ /**
418
+ * The integration to use for authentication
419
+ */
420
+ const zIntegrationView = z.object({
421
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
422
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
423
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of the integration" })),
424
+ hash_id: z.optional(z.string().register(z.globalRegistry, { description: "The unique hash ID of the integration" })),
425
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the integration" })),
426
+ type: z.optional(z.enum([
427
+ "GIT_HUB",
428
+ "BITBUCKET",
429
+ "GOOGLE",
430
+ "DIGITAL_OCEAN",
431
+ "SLACK",
432
+ "MODULUS",
433
+ "HEROKU",
434
+ "AMAZON",
435
+ "GIT_LAB",
436
+ "SHOPIFY",
437
+ "GIT_HUB_ENTERPRISE",
438
+ "GIT_LAB_ENTERPRISE",
439
+ "PUSHOVER",
440
+ "PUSHBULLET",
441
+ "RACKSPACE",
442
+ "CUSTOM",
443
+ "CLOUDFLARE",
444
+ "NEW_RELIC",
445
+ "SENTRY",
446
+ "ROLLBAR",
447
+ "DATADOG",
448
+ "DO_SPACES",
449
+ "HONEYBADGER",
450
+ "VULTR",
451
+ "SENTRY_ENTERPRISE",
452
+ "LOGGLY",
453
+ "HIP_CHAT",
454
+ "FIREBASE",
455
+ "TELEGRAM",
456
+ "AZURE",
457
+ "UPCLOUD",
458
+ "GHOST_INSPECTOR",
459
+ "NETLIFY",
460
+ "AZURE_CLOUD",
461
+ "MICROSOFT_TEAMS",
462
+ "GOOGLE_SERVICE_ACCOUNT",
463
+ "GOOGLE_PLAY_STORE",
464
+ "DOCKER_HUB",
465
+ "APP_STORE",
466
+ "GIT_HUB_APP",
467
+ "GIT_HUB_APP_ENTERPRISE",
468
+ "GIT_HUB_API",
469
+ "ATOP",
470
+ "SNYK",
471
+ "STACK_HAWK",
472
+ "BLACKFIRE",
473
+ "BACKBLAZE",
474
+ "ONE_LOGIN",
475
+ "OKTA",
476
+ "CONTENTFUL"
477
+ ]).register(z.globalRegistry, { description: "The type of integration" })),
478
+ auth_type: z.optional(z.enum([
479
+ "OAUTH",
480
+ "TOKEN",
481
+ "API_KEY",
482
+ "APP",
483
+ "APP_SPRYKER",
484
+ "TOKEN_APP_EXTENSION",
485
+ "DEFAULT",
486
+ "OIDC",
487
+ "TRUSTED",
488
+ "APP_RW"
489
+ ]).register(z.globalRegistry, { description: "The authentication method used by the integration" })),
490
+ scope: z.optional(z.enum([
491
+ "WORKSPACE",
492
+ "PROJECT",
493
+ "ENVIRONMENT"
494
+ ]).register(z.globalRegistry, { description: "The scope of the integration" })),
495
+ project_name: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project (required when scope is `PROJECT`)" })),
496
+ app_id: z.optional(z.string().register(z.globalRegistry, { description: "The application ID for Azure Cloud integrations" })),
497
+ google_project: z.optional(z.string().register(z.globalRegistry, { description: "The Google Cloud project ID" })),
498
+ host_url: z.optional(z.string().register(z.globalRegistry, { description: "The host URL for custom integrations" })),
499
+ webhook_address: z.optional(z.string().register(z.globalRegistry, { description: "The webhook URL for receiving notifications" })),
500
+ audience: z.optional(z.string().register(z.globalRegistry, { description: "The JWT audience for token validation" })),
501
+ atop_url: z.optional(z.string().register(z.globalRegistry, { description: "The ATOP service URL" })),
502
+ permissions: z.optional(zIntegrationPermissionsView),
503
+ all_pipelines_allowed: z.optional(z.boolean().register(z.globalRegistry, { description: "Set to `true` to allow all pipelines to use this integration" })),
504
+ allowed_pipelines: z.optional(z.array(zShortPipelineView).register(z.globalRegistry, { description: "List of specific pipelines allowed to use this integration" }))
505
+ }).register(z.globalRegistry, { description: "The integration to use for authentication" });
506
+ const zIntegrationsView = z.object({
507
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
508
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
509
+ integrations: z.optional(z.array(zIntegrationView))
510
+ });
511
+ const zIdsView = z.object({
512
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
513
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
514
+ domain: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" })),
515
+ project_identifier: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project" })),
516
+ pipeline_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the pipeline" })),
517
+ environment_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the environment" })),
518
+ pkg_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the package" })),
519
+ pkg_version_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the package version" })),
520
+ sandbox_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the sandbox" }))
521
+ });
522
+ const zAddWorkspaceMemberRequest = z.object({
523
+ admin: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the user has admin privileges" })),
524
+ auto_assign_to_new_projects: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether user is automatically assigned to new projects" })),
525
+ auto_assign_permission_set_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "ID of permission set to automatically assign to new projects" })),
526
+ email: z.string().register(z.globalRegistry, { description: "The email address of the user" })
527
+ });
528
+ const zAddIntegrationRequest = z.object({
529
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of the integration" })),
530
+ name: z.string().register(z.globalRegistry, { description: "The name of the integration" }),
531
+ token: z.optional(z.string().register(z.globalRegistry, { description: "The authentication token for services like GitHub, GitLab, DigitalOcean" })),
532
+ email: z.optional(z.string().register(z.globalRegistry, { description: "Email address associated with the integration" })),
533
+ api_key: z.optional(z.string().register(z.globalRegistry, { description: "The API key for services that use key-based authentication" })),
534
+ access_key: z.optional(z.string().register(z.globalRegistry, { description: "The access key ID for AWS or DigitalOcean Spaces" })),
535
+ secret_key: z.optional(z.string().register(z.globalRegistry, { description: "The secret access key for AWS or DigitalOcean Spaces" })),
536
+ partner_token: z.optional(z.string().register(z.globalRegistry, { description: "Partner token for specific integrations" })),
537
+ shop: z.optional(z.string().register(z.globalRegistry, { description: "The shop name for Shopify integrations" })),
538
+ url: z.optional(z.string().register(z.globalRegistry, { description: "The integration URL" })),
539
+ chat_id: z.optional(z.string().register(z.globalRegistry, { description: "The chat ID for messaging integrations" })),
540
+ git_hub_user_id: z.optional(z.string().register(z.globalRegistry, { description: "The GitHub user ID" })),
541
+ git_hub_user_name: z.optional(z.string().register(z.globalRegistry, { description: "The GitHub username" })),
542
+ username: z.optional(z.string().register(z.globalRegistry, { description: "The username for authentication" })),
543
+ password: z.optional(z.string().register(z.globalRegistry, { description: "The password for Azure Cloud, UpCloud, or DockerHub" })),
544
+ app_id: z.optional(z.string().register(z.globalRegistry, { description: "The application ID for Azure Cloud integrations" })),
545
+ tenant_id: z.optional(z.string().register(z.globalRegistry, { description: "The tenant ID for Azure Cloud integrations" })),
546
+ client_id: z.optional(z.string().register(z.globalRegistry, { description: "The client ID for OAuth-based integrations" })),
547
+ client_token: z.optional(z.string().register(z.globalRegistry, { description: "The client token for authentication" })),
548
+ server_id: z.optional(z.string().register(z.globalRegistry, { description: "The server ID for Discord integrations" })),
549
+ server_token: z.optional(z.string().register(z.globalRegistry, { description: "The server token for authentication" })),
550
+ key_id: z.optional(z.string().register(z.globalRegistry, { description: "The key ID for various integrations" })),
551
+ application_key: z.optional(z.string().register(z.globalRegistry, { description: "The application key for Datadog integrations" })),
552
+ host_url: z.optional(z.string().register(z.globalRegistry, { description: "The host URL for custom integrations" })),
553
+ webhook_address: z.optional(z.string().register(z.globalRegistry, { description: "The webhook URL for receiving notifications" })),
554
+ slack_user_id: z.optional(z.string().register(z.globalRegistry, { description: "The Slack user ID" })),
555
+ region: z.optional(z.string().register(z.globalRegistry, { description: "The cloud region (e.g., us-east-1, eu-west-1)" })),
556
+ role_assumptions: z.optional(z.array(zRoleAssumptionView).register(z.globalRegistry, { description: "AWS IAM role assumptions for cross-account access" })),
557
+ all_pipelines_allowed: z.optional(z.boolean().register(z.globalRegistry, { description: "Set to `true` to allow all pipelines to use this integration" })),
558
+ allowed_pipelines: z.optional(z.array(zPipelineIdView).register(z.globalRegistry, { description: "List of specific pipelines allowed to use this integration" })),
559
+ permissions: z.optional(zIntegrationPermissionsView),
560
+ auth_type: z.optional(z.enum([
561
+ "OAUTH",
562
+ "TOKEN",
563
+ "API_KEY",
564
+ "APP",
565
+ "APP_SPRYKER",
566
+ "TOKEN_APP_EXTENSION",
567
+ "DEFAULT",
568
+ "OIDC",
569
+ "TRUSTED",
570
+ "APP_RW"
571
+ ]).register(z.globalRegistry, { description: "The authentication method used by the integration" })),
572
+ target_url: z.optional(z.string().register(z.globalRegistry, { description: "The target URL for webhook-based integrations" })),
573
+ refresh_token: z.optional(z.string().register(z.globalRegistry, { description: "The refresh token for OAuth flows" })),
574
+ audience: z.optional(z.string().register(z.globalRegistry, { description: "The JWT audience for token validation" })),
575
+ config: z.optional(z.string().register(z.globalRegistry, { description: "Additional configuration data in JSON format" })),
576
+ google_project: z.optional(z.string().register(z.globalRegistry, { description: "The Google Cloud project ID" })),
577
+ atop_url: z.optional(z.string().register(z.globalRegistry, { description: "The ATOP service URL" })),
578
+ type: z.enum([
579
+ "GIT_HUB",
580
+ "BITBUCKET",
581
+ "GOOGLE",
582
+ "DIGITAL_OCEAN",
583
+ "SLACK",
584
+ "MODULUS",
585
+ "HEROKU",
586
+ "AMAZON",
587
+ "GIT_LAB",
588
+ "SHOPIFY",
589
+ "GIT_HUB_ENTERPRISE",
590
+ "GIT_LAB_ENTERPRISE",
591
+ "PUSHOVER",
592
+ "PUSHBULLET",
593
+ "RACKSPACE",
594
+ "CUSTOM",
595
+ "CLOUDFLARE",
596
+ "NEW_RELIC",
597
+ "SENTRY",
598
+ "ROLLBAR",
599
+ "DATADOG",
600
+ "DO_SPACES",
601
+ "HONEYBADGER",
602
+ "VULTR",
603
+ "SENTRY_ENTERPRISE",
604
+ "LOGGLY",
605
+ "HIP_CHAT",
606
+ "FIREBASE",
607
+ "TELEGRAM",
608
+ "AZURE",
609
+ "UPCLOUD",
610
+ "GHOST_INSPECTOR",
611
+ "NETLIFY",
612
+ "AZURE_CLOUD",
613
+ "MICROSOFT_TEAMS",
614
+ "GOOGLE_SERVICE_ACCOUNT",
615
+ "GOOGLE_PLAY_STORE",
616
+ "DOCKER_HUB",
617
+ "APP_STORE",
618
+ "GIT_HUB_APP",
619
+ "GIT_HUB_APP_ENTERPRISE",
620
+ "GIT_HUB_API",
621
+ "ATOP",
622
+ "SNYK",
623
+ "STACK_HAWK",
624
+ "BLACKFIRE",
625
+ "BACKBLAZE",
626
+ "ONE_LOGIN",
627
+ "OKTA",
628
+ "CONTENTFUL"
629
+ ]).register(z.globalRegistry, { description: "The type of integration" }),
630
+ scope: z.enum([
631
+ "WORKSPACE",
632
+ "PROJECT",
633
+ "ENVIRONMENT"
634
+ ]).register(z.globalRegistry, { description: "The scope of the integration" }),
635
+ project_name: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project (required when scope is `PROJECT`)" }))
636
+ });
637
+ /**
91
638
  * Sandbox reference
92
639
  */
93
640
  const zSandboxIdView = z.object({
@@ -244,6 +791,18 @@ const zPermissionsView = z.object({
244
791
  groups: z.optional(z.array(zGroupPermissionView).register(z.globalRegistry, { description: "List of user groups with their access levels" }))
245
792
  }).register(z.globalRegistry, { description: "Access permissions configuration" });
246
793
  /**
794
+ * Short representation of a project
795
+ */
796
+ const zShortProjectView = z.object({
797
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
798
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
799
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project" })),
800
+ display_name: z.string().register(z.globalRegistry, { description: "The Name of the project" }),
801
+ status: z.optional(z.string().register(z.globalRegistry, { description: "The status of the project" })),
802
+ access: z.optional(z.enum(["PRIVATE", "PUBLIC"]).register(z.globalRegistry, { description: "Indicates if this is a public project" })),
803
+ create_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The creation date of the project" }))
804
+ }).register(z.globalRegistry, { description: "Short representation of a project" });
805
+ /**
247
806
  * The environment variables of the sandbox
248
807
  */
249
808
  const zAddVariableInObjectRequest = z.object({
@@ -609,6 +1168,248 @@ const zSandboxResponse = z.object({
609
1168
  permissions: z.optional(zPermissionsView),
610
1169
  variables: z.optional(z.array(zEnvironmentVariableView).register(z.globalRegistry, { description: "The environment variables of the sandbox" }))
611
1170
  });
1171
+ const zProjectsView = z.object({
1172
+ url: z.optional(z.string().register(z.globalRegistry, { description: "API endpoint to GET this object" }).readonly()),
1173
+ html_url: z.optional(z.string().register(z.globalRegistry, { description: "Web URL to view this object in Buddy.works" }).readonly()),
1174
+ projects: z.optional(z.array(zShortProjectView))
1175
+ });
1176
+ const zShortWorkspaceViewWritable = z.object({
1177
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the workspace" })),
1178
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the workspace" })),
1179
+ domain: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end)." }))
1180
+ });
1181
+ const zWorkspacesViewWritable = z.object({ workspaces: z.optional(z.array(zShortWorkspaceViewWritable)) });
1182
+ const zWorkspaceMemberViewWritable = z.object({
1183
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the user" })),
1184
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the user" })),
1185
+ avatar_url: z.optional(z.string().register(z.globalRegistry, { description: "The avatar URL of the user" })),
1186
+ email: z.optional(z.string().register(z.globalRegistry, { description: "The email address of the user" })),
1187
+ admin: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the user has admin privileges" })),
1188
+ workspace_owner: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the user is workspace owner" })),
1189
+ auto_assign_to_new_projects: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether user is automatically assigned to new projects" })),
1190
+ auto_assign_permission_set_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "ID of permission set to automatically assign to new projects" }))
1191
+ });
1192
+ const zWorkspaceMembersViewWritable = z.object({ members: z.optional(z.array(zWorkspaceMemberViewWritable)) });
1193
+ const zWorkspaceViewWritable = z.object({
1194
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the workspace" })),
1195
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the workspace" })),
1196
+ domain: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end)." })),
1197
+ owner_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the workspace owner" })),
1198
+ frozen: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether the workspace is frozen" })),
1199
+ create_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The date and time when the workspace was created" })),
1200
+ default_pipeline_resource: z.optional(z.enum([
1201
+ "DEFAULT",
1202
+ "NANO",
1203
+ "SMALL",
1204
+ "MEDIUM",
1205
+ "LARGE",
1206
+ "XLARGE",
1207
+ "CUSTOM",
1208
+ "X2LARGE"
1209
+ ]).register(z.globalRegistry, { description: "Default pipeline resource allocation for the workspace" })),
1210
+ sso_enabled: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether Single Sign-On (SSO) is enabled for the workspace" })),
1211
+ public_pipelines_disabled: z.optional(z.boolean().register(z.globalRegistry, { description: "Whether public pipelines are disabled in the workspace" }))
1212
+ });
1213
+ const zSsoViewWritable = z.object({
1214
+ type: z.optional(z.enum(["SAML", "OIDC"]).register(z.globalRegistry, { description: "The type of the SSO to be set" })),
1215
+ sso_provider_type: z.optional(z.enum([
1216
+ "OKTA",
1217
+ "ONE_LOGIN",
1218
+ "GOOGLE",
1219
+ "AZURE",
1220
+ "AWS",
1221
+ "CUSTOM"
1222
+ ]).register(z.globalRegistry, { description: "The provider type for SSO configuration" })),
1223
+ sso_url: z.optional(z.string().register(z.globalRegistry, { description: "The SSO URL / SAML endpoint / Identity provider Single sign-on URL. Set when type is `SAML`." })),
1224
+ issuer: z.optional(z.string().register(z.globalRegistry, { description: "Issuer URI, IDP Entity ID, SSO issuer, provider issuer, AD identifier or the base URL of the OpenID Connect (OIDC) server." })),
1225
+ certificate: z.optional(z.string().register(z.globalRegistry, { description: "The x509 certificate content. Set when type is `SAML`." })),
1226
+ signature_method: z.optional(z.string().register(z.globalRegistry, { description: "Set when type is `SAML`. Examples: `sha1`, `sha256`, `sha512`" })),
1227
+ digest_method: z.optional(z.string().register(z.globalRegistry, { description: "Set when type is `SAML`. Examples: `sha1`, `sha256`, `sha512`" })),
1228
+ require_sso_for_all_members: z.optional(z.boolean().register(z.globalRegistry, { description: "Require SSO authentication." }))
1229
+ });
1230
+ /**
1231
+ * Short representation of a pipeline
1232
+ */
1233
+ const zShortPipelineViewWritable = z.object({
1234
+ id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The unique identifier of the pipeline" })),
1235
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of pipeline" })),
1236
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the pipeline" })),
1237
+ definition_source: z.optional(z.enum(["LOCAL", "REMOTE"]).register(z.globalRegistry, { description: "The source of the pipeline definition" })),
1238
+ git_config_ref: z.optional(z.enum([
1239
+ "NONE",
1240
+ "DYNAMIC",
1241
+ "FIXED"
1242
+ ]).register(z.globalRegistry, { description: "The git configuration reference type" })),
1243
+ refs: z.optional(z.array(z.string().register(z.globalRegistry, { description: "Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless" })).register(z.globalRegistry, { description: "Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless" })),
1244
+ events: z.optional(z.array(zPipelineEventView).register(z.globalRegistry, { description: "The list of events that trigger the pipeline run" })),
1245
+ loop: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The loop configuration for the pipeline" })),
1246
+ priority: z.optional(z.enum([
1247
+ "LOW",
1248
+ "NORMAL",
1249
+ "HIGH"
1250
+ ]).register(z.globalRegistry, { description: "The priority of the pipeline" })),
1251
+ disabled: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates if the pipeline is disabled" })),
1252
+ disabled_reason: z.optional(z.string().register(z.globalRegistry, { description: "The reason why the pipeline is disabled" })),
1253
+ last_execution_status: z.optional(z.enum([
1254
+ "INPROGRESS",
1255
+ "ENQUEUED",
1256
+ "TERMINATED",
1257
+ "SUCCESSFUL",
1258
+ "FAILED",
1259
+ "INITIAL",
1260
+ "NOT_EXECUTED",
1261
+ "SKIPPED",
1262
+ "TERMINATING",
1263
+ "WAITING_FOR_APPLY",
1264
+ "WAITING_FOR_VARIABLES",
1265
+ "WAITING_FOR_SETTABLE_VARIABLES",
1266
+ "WAITING_FOR_VT_SESSION"
1267
+ ]).register(z.globalRegistry, { description: "The status of the last run" })),
1268
+ last_execution_revision: z.optional(z.string().register(z.globalRegistry, { description: "The git revision of the last run" })),
1269
+ target_site_url: z.optional(z.string().register(z.globalRegistry, { description: "The URL to the target site after deployment" })),
1270
+ execution_message_template: z.optional(z.string().register(z.globalRegistry, { description: "The template for commit status messages" })),
1271
+ create_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The creation date of the pipeline" })),
1272
+ always_from_scratch: z.optional(z.boolean().register(z.globalRegistry, { description: "Defines whether to upload everything from scratch on every run" })),
1273
+ ignore_fail_on_project_status: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the status of a given pipeline will not impact the project status on the dashboard" })),
1274
+ no_skip_to_most_recent: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the pipeline will not skip queued runs to execute the most recent one" })),
1275
+ terminate_stale_runs: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, stale runs will be automatically terminated" })),
1276
+ auto_clear_cache: z.optional(z.boolean().register(z.globalRegistry, { description: "Defines whether to automatically clear cache before running the pipeline" })),
1277
+ paused: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates if the pipeline is paused" })),
1278
+ pause_on_repeated_failures: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "Defines how many repeated failures are required to pause the pipeline" })),
1279
+ fetch_all_refs: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, all refs will be fetched from the repository" })),
1280
+ fail_on_prepare_env_warning: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the pipeline will fail on environment preparation warnings" })),
1281
+ concurrent_pipeline_runs: z.optional(z.boolean().register(z.globalRegistry, { description: "Defines whether the pipeline can be run concurrently" })),
1282
+ clone_depth: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "Defines the depth of the git clone operation for shallow clones" })),
1283
+ do_not_create_commit_status: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, commit statuses will not be created in the repository" })),
1284
+ stale: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates that pipeline definition was probably removed on particular Git ref and pipeline won't be run on events" })),
1285
+ waiting_for_push: z.optional(z.boolean().register(z.globalRegistry, { description: "Indicates if the pipeline is waiting for the first push to the repository" })),
1286
+ resources: z.optional(z.enum([
1287
+ "DEFAULT",
1288
+ "NANO",
1289
+ "SMALL",
1290
+ "MEDIUM",
1291
+ "LARGE",
1292
+ "XLARGE",
1293
+ "CUSTOM",
1294
+ "X2LARGE"
1295
+ ]).register(z.globalRegistry, { description: "The resource configuration for the pipeline run" })),
1296
+ remote_path: z.optional(z.string().register(z.globalRegistry, { description: "The path to the remote pipeline definition file" })),
1297
+ remote_ref: z.optional(z.string().register(z.globalRegistry, { description: "The ref of the remote pipeline definition" })),
1298
+ remote_project_name: z.optional(z.string().register(z.globalRegistry, { description: "The project name of the remote pipeline definition" })),
1299
+ remote_parameters: z.optional(z.array(zPipelinePropertyView).register(z.globalRegistry, { description: "The parameters passed to the remote pipeline definition" })),
1300
+ git_config: z.optional(zYamlDefinitionView),
1301
+ tags: z.optional(z.array(z.string()).register(z.globalRegistry, { description: "The list of tags associated with the pipeline for organization" })),
1302
+ git_changeset_base: z.optional(z.enum([
1303
+ "LATEST_RUN",
1304
+ "LATEST_RUN_MATCHING_REF",
1305
+ "PULL_REQUEST"
1306
+ ]).register(z.globalRegistry, { description: "The base for git changeset calculation. Determines which changes trigger the pipeline" })),
1307
+ filesystem_changeset_base: z.optional(z.enum(["DATE_MODIFIED", "CONTENTS"]).register(z.globalRegistry, { description: "The base for filesystem changeset calculation. Determines which file changes trigger the pipeline" })),
1308
+ cpu: z.optional(z.enum([
1309
+ "X64",
1310
+ "ARM",
1311
+ "X86"
1312
+ ]).register(z.globalRegistry, { description: "The CPU architecture for the pipeline run" })),
1313
+ description_required: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, a description is required when executing the pipeline manually" })),
1314
+ folder: z.optional(z.string().register(z.globalRegistry, { description: "The folder name where the pipeline is organized" }))
1315
+ }).register(z.globalRegistry, { description: "Short representation of a pipeline" });
1316
+ /**
1317
+ * The integration to use for authentication
1318
+ */
1319
+ const zIntegrationViewWritable = z.object({
1320
+ identifier: z.optional(z.string().register(z.globalRegistry, { description: "A human-readable ID of the integration" })),
1321
+ hash_id: z.optional(z.string().register(z.globalRegistry, { description: "The unique hash ID of the integration" })),
1322
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The name of the integration" })),
1323
+ type: z.optional(z.enum([
1324
+ "GIT_HUB",
1325
+ "BITBUCKET",
1326
+ "GOOGLE",
1327
+ "DIGITAL_OCEAN",
1328
+ "SLACK",
1329
+ "MODULUS",
1330
+ "HEROKU",
1331
+ "AMAZON",
1332
+ "GIT_LAB",
1333
+ "SHOPIFY",
1334
+ "GIT_HUB_ENTERPRISE",
1335
+ "GIT_LAB_ENTERPRISE",
1336
+ "PUSHOVER",
1337
+ "PUSHBULLET",
1338
+ "RACKSPACE",
1339
+ "CUSTOM",
1340
+ "CLOUDFLARE",
1341
+ "NEW_RELIC",
1342
+ "SENTRY",
1343
+ "ROLLBAR",
1344
+ "DATADOG",
1345
+ "DO_SPACES",
1346
+ "HONEYBADGER",
1347
+ "VULTR",
1348
+ "SENTRY_ENTERPRISE",
1349
+ "LOGGLY",
1350
+ "HIP_CHAT",
1351
+ "FIREBASE",
1352
+ "TELEGRAM",
1353
+ "AZURE",
1354
+ "UPCLOUD",
1355
+ "GHOST_INSPECTOR",
1356
+ "NETLIFY",
1357
+ "AZURE_CLOUD",
1358
+ "MICROSOFT_TEAMS",
1359
+ "GOOGLE_SERVICE_ACCOUNT",
1360
+ "GOOGLE_PLAY_STORE",
1361
+ "DOCKER_HUB",
1362
+ "APP_STORE",
1363
+ "GIT_HUB_APP",
1364
+ "GIT_HUB_APP_ENTERPRISE",
1365
+ "GIT_HUB_API",
1366
+ "ATOP",
1367
+ "SNYK",
1368
+ "STACK_HAWK",
1369
+ "BLACKFIRE",
1370
+ "BACKBLAZE",
1371
+ "ONE_LOGIN",
1372
+ "OKTA",
1373
+ "CONTENTFUL"
1374
+ ]).register(z.globalRegistry, { description: "The type of integration" })),
1375
+ auth_type: z.optional(z.enum([
1376
+ "OAUTH",
1377
+ "TOKEN",
1378
+ "API_KEY",
1379
+ "APP",
1380
+ "APP_SPRYKER",
1381
+ "TOKEN_APP_EXTENSION",
1382
+ "DEFAULT",
1383
+ "OIDC",
1384
+ "TRUSTED",
1385
+ "APP_RW"
1386
+ ]).register(z.globalRegistry, { description: "The authentication method used by the integration" })),
1387
+ scope: z.optional(z.enum([
1388
+ "WORKSPACE",
1389
+ "PROJECT",
1390
+ "ENVIRONMENT"
1391
+ ]).register(z.globalRegistry, { description: "The scope of the integration" })),
1392
+ project_name: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project (required when scope is `PROJECT`)" })),
1393
+ app_id: z.optional(z.string().register(z.globalRegistry, { description: "The application ID for Azure Cloud integrations" })),
1394
+ google_project: z.optional(z.string().register(z.globalRegistry, { description: "The Google Cloud project ID" })),
1395
+ host_url: z.optional(z.string().register(z.globalRegistry, { description: "The host URL for custom integrations" })),
1396
+ webhook_address: z.optional(z.string().register(z.globalRegistry, { description: "The webhook URL for receiving notifications" })),
1397
+ audience: z.optional(z.string().register(z.globalRegistry, { description: "The JWT audience for token validation" })),
1398
+ atop_url: z.optional(z.string().register(z.globalRegistry, { description: "The ATOP service URL" })),
1399
+ permissions: z.optional(zIntegrationPermissionsView),
1400
+ all_pipelines_allowed: z.optional(z.boolean().register(z.globalRegistry, { description: "Set to `true` to allow all pipelines to use this integration" })),
1401
+ allowed_pipelines: z.optional(z.array(zShortPipelineViewWritable).register(z.globalRegistry, { description: "List of specific pipelines allowed to use this integration" }))
1402
+ }).register(z.globalRegistry, { description: "The integration to use for authentication" });
1403
+ const zIntegrationsViewWritable = z.object({ integrations: z.optional(z.array(zIntegrationViewWritable)) });
1404
+ const zIdsViewWritable = z.object({
1405
+ domain: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" })),
1406
+ project_identifier: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project" })),
1407
+ pipeline_id: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the pipeline" })),
1408
+ environment_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the environment" })),
1409
+ pkg_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the package" })),
1410
+ pkg_version_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the package version" })),
1411
+ sandbox_id: z.optional(z.string().register(z.globalRegistry, { description: "The ID of the sandbox" }))
1412
+ });
612
1413
  /**
613
1414
  * Sandbox reference
614
1415
  */
@@ -738,6 +1539,16 @@ const zProjectViewWritable = z.object({
738
1539
  without_repository: z.optional(z.boolean().register(z.globalRegistry, { description: "If set to true, the project is created without any repository attached." }))
739
1540
  });
740
1541
  /**
1542
+ * Short representation of a project
1543
+ */
1544
+ const zShortProjectViewWritable = z.object({
1545
+ name: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project" })),
1546
+ display_name: z.string().register(z.globalRegistry, { description: "The Name of the project" }),
1547
+ status: z.optional(z.string().register(z.globalRegistry, { description: "The status of the project" })),
1548
+ access: z.optional(z.enum(["PRIVATE", "PUBLIC"]).register(z.globalRegistry, { description: "Indicates if this is a public project" })),
1549
+ create_date: z.optional(z.iso.datetime().register(z.globalRegistry, { description: "The creation date of the project" }))
1550
+ }).register(z.globalRegistry, { description: "Short representation of a project" });
1551
+ /**
741
1552
  * The environment variables of the sandbox
742
1553
  */
743
1554
  const zAddVariableInObjectRequestWritable = z.object({
@@ -1016,6 +1827,136 @@ const zSandboxResponseWritable = z.object({
1016
1827
  permissions: z.optional(zPermissionsView),
1017
1828
  variables: z.optional(z.array(zEnvironmentVariableView).register(z.globalRegistry, { description: "The environment variables of the sandbox" }))
1018
1829
  });
1830
+ const zProjectsViewWritable = z.object({ projects: z.optional(z.array(zShortProjectViewWritable)) });
1831
+ const zGetWorkspacesData = z.object({
1832
+ body: z.optional(z.never()),
1833
+ path: z.optional(z.never()),
1834
+ query: z.optional(z.never())
1835
+ });
1836
+ const zGetWorkspaceData = z.object({
1837
+ body: z.optional(z.never()),
1838
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1839
+ query: z.optional(z.never())
1840
+ });
1841
+ const zDisableSsoData = z.object({
1842
+ body: z.optional(z.never()),
1843
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1844
+ query: z.optional(z.never())
1845
+ });
1846
+ const zEnableSsoData = z.object({
1847
+ body: z.optional(z.never()),
1848
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1849
+ query: z.optional(z.never())
1850
+ });
1851
+ const zGetIdentifiersData = z.object({
1852
+ body: z.optional(z.never()),
1853
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1854
+ query: z.optional(z.object({
1855
+ project: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the project" })),
1856
+ pipeline: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the pipeline" })),
1857
+ environment: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the environment" })),
1858
+ package: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the package" })),
1859
+ package_version: z.optional(z.string().register(z.globalRegistry, { description: "The version of the package" })),
1860
+ sandbox: z.optional(z.string().register(z.globalRegistry, { description: "The human-readable ID of the sandbox" }))
1861
+ }))
1862
+ });
1863
+ const zGetIdentifiersResponse = zIdsView;
1864
+ const zGetIntegrationsData = z.object({
1865
+ body: z.optional(z.never()),
1866
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1867
+ query: z.optional(z.never())
1868
+ });
1869
+ const zAddIntegrationData = z.object({
1870
+ body: z.optional(zAddIntegrationRequest),
1871
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1872
+ query: z.optional(z.never())
1873
+ });
1874
+ const zDeleteIntegrationData = z.object({
1875
+ body: z.optional(z.never()),
1876
+ path: z.object({
1877
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1878
+ hash_id: z.string().register(z.globalRegistry, { description: "The hash ID of the integration" })
1879
+ }),
1880
+ query: z.optional(z.never())
1881
+ });
1882
+ /**
1883
+ * Integration deleted successfully
1884
+ */
1885
+ const zDeleteIntegrationResponse = z.void().register(z.globalRegistry, { description: "Integration deleted successfully" });
1886
+ const zGetIntegrationData = z.object({
1887
+ body: z.optional(z.never()),
1888
+ path: z.object({
1889
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1890
+ hash_id: z.string().register(z.globalRegistry, { description: "The hash ID of the integration" })
1891
+ }),
1892
+ query: z.optional(z.never())
1893
+ });
1894
+ const zUpdateIntegrationData = z.object({
1895
+ body: z.optional(zUpdateIntegrationRequest),
1896
+ path: z.object({
1897
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1898
+ hash_id: z.string().register(z.globalRegistry, { description: "The hash ID of the integration" })
1899
+ }),
1900
+ query: z.optional(z.never())
1901
+ });
1902
+ const zGetWorkspaceMembersData = z.object({
1903
+ body: z.optional(z.never()),
1904
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1905
+ query: z.optional(z.object({
1906
+ page: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The number of the successive pages (results are split into pages of per_page elements each)." })),
1907
+ per_page: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "Specifies the number of returned elements on the page. The default value is 20." })),
1908
+ sort_by: z.optional(z.string().register(z.globalRegistry, { description: "Specifies ordering for workspace members. Can be one of `id` or `name`." })),
1909
+ sort_direction: z.optional(z.string().register(z.globalRegistry, { description: "Specifies the direction of the ordering. Can be one of `ASC` or `DESC`" }))
1910
+ }))
1911
+ });
1912
+ const zAddWorkspaceMemberData = z.object({
1913
+ body: z.optional(zAddWorkspaceMemberRequest),
1914
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1915
+ query: z.optional(z.never())
1916
+ });
1917
+ const zDeleteWorkspaceMemberData = z.object({
1918
+ body: z.optional(z.never()),
1919
+ path: z.object({
1920
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1921
+ id: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the member" })
1922
+ }),
1923
+ query: z.optional(z.never())
1924
+ });
1925
+ /**
1926
+ * Workspace member deleted successfully
1927
+ */
1928
+ const zDeleteWorkspaceMemberResponse = z.void().register(z.globalRegistry, { description: "Workspace member deleted successfully" });
1929
+ const zGetWorkspaceMemberData = z.object({
1930
+ body: z.optional(z.never()),
1931
+ path: z.object({
1932
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1933
+ id: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the member" })
1934
+ }),
1935
+ query: z.optional(z.never())
1936
+ });
1937
+ const zUpdateWorkspaceMemberData = z.object({
1938
+ body: z.optional(zUpdateWorkspaceMemberRequest),
1939
+ path: z.object({
1940
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1941
+ id: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the member" })
1942
+ }),
1943
+ query: z.optional(z.never())
1944
+ });
1945
+ const zGetWorkspaceMemberProjectsData = z.object({
1946
+ body: z.optional(z.never()),
1947
+ path: z.object({
1948
+ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }),
1949
+ user_id: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The ID of the user" })
1950
+ }),
1951
+ query: z.optional(z.object({
1952
+ page: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "The number of the successive pages (results are split into pages of per_page elements each)." })),
1953
+ per_page: z.optional(z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, { description: "Specifies the number of returned elements on the page. The default value is 20." })),
1954
+ status: z.optional(z.string().register(z.globalRegistry, { description: "Filters projects by the specified status. Can be one of `ACTIVE` or `CLOSED`" })),
1955
+ sort_by: z.optional(z.string().register(z.globalRegistry, { description: "Specifies ordering. Can be one of `name`, `create_date` or `repository_size`" })),
1956
+ sort_direction: z.optional(z.string().register(z.globalRegistry, { description: "Specifies the direction of the ordering. Can be one of `ASC` or `DESC`" })),
1957
+ all: z.optional(z.string().register(z.globalRegistry, { description: "If set to true, returns all projects accessible to the user" }))
1958
+ }))
1959
+ });
1019
1960
  const zGetSandboxesData = z.object({
1020
1961
  body: z.optional(z.never()),
1021
1962
  path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
@@ -1283,11 +2224,21 @@ const zAddSandboxByYamlData = z.object({
1283
2224
  path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
1284
2225
  query: z.object({ project_name: z.string().register(z.globalRegistry, { description: "The human-readable ID of the project to filter sandboxes" }) })
1285
2226
  });
2227
+ const zGetSsoData = z.object({
2228
+ body: z.optional(z.never()),
2229
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
2230
+ query: z.optional(z.never())
2231
+ });
2232
+ const zUpdateSsoData = z.object({
2233
+ body: z.optional(zUpdateSsoRequest),
2234
+ path: z.object({ workspace_domain: z.string().register(z.globalRegistry, { description: "The human-readable ID of the workspace" }) }),
2235
+ query: z.optional(z.never())
2236
+ });
1286
2237
 
1287
2238
  //#endregion
1288
2239
  //#region package.json
1289
2240
  var name = "@buddy-works/sandbox-sdk";
1290
- var version = "0.1.2";
2241
+ var version = "0.1.3-rc.0";
1291
2242
 
1292
2243
  //#endregion
1293
2244
  //#region src/utils/environment.ts
@@ -1694,6 +2645,16 @@ var BuddyApiClient = class extends HttpClient {
1694
2645
  responseSchema: zGetSandboxResponse.transform(getSandboxResponseTransformer)
1695
2646
  });
1696
2647
  }
2648
+ /** Get a specific sandbox by its ID */
2649
+ async getIdentifiers(data) {
2650
+ return this.#requestWithValidation({
2651
+ method: "GET",
2652
+ data,
2653
+ url: "/workspaces/{workspace_domain}/identifiers",
2654
+ dataSchema: zGetIdentifiersData,
2655
+ responseSchema: zGetIdentifiersResponse
2656
+ });
2657
+ }
1697
2658
  /** Execute a command in a sandbox */
1698
2659
  async executeCommand(data) {
1699
2660
  return this.#requestWithValidation({
@@ -2388,7 +3349,16 @@ var Sandbox = class Sandbox {
2388
3349
  return withErrorHandler("Failed to get sandbox by identifier", async () => {
2389
3350
  const { connection } = config ?? {};
2390
3351
  const client = createClient(connection);
2391
- const sandboxId = ((await client.getSandboxes({}))?.sandboxes ?? []).find((s) => s.identifier === identifier)?.id;
3352
+ let sandboxId;
3353
+ try {
3354
+ sandboxId = (await client.getIdentifiers({ query: {
3355
+ project: client.project_name,
3356
+ sandbox: identifier
3357
+ } })).sandbox_id;
3358
+ } catch {}
3359
+ if (!sandboxId) try {
3360
+ sandboxId = (await client.getSandboxes({}))?.sandboxes?.find((s) => s.identifier === identifier)?.id;
3361
+ } catch {}
2392
3362
  if (!sandboxId) throw new Error(`Sandbox with identifier '${identifier}' not found`);
2393
3363
  const sandboxResponse = await client.getSandboxById({ path: { id: sandboxId } });
2394
3364
  if (!sandboxResponse) throw new Error(`Sandbox with ID '${sandboxId}' not found`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buddy-works/sandbox-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3-rc.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for managing sandboxes through the Buddy API",
6
6
  "main": "./dist/index.mjs",