@cdot65/prisma-airs-sdk 0.19.0 → 0.20.1

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
@@ -35,6 +35,18 @@ __export(index_exports, {
35
35
  AIGatewayWorkspacesClient: () => AIGatewayWorkspacesClient,
36
36
  AIRS_ENDPOINTS: () => AIRS_ENDPOINTS,
37
37
  AISecSDKException: () => AISecSDKException,
38
+ AI_GATEWAY_DEPLOYMENT_STATUSES: () => AI_GATEWAY_DEPLOYMENT_STATUSES,
39
+ AI_GATEWAY_DEPLOYMENT_TYPES: () => AI_GATEWAY_DEPLOYMENT_TYPES,
40
+ AI_GATEWAY_KNOWN_API_KEY_SCOPES: () => AI_GATEWAY_KNOWN_API_KEY_SCOPES,
41
+ AI_GATEWAY_KNOWN_CACHE_MODES: () => AI_GATEWAY_KNOWN_CACHE_MODES,
42
+ AI_GATEWAY_KNOWN_CONFIG_STRATEGIES: () => AI_GATEWAY_KNOWN_CONFIG_STRATEGIES,
43
+ AI_GATEWAY_KNOWN_MCP_AUTH_TYPES: () => AI_GATEWAY_KNOWN_MCP_AUTH_TYPES,
44
+ AI_GATEWAY_KNOWN_MCP_TRANSPORTS: () => AI_GATEWAY_KNOWN_MCP_TRANSPORTS,
45
+ AI_GATEWAY_KNOWN_RATE_LIMIT_TYPES: () => AI_GATEWAY_KNOWN_RATE_LIMIT_TYPES,
46
+ AI_GATEWAY_KNOWN_RATE_LIMIT_UNITS: () => AI_GATEWAY_KNOWN_RATE_LIMIT_UNITS,
47
+ AI_GATEWAY_MUTABLE_MCP_CAPABILITY_TYPES: () => AI_GATEWAY_MUTABLE_MCP_CAPABILITY_TYPES,
48
+ AI_GATEWAY_REDACTED: () => AI_GATEWAY_REDACTED,
49
+ AI_GATEWAY_SECRET_FIELDS: () => AI_GATEWAY_SECRET_FIELDS,
38
50
  AI_GW_ADMIN_ENDPOINT: () => AI_GW_ADMIN_ENDPOINT,
39
51
  AI_GW_API_KEYS_SERVICE_PATH: () => AI_GW_API_KEYS_SERVICE_PATH,
40
52
  AI_GW_API_KEYS_USER_PATH: () => AI_GW_API_KEYS_USER_PATH,
@@ -286,39 +298,100 @@ __export(index_exports, {
286
298
  FileScanDataSchema: () => FileScanDataSchema,
287
299
  FileScanResult: () => FileScanResult,
288
300
  FileType: () => FileType,
301
+ GatewayApiKeyCreateRequestSchema: () => GatewayApiKeyCreateRequestSchema,
302
+ GatewayApiKeyRotateRequestSchema: () => GatewayApiKeyRotateRequestSchema,
289
303
  GatewayApiKeyRotateResponseSchema: () => GatewayApiKeyRotateResponseSchema,
304
+ GatewayApiKeyRotationPolicySchema: () => GatewayApiKeyRotationPolicySchema,
290
305
  GatewayApiKeySchema: () => GatewayApiKeySchema,
306
+ GatewayApiKeyScopeSchema: () => GatewayApiKeyScopeSchema,
307
+ GatewayApiKeyUpdateRequestSchema: () => GatewayApiKeyUpdateRequestSchema,
291
308
  GatewayAuditLogRecordSchema: () => GatewayAuditLogRecordSchema,
292
309
  GatewayAuditLogsResponseSchema: () => GatewayAuditLogsResponseSchema,
310
+ GatewayAzureAIConfigurationSchema: () => GatewayAzureAIConfigurationSchema,
311
+ GatewayAzureDeploymentConfigurationSchema: () => GatewayAzureDeploymentConfigurationSchema,
312
+ GatewayAzureOpenAIConfigurationSchema: () => GatewayAzureOpenAIConfigurationSchema,
313
+ GatewayBedrockConfigurationSchema: () => GatewayBedrockConfigurationSchema,
293
314
  GatewayChartRecordSchema: () => GatewayChartRecordSchema,
315
+ GatewayConfigCacheModeSchema: () => GatewayConfigCacheModeSchema,
316
+ GatewayConfigCreateRequestSchema: () => GatewayConfigCreateRequestSchema,
294
317
  GatewayConfigCreateResponseSchema: () => GatewayConfigCreateResponseSchema,
295
318
  GatewayConfigDetailSchema: () => GatewayConfigDetailSchema,
296
319
  GatewayConfigSchema: () => GatewayConfigSchema,
320
+ GatewayConfigStrategySchema: () => GatewayConfigStrategySchema,
321
+ GatewayConfigUpdateRequestSchema: () => GatewayConfigUpdateRequestSchema,
297
322
  GatewayConfigVersionSchema: () => GatewayConfigVersionSchema,
323
+ GatewayCortexConfigurationSchema: () => GatewayCortexConfigurationSchema,
324
+ GatewayCustomHostConfigurationSchema: () => GatewayCustomHostConfigurationSchema,
325
+ GatewayDefaultsInputSchema: () => GatewayDefaultsInputSchema,
326
+ GatewayDeploymentAuthSettingsInputSchema: () => GatewayDeploymentAuthSettingsInputSchema,
327
+ GatewayDeploymentCreateRequestSchema: () => GatewayDeploymentCreateRequestSchema,
298
328
  GatewayDeploymentCreateResponseSchema: () => GatewayDeploymentCreateResponseSchema,
299
329
  GatewayDeploymentDetailSchema: () => GatewayDeploymentDetailSchema,
300
330
  GatewayDeploymentPingResponseSchema: () => GatewayDeploymentPingResponseSchema,
301
331
  GatewayDeploymentSchema: () => GatewayDeploymentSchema,
332
+ GatewayDeploymentStatusSchema: () => GatewayDeploymentStatusSchema,
333
+ GatewayDeploymentTypeSchema: () => GatewayDeploymentTypeSchema,
334
+ GatewayDeploymentUpdateRequestSchema: () => GatewayDeploymentUpdateRequestSchema,
335
+ GatewayGlobalWorkspaceAccessInputSchema: () => GatewayGlobalWorkspaceAccessInputSchema,
302
336
  GatewayGlobalWorkspaceAccessSchema: () => GatewayGlobalWorkspaceAccessSchema,
303
337
  GatewayGroupRowSchema: () => GatewayGroupRowSchema,
338
+ GatewayGuardrailActionsSchema: () => GatewayGuardrailActionsSchema,
339
+ GatewayGuardrailCheckSchema: () => GatewayGuardrailCheckSchema,
340
+ GatewayGuardrailCreateRequestSchema: () => GatewayGuardrailCreateRequestSchema,
304
341
  GatewayGuardrailCreateResponseSchema: () => GatewayGuardrailCreateResponseSchema,
305
342
  GatewayGuardrailDetailSchema: () => GatewayGuardrailDetailSchema,
306
343
  GatewayGuardrailSchema: () => GatewayGuardrailSchema,
344
+ GatewayGuardrailUpdateRequestSchema: () => GatewayGuardrailUpdateRequestSchema,
345
+ GatewayHuggingFaceConfigurationSchema: () => GatewayHuggingFaceConfigurationSchema,
346
+ GatewayIntegrationCreateRequestSchema: () => GatewayIntegrationCreateRequestSchema,
347
+ GatewayIntegrationModelUpdateSchema: () => GatewayIntegrationModelUpdateSchema,
348
+ GatewayIntegrationModelsBulkUpdateRequestSchema: () => GatewayIntegrationModelsBulkUpdateRequestSchema,
307
349
  GatewayIntegrationModelsResponseSchema: () => GatewayIntegrationModelsResponseSchema,
308
350
  GatewayIntegrationSchema: () => GatewayIntegrationSchema,
351
+ GatewayIntegrationUpdateRequestSchema: () => GatewayIntegrationUpdateRequestSchema,
309
352
  GatewayIntegrationWorkspaceSchema: () => GatewayIntegrationWorkspaceSchema,
353
+ GatewayIntegrationWorkspacesBulkUpdateRequestSchema: () => GatewayIntegrationWorkspacesBulkUpdateRequestSchema,
310
354
  GatewayIntegrationWorkspacesResponseSchema: () => GatewayIntegrationWorkspacesResponseSchema,
355
+ GatewayJsonObjectSchema: () => GatewayJsonObjectSchema,
356
+ GatewayJsonValueSchema: () => GatewayJsonValueSchema,
311
357
  GatewayLogRecordSchema: () => GatewayLogRecordSchema,
312
358
  GatewayLogsResponseSchema: () => GatewayLogsResponseSchema,
359
+ GatewayMcpAuthTypeSchema: () => GatewayMcpAuthTypeSchema,
360
+ GatewayMcpTransportSchema: () => GatewayMcpTransportSchema,
361
+ GatewayMutableMcpCapabilityTypeSchema: () => GatewayMutableMcpCapabilityTypeSchema,
362
+ GatewayOpenAIConfigurationSchema: () => GatewayOpenAIConfigurationSchema,
363
+ GatewayOrganisationAuthSettingsUpdateRequestSchema: () => GatewayOrganisationAuthSettingsUpdateRequestSchema,
364
+ GatewayOrganisationUpdateRequestSchema: () => GatewayOrganisationUpdateRequestSchema,
365
+ GatewayPluginCreateRequestSchema: () => GatewayPluginCreateRequestSchema,
313
366
  GatewayPluginSchema: () => GatewayPluginSchema,
367
+ GatewayProviderCreateRequestSchema: () => GatewayProviderCreateRequestSchema,
314
368
  GatewayProviderCreateResponseSchema: () => GatewayProviderCreateResponseSchema,
315
369
  GatewayProviderDetailSchema: () => GatewayProviderDetailSchema,
316
370
  GatewayProviderSchema: () => GatewayProviderSchema,
371
+ GatewayProviderUpdateRequestSchema: () => GatewayProviderUpdateRequestSchema,
372
+ GatewayRateLimitInputSchema: () => GatewayRateLimitInputSchema,
317
373
  GatewayRateLimitSchema: () => GatewayRateLimitSchema,
374
+ GatewayRateLimitTypeSchema: () => GatewayRateLimitTypeSchema,
375
+ GatewayRateLimitUnitSchema: () => GatewayRateLimitUnitSchema,
376
+ GatewayRoutingCacheSchema: () => GatewayRoutingCacheSchema,
377
+ GatewayRoutingConfigSchema: () => GatewayRoutingConfigSchema,
378
+ GatewayRoutingRetrySchema: () => GatewayRoutingRetrySchema,
379
+ GatewayRoutingStrategySchema: () => GatewayRoutingStrategySchema,
380
+ GatewayRoutingTargetSchema: () => GatewayRoutingTargetSchema,
381
+ GatewaySageMakerConfigurationSchema: () => GatewaySageMakerConfigurationSchema,
382
+ GatewaySecretMappingSchema: () => GatewaySecretMappingSchema,
383
+ GatewayServiceApiKeyCreateRequestSchema: () => GatewayServiceApiKeyCreateRequestSchema,
384
+ GatewayUsageLimitInputSchema: () => GatewayUsageLimitInputSchema,
318
385
  GatewayUsageLimitSchema: () => GatewayUsageLimitSchema,
386
+ GatewayUserApiKeyCreateRequestSchema: () => GatewayUserApiKeyCreateRequestSchema,
387
+ GatewayVertexAIConfigurationSchema: () => GatewayVertexAIConfigurationSchema,
388
+ GatewayWorkersAIConfigurationSchema: () => GatewayWorkersAIConfigurationSchema,
389
+ GatewayWorkspaceBindingSchema: () => GatewayWorkspaceBindingSchema,
390
+ GatewayWorkspaceCreateRequestSchema: () => GatewayWorkspaceCreateRequestSchema,
319
391
  GatewayWorkspaceCreateResponseSchema: () => GatewayWorkspaceCreateResponseSchema,
320
392
  GatewayWorkspaceDetailSchema: () => GatewayWorkspaceDetailSchema,
321
393
  GatewayWorkspaceSchema: () => GatewayWorkspaceSchema,
394
+ GatewayWorkspaceUpdateRequestSchema: () => GatewayWorkspaceUpdateRequestSchema,
322
395
  GatewayWriteResponseSchema: () => GatewayWriteResponseSchema,
323
396
  GoalListResponseSchema: () => GoalListResponseSchema,
324
397
  GoalSchema: () => GoalSchema,
@@ -422,12 +495,17 @@ __export(index_exports, {
422
495
  MaskedDataSchema: () => MaskedDataSchema,
423
496
  McEntrySchema: () => McEntrySchema,
424
497
  McReportSchema: () => McReportSchema,
498
+ McpIntegrationCapabilitiesBulkUpdateRequestSchema: () => McpIntegrationCapabilitiesBulkUpdateRequestSchema,
425
499
  McpIntegrationCapabilitiesResponseSchema: () => McpIntegrationCapabilitiesResponseSchema,
426
500
  McpIntegrationCapabilitiesUpdateResponseSchema: () => McpIntegrationCapabilitiesUpdateResponseSchema,
427
501
  McpIntegrationCapabilitySchema: () => McpIntegrationCapabilitySchema,
502
+ McpIntegrationCapabilityUpdateSchema: () => McpIntegrationCapabilityUpdateSchema,
503
+ McpIntegrationCreateRequestSchema: () => McpIntegrationCreateRequestSchema,
428
504
  McpIntegrationDetailSchema: () => McpIntegrationDetailSchema,
429
505
  McpIntegrationMetadataSchema: () => McpIntegrationMetadataSchema,
430
506
  McpIntegrationSchema: () => McpIntegrationSchema,
507
+ McpIntegrationUpdateRequestSchema: () => McpIntegrationUpdateRequestSchema,
508
+ McpIntegrationWorkspacesBulkUpdateRequestSchema: () => McpIntegrationWorkspacesBulkUpdateRequestSchema,
431
509
  McpIntegrationWorkspacesUpdateResponseSchema: () => McpIntegrationWorkspacesUpdateResponseSchema,
432
510
  MetadataCriterionSchema: () => MetadataCriterionSchema,
433
511
  MetadataSchema: () => MetadataSchema,
@@ -671,6 +749,7 @@ __export(index_exports, {
671
749
  WebSocketConnectionParamsSchema: () => WebSocketConnectionParamsSchema,
672
750
  WeightedRegexSchema: () => WeightedRegexSchema,
673
751
  aiGwOrganisationsAuthSettingsPath: () => aiGwOrganisationsAuthSettingsPath,
752
+ buildDottedObject: () => buildDottedObject,
674
753
  collectAll: () => collectAll,
675
754
  collectSkipPages: () => collectSkipPages,
676
755
  collectSpringPages: () => collectSpringPages,
@@ -679,7 +758,9 @@ __export(index_exports, {
679
758
  jsonNullable: () => jsonNullable,
680
759
  pageSchema: () => pageSchema,
681
760
  paginate: () => paginate,
682
- serializeListing: () => serializeListing
761
+ redactAIGatewaySecrets: () => redactAIGatewaySecrets,
762
+ serializeListing: () => serializeListing,
763
+ setDottedValue: () => setDottedValue
683
764
  });
684
765
  module.exports = __toCommonJS(index_exports);
685
766
 
@@ -714,7 +795,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
714
795
  var MAX_CONNECTION_POOL_SIZE = 100;
715
796
  var MAX_NUMBER_OF_RETRIES = 5;
716
797
  var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
717
- var SDK_VERSION = "0.17.0";
798
+ var SDK_VERSION = "0.20.1";
718
799
  var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
719
800
  var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
720
801
  var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
@@ -957,8 +1038,8 @@ var import_zod15 = require("zod");
957
1038
  // src/utils.ts
958
1039
  var import_node_crypto = require("crypto");
959
1040
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
960
- function isValidUuid(value) {
961
- return UUID_RE.test(value);
1041
+ function isValidUuid(value2) {
1042
+ return UUID_RE.test(value2);
962
1043
  }
963
1044
  function generatePayloadHash(payload, secret) {
964
1045
  return (0, import_node_crypto.createHmac)("sha256", secret).update(payload).digest("hex");
@@ -1018,9 +1099,9 @@ function extractErrorMessage(body, status) {
1018
1099
  return body ? `API error ${status}: ${body}` : `API error ${status}`;
1019
1100
  }
1020
1101
  }
1021
- function parseRetryAfterHeader(value) {
1022
- if (value === null) return void 0;
1023
- const normalized = value.trim();
1102
+ function parseRetryAfterHeader(value2) {
1103
+ if (value2 === null) return void 0;
1104
+ const normalized = value2.trim();
1024
1105
  if (/^\d+$/.test(normalized)) {
1025
1106
  const milliseconds = Number(normalized) * 1e3;
1026
1107
  return Number.isFinite(milliseconds) ? milliseconds : void 0;
@@ -1122,6 +1203,120 @@ async function executeWithRetry(opts) {
1122
1203
 
1123
1204
  // src/http/debug.ts
1124
1205
  var import_node_crypto2 = require("crypto");
1206
+
1207
+ // src/ai-gateway/secret-fields.ts
1208
+ var AI_GATEWAY_REDACTED = "[REDACTED]";
1209
+ var value = (...path) => ({
1210
+ path,
1211
+ redact: "value"
1212
+ });
1213
+ var subtree = (...path) => ({
1214
+ path,
1215
+ redact: "subtree"
1216
+ });
1217
+ var oneTime = (...path) => ({
1218
+ path,
1219
+ redact: "value",
1220
+ oneTime: true
1221
+ });
1222
+ var providerRequestSecrets = [
1223
+ value("key"),
1224
+ value("configurations", "azure_entra_client_secret"),
1225
+ value("configurations", "aws_secret_access_key"),
1226
+ subtree("configurations", "vertex_service_account_json"),
1227
+ value("configurations", "custom_headers", "*")
1228
+ ];
1229
+ var mcpRequestSecrets = [
1230
+ value("configurations", "custom_headers", "*"),
1231
+ value("configurations", "client_secret"),
1232
+ value("configurations", "oauth_client_secret"),
1233
+ subtree("configurations", "oauth_metadata")
1234
+ ];
1235
+ var empty = [];
1236
+ var AI_GATEWAY_SECRET_FIELDS = {
1237
+ "apiKeys.createService": { request: empty, response: [oneTime("key")] },
1238
+ "apiKeys.createUser": { request: empty, response: [oneTime("key")] },
1239
+ "apiKeys.rotateService": { request: empty, response: [oneTime("key")] },
1240
+ "apiKeys.rotateUser": { request: empty, response: [oneTime("key")] },
1241
+ "deployments.create": {
1242
+ request: empty,
1243
+ response: [oneTime("client_auth"), oneTime("credentials", "password")]
1244
+ },
1245
+ "deployments.update": {
1246
+ request: empty,
1247
+ response: [oneTime("client_auth"), oneTime("credentials", "password")]
1248
+ },
1249
+ "integrations.create": { request: providerRequestSecrets, response: empty },
1250
+ "integrations.update": { request: providerRequestSecrets, response: empty },
1251
+ "mcpIntegrations.create": { request: mcpRequestSecrets, response: empty },
1252
+ "mcpIntegrations.update": { request: mcpRequestSecrets, response: empty },
1253
+ "organisations.getAuthSettings": {
1254
+ request: empty,
1255
+ response: [value("scim_token"), value("data", "scim_token")]
1256
+ },
1257
+ "organisations.updateAuthSettings": {
1258
+ request: [value("scim_token"), value("auth_settings", "client_secret")],
1259
+ response: [value("scim_token"), value("data", "scim_token")]
1260
+ },
1261
+ "plugins.create": { request: [value("credentials", "*")], response: empty },
1262
+ "providers.get": {
1263
+ request: empty,
1264
+ response: [
1265
+ value("key"),
1266
+ subtree("model_config"),
1267
+ subtree("credentials"),
1268
+ value("configurations", "azure_entra_client_secret"),
1269
+ value("configurations", "aws_secret_access_key"),
1270
+ subtree("configurations", "vertex_service_account_json"),
1271
+ value("configurations", "custom_headers", "*")
1272
+ ]
1273
+ }
1274
+ };
1275
+ function cloneValue(input, seen = /* @__PURE__ */ new WeakMap()) {
1276
+ if (typeof input !== "object" || input === null) return input;
1277
+ const cached = seen.get(input);
1278
+ if (cached !== void 0) return cached;
1279
+ const output = Array.isArray(input) ? [] : {};
1280
+ seen.set(input, output);
1281
+ if (Array.isArray(input)) {
1282
+ for (const item of input) output.push(cloneValue(item, seen));
1283
+ } else {
1284
+ for (const [key, item] of Object.entries(input)) {
1285
+ Object.defineProperty(output, key, {
1286
+ value: cloneValue(item, seen),
1287
+ enumerable: true,
1288
+ configurable: true,
1289
+ writable: true
1290
+ });
1291
+ }
1292
+ }
1293
+ return output;
1294
+ }
1295
+ function applyRule(current, path, index) {
1296
+ if (index === path.length) return AI_GATEWAY_REDACTED;
1297
+ if (typeof current !== "object" || current === null) return current;
1298
+ const segment = path[index];
1299
+ if (Array.isArray(current)) {
1300
+ if (segment !== "*") return current;
1301
+ for (let i = 0; i < current.length; i++) current[i] = applyRule(current[i], path, index + 1);
1302
+ return current;
1303
+ }
1304
+ const record = current;
1305
+ if (segment === "*") {
1306
+ for (const key of Object.keys(record)) record[key] = applyRule(record[key], path, index + 1);
1307
+ } else if (Object.prototype.hasOwnProperty.call(record, segment)) {
1308
+ record[segment] = applyRule(record[segment], path, index + 1);
1309
+ }
1310
+ return record;
1311
+ }
1312
+ function redactAIGatewaySecrets(operation, input, direction = "request") {
1313
+ const output = cloneValue(input);
1314
+ const metadata = AI_GATEWAY_SECRET_FIELDS[operation];
1315
+ for (const rule of metadata[direction]) applyRule(output, rule.path, 0);
1316
+ return output;
1317
+ }
1318
+
1319
+ // src/http/debug.ts
1125
1320
  var TRUTHY = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
1126
1321
  var SENSITIVE_HEADERS = /* @__PURE__ */ new Set([HEADER_AUTH_TOKEN.toLowerCase(), HEADER_API_KEY.toLowerCase()]);
1127
1322
  var PREFIX = "[airs-sdk]";
@@ -1129,16 +1324,23 @@ function isDebugEnabled() {
1129
1324
  const raw = process.env.PANW_AI_SEC_DEBUG;
1130
1325
  return raw !== void 0 && TRUTHY.has(raw.trim().toLowerCase());
1131
1326
  }
1132
- function hashToken(value) {
1133
- return "sha256:" + (0, import_node_crypto2.createHash)("sha256").update(value).digest("hex").slice(0, 12);
1327
+ function hashToken(value2) {
1328
+ return "sha256:" + (0, import_node_crypto2.createHash)("sha256").update(value2).digest("hex").slice(0, 12);
1134
1329
  }
1135
1330
  function sanitizeHeaders(headers) {
1136
1331
  const out = {};
1137
- for (const [key, value] of Object.entries(headers)) {
1138
- out[key] = SENSITIVE_HEADERS.has(key.toLowerCase()) ? hashToken(value) : value;
1332
+ for (const [key, value2] of Object.entries(headers)) {
1333
+ out[key] = SENSITIVE_HEADERS.has(key.toLowerCase()) ? hashToken(value2) : value2;
1139
1334
  }
1140
1335
  return out;
1141
1336
  }
1337
+ function sanitizeAIGatewayDebugBody(body, operation, direction) {
1338
+ try {
1339
+ return JSON.stringify(redactAIGatewaySecrets(operation, JSON.parse(body), direction));
1340
+ } catch {
1341
+ return "[BODY OMITTED: REDACTION FAILED]";
1342
+ }
1343
+ }
1142
1344
  function logRequest(method, url, headers, body) {
1143
1345
  console.error(`${PREFIX} \u2192 ${method} ${url}`);
1144
1346
  console.error(`${PREFIX} headers ${JSON.stringify(sanitizeHeaders(headers))}`);
@@ -1150,6 +1352,20 @@ function logResponse(status, ms, body) {
1150
1352
 
1151
1353
  // src/http/request.ts
1152
1354
  async function request(spec) {
1355
+ let validatedBody = spec.body;
1356
+ if (spec.requestSchema !== void 0) {
1357
+ const result2 = spec.requestSchema.safeParse(spec.body);
1358
+ if (!result2.success) {
1359
+ const issues = result2.error.issues.map(
1360
+ (issue) => `${issue.path.length > 0 ? issue.path.join(".") : "<root>"}: ${issue.message}`
1361
+ ).join("; ");
1362
+ throw new AISecSDKException(
1363
+ `Request body for ${spec.method} ${spec.path} did not match schema: ${issues}`,
1364
+ "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1365
+ );
1366
+ }
1367
+ validatedBody = result2.data;
1368
+ }
1153
1369
  let hasRetriedAuth = false;
1154
1370
  const debug = isDebugEnabled();
1155
1371
  const response = await executeWithRetry({
@@ -1158,11 +1374,11 @@ async function request(spec) {
1158
1374
  const baseUrl = spec.baseUrl.replace(/\/+$/, "");
1159
1375
  const url = new URL(`${baseUrl}${spec.path}`);
1160
1376
  if (spec.params) {
1161
- for (const [key, value] of Object.entries(spec.params)) {
1162
- if (Array.isArray(value)) {
1163
- for (const v of value) url.searchParams.append(key, v);
1377
+ for (const [key, value2] of Object.entries(spec.params)) {
1378
+ if (Array.isArray(value2)) {
1379
+ for (const v of value2) url.searchParams.append(key, v);
1164
1380
  } else {
1165
- url.searchParams.set(key, value);
1381
+ url.searchParams.set(key, value2);
1166
1382
  }
1167
1383
  }
1168
1384
  }
@@ -1174,16 +1390,19 @@ async function request(spec) {
1174
1390
  let bodyForFetch;
1175
1391
  if (spec.formData !== void 0) {
1176
1392
  bodyForFetch = spec.formData;
1177
- } else if (spec.body !== void 0) {
1393
+ } else if (validatedBody !== void 0) {
1178
1394
  headers["Content-Type"] = spec.contentType ?? "application/json";
1179
- bodyText = JSON.stringify(spec.body);
1395
+ bodyText = JSON.stringify(validatedBody);
1180
1396
  bodyForFetch = bodyText;
1181
1397
  }
1182
1398
  const prepared = { method: spec.method, url, headers, bodyText };
1183
1399
  const final = await spec.auth.prepare(prepared);
1184
1400
  const startedAt = debug ? Date.now() : 0;
1185
1401
  if (debug) {
1186
- const logBody = spec.formData !== void 0 ? "[multipart/form-data]" : final.bodyText;
1402
+ let logBody = spec.formData !== void 0 ? "[multipart/form-data]" : final.bodyText;
1403
+ if (logBody !== void 0 && spec.secretOperation !== void 0) {
1404
+ logBody = sanitizeAIGatewayDebugBody(logBody, spec.secretOperation, "request");
1405
+ }
1187
1406
  logRequest(final.method, final.url.toString(), final.headers, logBody);
1188
1407
  }
1189
1408
  const res = await fetch(final.url.toString(), {
@@ -1195,6 +1414,9 @@ async function request(spec) {
1195
1414
  let respBody;
1196
1415
  try {
1197
1416
  respBody = await res.clone().text();
1417
+ if (respBody && spec.secretOperation !== void 0) {
1418
+ respBody = sanitizeAIGatewayDebugBody(respBody, spec.secretOperation, "response");
1419
+ }
1198
1420
  } catch {
1199
1421
  }
1200
1422
  logResponse(res.status, Date.now() - startedAt, respBody);
@@ -1848,14 +2070,14 @@ var Content = class _Content {
1848
2070
  get prompt() {
1849
2071
  return this._prompt;
1850
2072
  }
1851
- set prompt(value) {
1852
- if (value !== void 0 && Buffer.byteLength(value) > MAX_CONTENT_PROMPT_LENGTH) {
2073
+ set prompt(value2) {
2074
+ if (value2 !== void 0 && Buffer.byteLength(value2) > MAX_CONTENT_PROMPT_LENGTH) {
1853
2075
  throw new AISecSDKException(
1854
2076
  `prompt exceeds max length of ${MAX_CONTENT_PROMPT_LENGTH} bytes`,
1855
2077
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1856
2078
  );
1857
2079
  }
1858
- this._prompt = value;
2080
+ this._prompt = value2;
1859
2081
  }
1860
2082
  /**
1861
2083
  * AI model response text. Setting a value validates its byte length (max 2 MB).
@@ -1870,14 +2092,14 @@ var Content = class _Content {
1870
2092
  get response() {
1871
2093
  return this._response;
1872
2094
  }
1873
- set response(value) {
1874
- if (value !== void 0 && Buffer.byteLength(value) > MAX_CONTENT_RESPONSE_LENGTH) {
2095
+ set response(value2) {
2096
+ if (value2 !== void 0 && Buffer.byteLength(value2) > MAX_CONTENT_RESPONSE_LENGTH) {
1875
2097
  throw new AISecSDKException(
1876
2098
  `response exceeds max length of ${MAX_CONTENT_RESPONSE_LENGTH} bytes`,
1877
2099
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1878
2100
  );
1879
2101
  }
1880
- this._response = value;
2102
+ this._response = value2;
1881
2103
  }
1882
2104
  /**
1883
2105
  * Conversation context. Setting a value validates its byte length (max 100 MB).
@@ -1892,14 +2114,14 @@ var Content = class _Content {
1892
2114
  get context() {
1893
2115
  return this._context;
1894
2116
  }
1895
- set context(value) {
1896
- if (value !== void 0 && Buffer.byteLength(value) > MAX_CONTENT_CONTEXT_LENGTH) {
2117
+ set context(value2) {
2118
+ if (value2 !== void 0 && Buffer.byteLength(value2) > MAX_CONTENT_CONTEXT_LENGTH) {
1897
2119
  throw new AISecSDKException(
1898
2120
  `context exceeds max length of ${MAX_CONTENT_CONTEXT_LENGTH} bytes`,
1899
2121
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1900
2122
  );
1901
2123
  }
1902
- this._context = value;
2124
+ this._context = value2;
1903
2125
  }
1904
2126
  /**
1905
2127
  * Code prompt text. Setting a value validates its byte length (max 2 MB).
@@ -1914,14 +2136,14 @@ var Content = class _Content {
1914
2136
  get codePrompt() {
1915
2137
  return this._codePrompt;
1916
2138
  }
1917
- set codePrompt(value) {
1918
- if (value !== void 0 && Buffer.byteLength(value) > MAX_CONTENT_PROMPT_LENGTH) {
2139
+ set codePrompt(value2) {
2140
+ if (value2 !== void 0 && Buffer.byteLength(value2) > MAX_CONTENT_PROMPT_LENGTH) {
1919
2141
  throw new AISecSDKException(
1920
2142
  `codePrompt exceeds max length of ${MAX_CONTENT_PROMPT_LENGTH} bytes`,
1921
2143
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1922
2144
  );
1923
2145
  }
1924
- this._codePrompt = value;
2146
+ this._codePrompt = value2;
1925
2147
  }
1926
2148
  /**
1927
2149
  * Code response text. Setting a value validates its byte length (max 2 MB).
@@ -1936,14 +2158,14 @@ var Content = class _Content {
1936
2158
  get codeResponse() {
1937
2159
  return this._codeResponse;
1938
2160
  }
1939
- set codeResponse(value) {
1940
- if (value !== void 0 && Buffer.byteLength(value) > MAX_CONTENT_RESPONSE_LENGTH) {
2161
+ set codeResponse(value2) {
2162
+ if (value2 !== void 0 && Buffer.byteLength(value2) > MAX_CONTENT_RESPONSE_LENGTH) {
1941
2163
  throw new AISecSDKException(
1942
2164
  `codeResponse exceeds max length of ${MAX_CONTENT_RESPONSE_LENGTH} bytes`,
1943
2165
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1944
2166
  );
1945
2167
  }
1946
- this._codeResponse = value;
2168
+ this._codeResponse = value2;
1947
2169
  }
1948
2170
  /**
1949
2171
  * Tool/function call event data attached to the content.
@@ -1961,8 +2183,8 @@ var Content = class _Content {
1961
2183
  get toolEvent() {
1962
2184
  return this._toolEvent;
1963
2185
  }
1964
- set toolEvent(value) {
1965
- this._toolEvent = value;
2186
+ set toolEvent(value2) {
2187
+ this._toolEvent = value2;
1966
2188
  }
1967
2189
  /**
1968
2190
  * Total byte length of all text content fields.
@@ -3378,7 +3600,7 @@ var RuleEvaluationListSchema = import_zod32.z.object({
3378
3600
  }).passthrough();
3379
3601
  var ViolationRemediationSchema = import_zod32.z.object({
3380
3602
  steps: import_zod32.z.array(import_zod32.z.string()),
3381
- url: import_zod32.z.string()
3603
+ url: import_zod32.z.string().optional()
3382
3604
  }).passthrough();
3383
3605
  var ViolationResponseSchema = import_zod32.z.object({
3384
3606
  uuid: import_zod32.z.string(),
@@ -3390,7 +3612,7 @@ var ViolationResponseSchema = import_zod32.z.object({
3390
3612
  rule_name: import_zod32.z.string(),
3391
3613
  rule_description: import_zod32.z.string(),
3392
3614
  rule_instance_state: import_zod32.z.string(),
3393
- remediation: ViolationRemediationSchema,
3615
+ remediation: ViolationRemediationSchema.optional(),
3394
3616
  file: import_zod32.z.string().nullable().optional(),
3395
3617
  hash: import_zod32.z.string().nullable().optional(),
3396
3618
  module: import_zod32.z.string().nullable().optional(),
@@ -3442,12 +3664,12 @@ var ListModelSecurityRulesResponseSchema = import_zod32.z.object({
3442
3664
  var ModelSecurityRuleInstanceResponseSchema = import_zod32.z.object({
3443
3665
  uuid: import_zod32.z.string(),
3444
3666
  tsg_id: import_zod32.z.string(),
3445
- created_at: import_zod32.z.string(),
3446
- updated_at: import_zod32.z.string(),
3667
+ created_at: import_zod32.z.string().optional(),
3668
+ updated_at: import_zod32.z.string().optional(),
3447
3669
  security_group_uuid: import_zod32.z.string(),
3448
- security_rule_uuid: import_zod32.z.string(),
3670
+ security_rule_uuid: import_zod32.z.string().optional(),
3449
3671
  state: import_zod32.z.string(),
3450
- rule: ModelSecurityRuleResponseSchema,
3672
+ rule: ModelSecurityRuleResponseSchema.optional(),
3451
3673
  field_values: import_zod32.z.record(import_zod32.z.unknown()).optional()
3452
3674
  }).passthrough();
3453
3675
  var ModelSecurityRuleInstanceUpdateRequestSchema = import_zod32.z.object({
@@ -5436,6 +5658,472 @@ var GatewayAuditLogRecordSchema = import_zod35.z.object({
5436
5658
  }).passthrough();
5437
5659
  var GatewayAuditLogsResponseSchema = import_zod35.z.object({ records: import_zod35.z.array(GatewayAuditLogRecordSchema) }).passthrough();
5438
5660
 
5661
+ // src/models/ai-gateway-routing.ts
5662
+ var import_zod36 = require("zod");
5663
+ var AI_GATEWAY_DEPLOYMENT_TYPES = ["non_production", "production"];
5664
+ var GatewayDeploymentTypeSchema = import_zod36.z.enum(AI_GATEWAY_DEPLOYMENT_TYPES);
5665
+ var AI_GATEWAY_DEPLOYMENT_STATUSES = ["active", "archived"];
5666
+ var GatewayDeploymentStatusSchema = import_zod36.z.enum(AI_GATEWAY_DEPLOYMENT_STATUSES);
5667
+ var AI_GATEWAY_MUTABLE_MCP_CAPABILITY_TYPES = ["prompt", "resource", "tool"];
5668
+ var GatewayMutableMcpCapabilityTypeSchema = import_zod36.z.enum(
5669
+ AI_GATEWAY_MUTABLE_MCP_CAPABILITY_TYPES
5670
+ );
5671
+ var AI_GATEWAY_KNOWN_API_KEY_SCOPES = [
5672
+ "agents.invoke",
5673
+ "completions.write",
5674
+ "logs.write",
5675
+ "mcp.invoke",
5676
+ "prompts.render"
5677
+ ];
5678
+ var AI_GATEWAY_KNOWN_CACHE_MODES = ["semantic", "simple"];
5679
+ var AI_GATEWAY_KNOWN_CONFIG_STRATEGIES = ["fallback", "loadbalance", "single"];
5680
+ var AI_GATEWAY_KNOWN_MCP_AUTH_TYPES = [
5681
+ "headers",
5682
+ "none",
5683
+ "oauth_auto",
5684
+ "oauth_client_credentials"
5685
+ ];
5686
+ var AI_GATEWAY_KNOWN_MCP_TRANSPORTS = ["http", "interactive", "sse"];
5687
+ var AI_GATEWAY_KNOWN_RATE_LIMIT_TYPES = ["requests", "tokens"];
5688
+ var AI_GATEWAY_KNOWN_RATE_LIMIT_UNITS = ["rpd", "rph", "rpm", "rps", "rpw"];
5689
+ var openValue = () => import_zod36.z.string().min(1);
5690
+ var GatewayApiKeyScopeSchema = openValue();
5691
+ var GatewayConfigCacheModeSchema = openValue();
5692
+ var GatewayConfigStrategySchema = openValue();
5693
+ var GatewayMcpAuthTypeSchema = openValue();
5694
+ var GatewayMcpTransportSchema = openValue();
5695
+ var GatewayRateLimitTypeSchema = openValue();
5696
+ var GatewayRateLimitUnitSchema = openValue();
5697
+ var unsafeJsonKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
5698
+ function isFiniteJsonValue(value2, ancestors = /* @__PURE__ */ new WeakSet()) {
5699
+ if (value2 === null || typeof value2 === "string" || typeof value2 === "boolean" || typeof value2 === "number" && Number.isFinite(value2)) {
5700
+ return true;
5701
+ }
5702
+ if (typeof value2 !== "object" || ancestors.has(value2)) return false;
5703
+ if (Array.isArray(value2)) {
5704
+ const keys = Object.keys(value2);
5705
+ if (keys.length !== value2.length || keys.some((key, index) => key !== String(index)) || Object.getOwnPropertySymbols(value2).length > 0) {
5706
+ return false;
5707
+ }
5708
+ ancestors.add(value2);
5709
+ const valid2 = value2.every((item) => isFiniteJsonValue(item, ancestors));
5710
+ ancestors.delete(value2);
5711
+ return valid2;
5712
+ }
5713
+ const prototype = Object.getPrototypeOf(value2);
5714
+ if (prototype !== Object.prototype && prototype !== null) return false;
5715
+ if (Object.getOwnPropertySymbols(value2).length > 0) return false;
5716
+ ancestors.add(value2);
5717
+ const valid = Object.entries(Object.getOwnPropertyDescriptors(value2)).every(
5718
+ ([key, descriptor]) => descriptor.enumerable === true && "value" in descriptor && !unsafeJsonKeys.has(key) && isFiniteJsonValue(descriptor.value, ancestors)
5719
+ );
5720
+ ancestors.delete(value2);
5721
+ return valid;
5722
+ }
5723
+ var GatewayJsonValueSchema = import_zod36.z.custom(
5724
+ (value2) => isFiniteJsonValue(value2),
5725
+ "Expected a finite, prototype-safe JSON value"
5726
+ );
5727
+ var GatewayJsonObjectSchema = import_zod36.z.custom(
5728
+ (value2) => typeof value2 === "object" && value2 !== null && !Array.isArray(value2) && isFiniteJsonValue(value2),
5729
+ "Expected a finite, prototype-safe JSON object"
5730
+ );
5731
+ var GatewayRoutingRetrySchema = import_zod36.z.object({
5732
+ attempts: import_zod36.z.number().int().min(0).optional(),
5733
+ on_status_codes: import_zod36.z.array(import_zod36.z.number().int().min(100).max(599)).optional()
5734
+ }).catchall(GatewayJsonValueSchema);
5735
+ var GatewayRoutingCacheSchema = import_zod36.z.object({
5736
+ mode: GatewayConfigCacheModeSchema.optional(),
5737
+ max_age: import_zod36.z.number().int().min(0).optional()
5738
+ }).catchall(GatewayJsonValueSchema);
5739
+ var GatewayRoutingStrategySchema = import_zod36.z.object({ mode: GatewayConfigStrategySchema }).catchall(GatewayJsonValueSchema);
5740
+ var GatewayRoutingTargetSchema = import_zod36.z.object({
5741
+ provider: import_zod36.z.string().min(1).optional(),
5742
+ virtual_key: import_zod36.z.string().min(1).optional()
5743
+ }).catchall(GatewayJsonValueSchema);
5744
+ var GatewayRoutingConfigSchema = import_zod36.z.object({
5745
+ retry: GatewayRoutingRetrySchema.optional(),
5746
+ cache: GatewayRoutingCacheSchema.optional(),
5747
+ strategy: GatewayRoutingStrategySchema.optional(),
5748
+ targets: import_zod36.z.array(GatewayRoutingTargetSchema).optional(),
5749
+ provider: import_zod36.z.string().min(1).optional(),
5750
+ virtual_key: import_zod36.z.string().min(1).optional()
5751
+ }).catchall(GatewayJsonValueSchema);
5752
+ var GatewayOpenAIConfigurationSchema = import_zod36.z.object({
5753
+ openai_organization: import_zod36.z.string().min(1).optional(),
5754
+ openai_project: import_zod36.z.string().min(1).optional()
5755
+ }).catchall(GatewayJsonValueSchema);
5756
+ var GatewayAzureDeploymentConfigurationSchema = import_zod36.z.object({
5757
+ alias: import_zod36.z.string().min(1).optional(),
5758
+ azure_api_version: import_zod36.z.string().min(1).max(30),
5759
+ azure_deployment_name: import_zod36.z.string().min(1),
5760
+ is_default: import_zod36.z.boolean().optional(),
5761
+ azure_model_slug: import_zod36.z.string().min(1)
5762
+ }).catchall(GatewayJsonValueSchema);
5763
+ var azureAuthModeSchema = import_zod36.z.enum(["default", "entra", "managed"]);
5764
+ var GatewayAzureOpenAIConfigurationSchema = import_zod36.z.object({
5765
+ azure_auth_mode: azureAuthModeSchema,
5766
+ azure_resource_name: import_zod36.z.string().min(1),
5767
+ azure_deployment_config: import_zod36.z.array(GatewayAzureDeploymentConfigurationSchema).min(1),
5768
+ azure_entra_tenant_id: import_zod36.z.string().min(1).optional(),
5769
+ azure_entra_client_id: import_zod36.z.string().min(1).optional(),
5770
+ azure_entra_client_secret: import_zod36.z.string().min(1).optional(),
5771
+ azure_managed_client_id: import_zod36.z.string().min(1).optional()
5772
+ }).catchall(GatewayJsonValueSchema);
5773
+ var GatewayBedrockConfigurationSchema = import_zod36.z.object({
5774
+ aws_auth_type: import_zod36.z.enum(["accessKey", "assumedRole"]),
5775
+ aws_region: import_zod36.z.string().min(1),
5776
+ aws_access_key_id: import_zod36.z.string().min(1).optional(),
5777
+ aws_secret_access_key: import_zod36.z.string().min(1).optional(),
5778
+ aws_role_arn: import_zod36.z.string().min(1).optional(),
5779
+ aws_external_id: import_zod36.z.string().min(1).nullable().optional()
5780
+ }).catchall(GatewayJsonValueSchema);
5781
+ var GatewaySageMakerConfigurationSchema = GatewayBedrockConfigurationSchema.extend({
5782
+ amzn_sagemaker_custom_attributes: import_zod36.z.string().optional(),
5783
+ amzn_sagemaker_target_model: import_zod36.z.string().optional(),
5784
+ amzn_sagemaker_target_variant: import_zod36.z.string().optional(),
5785
+ amzn_sagemaker_target_container_hostname: import_zod36.z.string().optional(),
5786
+ amzn_sagemaker_inference_id: import_zod36.z.string().optional(),
5787
+ amzn_sagemaker_enable_explanations: import_zod36.z.string().optional(),
5788
+ amzn_sagemaker_inference_component: import_zod36.z.string().optional(),
5789
+ amzn_sagemaker_session_id: import_zod36.z.string().optional(),
5790
+ amzn_sagemaker_model_name: import_zod36.z.string().optional()
5791
+ }).catchall(GatewayJsonValueSchema);
5792
+ var GatewayVertexAIConfigurationSchema = import_zod36.z.object({
5793
+ vertex_auth_type: import_zod36.z.enum(["basic", "serviceAccount"]),
5794
+ vertex_region: import_zod36.z.string().min(1),
5795
+ vertex_project_id: import_zod36.z.string().min(1).optional(),
5796
+ vertex_service_account_json: GatewayJsonObjectSchema.optional()
5797
+ }).catchall(GatewayJsonValueSchema);
5798
+ var GatewayAzureAIConfigurationSchema = import_zod36.z.object({
5799
+ azure_auth_mode: azureAuthModeSchema,
5800
+ azure_foundry_url: import_zod36.z.string().url(),
5801
+ azure_api_version: import_zod36.z.string().min(1).max(30).optional(),
5802
+ azure_deployment_name: import_zod36.z.string().min(1).optional(),
5803
+ azure_entra_tenant_id: import_zod36.z.string().min(1).optional(),
5804
+ azure_entra_client_id: import_zod36.z.string().min(1).optional(),
5805
+ azure_entra_client_secret: import_zod36.z.string().min(1).optional(),
5806
+ azure_managed_client_id: import_zod36.z.string().min(1).optional()
5807
+ }).catchall(GatewayJsonValueSchema);
5808
+ var GatewayWorkersAIConfigurationSchema = import_zod36.z.object({ workers_ai_account_id: import_zod36.z.string().min(1) }).catchall(GatewayJsonValueSchema);
5809
+ var GatewayHuggingFaceConfigurationSchema = import_zod36.z.object({ huggingface_base_url: import_zod36.z.string().url().optional() }).catchall(GatewayJsonValueSchema);
5810
+ var GatewayCortexConfigurationSchema = import_zod36.z.object({ snowflake_account: import_zod36.z.string().min(1) }).catchall(GatewayJsonValueSchema);
5811
+ var GatewayCustomHostConfigurationSchema = import_zod36.z.object({
5812
+ custom_host: import_zod36.z.string().url().optional(),
5813
+ custom_headers: import_zod36.z.record(import_zod36.z.string()).optional()
5814
+ }).catchall(GatewayJsonValueSchema);
5815
+
5816
+ // src/models/ai-gateway-requests.ts
5817
+ var import_zod37 = require("zod");
5818
+ var nonEmptyString = import_zod37.z.string().min(1);
5819
+ var uuid = import_zod37.z.string().uuid();
5820
+ var numericId = import_zod37.z.string().regex(/^\d+$/, "Expected a numeric-string TSG id");
5821
+ var workspaceRef = import_zod37.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/);
5822
+ var dateTime = import_zod37.z.string().datetime({ offset: true });
5823
+ var nonEmptyObject = (schema, message = "Provide at least one field") => schema.refine((body) => Object.keys(body).length > 0, { message });
5824
+ var GatewayRateLimitInputSchema = import_zod37.z.object({
5825
+ type: GatewayRateLimitTypeSchema,
5826
+ unit: GatewayRateLimitUnitSchema,
5827
+ value: import_zod37.z.number().int().min(0)
5828
+ }).strict();
5829
+ var GatewayUsageLimitInputSchema = nonEmptyObject(
5830
+ import_zod37.z.object({
5831
+ credit_limit: import_zod37.z.number().min(0).optional(),
5832
+ type: import_zod37.z.enum(["cost", "tokens"]).optional(),
5833
+ alert_threshold: import_zod37.z.number().min(0).optional(),
5834
+ periodic_reset: import_zod37.z.enum(["monthly", "weekly"]).nullable().optional(),
5835
+ periodic_reset_days: import_zod37.z.number().int().min(1).max(365).nullable().optional(),
5836
+ next_usage_reset_at: dateTime.nullable().optional()
5837
+ }).strict()
5838
+ ).refine(
5839
+ (value2) => value2.periodic_reset == null || value2.periodic_reset_days == null,
5840
+ "periodic_reset and periodic_reset_days are mutually exclusive"
5841
+ );
5842
+ var GatewayDefaultsInputSchema = import_zod37.z.object({
5843
+ metadata: import_zod37.z.record(GatewayJsonValueSchema).optional(),
5844
+ config_id: nonEmptyString.optional(),
5845
+ allow_config_override: import_zod37.z.boolean().optional()
5846
+ }).catchall(GatewayJsonValueSchema);
5847
+ var GatewaySecretMappingSchema = import_zod37.z.object({
5848
+ target_field: nonEmptyString,
5849
+ secret_reference_id: nonEmptyString,
5850
+ secret_key: nonEmptyString.nullable().optional(),
5851
+ value_format: import_zod37.z.enum(["json", "string"]).nullable().optional()
5852
+ }).strict();
5853
+ var GatewayGlobalWorkspaceAccessInputSchema = import_zod37.z.object({
5854
+ enabled: import_zod37.z.boolean(),
5855
+ usage_limits: import_zod37.z.array(GatewayUsageLimitInputSchema).max(1).nullable().optional(),
5856
+ rate_limits: import_zod37.z.array(GatewayRateLimitInputSchema).max(1).nullable().optional()
5857
+ }).strict();
5858
+ var GatewayWorkspaceBindingSchema = import_zod37.z.object({
5859
+ id: workspaceRef,
5860
+ enabled: import_zod37.z.boolean(),
5861
+ usage_limits: import_zod37.z.array(GatewayUsageLimitInputSchema).max(1).nullable().optional(),
5862
+ rate_limits: import_zod37.z.array(GatewayRateLimitInputSchema).max(1).nullable().optional(),
5863
+ reset_usage: import_zod37.z.boolean().optional(),
5864
+ create_default_provider: import_zod37.z.boolean().optional(),
5865
+ default_provider_slug: nonEmptyString.optional()
5866
+ }).strict();
5867
+ var GatewayWorkspaceCreateRequestSchema = import_zod37.z.object({
5868
+ name: nonEmptyString,
5869
+ scope_name: nonEmptyString,
5870
+ description: import_zod37.z.string().optional(),
5871
+ icon: import_zod37.z.string().optional(),
5872
+ defaults: GatewayDefaultsInputSchema.optional(),
5873
+ users: import_zod37.z.array(nonEmptyString).optional(),
5874
+ usage_limits: import_zod37.z.array(GatewayUsageLimitInputSchema).optional(),
5875
+ rate_limits: import_zod37.z.array(GatewayRateLimitInputSchema).optional()
5876
+ }).strict();
5877
+ var GatewayWorkspaceUpdateRequestSchema = nonEmptyObject(
5878
+ import_zod37.z.object({
5879
+ name: nonEmptyString.optional(),
5880
+ description: import_zod37.z.string().optional(),
5881
+ icon: import_zod37.z.string().optional(),
5882
+ defaults: GatewayDefaultsInputSchema.optional(),
5883
+ usage_limits: import_zod37.z.array(GatewayUsageLimitInputSchema).optional(),
5884
+ rate_limits: import_zod37.z.array(GatewayRateLimitInputSchema).optional()
5885
+ }).strict()
5886
+ );
5887
+ var GatewayConfigCreateRequestSchema = import_zod37.z.object({
5888
+ name: nonEmptyString,
5889
+ workspace_id: uuid,
5890
+ config: GatewayRoutingConfigSchema
5891
+ }).strict();
5892
+ var GatewayConfigUpdateRequestSchema = nonEmptyObject(
5893
+ import_zod37.z.object({
5894
+ name: nonEmptyString.optional(),
5895
+ workspace_id: uuid.optional(),
5896
+ config: GatewayRoutingConfigSchema.optional(),
5897
+ status: nonEmptyString.optional()
5898
+ }).strict()
5899
+ );
5900
+ var GatewayGuardrailCheckSchema = import_zod37.z.object({
5901
+ id: nonEmptyString,
5902
+ parameters: GatewayJsonObjectSchema.optional(),
5903
+ is_enabled: import_zod37.z.boolean().optional(),
5904
+ name: nonEmptyString.optional()
5905
+ }).strict();
5906
+ var feedbackSchema = import_zod37.z.object({
5907
+ value: import_zod37.z.number(),
5908
+ weight: import_zod37.z.number(),
5909
+ metadata: import_zod37.z.string()
5910
+ }).catchall(GatewayJsonValueSchema);
5911
+ var actionResultSchema = import_zod37.z.object({ feedback: feedbackSchema.optional() }).catchall(GatewayJsonValueSchema);
5912
+ var GatewayGuardrailActionsSchema = nonEmptyObject(
5913
+ import_zod37.z.object({
5914
+ deny: import_zod37.z.boolean().optional(),
5915
+ async: import_zod37.z.boolean().optional(),
5916
+ on_success: actionResultSchema.optional(),
5917
+ on_fail: actionResultSchema.optional()
5918
+ }).catchall(GatewayJsonValueSchema)
5919
+ );
5920
+ var GatewayGuardrailCreateRequestSchema = import_zod37.z.object({
5921
+ workspace_id: uuid,
5922
+ name: nonEmptyString,
5923
+ checks: import_zod37.z.array(GatewayGuardrailCheckSchema).min(1),
5924
+ actions: GatewayGuardrailActionsSchema
5925
+ }).strict();
5926
+ var GatewayGuardrailUpdateRequestSchema = nonEmptyObject(
5927
+ import_zod37.z.object({
5928
+ name: nonEmptyString.optional(),
5929
+ checks: import_zod37.z.array(GatewayGuardrailCheckSchema).min(1).optional(),
5930
+ actions: GatewayGuardrailActionsSchema.optional()
5931
+ }).strict()
5932
+ );
5933
+ var GatewayProviderCreateRequestSchema = import_zod37.z.object({
5934
+ workspace_id: uuid,
5935
+ ai_provider_id: uuid,
5936
+ name: nonEmptyString,
5937
+ integration_id: uuid,
5938
+ slug: nonEmptyString,
5939
+ note: import_zod37.z.string().nullable().optional(),
5940
+ usage_limits: GatewayUsageLimitInputSchema.nullable().optional(),
5941
+ rate_limits: GatewayRateLimitInputSchema.nullable().optional(),
5942
+ expires_at: dateTime.nullable().optional()
5943
+ }).strict();
5944
+ var GatewayProviderUpdateRequestSchema = nonEmptyObject(
5945
+ import_zod37.z.object({
5946
+ name: nonEmptyString.optional(),
5947
+ note: import_zod37.z.string().nullable().optional(),
5948
+ usage_limits: GatewayUsageLimitInputSchema.nullable().optional(),
5949
+ rate_limits: GatewayRateLimitInputSchema.nullable().optional(),
5950
+ expires_at: dateTime.nullable().optional(),
5951
+ reset_usage: import_zod37.z.boolean().optional()
5952
+ }).strict()
5953
+ );
5954
+ var GatewayApiKeyRotationPolicySchema = nonEmptyObject(
5955
+ import_zod37.z.object({
5956
+ rotation_period: import_zod37.z.enum(["monthly", "weekly"]).nullable().optional(),
5957
+ next_rotation_at: dateTime.nullable().optional(),
5958
+ key_transition_period_ms: import_zod37.z.number().int().min(18e5).optional()
5959
+ }).strict()
5960
+ ).refine(
5961
+ (value2) => value2.rotation_period == null || value2.next_rotation_at == null,
5962
+ "rotation_period and next_rotation_at are mutually exclusive"
5963
+ );
5964
+ var apiKeyMutableFields = {
5965
+ name: nonEmptyString,
5966
+ description: import_zod37.z.string().optional(),
5967
+ scopes: import_zod37.z.array(GatewayApiKeyScopeSchema).min(1),
5968
+ rate_limits: import_zod37.z.array(GatewayRateLimitInputSchema).nullable().optional(),
5969
+ usage_limits: GatewayUsageLimitInputSchema.nullable().optional(),
5970
+ defaults: GatewayDefaultsInputSchema.nullable().optional(),
5971
+ alert_emails: import_zod37.z.array(import_zod37.z.string().email()).optional(),
5972
+ expires_at: dateTime.nullable().optional(),
5973
+ rotation_policy: GatewayApiKeyRotationPolicySchema.nullable().optional()
5974
+ };
5975
+ var serviceApiKeyCreateFields = {
5976
+ ...apiKeyMutableFields,
5977
+ organisation_id: numericId,
5978
+ workspace_id: uuid,
5979
+ type: nonEmptyString
5980
+ };
5981
+ var GatewayServiceApiKeyCreateRequestSchema = import_zod37.z.object(serviceApiKeyCreateFields).strict();
5982
+ var GatewayUserApiKeyCreateRequestSchema = import_zod37.z.object({ ...serviceApiKeyCreateFields, user_id: uuid }).strict();
5983
+ var GatewayApiKeyCreateRequestSchema = import_zod37.z.union([
5984
+ GatewayUserApiKeyCreateRequestSchema,
5985
+ GatewayServiceApiKeyCreateRequestSchema
5986
+ ]);
5987
+ var GatewayApiKeyUpdateRequestSchema = nonEmptyObject(
5988
+ import_zod37.z.object({
5989
+ name: nonEmptyString.optional(),
5990
+ description: import_zod37.z.string().optional(),
5991
+ scopes: import_zod37.z.array(GatewayApiKeyScopeSchema).min(1).optional(),
5992
+ rate_limits: import_zod37.z.array(GatewayRateLimitInputSchema).nullable().optional(),
5993
+ usage_limits: GatewayUsageLimitInputSchema.nullable().optional(),
5994
+ reset_usage: import_zod37.z.boolean().optional(),
5995
+ defaults: GatewayDefaultsInputSchema.nullable().optional(),
5996
+ alert_emails: import_zod37.z.array(import_zod37.z.string().email()).optional(),
5997
+ expires_at: dateTime.nullable().optional(),
5998
+ rotation_policy: GatewayApiKeyRotationPolicySchema.nullable().optional()
5999
+ }).strict()
6000
+ );
6001
+ var GatewayApiKeyRotateRequestSchema = import_zod37.z.object({ key_transition_period_ms: import_zod37.z.number().int().min(18e5).optional() }).strict();
6002
+ var GatewayIntegrationCreateRequestSchema = import_zod37.z.object({
6003
+ organisation_id: numericId,
6004
+ ai_provider_id: uuid,
6005
+ name: nonEmptyString,
6006
+ slug: nonEmptyString,
6007
+ description: import_zod37.z.string().optional(),
6008
+ configurations: GatewayJsonObjectSchema.optional(),
6009
+ key: nonEmptyString.optional(),
6010
+ secret_mappings: import_zod37.z.array(GatewaySecretMappingSchema).optional()
6011
+ }).strict();
6012
+ var GatewayIntegrationUpdateRequestSchema = nonEmptyObject(
6013
+ import_zod37.z.object({
6014
+ name: nonEmptyString.optional(),
6015
+ description: import_zod37.z.string().optional(),
6016
+ configurations: GatewayJsonObjectSchema.optional(),
6017
+ key: nonEmptyString.optional(),
6018
+ secret_mappings: import_zod37.z.array(GatewaySecretMappingSchema).optional()
6019
+ }).strict()
6020
+ );
6021
+ var GatewayIntegrationModelUpdateSchema = import_zod37.z.object({
6022
+ slug: nonEmptyString,
6023
+ enabled: import_zod37.z.boolean(),
6024
+ is_custom: import_zod37.z.boolean().nullable().optional(),
6025
+ is_finetune: import_zod37.z.boolean().nullable().optional(),
6026
+ base_model_slug: nonEmptyString.nullable().optional(),
6027
+ configurations: GatewayJsonObjectSchema.optional(),
6028
+ pricing_config: GatewayJsonObjectSchema.optional()
6029
+ }).strict();
6030
+ var GatewayIntegrationModelsBulkUpdateRequestSchema = import_zod37.z.object({
6031
+ models: import_zod37.z.array(GatewayIntegrationModelUpdateSchema).min(1),
6032
+ allow_all_models: import_zod37.z.boolean().optional()
6033
+ }).strict();
6034
+ var GatewayIntegrationWorkspacesBulkUpdateRequestSchema = nonEmptyObject(
6035
+ import_zod37.z.object({
6036
+ workspaces: import_zod37.z.array(GatewayWorkspaceBindingSchema).optional(),
6037
+ global_workspace_access: GatewayGlobalWorkspaceAccessInputSchema.optional(),
6038
+ override_existing_workspace_access: import_zod37.z.boolean().optional(),
6039
+ create_default_provider: import_zod37.z.boolean().optional(),
6040
+ default_provider_slug: nonEmptyString.optional()
6041
+ }).strict()
6042
+ );
6043
+ var McpIntegrationCreateRequestSchema = import_zod37.z.object({
6044
+ name: nonEmptyString,
6045
+ organisation_id: numericId,
6046
+ slug: nonEmptyString,
6047
+ url: import_zod37.z.string().url(),
6048
+ auth_type: GatewayMcpAuthTypeSchema,
6049
+ transport: GatewayMcpTransportSchema,
6050
+ description: import_zod37.z.string().nullable().optional(),
6051
+ configurations: GatewayJsonObjectSchema.optional(),
6052
+ secret_mappings: import_zod37.z.array(GatewaySecretMappingSchema).optional()
6053
+ }).strict();
6054
+ var McpIntegrationUpdateRequestSchema = nonEmptyObject(
6055
+ import_zod37.z.object({
6056
+ name: nonEmptyString.optional(),
6057
+ description: import_zod37.z.string().nullable().optional(),
6058
+ configurations: GatewayJsonObjectSchema.optional(),
6059
+ url: import_zod37.z.string().url().optional(),
6060
+ auth_type: GatewayMcpAuthTypeSchema.optional(),
6061
+ transport: GatewayMcpTransportSchema.optional(),
6062
+ secret_mappings: import_zod37.z.array(GatewaySecretMappingSchema).optional()
6063
+ }).strict()
6064
+ );
6065
+ var McpIntegrationCapabilityUpdateSchema = import_zod37.z.object({
6066
+ name: nonEmptyString,
6067
+ type: GatewayMutableMcpCapabilityTypeSchema,
6068
+ enabled: import_zod37.z.boolean()
6069
+ }).strict();
6070
+ var McpIntegrationCapabilitiesBulkUpdateRequestSchema = import_zod37.z.object({ capabilities: import_zod37.z.array(McpIntegrationCapabilityUpdateSchema).min(1) }).strict();
6071
+ var McpIntegrationWorkspacesBulkUpdateRequestSchema = nonEmptyObject(
6072
+ import_zod37.z.object({
6073
+ workspaces: import_zod37.z.array(import_zod37.z.object({ id: workspaceRef, enabled: import_zod37.z.boolean() }).strict()).optional(),
6074
+ global_workspace_access: import_zod37.z.object({ enabled: import_zod37.z.boolean() }).strict().nullable().optional(),
6075
+ override_existing_workspace_access: import_zod37.z.boolean().optional()
6076
+ }).strict()
6077
+ );
6078
+ var GatewayDeploymentAuthSettingsInputSchema = import_zod37.z.object({
6079
+ gateway_base_url: import_zod37.z.string().url().optional(),
6080
+ mcp_gateway_base_url: import_zod37.z.string().url().optional(),
6081
+ is_dataservice_hosted: import_zod37.z.union([import_zod37.z.literal(0), import_zod37.z.literal(1)]).optional(),
6082
+ is_playground_proxy_allowed: import_zod37.z.union([import_zod37.z.literal(0), import_zod37.z.literal(1)]).optional(),
6083
+ workspaces_allowed: import_zod37.z.array(workspaceRef).optional(),
6084
+ jwt_subs_allowed: import_zod37.z.array(nonEmptyString).optional(),
6085
+ jwt_sub_workspace_mapping: import_zod37.z.record(workspaceRef).optional(),
6086
+ allow_all_workspaces: import_zod37.z.boolean().optional(),
6087
+ remove_workspaces_allowed: import_zod37.z.array(workspaceRef).optional(),
6088
+ remove_subs_allowed: import_zod37.z.array(nonEmptyString).optional()
6089
+ }).strict();
6090
+ var GatewayDeploymentCreateRequestSchema = import_zod37.z.object({
6091
+ name: nonEmptyString,
6092
+ type: GatewayDeploymentTypeSchema,
6093
+ organisation_id: numericId,
6094
+ auth_settings: GatewayDeploymentAuthSettingsInputSchema.optional(),
6095
+ deployment_config: GatewayJsonObjectSchema.optional(),
6096
+ is_default: import_zod37.z.boolean().optional(),
6097
+ slug: nonEmptyString.optional()
6098
+ }).strict();
6099
+ var GatewayDeploymentUpdateRequestSchema = nonEmptyObject(
6100
+ import_zod37.z.object({
6101
+ name: nonEmptyString.optional(),
6102
+ type: GatewayDeploymentTypeSchema.optional(),
6103
+ status: GatewayDeploymentStatusSchema.optional(),
6104
+ deployment_config: GatewayJsonObjectSchema.nullable().optional(),
6105
+ is_default: import_zod37.z.boolean().optional(),
6106
+ rotate_auth: import_zod37.z.boolean().optional(),
6107
+ override_existing: import_zod37.z.boolean().optional(),
6108
+ auth_settings: GatewayDeploymentAuthSettingsInputSchema.optional()
6109
+ }).strict()
6110
+ );
6111
+ var GatewayPluginCreateRequestSchema = import_zod37.z.object({
6112
+ organisation_id: numericId,
6113
+ integration_id: uuid,
6114
+ credentials: import_zod37.z.record(import_zod37.z.string().min(1)).refine((value2) => Object.keys(value2).length > 0)
6115
+ }).strict();
6116
+ var GatewayOrganisationUpdateRequestSchema = nonEmptyObject(
6117
+ import_zod37.z.object({ name: nonEmptyString.optional() }).catchall(GatewayJsonValueSchema)
6118
+ );
6119
+ var GatewayOrganisationAuthSettingsUpdateRequestSchema = nonEmptyObject(
6120
+ import_zod37.z.object({
6121
+ auth_settings: GatewayJsonObjectSchema.optional(),
6122
+ domains: import_zod37.z.array(nonEmptyString).optional(),
6123
+ scim_token: nonEmptyString.optional()
6124
+ }).catchall(GatewayJsonValueSchema)
6125
+ );
6126
+
5439
6127
  // src/http/auth/oauth.ts
5440
6128
  var OAuthAuth = class {
5441
6129
  constructor(oauthClient) {
@@ -5458,12 +6146,12 @@ var OAuthAuth = class {
5458
6146
  };
5459
6147
 
5460
6148
  // src/models/oauth-token.ts
5461
- var import_zod36 = require("zod");
5462
- var OAuthTokenResponseSchema = import_zod36.z.object({
5463
- access_token: import_zod36.z.string(),
5464
- token_type: import_zod36.z.string().optional(),
5465
- expires_in: import_zod36.z.number(),
5466
- scope: import_zod36.z.string().optional()
6149
+ var import_zod38 = require("zod");
6150
+ var OAuthTokenResponseSchema = import_zod38.z.object({
6151
+ access_token: import_zod38.z.string(),
6152
+ token_type: import_zod38.z.string().optional(),
6153
+ expires_in: import_zod38.z.number(),
6154
+ scope: import_zod38.z.string().optional()
5467
6155
  }).passthrough();
5468
6156
 
5469
6157
  // src/management/oauth-client.ts
@@ -5681,26 +6369,26 @@ function resolveOAuthConfig(opts) {
5681
6369
  }
5682
6370
 
5683
6371
  // src/validators.ts
5684
- function assertUuid(value, fieldName) {
5685
- if (!isValidUuid(value)) {
6372
+ function assertUuid(value2, fieldName) {
6373
+ if (!isValidUuid(value2)) {
5686
6374
  throw new AISecSDKException(
5687
- `Invalid ${fieldName}: ${value}`,
6375
+ `Invalid ${fieldName}: ${value2}`,
5688
6376
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5689
6377
  );
5690
6378
  }
5691
6379
  }
5692
- function assertWorkspaceRef(value, fieldName) {
5693
- if (!isValidUuid(value) && !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) {
6380
+ function assertWorkspaceRef(value2, fieldName) {
6381
+ if (!isValidUuid(value2) && !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value2)) {
5694
6382
  throw new AISecSDKException(
5695
- `Invalid ${fieldName}: ${value} (expected a workspace UUID or slug)`,
6383
+ `Invalid ${fieldName}: ${value2} (expected a workspace UUID or slug)`,
5696
6384
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5697
6385
  );
5698
6386
  }
5699
6387
  }
5700
- function assertNumericId(value, fieldName) {
5701
- if (!/^\d+$/.test(value)) {
6388
+ function assertNumericId(value2, fieldName) {
6389
+ if (!/^\d+$/.test(value2)) {
5702
6390
  throw new AISecSDKException(
5703
- `Invalid ${fieldName}: ${value}`,
6391
+ `Invalid ${fieldName}: ${value2}`,
5704
6392
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5705
6393
  );
5706
6394
  }
@@ -6569,7 +7257,7 @@ var ScanLogsClient = class {
6569
7257
  };
6570
7258
 
6571
7259
  // src/management/oauth-management.ts
6572
- var import_zod37 = require("zod");
7260
+ var import_zod39 = require("zod");
6573
7261
  var OAuthManagementClient = class {
6574
7262
  baseUrl;
6575
7263
  auth;
@@ -6603,7 +7291,7 @@ var OAuthManagementClient = class {
6603
7291
  path: MGMT_OAUTH_INVALIDATE_PATH,
6604
7292
  params: { token },
6605
7293
  body,
6606
- responseSchema: import_zod37.z.string(),
7294
+ responseSchema: import_zod39.z.string(),
6607
7295
  auth: this.auth,
6608
7296
  numRetries: this.numRetries
6609
7297
  });
@@ -7667,12 +8355,12 @@ var ModelSecurityScansClient = class {
7667
8355
  * // { uuid: '550e8400-...', eval_outcome: 'ALLOWED', model_uri: 'hf://org/model', ... }
7668
8356
  * ```
7669
8357
  */
7670
- async get(uuid) {
7671
- assertUuid(uuid, "scan uuid");
8358
+ async get(uuid2) {
8359
+ assertUuid(uuid2, "scan uuid");
7672
8360
  return request({
7673
8361
  method: "GET",
7674
8362
  baseUrl: this.baseUrl,
7675
- path: `${MODEL_SEC_SCANS_PATH}/${uuid}`,
8363
+ path: `${MODEL_SEC_SCANS_PATH}/${uuid2}`,
7676
8364
  responseSchema: ScanBaseResponseSchema,
7677
8365
  auth: this.auth,
7678
8366
  numRetries: this.numRetries
@@ -7909,12 +8597,12 @@ var ModelSecurityScansClient = class {
7909
8597
  * // { uuid: '660e8400-...', rule_name: 'Pickle Scan', result: 'FAILED', violation_count: 2, ... }
7910
8598
  * ```
7911
8599
  */
7912
- async getEvaluation(uuid) {
7913
- assertUuid(uuid, "evaluation uuid");
8600
+ async getEvaluation(uuid2) {
8601
+ assertUuid(uuid2, "evaluation uuid");
7914
8602
  return request({
7915
8603
  method: "GET",
7916
8604
  baseUrl: this.baseUrl,
7917
- path: `${MODEL_SEC_EVALUATIONS_PATH}/${uuid}`,
8605
+ path: `${MODEL_SEC_EVALUATIONS_PATH}/${uuid2}`,
7918
8606
  responseSchema: RuleEvaluationResponseSchema,
7919
8607
  auth: this.auth,
7920
8608
  numRetries: this.numRetries
@@ -7934,12 +8622,12 @@ var ModelSecurityScansClient = class {
7934
8622
  * // { uuid: '660e8400-...', rule_name: 'Pickle Scan', description: 'Unsafe pickle opcode', ... }
7935
8623
  * ```
7936
8624
  */
7937
- async getViolation(uuid) {
7938
- assertUuid(uuid, "violation uuid");
8625
+ async getViolation(uuid2) {
8626
+ assertUuid(uuid2, "violation uuid");
7939
8627
  return request({
7940
8628
  method: "GET",
7941
8629
  baseUrl: this.baseUrl,
7942
- path: `${MODEL_SEC_VIOLATIONS_PATH}/${uuid}`,
8630
+ path: `${MODEL_SEC_VIOLATIONS_PATH}/${uuid2}`,
7943
8631
  responseSchema: ViolationResponseSchema,
7944
8632
  auth: this.auth,
7945
8633
  numRetries: this.numRetries
@@ -8052,12 +8740,12 @@ var ModelSecurityGroupsClient = class {
8052
8740
  * // { uuid: '550e8400-...', name: 'hf-strict', source_type: 'HUGGING_FACE', state: 'ACTIVE', ... }
8053
8741
  * ```
8054
8742
  */
8055
- async get(uuid) {
8056
- assertUuid(uuid, "security group uuid");
8743
+ async get(uuid2) {
8744
+ assertUuid(uuid2, "security group uuid");
8057
8745
  return request({
8058
8746
  method: "GET",
8059
8747
  baseUrl: this.baseUrl,
8060
- path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
8748
+ path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid2}`,
8061
8749
  responseSchema: ModelSecurityGroupResponseSchema,
8062
8750
  auth: this.auth,
8063
8751
  numRetries: this.numRetries
@@ -8081,12 +8769,12 @@ var ModelSecurityGroupsClient = class {
8081
8769
  * // { uuid: '550e8400-...', name: 'hf-strict-v2', state: 'ACTIVE', ... }
8082
8770
  * ```
8083
8771
  */
8084
- async update(uuid, body) {
8085
- assertUuid(uuid, "security group uuid");
8772
+ async update(uuid2, body) {
8773
+ assertUuid(uuid2, "security group uuid");
8086
8774
  return request({
8087
8775
  method: "PUT",
8088
8776
  baseUrl: this.baseUrl,
8089
- path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
8777
+ path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid2}`,
8090
8778
  body,
8091
8779
  responseSchema: ModelSecurityGroupResponseSchema,
8092
8780
  auth: this.auth,
@@ -8106,12 +8794,12 @@ var ModelSecurityGroupsClient = class {
8106
8794
  * // resolves to undefined on success
8107
8795
  * ```
8108
8796
  */
8109
- async delete(uuid) {
8110
- assertUuid(uuid, "security group uuid");
8797
+ async delete(uuid2) {
8798
+ assertUuid(uuid2, "security group uuid");
8111
8799
  await request({
8112
8800
  method: "DELETE",
8113
8801
  baseUrl: this.baseUrl,
8114
- path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
8802
+ path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid2}`,
8115
8803
  auth: this.auth,
8116
8804
  numRetries: this.numRetries
8117
8805
  });
@@ -8274,12 +8962,12 @@ var ModelSecurityRulesClient = class {
8274
8962
  * // { uuid: '550e8400-...', name: 'Pickle Scan', rule_type: 'ARTIFACT', default_state: 'BLOCKING', ... }
8275
8963
  * ```
8276
8964
  */
8277
- async get(uuid) {
8278
- assertUuid(uuid, "security rule uuid");
8965
+ async get(uuid2) {
8966
+ assertUuid(uuid2, "security rule uuid");
8279
8967
  return request({
8280
8968
  method: "GET",
8281
8969
  baseUrl: this.baseUrl,
8282
- path: `${MODEL_SEC_SECURITY_RULES_PATH}/${uuid}`,
8970
+ path: `${MODEL_SEC_SECURITY_RULES_PATH}/${uuid2}`,
8283
8971
  responseSchema: ModelSecurityRuleResponseSchema,
8284
8972
  auth: this.auth,
8285
8973
  numRetries: this.numRetries
@@ -8360,12 +9048,12 @@ var ModelSecurityModelsClient = class {
8360
9048
  * // { uuid: '550e8400-...', name: 'org/model', latest_version_uuid: '660e8400-...', latest_version_outcome: 'PASSED' }
8361
9049
  * ```
8362
9050
  */
8363
- async getModel(uuid) {
8364
- assertUuid(uuid, "model uuid");
9051
+ async getModel(uuid2) {
9052
+ assertUuid(uuid2, "model uuid");
8365
9053
  return request({
8366
9054
  method: "GET",
8367
9055
  baseUrl: this.baseUrl,
8368
- path: `${MODEL_SEC_MODELS_PATH}/${uuid}`,
9056
+ path: `${MODEL_SEC_MODELS_PATH}/${uuid2}`,
8369
9057
  responseSchema: ModelResponseSchema,
8370
9058
  auth: this.auth,
8371
9059
  numRetries: this.numRetries
@@ -8423,12 +9111,12 @@ var ModelSecurityModelsClient = class {
8423
9111
  * // { uuid: '660e8400-...', revision: 'main', model_uuid: '550e8400-...', last_eval_outcome: 'PASSED' }
8424
9112
  * ```
8425
9113
  */
8426
- async getModelVersion(uuid) {
8427
- assertUuid(uuid, "model version uuid");
9114
+ async getModelVersion(uuid2) {
9115
+ assertUuid(uuid2, "model version uuid");
8428
9116
  return request({
8429
9117
  method: "GET",
8430
9118
  baseUrl: this.baseUrl,
8431
- path: `${MODEL_SEC_MODEL_VERSIONS_PATH}/${uuid}`,
9119
+ path: `${MODEL_SEC_MODEL_VERSIONS_PATH}/${uuid2}`,
8432
9120
  responseSchema: ModelVersionResponseSchema,
8433
9121
  auth: this.auth,
8434
9122
  numRetries: this.numRetries
@@ -8541,7 +9229,7 @@ var ModelSecurityClient = class {
8541
9229
  };
8542
9230
 
8543
9231
  // src/red-team/scans-client.ts
8544
- var import_zod38 = require("zod");
9232
+ var import_zod40 = require("zod");
8545
9233
  var RedTeamScansClient = class {
8546
9234
  baseUrl;
8547
9235
  auth;
@@ -8685,7 +9373,7 @@ var RedTeamScansClient = class {
8685
9373
  method: "GET",
8686
9374
  baseUrl: this.baseUrl,
8687
9375
  path: RED_TEAM_CATEGORIES_PATH,
8688
- responseSchema: import_zod38.z.array(CategoryModelSchema),
9376
+ responseSchema: import_zod40.z.array(CategoryModelSchema),
8689
9377
  auth: this.auth,
8690
9378
  numRetries: this.numRetries
8691
9379
  });
@@ -8693,7 +9381,7 @@ var RedTeamScansClient = class {
8693
9381
  };
8694
9382
 
8695
9383
  // src/red-team/reports-client.ts
8696
- var import_zod39 = require("zod");
9384
+ var import_zod41 = require("zod");
8697
9385
  var RedTeamReportsClient = class {
8698
9386
  baseUrl;
8699
9387
  auth;
@@ -9068,7 +9756,7 @@ var RedTeamReportsClient = class {
9068
9756
  baseUrl: this.baseUrl,
9069
9757
  path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
9070
9758
  params: { file_format: format },
9071
- responseSchema: import_zod39.z.unknown(),
9759
+ responseSchema: import_zod41.z.unknown(),
9072
9760
  auth: this.auth,
9073
9761
  numRetries: this.numRetries
9074
9762
  });
@@ -9092,7 +9780,7 @@ var RedTeamReportsClient = class {
9092
9780
  method: "POST",
9093
9781
  baseUrl: this.baseUrl,
9094
9782
  path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
9095
- responseSchema: import_zod39.z.unknown(),
9783
+ responseSchema: import_zod41.z.unknown(),
9096
9784
  auth: this.auth,
9097
9785
  numRetries: this.numRetries
9098
9786
  });
@@ -9100,7 +9788,7 @@ var RedTeamReportsClient = class {
9100
9788
  };
9101
9789
 
9102
9790
  // src/red-team/custom-attack-reports-client.ts
9103
- var import_zod40 = require("zod");
9791
+ var import_zod42 = require("zod");
9104
9792
  var RedTeamCustomAttackReportsClient = class {
9105
9793
  baseUrl;
9106
9794
  auth;
@@ -9190,7 +9878,7 @@ var RedTeamCustomAttackReportsClient = class {
9190
9878
  baseUrl: this.baseUrl,
9191
9879
  path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
9192
9880
  params,
9193
- responseSchema: import_zod40.z.array(PromptDetailResponseSchema),
9881
+ responseSchema: import_zod42.z.array(PromptDetailResponseSchema),
9194
9882
  auth: this.auth,
9195
9883
  numRetries: this.numRetries
9196
9884
  });
@@ -9284,7 +9972,7 @@ var RedTeamCustomAttackReportsClient = class {
9284
9972
  method: "GET",
9285
9973
  baseUrl: this.baseUrl,
9286
9974
  path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
9287
- responseSchema: import_zod40.z.array(CustomAttackOutputSchema),
9975
+ responseSchema: import_zod42.z.array(CustomAttackOutputSchema),
9288
9976
  auth: this.auth,
9289
9977
  numRetries: this.numRetries
9290
9978
  });
@@ -9309,7 +9997,7 @@ var RedTeamCustomAttackReportsClient = class {
9309
9997
  method: "GET",
9310
9998
  baseUrl: this.baseUrl,
9311
9999
  path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
9312
- responseSchema: import_zod40.z.array(PropertyStatisticSchema),
10000
+ responseSchema: import_zod42.z.array(PropertyStatisticSchema),
9313
10001
  auth: this.auth,
9314
10002
  numRetries: this.numRetries
9315
10003
  });
@@ -9317,7 +10005,7 @@ var RedTeamCustomAttackReportsClient = class {
9317
10005
  };
9318
10006
 
9319
10007
  // src/red-team/targets-client.ts
9320
- var import_zod41 = require("zod");
10008
+ var import_zod43 = require("zod");
9321
10009
  var RedTeamTargetsClient = class {
9322
10010
  baseUrl;
9323
10011
  auth;
@@ -9431,12 +10119,12 @@ var RedTeamTargetsClient = class {
9431
10119
  * // { uuid: '550e8400-...', name: 'prod-chatbot', status: 'READY', active: true, validated: true }
9432
10120
  * ```
9433
10121
  */
9434
- async get(uuid) {
9435
- assertUuid(uuid, "target uuid");
10122
+ async get(uuid2) {
10123
+ assertUuid(uuid2, "target uuid");
9436
10124
  return request({
9437
10125
  method: "GET",
9438
10126
  baseUrl: this.baseUrl,
9439
- path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
10127
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}`,
9440
10128
  responseSchema: TargetResponseSchema,
9441
10129
  auth: this.auth,
9442
10130
  numRetries: this.numRetries
@@ -9462,14 +10150,14 @@ var RedTeamTargetsClient = class {
9462
10150
  * // { uuid: '550e8400-...', name: 'prod-chatbot-v2', status: 'READY', updated_at: '2026-03-08T10:00:00Z' }
9463
10151
  * ```
9464
10152
  */
9465
- async update(uuid, body, opts) {
9466
- assertUuid(uuid, "target uuid");
10153
+ async update(uuid2, body, opts) {
10154
+ assertUuid(uuid2, "target uuid");
9467
10155
  const params = {};
9468
10156
  if (opts?.validate !== void 0) params.validate = String(opts.validate);
9469
10157
  return request({
9470
10158
  method: "PUT",
9471
10159
  baseUrl: this.baseUrl,
9472
- path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
10160
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}`,
9473
10161
  body,
9474
10162
  params: Object.keys(params).length > 0 ? params : void 0,
9475
10163
  responseSchema: TargetResponseSchema,
@@ -9491,12 +10179,12 @@ var RedTeamTargetsClient = class {
9491
10179
  * // { message: 'ok', status: 200 }
9492
10180
  * ```
9493
10181
  */
9494
- async delete(uuid) {
9495
- assertUuid(uuid, "target uuid");
10182
+ async delete(uuid2) {
10183
+ assertUuid(uuid2, "target uuid");
9496
10184
  return request({
9497
10185
  method: "DELETE",
9498
10186
  baseUrl: this.baseUrl,
9499
- path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
10187
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}`,
9500
10188
  responseSchema: BaseResponseSchema.optional(),
9501
10189
  allowEmptyBody: true,
9502
10190
  auth: this.auth,
@@ -9546,12 +10234,12 @@ var RedTeamTargetsClient = class {
9546
10234
  * // { target_id: '550e8400-...', target_version: 1, status: 'READY' }
9547
10235
  * ```
9548
10236
  */
9549
- async getProfile(uuid) {
9550
- assertUuid(uuid, "target uuid");
10237
+ async getProfile(uuid2) {
10238
+ assertUuid(uuid2, "target uuid");
9551
10239
  return request({
9552
10240
  method: "GET",
9553
10241
  baseUrl: this.baseUrl,
9554
- path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
10242
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}/profile`,
9555
10243
  responseSchema: TargetProfileResponseSchema,
9556
10244
  auth: this.auth,
9557
10245
  numRetries: this.numRetries
@@ -9575,12 +10263,12 @@ var RedTeamTargetsClient = class {
9575
10263
  * // { uuid: '550e8400-...', name: 'prod-chatbot', status: 'READY' }
9576
10264
  * ```
9577
10265
  */
9578
- async updateProfile(uuid, body) {
9579
- assertUuid(uuid, "target uuid");
10266
+ async updateProfile(uuid2, body) {
10267
+ assertUuid(uuid2, "target uuid");
9580
10268
  return request({
9581
10269
  method: "PUT",
9582
10270
  baseUrl: this.baseUrl,
9583
- path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
10271
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}/profile`,
9584
10272
  body,
9585
10273
  responseSchema: TargetResponseSchema,
9586
10274
  auth: this.auth,
@@ -9633,7 +10321,7 @@ var RedTeamTargetsClient = class {
9633
10321
  method: "GET",
9634
10322
  baseUrl: this.baseUrl,
9635
10323
  path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
9636
- responseSchema: import_zod41.z.record(import_zod41.z.unknown()),
10324
+ responseSchema: import_zod43.z.record(import_zod43.z.unknown()),
9637
10325
  auth: this.auth,
9638
10326
  numRetries: this.numRetries
9639
10327
  });
@@ -9754,12 +10442,12 @@ var RedTeamCustomAttacksClient = class {
9754
10442
  * // { uuid: '550e8400-...', name: 'jailbreaks', status: 'READY', active: true, archive: false }
9755
10443
  * ```
9756
10444
  */
9757
- async getPromptSet(uuid) {
9758
- assertUuid(uuid, "prompt set uuid");
10445
+ async getPromptSet(uuid2) {
10446
+ assertUuid(uuid2, "prompt set uuid");
9759
10447
  return request({
9760
10448
  method: "GET",
9761
10449
  baseUrl: this.baseUrl,
9762
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
10450
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}`,
9763
10451
  responseSchema: CustomPromptSetResponseSchema,
9764
10452
  auth: this.auth,
9765
10453
  numRetries: this.numRetries
@@ -9782,12 +10470,12 @@ var RedTeamCustomAttacksClient = class {
9782
10470
  * // { uuid: '550e8400-...', name: 'jailbreaks-v2', status: 'READY', active: true }
9783
10471
  * ```
9784
10472
  */
9785
- async updatePromptSet(uuid, body) {
9786
- assertUuid(uuid, "prompt set uuid");
10473
+ async updatePromptSet(uuid2, body) {
10474
+ assertUuid(uuid2, "prompt set uuid");
9787
10475
  return request({
9788
10476
  method: "PUT",
9789
10477
  baseUrl: this.baseUrl,
9790
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
10478
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}`,
9791
10479
  body,
9792
10480
  responseSchema: CustomPromptSetResponseSchema,
9793
10481
  auth: this.auth,
@@ -9811,12 +10499,12 @@ var RedTeamCustomAttacksClient = class {
9811
10499
  * // { uuid: '550e8400-...', name: 'jailbreaks', status: 'READY', archive: true }
9812
10500
  * ```
9813
10501
  */
9814
- async archivePromptSet(uuid, body) {
9815
- assertUuid(uuid, "prompt set uuid");
10502
+ async archivePromptSet(uuid2, body) {
10503
+ assertUuid(uuid2, "prompt set uuid");
9816
10504
  return request({
9817
10505
  method: "PUT",
9818
10506
  baseUrl: this.baseUrl,
9819
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/archive`,
10507
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}/archive`,
9820
10508
  body,
9821
10509
  responseSchema: CustomPromptSetResponseSchema,
9822
10510
  auth: this.auth,
@@ -9837,12 +10525,12 @@ var RedTeamCustomAttacksClient = class {
9837
10525
  * // { uuid: '550e8400-...', name: 'jailbreaks', status: 'READY', active: true, tsg_id: 'tsg-1' }
9838
10526
  * ```
9839
10527
  */
9840
- async getPromptSetReference(uuid) {
9841
- assertUuid(uuid, "prompt set uuid");
10528
+ async getPromptSetReference(uuid2) {
10529
+ assertUuid(uuid2, "prompt set uuid");
9842
10530
  return request({
9843
10531
  method: "GET",
9844
10532
  baseUrl: this.baseUrl,
9845
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/reference`,
10533
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}/reference`,
9846
10534
  responseSchema: CustomPromptSetReferenceSchema,
9847
10535
  auth: this.auth,
9848
10536
  numRetries: this.numRetries
@@ -9863,14 +10551,14 @@ var RedTeamCustomAttacksClient = class {
9863
10551
  * // { uuid: '550e8400-...', status: 'READY', is_latest: true, version: 'gen-12345' }
9864
10552
  * ```
9865
10553
  */
9866
- async getPromptSetVersionInfo(uuid, opts) {
9867
- assertUuid(uuid, "prompt set uuid");
10554
+ async getPromptSetVersionInfo(uuid2, opts) {
10555
+ assertUuid(uuid2, "prompt set uuid");
9868
10556
  const params = {};
9869
10557
  if (opts?.version !== void 0) params.version = opts.version;
9870
10558
  return request({
9871
10559
  method: "GET",
9872
10560
  baseUrl: this.baseUrl,
9873
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/version-info`,
10561
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}/version-info`,
9874
10562
  params: Object.keys(params).length > 0 ? params : void 0,
9875
10563
  responseSchema: CustomPromptSetVersionInfoSchema,
9876
10564
  auth: this.auth,
@@ -9918,10 +10606,10 @@ var RedTeamCustomAttacksClient = class {
9918
10606
  * // 'prompt,goal,category,severity\n'
9919
10607
  * ```
9920
10608
  */
9921
- async downloadTemplate(uuid) {
9922
- assertUuid(uuid, "prompt set uuid");
10609
+ async downloadTemplate(uuid2) {
10610
+ assertUuid(uuid2, "prompt set uuid");
9923
10611
  const url = new URL(
9924
- `${this.baseUrl.replace(/\/+$/, "")}${RED_TEAM_CUSTOM_ATTACK_PATH}/download-template/${uuid}`
10612
+ `${this.baseUrl.replace(/\/+$/, "")}${RED_TEAM_CUSTOM_ATTACK_PATH}/download-template/${uuid2}`
9925
10613
  );
9926
10614
  const stub = {
9927
10615
  method: "GET",
@@ -10822,12 +11510,12 @@ var RedTeamAdaptersClient = class {
10822
11510
  * // adapter.status => 'ACTIVE'
10823
11511
  * ```
10824
11512
  */
10825
- async get(uuid) {
10826
- assertUuid(uuid, "adapter uuid");
11513
+ async get(uuid2) {
11514
+ assertUuid(uuid2, "adapter uuid");
10827
11515
  return request({
10828
11516
  method: "GET",
10829
11517
  baseUrl: this.baseUrl,
10830
- path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
11518
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid2}`,
10831
11519
  responseSchema: AdapterResponseSchema,
10832
11520
  auth: this.auth,
10833
11521
  numRetries: this.numRetries
@@ -10855,13 +11543,13 @@ var RedTeamAdaptersClient = class {
10855
11543
  * });
10856
11544
  * ```
10857
11545
  */
10858
- async update(uuid, body, opts) {
10859
- assertUuid(uuid, "adapter uuid");
11546
+ async update(uuid2, body, opts) {
11547
+ assertUuid(uuid2, "adapter uuid");
10860
11548
  const validate = opts?.validate ?? true;
10861
11549
  return request({
10862
11550
  method: "PUT",
10863
11551
  baseUrl: this.baseUrl,
10864
- path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
11552
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid2}`,
10865
11553
  params: { validate: String(validate) },
10866
11554
  body,
10867
11555
  responseSchema: AdapterResponseSchema,
@@ -10877,12 +11565,12 @@ var RedTeamAdaptersClient = class {
10877
11565
  * await rt.adapters.delete('550e8400-e29b-41d4-a716-446655440000');
10878
11566
  * ```
10879
11567
  */
10880
- async delete(uuid) {
10881
- assertUuid(uuid, "adapter uuid");
11568
+ async delete(uuid2) {
11569
+ assertUuid(uuid2, "adapter uuid");
10882
11570
  return request({
10883
11571
  method: "DELETE",
10884
11572
  baseUrl: this.baseUrl,
10885
- path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
11573
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid2}`,
10886
11574
  responseSchema: BaseResponseSchema.optional(),
10887
11575
  allowEmptyBody: true,
10888
11576
  auth: this.auth,
@@ -11751,12 +12439,12 @@ var AIGatewayWorkspacesClient = class {
11751
12439
  * const other = await gw.workspaces.get('ws-produc-985697', { plane: 'admin' });
11752
12440
  * ```
11753
12441
  */
11754
- async get(workspaceRef, options = {}) {
11755
- assertWorkspaceRef(workspaceRef, "workspaceRef");
12442
+ async get(workspaceRef2, options = {}) {
12443
+ assertWorkspaceRef(workspaceRef2, "workspaceRef");
11756
12444
  return request({
11757
12445
  method: "GET",
11758
12446
  baseUrl: this.urlFor(options.plane),
11759
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
12447
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef2}`,
11760
12448
  responseSchema: GatewayWorkspaceDetailSchema,
11761
12449
  auth: this.auth,
11762
12450
  numRetries: this.numRetries
@@ -11785,17 +12473,12 @@ var AIGatewayWorkspacesClient = class {
11785
12473
  * ```
11786
12474
  */
11787
12475
  async create(body) {
11788
- if (!body.name) {
11789
- throw new AISecSDKException("Missing name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11790
- }
11791
- if (!body.scope_name) {
11792
- throw new AISecSDKException("Missing scope_name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11793
- }
11794
12476
  return request({
11795
12477
  method: "POST",
11796
12478
  baseUrl: this.adminBaseUrl,
11797
12479
  path: AI_GW_WORKSPACES_PATH,
11798
12480
  body,
12481
+ requestSchema: GatewayWorkspaceCreateRequestSchema,
11799
12482
  responseSchema: GatewayWorkspaceCreateResponseSchema,
11800
12483
  auth: this.auth,
11801
12484
  numRetries: this.numRetries
@@ -11820,19 +12503,14 @@ var AIGatewayWorkspacesClient = class {
11820
12503
  * });
11821
12504
  * ```
11822
12505
  */
11823
- async update(workspaceRef, body) {
11824
- assertWorkspaceRef(workspaceRef, "workspaceRef");
11825
- if (Object.keys(body).length === 0) {
11826
- throw new AISecSDKException(
11827
- "Empty update: provide at least one of name, description, icon, defaults, usage_limits, rate_limits",
11828
- "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
11829
- );
11830
- }
12506
+ async update(workspaceRef2, body) {
12507
+ assertWorkspaceRef(workspaceRef2, "workspaceRef");
11831
12508
  return request({
11832
12509
  method: "PUT",
11833
12510
  baseUrl: this.adminBaseUrl,
11834
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
12511
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef2}`,
11835
12512
  body,
12513
+ requestSchema: GatewayWorkspaceUpdateRequestSchema,
11836
12514
  responseSchema: GatewayWriteResponseSchema,
11837
12515
  auth: this.auth,
11838
12516
  numRetries: this.numRetries
@@ -11863,12 +12541,12 @@ var AIGatewayWorkspacesClient = class {
11863
12541
  * const gone = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
11864
12542
  * ```
11865
12543
  */
11866
- async delete(workspaceRef) {
11867
- assertWorkspaceRef(workspaceRef, "workspaceRef");
12544
+ async delete(workspaceRef2) {
12545
+ assertWorkspaceRef(workspaceRef2, "workspaceRef");
11868
12546
  return request({
11869
12547
  method: "DELETE",
11870
12548
  baseUrl: this.adminBaseUrl,
11871
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
12549
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef2}`,
11872
12550
  auth: this.auth,
11873
12551
  numRetries: this.numRetries
11874
12552
  });
@@ -11994,6 +12672,7 @@ var AIGatewayConfigsClient = class {
11994
12672
  baseUrl: this.baseUrl,
11995
12673
  path: AI_GW_CONFIGS_PATH,
11996
12674
  body,
12675
+ requestSchema: GatewayConfigCreateRequestSchema,
11997
12676
  responseSchema: GatewayConfigCreateResponseSchema,
11998
12677
  auth: this.auth,
11999
12678
  numRetries: this.numRetries
@@ -12002,7 +12681,7 @@ var AIGatewayConfigsClient = class {
12002
12681
  /**
12003
12682
  * Update a config.
12004
12683
  * @param configId - Config UUID.
12005
- * @param body - Replacement fields.
12684
+ * @param body - One or more fields to update. A supplied `config` replaces the routing document.
12006
12685
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12007
12686
  * @example
12008
12687
  * ```ts
@@ -12018,12 +12697,12 @@ var AIGatewayConfigsClient = class {
12018
12697
  */
12019
12698
  async update(configId, body) {
12020
12699
  assertUuid(configId, "configId");
12021
- assertUuid(body.workspace_id, "workspace_id");
12022
12700
  return request({
12023
12701
  method: "PUT",
12024
12702
  baseUrl: this.baseUrl,
12025
12703
  path: `${AI_GW_CONFIGS_PATH}/${configId}`,
12026
12704
  body,
12705
+ requestSchema: GatewayConfigUpdateRequestSchema,
12027
12706
  responseSchema: GatewayWriteResponseSchema,
12028
12707
  auth: this.auth,
12029
12708
  numRetries: this.numRetries
@@ -12151,6 +12830,7 @@ var AIGatewayGuardrailsClient = class {
12151
12830
  baseUrl: this.baseUrl,
12152
12831
  path: AI_GW_GUARDRAILS_PATH,
12153
12832
  body,
12833
+ requestSchema: GatewayGuardrailCreateRequestSchema,
12154
12834
  responseSchema: GatewayGuardrailCreateResponseSchema,
12155
12835
  auth: this.auth,
12156
12836
  numRetries: this.numRetries
@@ -12177,6 +12857,7 @@ var AIGatewayGuardrailsClient = class {
12177
12857
  baseUrl: this.baseUrl,
12178
12858
  path: `${AI_GW_GUARDRAILS_PATH}/${guardrailId}`,
12179
12859
  body,
12860
+ requestSchema: GatewayGuardrailUpdateRequestSchema,
12180
12861
  responseSchema: GatewayWriteResponseSchema,
12181
12862
  auth: this.auth,
12182
12863
  numRetries: this.numRetries
@@ -12252,7 +12933,8 @@ var AIGatewayProvidersClient = class {
12252
12933
  * Fetch one provider binding. Verified live 2026-08-29.
12253
12934
  *
12254
12935
  * @remarks The response can contain provider credential material. Do not log or persist it,
12255
- * and do not enable SDK debug logging around this call in production.
12936
+ * and avoid logging the complete returned object. SDK debug logs redact the known credential
12937
+ * fields for this operation.
12256
12938
  * @param providerId - Provider UUID.
12257
12939
  * @returns Provider configuration and lifecycle detail.
12258
12940
  * @example
@@ -12269,6 +12951,7 @@ var AIGatewayProvidersClient = class {
12269
12951
  method: "GET",
12270
12952
  baseUrl: this.baseUrl,
12271
12953
  path: `${AI_GW_PROVIDERS_PATH}/${providerId}`,
12954
+ secretOperation: "providers.get",
12272
12955
  responseSchema: GatewayProviderDetailSchema,
12273
12956
  auth: this.auth,
12274
12957
  numRetries: this.numRetries
@@ -12309,6 +12992,7 @@ var AIGatewayProvidersClient = class {
12309
12992
  baseUrl: this.baseUrl,
12310
12993
  path: AI_GW_PROVIDERS_PATH,
12311
12994
  body,
12995
+ requestSchema: GatewayProviderCreateRequestSchema,
12312
12996
  responseSchema: GatewayProviderCreateResponseSchema,
12313
12997
  auth: this.auth,
12314
12998
  numRetries: this.numRetries
@@ -12336,6 +13020,7 @@ var AIGatewayProvidersClient = class {
12336
13020
  baseUrl: this.baseUrl,
12337
13021
  path: `${AI_GW_PROVIDERS_PATH}/${providerId}`,
12338
13022
  body,
13023
+ requestSchema: GatewayProviderUpdateRequestSchema,
12339
13024
  responseSchema: GatewayWriteResponseSchema,
12340
13025
  auth: this.auth,
12341
13026
  numRetries: this.numRetries
@@ -12396,13 +13081,14 @@ var AIGatewayApiKeysClient = class {
12396
13081
  });
12397
13082
  }
12398
13083
  /** @internal */
12399
- writeAt(method, path, body) {
12400
- assertUuid(body.workspace_id, "workspace_id");
13084
+ writeAt(method, path, body, requestSchema, secretOperation) {
12401
13085
  return request({
12402
13086
  method,
12403
13087
  baseUrl: this.baseUrl,
12404
13088
  path,
12405
13089
  body,
13090
+ requestSchema,
13091
+ secretOperation,
12406
13092
  responseSchema: GatewayWriteResponseSchema,
12407
13093
  auth: this.auth,
12408
13094
  numRetries: this.numRetries
@@ -12461,13 +13147,15 @@ var AIGatewayApiKeysClient = class {
12461
13147
  numRetries: this.numRetries
12462
13148
  });
12463
13149
  }
12464
- rotateAt(path, keyId, body = {}) {
13150
+ rotateAt(path, keyId, body, secretOperation) {
12465
13151
  assertUuid(keyId, "keyId");
12466
13152
  return request({
12467
13153
  method: "POST",
12468
13154
  baseUrl: this.baseUrl,
12469
13155
  path: `${path}/${keyId}/rotate`,
12470
13156
  body,
13157
+ requestSchema: GatewayApiKeyRotateRequestSchema,
13158
+ secretOperation,
12471
13159
  responseSchema: GatewayApiKeyRotateResponseSchema,
12472
13160
  auth: this.auth,
12473
13161
  numRetries: this.numRetries
@@ -12491,11 +13179,11 @@ var AIGatewayApiKeysClient = class {
12491
13179
  }
12492
13180
  /** Rotate a service key; capture the returned secret. @example `const rotated = await gw.apiKeys.rotateService(keyId);` */
12493
13181
  async rotateService(keyId, body = {}) {
12494
- return this.rotateAt(AI_GW_API_KEYS_SERVICE_PATH, keyId, body);
13182
+ return this.rotateAt(AI_GW_API_KEYS_SERVICE_PATH, keyId, body, "apiKeys.rotateService");
12495
13183
  }
12496
13184
  /** Rotate a user key; capture the returned secret. @example `const rotated = await gw.apiKeys.rotateUser(keyId);` */
12497
13185
  async rotateUser(keyId, body = {}) {
12498
- return this.rotateAt(AI_GW_API_KEYS_USER_PATH, keyId, body);
13186
+ return this.rotateAt(AI_GW_API_KEYS_USER_PATH, keyId, body, "apiKeys.rotateUser");
12499
13187
  }
12500
13188
  /**
12501
13189
  * Create a service API key.
@@ -12516,7 +13204,13 @@ var AIGatewayApiKeysClient = class {
12516
13204
  * ```
12517
13205
  */
12518
13206
  async createService(body) {
12519
- return this.writeAt("POST", AI_GW_API_KEYS_SERVICE_PATH, body);
13207
+ return this.writeAt(
13208
+ "POST",
13209
+ AI_GW_API_KEYS_SERVICE_PATH,
13210
+ body,
13211
+ GatewayServiceApiKeyCreateRequestSchema,
13212
+ "apiKeys.createService"
13213
+ );
12520
13214
  }
12521
13215
  /**
12522
13216
  * Create a user API key.
@@ -12538,12 +13232,18 @@ var AIGatewayApiKeysClient = class {
12538
13232
  * ```
12539
13233
  */
12540
13234
  async createUser(body) {
12541
- return this.writeAt("POST", AI_GW_API_KEYS_USER_PATH, body);
13235
+ return this.writeAt(
13236
+ "POST",
13237
+ AI_GW_API_KEYS_USER_PATH,
13238
+ body,
13239
+ GatewayUserApiKeyCreateRequestSchema,
13240
+ "apiKeys.createUser"
13241
+ );
12542
13242
  }
12543
13243
  /**
12544
13244
  * Update a service API key.
12545
13245
  * @param keyId - Key UUID.
12546
- * @param body - Replacement fields.
13246
+ * @param body - One or more fields to update.
12547
13247
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12548
13248
  * @example
12549
13249
  * ```ts
@@ -12561,12 +13261,17 @@ var AIGatewayApiKeysClient = class {
12561
13261
  */
12562
13262
  async updateService(keyId, body) {
12563
13263
  assertUuid(keyId, "keyId");
12564
- return this.writeAt("PUT", `${AI_GW_API_KEYS_SERVICE_PATH}/${keyId}`, body);
13264
+ return this.writeAt(
13265
+ "PUT",
13266
+ `${AI_GW_API_KEYS_SERVICE_PATH}/${keyId}`,
13267
+ body,
13268
+ GatewayApiKeyUpdateRequestSchema
13269
+ );
12565
13270
  }
12566
13271
  /**
12567
13272
  * Update a user API key.
12568
13273
  * @param keyId - Key UUID.
12569
- * @param body - Replacement fields.
13274
+ * @param body - One or more fields to update.
12570
13275
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12571
13276
  * @example
12572
13277
  * ```ts
@@ -12585,7 +13290,12 @@ var AIGatewayApiKeysClient = class {
12585
13290
  */
12586
13291
  async updateUser(keyId, body) {
12587
13292
  assertUuid(keyId, "keyId");
12588
- return this.writeAt("PUT", `${AI_GW_API_KEYS_USER_PATH}/${keyId}`, body);
13293
+ return this.writeAt(
13294
+ "PUT",
13295
+ `${AI_GW_API_KEYS_USER_PATH}/${keyId}`,
13296
+ body,
13297
+ GatewayApiKeyUpdateRequestSchema
13298
+ );
12589
13299
  }
12590
13300
  };
12591
13301
 
@@ -12649,8 +13359,8 @@ var AIGatewayIntegrationsClient = class {
12649
13359
  * Create an integration.
12650
13360
  *
12651
13361
  * @remarks
12652
- * `body.key` (the provider API key) is a live secret. Setting `PANW_AI_SEC_DEBUG` will
12653
- * print it, unredacted, to the SDK's own debug log.
13362
+ * `body.key` (the provider API key) is a live secret. SDK debug logs replace known
13363
+ * credential fields with `[REDACTED]`, but callers must still avoid logging the input object.
12654
13364
  *
12655
13365
  * @param body - Provider id, name, slug, and provider-specific configuration.
12656
13366
  * @returns The raw create response. Shape unverified against a live tenant — see the PRD.
@@ -12675,6 +13385,8 @@ var AIGatewayIntegrationsClient = class {
12675
13385
  baseUrl: this.baseUrl,
12676
13386
  path: AI_GW_INTEGRATIONS_PATH,
12677
13387
  body,
13388
+ requestSchema: GatewayIntegrationCreateRequestSchema,
13389
+ secretOperation: "integrations.create",
12678
13390
  responseSchema: GatewayWriteResponseSchema,
12679
13391
  auth: this.auth,
12680
13392
  numRetries: this.numRetries
@@ -12683,7 +13395,7 @@ var AIGatewayIntegrationsClient = class {
12683
13395
  /**
12684
13396
  * Update an integration.
12685
13397
  * @param integrationId - Integration UUID.
12686
- * @param body - Replacement fields.
13398
+ * @param body - One or more fields to update.
12687
13399
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12688
13400
  * @example
12689
13401
  * ```ts
@@ -12698,12 +13410,13 @@ var AIGatewayIntegrationsClient = class {
12698
13410
  */
12699
13411
  async update(integrationId, body) {
12700
13412
  assertUuid(integrationId, "integrationId");
12701
- if (body.ai_provider_id !== void 0) assertUuid(body.ai_provider_id, "ai_provider_id");
12702
13413
  return request({
12703
13414
  method: "PUT",
12704
13415
  baseUrl: this.baseUrl,
12705
13416
  path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
12706
13417
  body,
13418
+ requestSchema: GatewayIntegrationUpdateRequestSchema,
13419
+ secretOperation: "integrations.update",
12707
13420
  responseSchema: GatewayWriteResponseSchema,
12708
13421
  auth: this.auth,
12709
13422
  numRetries: this.numRetries
@@ -12759,9 +13472,9 @@ var AIGatewayIntegrationsClient = class {
12759
13472
  });
12760
13473
  }
12761
13474
  /**
12762
- * Replace which models this integration exposes.
13475
+ * Bulk-update model enablement for this integration.
12763
13476
  * @param integrationId - Integration UUID.
12764
- * @param body - Full model list; this is a replace, not a merge.
13477
+ * @param body - One or more model entries to update; omission is not documented as deletion.
12765
13478
  * @returns The raw response. Shape unverified against a live tenant — see the PRD.
12766
13479
  * @example
12767
13480
  * ```ts
@@ -12780,6 +13493,7 @@ var AIGatewayIntegrationsClient = class {
12780
13493
  baseUrl: this.baseUrl,
12781
13494
  path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/models`,
12782
13495
  body,
13496
+ requestSchema: GatewayIntegrationModelsBulkUpdateRequestSchema,
12783
13497
  responseSchema: GatewayWriteResponseSchema,
12784
13498
  auth: this.auth,
12785
13499
  numRetries: this.numRetries
@@ -12791,7 +13505,7 @@ var AIGatewayIntegrationsClient = class {
12791
13505
  * @remarks
12792
13506
  * `global_workspace_access` is an **object** on this read, not a boolean, despite the
12793
13507
  * field name — `{ enabled, rate_limits, usage_limits }`. The corresponding write
12794
- * ({@link setWorkspaces}) DOES send a plain boolean; the two are not symmetric.
13508
+ * ({@link setWorkspaces}) uses the same object shape.
12795
13509
  *
12796
13510
  * @param integrationId - Integration UUID.
12797
13511
  * @returns Bound workspaces plus the `global_workspace_access` object.
@@ -12816,9 +13530,9 @@ var AIGatewayIntegrationsClient = class {
12816
13530
  });
12817
13531
  }
12818
13532
  /**
12819
- * Replace which workspaces may use this integration.
13533
+ * Bulk-update which workspaces may use this integration.
12820
13534
  * @param integrationId - Integration UUID.
12821
- * @param body - Workspace bindings or a global-access flag.
13535
+ * @param body - Workspace bindings, global-access settings, or explicit override behavior.
12822
13536
  * @returns The raw response. Shape unverified against a live tenant — see the PRD.
12823
13537
  * @example
12824
13538
  * ```ts
@@ -12826,7 +13540,7 @@ var AIGatewayIntegrationsClient = class {
12826
13540
  * const gw = new AIGatewayClient();
12827
13541
  *
12828
13542
  * await gw.integrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
12829
- * global_workspace_access: true,
13543
+ * global_workspace_access: { enabled: true },
12830
13544
  * });
12831
13545
  * ```
12832
13546
  */
@@ -12837,6 +13551,7 @@ var AIGatewayIntegrationsClient = class {
12837
13551
  baseUrl: this.baseUrl,
12838
13552
  path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/workspaces`,
12839
13553
  body,
13554
+ requestSchema: GatewayIntegrationWorkspacesBulkUpdateRequestSchema,
12840
13555
  responseSchema: GatewayWriteResponseSchema,
12841
13556
  auth: this.auth,
12842
13557
  numRetries: this.numRetries
@@ -12970,6 +13685,8 @@ var AIGatewayMcpIntegrationsClient = class {
12970
13685
  baseUrl: this.baseUrl,
12971
13686
  path: AI_GW_MCP_INTEGRATIONS_PATH,
12972
13687
  body,
13688
+ requestSchema: McpIntegrationCreateRequestSchema,
13689
+ secretOperation: "mcpIntegrations.create",
12973
13690
  responseSchema: GatewayWriteResponseSchema,
12974
13691
  auth: this.auth,
12975
13692
  numRetries: this.numRetries
@@ -12983,6 +13700,8 @@ var AIGatewayMcpIntegrationsClient = class {
12983
13700
  baseUrl: this.baseUrl,
12984
13701
  path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}`,
12985
13702
  body,
13703
+ requestSchema: McpIntegrationUpdateRequestSchema,
13704
+ secretOperation: "mcpIntegrations.update",
12986
13705
  responseSchema: GatewayWriteResponseSchema,
12987
13706
  auth: this.auth,
12988
13707
  numRetries: this.numRetries
@@ -12999,7 +13718,7 @@ var AIGatewayMcpIntegrationsClient = class {
12999
13718
  numRetries: this.numRetries
13000
13719
  });
13001
13720
  }
13002
- /** Replace capability enablement values. @example `await gw.mcpIntegrations.setCapabilities(id, { capabilities: [{ name: 'lookup', type: 'tool', enabled: true }] });` */
13721
+ /** Bulk-update capability enablement values. @example `await gw.mcpIntegrations.setCapabilities(id, { capabilities: [{ name: 'lookup', type: 'tool', enabled: true }] });` */
13003
13722
  async setCapabilities(mcpIntegrationId, body) {
13004
13723
  assertUuid(mcpIntegrationId, "mcpIntegrationId");
13005
13724
  return request({
@@ -13007,15 +13726,17 @@ var AIGatewayMcpIntegrationsClient = class {
13007
13726
  baseUrl: this.baseUrl,
13008
13727
  path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/capabilities`,
13009
13728
  body,
13729
+ requestSchema: McpIntegrationCapabilitiesBulkUpdateRequestSchema,
13010
13730
  responseSchema: McpIntegrationCapabilitiesUpdateResponseSchema,
13011
13731
  auth: this.auth,
13012
13732
  numRetries: this.numRetries
13013
13733
  });
13014
13734
  }
13015
13735
  /**
13016
- * Replace which workspaces may use this MCP integration.
13736
+ * Bulk-update which workspaces may use this MCP integration.
13017
13737
  * @param mcpIntegrationId - MCP integration UUID.
13018
- * @param body - Workspace bindings or a global-access flag; this is a replace, not a merge.
13738
+ * @param body - Workspace bindings or global-access settings. Use the explicit override flag
13739
+ * to request replacement behavior.
13019
13740
  * @returns An empty object. Verified live 2026-08-30.
13020
13741
  * @example
13021
13742
  * ```ts
@@ -13036,6 +13757,7 @@ var AIGatewayMcpIntegrationsClient = class {
13036
13757
  baseUrl: this.baseUrl,
13037
13758
  path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/workspaces`,
13038
13759
  body,
13760
+ requestSchema: McpIntegrationWorkspacesBulkUpdateRequestSchema,
13039
13761
  responseSchema: McpIntegrationWorkspacesUpdateResponseSchema,
13040
13762
  auth: this.auth,
13041
13763
  numRetries: this.numRetries
@@ -13114,8 +13836,8 @@ var AIGatewayDeploymentsClient = class {
13114
13836
  *
13115
13837
  * This is the **only** time `credentials.password` and `client_auth` are readable; the
13116
13838
  * detail read masks them. Capture them here or they are unrecoverable. Never log them.
13117
- * Note that setting `PANW_AI_SEC_DEBUG` will print the raw request/response, including
13118
- * `credentials.password`, to the SDK's own debug log regardless of this warning.
13839
+ * SDK debug logs redact returned one-time `client_auth` and registry passwords. Callers
13840
+ * must still capture the create response once and store it securely.
13119
13841
  *
13120
13842
  * @param body - Name, type, TSG, and auth settings.
13121
13843
  * @returns The creation receipt including the deployment's gateway credentials.
@@ -13140,6 +13862,8 @@ var AIGatewayDeploymentsClient = class {
13140
13862
  baseUrl: this.baseUrl,
13141
13863
  path: AI_GW_DEPLOYMENTS_PATH,
13142
13864
  body,
13865
+ requestSchema: GatewayDeploymentCreateRequestSchema,
13866
+ secretOperation: "deployments.create",
13143
13867
  responseSchema: GatewayDeploymentCreateResponseSchema,
13144
13868
  auth: this.auth,
13145
13869
  numRetries: this.numRetries
@@ -13169,6 +13893,8 @@ var AIGatewayDeploymentsClient = class {
13169
13893
  baseUrl: this.baseUrl,
13170
13894
  path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}`,
13171
13895
  body,
13896
+ requestSchema: GatewayDeploymentUpdateRequestSchema,
13897
+ secretOperation: "deployments.update",
13172
13898
  responseSchema: GatewayWriteResponseSchema,
13173
13899
  auth: this.auth,
13174
13900
  numRetries: this.numRetries
@@ -13271,8 +13997,8 @@ var AIGatewayPluginsClient = class {
13271
13997
  * Bind a plugin to the organisation.
13272
13998
  *
13273
13999
  * @remarks
13274
- * `body.credentials` (e.g. `AIRS_API_KEY`) is a live secret. Setting `PANW_AI_SEC_DEBUG`
13275
- * will print it, unredacted, to the SDK's own debug log.
14000
+ * `body.credentials` (e.g. `AIRS_API_KEY`) is a live secret. SDK debug logs replace each
14001
+ * credential value with `[REDACTED]`, but callers must still avoid logging the input object.
13276
14002
  *
13277
14003
  * @param body - Integration id and provider-specific credentials.
13278
14004
  * @returns The raw create response. Shape unverified against a live tenant — see the PRD.
@@ -13295,6 +14021,8 @@ var AIGatewayPluginsClient = class {
13295
14021
  baseUrl: this.baseUrl,
13296
14022
  path: AI_GW_PLUGINS_PATH,
13297
14023
  body,
14024
+ requestSchema: GatewayPluginCreateRequestSchema,
14025
+ secretOperation: "plugins.create",
13298
14026
  responseSchema: GatewayWriteResponseSchema,
13299
14027
  auth: this.auth,
13300
14028
  numRetries: this.numRetries
@@ -13336,7 +14064,7 @@ var AIGatewayOrganisationsClient = class {
13336
14064
  }
13337
14065
  /**
13338
14066
  * Update the calling organisation's settings.
13339
- * @param body - Replacement fields.
14067
+ * @param body - One or more fields to update.
13340
14068
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
13341
14069
  * @example
13342
14070
  * ```ts
@@ -13352,6 +14080,7 @@ var AIGatewayOrganisationsClient = class {
13352
14080
  baseUrl: this.baseUrl,
13353
14081
  path: AI_GW_ORGANISATIONS_SELF_PATH,
13354
14082
  body,
14083
+ requestSchema: GatewayOrganisationUpdateRequestSchema,
13355
14084
  responseSchema: GatewayWriteResponseSchema,
13356
14085
  auth: this.auth,
13357
14086
  numRetries: this.numRetries
@@ -13362,8 +14091,8 @@ var AIGatewayOrganisationsClient = class {
13362
14091
  *
13363
14092
  * @remarks
13364
14093
  * The response includes a `scim_token` — a live secret. Never log the returned object.
13365
- * Note that setting `PANW_AI_SEC_DEBUG` will print it (unredacted) to the SDK's own debug
13366
- * log regardless of this warning, since debug logging only sanitizes header values.
14094
+ * SDK debug logs redact `scim_token` and known nested client-secret fields. Callers must
14095
+ * still avoid logging the input object or returned auth settings directly.
13367
14096
  *
13368
14097
  * @param tsgId - The TSG as a numeric string, not a UUID.
13369
14098
  * @returns Auth settings, including domains and the SCIM token.
@@ -13382,6 +14111,7 @@ var AIGatewayOrganisationsClient = class {
13382
14111
  method: "GET",
13383
14112
  baseUrl: this.baseUrl,
13384
14113
  path: aiGwOrganisationsAuthSettingsPath(tsgId),
14114
+ secretOperation: "organisations.getAuthSettings",
13385
14115
  responseSchema: AuthSettingsResponseSchema,
13386
14116
  auth: this.auth,
13387
14117
  numRetries: this.numRetries
@@ -13390,7 +14120,7 @@ var AIGatewayOrganisationsClient = class {
13390
14120
  /**
13391
14121
  * Update an organisation's auth settings.
13392
14122
  * @param tsgId - The TSG as a numeric string, not a UUID.
13393
- * @param body - Replacement fields.
14123
+ * @param body - One or more auth-setting fields to update.
13394
14124
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
13395
14125
  * @example
13396
14126
  * ```ts
@@ -13409,6 +14139,8 @@ var AIGatewayOrganisationsClient = class {
13409
14139
  baseUrl: this.baseUrl,
13410
14140
  path: aiGwOrganisationsAuthSettingsPath(tsgId),
13411
14141
  body,
14142
+ requestSchema: GatewayOrganisationAuthSettingsUpdateRequestSchema,
14143
+ secretOperation: "organisations.updateAuthSettings",
13412
14144
  responseSchema: GatewayWriteResponseSchema,
13413
14145
  auth: this.auth,
13414
14146
  numRetries: this.numRetries
@@ -13526,6 +14258,165 @@ var AIGatewayClient = class {
13526
14258
  this.auditLogs = new AIGatewayAuditLogsClient(adminOpts);
13527
14259
  }
13528
14260
  };
14261
+
14262
+ // src/ai-gateway/nested-values.ts
14263
+ var FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
14264
+ var ESCAPABLE = /* @__PURE__ */ new Set([".", "[", "]", "\\"]);
14265
+ function invalid(message) {
14266
+ throw new AISecSDKException(message, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
14267
+ }
14268
+ function pushProperty(tokens, value2, path) {
14269
+ if (!value2) invalid(`Invalid dotted path: ${path}`);
14270
+ if (FORBIDDEN_SEGMENTS.has(value2)) invalid(`Unsafe dotted path segment: ${value2}`);
14271
+ tokens.push(value2);
14272
+ }
14273
+ function parsePath(path) {
14274
+ if (!path) invalid("Dotted path must not be empty");
14275
+ const tokens = [];
14276
+ let property = "";
14277
+ let afterDot = false;
14278
+ let afterIndex = false;
14279
+ for (let i = 0; i < path.length; i++) {
14280
+ const char = path[i];
14281
+ if (char === "\\") {
14282
+ const escaped = path[++i];
14283
+ if (escaped === void 0 || !ESCAPABLE.has(escaped)) {
14284
+ invalid(`Invalid escape in dotted path: ${path}`);
14285
+ }
14286
+ if (afterIndex) invalid(`Missing dot after array index in path: ${path}`);
14287
+ property += escaped;
14288
+ afterDot = false;
14289
+ continue;
14290
+ }
14291
+ if (char === ".") {
14292
+ if (property) {
14293
+ pushProperty(tokens, property, path);
14294
+ property = "";
14295
+ } else if (!afterIndex) {
14296
+ invalid(`Invalid empty segment in dotted path: ${path}`);
14297
+ }
14298
+ afterDot = true;
14299
+ afterIndex = false;
14300
+ continue;
14301
+ }
14302
+ if (char === "[") {
14303
+ if (afterDot) invalid(`Invalid array segment in dotted path: ${path}`);
14304
+ if (property) {
14305
+ pushProperty(tokens, property, path);
14306
+ property = "";
14307
+ } else if (tokens.length === 0) {
14308
+ invalid(`Dotted paths must start with an object property: ${path}`);
14309
+ }
14310
+ const close = path.indexOf("]", i + 1);
14311
+ if (close === -1) invalid(`Unclosed array index in dotted path: ${path}`);
14312
+ const rawIndex = path.slice(i + 1, close);
14313
+ if (!/^(0|[1-9]\d*)$/.test(rawIndex)) invalid(`Invalid array index in dotted path: ${path}`);
14314
+ tokens.push(Number(rawIndex));
14315
+ i = close;
14316
+ afterIndex = true;
14317
+ afterDot = false;
14318
+ continue;
14319
+ }
14320
+ if (char === "]") invalid(`Unexpected ] in dotted path: ${path}`);
14321
+ if (afterIndex) invalid(`Missing dot after array index in path: ${path}`);
14322
+ property += char;
14323
+ afterDot = false;
14324
+ }
14325
+ if (property) pushProperty(tokens, property, path);
14326
+ else if (afterDot) invalid(`Dotted path must not end with a dot: ${path}`);
14327
+ if (tokens.length === 0) invalid(`Invalid dotted path: ${path}`);
14328
+ return tokens;
14329
+ }
14330
+ function isContainerFor(value2, expectArray) {
14331
+ return expectArray ? Array.isArray(value2) : typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
14332
+ }
14333
+ function readSegment(container, segment) {
14334
+ return typeof segment === "number" ? container[segment] : container[segment];
14335
+ }
14336
+ function writeSegment(container, segment, value2) {
14337
+ if (typeof segment === "number") container[segment] = value2;
14338
+ else container[segment] = value2;
14339
+ }
14340
+ function assign(root, tokens, value2, replaceExisting) {
14341
+ let current = root;
14342
+ for (let i = 0; i < tokens.length; i++) {
14343
+ const segment = tokens[i];
14344
+ const final = i === tokens.length - 1;
14345
+ if (typeof segment === "number" && !Array.isArray(current)) {
14346
+ invalid("Array index conflicts with an object path");
14347
+ }
14348
+ if (typeof segment === "string" && Array.isArray(current)) {
14349
+ invalid("Object property conflicts with an array path");
14350
+ }
14351
+ const hasValue = Object.prototype.hasOwnProperty.call(current, segment);
14352
+ if (final) {
14353
+ if (hasValue && !replaceExisting) invalid("Duplicate dotted path");
14354
+ writeSegment(current, segment, value2);
14355
+ return;
14356
+ }
14357
+ const expectArray = typeof tokens[i + 1] === "number";
14358
+ if (!hasValue) {
14359
+ writeSegment(current, segment, expectArray ? [] : {});
14360
+ } else {
14361
+ const existing = readSegment(current, segment);
14362
+ if (!isContainerFor(existing, expectArray)) invalid("Dotted path shape conflict");
14363
+ }
14364
+ current = readSegment(current, segment);
14365
+ }
14366
+ }
14367
+ function assertDenseArrays(value2) {
14368
+ if (Array.isArray(value2)) {
14369
+ for (let i = 0; i < value2.length; i++) {
14370
+ if (!Object.prototype.hasOwnProperty.call(value2, i))
14371
+ invalid("Sparse arrays are not supported");
14372
+ assertDenseArrays(value2[i]);
14373
+ }
14374
+ return;
14375
+ }
14376
+ if (typeof value2 === "object" && value2 !== null) {
14377
+ for (const nested of Object.values(value2)) assertDenseArrays(nested);
14378
+ }
14379
+ }
14380
+ function cloneJson(value2) {
14381
+ if (Array.isArray(value2)) {
14382
+ return value2.map((item) => cloneJson(item));
14383
+ }
14384
+ if (typeof value2 === "object" && value2 !== null) {
14385
+ return Object.fromEntries(
14386
+ Object.entries(value2).map(([key, item]) => [key, cloneJson(item)])
14387
+ );
14388
+ }
14389
+ return value2;
14390
+ }
14391
+ function parseJsonValue(value2) {
14392
+ const result = GatewayJsonValueSchema.safeParse(value2);
14393
+ if (!result.success) invalid("Dotted value must be finite JSON");
14394
+ return cloneJson(result.data);
14395
+ }
14396
+ function buildDottedObject(entries) {
14397
+ const parsed = entries.map((entry) => ({
14398
+ tokens: parsePath(entry.path),
14399
+ value: parseJsonValue(entry.value)
14400
+ }));
14401
+ const identities = /* @__PURE__ */ new Set();
14402
+ for (const entry of parsed) {
14403
+ const identity = JSON.stringify(entry.tokens);
14404
+ if (identities.has(identity)) invalid("Duplicate dotted path");
14405
+ identities.add(identity);
14406
+ }
14407
+ const result = {};
14408
+ for (const entry of parsed) assign(result, entry.tokens, entry.value, false);
14409
+ assertDenseArrays(result);
14410
+ return result;
14411
+ }
14412
+ function setDottedValue(input, path, value2) {
14413
+ const parsedInput = GatewayJsonObjectSchema.safeParse(input);
14414
+ if (!parsedInput.success) invalid("Input must be a finite JSON object");
14415
+ const result = cloneJson(parsedInput.data);
14416
+ assign(result, parsePath(path), parseJsonValue(value2), true);
14417
+ assertDenseArrays(result);
14418
+ return result;
14419
+ }
13529
14420
  // Annotate the CommonJS export names for ESM import in node:
13530
14421
  0 && (module.exports = {
13531
14422
  AIGatewayApiKeysClient,
@@ -13543,6 +14434,18 @@ var AIGatewayClient = class {
13543
14434
  AIGatewayWorkspacesClient,
13544
14435
  AIRS_ENDPOINTS,
13545
14436
  AISecSDKException,
14437
+ AI_GATEWAY_DEPLOYMENT_STATUSES,
14438
+ AI_GATEWAY_DEPLOYMENT_TYPES,
14439
+ AI_GATEWAY_KNOWN_API_KEY_SCOPES,
14440
+ AI_GATEWAY_KNOWN_CACHE_MODES,
14441
+ AI_GATEWAY_KNOWN_CONFIG_STRATEGIES,
14442
+ AI_GATEWAY_KNOWN_MCP_AUTH_TYPES,
14443
+ AI_GATEWAY_KNOWN_MCP_TRANSPORTS,
14444
+ AI_GATEWAY_KNOWN_RATE_LIMIT_TYPES,
14445
+ AI_GATEWAY_KNOWN_RATE_LIMIT_UNITS,
14446
+ AI_GATEWAY_MUTABLE_MCP_CAPABILITY_TYPES,
14447
+ AI_GATEWAY_REDACTED,
14448
+ AI_GATEWAY_SECRET_FIELDS,
13546
14449
  AI_GW_ADMIN_ENDPOINT,
13547
14450
  AI_GW_API_KEYS_SERVICE_PATH,
13548
14451
  AI_GW_API_KEYS_USER_PATH,
@@ -13794,39 +14697,100 @@ var AIGatewayClient = class {
13794
14697
  FileScanDataSchema,
13795
14698
  FileScanResult,
13796
14699
  FileType,
14700
+ GatewayApiKeyCreateRequestSchema,
14701
+ GatewayApiKeyRotateRequestSchema,
13797
14702
  GatewayApiKeyRotateResponseSchema,
14703
+ GatewayApiKeyRotationPolicySchema,
13798
14704
  GatewayApiKeySchema,
14705
+ GatewayApiKeyScopeSchema,
14706
+ GatewayApiKeyUpdateRequestSchema,
13799
14707
  GatewayAuditLogRecordSchema,
13800
14708
  GatewayAuditLogsResponseSchema,
14709
+ GatewayAzureAIConfigurationSchema,
14710
+ GatewayAzureDeploymentConfigurationSchema,
14711
+ GatewayAzureOpenAIConfigurationSchema,
14712
+ GatewayBedrockConfigurationSchema,
13801
14713
  GatewayChartRecordSchema,
14714
+ GatewayConfigCacheModeSchema,
14715
+ GatewayConfigCreateRequestSchema,
13802
14716
  GatewayConfigCreateResponseSchema,
13803
14717
  GatewayConfigDetailSchema,
13804
14718
  GatewayConfigSchema,
14719
+ GatewayConfigStrategySchema,
14720
+ GatewayConfigUpdateRequestSchema,
13805
14721
  GatewayConfigVersionSchema,
14722
+ GatewayCortexConfigurationSchema,
14723
+ GatewayCustomHostConfigurationSchema,
14724
+ GatewayDefaultsInputSchema,
14725
+ GatewayDeploymentAuthSettingsInputSchema,
14726
+ GatewayDeploymentCreateRequestSchema,
13806
14727
  GatewayDeploymentCreateResponseSchema,
13807
14728
  GatewayDeploymentDetailSchema,
13808
14729
  GatewayDeploymentPingResponseSchema,
13809
14730
  GatewayDeploymentSchema,
14731
+ GatewayDeploymentStatusSchema,
14732
+ GatewayDeploymentTypeSchema,
14733
+ GatewayDeploymentUpdateRequestSchema,
14734
+ GatewayGlobalWorkspaceAccessInputSchema,
13810
14735
  GatewayGlobalWorkspaceAccessSchema,
13811
14736
  GatewayGroupRowSchema,
14737
+ GatewayGuardrailActionsSchema,
14738
+ GatewayGuardrailCheckSchema,
14739
+ GatewayGuardrailCreateRequestSchema,
13812
14740
  GatewayGuardrailCreateResponseSchema,
13813
14741
  GatewayGuardrailDetailSchema,
13814
14742
  GatewayGuardrailSchema,
14743
+ GatewayGuardrailUpdateRequestSchema,
14744
+ GatewayHuggingFaceConfigurationSchema,
14745
+ GatewayIntegrationCreateRequestSchema,
14746
+ GatewayIntegrationModelUpdateSchema,
14747
+ GatewayIntegrationModelsBulkUpdateRequestSchema,
13815
14748
  GatewayIntegrationModelsResponseSchema,
13816
14749
  GatewayIntegrationSchema,
14750
+ GatewayIntegrationUpdateRequestSchema,
13817
14751
  GatewayIntegrationWorkspaceSchema,
14752
+ GatewayIntegrationWorkspacesBulkUpdateRequestSchema,
13818
14753
  GatewayIntegrationWorkspacesResponseSchema,
14754
+ GatewayJsonObjectSchema,
14755
+ GatewayJsonValueSchema,
13819
14756
  GatewayLogRecordSchema,
13820
14757
  GatewayLogsResponseSchema,
14758
+ GatewayMcpAuthTypeSchema,
14759
+ GatewayMcpTransportSchema,
14760
+ GatewayMutableMcpCapabilityTypeSchema,
14761
+ GatewayOpenAIConfigurationSchema,
14762
+ GatewayOrganisationAuthSettingsUpdateRequestSchema,
14763
+ GatewayOrganisationUpdateRequestSchema,
14764
+ GatewayPluginCreateRequestSchema,
13821
14765
  GatewayPluginSchema,
14766
+ GatewayProviderCreateRequestSchema,
13822
14767
  GatewayProviderCreateResponseSchema,
13823
14768
  GatewayProviderDetailSchema,
13824
14769
  GatewayProviderSchema,
14770
+ GatewayProviderUpdateRequestSchema,
14771
+ GatewayRateLimitInputSchema,
13825
14772
  GatewayRateLimitSchema,
14773
+ GatewayRateLimitTypeSchema,
14774
+ GatewayRateLimitUnitSchema,
14775
+ GatewayRoutingCacheSchema,
14776
+ GatewayRoutingConfigSchema,
14777
+ GatewayRoutingRetrySchema,
14778
+ GatewayRoutingStrategySchema,
14779
+ GatewayRoutingTargetSchema,
14780
+ GatewaySageMakerConfigurationSchema,
14781
+ GatewaySecretMappingSchema,
14782
+ GatewayServiceApiKeyCreateRequestSchema,
14783
+ GatewayUsageLimitInputSchema,
13826
14784
  GatewayUsageLimitSchema,
14785
+ GatewayUserApiKeyCreateRequestSchema,
14786
+ GatewayVertexAIConfigurationSchema,
14787
+ GatewayWorkersAIConfigurationSchema,
14788
+ GatewayWorkspaceBindingSchema,
14789
+ GatewayWorkspaceCreateRequestSchema,
13827
14790
  GatewayWorkspaceCreateResponseSchema,
13828
14791
  GatewayWorkspaceDetailSchema,
13829
14792
  GatewayWorkspaceSchema,
14793
+ GatewayWorkspaceUpdateRequestSchema,
13830
14794
  GatewayWriteResponseSchema,
13831
14795
  GoalListResponseSchema,
13832
14796
  GoalSchema,
@@ -13930,12 +14894,17 @@ var AIGatewayClient = class {
13930
14894
  MaskedDataSchema,
13931
14895
  McEntrySchema,
13932
14896
  McReportSchema,
14897
+ McpIntegrationCapabilitiesBulkUpdateRequestSchema,
13933
14898
  McpIntegrationCapabilitiesResponseSchema,
13934
14899
  McpIntegrationCapabilitiesUpdateResponseSchema,
13935
14900
  McpIntegrationCapabilitySchema,
14901
+ McpIntegrationCapabilityUpdateSchema,
14902
+ McpIntegrationCreateRequestSchema,
13936
14903
  McpIntegrationDetailSchema,
13937
14904
  McpIntegrationMetadataSchema,
13938
14905
  McpIntegrationSchema,
14906
+ McpIntegrationUpdateRequestSchema,
14907
+ McpIntegrationWorkspacesBulkUpdateRequestSchema,
13939
14908
  McpIntegrationWorkspacesUpdateResponseSchema,
13940
14909
  MetadataCriterionSchema,
13941
14910
  MetadataSchema,
@@ -14179,6 +15148,7 @@ var AIGatewayClient = class {
14179
15148
  WebSocketConnectionParamsSchema,
14180
15149
  WeightedRegexSchema,
14181
15150
  aiGwOrganisationsAuthSettingsPath,
15151
+ buildDottedObject,
14182
15152
  collectAll,
14183
15153
  collectSkipPages,
14184
15154
  collectSpringPages,
@@ -14187,6 +15157,8 @@ var AIGatewayClient = class {
14187
15157
  jsonNullable,
14188
15158
  pageSchema,
14189
15159
  paginate,
14190
- serializeListing
15160
+ redactAIGatewaySecrets,
15161
+ serializeListing,
15162
+ setDottedValue
14191
15163
  });
14192
15164
  //# sourceMappingURL=index.cjs.map