@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.cjs CHANGED
@@ -60,6 +60,16 @@ __export(index_exports, {
60
60
  AI_SEC_API_TOKEN: () => AI_SEC_API_TOKEN,
61
61
  ASYNC_SCAN_PATH: () => ASYNC_SCAN_PATH,
62
62
  Action: () => Action,
63
+ AdapterCreateRequestSchema: () => AdapterCreateRequestSchema,
64
+ AdapterListItemSchema: () => AdapterListItemSchema,
65
+ AdapterListSchema: () => AdapterListSchema,
66
+ AdapterResponseSchema: () => AdapterResponseSchema,
67
+ AdapterUpdateRequestSchema: () => AdapterUpdateRequestSchema,
68
+ AdapterValidateRequestSchema: () => AdapterValidateRequestSchema,
69
+ AdapterValidateResponseSchema: () => AdapterValidateResponseSchema,
70
+ AdapterVarResponseSchema: () => AdapterVarResponseSchema,
71
+ AdapterVarSchema: () => AdapterVarSchema,
72
+ AdapterVarTypeSchema: () => AdapterVarTypeSchema,
63
73
  AdvancedDataProfileRequestSchema: () => AdvancedDataProfileRequestSchema,
64
74
  AgentEntrySchema: () => AgentEntrySchema,
65
75
  AgentMetaSchema: () => AgentMetaSchema,
@@ -300,6 +310,9 @@ __export(index_exports, {
300
310
  GatewayPluginSchema: () => GatewayPluginSchema,
301
311
  GatewayProviderCreateResponseSchema: () => GatewayProviderCreateResponseSchema,
302
312
  GatewayProviderSchema: () => GatewayProviderSchema,
313
+ GatewayRateLimitSchema: () => GatewayRateLimitSchema,
314
+ GatewayUsageLimitSchema: () => GatewayUsageLimitSchema,
315
+ GatewayWorkspaceCreateResponseSchema: () => GatewayWorkspaceCreateResponseSchema,
303
316
  GatewayWorkspaceDetailSchema: () => GatewayWorkspaceDetailSchema,
304
317
  GatewayWorkspaceSchema: () => GatewayWorkspaceSchema,
305
318
  GatewayWriteResponseSchema: () => GatewayWriteResponseSchema,
@@ -472,6 +485,8 @@ __export(index_exports, {
472
485
  PyPIAuthResponseSchema: () => PyPIAuthResponseSchema,
473
486
  QuotaDetailsSchema: () => QuotaDetailsSchema,
474
487
  QuotaSummarySchema: () => QuotaSummarySchema,
488
+ RED_TEAM_ADAPTER_PATH: () => RED_TEAM_ADAPTER_PATH,
489
+ RED_TEAM_ADAPTER_VALIDATE_PATH: () => RED_TEAM_ADAPTER_VALIDATE_PATH,
475
490
  RED_TEAM_CATEGORIES_PATH: () => RED_TEAM_CATEGORIES_PATH,
476
491
  RED_TEAM_CHANNELS_PATH: () => RED_TEAM_CHANNELS_PATH,
477
492
  RED_TEAM_CHANNELS_STATS_PATH: () => RED_TEAM_CHANNELS_STATS_PATH,
@@ -501,6 +516,7 @@ __export(index_exports, {
501
516
  RED_TEAM_TEMPLATE_PATH: () => RED_TEAM_TEMPLATE_PATH,
502
517
  RED_TEAM_TOKEN_ENDPOINT: () => RED_TEAM_TOKEN_ENDPOINT,
503
518
  RED_TEAM_TSG_ID: () => RED_TEAM_TSG_ID,
519
+ RedTeamAdaptersClient: () => RedTeamAdaptersClient,
504
520
  RedTeamCategory: () => RedTeamCategory,
505
521
  RedTeamClient: () => RedTeamClient,
506
522
  RedTeamCustomAttackReportsClient: () => RedTeamCustomAttackReportsClient,
@@ -644,10 +660,15 @@ __export(index_exports, {
644
660
  WebSocketConnectionParamsSchema: () => WebSocketConnectionParamsSchema,
645
661
  WeightedRegexSchema: () => WeightedRegexSchema,
646
662
  aiGwOrganisationsAuthSettingsPath: () => aiGwOrganisationsAuthSettingsPath,
663
+ collectAll: () => collectAll,
664
+ collectSkipPages: () => collectSkipPages,
665
+ collectSpringPages: () => collectSpringPages,
647
666
  globalConfiguration: () => globalConfiguration,
648
667
  init: () => init,
649
668
  jsonNullable: () => jsonNullable,
650
- pageSchema: () => pageSchema
669
+ pageSchema: () => pageSchema,
670
+ paginate: () => paginate,
671
+ serializeListing: () => serializeListing
651
672
  });
652
673
  module.exports = __toCommonJS(index_exports);
653
674
 
@@ -682,7 +703,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
682
703
  var MAX_CONNECTION_POOL_SIZE = 100;
683
704
  var MAX_NUMBER_OF_RETRIES = 5;
684
705
  var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
685
- var SDK_VERSION = "0.14.1";
706
+ var SDK_VERSION = "0.17.0";
686
707
  var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
687
708
  var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
688
709
  var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
@@ -757,6 +778,8 @@ var RED_TEAM_LANGUAGES_PATH = "/v1/languages";
757
778
  var RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH = "/v1/error-log/target-profile";
758
779
  var RED_TEAM_TARGET_PATH = "/v1/target";
759
780
  var RED_TEAM_TARGET_VALIDATE_AUTH_PATH = "/v1/target/validate-auth";
781
+ var RED_TEAM_ADAPTER_PATH = "/v1/adapters";
782
+ var RED_TEAM_ADAPTER_VALIDATE_PATH = "/v1/adapters/validate";
760
783
  var RED_TEAM_TEMPLATE_PATH = "/v1/template";
761
784
  var RED_TEAM_EULA_PATH = "/v1/eula";
762
785
  var RED_TEAM_INSTANCES_PATH = "/v1/instances";
@@ -2012,6 +2035,60 @@ var Content = class _Content {
2012
2035
  }
2013
2036
  };
2014
2037
 
2038
+ // src/listing.ts
2039
+ async function* paginate(fetchPage, initialCursor) {
2040
+ let cursor = initialCursor;
2041
+ const seen = /* @__PURE__ */ new Set();
2042
+ while (true) {
2043
+ if (seen.has(cursor)) throw new Error("Pagination returned a repeated cursor");
2044
+ seen.add(cursor);
2045
+ const page = await fetchPage(cursor);
2046
+ yield* page.items;
2047
+ if (page.next === void 0) return;
2048
+ cursor = page.next;
2049
+ }
2050
+ }
2051
+ async function collectAll(iterable, opts = {}) {
2052
+ const max = opts.max ?? 1e4;
2053
+ if (!Number.isSafeInteger(max) || max < 0)
2054
+ throw new RangeError("max must be a non-negative integer");
2055
+ const items = [];
2056
+ for await (const item of iterable) {
2057
+ if (max > 0 && items.length >= max) break;
2058
+ items.push(item);
2059
+ }
2060
+ return items;
2061
+ }
2062
+ function collectSkipPages(fetchPage, opts = {}) {
2063
+ const limit = opts.limit ?? 50;
2064
+ return collectAll(
2065
+ paginate(async (skip) => {
2066
+ const page = await fetchPage(skip, limit);
2067
+ const next = skip + page.items.length;
2068
+ const hasMore = page.items.length > 0 && (page.total == null ? page.items.length === limit : next < page.total);
2069
+ return { items: page.items, next: hasMore ? next : void 0 };
2070
+ }, 0),
2071
+ { max: opts.max }
2072
+ );
2073
+ }
2074
+ function collectSpringPages(fetchPage, opts = {}) {
2075
+ const size = opts.size ?? 50;
2076
+ return collectAll(
2077
+ paginate(async (page) => {
2078
+ const result = await fetchPage(page, size);
2079
+ return { items: result.items, next: result.last ? void 0 : page + 1 };
2080
+ }, 0),
2081
+ { max: opts.max }
2082
+ );
2083
+ }
2084
+ function serializeListing(opts) {
2085
+ const params = {};
2086
+ if (opts?.skip !== void 0) params.skip = String(opts.skip);
2087
+ if (opts?.limit !== void 0) params.limit = String(opts.limit);
2088
+ if (opts?.search !== void 0) params.search = opts.search;
2089
+ return params;
2090
+ }
2091
+
2015
2092
  // src/models/enums.ts
2016
2093
  var Verdict = {
2017
2094
  BENIGN: "benign",
@@ -4272,6 +4349,76 @@ var TenantLanguagesResponseSchema = import_zod33.z.object({
4272
4349
  supported_job_types: import_zod33.z.array(import_zod33.z.string()),
4273
4350
  languages: import_zod33.z.array(LanguageOptionSchema)
4274
4351
  }).passthrough();
4352
+ var AdapterVarTypeSchema = import_zod33.z.enum(["VAR", "SECRET"]);
4353
+ var AdapterVarSchema = import_zod33.z.object({
4354
+ key: import_zod33.z.string().max(255),
4355
+ value: import_zod33.z.string().nullable().optional(),
4356
+ type: AdapterVarTypeSchema
4357
+ });
4358
+ var AdapterVarResponseSchema = AdapterVarSchema.extend({
4359
+ is_redacted: import_zod33.z.boolean().optional()
4360
+ }).passthrough();
4361
+ var AdapterCreateRequestSchema = import_zod33.z.object({
4362
+ name: import_zod33.z.string().max(255),
4363
+ description: import_zod33.z.string().nullable().optional(),
4364
+ script_b64: import_zod33.z.string(),
4365
+ /** Optional while the adapter is a DRAFT; required to activate (`validate: true`). */
4366
+ network_broker_channel_uuid: import_zod33.z.string().uuid().nullable().optional(),
4367
+ variables: import_zod33.z.array(AdapterVarSchema).optional(),
4368
+ /** Sample prompt used to exercise the adapter end-to-end during validation. Not stored. */
4369
+ prompt: import_zod33.z.string()
4370
+ }).strict();
4371
+ var AdapterUpdateRequestSchema = import_zod33.z.object({
4372
+ name: import_zod33.z.string().max(255),
4373
+ description: import_zod33.z.string().nullable().optional(),
4374
+ script_b64: import_zod33.z.string(),
4375
+ network_broker_channel_uuid: import_zod33.z.string().uuid().nullable().optional(),
4376
+ variables: import_zod33.z.array(AdapterVarSchema).optional(),
4377
+ prompt: import_zod33.z.string()
4378
+ }).strict();
4379
+ var AdapterResponseSchema = import_zod33.z.object({
4380
+ uuid: import_zod33.z.string().uuid(),
4381
+ tsg_id: import_zod33.z.string(),
4382
+ name: import_zod33.z.string(),
4383
+ script_b64: import_zod33.z.string(),
4384
+ status: import_zod33.z.string(),
4385
+ description: import_zod33.z.string().nullable().optional(),
4386
+ network_broker_channel_uuid: import_zod33.z.string().uuid().nullable().optional(),
4387
+ variables: import_zod33.z.array(AdapterVarResponseSchema).optional(),
4388
+ /** Number of targets currently referencing this adapter. */
4389
+ target_count: import_zod33.z.number().int().optional(),
4390
+ created_at: import_zod33.z.string().nullable().optional(),
4391
+ updated_at: import_zod33.z.string().nullable().optional(),
4392
+ created_by_user_id: import_zod33.z.string().uuid().nullable().optional(),
4393
+ updated_by_user_id: import_zod33.z.string().uuid().nullable().optional()
4394
+ }).passthrough();
4395
+ var AdapterListItemSchema = import_zod33.z.object({
4396
+ uuid: import_zod33.z.string().uuid(),
4397
+ name: import_zod33.z.string(),
4398
+ status: import_zod33.z.string(),
4399
+ created_at: import_zod33.z.string(),
4400
+ updated_at: import_zod33.z.string(),
4401
+ created_by_user_id: import_zod33.z.string().uuid().nullable().optional(),
4402
+ target_count: import_zod33.z.number().int().nullable().optional()
4403
+ }).passthrough();
4404
+ var AdapterListSchema = import_zod33.z.object({
4405
+ pagination: RedTeamPaginationSchema,
4406
+ data: import_zod33.z.array(AdapterListItemSchema).optional()
4407
+ }).passthrough();
4408
+ var AdapterValidateRequestSchema = import_zod33.z.object({
4409
+ script_b64: import_zod33.z.string(),
4410
+ network_broker_channel_uuid: import_zod33.z.string().uuid(),
4411
+ prompt: import_zod33.z.string(),
4412
+ variables: import_zod33.z.array(AdapterVarSchema).optional(),
4413
+ /** Omit when validating a brand-new adapter. */
4414
+ adapter_uuid: import_zod33.z.string().uuid().nullable().optional()
4415
+ }).strict();
4416
+ var AdapterValidateResponseSchema = import_zod33.z.object({
4417
+ validated: import_zod33.z.boolean(),
4418
+ stdout: import_zod33.z.string().nullable().optional(),
4419
+ stderr: import_zod33.z.string().nullable().optional(),
4420
+ traceback: import_zod33.z.string().nullable().optional()
4421
+ }).passthrough();
4275
4422
  var TargetRequestBaseFields = {
4276
4423
  name: import_zod33.z.string(),
4277
4424
  description: import_zod33.z.string().nullable().optional(),
@@ -4285,7 +4432,11 @@ var TargetRequestBaseFields = {
4285
4432
  target_background: TargetBackgroundSchema.nullable().optional(),
4286
4433
  additional_context: TargetAdditionalContextSchema.nullable().optional(),
4287
4434
  extra_info: import_zod33.z.record(import_zod33.z.unknown()).nullable().optional(),
4288
- network_broker_channel_uuid: import_zod33.z.string().nullable().optional()
4435
+ network_broker_channel_uuid: import_zod33.z.string().nullable().optional(),
4436
+ /** UUID of the custom target adapter to use. Required when connection_type is CUSTOM_TARGET_ADAPTER. */
4437
+ adapter_uuid: import_zod33.z.string().uuid().nullable().optional(),
4438
+ /** Per-target overrides for the adapter's variables. Array of AdapterVar objects. */
4439
+ adapter_variable_overrides: import_zod33.z.array(AdapterVarSchema).nullable().optional()
4289
4440
  };
4290
4441
  var TargetCreateRequestSchema = import_zod33.z.object(TargetRequestBaseFields).strict();
4291
4442
  var TargetUpdateRequestSchema = import_zod33.z.object(TargetRequestBaseFields).strict();
@@ -4677,6 +4828,20 @@ var aiGatewayList = (item) => import_zod35.z.object({
4677
4828
  has_more: import_zod35.z.boolean().optional(),
4678
4829
  data: import_zod35.z.array(item)
4679
4830
  }).passthrough();
4831
+ var GatewayUsageLimitSchema = import_zod35.z.object({
4832
+ credit_limit: import_zod35.z.number().optional(),
4833
+ type: import_zod35.z.string().optional(),
4834
+ alert_threshold: import_zod35.z.number().optional(),
4835
+ periodic_reset: import_zod35.z.string().nullable().optional(),
4836
+ periodic_reset_days: import_zod35.z.number().nullable().optional(),
4837
+ next_usage_reset_at: import_zod35.z.string().nullable().optional()
4838
+ }).passthrough();
4839
+ var GatewayRateLimitSchema = import_zod35.z.object({
4840
+ type: import_zod35.z.string().optional(),
4841
+ unit: import_zod35.z.string().optional(),
4842
+ value: import_zod35.z.number().optional()
4843
+ }).passthrough();
4844
+ var limitsField = (policy) => import_zod35.z.union([import_zod35.z.array(policy), import_zod35.z.record(import_zod35.z.unknown())]).nullable();
4680
4845
  var aiGatewayGroupList = (item) => import_zod35.z.object({
4681
4846
  object: import_zod35.z.string(),
4682
4847
  is_quota_exceeded: import_zod35.z.boolean(),
@@ -4883,7 +5048,9 @@ var GatewayWorkspaceSchema = import_zod35.z.object({
4883
5048
  slug: import_zod35.z.string(),
4884
5049
  name: import_zod35.z.string(),
4885
5050
  icon: import_zod35.z.string().nullable(),
4886
- description: import_zod35.z.string(),
5051
+ // Nullable: a workspace created without one returns null, and upstream declares it
5052
+ // `nullable: true`. Observed on an archived workspace (#213).
5053
+ description: import_zod35.z.string().nullable(),
4887
5054
  created_at: import_zod35.z.string(),
4888
5055
  last_updated_at: import_zod35.z.string(),
4889
5056
  is_default: import_zod35.z.number(),
@@ -4894,18 +5061,38 @@ var GatewayWorkspaceSchema = import_zod35.z.object({
4894
5061
  var GatewayWorkspaceDetailSchema = import_zod35.z.object({
4895
5062
  id: import_zod35.z.string(),
4896
5063
  name: import_zod35.z.string(),
4897
- description: import_zod35.z.string(),
5064
+ /** Nullable — see `GatewayWorkspaceSchema.description`. */
5065
+ description: import_zod35.z.string().nullable(),
4898
5066
  created_at: import_zod35.z.string(),
4899
5067
  last_updated_at: import_zod35.z.string(),
4900
5068
  is_default: import_zod35.z.number(),
4901
5069
  slug: import_zod35.z.string(),
4902
5070
  icon: import_zod35.z.string().nullable(),
4903
5071
  defaults: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
4904
- usage_limits: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
4905
- rate_limits: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5072
+ usage_limits: limitsField(GatewayUsageLimitSchema),
5073
+ rate_limits: limitsField(GatewayRateLimitSchema),
4906
5074
  security_settings: import_zod35.z.record(import_zod35.z.boolean()).optional(),
4907
5075
  data_plane_security_settings: import_zod35.z.record(import_zod35.z.unknown()).optional(),
4908
- settings: import_zod35.z.record(import_zod35.z.unknown()).optional()
5076
+ settings: import_zod35.z.record(import_zod35.z.unknown()).optional(),
5077
+ /**
5078
+ * Lifecycle state. **Diverges from the list row**: `list()` reports `'active'` for a
5079
+ * workspace whose `get()` reports `null` (observed live 2026-08-01). Prefer the list value,
5080
+ * or treat a `null` here as "unknown", not as "inactive".
5081
+ */
5082
+ status: import_zod35.z.string().nullable().optional()
5083
+ }).passthrough();
5084
+ var GatewayWorkspaceCreateResponseSchema = import_zod35.z.object({
5085
+ id: import_zod35.z.string(),
5086
+ name: import_zod35.z.string(),
5087
+ slug: import_zod35.z.string(),
5088
+ description: import_zod35.z.string().nullable(),
5089
+ created_at: import_zod35.z.string(),
5090
+ last_updated_at: import_zod35.z.string(),
5091
+ scope_name: import_zod35.z.string(),
5092
+ object: import_zod35.z.string(),
5093
+ defaults: import_zod35.z.record(import_zod35.z.unknown()).nullable().optional(),
5094
+ /** Seeded workspace members. Present on create only. */
5095
+ users: import_zod35.z.array(import_zod35.z.unknown()).optional()
4909
5096
  }).passthrough();
4910
5097
  var ListWorkspacesResponseSchema = aiGatewayList(GatewayWorkspaceSchema);
4911
5098
  var GatewayConfigSchema = import_zod35.z.object({
@@ -5021,8 +5208,8 @@ var GatewayIntegrationModelsResponseSchema = import_zod35.z.object({
5021
5208
  }).passthrough();
5022
5209
  var GatewayIntegrationWorkspaceSchema = import_zod35.z.object({
5023
5210
  id: import_zod35.z.string(),
5024
- usage_limits: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5025
- rate_limits: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5211
+ usage_limits: limitsField(GatewayUsageLimitSchema),
5212
+ rate_limits: limitsField(GatewayRateLimitSchema),
5026
5213
  enabled: import_zod35.z.boolean(),
5027
5214
  status: import_zod35.z.string(),
5028
5215
  created_at: import_zod35.z.string(),
@@ -5031,8 +5218,8 @@ var GatewayIntegrationWorkspaceSchema = import_zod35.z.object({
5031
5218
  }).passthrough();
5032
5219
  var GatewayGlobalWorkspaceAccessSchema = import_zod35.z.object({
5033
5220
  enabled: import_zod35.z.boolean(),
5034
- rate_limits: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5035
- usage_limits: import_zod35.z.record(import_zod35.z.unknown()).nullable()
5221
+ rate_limits: limitsField(GatewayRateLimitSchema),
5222
+ usage_limits: limitsField(GatewayUsageLimitSchema)
5036
5223
  }).passthrough();
5037
5224
  var GatewayIntegrationWorkspacesResponseSchema = import_zod35.z.object({
5038
5225
  workspaces: import_zod35.z.array(GatewayIntegrationWorkspaceSchema),
@@ -5384,6 +5571,14 @@ function assertUuid(value, fieldName) {
5384
5571
  );
5385
5572
  }
5386
5573
  }
5574
+ function assertWorkspaceRef(value, fieldName) {
5575
+ if (!isValidUuid(value) && !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) {
5576
+ throw new AISecSDKException(
5577
+ `Invalid ${fieldName}: ${value} (expected a workspace UUID or slug)`,
5578
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5579
+ );
5580
+ }
5581
+ }
5387
5582
  function assertNumericId(value, fieldName) {
5388
5583
  if (!/^\d+$/.test(value)) {
5389
5584
  throw new AISecSDKException(
@@ -5455,6 +5650,7 @@ var ProfilesClient = class {
5455
5650
  offset: String(opts?.offset ?? 0),
5456
5651
  limit: String(opts?.limit ?? 100)
5457
5652
  };
5653
+ if (opts?.latest !== void 0) params.latest = String(opts.latest);
5458
5654
  return request({
5459
5655
  method: "GET",
5460
5656
  baseUrl: this.baseUrl,
@@ -5465,6 +5661,23 @@ var ProfilesClient = class {
5465
5661
  numRetries: this.numRetries
5466
5662
  });
5467
5663
  }
5664
+ /**
5665
+ * List security profiles across every response page.
5666
+ * @example
5667
+ * ```ts
5668
+ * const profiles = await mgmt.profiles.listAll({ latest: true });
5669
+ * ```
5670
+ */
5671
+ async listAll(opts = {}) {
5672
+ const limit = opts.limit ?? 100;
5673
+ return collectAll(
5674
+ paginate(async (offset) => {
5675
+ const page = await this.list({ offset, limit, latest: opts.latest });
5676
+ return { items: page.ai_profiles, next: page.next_offset || void 0 };
5677
+ }, 0),
5678
+ { max: opts.max }
5679
+ );
5680
+ }
5468
5681
  /**
5469
5682
  * Get a security profile by UUID.
5470
5683
  * Fetches all profiles and filters — no dedicated API endpoint exists.
@@ -5482,7 +5695,7 @@ var ProfilesClient = class {
5482
5695
  * ```
5483
5696
  */
5484
5697
  async get(profileId) {
5485
- const { ai_profiles } = await this.list();
5698
+ const ai_profiles = await this.listAll();
5486
5699
  const profile = ai_profiles.find((p) => p.profile_id === profileId);
5487
5700
  if (!profile) {
5488
5701
  throw new AISecSDKException(
@@ -5508,7 +5721,7 @@ var ProfilesClient = class {
5508
5721
  * ```
5509
5722
  */
5510
5723
  async getByName(profileName) {
5511
- const { ai_profiles } = await this.list();
5724
+ const ai_profiles = await this.listAll();
5512
5725
  const matches = ai_profiles.filter((p) => p.profile_name === profileName);
5513
5726
  if (matches.length === 0) {
5514
5727
  throw new AISecSDKException(
@@ -5663,6 +5876,22 @@ var TopicsClient = class {
5663
5876
  * ```
5664
5877
  */
5665
5878
  async list(opts) {
5879
+ if (opts?.latestOnly) {
5880
+ const all = await this.listAll({ limit: 200 });
5881
+ const latest = /* @__PURE__ */ new Map();
5882
+ for (const topic of all) {
5883
+ const current = latest.get(topic.topic_name);
5884
+ if (!current || topic.revision > current.revision) latest.set(topic.topic_name, topic);
5885
+ }
5886
+ const custom_topics = [...latest.values()];
5887
+ const offset = opts.offset ?? 0;
5888
+ const limit = opts.limit ?? 100;
5889
+ const nextOffset = offset + limit;
5890
+ return {
5891
+ custom_topics: custom_topics.slice(offset, nextOffset),
5892
+ next_offset: nextOffset < custom_topics.length ? nextOffset : void 0
5893
+ };
5894
+ }
5666
5895
  const params = {
5667
5896
  offset: String(opts?.offset ?? 0),
5668
5897
  limit: String(opts?.limit ?? 100)
@@ -5677,6 +5906,55 @@ var TopicsClient = class {
5677
5906
  numRetries: this.numRetries
5678
5907
  });
5679
5908
  }
5909
+ /**
5910
+ * List custom topics across every response page.
5911
+ * @example
5912
+ * ```ts
5913
+ * const topics = await mgmt.topics.listAll({ limit: 200 });
5914
+ * ```
5915
+ */
5916
+ async listAll(opts = {}) {
5917
+ const limit = opts.limit ?? 100;
5918
+ return collectAll(
5919
+ paginate(async (offset) => {
5920
+ const page = await this.list({ offset, limit });
5921
+ return { items: page.custom_topics, next: page.next_offset || void 0 };
5922
+ }, 0),
5923
+ { max: opts.max }
5924
+ );
5925
+ }
5926
+ /**
5927
+ * Get an exact custom-topic revision by UUID.
5928
+ * @example
5929
+ * ```ts
5930
+ * const topic = await mgmt.topics.get('550e8400-e29b-41d4-a716-446655440000');
5931
+ * ```
5932
+ */
5933
+ async get(topicId) {
5934
+ const topic = (await this.listAll()).find((item) => item.topic_id === topicId);
5935
+ if (!topic)
5936
+ throw new AISecSDKException(
5937
+ `Topic not found: ${topicId}`,
5938
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5939
+ );
5940
+ return topic;
5941
+ }
5942
+ /**
5943
+ * Get the highest revision of a custom topic by name.
5944
+ * @example
5945
+ * ```ts
5946
+ * const topic = await mgmt.topics.getByName('credit-cards');
5947
+ * ```
5948
+ */
5949
+ async getByName(topicName) {
5950
+ const matches = (await this.listAll()).filter((item) => item.topic_name === topicName);
5951
+ if (matches.length === 0)
5952
+ throw new AISecSDKException(
5953
+ `Topic not found: ${topicName}`,
5954
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5955
+ );
5956
+ return matches.reduce((best, topic) => topic.revision > best.revision ? topic : best);
5957
+ }
5680
5958
  /**
5681
5959
  * Update an existing custom topic.
5682
5960
  * @param topicId - UUID of the topic to update.
@@ -5840,6 +6118,17 @@ var ApiKeysClient = class {
5840
6118
  numRetries: this.numRetries
5841
6119
  });
5842
6120
  }
6121
+ /** List all API keys. @example `const keys = await mgmt.apiKeys.listAll();` */
6122
+ async listAll(opts = {}) {
6123
+ const limit = opts.limit ?? 100;
6124
+ return collectAll(
6125
+ paginate(async (offset) => {
6126
+ const page = await this.list({ offset, limit });
6127
+ return { items: page.api_keys ?? [], next: page.next_offset || void 0 };
6128
+ }, 0),
6129
+ { max: opts.max }
6130
+ );
6131
+ }
5843
6132
  /**
5844
6133
  * Delete an API key by name.
5845
6134
  * @param apiKeyName - Name of the API key to delete.
@@ -5964,6 +6253,17 @@ var CustomerAppsClient = class {
5964
6253
  numRetries: this.numRetries
5965
6254
  });
5966
6255
  }
6256
+ /** List all customer applications. @example `const apps = await mgmt.customerApps.listAll();` */
6257
+ async listAll(opts = {}) {
6258
+ const limit = opts.limit ?? 100;
6259
+ return collectAll(
6260
+ paginate(async (offset) => {
6261
+ const page = await this.list({ offset, limit });
6262
+ return { items: page.customer_apps ?? [], next: page.next_offset || void 0 };
6263
+ }, 0),
6264
+ { max: opts.max }
6265
+ );
6266
+ }
5967
6267
  /**
5968
6268
  * Update a customer app.
5969
6269
  * @param customerAppId - UUID of the customer app to update.
@@ -6411,6 +6711,17 @@ var DataFilteringProfilesClient = class {
6411
6711
  numRetries: this.numRetries
6412
6712
  });
6413
6713
  }
6714
+ /** List all filtering profiles. @example `const profiles = await mgmt.dlp.dataFilteringProfiles.listAll();` */
6715
+ async listAll(params = {}) {
6716
+ return collectSpringPages(
6717
+ async (page, size) => {
6718
+ const result = await this.list({ ...params, page, size });
6719
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
6720
+ return { items: result.content, last };
6721
+ },
6722
+ { size: params.size, max: params.max }
6723
+ );
6724
+ }
6414
6725
  /**
6415
6726
  * Get a single data filtering profile by resource ID.
6416
6727
  * @example
@@ -6504,6 +6815,17 @@ var DataPatternsClient = class {
6504
6815
  numRetries: this.numRetries
6505
6816
  });
6506
6817
  }
6818
+ /** List all data patterns. @example `const patterns = await mgmt.dlp.dataPatterns.listAll();` */
6819
+ async listAll(params = {}) {
6820
+ return collectSpringPages(
6821
+ async (page, size) => {
6822
+ const result = await this.list({ ...params, page, size });
6823
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
6824
+ return { items: result.content, last };
6825
+ },
6826
+ { size: params.size, max: params.max }
6827
+ );
6828
+ }
6507
6829
  /**
6508
6830
  * Create a new custom data pattern.
6509
6831
  * @example
@@ -6677,6 +6999,17 @@ var DataProfilesClient = class {
6677
6999
  numRetries: this.numRetries
6678
7000
  });
6679
7001
  }
7002
+ /** List all data profiles. @example `const profiles = await mgmt.dlp.dataProfiles.listAll();` */
7003
+ async listAll(params = {}) {
7004
+ return collectSpringPages(
7005
+ async (page, size) => {
7006
+ const result = await this.list({ ...params, page, size });
7007
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
7008
+ return { items: result.content, last };
7009
+ },
7010
+ { size: params.size, max: params.max }
7011
+ );
7012
+ }
6680
7013
  /**
6681
7014
  * Create a new data profile.
6682
7015
  * @example
@@ -6857,6 +7190,17 @@ var DictionariesClient = class {
6857
7190
  numRetries: this.numRetries
6858
7191
  });
6859
7192
  }
7193
+ /** List all dictionaries. @example `const dictionaries = await mgmt.dlp.dictionaries.listAll();` */
7194
+ async listAll(params = {}) {
7195
+ return collectSpringPages(
7196
+ async (page, size) => {
7197
+ const result = await this.list({ ...params, page, size });
7198
+ const last = result.last ?? (result.totalPages !== void 0 ? page + 1 >= result.totalPages : result.content.length < size);
7199
+ return { items: result.content, last };
7200
+ },
7201
+ { size: params.size, max: params.max }
7202
+ );
7203
+ }
6860
7204
  /**
6861
7205
  * Create a dictionary by uploading a keyword file. Sends a multipart body — the SDK does
6862
7206
  * not set Content-Type so the runtime can write the correct boundary.
@@ -7089,15 +7433,6 @@ var ManagementClient = class {
7089
7433
  }
7090
7434
  };
7091
7435
 
7092
- // src/listing.ts
7093
- function serializeListing(opts) {
7094
- const params = {};
7095
- if (opts?.skip !== void 0) params.skip = String(opts.skip);
7096
- if (opts?.limit !== void 0) params.limit = String(opts.limit);
7097
- if (opts?.search !== void 0) params.search = opts.search;
7098
- return params;
7099
- }
7100
-
7101
7436
  // src/model-security/scans-client.ts
7102
7437
  function buildScanListParams(opts) {
7103
7438
  const params = serializeListing(opts);
@@ -7193,6 +7528,13 @@ var ModelSecurityScansClient = class {
7193
7528
  numRetries: this.numRetries
7194
7529
  });
7195
7530
  }
7531
+ /** List every model-security scan page. @example `const scans = await ms.scans.listAll();` */
7532
+ async listAll(opts = {}) {
7533
+ return collectSkipPages(async (skip, limit) => {
7534
+ const page = await this.list({ ...opts, skip, limit });
7535
+ return { items: page.scans, total: page.pagination.total_items };
7536
+ }, opts);
7537
+ }
7196
7538
  /**
7197
7539
  * Get a single scan by UUID.
7198
7540
  * @param uuid - Scan UUID.
@@ -7571,6 +7913,13 @@ var ModelSecurityGroupsClient = class {
7571
7913
  numRetries: this.numRetries
7572
7914
  });
7573
7915
  }
7916
+ /** List every security-group page. @example `const groups = await ms.securityGroups.listAll();` */
7917
+ async listAll(opts = {}) {
7918
+ return collectSkipPages(async (skip, limit) => {
7919
+ const page = await this.list({ ...opts, skip, limit });
7920
+ return { items: page.security_groups, total: page.pagination.total_items };
7921
+ }, opts);
7922
+ }
7574
7923
  /**
7575
7924
  * Get a single security group by UUID.
7576
7925
  * @param uuid - Security group UUID.
@@ -7786,6 +8135,13 @@ var ModelSecurityRulesClient = class {
7786
8135
  numRetries: this.numRetries
7787
8136
  });
7788
8137
  }
8138
+ /** List every security-rule page. @example `const rules = await ms.securityRules.listAll();` */
8139
+ async listAll(opts = {}) {
8140
+ return collectSkipPages(async (skip, limit) => {
8141
+ const page = await this.list({ ...opts, skip, limit });
8142
+ return { items: page.rules, total: page.pagination.total_items };
8143
+ }, opts);
8144
+ }
7789
8145
  /**
7790
8146
  * Get a single security rule by UUID.
7791
8147
  * @param uuid - Security rule UUID.
@@ -7865,6 +8221,13 @@ var ModelSecurityModelsClient = class {
7865
8221
  numRetries: this.numRetries
7866
8222
  });
7867
8223
  }
8224
+ /** List every model page. @example `const models = await ms.models.listAllModels();` */
8225
+ async listAllModels(opts = {}) {
8226
+ return collectSkipPages(async (skip, limit) => {
8227
+ const page = await this.listModels({ ...opts, skip, limit });
8228
+ return { items: page.models, total: page.pagination.total_items };
8229
+ }, opts);
8230
+ }
7868
8231
  /**
7869
8232
  * Get a single model by UUID.
7870
8233
  * @param uuid - Model UUID.
@@ -7921,6 +8284,13 @@ var ModelSecurityModelsClient = class {
7921
8284
  numRetries: this.numRetries
7922
8285
  });
7923
8286
  }
8287
+ /** List every version of a model. @example `const versions = await ms.models.listAllModelVersions(modelUuid);` */
8288
+ async listAllModelVersions(modelUuid, opts = {}) {
8289
+ return collectSkipPages(async (skip, limit) => {
8290
+ const page = await this.listModelVersions(modelUuid, { ...opts, skip, limit });
8291
+ return { items: page.model_versions, total: page.pagination.total_items };
8292
+ }, opts);
8293
+ }
7924
8294
  /**
7925
8295
  * Get a single model version by UUID.
7926
8296
  * @param uuid - Model version UUID.
@@ -7975,6 +8345,13 @@ var ModelSecurityModelsClient = class {
7975
8345
  numRetries: this.numRetries
7976
8346
  });
7977
8347
  }
8348
+ /** List every file in a model version. @example `const files = await ms.models.listAllModelVersionFiles(versionUuid);` */
8349
+ async listAllModelVersionFiles(modelVersionUuid, opts = {}) {
8350
+ return collectSkipPages(async (skip, limit) => {
8351
+ const page = await this.listModelVersionFiles(modelVersionUuid, { ...opts, skip, limit });
8352
+ return { items: page.files, total: page.pagination.total_items };
8353
+ }, opts);
8354
+ }
7978
8355
  };
7979
8356
 
7980
8357
  // src/model-security/client.ts
@@ -8115,6 +8492,13 @@ var RedTeamScansClient = class {
8115
8492
  numRetries: this.numRetries
8116
8493
  });
8117
8494
  }
8495
+ /** List every scan page. @example `const scans = await rt.scans.listAll({ status: 'COMPLETED' });` */
8496
+ async listAll(opts = {}) {
8497
+ return collectSkipPages(async (skip, limit) => {
8498
+ const page = await this.list({ ...opts, skip, limit });
8499
+ return { items: page.data, total: page.pagination.total_items };
8500
+ }, opts);
8501
+ }
8118
8502
  /**
8119
8503
  * Get a single scan job by ID.
8120
8504
  * @param jobId - The job UUID.
@@ -8892,6 +9276,29 @@ var RedTeamTargetsClient = class {
8892
9276
  numRetries: this.numRetries
8893
9277
  });
8894
9278
  }
9279
+ /**
9280
+ * List targets across every page while preserving the supplied filters.
9281
+ * @example
9282
+ * ```ts
9283
+ * const targets = await rt.targets.listAll({ limit: 100, status: 'READY' });
9284
+ * ```
9285
+ */
9286
+ async listAll(opts = {}) {
9287
+ const limit = opts.limit ?? 50;
9288
+ return collectAll(
9289
+ paginate(async (skip) => {
9290
+ const page = await this.list({ ...opts, skip, limit });
9291
+ const items = page.data ?? [];
9292
+ const next = skip + items.length;
9293
+ const total = page.pagination.total_items;
9294
+ return {
9295
+ items,
9296
+ next: items.length > 0 && (total == null ? items.length === limit : next < total) ? next : void 0
9297
+ };
9298
+ }, 0),
9299
+ { max: opts.max }
9300
+ );
9301
+ }
8895
9302
  /**
8896
9303
  * Get a target by UUID.
8897
9304
  * @param uuid - The target UUID.
@@ -9208,6 +9615,13 @@ var RedTeamCustomAttacksClient = class {
9208
9615
  numRetries: this.numRetries
9209
9616
  });
9210
9617
  }
9618
+ /** List every custom prompt-set page. @example `const sets = await rt.customAttacks.listAllPromptSets();` */
9619
+ async listAllPromptSets(opts = {}) {
9620
+ return collectSkipPages(async (skip, limit) => {
9621
+ const page = await this.listPromptSets({ ...opts, skip, limit });
9622
+ return { items: page.data ?? [], total: page.pagination.total_items };
9623
+ }, opts);
9624
+ }
9211
9625
  /**
9212
9626
  * Get a prompt set by UUID.
9213
9627
  * @param uuid - The prompt set UUID.
@@ -9520,6 +9934,13 @@ var RedTeamCustomAttacksClient = class {
9520
9934
  numRetries: this.numRetries
9521
9935
  });
9522
9936
  }
9937
+ /** List every prompt page for a set. @example `const prompts = await rt.customAttacks.listAllPrompts(promptSetUuid);` */
9938
+ async listAllPrompts(promptSetUuid, opts = {}) {
9939
+ return collectSkipPages(async (skip, limit) => {
9940
+ const page = await this.listPrompts(promptSetUuid, { ...opts, skip, limit });
9941
+ return { items: page.data ?? [], total: page.pagination.total_items };
9942
+ }, opts);
9943
+ }
9523
9944
  /**
9524
9945
  * Get a prompt by UUID.
9525
9946
  * @param promptSetUuid - The prompt set UUID.
@@ -10206,6 +10627,183 @@ var RedTeamNetworkBrokerClient = class {
10206
10627
  }
10207
10628
  };
10208
10629
 
10630
+ // src/red-team/adapters-client.ts
10631
+ var RedTeamAdaptersClient = class {
10632
+ baseUrl;
10633
+ auth;
10634
+ numRetries;
10635
+ constructor(opts) {
10636
+ this.baseUrl = opts.baseUrl;
10637
+ this.auth = opts.auth;
10638
+ this.numRetries = opts.numRetries;
10639
+ }
10640
+ /**
10641
+ * Create a new custom target adapter.
10642
+ * @param body - Adapter creation request (name, base64 script, variables, validation prompt).
10643
+ * @param opts - Set validate: false to save as DRAFT without running the script.
10644
+ * @returns The created adapter.
10645
+ * @example
10646
+ * ```ts
10647
+ * const adapter = await rt.adapters.create({
10648
+ * name: 'my-adapter',
10649
+ * script_b64: Buffer.from(script).toString('base64'),
10650
+ * network_broker_channel_uuid: '550e8400-...',
10651
+ * variables: [{ key: 'endpoint', value: 'http://...', type: 'VAR' }],
10652
+ * prompt: 'Hello',
10653
+ * }, { validate: true });
10654
+ * ```
10655
+ */
10656
+ async create(body, opts) {
10657
+ const validate = opts?.validate ?? true;
10658
+ return request({
10659
+ method: "POST",
10660
+ baseUrl: this.baseUrl,
10661
+ path: RED_TEAM_ADAPTER_PATH,
10662
+ params: { validate: String(validate) },
10663
+ body,
10664
+ responseSchema: AdapterResponseSchema,
10665
+ auth: this.auth,
10666
+ numRetries: this.numRetries
10667
+ });
10668
+ }
10669
+ /**
10670
+ * List adapters with optional pagination.
10671
+ * @param opts - Optional limit/skip/search.
10672
+ * @returns Paginated list of adapters.
10673
+ * @example
10674
+ * ```ts
10675
+ * const { data } = await rt.adapters.list({ limit: 20 });
10676
+ * // data => [{ uuid: '...', name: 'my-adapter', status: 'ACTIVE' }]
10677
+ * ```
10678
+ */
10679
+ async list(opts) {
10680
+ return request({
10681
+ method: "GET",
10682
+ baseUrl: this.baseUrl,
10683
+ path: RED_TEAM_ADAPTER_PATH,
10684
+ params: serializeListing(opts),
10685
+ responseSchema: AdapterListSchema,
10686
+ auth: this.auth,
10687
+ numRetries: this.numRetries
10688
+ });
10689
+ }
10690
+ /** List every adapter page. @example `const adapters = await rt.adapters.listAll();` */
10691
+ async listAll(opts = {}) {
10692
+ return collectSkipPages(async (skip, limit) => {
10693
+ const page = await this.list({ ...opts, skip, limit });
10694
+ return { items: page.data ?? [], total: page.pagination.total_items };
10695
+ }, opts);
10696
+ }
10697
+ /**
10698
+ * Get a single adapter by UUID.
10699
+ * @param uuid - Adapter UUID.
10700
+ * @returns The adapter detail.
10701
+ * @example
10702
+ * ```ts
10703
+ * const adapter = await rt.adapters.get('550e8400-e29b-41d4-a716-446655440000');
10704
+ * // adapter.status => 'ACTIVE'
10705
+ * ```
10706
+ */
10707
+ async get(uuid) {
10708
+ assertUuid(uuid, "adapter uuid");
10709
+ return request({
10710
+ method: "GET",
10711
+ baseUrl: this.baseUrl,
10712
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
10713
+ responseSchema: AdapterResponseSchema,
10714
+ auth: this.auth,
10715
+ numRetries: this.numRetries
10716
+ });
10717
+ }
10718
+ /**
10719
+ * Update an adapter. **Full replacement (PUT), not a patch** — `name`, `script_b64`, and
10720
+ * `prompt` are required just as on create. For `variables`, the list defines the complete
10721
+ * desired key set: a provided value sets it, `null` keeps the stored value (unchanged
10722
+ * secrets), and omitting a key **deletes** that variable.
10723
+ * @param uuid - Adapter UUID.
10724
+ * @param body - The complete adapter definition.
10725
+ * @param opts - Set validate: false to save as DRAFT without re-running the script.
10726
+ * @returns The updated adapter.
10727
+ * @example
10728
+ * ```ts
10729
+ * const updated = await rt.adapters.update('550e8400-...', {
10730
+ * name: 'my-keycloak-agent',
10731
+ * script_b64: Buffer.from(newScript).toString('base64'),
10732
+ * prompt: 'What is the capital of France?',
10733
+ * variables: [
10734
+ * { key: 'endpoint', value: 'http://agent.svc:8080', type: 'VAR' },
10735
+ * { key: 'client_secret', value: null, type: 'SECRET' }, // null keeps stored secret
10736
+ * ],
10737
+ * });
10738
+ * ```
10739
+ */
10740
+ async update(uuid, body, opts) {
10741
+ assertUuid(uuid, "adapter uuid");
10742
+ const validate = opts?.validate ?? true;
10743
+ return request({
10744
+ method: "PUT",
10745
+ baseUrl: this.baseUrl,
10746
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
10747
+ params: { validate: String(validate) },
10748
+ body,
10749
+ responseSchema: AdapterResponseSchema,
10750
+ auth: this.auth,
10751
+ numRetries: this.numRetries
10752
+ });
10753
+ }
10754
+ /**
10755
+ * Delete an adapter.
10756
+ * @param uuid - Adapter UUID.
10757
+ * @example
10758
+ * ```ts
10759
+ * await rt.adapters.delete('550e8400-e29b-41d4-a716-446655440000');
10760
+ * ```
10761
+ */
10762
+ async delete(uuid) {
10763
+ assertUuid(uuid, "adapter uuid");
10764
+ return request({
10765
+ method: "DELETE",
10766
+ baseUrl: this.baseUrl,
10767
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
10768
+ responseSchema: BaseResponseSchema.optional(),
10769
+ allowEmptyBody: true,
10770
+ auth: this.auth,
10771
+ numRetries: this.numRetries
10772
+ });
10773
+ }
10774
+ /**
10775
+ * Validate an adapter script without saving anything. Runs the script end-to-end through the
10776
+ * network broker channel using the sample prompt, and returns the execution outcome —
10777
+ * `validated` plus the script's `stdout` / `stderr` / `traceback` — not an adapter record.
10778
+ *
10779
+ * This endpoint has its own request shape: no `name`, `network_broker_channel_uuid` is
10780
+ * required, and `adapter_uuid` may reference an existing adapter so `null` variable values
10781
+ * are resolved from its stored secrets before the run.
10782
+ * @param body - Script, channel, prompt, and optionally variables / an existing adapter UUID.
10783
+ * @returns The validation outcome.
10784
+ * @example
10785
+ * ```ts
10786
+ * const result = await rt.adapters.validate({
10787
+ * script_b64: Buffer.from(script).toString('base64'),
10788
+ * network_broker_channel_uuid: '550e8400-...',
10789
+ * prompt: 'Hello',
10790
+ * });
10791
+ * if (!result.validated) console.error(result.stderr ?? result.traceback);
10792
+ * ```
10793
+ */
10794
+ async validate(body) {
10795
+ return request({
10796
+ method: "POST",
10797
+ baseUrl: this.baseUrl,
10798
+ path: RED_TEAM_ADAPTER_VALIDATE_PATH,
10799
+ body,
10800
+ responseSchema: AdapterValidateResponseSchema,
10801
+ auth: this.auth,
10802
+ numRetries: this.numRetries
10803
+ });
10804
+ }
10805
+ };
10806
+
10209
10807
  // src/red-team/client.ts
10210
10808
  var RedTeamClient = class {
10211
10809
  /** Data plane scan operations. */
@@ -10224,6 +10822,8 @@ var RedTeamClient = class {
10224
10822
  instances;
10225
10823
  /** Network broker channel operations (distinct network broker base URL). */
10226
10824
  networkBroker;
10825
+ /** Management plane custom target adapter operations. */
10826
+ adapters;
10227
10827
  dataEndpoint;
10228
10828
  mgmtEndpoint;
10229
10829
  auth;
@@ -10262,6 +10862,7 @@ var RedTeamClient = class {
10262
10862
  });
10263
10863
  this.eula = new RedTeamEulaClient({ baseUrl: mgmtEndpoint, auth, numRetries });
10264
10864
  this.instances = new RedTeamInstancesClient({ baseUrl: mgmtEndpoint, auth, numRetries });
10865
+ this.adapters = new RedTeamAdaptersClient({ baseUrl: mgmtEndpoint, auth, numRetries });
10265
10866
  this.networkBroker = new RedTeamNetworkBrokerClient({
10266
10867
  baseUrl: networkBrokerEndpoint,
10267
10868
  auth,
@@ -10959,30 +11560,49 @@ var AIGatewayTelemetryClient = class {
10959
11560
  // src/ai-gateway/workspaces-client.ts
10960
11561
  var AIGatewayWorkspacesClient = class {
10961
11562
  baseUrl;
11563
+ adminBaseUrl;
10962
11564
  auth;
10963
11565
  numRetries;
10964
11566
  constructor(opts) {
10965
11567
  this.baseUrl = opts.baseUrl;
11568
+ this.adminBaseUrl = opts.adminBaseUrl;
10966
11569
  this.auth = opts.auth;
10967
11570
  this.numRetries = opts.numRetries;
10968
11571
  }
11572
+ urlFor(plane) {
11573
+ return plane === "admin" ? this.adminBaseUrl : this.baseUrl;
11574
+ }
10969
11575
  /**
10970
- * List workspaces visible to the caller.
10971
- * @returns All workspaces, each with the `scope_name` that grants data-plane access to it.
11576
+ * List workspaces.
11577
+ *
11578
+ * Two defaults worth knowing, because each one hides rows:
11579
+ *
11580
+ * 1. **Active only.** Without `status`, archived workspaces are omitted. Pass
11581
+ * `{ status: 'archived' }` to see them — that is where {@link AIGatewayWorkspacesClient.delete}
11582
+ * leaves a workspace.
11583
+ * 2. **Your scope only.** The data plane returns just the workspaces your service account holds a
11584
+ * workspace-scope grant on. Pass `{ plane: 'admin' }` to enumerate the whole tenant.
11585
+ *
11586
+ * @param options - Optional status filter and plane selection.
11587
+ * @returns Workspaces, each with the `scope_name` that grants data-plane access to it.
10972
11588
  * @example
10973
11589
  * ```ts
10974
11590
  * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
10975
11591
  * const gw = new AIGatewayClient();
10976
11592
  *
10977
- * const ws = await gw.workspaces.list();
10978
- * // ws.data[0] => { slug: 'ws-main-a-349e0e', scope_name: 'main_airs_workspace_1852583913', ... }
11593
+ * const mine = await gw.workspaces.list();
11594
+ * // mine.data[0] => { slug: 'ws-main-a-349e0e', scope_name: 'main_airs_workspace_1852583913', ... }
11595
+ *
11596
+ * const everything = await gw.workspaces.list({ plane: 'admin' });
11597
+ * const archived = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
10979
11598
  * ```
10980
11599
  */
10981
- async list() {
11600
+ async list(options = {}) {
10982
11601
  return request({
10983
11602
  method: "GET",
10984
- baseUrl: this.baseUrl,
11603
+ baseUrl: this.urlFor(options.plane),
10985
11604
  path: AI_GW_WORKSPACES_PATH,
11605
+ params: options.status ? { status: options.status } : void 0,
10986
11606
  responseSchema: ListWorkspacesResponseSchema,
10987
11607
  auth: this.auth,
10988
11608
  numRetries: this.numRetries
@@ -10990,7 +11610,16 @@ var AIGatewayWorkspacesClient = class {
10990
11610
  }
10991
11611
  /**
10992
11612
  * Fetch one workspace, including its security and rate-limit settings.
10993
- * @param workspaceId - Workspace UUID.
11613
+ *
11614
+ * @param workspaceRef - Workspace UUID **or** slug; the API accepts both.
11615
+ * @param options - Plane selection. A workspace outside your workspace scope answers `403 AB03`
11616
+ * on the data plane, not `404`; re-read it with `{ plane: 'admin' }`.
11617
+ *
11618
+ * **Archived workspaces are not retrievable here.** Once
11619
+ * {@link AIGatewayWorkspacesClient.delete} has archived a workspace, this returns `404 AB08`
11620
+ * for both its UUID and its slug, on either plane (verified live 2026-08-01) — even though the
11621
+ * row is still listed by `list({ status: 'archived' })`. Treat a 404 after a delete as expected,
11622
+ * and use the list filter to inspect archived workspaces.
10994
11623
  * @returns Workspace detail; list rows do not carry the settings blocks.
10995
11624
  * @example
10996
11625
  * ```ts
@@ -10999,19 +11628,133 @@ var AIGatewayWorkspacesClient = class {
10999
11628
  *
11000
11629
  * const ws = await gw.workspaces.get('16f7e90d-382a-4e78-b577-1b01eb5f8297');
11001
11630
  * // ws.security_settings?.membersViewLogs => true
11631
+ *
11632
+ * // Slugs work too, and the admin plane reaches workspaces you aren't scoped to:
11633
+ * const other = await gw.workspaces.get('ws-produc-985697', { plane: 'admin' });
11002
11634
  * ```
11003
11635
  */
11004
- async get(workspaceId) {
11005
- assertUuid(workspaceId, "workspaceId");
11636
+ async get(workspaceRef, options = {}) {
11637
+ assertWorkspaceRef(workspaceRef, "workspaceRef");
11006
11638
  return request({
11007
11639
  method: "GET",
11008
- baseUrl: this.baseUrl,
11009
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceId}`,
11640
+ baseUrl: this.urlFor(options.plane),
11641
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
11010
11642
  responseSchema: GatewayWorkspaceDetailSchema,
11011
11643
  auth: this.auth,
11012
11644
  numRetries: this.numRetries
11013
11645
  });
11014
11646
  }
11647
+ /**
11648
+ * Create a workspace. **Admin plane** — needs a tenant-root admin role.
11649
+ *
11650
+ * @param body - `name` and `scope_name` are both required; the API rejects a body missing either.
11651
+ * @returns The created workspace. Unlike `configs`/`guardrails`/`providers`/`deployments`,
11652
+ * which return short receipts, this returns most of the record — but not `status`,
11653
+ * `is_default`, `icon`, `usage_limits`, `rate_limits`, or the settings blocks. Call
11654
+ * {@link AIGatewayWorkspacesClient.get} when you need those.
11655
+ * @example
11656
+ * ```ts
11657
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
11658
+ * const gw = new AIGatewayClient();
11659
+ *
11660
+ * const created = await gw.workspaces.create({
11661
+ * name: 'Production',
11662
+ * scope_name: 'ws_production_bx7qw0', // the SCM scope, not derived from name
11663
+ * description: 'All production applications',
11664
+ * defaults: { metadata: { env: 'production' } },
11665
+ * rate_limits: [{ type: 'requests', unit: 'rpm', value: 100 }],
11666
+ * });
11667
+ * ```
11668
+ */
11669
+ async create(body) {
11670
+ if (!body.name) {
11671
+ throw new AISecSDKException("Missing name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11672
+ }
11673
+ if (!body.scope_name) {
11674
+ throw new AISecSDKException("Missing scope_name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11675
+ }
11676
+ return request({
11677
+ method: "POST",
11678
+ baseUrl: this.adminBaseUrl,
11679
+ path: AI_GW_WORKSPACES_PATH,
11680
+ body,
11681
+ responseSchema: GatewayWorkspaceCreateResponseSchema,
11682
+ auth: this.auth,
11683
+ numRetries: this.numRetries
11684
+ });
11685
+ }
11686
+ /**
11687
+ * Update a workspace. **Admin plane.** Partial patch — send only the fields that change.
11688
+ *
11689
+ * @param workspaceRef - Workspace UUID or slug.
11690
+ * @param body - At least one field. An empty patch is rejected locally, mirroring the API's own
11691
+ * "No update fields provided" rejection, so a typo'd caller fails without a round trip.
11692
+ * @returns An **empty object** — the API acknowledges the write without echoing the record
11693
+ * (verified live 2026-08-01). The change does persist; re-read with
11694
+ * {@link AIGatewayWorkspacesClient.get} to see it.
11695
+ * @example
11696
+ * ```ts
11697
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
11698
+ * const gw = new AIGatewayClient();
11699
+ *
11700
+ * await gw.workspaces.update('ws-produc-985697', {
11701
+ * description: 'Production workloads, us-east',
11702
+ * });
11703
+ * ```
11704
+ */
11705
+ async update(workspaceRef, body) {
11706
+ assertWorkspaceRef(workspaceRef, "workspaceRef");
11707
+ if (Object.keys(body).length === 0) {
11708
+ throw new AISecSDKException(
11709
+ "Empty update: provide at least one of name, description, icon, defaults, usage_limits, rate_limits",
11710
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
11711
+ );
11712
+ }
11713
+ return request({
11714
+ method: "PUT",
11715
+ baseUrl: this.adminBaseUrl,
11716
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
11717
+ body,
11718
+ responseSchema: GatewayWriteResponseSchema,
11719
+ auth: this.auth,
11720
+ numRetries: this.numRetries
11721
+ });
11722
+ }
11723
+ /**
11724
+ * Delete a workspace. **Admin plane.**
11725
+ *
11726
+ * This is a **soft delete**: the workspace is archived, not destroyed. It vanishes from a default
11727
+ * {@link AIGatewayWorkspacesClient.list} but stays visible via `list({ status: 'archived' })`.
11728
+ * Note that `list` is the *only* way to see it afterwards —
11729
+ * {@link AIGatewayWorkspacesClient.get} answers `404 AB08` for an archived workspace.
11730
+ * Same semantics as `deployments.delete()`, and the opposite of `configs`/`guardrails`/`providers`,
11731
+ * which hard delete. There is no hard delete for workspaces.
11732
+ *
11733
+ * Takes no query parameters — unlike `integrations.delete()` and `deployments.delete()`, which
11734
+ * both require `organisation_id`.
11735
+ *
11736
+ * @param workspaceRef - Workspace UUID or slug.
11737
+ * @example
11738
+ * ```ts
11739
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
11740
+ * const gw = new AIGatewayClient();
11741
+ *
11742
+ * await gw.workspaces.delete('ws-produc-985697');
11743
+ *
11744
+ * // Still there, archived:
11745
+ * const gone = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
11746
+ * ```
11747
+ */
11748
+ async delete(workspaceRef) {
11749
+ assertWorkspaceRef(workspaceRef, "workspaceRef");
11750
+ return request({
11751
+ method: "DELETE",
11752
+ baseUrl: this.adminBaseUrl,
11753
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
11754
+ auth: this.auth,
11755
+ numRetries: this.numRetries
11756
+ });
11757
+ }
11015
11758
  };
11016
11759
 
11017
11760
  // src/ai-gateway/configs-client.ts
@@ -12333,7 +13076,7 @@ var AIGatewayClient = class {
12333
13076
  const dataOpts = { baseUrl: dataEndpoint, auth, numRetries };
12334
13077
  const adminOpts = { baseUrl: adminEndpoint, auth, numRetries };
12335
13078
  this.telemetry = new AIGatewayTelemetryClient({ ...dataOpts, tsgId });
12336
- this.workspaces = new AIGatewayWorkspacesClient(dataOpts);
13079
+ this.workspaces = new AIGatewayWorkspacesClient({ ...dataOpts, adminBaseUrl: adminEndpoint });
12337
13080
  this.configs = new AIGatewayConfigsClient(dataOpts);
12338
13081
  this.guardrails = new AIGatewayGuardrailsClient(dataOpts);
12339
13082
  this.providers = new AIGatewayProvidersClient(dataOpts);
@@ -12388,6 +13131,16 @@ var AIGatewayClient = class {
12388
13131
  AI_SEC_API_TOKEN,
12389
13132
  ASYNC_SCAN_PATH,
12390
13133
  Action,
13134
+ AdapterCreateRequestSchema,
13135
+ AdapterListItemSchema,
13136
+ AdapterListSchema,
13137
+ AdapterResponseSchema,
13138
+ AdapterUpdateRequestSchema,
13139
+ AdapterValidateRequestSchema,
13140
+ AdapterValidateResponseSchema,
13141
+ AdapterVarResponseSchema,
13142
+ AdapterVarSchema,
13143
+ AdapterVarTypeSchema,
12391
13144
  AdvancedDataProfileRequestSchema,
12392
13145
  AgentEntrySchema,
12393
13146
  AgentMetaSchema,
@@ -12628,6 +13381,9 @@ var AIGatewayClient = class {
12628
13381
  GatewayPluginSchema,
12629
13382
  GatewayProviderCreateResponseSchema,
12630
13383
  GatewayProviderSchema,
13384
+ GatewayRateLimitSchema,
13385
+ GatewayUsageLimitSchema,
13386
+ GatewayWorkspaceCreateResponseSchema,
12631
13387
  GatewayWorkspaceDetailSchema,
12632
13388
  GatewayWorkspaceSchema,
12633
13389
  GatewayWriteResponseSchema,
@@ -12800,6 +13556,8 @@ var AIGatewayClient = class {
12800
13556
  PyPIAuthResponseSchema,
12801
13557
  QuotaDetailsSchema,
12802
13558
  QuotaSummarySchema,
13559
+ RED_TEAM_ADAPTER_PATH,
13560
+ RED_TEAM_ADAPTER_VALIDATE_PATH,
12803
13561
  RED_TEAM_CATEGORIES_PATH,
12804
13562
  RED_TEAM_CHANNELS_PATH,
12805
13563
  RED_TEAM_CHANNELS_STATS_PATH,
@@ -12829,6 +13587,7 @@ var AIGatewayClient = class {
12829
13587
  RED_TEAM_TEMPLATE_PATH,
12830
13588
  RED_TEAM_TOKEN_ENDPOINT,
12831
13589
  RED_TEAM_TSG_ID,
13590
+ RedTeamAdaptersClient,
12832
13591
  RedTeamCategory,
12833
13592
  RedTeamClient,
12834
13593
  RedTeamCustomAttackReportsClient,
@@ -12972,9 +13731,14 @@ var AIGatewayClient = class {
12972
13731
  WebSocketConnectionParamsSchema,
12973
13732
  WeightedRegexSchema,
12974
13733
  aiGwOrganisationsAuthSettingsPath,
13734
+ collectAll,
13735
+ collectSkipPages,
13736
+ collectSpringPages,
12975
13737
  globalConfiguration,
12976
13738
  init,
12977
13739
  jsonNullable,
12978
- pageSchema
13740
+ pageSchema,
13741
+ paginate,
13742
+ serializeListing
12979
13743
  });
12980
13744
  //# sourceMappingURL=index.cjs.map