@cdot65/prisma-airs-sdk 0.14.1 → 0.18.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.js CHANGED
@@ -29,7 +29,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
29
29
  var MAX_CONNECTION_POOL_SIZE = 100;
30
30
  var MAX_NUMBER_OF_RETRIES = 5;
31
31
  var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
32
- var SDK_VERSION = "0.14.1";
32
+ var SDK_VERSION = "0.17.0";
33
33
  var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
34
34
  var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
35
35
  var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
@@ -104,6 +104,8 @@ var RED_TEAM_LANGUAGES_PATH = "/v1/languages";
104
104
  var RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH = "/v1/error-log/target-profile";
105
105
  var RED_TEAM_TARGET_PATH = "/v1/target";
106
106
  var RED_TEAM_TARGET_VALIDATE_AUTH_PATH = "/v1/target/validate-auth";
107
+ var RED_TEAM_ADAPTER_PATH = "/v1/adapters";
108
+ var RED_TEAM_ADAPTER_VALIDATE_PATH = "/v1/adapters/validate";
107
109
  var RED_TEAM_TEMPLATE_PATH = "/v1/template";
108
110
  var RED_TEAM_EULA_PATH = "/v1/eula";
109
111
  var RED_TEAM_INSTANCES_PATH = "/v1/instances";
@@ -1359,6 +1361,60 @@ var Content = class _Content {
1359
1361
  }
1360
1362
  };
1361
1363
 
1364
+ // src/listing.ts
1365
+ async function* paginate(fetchPage, initialCursor) {
1366
+ let cursor = initialCursor;
1367
+ const seen = /* @__PURE__ */ new Set();
1368
+ while (true) {
1369
+ if (seen.has(cursor)) throw new Error("Pagination returned a repeated cursor");
1370
+ seen.add(cursor);
1371
+ const page = await fetchPage(cursor);
1372
+ yield* page.items;
1373
+ if (page.next === void 0) return;
1374
+ cursor = page.next;
1375
+ }
1376
+ }
1377
+ async function collectAll(iterable, opts = {}) {
1378
+ const max = opts.max ?? 1e4;
1379
+ if (!Number.isSafeInteger(max) || max < 0)
1380
+ throw new RangeError("max must be a non-negative integer");
1381
+ const items = [];
1382
+ for await (const item of iterable) {
1383
+ if (max > 0 && items.length >= max) break;
1384
+ items.push(item);
1385
+ }
1386
+ return items;
1387
+ }
1388
+ function collectSkipPages(fetchPage, opts = {}) {
1389
+ const limit = opts.limit ?? 50;
1390
+ return collectAll(
1391
+ paginate(async (skip) => {
1392
+ const page = await fetchPage(skip, limit);
1393
+ const next = skip + page.items.length;
1394
+ const hasMore = page.items.length > 0 && (page.total == null ? page.items.length === limit : next < page.total);
1395
+ return { items: page.items, next: hasMore ? next : void 0 };
1396
+ }, 0),
1397
+ { max: opts.max }
1398
+ );
1399
+ }
1400
+ function collectSpringPages(fetchPage, opts = {}) {
1401
+ const size = opts.size ?? 50;
1402
+ return collectAll(
1403
+ paginate(async (page) => {
1404
+ const result = await fetchPage(page, size);
1405
+ return { items: result.items, next: result.last ? void 0 : page + 1 };
1406
+ }, 0),
1407
+ { max: opts.max }
1408
+ );
1409
+ }
1410
+ function serializeListing(opts) {
1411
+ const params = {};
1412
+ if (opts?.skip !== void 0) params.skip = String(opts.skip);
1413
+ if (opts?.limit !== void 0) params.limit = String(opts.limit);
1414
+ if (opts?.search !== void 0) params.search = opts.search;
1415
+ return params;
1416
+ }
1417
+
1362
1418
  // src/models/enums.ts
1363
1419
  var Verdict = {
1364
1420
  BENIGN: "benign",
@@ -3619,6 +3675,76 @@ var TenantLanguagesResponseSchema = z33.object({
3619
3675
  supported_job_types: z33.array(z33.string()),
3620
3676
  languages: z33.array(LanguageOptionSchema)
3621
3677
  }).passthrough();
3678
+ var AdapterVarTypeSchema = z33.enum(["VAR", "SECRET"]);
3679
+ var AdapterVarSchema = z33.object({
3680
+ key: z33.string().max(255),
3681
+ value: z33.string().nullable().optional(),
3682
+ type: AdapterVarTypeSchema
3683
+ });
3684
+ var AdapterVarResponseSchema = AdapterVarSchema.extend({
3685
+ is_redacted: z33.boolean().optional()
3686
+ }).passthrough();
3687
+ var AdapterCreateRequestSchema = z33.object({
3688
+ name: z33.string().max(255),
3689
+ description: z33.string().nullable().optional(),
3690
+ script_b64: z33.string(),
3691
+ /** Optional while the adapter is a DRAFT; required to activate (`validate: true`). */
3692
+ network_broker_channel_uuid: z33.string().uuid().nullable().optional(),
3693
+ variables: z33.array(AdapterVarSchema).optional(),
3694
+ /** Sample prompt used to exercise the adapter end-to-end during validation. Not stored. */
3695
+ prompt: z33.string()
3696
+ }).strict();
3697
+ var AdapterUpdateRequestSchema = z33.object({
3698
+ name: z33.string().max(255),
3699
+ description: z33.string().nullable().optional(),
3700
+ script_b64: z33.string(),
3701
+ network_broker_channel_uuid: z33.string().uuid().nullable().optional(),
3702
+ variables: z33.array(AdapterVarSchema).optional(),
3703
+ prompt: z33.string()
3704
+ }).strict();
3705
+ var AdapterResponseSchema = z33.object({
3706
+ uuid: z33.string().uuid(),
3707
+ tsg_id: z33.string(),
3708
+ name: z33.string(),
3709
+ script_b64: z33.string(),
3710
+ status: z33.string(),
3711
+ description: z33.string().nullable().optional(),
3712
+ network_broker_channel_uuid: z33.string().uuid().nullable().optional(),
3713
+ variables: z33.array(AdapterVarResponseSchema).optional(),
3714
+ /** Number of targets currently referencing this adapter. */
3715
+ target_count: z33.number().int().optional(),
3716
+ created_at: z33.string().nullable().optional(),
3717
+ updated_at: z33.string().nullable().optional(),
3718
+ created_by_user_id: z33.string().uuid().nullable().optional(),
3719
+ updated_by_user_id: z33.string().uuid().nullable().optional()
3720
+ }).passthrough();
3721
+ var AdapterListItemSchema = z33.object({
3722
+ uuid: z33.string().uuid(),
3723
+ name: z33.string(),
3724
+ status: z33.string(),
3725
+ created_at: z33.string(),
3726
+ updated_at: z33.string(),
3727
+ created_by_user_id: z33.string().uuid().nullable().optional(),
3728
+ target_count: z33.number().int().nullable().optional()
3729
+ }).passthrough();
3730
+ var AdapterListSchema = z33.object({
3731
+ pagination: RedTeamPaginationSchema,
3732
+ data: z33.array(AdapterListItemSchema).optional()
3733
+ }).passthrough();
3734
+ var AdapterValidateRequestSchema = z33.object({
3735
+ script_b64: z33.string(),
3736
+ network_broker_channel_uuid: z33.string().uuid(),
3737
+ prompt: z33.string(),
3738
+ variables: z33.array(AdapterVarSchema).optional(),
3739
+ /** Omit when validating a brand-new adapter. */
3740
+ adapter_uuid: z33.string().uuid().nullable().optional()
3741
+ }).strict();
3742
+ var AdapterValidateResponseSchema = z33.object({
3743
+ validated: z33.boolean(),
3744
+ stdout: z33.string().nullable().optional(),
3745
+ stderr: z33.string().nullable().optional(),
3746
+ traceback: z33.string().nullable().optional()
3747
+ }).passthrough();
3622
3748
  var TargetRequestBaseFields = {
3623
3749
  name: z33.string(),
3624
3750
  description: z33.string().nullable().optional(),
@@ -3632,7 +3758,11 @@ var TargetRequestBaseFields = {
3632
3758
  target_background: TargetBackgroundSchema.nullable().optional(),
3633
3759
  additional_context: TargetAdditionalContextSchema.nullable().optional(),
3634
3760
  extra_info: z33.record(z33.unknown()).nullable().optional(),
3635
- network_broker_channel_uuid: z33.string().nullable().optional()
3761
+ network_broker_channel_uuid: z33.string().nullable().optional(),
3762
+ /** UUID of the custom target adapter to use. Required when connection_type is CUSTOM_TARGET_ADAPTER. */
3763
+ adapter_uuid: z33.string().uuid().nullable().optional(),
3764
+ /** Per-target overrides for the adapter's variables. Array of AdapterVar objects. */
3765
+ adapter_variable_overrides: z33.array(AdapterVarSchema).nullable().optional()
3636
3766
  };
3637
3767
  var TargetCreateRequestSchema = z33.object(TargetRequestBaseFields).strict();
3638
3768
  var TargetUpdateRequestSchema = z33.object(TargetRequestBaseFields).strict();
@@ -4024,6 +4154,20 @@ var aiGatewayList = (item) => z35.object({
4024
4154
  has_more: z35.boolean().optional(),
4025
4155
  data: z35.array(item)
4026
4156
  }).passthrough();
4157
+ var GatewayUsageLimitSchema = z35.object({
4158
+ credit_limit: z35.number().optional(),
4159
+ type: z35.string().optional(),
4160
+ alert_threshold: z35.number().optional(),
4161
+ periodic_reset: z35.string().nullable().optional(),
4162
+ periodic_reset_days: z35.number().nullable().optional(),
4163
+ next_usage_reset_at: z35.string().nullable().optional()
4164
+ }).passthrough();
4165
+ var GatewayRateLimitSchema = z35.object({
4166
+ type: z35.string().optional(),
4167
+ unit: z35.string().optional(),
4168
+ value: z35.number().optional()
4169
+ }).passthrough();
4170
+ var limitsField = (policy) => z35.union([z35.array(policy), z35.record(z35.unknown())]).nullable();
4027
4171
  var aiGatewayGroupList = (item) => z35.object({
4028
4172
  object: z35.string(),
4029
4173
  is_quota_exceeded: z35.boolean(),
@@ -4230,7 +4374,9 @@ var GatewayWorkspaceSchema = z35.object({
4230
4374
  slug: z35.string(),
4231
4375
  name: z35.string(),
4232
4376
  icon: z35.string().nullable(),
4233
- description: z35.string(),
4377
+ // Nullable: a workspace created without one returns null, and upstream declares it
4378
+ // `nullable: true`. Observed on an archived workspace (#213).
4379
+ description: z35.string().nullable(),
4234
4380
  created_at: z35.string(),
4235
4381
  last_updated_at: z35.string(),
4236
4382
  is_default: z35.number(),
@@ -4241,18 +4387,38 @@ var GatewayWorkspaceSchema = z35.object({
4241
4387
  var GatewayWorkspaceDetailSchema = z35.object({
4242
4388
  id: z35.string(),
4243
4389
  name: z35.string(),
4244
- description: z35.string(),
4390
+ /** Nullable — see `GatewayWorkspaceSchema.description`. */
4391
+ description: z35.string().nullable(),
4245
4392
  created_at: z35.string(),
4246
4393
  last_updated_at: z35.string(),
4247
4394
  is_default: z35.number(),
4248
4395
  slug: z35.string(),
4249
4396
  icon: z35.string().nullable(),
4250
4397
  defaults: z35.record(z35.unknown()).nullable(),
4251
- usage_limits: z35.record(z35.unknown()).nullable(),
4252
- rate_limits: z35.record(z35.unknown()).nullable(),
4398
+ usage_limits: limitsField(GatewayUsageLimitSchema),
4399
+ rate_limits: limitsField(GatewayRateLimitSchema),
4253
4400
  security_settings: z35.record(z35.boolean()).optional(),
4254
4401
  data_plane_security_settings: z35.record(z35.unknown()).optional(),
4255
- settings: z35.record(z35.unknown()).optional()
4402
+ settings: z35.record(z35.unknown()).optional(),
4403
+ /**
4404
+ * Lifecycle state. **Diverges from the list row**: `list()` reports `'active'` for a
4405
+ * workspace whose `get()` reports `null` (observed live 2026-08-01). Prefer the list value,
4406
+ * or treat a `null` here as "unknown", not as "inactive".
4407
+ */
4408
+ status: z35.string().nullable().optional()
4409
+ }).passthrough();
4410
+ var GatewayWorkspaceCreateResponseSchema = z35.object({
4411
+ id: z35.string(),
4412
+ name: z35.string(),
4413
+ slug: z35.string(),
4414
+ description: z35.string().nullable(),
4415
+ created_at: z35.string(),
4416
+ last_updated_at: z35.string(),
4417
+ scope_name: z35.string(),
4418
+ object: z35.string(),
4419
+ defaults: z35.record(z35.unknown()).nullable().optional(),
4420
+ /** Seeded workspace members. Present on create only. */
4421
+ users: z35.array(z35.unknown()).optional()
4256
4422
  }).passthrough();
4257
4423
  var ListWorkspacesResponseSchema = aiGatewayList(GatewayWorkspaceSchema);
4258
4424
  var GatewayConfigSchema = z35.object({
@@ -4368,8 +4534,8 @@ var GatewayIntegrationModelsResponseSchema = z35.object({
4368
4534
  }).passthrough();
4369
4535
  var GatewayIntegrationWorkspaceSchema = z35.object({
4370
4536
  id: z35.string(),
4371
- usage_limits: z35.record(z35.unknown()).nullable(),
4372
- rate_limits: z35.record(z35.unknown()).nullable(),
4537
+ usage_limits: limitsField(GatewayUsageLimitSchema),
4538
+ rate_limits: limitsField(GatewayRateLimitSchema),
4373
4539
  enabled: z35.boolean(),
4374
4540
  status: z35.string(),
4375
4541
  created_at: z35.string(),
@@ -4378,8 +4544,8 @@ var GatewayIntegrationWorkspaceSchema = z35.object({
4378
4544
  }).passthrough();
4379
4545
  var GatewayGlobalWorkspaceAccessSchema = z35.object({
4380
4546
  enabled: z35.boolean(),
4381
- rate_limits: z35.record(z35.unknown()).nullable(),
4382
- usage_limits: z35.record(z35.unknown()).nullable()
4547
+ rate_limits: limitsField(GatewayRateLimitSchema),
4548
+ usage_limits: limitsField(GatewayUsageLimitSchema)
4383
4549
  }).passthrough();
4384
4550
  var GatewayIntegrationWorkspacesResponseSchema = z35.object({
4385
4551
  workspaces: z35.array(GatewayIntegrationWorkspaceSchema),
@@ -4731,6 +4897,14 @@ function assertUuid(value, fieldName) {
4731
4897
  );
4732
4898
  }
4733
4899
  }
4900
+ function assertWorkspaceRef(value, fieldName) {
4901
+ if (!isValidUuid(value) && !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) {
4902
+ throw new AISecSDKException(
4903
+ `Invalid ${fieldName}: ${value} (expected a workspace UUID or slug)`,
4904
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
4905
+ );
4906
+ }
4907
+ }
4734
4908
  function assertNumericId(value, fieldName) {
4735
4909
  if (!/^\d+$/.test(value)) {
4736
4910
  throw new AISecSDKException(
@@ -4802,6 +4976,7 @@ var ProfilesClient = class {
4802
4976
  offset: String(opts?.offset ?? 0),
4803
4977
  limit: String(opts?.limit ?? 100)
4804
4978
  };
4979
+ if (opts?.latest !== void 0) params.latest = String(opts.latest);
4805
4980
  return request({
4806
4981
  method: "GET",
4807
4982
  baseUrl: this.baseUrl,
@@ -4812,6 +4987,23 @@ var ProfilesClient = class {
4812
4987
  numRetries: this.numRetries
4813
4988
  });
4814
4989
  }
4990
+ /**
4991
+ * List security profiles across every response page.
4992
+ * @example
4993
+ * ```ts
4994
+ * const profiles = await mgmt.profiles.listAll({ latest: true });
4995
+ * ```
4996
+ */
4997
+ async listAll(opts = {}) {
4998
+ const limit = opts.limit ?? 100;
4999
+ return collectAll(
5000
+ paginate(async (offset) => {
5001
+ const page = await this.list({ offset, limit, latest: opts.latest });
5002
+ return { items: page.ai_profiles, next: page.next_offset || void 0 };
5003
+ }, 0),
5004
+ { max: opts.max }
5005
+ );
5006
+ }
4815
5007
  /**
4816
5008
  * Get a security profile by UUID.
4817
5009
  * Fetches all profiles and filters — no dedicated API endpoint exists.
@@ -4829,7 +5021,7 @@ var ProfilesClient = class {
4829
5021
  * ```
4830
5022
  */
4831
5023
  async get(profileId) {
4832
- const { ai_profiles } = await this.list();
5024
+ const ai_profiles = await this.listAll();
4833
5025
  const profile = ai_profiles.find((p) => p.profile_id === profileId);
4834
5026
  if (!profile) {
4835
5027
  throw new AISecSDKException(
@@ -4855,7 +5047,7 @@ var ProfilesClient = class {
4855
5047
  * ```
4856
5048
  */
4857
5049
  async getByName(profileName) {
4858
- const { ai_profiles } = await this.list();
5050
+ const ai_profiles = await this.listAll();
4859
5051
  const matches = ai_profiles.filter((p) => p.profile_name === profileName);
4860
5052
  if (matches.length === 0) {
4861
5053
  throw new AISecSDKException(
@@ -5010,6 +5202,22 @@ var TopicsClient = class {
5010
5202
  * ```
5011
5203
  */
5012
5204
  async list(opts) {
5205
+ if (opts?.latestOnly) {
5206
+ const all = await this.listAll({ limit: 200 });
5207
+ const latest = /* @__PURE__ */ new Map();
5208
+ for (const topic of all) {
5209
+ const current = latest.get(topic.topic_name);
5210
+ if (!current || topic.revision > current.revision) latest.set(topic.topic_name, topic);
5211
+ }
5212
+ const custom_topics = [...latest.values()];
5213
+ const offset = opts.offset ?? 0;
5214
+ const limit = opts.limit ?? 100;
5215
+ const nextOffset = offset + limit;
5216
+ return {
5217
+ custom_topics: custom_topics.slice(offset, nextOffset),
5218
+ next_offset: nextOffset < custom_topics.length ? nextOffset : void 0
5219
+ };
5220
+ }
5013
5221
  const params = {
5014
5222
  offset: String(opts?.offset ?? 0),
5015
5223
  limit: String(opts?.limit ?? 100)
@@ -5024,6 +5232,55 @@ var TopicsClient = class {
5024
5232
  numRetries: this.numRetries
5025
5233
  });
5026
5234
  }
5235
+ /**
5236
+ * List custom topics across every response page.
5237
+ * @example
5238
+ * ```ts
5239
+ * const topics = await mgmt.topics.listAll({ limit: 200 });
5240
+ * ```
5241
+ */
5242
+ async listAll(opts = {}) {
5243
+ const limit = opts.limit ?? 100;
5244
+ return collectAll(
5245
+ paginate(async (offset) => {
5246
+ const page = await this.list({ offset, limit });
5247
+ return { items: page.custom_topics, next: page.next_offset || void 0 };
5248
+ }, 0),
5249
+ { max: opts.max }
5250
+ );
5251
+ }
5252
+ /**
5253
+ * Get an exact custom-topic revision by UUID.
5254
+ * @example
5255
+ * ```ts
5256
+ * const topic = await mgmt.topics.get('550e8400-e29b-41d4-a716-446655440000');
5257
+ * ```
5258
+ */
5259
+ async get(topicId) {
5260
+ const topic = (await this.listAll()).find((item) => item.topic_id === topicId);
5261
+ if (!topic)
5262
+ throw new AISecSDKException(
5263
+ `Topic not found: ${topicId}`,
5264
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5265
+ );
5266
+ return topic;
5267
+ }
5268
+ /**
5269
+ * Get the highest revision of a custom topic by name.
5270
+ * @example
5271
+ * ```ts
5272
+ * const topic = await mgmt.topics.getByName('credit-cards');
5273
+ * ```
5274
+ */
5275
+ async getByName(topicName) {
5276
+ const matches = (await this.listAll()).filter((item) => item.topic_name === topicName);
5277
+ if (matches.length === 0)
5278
+ throw new AISecSDKException(
5279
+ `Topic not found: ${topicName}`,
5280
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5281
+ );
5282
+ return matches.reduce((best, topic) => topic.revision > best.revision ? topic : best);
5283
+ }
5027
5284
  /**
5028
5285
  * Update an existing custom topic.
5029
5286
  * @param topicId - UUID of the topic to update.
@@ -5187,6 +5444,17 @@ var ApiKeysClient = class {
5187
5444
  numRetries: this.numRetries
5188
5445
  });
5189
5446
  }
5447
+ /** List all API keys. @example `const keys = await mgmt.apiKeys.listAll();` */
5448
+ async listAll(opts = {}) {
5449
+ const limit = opts.limit ?? 100;
5450
+ return collectAll(
5451
+ paginate(async (offset) => {
5452
+ const page = await this.list({ offset, limit });
5453
+ return { items: page.api_keys ?? [], next: page.next_offset || void 0 };
5454
+ }, 0),
5455
+ { max: opts.max }
5456
+ );
5457
+ }
5190
5458
  /**
5191
5459
  * Delete an API key by name.
5192
5460
  * @param apiKeyName - Name of the API key to delete.
@@ -5311,6 +5579,17 @@ var CustomerAppsClient = class {
5311
5579
  numRetries: this.numRetries
5312
5580
  });
5313
5581
  }
5582
+ /** List all customer applications. @example `const apps = await mgmt.customerApps.listAll();` */
5583
+ async listAll(opts = {}) {
5584
+ const limit = opts.limit ?? 100;
5585
+ return collectAll(
5586
+ paginate(async (offset) => {
5587
+ const page = await this.list({ offset, limit });
5588
+ return { items: page.customer_apps ?? [], next: page.next_offset || void 0 };
5589
+ }, 0),
5590
+ { max: opts.max }
5591
+ );
5592
+ }
5314
5593
  /**
5315
5594
  * Update a customer app.
5316
5595
  * @param customerAppId - UUID of the customer app to update.
@@ -5758,6 +6037,17 @@ var DataFilteringProfilesClient = class {
5758
6037
  numRetries: this.numRetries
5759
6038
  });
5760
6039
  }
6040
+ /** List all filtering profiles. @example `const profiles = await mgmt.dlp.dataFilteringProfiles.listAll();` */
6041
+ async listAll(params = {}) {
6042
+ return collectSpringPages(
6043
+ async (page, size) => {
6044
+ const result = await this.list({ ...params, page, size });
6045
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
6046
+ return { items: result.content, last };
6047
+ },
6048
+ { size: params.size, max: params.max }
6049
+ );
6050
+ }
5761
6051
  /**
5762
6052
  * Get a single data filtering profile by resource ID.
5763
6053
  * @example
@@ -5851,6 +6141,17 @@ var DataPatternsClient = class {
5851
6141
  numRetries: this.numRetries
5852
6142
  });
5853
6143
  }
6144
+ /** List all data patterns. @example `const patterns = await mgmt.dlp.dataPatterns.listAll();` */
6145
+ async listAll(params = {}) {
6146
+ return collectSpringPages(
6147
+ async (page, size) => {
6148
+ const result = await this.list({ ...params, page, size });
6149
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
6150
+ return { items: result.content, last };
6151
+ },
6152
+ { size: params.size, max: params.max }
6153
+ );
6154
+ }
5854
6155
  /**
5855
6156
  * Create a new custom data pattern.
5856
6157
  * @example
@@ -6024,6 +6325,17 @@ var DataProfilesClient = class {
6024
6325
  numRetries: this.numRetries
6025
6326
  });
6026
6327
  }
6328
+ /** List all data profiles. @example `const profiles = await mgmt.dlp.dataProfiles.listAll();` */
6329
+ async listAll(params = {}) {
6330
+ return collectSpringPages(
6331
+ async (page, size) => {
6332
+ const result = await this.list({ ...params, page, size });
6333
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
6334
+ return { items: result.content, last };
6335
+ },
6336
+ { size: params.size, max: params.max }
6337
+ );
6338
+ }
6027
6339
  /**
6028
6340
  * Create a new data profile.
6029
6341
  * @example
@@ -6204,6 +6516,17 @@ var DictionariesClient = class {
6204
6516
  numRetries: this.numRetries
6205
6517
  });
6206
6518
  }
6519
+ /** List all dictionaries. @example `const dictionaries = await mgmt.dlp.dictionaries.listAll();` */
6520
+ async listAll(params = {}) {
6521
+ return collectSpringPages(
6522
+ async (page, size) => {
6523
+ const result = await this.list({ ...params, page, size });
6524
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
6525
+ return { items: result.content, last };
6526
+ },
6527
+ { size: params.size, max: params.max }
6528
+ );
6529
+ }
6207
6530
  /**
6208
6531
  * Create a dictionary by uploading a keyword file. Sends a multipart body — the SDK does
6209
6532
  * not set Content-Type so the runtime can write the correct boundary.
@@ -6436,15 +6759,6 @@ var ManagementClient = class {
6436
6759
  }
6437
6760
  };
6438
6761
 
6439
- // src/listing.ts
6440
- function serializeListing(opts) {
6441
- const params = {};
6442
- if (opts?.skip !== void 0) params.skip = String(opts.skip);
6443
- if (opts?.limit !== void 0) params.limit = String(opts.limit);
6444
- if (opts?.search !== void 0) params.search = opts.search;
6445
- return params;
6446
- }
6447
-
6448
6762
  // src/model-security/scans-client.ts
6449
6763
  function buildScanListParams(opts) {
6450
6764
  const params = serializeListing(opts);
@@ -6540,6 +6854,13 @@ var ModelSecurityScansClient = class {
6540
6854
  numRetries: this.numRetries
6541
6855
  });
6542
6856
  }
6857
+ /** List every model-security scan page. @example `const scans = await ms.scans.listAll();` */
6858
+ async listAll(opts = {}) {
6859
+ return collectSkipPages(async (skip, limit) => {
6860
+ const page = await this.list({ ...opts, skip, limit });
6861
+ return { items: page.scans, total: page.pagination.total_items };
6862
+ }, opts);
6863
+ }
6543
6864
  /**
6544
6865
  * Get a single scan by UUID.
6545
6866
  * @param uuid - Scan UUID.
@@ -6918,6 +7239,13 @@ var ModelSecurityGroupsClient = class {
6918
7239
  numRetries: this.numRetries
6919
7240
  });
6920
7241
  }
7242
+ /** List every security-group page. @example `const groups = await ms.securityGroups.listAll();` */
7243
+ async listAll(opts = {}) {
7244
+ return collectSkipPages(async (skip, limit) => {
7245
+ const page = await this.list({ ...opts, skip, limit });
7246
+ return { items: page.security_groups, total: page.pagination.total_items };
7247
+ }, opts);
7248
+ }
6921
7249
  /**
6922
7250
  * Get a single security group by UUID.
6923
7251
  * @param uuid - Security group UUID.
@@ -7133,6 +7461,13 @@ var ModelSecurityRulesClient = class {
7133
7461
  numRetries: this.numRetries
7134
7462
  });
7135
7463
  }
7464
+ /** List every security-rule page. @example `const rules = await ms.securityRules.listAll();` */
7465
+ async listAll(opts = {}) {
7466
+ return collectSkipPages(async (skip, limit) => {
7467
+ const page = await this.list({ ...opts, skip, limit });
7468
+ return { items: page.rules, total: page.pagination.total_items };
7469
+ }, opts);
7470
+ }
7136
7471
  /**
7137
7472
  * Get a single security rule by UUID.
7138
7473
  * @param uuid - Security rule UUID.
@@ -7212,6 +7547,13 @@ var ModelSecurityModelsClient = class {
7212
7547
  numRetries: this.numRetries
7213
7548
  });
7214
7549
  }
7550
+ /** List every model page. @example `const models = await ms.models.listAllModels();` */
7551
+ async listAllModels(opts = {}) {
7552
+ return collectSkipPages(async (skip, limit) => {
7553
+ const page = await this.listModels({ ...opts, skip, limit });
7554
+ return { items: page.models, total: page.pagination.total_items };
7555
+ }, opts);
7556
+ }
7215
7557
  /**
7216
7558
  * Get a single model by UUID.
7217
7559
  * @param uuid - Model UUID.
@@ -7268,6 +7610,13 @@ var ModelSecurityModelsClient = class {
7268
7610
  numRetries: this.numRetries
7269
7611
  });
7270
7612
  }
7613
+ /** List every version of a model. @example `const versions = await ms.models.listAllModelVersions(modelUuid);` */
7614
+ async listAllModelVersions(modelUuid, opts = {}) {
7615
+ return collectSkipPages(async (skip, limit) => {
7616
+ const page = await this.listModelVersions(modelUuid, { ...opts, skip, limit });
7617
+ return { items: page.model_versions, total: page.pagination.total_items };
7618
+ }, opts);
7619
+ }
7271
7620
  /**
7272
7621
  * Get a single model version by UUID.
7273
7622
  * @param uuid - Model version UUID.
@@ -7322,6 +7671,13 @@ var ModelSecurityModelsClient = class {
7322
7671
  numRetries: this.numRetries
7323
7672
  });
7324
7673
  }
7674
+ /** List every file in a model version. @example `const files = await ms.models.listAllModelVersionFiles(versionUuid);` */
7675
+ async listAllModelVersionFiles(modelVersionUuid, opts = {}) {
7676
+ return collectSkipPages(async (skip, limit) => {
7677
+ const page = await this.listModelVersionFiles(modelVersionUuid, { ...opts, skip, limit });
7678
+ return { items: page.files, total: page.pagination.total_items };
7679
+ }, opts);
7680
+ }
7325
7681
  };
7326
7682
 
7327
7683
  // src/model-security/client.ts
@@ -7462,6 +7818,13 @@ var RedTeamScansClient = class {
7462
7818
  numRetries: this.numRetries
7463
7819
  });
7464
7820
  }
7821
+ /** List every scan page. @example `const scans = await rt.scans.listAll({ status: 'COMPLETED' });` */
7822
+ async listAll(opts = {}) {
7823
+ return collectSkipPages(async (skip, limit) => {
7824
+ const page = await this.list({ ...opts, skip, limit });
7825
+ return { items: page.data, total: page.pagination.total_items };
7826
+ }, opts);
7827
+ }
7465
7828
  /**
7466
7829
  * Get a single scan job by ID.
7467
7830
  * @param jobId - The job UUID.
@@ -8239,6 +8602,29 @@ var RedTeamTargetsClient = class {
8239
8602
  numRetries: this.numRetries
8240
8603
  });
8241
8604
  }
8605
+ /**
8606
+ * List targets across every page while preserving the supplied filters.
8607
+ * @example
8608
+ * ```ts
8609
+ * const targets = await rt.targets.listAll({ limit: 100, status: 'READY' });
8610
+ * ```
8611
+ */
8612
+ async listAll(opts = {}) {
8613
+ const limit = opts.limit ?? 50;
8614
+ return collectAll(
8615
+ paginate(async (skip) => {
8616
+ const page = await this.list({ ...opts, skip, limit });
8617
+ const items = page.data ?? [];
8618
+ const next = skip + items.length;
8619
+ const total = page.pagination.total_items;
8620
+ return {
8621
+ items,
8622
+ next: items.length > 0 && (total == null ? items.length === limit : next < total) ? next : void 0
8623
+ };
8624
+ }, 0),
8625
+ { max: opts.max }
8626
+ );
8627
+ }
8242
8628
  /**
8243
8629
  * Get a target by UUID.
8244
8630
  * @param uuid - The target UUID.
@@ -8555,6 +8941,13 @@ var RedTeamCustomAttacksClient = class {
8555
8941
  numRetries: this.numRetries
8556
8942
  });
8557
8943
  }
8944
+ /** List every custom prompt-set page. @example `const sets = await rt.customAttacks.listAllPromptSets();` */
8945
+ async listAllPromptSets(opts = {}) {
8946
+ return collectSkipPages(async (skip, limit) => {
8947
+ const page = await this.listPromptSets({ ...opts, skip, limit });
8948
+ return { items: page.data ?? [], total: page.pagination.total_items };
8949
+ }, opts);
8950
+ }
8558
8951
  /**
8559
8952
  * Get a prompt set by UUID.
8560
8953
  * @param uuid - The prompt set UUID.
@@ -8867,6 +9260,13 @@ var RedTeamCustomAttacksClient = class {
8867
9260
  numRetries: this.numRetries
8868
9261
  });
8869
9262
  }
9263
+ /** List every prompt page for a set. @example `const prompts = await rt.customAttacks.listAllPrompts(promptSetUuid);` */
9264
+ async listAllPrompts(promptSetUuid, opts = {}) {
9265
+ return collectSkipPages(async (skip, limit) => {
9266
+ const page = await this.listPrompts(promptSetUuid, { ...opts, skip, limit });
9267
+ return { items: page.data ?? [], total: page.pagination.total_items };
9268
+ }, opts);
9269
+ }
8870
9270
  /**
8871
9271
  * Get a prompt by UUID.
8872
9272
  * @param promptSetUuid - The prompt set UUID.
@@ -9553,6 +9953,183 @@ var RedTeamNetworkBrokerClient = class {
9553
9953
  }
9554
9954
  };
9555
9955
 
9956
+ // src/red-team/adapters-client.ts
9957
+ var RedTeamAdaptersClient = class {
9958
+ baseUrl;
9959
+ auth;
9960
+ numRetries;
9961
+ constructor(opts) {
9962
+ this.baseUrl = opts.baseUrl;
9963
+ this.auth = opts.auth;
9964
+ this.numRetries = opts.numRetries;
9965
+ }
9966
+ /**
9967
+ * Create a new custom target adapter.
9968
+ * @param body - Adapter creation request (name, base64 script, variables, validation prompt).
9969
+ * @param opts - Set validate: false to save as DRAFT without running the script.
9970
+ * @returns The created adapter.
9971
+ * @example
9972
+ * ```ts
9973
+ * const adapter = await rt.adapters.create({
9974
+ * name: 'my-adapter',
9975
+ * script_b64: Buffer.from(script).toString('base64'),
9976
+ * network_broker_channel_uuid: '550e8400-...',
9977
+ * variables: [{ key: 'endpoint', value: 'http://...', type: 'VAR' }],
9978
+ * prompt: 'Hello',
9979
+ * }, { validate: true });
9980
+ * ```
9981
+ */
9982
+ async create(body, opts) {
9983
+ const validate = opts?.validate ?? true;
9984
+ return request({
9985
+ method: "POST",
9986
+ baseUrl: this.baseUrl,
9987
+ path: RED_TEAM_ADAPTER_PATH,
9988
+ params: { validate: String(validate) },
9989
+ body,
9990
+ responseSchema: AdapterResponseSchema,
9991
+ auth: this.auth,
9992
+ numRetries: this.numRetries
9993
+ });
9994
+ }
9995
+ /**
9996
+ * List adapters with optional pagination.
9997
+ * @param opts - Optional limit/skip/search.
9998
+ * @returns Paginated list of adapters.
9999
+ * @example
10000
+ * ```ts
10001
+ * const { data } = await rt.adapters.list({ limit: 20 });
10002
+ * // data => [{ uuid: '...', name: 'my-adapter', status: 'ACTIVE' }]
10003
+ * ```
10004
+ */
10005
+ async list(opts) {
10006
+ return request({
10007
+ method: "GET",
10008
+ baseUrl: this.baseUrl,
10009
+ path: RED_TEAM_ADAPTER_PATH,
10010
+ params: serializeListing(opts),
10011
+ responseSchema: AdapterListSchema,
10012
+ auth: this.auth,
10013
+ numRetries: this.numRetries
10014
+ });
10015
+ }
10016
+ /** List every adapter page. @example `const adapters = await rt.adapters.listAll();` */
10017
+ async listAll(opts = {}) {
10018
+ return collectSkipPages(async (skip, limit) => {
10019
+ const page = await this.list({ ...opts, skip, limit });
10020
+ return { items: page.data ?? [], total: page.pagination.total_items };
10021
+ }, opts);
10022
+ }
10023
+ /**
10024
+ * Get a single adapter by UUID.
10025
+ * @param uuid - Adapter UUID.
10026
+ * @returns The adapter detail.
10027
+ * @example
10028
+ * ```ts
10029
+ * const adapter = await rt.adapters.get('550e8400-e29b-41d4-a716-446655440000');
10030
+ * // adapter.status => 'ACTIVE'
10031
+ * ```
10032
+ */
10033
+ async get(uuid) {
10034
+ assertUuid(uuid, "adapter uuid");
10035
+ return request({
10036
+ method: "GET",
10037
+ baseUrl: this.baseUrl,
10038
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
10039
+ responseSchema: AdapterResponseSchema,
10040
+ auth: this.auth,
10041
+ numRetries: this.numRetries
10042
+ });
10043
+ }
10044
+ /**
10045
+ * Update an adapter. **Full replacement (PUT), not a patch** — `name`, `script_b64`, and
10046
+ * `prompt` are required just as on create. For `variables`, the list defines the complete
10047
+ * desired key set: a provided value sets it, `null` keeps the stored value (unchanged
10048
+ * secrets), and omitting a key **deletes** that variable.
10049
+ * @param uuid - Adapter UUID.
10050
+ * @param body - The complete adapter definition.
10051
+ * @param opts - Set validate: false to save as DRAFT without re-running the script.
10052
+ * @returns The updated adapter.
10053
+ * @example
10054
+ * ```ts
10055
+ * const updated = await rt.adapters.update('550e8400-...', {
10056
+ * name: 'my-keycloak-agent',
10057
+ * script_b64: Buffer.from(newScript).toString('base64'),
10058
+ * prompt: 'What is the capital of France?',
10059
+ * variables: [
10060
+ * { key: 'endpoint', value: 'http://agent.svc:8080', type: 'VAR' },
10061
+ * { key: 'client_secret', value: null, type: 'SECRET' }, // null keeps stored secret
10062
+ * ],
10063
+ * });
10064
+ * ```
10065
+ */
10066
+ async update(uuid, body, opts) {
10067
+ assertUuid(uuid, "adapter uuid");
10068
+ const validate = opts?.validate ?? true;
10069
+ return request({
10070
+ method: "PUT",
10071
+ baseUrl: this.baseUrl,
10072
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
10073
+ params: { validate: String(validate) },
10074
+ body,
10075
+ responseSchema: AdapterResponseSchema,
10076
+ auth: this.auth,
10077
+ numRetries: this.numRetries
10078
+ });
10079
+ }
10080
+ /**
10081
+ * Delete an adapter.
10082
+ * @param uuid - Adapter UUID.
10083
+ * @example
10084
+ * ```ts
10085
+ * await rt.adapters.delete('550e8400-e29b-41d4-a716-446655440000');
10086
+ * ```
10087
+ */
10088
+ async delete(uuid) {
10089
+ assertUuid(uuid, "adapter uuid");
10090
+ return request({
10091
+ method: "DELETE",
10092
+ baseUrl: this.baseUrl,
10093
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
10094
+ responseSchema: BaseResponseSchema.optional(),
10095
+ allowEmptyBody: true,
10096
+ auth: this.auth,
10097
+ numRetries: this.numRetries
10098
+ });
10099
+ }
10100
+ /**
10101
+ * Validate an adapter script without saving anything. Runs the script end-to-end through the
10102
+ * network broker channel using the sample prompt, and returns the execution outcome —
10103
+ * `validated` plus the script's `stdout` / `stderr` / `traceback` — not an adapter record.
10104
+ *
10105
+ * This endpoint has its own request shape: no `name`, `network_broker_channel_uuid` is
10106
+ * required, and `adapter_uuid` may reference an existing adapter so `null` variable values
10107
+ * are resolved from its stored secrets before the run.
10108
+ * @param body - Script, channel, prompt, and optionally variables / an existing adapter UUID.
10109
+ * @returns The validation outcome.
10110
+ * @example
10111
+ * ```ts
10112
+ * const result = await rt.adapters.validate({
10113
+ * script_b64: Buffer.from(script).toString('base64'),
10114
+ * network_broker_channel_uuid: '550e8400-...',
10115
+ * prompt: 'Hello',
10116
+ * });
10117
+ * if (!result.validated) console.error(result.stderr ?? result.traceback);
10118
+ * ```
10119
+ */
10120
+ async validate(body) {
10121
+ return request({
10122
+ method: "POST",
10123
+ baseUrl: this.baseUrl,
10124
+ path: RED_TEAM_ADAPTER_VALIDATE_PATH,
10125
+ body,
10126
+ responseSchema: AdapterValidateResponseSchema,
10127
+ auth: this.auth,
10128
+ numRetries: this.numRetries
10129
+ });
10130
+ }
10131
+ };
10132
+
9556
10133
  // src/red-team/client.ts
9557
10134
  var RedTeamClient = class {
9558
10135
  /** Data plane scan operations. */
@@ -9571,6 +10148,8 @@ var RedTeamClient = class {
9571
10148
  instances;
9572
10149
  /** Network broker channel operations (distinct network broker base URL). */
9573
10150
  networkBroker;
10151
+ /** Management plane custom target adapter operations. */
10152
+ adapters;
9574
10153
  dataEndpoint;
9575
10154
  mgmtEndpoint;
9576
10155
  auth;
@@ -9609,6 +10188,7 @@ var RedTeamClient = class {
9609
10188
  });
9610
10189
  this.eula = new RedTeamEulaClient({ baseUrl: mgmtEndpoint, auth, numRetries });
9611
10190
  this.instances = new RedTeamInstancesClient({ baseUrl: mgmtEndpoint, auth, numRetries });
10191
+ this.adapters = new RedTeamAdaptersClient({ baseUrl: mgmtEndpoint, auth, numRetries });
9612
10192
  this.networkBroker = new RedTeamNetworkBrokerClient({
9613
10193
  baseUrl: networkBrokerEndpoint,
9614
10194
  auth,
@@ -10306,30 +10886,49 @@ var AIGatewayTelemetryClient = class {
10306
10886
  // src/ai-gateway/workspaces-client.ts
10307
10887
  var AIGatewayWorkspacesClient = class {
10308
10888
  baseUrl;
10889
+ adminBaseUrl;
10309
10890
  auth;
10310
10891
  numRetries;
10311
10892
  constructor(opts) {
10312
10893
  this.baseUrl = opts.baseUrl;
10894
+ this.adminBaseUrl = opts.adminBaseUrl;
10313
10895
  this.auth = opts.auth;
10314
10896
  this.numRetries = opts.numRetries;
10315
10897
  }
10898
+ urlFor(plane) {
10899
+ return plane === "admin" ? this.adminBaseUrl : this.baseUrl;
10900
+ }
10316
10901
  /**
10317
- * List workspaces visible to the caller.
10318
- * @returns All workspaces, each with the `scope_name` that grants data-plane access to it.
10902
+ * List workspaces.
10903
+ *
10904
+ * Two defaults worth knowing, because each one hides rows:
10905
+ *
10906
+ * 1. **Active only.** Without `status`, archived workspaces are omitted. Pass
10907
+ * `{ status: 'archived' }` to see them — that is where {@link AIGatewayWorkspacesClient.delete}
10908
+ * leaves a workspace.
10909
+ * 2. **Your scope only.** The data plane returns just the workspaces your service account holds a
10910
+ * workspace-scope grant on. Pass `{ plane: 'admin' }` to enumerate the whole tenant.
10911
+ *
10912
+ * @param options - Optional status filter and plane selection.
10913
+ * @returns Workspaces, each with the `scope_name` that grants data-plane access to it.
10319
10914
  * @example
10320
10915
  * ```ts
10321
10916
  * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
10322
10917
  * const gw = new AIGatewayClient();
10323
10918
  *
10324
- * const ws = await gw.workspaces.list();
10325
- * // ws.data[0] => { slug: 'ws-main-a-349e0e', scope_name: 'main_airs_workspace_1852583913', ... }
10919
+ * const mine = await gw.workspaces.list();
10920
+ * // mine.data[0] => { slug: 'ws-main-a-349e0e', scope_name: 'main_airs_workspace_1852583913', ... }
10921
+ *
10922
+ * const everything = await gw.workspaces.list({ plane: 'admin' });
10923
+ * const archived = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
10326
10924
  * ```
10327
10925
  */
10328
- async list() {
10926
+ async list(options = {}) {
10329
10927
  return request({
10330
10928
  method: "GET",
10331
- baseUrl: this.baseUrl,
10929
+ baseUrl: this.urlFor(options.plane),
10332
10930
  path: AI_GW_WORKSPACES_PATH,
10931
+ params: options.status ? { status: options.status } : void 0,
10333
10932
  responseSchema: ListWorkspacesResponseSchema,
10334
10933
  auth: this.auth,
10335
10934
  numRetries: this.numRetries
@@ -10337,7 +10936,16 @@ var AIGatewayWorkspacesClient = class {
10337
10936
  }
10338
10937
  /**
10339
10938
  * Fetch one workspace, including its security and rate-limit settings.
10340
- * @param workspaceId - Workspace UUID.
10939
+ *
10940
+ * @param workspaceRef - Workspace UUID **or** slug; the API accepts both.
10941
+ * @param options - Plane selection. A workspace outside your workspace scope answers `403 AB03`
10942
+ * on the data plane, not `404`; re-read it with `{ plane: 'admin' }`.
10943
+ *
10944
+ * **Archived workspaces are not retrievable here.** Once
10945
+ * {@link AIGatewayWorkspacesClient.delete} has archived a workspace, this returns `404 AB08`
10946
+ * for both its UUID and its slug, on either plane (verified live 2026-08-01) — even though the
10947
+ * row is still listed by `list({ status: 'archived' })`. Treat a 404 after a delete as expected,
10948
+ * and use the list filter to inspect archived workspaces.
10341
10949
  * @returns Workspace detail; list rows do not carry the settings blocks.
10342
10950
  * @example
10343
10951
  * ```ts
@@ -10346,19 +10954,133 @@ var AIGatewayWorkspacesClient = class {
10346
10954
  *
10347
10955
  * const ws = await gw.workspaces.get('16f7e90d-382a-4e78-b577-1b01eb5f8297');
10348
10956
  * // ws.security_settings?.membersViewLogs => true
10957
+ *
10958
+ * // Slugs work too, and the admin plane reaches workspaces you aren't scoped to:
10959
+ * const other = await gw.workspaces.get('ws-produc-985697', { plane: 'admin' });
10349
10960
  * ```
10350
10961
  */
10351
- async get(workspaceId) {
10352
- assertUuid(workspaceId, "workspaceId");
10962
+ async get(workspaceRef, options = {}) {
10963
+ assertWorkspaceRef(workspaceRef, "workspaceRef");
10353
10964
  return request({
10354
10965
  method: "GET",
10355
- baseUrl: this.baseUrl,
10356
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceId}`,
10966
+ baseUrl: this.urlFor(options.plane),
10967
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
10357
10968
  responseSchema: GatewayWorkspaceDetailSchema,
10358
10969
  auth: this.auth,
10359
10970
  numRetries: this.numRetries
10360
10971
  });
10361
10972
  }
10973
+ /**
10974
+ * Create a workspace. **Admin plane** — needs a tenant-root admin role.
10975
+ *
10976
+ * @param body - `name` and `scope_name` are both required; the API rejects a body missing either.
10977
+ * @returns The created workspace. Unlike `configs`/`guardrails`/`providers`/`deployments`,
10978
+ * which return short receipts, this returns most of the record — but not `status`,
10979
+ * `is_default`, `icon`, `usage_limits`, `rate_limits`, or the settings blocks. Call
10980
+ * {@link AIGatewayWorkspacesClient.get} when you need those.
10981
+ * @example
10982
+ * ```ts
10983
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
10984
+ * const gw = new AIGatewayClient();
10985
+ *
10986
+ * const created = await gw.workspaces.create({
10987
+ * name: 'Production',
10988
+ * scope_name: 'ws_production_bx7qw0', // the SCM scope, not derived from name
10989
+ * description: 'All production applications',
10990
+ * defaults: { metadata: { env: 'production' } },
10991
+ * rate_limits: [{ type: 'requests', unit: 'rpm', value: 100 }],
10992
+ * });
10993
+ * ```
10994
+ */
10995
+ async create(body) {
10996
+ if (!body.name) {
10997
+ throw new AISecSDKException("Missing name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
10998
+ }
10999
+ if (!body.scope_name) {
11000
+ throw new AISecSDKException("Missing scope_name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11001
+ }
11002
+ return request({
11003
+ method: "POST",
11004
+ baseUrl: this.adminBaseUrl,
11005
+ path: AI_GW_WORKSPACES_PATH,
11006
+ body,
11007
+ responseSchema: GatewayWorkspaceCreateResponseSchema,
11008
+ auth: this.auth,
11009
+ numRetries: this.numRetries
11010
+ });
11011
+ }
11012
+ /**
11013
+ * Update a workspace. **Admin plane.** Partial patch — send only the fields that change.
11014
+ *
11015
+ * @param workspaceRef - Workspace UUID or slug.
11016
+ * @param body - At least one field. An empty patch is rejected locally, mirroring the API's own
11017
+ * "No update fields provided" rejection, so a typo'd caller fails without a round trip.
11018
+ * @returns An **empty object** — the API acknowledges the write without echoing the record
11019
+ * (verified live 2026-08-01). The change does persist; re-read with
11020
+ * {@link AIGatewayWorkspacesClient.get} to see it.
11021
+ * @example
11022
+ * ```ts
11023
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
11024
+ * const gw = new AIGatewayClient();
11025
+ *
11026
+ * await gw.workspaces.update('ws-produc-985697', {
11027
+ * description: 'Production workloads, us-east',
11028
+ * });
11029
+ * ```
11030
+ */
11031
+ async update(workspaceRef, body) {
11032
+ assertWorkspaceRef(workspaceRef, "workspaceRef");
11033
+ if (Object.keys(body).length === 0) {
11034
+ throw new AISecSDKException(
11035
+ "Empty update: provide at least one of name, description, icon, defaults, usage_limits, rate_limits",
11036
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
11037
+ );
11038
+ }
11039
+ return request({
11040
+ method: "PUT",
11041
+ baseUrl: this.adminBaseUrl,
11042
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
11043
+ body,
11044
+ responseSchema: GatewayWriteResponseSchema,
11045
+ auth: this.auth,
11046
+ numRetries: this.numRetries
11047
+ });
11048
+ }
11049
+ /**
11050
+ * Delete a workspace. **Admin plane.**
11051
+ *
11052
+ * This is a **soft delete**: the workspace is archived, not destroyed. It vanishes from a default
11053
+ * {@link AIGatewayWorkspacesClient.list} but stays visible via `list({ status: 'archived' })`.
11054
+ * Note that `list` is the *only* way to see it afterwards —
11055
+ * {@link AIGatewayWorkspacesClient.get} answers `404 AB08` for an archived workspace.
11056
+ * Same semantics as `deployments.delete()`, and the opposite of `configs`/`guardrails`/`providers`,
11057
+ * which hard delete. There is no hard delete for workspaces.
11058
+ *
11059
+ * Takes no query parameters — unlike `integrations.delete()` and `deployments.delete()`, which
11060
+ * both require `organisation_id`.
11061
+ *
11062
+ * @param workspaceRef - Workspace UUID or slug.
11063
+ * @example
11064
+ * ```ts
11065
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
11066
+ * const gw = new AIGatewayClient();
11067
+ *
11068
+ * await gw.workspaces.delete('ws-produc-985697');
11069
+ *
11070
+ * // Still there, archived:
11071
+ * const gone = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
11072
+ * ```
11073
+ */
11074
+ async delete(workspaceRef) {
11075
+ assertWorkspaceRef(workspaceRef, "workspaceRef");
11076
+ return request({
11077
+ method: "DELETE",
11078
+ baseUrl: this.adminBaseUrl,
11079
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
11080
+ auth: this.auth,
11081
+ numRetries: this.numRetries
11082
+ });
11083
+ }
10362
11084
  };
10363
11085
 
10364
11086
  // src/ai-gateway/configs-client.ts
@@ -11680,7 +12402,7 @@ var AIGatewayClient = class {
11680
12402
  const dataOpts = { baseUrl: dataEndpoint, auth, numRetries };
11681
12403
  const adminOpts = { baseUrl: adminEndpoint, auth, numRetries };
11682
12404
  this.telemetry = new AIGatewayTelemetryClient({ ...dataOpts, tsgId });
11683
- this.workspaces = new AIGatewayWorkspacesClient(dataOpts);
12405
+ this.workspaces = new AIGatewayWorkspacesClient({ ...dataOpts, adminBaseUrl: adminEndpoint });
11684
12406
  this.configs = new AIGatewayConfigsClient(dataOpts);
11685
12407
  this.guardrails = new AIGatewayGuardrailsClient(dataOpts);
11686
12408
  this.providers = new AIGatewayProvidersClient(dataOpts);
@@ -11734,6 +12456,16 @@ export {
11734
12456
  AI_SEC_API_TOKEN,
11735
12457
  ASYNC_SCAN_PATH,
11736
12458
  Action,
12459
+ AdapterCreateRequestSchema,
12460
+ AdapterListItemSchema,
12461
+ AdapterListSchema,
12462
+ AdapterResponseSchema,
12463
+ AdapterUpdateRequestSchema,
12464
+ AdapterValidateRequestSchema,
12465
+ AdapterValidateResponseSchema,
12466
+ AdapterVarResponseSchema,
12467
+ AdapterVarSchema,
12468
+ AdapterVarTypeSchema,
11737
12469
  AdvancedDataProfileRequestSchema,
11738
12470
  AgentEntrySchema,
11739
12471
  AgentMetaSchema,
@@ -11974,6 +12706,9 @@ export {
11974
12706
  GatewayPluginSchema,
11975
12707
  GatewayProviderCreateResponseSchema,
11976
12708
  GatewayProviderSchema,
12709
+ GatewayRateLimitSchema,
12710
+ GatewayUsageLimitSchema,
12711
+ GatewayWorkspaceCreateResponseSchema,
11977
12712
  GatewayWorkspaceDetailSchema,
11978
12713
  GatewayWorkspaceSchema,
11979
12714
  GatewayWriteResponseSchema,
@@ -12146,6 +12881,8 @@ export {
12146
12881
  PyPIAuthResponseSchema,
12147
12882
  QuotaDetailsSchema,
12148
12883
  QuotaSummarySchema,
12884
+ RED_TEAM_ADAPTER_PATH,
12885
+ RED_TEAM_ADAPTER_VALIDATE_PATH,
12149
12886
  RED_TEAM_CATEGORIES_PATH,
12150
12887
  RED_TEAM_CHANNELS_PATH,
12151
12888
  RED_TEAM_CHANNELS_STATS_PATH,
@@ -12175,6 +12912,7 @@ export {
12175
12912
  RED_TEAM_TEMPLATE_PATH,
12176
12913
  RED_TEAM_TOKEN_ENDPOINT,
12177
12914
  RED_TEAM_TSG_ID,
12915
+ RedTeamAdaptersClient,
12178
12916
  RedTeamCategory,
12179
12917
  RedTeamClient,
12180
12918
  RedTeamCustomAttackReportsClient,
@@ -12318,9 +13056,14 @@ export {
12318
13056
  WebSocketConnectionParamsSchema,
12319
13057
  WeightedRegexSchema,
12320
13058
  aiGwOrganisationsAuthSettingsPath,
13059
+ collectAll,
13060
+ collectSkipPages,
13061
+ collectSpringPages,
12321
13062
  globalConfiguration,
12322
13063
  init,
12323
13064
  jsonNullable,
12324
- pageSchema
13065
+ pageSchema,
13066
+ paginate,
13067
+ serializeListing
12325
13068
  };
12326
13069
  //# sourceMappingURL=index.js.map