@cdot65/prisma-airs-sdk 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -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,35 +298,100 @@ __export(index_exports, {
286
298
  FileScanDataSchema: () => FileScanDataSchema,
287
299
  FileScanResult: () => FileScanResult,
288
300
  FileType: () => FileType,
301
+ GatewayApiKeyCreateRequestSchema: () => GatewayApiKeyCreateRequestSchema,
302
+ GatewayApiKeyRotateRequestSchema: () => GatewayApiKeyRotateRequestSchema,
303
+ GatewayApiKeyRotateResponseSchema: () => GatewayApiKeyRotateResponseSchema,
304
+ GatewayApiKeyRotationPolicySchema: () => GatewayApiKeyRotationPolicySchema,
289
305
  GatewayApiKeySchema: () => GatewayApiKeySchema,
306
+ GatewayApiKeyScopeSchema: () => GatewayApiKeyScopeSchema,
307
+ GatewayApiKeyUpdateRequestSchema: () => GatewayApiKeyUpdateRequestSchema,
290
308
  GatewayAuditLogRecordSchema: () => GatewayAuditLogRecordSchema,
291
309
  GatewayAuditLogsResponseSchema: () => GatewayAuditLogsResponseSchema,
310
+ GatewayAzureAIConfigurationSchema: () => GatewayAzureAIConfigurationSchema,
311
+ GatewayAzureDeploymentConfigurationSchema: () => GatewayAzureDeploymentConfigurationSchema,
312
+ GatewayAzureOpenAIConfigurationSchema: () => GatewayAzureOpenAIConfigurationSchema,
313
+ GatewayBedrockConfigurationSchema: () => GatewayBedrockConfigurationSchema,
292
314
  GatewayChartRecordSchema: () => GatewayChartRecordSchema,
315
+ GatewayConfigCacheModeSchema: () => GatewayConfigCacheModeSchema,
316
+ GatewayConfigCreateRequestSchema: () => GatewayConfigCreateRequestSchema,
293
317
  GatewayConfigCreateResponseSchema: () => GatewayConfigCreateResponseSchema,
294
318
  GatewayConfigDetailSchema: () => GatewayConfigDetailSchema,
295
319
  GatewayConfigSchema: () => GatewayConfigSchema,
320
+ GatewayConfigStrategySchema: () => GatewayConfigStrategySchema,
321
+ GatewayConfigUpdateRequestSchema: () => GatewayConfigUpdateRequestSchema,
322
+ GatewayConfigVersionSchema: () => GatewayConfigVersionSchema,
323
+ GatewayCortexConfigurationSchema: () => GatewayCortexConfigurationSchema,
324
+ GatewayCustomHostConfigurationSchema: () => GatewayCustomHostConfigurationSchema,
325
+ GatewayDefaultsInputSchema: () => GatewayDefaultsInputSchema,
326
+ GatewayDeploymentAuthSettingsInputSchema: () => GatewayDeploymentAuthSettingsInputSchema,
327
+ GatewayDeploymentCreateRequestSchema: () => GatewayDeploymentCreateRequestSchema,
296
328
  GatewayDeploymentCreateResponseSchema: () => GatewayDeploymentCreateResponseSchema,
297
329
  GatewayDeploymentDetailSchema: () => GatewayDeploymentDetailSchema,
330
+ GatewayDeploymentPingResponseSchema: () => GatewayDeploymentPingResponseSchema,
298
331
  GatewayDeploymentSchema: () => GatewayDeploymentSchema,
332
+ GatewayDeploymentStatusSchema: () => GatewayDeploymentStatusSchema,
333
+ GatewayDeploymentTypeSchema: () => GatewayDeploymentTypeSchema,
334
+ GatewayDeploymentUpdateRequestSchema: () => GatewayDeploymentUpdateRequestSchema,
335
+ GatewayGlobalWorkspaceAccessInputSchema: () => GatewayGlobalWorkspaceAccessInputSchema,
299
336
  GatewayGlobalWorkspaceAccessSchema: () => GatewayGlobalWorkspaceAccessSchema,
300
337
  GatewayGroupRowSchema: () => GatewayGroupRowSchema,
338
+ GatewayGuardrailActionsSchema: () => GatewayGuardrailActionsSchema,
339
+ GatewayGuardrailCheckSchema: () => GatewayGuardrailCheckSchema,
340
+ GatewayGuardrailCreateRequestSchema: () => GatewayGuardrailCreateRequestSchema,
301
341
  GatewayGuardrailCreateResponseSchema: () => GatewayGuardrailCreateResponseSchema,
302
342
  GatewayGuardrailDetailSchema: () => GatewayGuardrailDetailSchema,
303
343
  GatewayGuardrailSchema: () => GatewayGuardrailSchema,
344
+ GatewayGuardrailUpdateRequestSchema: () => GatewayGuardrailUpdateRequestSchema,
345
+ GatewayHuggingFaceConfigurationSchema: () => GatewayHuggingFaceConfigurationSchema,
346
+ GatewayIntegrationCreateRequestSchema: () => GatewayIntegrationCreateRequestSchema,
347
+ GatewayIntegrationModelUpdateSchema: () => GatewayIntegrationModelUpdateSchema,
348
+ GatewayIntegrationModelsBulkUpdateRequestSchema: () => GatewayIntegrationModelsBulkUpdateRequestSchema,
304
349
  GatewayIntegrationModelsResponseSchema: () => GatewayIntegrationModelsResponseSchema,
305
350
  GatewayIntegrationSchema: () => GatewayIntegrationSchema,
351
+ GatewayIntegrationUpdateRequestSchema: () => GatewayIntegrationUpdateRequestSchema,
306
352
  GatewayIntegrationWorkspaceSchema: () => GatewayIntegrationWorkspaceSchema,
353
+ GatewayIntegrationWorkspacesBulkUpdateRequestSchema: () => GatewayIntegrationWorkspacesBulkUpdateRequestSchema,
307
354
  GatewayIntegrationWorkspacesResponseSchema: () => GatewayIntegrationWorkspacesResponseSchema,
355
+ GatewayJsonObjectSchema: () => GatewayJsonObjectSchema,
356
+ GatewayJsonValueSchema: () => GatewayJsonValueSchema,
308
357
  GatewayLogRecordSchema: () => GatewayLogRecordSchema,
309
358
  GatewayLogsResponseSchema: () => GatewayLogsResponseSchema,
359
+ GatewayMcpAuthTypeSchema: () => GatewayMcpAuthTypeSchema,
360
+ GatewayMcpTransportSchema: () => GatewayMcpTransportSchema,
361
+ GatewayMutableMcpCapabilityTypeSchema: () => GatewayMutableMcpCapabilityTypeSchema,
362
+ GatewayOpenAIConfigurationSchema: () => GatewayOpenAIConfigurationSchema,
363
+ GatewayOrganisationAuthSettingsUpdateRequestSchema: () => GatewayOrganisationAuthSettingsUpdateRequestSchema,
364
+ GatewayOrganisationUpdateRequestSchema: () => GatewayOrganisationUpdateRequestSchema,
365
+ GatewayPluginCreateRequestSchema: () => GatewayPluginCreateRequestSchema,
310
366
  GatewayPluginSchema: () => GatewayPluginSchema,
367
+ GatewayProviderCreateRequestSchema: () => GatewayProviderCreateRequestSchema,
311
368
  GatewayProviderCreateResponseSchema: () => GatewayProviderCreateResponseSchema,
369
+ GatewayProviderDetailSchema: () => GatewayProviderDetailSchema,
312
370
  GatewayProviderSchema: () => GatewayProviderSchema,
371
+ GatewayProviderUpdateRequestSchema: () => GatewayProviderUpdateRequestSchema,
372
+ GatewayRateLimitInputSchema: () => GatewayRateLimitInputSchema,
313
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,
314
385
  GatewayUsageLimitSchema: () => GatewayUsageLimitSchema,
386
+ GatewayUserApiKeyCreateRequestSchema: () => GatewayUserApiKeyCreateRequestSchema,
387
+ GatewayVertexAIConfigurationSchema: () => GatewayVertexAIConfigurationSchema,
388
+ GatewayWorkersAIConfigurationSchema: () => GatewayWorkersAIConfigurationSchema,
389
+ GatewayWorkspaceBindingSchema: () => GatewayWorkspaceBindingSchema,
390
+ GatewayWorkspaceCreateRequestSchema: () => GatewayWorkspaceCreateRequestSchema,
315
391
  GatewayWorkspaceCreateResponseSchema: () => GatewayWorkspaceCreateResponseSchema,
316
392
  GatewayWorkspaceDetailSchema: () => GatewayWorkspaceDetailSchema,
317
393
  GatewayWorkspaceSchema: () => GatewayWorkspaceSchema,
394
+ GatewayWorkspaceUpdateRequestSchema: () => GatewayWorkspaceUpdateRequestSchema,
318
395
  GatewayWriteResponseSchema: () => GatewayWriteResponseSchema,
319
396
  GoalListResponseSchema: () => GoalListResponseSchema,
320
397
  GoalSchema: () => GoalSchema,
@@ -349,6 +426,7 @@ __export(index_exports, {
349
426
  LanguageOptionSchema: () => LanguageOptionSchema,
350
427
  LatencyChartResponseSchema: () => LatencyChartResponseSchema,
351
428
  ListApiKeysResponseSchema: () => ListApiKeysResponseSchema,
429
+ ListConfigVersionsResponseSchema: () => ListConfigVersionsResponseSchema,
352
430
  ListConfigsResponseSchema: () => ListConfigsResponseSchema,
353
431
  ListDeploymentsResponseSchema: () => ListDeploymentsResponseSchema,
354
432
  ListGuardrailsResponseSchema: () => ListGuardrailsResponseSchema,
@@ -417,7 +495,18 @@ __export(index_exports, {
417
495
  MaskedDataSchema: () => MaskedDataSchema,
418
496
  McEntrySchema: () => McEntrySchema,
419
497
  McReportSchema: () => McReportSchema,
498
+ McpIntegrationCapabilitiesBulkUpdateRequestSchema: () => McpIntegrationCapabilitiesBulkUpdateRequestSchema,
499
+ McpIntegrationCapabilitiesResponseSchema: () => McpIntegrationCapabilitiesResponseSchema,
500
+ McpIntegrationCapabilitiesUpdateResponseSchema: () => McpIntegrationCapabilitiesUpdateResponseSchema,
501
+ McpIntegrationCapabilitySchema: () => McpIntegrationCapabilitySchema,
502
+ McpIntegrationCapabilityUpdateSchema: () => McpIntegrationCapabilityUpdateSchema,
503
+ McpIntegrationCreateRequestSchema: () => McpIntegrationCreateRequestSchema,
504
+ McpIntegrationDetailSchema: () => McpIntegrationDetailSchema,
505
+ McpIntegrationMetadataSchema: () => McpIntegrationMetadataSchema,
420
506
  McpIntegrationSchema: () => McpIntegrationSchema,
507
+ McpIntegrationUpdateRequestSchema: () => McpIntegrationUpdateRequestSchema,
508
+ McpIntegrationWorkspacesBulkUpdateRequestSchema: () => McpIntegrationWorkspacesBulkUpdateRequestSchema,
509
+ McpIntegrationWorkspacesUpdateResponseSchema: () => McpIntegrationWorkspacesUpdateResponseSchema,
421
510
  MetadataCriterionSchema: () => MetadataCriterionSchema,
422
511
  MetadataSchema: () => MetadataSchema,
423
512
  ModelConfigurationSchema: () => ModelConfigurationSchema,
@@ -660,6 +749,7 @@ __export(index_exports, {
660
749
  WebSocketConnectionParamsSchema: () => WebSocketConnectionParamsSchema,
661
750
  WeightedRegexSchema: () => WeightedRegexSchema,
662
751
  aiGwOrganisationsAuthSettingsPath: () => aiGwOrganisationsAuthSettingsPath,
752
+ buildDottedObject: () => buildDottedObject,
663
753
  collectAll: () => collectAll,
664
754
  collectSkipPages: () => collectSkipPages,
665
755
  collectSpringPages: () => collectSpringPages,
@@ -668,7 +758,9 @@ __export(index_exports, {
668
758
  jsonNullable: () => jsonNullable,
669
759
  pageSchema: () => pageSchema,
670
760
  paginate: () => paginate,
671
- serializeListing: () => serializeListing
761
+ redactAIGatewaySecrets: () => redactAIGatewaySecrets,
762
+ serializeListing: () => serializeListing,
763
+ setDottedValue: () => setDottedValue
672
764
  });
673
765
  module.exports = __toCommonJS(index_exports);
674
766
 
@@ -703,7 +795,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
703
795
  var MAX_CONNECTION_POOL_SIZE = 100;
704
796
  var MAX_NUMBER_OF_RETRIES = 5;
705
797
  var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
706
- var SDK_VERSION = "0.17.0";
798
+ var SDK_VERSION = "0.20.0";
707
799
  var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
708
800
  var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
709
801
  var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
@@ -946,8 +1038,8 @@ var import_zod15 = require("zod");
946
1038
  // src/utils.ts
947
1039
  var import_node_crypto = require("crypto");
948
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;
949
- function isValidUuid(value) {
950
- return UUID_RE.test(value);
1041
+ function isValidUuid(value2) {
1042
+ return UUID_RE.test(value2);
951
1043
  }
952
1044
  function generatePayloadHash(payload, secret) {
953
1045
  return (0, import_node_crypto.createHmac)("sha256", secret).update(payload).digest("hex");
@@ -1007,9 +1099,9 @@ function extractErrorMessage(body, status) {
1007
1099
  return body ? `API error ${status}: ${body}` : `API error ${status}`;
1008
1100
  }
1009
1101
  }
1010
- function parseRetryAfterHeader(value) {
1011
- if (value === null) return void 0;
1012
- const normalized = value.trim();
1102
+ function parseRetryAfterHeader(value2) {
1103
+ if (value2 === null) return void 0;
1104
+ const normalized = value2.trim();
1013
1105
  if (/^\d+$/.test(normalized)) {
1014
1106
  const milliseconds = Number(normalized) * 1e3;
1015
1107
  return Number.isFinite(milliseconds) ? milliseconds : void 0;
@@ -1111,6 +1203,120 @@ async function executeWithRetry(opts) {
1111
1203
 
1112
1204
  // src/http/debug.ts
1113
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
1114
1320
  var TRUTHY = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
1115
1321
  var SENSITIVE_HEADERS = /* @__PURE__ */ new Set([HEADER_AUTH_TOKEN.toLowerCase(), HEADER_API_KEY.toLowerCase()]);
1116
1322
  var PREFIX = "[airs-sdk]";
@@ -1118,16 +1324,23 @@ function isDebugEnabled() {
1118
1324
  const raw = process.env.PANW_AI_SEC_DEBUG;
1119
1325
  return raw !== void 0 && TRUTHY.has(raw.trim().toLowerCase());
1120
1326
  }
1121
- function hashToken(value) {
1122
- 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);
1123
1329
  }
1124
1330
  function sanitizeHeaders(headers) {
1125
1331
  const out = {};
1126
- for (const [key, value] of Object.entries(headers)) {
1127
- 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;
1128
1334
  }
1129
1335
  return out;
1130
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
+ }
1131
1344
  function logRequest(method, url, headers, body) {
1132
1345
  console.error(`${PREFIX} \u2192 ${method} ${url}`);
1133
1346
  console.error(`${PREFIX} headers ${JSON.stringify(sanitizeHeaders(headers))}`);
@@ -1139,6 +1352,20 @@ function logResponse(status, ms, body) {
1139
1352
 
1140
1353
  // src/http/request.ts
1141
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
+ }
1142
1369
  let hasRetriedAuth = false;
1143
1370
  const debug = isDebugEnabled();
1144
1371
  const response = await executeWithRetry({
@@ -1147,11 +1374,11 @@ async function request(spec) {
1147
1374
  const baseUrl = spec.baseUrl.replace(/\/+$/, "");
1148
1375
  const url = new URL(`${baseUrl}${spec.path}`);
1149
1376
  if (spec.params) {
1150
- for (const [key, value] of Object.entries(spec.params)) {
1151
- if (Array.isArray(value)) {
1152
- 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);
1153
1380
  } else {
1154
- url.searchParams.set(key, value);
1381
+ url.searchParams.set(key, value2);
1155
1382
  }
1156
1383
  }
1157
1384
  }
@@ -1163,16 +1390,19 @@ async function request(spec) {
1163
1390
  let bodyForFetch;
1164
1391
  if (spec.formData !== void 0) {
1165
1392
  bodyForFetch = spec.formData;
1166
- } else if (spec.body !== void 0) {
1393
+ } else if (validatedBody !== void 0) {
1167
1394
  headers["Content-Type"] = spec.contentType ?? "application/json";
1168
- bodyText = JSON.stringify(spec.body);
1395
+ bodyText = JSON.stringify(validatedBody);
1169
1396
  bodyForFetch = bodyText;
1170
1397
  }
1171
1398
  const prepared = { method: spec.method, url, headers, bodyText };
1172
1399
  const final = await spec.auth.prepare(prepared);
1173
1400
  const startedAt = debug ? Date.now() : 0;
1174
1401
  if (debug) {
1175
- 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
+ }
1176
1406
  logRequest(final.method, final.url.toString(), final.headers, logBody);
1177
1407
  }
1178
1408
  const res = await fetch(final.url.toString(), {
@@ -1184,6 +1414,9 @@ async function request(spec) {
1184
1414
  let respBody;
1185
1415
  try {
1186
1416
  respBody = await res.clone().text();
1417
+ if (respBody && spec.secretOperation !== void 0) {
1418
+ respBody = sanitizeAIGatewayDebugBody(respBody, spec.secretOperation, "response");
1419
+ }
1187
1420
  } catch {
1188
1421
  }
1189
1422
  logResponse(res.status, Date.now() - startedAt, respBody);
@@ -1837,14 +2070,14 @@ var Content = class _Content {
1837
2070
  get prompt() {
1838
2071
  return this._prompt;
1839
2072
  }
1840
- set prompt(value) {
1841
- 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) {
1842
2075
  throw new AISecSDKException(
1843
2076
  `prompt exceeds max length of ${MAX_CONTENT_PROMPT_LENGTH} bytes`,
1844
2077
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1845
2078
  );
1846
2079
  }
1847
- this._prompt = value;
2080
+ this._prompt = value2;
1848
2081
  }
1849
2082
  /**
1850
2083
  * AI model response text. Setting a value validates its byte length (max 2 MB).
@@ -1859,14 +2092,14 @@ var Content = class _Content {
1859
2092
  get response() {
1860
2093
  return this._response;
1861
2094
  }
1862
- set response(value) {
1863
- 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) {
1864
2097
  throw new AISecSDKException(
1865
2098
  `response exceeds max length of ${MAX_CONTENT_RESPONSE_LENGTH} bytes`,
1866
2099
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1867
2100
  );
1868
2101
  }
1869
- this._response = value;
2102
+ this._response = value2;
1870
2103
  }
1871
2104
  /**
1872
2105
  * Conversation context. Setting a value validates its byte length (max 100 MB).
@@ -1881,14 +2114,14 @@ var Content = class _Content {
1881
2114
  get context() {
1882
2115
  return this._context;
1883
2116
  }
1884
- set context(value) {
1885
- 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) {
1886
2119
  throw new AISecSDKException(
1887
2120
  `context exceeds max length of ${MAX_CONTENT_CONTEXT_LENGTH} bytes`,
1888
2121
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1889
2122
  );
1890
2123
  }
1891
- this._context = value;
2124
+ this._context = value2;
1892
2125
  }
1893
2126
  /**
1894
2127
  * Code prompt text. Setting a value validates its byte length (max 2 MB).
@@ -1903,14 +2136,14 @@ var Content = class _Content {
1903
2136
  get codePrompt() {
1904
2137
  return this._codePrompt;
1905
2138
  }
1906
- set codePrompt(value) {
1907
- 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) {
1908
2141
  throw new AISecSDKException(
1909
2142
  `codePrompt exceeds max length of ${MAX_CONTENT_PROMPT_LENGTH} bytes`,
1910
2143
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1911
2144
  );
1912
2145
  }
1913
- this._codePrompt = value;
2146
+ this._codePrompt = value2;
1914
2147
  }
1915
2148
  /**
1916
2149
  * Code response text. Setting a value validates its byte length (max 2 MB).
@@ -1925,14 +2158,14 @@ var Content = class _Content {
1925
2158
  get codeResponse() {
1926
2159
  return this._codeResponse;
1927
2160
  }
1928
- set codeResponse(value) {
1929
- 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) {
1930
2163
  throw new AISecSDKException(
1931
2164
  `codeResponse exceeds max length of ${MAX_CONTENT_RESPONSE_LENGTH} bytes`,
1932
2165
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
1933
2166
  );
1934
2167
  }
1935
- this._codeResponse = value;
2168
+ this._codeResponse = value2;
1936
2169
  }
1937
2170
  /**
1938
2171
  * Tool/function call event data attached to the content.
@@ -1950,8 +2183,8 @@ var Content = class _Content {
1950
2183
  get toolEvent() {
1951
2184
  return this._toolEvent;
1952
2185
  }
1953
- set toolEvent(value) {
1954
- this._toolEvent = value;
2186
+ set toolEvent(value2) {
2187
+ this._toolEvent = value2;
1955
2188
  }
1956
2189
  /**
1957
2190
  * Total byte length of all text content fields.
@@ -3367,7 +3600,7 @@ var RuleEvaluationListSchema = import_zod32.z.object({
3367
3600
  }).passthrough();
3368
3601
  var ViolationRemediationSchema = import_zod32.z.object({
3369
3602
  steps: import_zod32.z.array(import_zod32.z.string()),
3370
- url: import_zod32.z.string()
3603
+ url: import_zod32.z.string().optional()
3371
3604
  }).passthrough();
3372
3605
  var ViolationResponseSchema = import_zod32.z.object({
3373
3606
  uuid: import_zod32.z.string(),
@@ -3379,7 +3612,7 @@ var ViolationResponseSchema = import_zod32.z.object({
3379
3612
  rule_name: import_zod32.z.string(),
3380
3613
  rule_description: import_zod32.z.string(),
3381
3614
  rule_instance_state: import_zod32.z.string(),
3382
- remediation: ViolationRemediationSchema,
3615
+ remediation: ViolationRemediationSchema.optional(),
3383
3616
  file: import_zod32.z.string().nullable().optional(),
3384
3617
  hash: import_zod32.z.string().nullable().optional(),
3385
3618
  module: import_zod32.z.string().nullable().optional(),
@@ -3431,12 +3664,12 @@ var ListModelSecurityRulesResponseSchema = import_zod32.z.object({
3431
3664
  var ModelSecurityRuleInstanceResponseSchema = import_zod32.z.object({
3432
3665
  uuid: import_zod32.z.string(),
3433
3666
  tsg_id: import_zod32.z.string(),
3434
- created_at: import_zod32.z.string(),
3435
- updated_at: import_zod32.z.string(),
3667
+ created_at: import_zod32.z.string().optional(),
3668
+ updated_at: import_zod32.z.string().optional(),
3436
3669
  security_group_uuid: import_zod32.z.string(),
3437
- security_rule_uuid: import_zod32.z.string(),
3670
+ security_rule_uuid: import_zod32.z.string().optional(),
3438
3671
  state: import_zod32.z.string(),
3439
- rule: ModelSecurityRuleResponseSchema,
3672
+ rule: ModelSecurityRuleResponseSchema.optional(),
3440
3673
  field_values: import_zod32.z.record(import_zod32.z.unknown()).optional()
3441
3674
  }).passthrough();
3442
3675
  var ModelSecurityRuleInstanceUpdateRequestSchema = import_zod32.z.object({
@@ -5117,6 +5350,11 @@ var GatewayConfigDetailSchema = GatewayConfigSchema.extend({
5117
5350
  type: import_zod35.z.string(),
5118
5351
  version_id: import_zod35.z.string()
5119
5352
  }).passthrough();
5353
+ var GatewayConfigVersionSchema = GatewayConfigDetailSchema.extend({
5354
+ version_created_at: import_zod35.z.string(),
5355
+ version_owner_id: import_zod35.z.string()
5356
+ }).passthrough();
5357
+ var ListConfigVersionsResponseSchema = aiGatewayList(GatewayConfigVersionSchema);
5120
5358
  var GatewayConfigCreateResponseSchema = import_zod35.z.object({
5121
5359
  id: import_zod35.z.string(),
5122
5360
  version_id: import_zod35.z.string(),
@@ -5154,8 +5392,8 @@ var GatewayGuardrailDetailSchema = GatewayGuardrailSchema.extend({
5154
5392
  async: import_zod35.z.boolean(),
5155
5393
  sequential: import_zod35.z.boolean(),
5156
5394
  /** Absent when the guardrail was created without a pass/fail feedback action. */
5157
- on_success: guardrailFeedbackActionSchema.optional(),
5158
- on_fail: guardrailFeedbackActionSchema.optional()
5395
+ on_success: guardrailFeedbackActionSchema.nullable().optional(),
5396
+ on_fail: guardrailFeedbackActionSchema.nullable().optional()
5159
5397
  }).passthrough(),
5160
5398
  version_id: import_zod35.z.string()
5161
5399
  }).passthrough();
@@ -5172,6 +5410,27 @@ var GatewayProviderSchema = import_zod35.z.object({
5172
5410
  object: import_zod35.z.string().optional()
5173
5411
  }).passthrough();
5174
5412
  var ListProvidersResponseSchema = aiGatewayList(GatewayProviderSchema);
5413
+ var GatewayProviderDetailSchema = import_zod35.z.object({
5414
+ id: import_zod35.z.string(),
5415
+ ai_provider_name: import_zod35.z.string(),
5416
+ model_config: import_zod35.z.record(import_zod35.z.unknown()),
5417
+ /** Potentially secret-bearing. Never log or persist this field. */
5418
+ key: import_zod35.z.string(),
5419
+ masked_api_key: import_zod35.z.string(),
5420
+ slug: import_zod35.z.string(),
5421
+ name: import_zod35.z.string(),
5422
+ usage_limits: import_zod35.z.unknown().nullable(),
5423
+ status: import_zod35.z.string(),
5424
+ note: import_zod35.z.string().nullable(),
5425
+ created_at: import_zod35.z.string(),
5426
+ expires_at: import_zod35.z.string().nullable(),
5427
+ last_reset_at: import_zod35.z.string().nullable(),
5428
+ rate_limits: import_zod35.z.array(import_zod35.z.unknown()),
5429
+ integration_id: import_zod35.z.string(),
5430
+ tags: import_zod35.z.unknown().nullable(),
5431
+ secret_mappings: import_zod35.z.array(import_zod35.z.unknown()).optional(),
5432
+ object: import_zod35.z.string()
5433
+ }).passthrough();
5175
5434
  var GatewayProviderCreateResponseSchema = import_zod35.z.object({
5176
5435
  id: import_zod35.z.string(),
5177
5436
  slug: import_zod35.z.string(),
@@ -5183,6 +5442,11 @@ var GatewayApiKeySchema = import_zod35.z.object({
5183
5442
  object: import_zod35.z.string().optional()
5184
5443
  }).passthrough();
5185
5444
  var ListApiKeysResponseSchema = aiGatewayList(GatewayApiKeySchema);
5445
+ var GatewayApiKeyRotateResponseSchema = import_zod35.z.object({
5446
+ id: import_zod35.z.string(),
5447
+ key: import_zod35.z.string(),
5448
+ key_transition_expires_at: import_zod35.z.string()
5449
+ }).passthrough();
5186
5450
  var GatewayIntegrationSchema = import_zod35.z.object({
5187
5451
  id: import_zod35.z.string(),
5188
5452
  organisation_id: import_zod35.z.string().optional(),
@@ -5213,7 +5477,7 @@ var GatewayIntegrationWorkspaceSchema = import_zod35.z.object({
5213
5477
  enabled: import_zod35.z.boolean(),
5214
5478
  status: import_zod35.z.string(),
5215
5479
  created_at: import_zod35.z.string(),
5216
- last_updated_at: import_zod35.z.string(),
5480
+ last_updated_at: import_zod35.z.string().nullable(),
5217
5481
  last_reset_at: import_zod35.z.string().nullable()
5218
5482
  }).passthrough();
5219
5483
  var GatewayGlobalWorkspaceAccessSchema = import_zod35.z.object({
@@ -5246,6 +5510,70 @@ var McpIntegrationSchema = import_zod35.z.object({
5246
5510
  last_updated_at: import_zod35.z.string()
5247
5511
  }).passthrough();
5248
5512
  var ListMcpIntegrationsResponseSchema = aiGatewayList(McpIntegrationSchema);
5513
+ var McpIntegrationDetailSchema = import_zod35.z.object({
5514
+ id: import_zod35.z.string(),
5515
+ name: import_zod35.z.string(),
5516
+ description: import_zod35.z.string().nullable(),
5517
+ owner_id: import_zod35.z.string(),
5518
+ status: import_zod35.z.string(),
5519
+ created_at: import_zod35.z.string(),
5520
+ last_updated_at: import_zod35.z.string(),
5521
+ configurations: import_zod35.z.record(import_zod35.z.unknown()),
5522
+ global_workspace_access: import_zod35.z.object({ enabled: import_zod35.z.boolean() }).passthrough().nullable(),
5523
+ workspace_id: import_zod35.z.string().nullable(),
5524
+ slug: import_zod35.z.string(),
5525
+ url: import_zod35.z.string(),
5526
+ auth_type: import_zod35.z.string(),
5527
+ transport: import_zod35.z.string(),
5528
+ type: import_zod35.z.string(),
5529
+ secret_mappings: import_zod35.z.array(import_zod35.z.unknown()).nullable(),
5530
+ object: import_zod35.z.string()
5531
+ }).passthrough();
5532
+ var McpCapabilityCountSchema = import_zod35.z.object({ total: import_zod35.z.number(), enabled: import_zod35.z.number() }).passthrough();
5533
+ var McpIntegrationCapabilitySchema = import_zod35.z.object({
5534
+ name: import_zod35.z.string(),
5535
+ type: import_zod35.z.string(),
5536
+ title: import_zod35.z.string().nullable(),
5537
+ description: import_zod35.z.string().nullable(),
5538
+ icons: import_zod35.z.unknown().nullable(),
5539
+ enabled: import_zod35.z.boolean(),
5540
+ created_at: import_zod35.z.string(),
5541
+ last_updated_at: import_zod35.z.string(),
5542
+ input_schema: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5543
+ output_schema: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5544
+ execution: import_zod35.z.unknown().nullable(),
5545
+ annotations: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
5546
+ object: import_zod35.z.string()
5547
+ }).passthrough();
5548
+ var McpIntegrationCapabilitiesResponseSchema = import_zod35.z.object({
5549
+ object: import_zod35.z.string(),
5550
+ counts: import_zod35.z.object({
5551
+ tools: McpCapabilityCountSchema.optional(),
5552
+ prompts: McpCapabilityCountSchema.optional(),
5553
+ resources: McpCapabilityCountSchema.optional(),
5554
+ resource_templates: McpCapabilityCountSchema.optional()
5555
+ }).passthrough(),
5556
+ total: import_zod35.z.number(),
5557
+ has_more: import_zod35.z.boolean(),
5558
+ data: import_zod35.z.array(McpIntegrationCapabilitySchema)
5559
+ }).passthrough();
5560
+ var McpIntegrationCapabilitiesUpdateResponseSchema = import_zod35.z.object({ success: import_zod35.z.boolean() }).passthrough();
5561
+ var McpIntegrationWorkspacesUpdateResponseSchema = import_zod35.z.object({}).strict();
5562
+ var McpIntegrationMetadataSchema = import_zod35.z.object({
5563
+ server_name: import_zod35.z.string(),
5564
+ server_version: import_zod35.z.string(),
5565
+ title: import_zod35.z.string().nullable(),
5566
+ description: import_zod35.z.string().nullable(),
5567
+ website_url: import_zod35.z.string().nullable(),
5568
+ icons: import_zod35.z.unknown().nullable(),
5569
+ protocol_version: import_zod35.z.string().nullable(),
5570
+ capability_flags: import_zod35.z.record(import_zod35.z.unknown()),
5571
+ instructions: import_zod35.z.string().nullable(),
5572
+ sync_status: import_zod35.z.string(),
5573
+ last_synced_at: import_zod35.z.string().nullable(),
5574
+ sync_error: import_zod35.z.string().nullable(),
5575
+ object: import_zod35.z.string()
5576
+ }).passthrough();
5249
5577
  var GatewayDeploymentSchema = import_zod35.z.object({
5250
5578
  id: import_zod35.z.string(),
5251
5579
  name: import_zod35.z.string(),
@@ -5281,6 +5609,18 @@ var GatewayDeploymentCreateResponseSchema = import_zod35.z.object({
5281
5609
  organisation_id: import_zod35.z.string(),
5282
5610
  object: import_zod35.z.string()
5283
5611
  }).passthrough();
5612
+ var GatewayDeploymentPingResponseSchema = import_zod35.z.object({
5613
+ status: import_zod35.z.string(),
5614
+ gateway_base_url: import_zod35.z.string(),
5615
+ outbound: import_zod35.z.object({
5616
+ status: import_zod35.z.string(),
5617
+ status_code: import_zod35.z.number().optional(),
5618
+ version: import_zod35.z.string().optional(),
5619
+ error: import_zod35.z.string().optional()
5620
+ }).passthrough(),
5621
+ inbound: import_zod35.z.object({ status: import_zod35.z.string(), error: import_zod35.z.string().optional() }).passthrough(),
5622
+ object: import_zod35.z.string()
5623
+ }).passthrough();
5284
5624
  var ListDeploymentsResponseSchema = aiGatewayList(GatewayDeploymentSchema);
5285
5625
  var GatewayPluginSchema = import_zod35.z.object({
5286
5626
  id: import_zod35.z.string(),
@@ -5318,6 +5658,472 @@ var GatewayAuditLogRecordSchema = import_zod35.z.object({
5318
5658
  }).passthrough();
5319
5659
  var GatewayAuditLogsResponseSchema = import_zod35.z.object({ records: import_zod35.z.array(GatewayAuditLogRecordSchema) }).passthrough();
5320
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
+
5321
6127
  // src/http/auth/oauth.ts
5322
6128
  var OAuthAuth = class {
5323
6129
  constructor(oauthClient) {
@@ -5340,12 +6146,12 @@ var OAuthAuth = class {
5340
6146
  };
5341
6147
 
5342
6148
  // src/models/oauth-token.ts
5343
- var import_zod36 = require("zod");
5344
- var OAuthTokenResponseSchema = import_zod36.z.object({
5345
- access_token: import_zod36.z.string(),
5346
- token_type: import_zod36.z.string().optional(),
5347
- expires_in: import_zod36.z.number(),
5348
- 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()
5349
6155
  }).passthrough();
5350
6156
 
5351
6157
  // src/management/oauth-client.ts
@@ -5563,26 +6369,26 @@ function resolveOAuthConfig(opts) {
5563
6369
  }
5564
6370
 
5565
6371
  // src/validators.ts
5566
- function assertUuid(value, fieldName) {
5567
- if (!isValidUuid(value)) {
6372
+ function assertUuid(value2, fieldName) {
6373
+ if (!isValidUuid(value2)) {
5568
6374
  throw new AISecSDKException(
5569
- `Invalid ${fieldName}: ${value}`,
6375
+ `Invalid ${fieldName}: ${value2}`,
5570
6376
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5571
6377
  );
5572
6378
  }
5573
6379
  }
5574
- function assertWorkspaceRef(value, fieldName) {
5575
- 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)) {
5576
6382
  throw new AISecSDKException(
5577
- `Invalid ${fieldName}: ${value} (expected a workspace UUID or slug)`,
6383
+ `Invalid ${fieldName}: ${value2} (expected a workspace UUID or slug)`,
5578
6384
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5579
6385
  );
5580
6386
  }
5581
6387
  }
5582
- function assertNumericId(value, fieldName) {
5583
- if (!/^\d+$/.test(value)) {
6388
+ function assertNumericId(value2, fieldName) {
6389
+ if (!/^\d+$/.test(value2)) {
5584
6390
  throw new AISecSDKException(
5585
- `Invalid ${fieldName}: ${value}`,
6391
+ `Invalid ${fieldName}: ${value2}`,
5586
6392
  "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
5587
6393
  );
5588
6394
  }
@@ -6451,7 +7257,7 @@ var ScanLogsClient = class {
6451
7257
  };
6452
7258
 
6453
7259
  // src/management/oauth-management.ts
6454
- var import_zod37 = require("zod");
7260
+ var import_zod39 = require("zod");
6455
7261
  var OAuthManagementClient = class {
6456
7262
  baseUrl;
6457
7263
  auth;
@@ -6485,7 +7291,7 @@ var OAuthManagementClient = class {
6485
7291
  path: MGMT_OAUTH_INVALIDATE_PATH,
6486
7292
  params: { token },
6487
7293
  body,
6488
- responseSchema: import_zod37.z.string(),
7294
+ responseSchema: import_zod39.z.string(),
6489
7295
  auth: this.auth,
6490
7296
  numRetries: this.numRetries
6491
7297
  });
@@ -7549,12 +8355,12 @@ var ModelSecurityScansClient = class {
7549
8355
  * // { uuid: '550e8400-...', eval_outcome: 'ALLOWED', model_uri: 'hf://org/model', ... }
7550
8356
  * ```
7551
8357
  */
7552
- async get(uuid) {
7553
- assertUuid(uuid, "scan uuid");
8358
+ async get(uuid2) {
8359
+ assertUuid(uuid2, "scan uuid");
7554
8360
  return request({
7555
8361
  method: "GET",
7556
8362
  baseUrl: this.baseUrl,
7557
- path: `${MODEL_SEC_SCANS_PATH}/${uuid}`,
8363
+ path: `${MODEL_SEC_SCANS_PATH}/${uuid2}`,
7558
8364
  responseSchema: ScanBaseResponseSchema,
7559
8365
  auth: this.auth,
7560
8366
  numRetries: this.numRetries
@@ -7791,12 +8597,12 @@ var ModelSecurityScansClient = class {
7791
8597
  * // { uuid: '660e8400-...', rule_name: 'Pickle Scan', result: 'FAILED', violation_count: 2, ... }
7792
8598
  * ```
7793
8599
  */
7794
- async getEvaluation(uuid) {
7795
- assertUuid(uuid, "evaluation uuid");
8600
+ async getEvaluation(uuid2) {
8601
+ assertUuid(uuid2, "evaluation uuid");
7796
8602
  return request({
7797
8603
  method: "GET",
7798
8604
  baseUrl: this.baseUrl,
7799
- path: `${MODEL_SEC_EVALUATIONS_PATH}/${uuid}`,
8605
+ path: `${MODEL_SEC_EVALUATIONS_PATH}/${uuid2}`,
7800
8606
  responseSchema: RuleEvaluationResponseSchema,
7801
8607
  auth: this.auth,
7802
8608
  numRetries: this.numRetries
@@ -7816,12 +8622,12 @@ var ModelSecurityScansClient = class {
7816
8622
  * // { uuid: '660e8400-...', rule_name: 'Pickle Scan', description: 'Unsafe pickle opcode', ... }
7817
8623
  * ```
7818
8624
  */
7819
- async getViolation(uuid) {
7820
- assertUuid(uuid, "violation uuid");
8625
+ async getViolation(uuid2) {
8626
+ assertUuid(uuid2, "violation uuid");
7821
8627
  return request({
7822
8628
  method: "GET",
7823
8629
  baseUrl: this.baseUrl,
7824
- path: `${MODEL_SEC_VIOLATIONS_PATH}/${uuid}`,
8630
+ path: `${MODEL_SEC_VIOLATIONS_PATH}/${uuid2}`,
7825
8631
  responseSchema: ViolationResponseSchema,
7826
8632
  auth: this.auth,
7827
8633
  numRetries: this.numRetries
@@ -7934,12 +8740,12 @@ var ModelSecurityGroupsClient = class {
7934
8740
  * // { uuid: '550e8400-...', name: 'hf-strict', source_type: 'HUGGING_FACE', state: 'ACTIVE', ... }
7935
8741
  * ```
7936
8742
  */
7937
- async get(uuid) {
7938
- assertUuid(uuid, "security group uuid");
8743
+ async get(uuid2) {
8744
+ assertUuid(uuid2, "security group uuid");
7939
8745
  return request({
7940
8746
  method: "GET",
7941
8747
  baseUrl: this.baseUrl,
7942
- path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
8748
+ path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid2}`,
7943
8749
  responseSchema: ModelSecurityGroupResponseSchema,
7944
8750
  auth: this.auth,
7945
8751
  numRetries: this.numRetries
@@ -7963,12 +8769,12 @@ var ModelSecurityGroupsClient = class {
7963
8769
  * // { uuid: '550e8400-...', name: 'hf-strict-v2', state: 'ACTIVE', ... }
7964
8770
  * ```
7965
8771
  */
7966
- async update(uuid, body) {
7967
- assertUuid(uuid, "security group uuid");
8772
+ async update(uuid2, body) {
8773
+ assertUuid(uuid2, "security group uuid");
7968
8774
  return request({
7969
8775
  method: "PUT",
7970
8776
  baseUrl: this.baseUrl,
7971
- path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
8777
+ path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid2}`,
7972
8778
  body,
7973
8779
  responseSchema: ModelSecurityGroupResponseSchema,
7974
8780
  auth: this.auth,
@@ -7988,12 +8794,12 @@ var ModelSecurityGroupsClient = class {
7988
8794
  * // resolves to undefined on success
7989
8795
  * ```
7990
8796
  */
7991
- async delete(uuid) {
7992
- assertUuid(uuid, "security group uuid");
8797
+ async delete(uuid2) {
8798
+ assertUuid(uuid2, "security group uuid");
7993
8799
  await request({
7994
8800
  method: "DELETE",
7995
8801
  baseUrl: this.baseUrl,
7996
- path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
8802
+ path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid2}`,
7997
8803
  auth: this.auth,
7998
8804
  numRetries: this.numRetries
7999
8805
  });
@@ -8156,12 +8962,12 @@ var ModelSecurityRulesClient = class {
8156
8962
  * // { uuid: '550e8400-...', name: 'Pickle Scan', rule_type: 'ARTIFACT', default_state: 'BLOCKING', ... }
8157
8963
  * ```
8158
8964
  */
8159
- async get(uuid) {
8160
- assertUuid(uuid, "security rule uuid");
8965
+ async get(uuid2) {
8966
+ assertUuid(uuid2, "security rule uuid");
8161
8967
  return request({
8162
8968
  method: "GET",
8163
8969
  baseUrl: this.baseUrl,
8164
- path: `${MODEL_SEC_SECURITY_RULES_PATH}/${uuid}`,
8970
+ path: `${MODEL_SEC_SECURITY_RULES_PATH}/${uuid2}`,
8165
8971
  responseSchema: ModelSecurityRuleResponseSchema,
8166
8972
  auth: this.auth,
8167
8973
  numRetries: this.numRetries
@@ -8242,12 +9048,12 @@ var ModelSecurityModelsClient = class {
8242
9048
  * // { uuid: '550e8400-...', name: 'org/model', latest_version_uuid: '660e8400-...', latest_version_outcome: 'PASSED' }
8243
9049
  * ```
8244
9050
  */
8245
- async getModel(uuid) {
8246
- assertUuid(uuid, "model uuid");
9051
+ async getModel(uuid2) {
9052
+ assertUuid(uuid2, "model uuid");
8247
9053
  return request({
8248
9054
  method: "GET",
8249
9055
  baseUrl: this.baseUrl,
8250
- path: `${MODEL_SEC_MODELS_PATH}/${uuid}`,
9056
+ path: `${MODEL_SEC_MODELS_PATH}/${uuid2}`,
8251
9057
  responseSchema: ModelResponseSchema,
8252
9058
  auth: this.auth,
8253
9059
  numRetries: this.numRetries
@@ -8305,12 +9111,12 @@ var ModelSecurityModelsClient = class {
8305
9111
  * // { uuid: '660e8400-...', revision: 'main', model_uuid: '550e8400-...', last_eval_outcome: 'PASSED' }
8306
9112
  * ```
8307
9113
  */
8308
- async getModelVersion(uuid) {
8309
- assertUuid(uuid, "model version uuid");
9114
+ async getModelVersion(uuid2) {
9115
+ assertUuid(uuid2, "model version uuid");
8310
9116
  return request({
8311
9117
  method: "GET",
8312
9118
  baseUrl: this.baseUrl,
8313
- path: `${MODEL_SEC_MODEL_VERSIONS_PATH}/${uuid}`,
9119
+ path: `${MODEL_SEC_MODEL_VERSIONS_PATH}/${uuid2}`,
8314
9120
  responseSchema: ModelVersionResponseSchema,
8315
9121
  auth: this.auth,
8316
9122
  numRetries: this.numRetries
@@ -8423,7 +9229,7 @@ var ModelSecurityClient = class {
8423
9229
  };
8424
9230
 
8425
9231
  // src/red-team/scans-client.ts
8426
- var import_zod38 = require("zod");
9232
+ var import_zod40 = require("zod");
8427
9233
  var RedTeamScansClient = class {
8428
9234
  baseUrl;
8429
9235
  auth;
@@ -8567,7 +9373,7 @@ var RedTeamScansClient = class {
8567
9373
  method: "GET",
8568
9374
  baseUrl: this.baseUrl,
8569
9375
  path: RED_TEAM_CATEGORIES_PATH,
8570
- responseSchema: import_zod38.z.array(CategoryModelSchema),
9376
+ responseSchema: import_zod40.z.array(CategoryModelSchema),
8571
9377
  auth: this.auth,
8572
9378
  numRetries: this.numRetries
8573
9379
  });
@@ -8575,7 +9381,7 @@ var RedTeamScansClient = class {
8575
9381
  };
8576
9382
 
8577
9383
  // src/red-team/reports-client.ts
8578
- var import_zod39 = require("zod");
9384
+ var import_zod41 = require("zod");
8579
9385
  var RedTeamReportsClient = class {
8580
9386
  baseUrl;
8581
9387
  auth;
@@ -8950,7 +9756,7 @@ var RedTeamReportsClient = class {
8950
9756
  baseUrl: this.baseUrl,
8951
9757
  path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
8952
9758
  params: { file_format: format },
8953
- responseSchema: import_zod39.z.unknown(),
9759
+ responseSchema: import_zod41.z.unknown(),
8954
9760
  auth: this.auth,
8955
9761
  numRetries: this.numRetries
8956
9762
  });
@@ -8974,7 +9780,7 @@ var RedTeamReportsClient = class {
8974
9780
  method: "POST",
8975
9781
  baseUrl: this.baseUrl,
8976
9782
  path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
8977
- responseSchema: import_zod39.z.unknown(),
9783
+ responseSchema: import_zod41.z.unknown(),
8978
9784
  auth: this.auth,
8979
9785
  numRetries: this.numRetries
8980
9786
  });
@@ -8982,7 +9788,7 @@ var RedTeamReportsClient = class {
8982
9788
  };
8983
9789
 
8984
9790
  // src/red-team/custom-attack-reports-client.ts
8985
- var import_zod40 = require("zod");
9791
+ var import_zod42 = require("zod");
8986
9792
  var RedTeamCustomAttackReportsClient = class {
8987
9793
  baseUrl;
8988
9794
  auth;
@@ -9072,7 +9878,7 @@ var RedTeamCustomAttackReportsClient = class {
9072
9878
  baseUrl: this.baseUrl,
9073
9879
  path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
9074
9880
  params,
9075
- responseSchema: import_zod40.z.array(PromptDetailResponseSchema),
9881
+ responseSchema: import_zod42.z.array(PromptDetailResponseSchema),
9076
9882
  auth: this.auth,
9077
9883
  numRetries: this.numRetries
9078
9884
  });
@@ -9166,7 +9972,7 @@ var RedTeamCustomAttackReportsClient = class {
9166
9972
  method: "GET",
9167
9973
  baseUrl: this.baseUrl,
9168
9974
  path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
9169
- responseSchema: import_zod40.z.array(CustomAttackOutputSchema),
9975
+ responseSchema: import_zod42.z.array(CustomAttackOutputSchema),
9170
9976
  auth: this.auth,
9171
9977
  numRetries: this.numRetries
9172
9978
  });
@@ -9191,7 +9997,7 @@ var RedTeamCustomAttackReportsClient = class {
9191
9997
  method: "GET",
9192
9998
  baseUrl: this.baseUrl,
9193
9999
  path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
9194
- responseSchema: import_zod40.z.array(PropertyStatisticSchema),
10000
+ responseSchema: import_zod42.z.array(PropertyStatisticSchema),
9195
10001
  auth: this.auth,
9196
10002
  numRetries: this.numRetries
9197
10003
  });
@@ -9199,7 +10005,7 @@ var RedTeamCustomAttackReportsClient = class {
9199
10005
  };
9200
10006
 
9201
10007
  // src/red-team/targets-client.ts
9202
- var import_zod41 = require("zod");
10008
+ var import_zod43 = require("zod");
9203
10009
  var RedTeamTargetsClient = class {
9204
10010
  baseUrl;
9205
10011
  auth;
@@ -9313,12 +10119,12 @@ var RedTeamTargetsClient = class {
9313
10119
  * // { uuid: '550e8400-...', name: 'prod-chatbot', status: 'READY', active: true, validated: true }
9314
10120
  * ```
9315
10121
  */
9316
- async get(uuid) {
9317
- assertUuid(uuid, "target uuid");
10122
+ async get(uuid2) {
10123
+ assertUuid(uuid2, "target uuid");
9318
10124
  return request({
9319
10125
  method: "GET",
9320
10126
  baseUrl: this.baseUrl,
9321
- path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
10127
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}`,
9322
10128
  responseSchema: TargetResponseSchema,
9323
10129
  auth: this.auth,
9324
10130
  numRetries: this.numRetries
@@ -9344,14 +10150,14 @@ var RedTeamTargetsClient = class {
9344
10150
  * // { uuid: '550e8400-...', name: 'prod-chatbot-v2', status: 'READY', updated_at: '2026-03-08T10:00:00Z' }
9345
10151
  * ```
9346
10152
  */
9347
- async update(uuid, body, opts) {
9348
- assertUuid(uuid, "target uuid");
10153
+ async update(uuid2, body, opts) {
10154
+ assertUuid(uuid2, "target uuid");
9349
10155
  const params = {};
9350
10156
  if (opts?.validate !== void 0) params.validate = String(opts.validate);
9351
10157
  return request({
9352
10158
  method: "PUT",
9353
10159
  baseUrl: this.baseUrl,
9354
- path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
10160
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}`,
9355
10161
  body,
9356
10162
  params: Object.keys(params).length > 0 ? params : void 0,
9357
10163
  responseSchema: TargetResponseSchema,
@@ -9373,12 +10179,12 @@ var RedTeamTargetsClient = class {
9373
10179
  * // { message: 'ok', status: 200 }
9374
10180
  * ```
9375
10181
  */
9376
- async delete(uuid) {
9377
- assertUuid(uuid, "target uuid");
10182
+ async delete(uuid2) {
10183
+ assertUuid(uuid2, "target uuid");
9378
10184
  return request({
9379
10185
  method: "DELETE",
9380
10186
  baseUrl: this.baseUrl,
9381
- path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
10187
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}`,
9382
10188
  responseSchema: BaseResponseSchema.optional(),
9383
10189
  allowEmptyBody: true,
9384
10190
  auth: this.auth,
@@ -9428,12 +10234,12 @@ var RedTeamTargetsClient = class {
9428
10234
  * // { target_id: '550e8400-...', target_version: 1, status: 'READY' }
9429
10235
  * ```
9430
10236
  */
9431
- async getProfile(uuid) {
9432
- assertUuid(uuid, "target uuid");
10237
+ async getProfile(uuid2) {
10238
+ assertUuid(uuid2, "target uuid");
9433
10239
  return request({
9434
10240
  method: "GET",
9435
10241
  baseUrl: this.baseUrl,
9436
- path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
10242
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}/profile`,
9437
10243
  responseSchema: TargetProfileResponseSchema,
9438
10244
  auth: this.auth,
9439
10245
  numRetries: this.numRetries
@@ -9457,12 +10263,12 @@ var RedTeamTargetsClient = class {
9457
10263
  * // { uuid: '550e8400-...', name: 'prod-chatbot', status: 'READY' }
9458
10264
  * ```
9459
10265
  */
9460
- async updateProfile(uuid, body) {
9461
- assertUuid(uuid, "target uuid");
10266
+ async updateProfile(uuid2, body) {
10267
+ assertUuid(uuid2, "target uuid");
9462
10268
  return request({
9463
10269
  method: "PUT",
9464
10270
  baseUrl: this.baseUrl,
9465
- path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
10271
+ path: `${RED_TEAM_TARGET_PATH}/${uuid2}/profile`,
9466
10272
  body,
9467
10273
  responseSchema: TargetResponseSchema,
9468
10274
  auth: this.auth,
@@ -9515,7 +10321,7 @@ var RedTeamTargetsClient = class {
9515
10321
  method: "GET",
9516
10322
  baseUrl: this.baseUrl,
9517
10323
  path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
9518
- responseSchema: import_zod41.z.record(import_zod41.z.unknown()),
10324
+ responseSchema: import_zod43.z.record(import_zod43.z.unknown()),
9519
10325
  auth: this.auth,
9520
10326
  numRetries: this.numRetries
9521
10327
  });
@@ -9636,12 +10442,12 @@ var RedTeamCustomAttacksClient = class {
9636
10442
  * // { uuid: '550e8400-...', name: 'jailbreaks', status: 'READY', active: true, archive: false }
9637
10443
  * ```
9638
10444
  */
9639
- async getPromptSet(uuid) {
9640
- assertUuid(uuid, "prompt set uuid");
10445
+ async getPromptSet(uuid2) {
10446
+ assertUuid(uuid2, "prompt set uuid");
9641
10447
  return request({
9642
10448
  method: "GET",
9643
10449
  baseUrl: this.baseUrl,
9644
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
10450
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}`,
9645
10451
  responseSchema: CustomPromptSetResponseSchema,
9646
10452
  auth: this.auth,
9647
10453
  numRetries: this.numRetries
@@ -9664,12 +10470,12 @@ var RedTeamCustomAttacksClient = class {
9664
10470
  * // { uuid: '550e8400-...', name: 'jailbreaks-v2', status: 'READY', active: true }
9665
10471
  * ```
9666
10472
  */
9667
- async updatePromptSet(uuid, body) {
9668
- assertUuid(uuid, "prompt set uuid");
10473
+ async updatePromptSet(uuid2, body) {
10474
+ assertUuid(uuid2, "prompt set uuid");
9669
10475
  return request({
9670
10476
  method: "PUT",
9671
10477
  baseUrl: this.baseUrl,
9672
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
10478
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}`,
9673
10479
  body,
9674
10480
  responseSchema: CustomPromptSetResponseSchema,
9675
10481
  auth: this.auth,
@@ -9693,12 +10499,12 @@ var RedTeamCustomAttacksClient = class {
9693
10499
  * // { uuid: '550e8400-...', name: 'jailbreaks', status: 'READY', archive: true }
9694
10500
  * ```
9695
10501
  */
9696
- async archivePromptSet(uuid, body) {
9697
- assertUuid(uuid, "prompt set uuid");
10502
+ async archivePromptSet(uuid2, body) {
10503
+ assertUuid(uuid2, "prompt set uuid");
9698
10504
  return request({
9699
10505
  method: "PUT",
9700
10506
  baseUrl: this.baseUrl,
9701
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/archive`,
10507
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}/archive`,
9702
10508
  body,
9703
10509
  responseSchema: CustomPromptSetResponseSchema,
9704
10510
  auth: this.auth,
@@ -9719,12 +10525,12 @@ var RedTeamCustomAttacksClient = class {
9719
10525
  * // { uuid: '550e8400-...', name: 'jailbreaks', status: 'READY', active: true, tsg_id: 'tsg-1' }
9720
10526
  * ```
9721
10527
  */
9722
- async getPromptSetReference(uuid) {
9723
- assertUuid(uuid, "prompt set uuid");
10528
+ async getPromptSetReference(uuid2) {
10529
+ assertUuid(uuid2, "prompt set uuid");
9724
10530
  return request({
9725
10531
  method: "GET",
9726
10532
  baseUrl: this.baseUrl,
9727
- path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/reference`,
10533
+ path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid2}/reference`,
9728
10534
  responseSchema: CustomPromptSetReferenceSchema,
9729
10535
  auth: this.auth,
9730
10536
  numRetries: this.numRetries
@@ -9745,14 +10551,14 @@ var RedTeamCustomAttacksClient = class {
9745
10551
  * // { uuid: '550e8400-...', status: 'READY', is_latest: true, version: 'gen-12345' }
9746
10552
  * ```
9747
10553
  */
9748
- async getPromptSetVersionInfo(uuid, opts) {
9749
- assertUuid(uuid, "prompt set uuid");
10554
+ async getPromptSetVersionInfo(uuid2, opts) {
10555
+ assertUuid(uuid2, "prompt set uuid");
9750
10556
  const params = {};
9751
10557
  if (opts?.version !== void 0) params.version = opts.version;
9752
10558
  return request({
9753
10559
  method: "GET",
9754
10560
  baseUrl: this.baseUrl,
9755
- 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`,
9756
10562
  params: Object.keys(params).length > 0 ? params : void 0,
9757
10563
  responseSchema: CustomPromptSetVersionInfoSchema,
9758
10564
  auth: this.auth,
@@ -9800,10 +10606,10 @@ var RedTeamCustomAttacksClient = class {
9800
10606
  * // 'prompt,goal,category,severity\n'
9801
10607
  * ```
9802
10608
  */
9803
- async downloadTemplate(uuid) {
9804
- assertUuid(uuid, "prompt set uuid");
10609
+ async downloadTemplate(uuid2) {
10610
+ assertUuid(uuid2, "prompt set uuid");
9805
10611
  const url = new URL(
9806
- `${this.baseUrl.replace(/\/+$/, "")}${RED_TEAM_CUSTOM_ATTACK_PATH}/download-template/${uuid}`
10612
+ `${this.baseUrl.replace(/\/+$/, "")}${RED_TEAM_CUSTOM_ATTACK_PATH}/download-template/${uuid2}`
9807
10613
  );
9808
10614
  const stub = {
9809
10615
  method: "GET",
@@ -10704,12 +11510,12 @@ var RedTeamAdaptersClient = class {
10704
11510
  * // adapter.status => 'ACTIVE'
10705
11511
  * ```
10706
11512
  */
10707
- async get(uuid) {
10708
- assertUuid(uuid, "adapter uuid");
11513
+ async get(uuid2) {
11514
+ assertUuid(uuid2, "adapter uuid");
10709
11515
  return request({
10710
11516
  method: "GET",
10711
11517
  baseUrl: this.baseUrl,
10712
- path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
11518
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid2}`,
10713
11519
  responseSchema: AdapterResponseSchema,
10714
11520
  auth: this.auth,
10715
11521
  numRetries: this.numRetries
@@ -10737,13 +11543,13 @@ var RedTeamAdaptersClient = class {
10737
11543
  * });
10738
11544
  * ```
10739
11545
  */
10740
- async update(uuid, body, opts) {
10741
- assertUuid(uuid, "adapter uuid");
11546
+ async update(uuid2, body, opts) {
11547
+ assertUuid(uuid2, "adapter uuid");
10742
11548
  const validate = opts?.validate ?? true;
10743
11549
  return request({
10744
11550
  method: "PUT",
10745
11551
  baseUrl: this.baseUrl,
10746
- path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
11552
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid2}`,
10747
11553
  params: { validate: String(validate) },
10748
11554
  body,
10749
11555
  responseSchema: AdapterResponseSchema,
@@ -10759,12 +11565,12 @@ var RedTeamAdaptersClient = class {
10759
11565
  * await rt.adapters.delete('550e8400-e29b-41d4-a716-446655440000');
10760
11566
  * ```
10761
11567
  */
10762
- async delete(uuid) {
10763
- assertUuid(uuid, "adapter uuid");
11568
+ async delete(uuid2) {
11569
+ assertUuid(uuid2, "adapter uuid");
10764
11570
  return request({
10765
11571
  method: "DELETE",
10766
11572
  baseUrl: this.baseUrl,
10767
- path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
11573
+ path: `${RED_TEAM_ADAPTER_PATH}/${uuid2}`,
10768
11574
  responseSchema: BaseResponseSchema.optional(),
10769
11575
  allowEmptyBody: true,
10770
11576
  auth: this.auth,
@@ -11633,12 +12439,12 @@ var AIGatewayWorkspacesClient = class {
11633
12439
  * const other = await gw.workspaces.get('ws-produc-985697', { plane: 'admin' });
11634
12440
  * ```
11635
12441
  */
11636
- async get(workspaceRef, options = {}) {
11637
- assertWorkspaceRef(workspaceRef, "workspaceRef");
12442
+ async get(workspaceRef2, options = {}) {
12443
+ assertWorkspaceRef(workspaceRef2, "workspaceRef");
11638
12444
  return request({
11639
12445
  method: "GET",
11640
12446
  baseUrl: this.urlFor(options.plane),
11641
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
12447
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef2}`,
11642
12448
  responseSchema: GatewayWorkspaceDetailSchema,
11643
12449
  auth: this.auth,
11644
12450
  numRetries: this.numRetries
@@ -11667,17 +12473,12 @@ var AIGatewayWorkspacesClient = class {
11667
12473
  * ```
11668
12474
  */
11669
12475
  async create(body) {
11670
- if (!body.name) {
11671
- throw new AISecSDKException("Missing name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11672
- }
11673
- if (!body.scope_name) {
11674
- throw new AISecSDKException("Missing scope_name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
11675
- }
11676
12476
  return request({
11677
12477
  method: "POST",
11678
12478
  baseUrl: this.adminBaseUrl,
11679
12479
  path: AI_GW_WORKSPACES_PATH,
11680
12480
  body,
12481
+ requestSchema: GatewayWorkspaceCreateRequestSchema,
11681
12482
  responseSchema: GatewayWorkspaceCreateResponseSchema,
11682
12483
  auth: this.auth,
11683
12484
  numRetries: this.numRetries
@@ -11702,19 +12503,14 @@ var AIGatewayWorkspacesClient = class {
11702
12503
  * });
11703
12504
  * ```
11704
12505
  */
11705
- async update(workspaceRef, body) {
11706
- assertWorkspaceRef(workspaceRef, "workspaceRef");
11707
- if (Object.keys(body).length === 0) {
11708
- throw new AISecSDKException(
11709
- "Empty update: provide at least one of name, description, icon, defaults, usage_limits, rate_limits",
11710
- "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
11711
- );
11712
- }
12506
+ async update(workspaceRef2, body) {
12507
+ assertWorkspaceRef(workspaceRef2, "workspaceRef");
11713
12508
  return request({
11714
12509
  method: "PUT",
11715
12510
  baseUrl: this.adminBaseUrl,
11716
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
12511
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef2}`,
11717
12512
  body,
12513
+ requestSchema: GatewayWorkspaceUpdateRequestSchema,
11718
12514
  responseSchema: GatewayWriteResponseSchema,
11719
12515
  auth: this.auth,
11720
12516
  numRetries: this.numRetries
@@ -11745,12 +12541,12 @@ var AIGatewayWorkspacesClient = class {
11745
12541
  * const gone = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
11746
12542
  * ```
11747
12543
  */
11748
- async delete(workspaceRef) {
11749
- assertWorkspaceRef(workspaceRef, "workspaceRef");
12544
+ async delete(workspaceRef2) {
12545
+ assertWorkspaceRef(workspaceRef2, "workspaceRef");
11750
12546
  return request({
11751
12547
  method: "DELETE",
11752
12548
  baseUrl: this.adminBaseUrl,
11753
- path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
12549
+ path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef2}`,
11754
12550
  auth: this.auth,
11755
12551
  numRetries: this.numRetries
11756
12552
  });
@@ -11823,6 +12619,29 @@ var AIGatewayConfigsClient = class {
11823
12619
  numRetries: this.numRetries
11824
12620
  });
11825
12621
  }
12622
+ /**
12623
+ * List the immutable version history for one config. Verified live 2026-08-29.
12624
+ * @param configId - Config UUID.
12625
+ * @returns Config versions, including version ownership and creation timestamps.
12626
+ * @example
12627
+ * ```ts
12628
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
12629
+ * const gw = new AIGatewayClient();
12630
+ * const versions = await gw.configs.listVersions('764cf9cd-4ebf-449e-b669-08149b0fbbbc');
12631
+ * console.log(versions.data[0].version_id);
12632
+ * ```
12633
+ */
12634
+ async listVersions(configId) {
12635
+ assertUuid(configId, "configId");
12636
+ return request({
12637
+ method: "GET",
12638
+ baseUrl: this.baseUrl,
12639
+ path: `${AI_GW_CONFIGS_PATH}/${configId}/versions`,
12640
+ responseSchema: ListConfigVersionsResponseSchema,
12641
+ auth: this.auth,
12642
+ numRetries: this.numRetries
12643
+ });
12644
+ }
11826
12645
  /**
11827
12646
  * Create a config.
11828
12647
  *
@@ -11853,6 +12672,7 @@ var AIGatewayConfigsClient = class {
11853
12672
  baseUrl: this.baseUrl,
11854
12673
  path: AI_GW_CONFIGS_PATH,
11855
12674
  body,
12675
+ requestSchema: GatewayConfigCreateRequestSchema,
11856
12676
  responseSchema: GatewayConfigCreateResponseSchema,
11857
12677
  auth: this.auth,
11858
12678
  numRetries: this.numRetries
@@ -11861,7 +12681,7 @@ var AIGatewayConfigsClient = class {
11861
12681
  /**
11862
12682
  * Update a config.
11863
12683
  * @param configId - Config UUID.
11864
- * @param body - Replacement fields.
12684
+ * @param body - One or more fields to update. A supplied `config` replaces the routing document.
11865
12685
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
11866
12686
  * @example
11867
12687
  * ```ts
@@ -11877,12 +12697,12 @@ var AIGatewayConfigsClient = class {
11877
12697
  */
11878
12698
  async update(configId, body) {
11879
12699
  assertUuid(configId, "configId");
11880
- assertUuid(body.workspace_id, "workspace_id");
11881
12700
  return request({
11882
12701
  method: "PUT",
11883
12702
  baseUrl: this.baseUrl,
11884
12703
  path: `${AI_GW_CONFIGS_PATH}/${configId}`,
11885
12704
  body,
12705
+ requestSchema: GatewayConfigUpdateRequestSchema,
11886
12706
  responseSchema: GatewayWriteResponseSchema,
11887
12707
  auth: this.auth,
11888
12708
  numRetries: this.numRetries
@@ -12010,11 +12830,39 @@ var AIGatewayGuardrailsClient = class {
12010
12830
  baseUrl: this.baseUrl,
12011
12831
  path: AI_GW_GUARDRAILS_PATH,
12012
12832
  body,
12833
+ requestSchema: GatewayGuardrailCreateRequestSchema,
12013
12834
  responseSchema: GatewayGuardrailCreateResponseSchema,
12014
12835
  auth: this.auth,
12015
12836
  numRetries: this.numRetries
12016
12837
  });
12017
12838
  }
12839
+ /**
12840
+ * Update a guardrail. Verified live 2026-08-29.
12841
+ * @param guardrailId - Guardrail UUID.
12842
+ * @param body - Fields to update.
12843
+ * @returns The gateway write response.
12844
+ * @example
12845
+ * ```ts
12846
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
12847
+ * const gw = new AIGatewayClient();
12848
+ * await gw.guardrails.update('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b', {
12849
+ * name: 'Updated guardrail',
12850
+ * });
12851
+ * ```
12852
+ */
12853
+ async update(guardrailId, body) {
12854
+ assertUuid(guardrailId, "guardrailId");
12855
+ return request({
12856
+ method: "PUT",
12857
+ baseUrl: this.baseUrl,
12858
+ path: `${AI_GW_GUARDRAILS_PATH}/${guardrailId}`,
12859
+ body,
12860
+ requestSchema: GatewayGuardrailUpdateRequestSchema,
12861
+ responseSchema: GatewayWriteResponseSchema,
12862
+ auth: this.auth,
12863
+ numRetries: this.numRetries
12864
+ });
12865
+ }
12018
12866
  /**
12019
12867
  * Delete a guardrail.
12020
12868
  *
@@ -12081,6 +12929,34 @@ var AIGatewayProvidersClient = class {
12081
12929
  numRetries: this.numRetries
12082
12930
  });
12083
12931
  }
12932
+ /**
12933
+ * Fetch one provider binding. Verified live 2026-08-29.
12934
+ *
12935
+ * @remarks The response can contain provider credential material. Do not log or persist it,
12936
+ * and avoid logging the complete returned object. SDK debug logs redact the known credential
12937
+ * fields for this operation.
12938
+ * @param providerId - Provider UUID.
12939
+ * @returns Provider configuration and lifecycle detail.
12940
+ * @example
12941
+ * ```ts
12942
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
12943
+ * const gw = new AIGatewayClient();
12944
+ * const provider = await gw.providers.get('f6692544-3265-49be-9711-bbdcebc079e4');
12945
+ * console.log(provider.name);
12946
+ * ```
12947
+ */
12948
+ async get(providerId) {
12949
+ assertUuid(providerId, "providerId");
12950
+ return request({
12951
+ method: "GET",
12952
+ baseUrl: this.baseUrl,
12953
+ path: `${AI_GW_PROVIDERS_PATH}/${providerId}`,
12954
+ secretOperation: "providers.get",
12955
+ responseSchema: GatewayProviderDetailSchema,
12956
+ auth: this.auth,
12957
+ numRetries: this.numRetries
12958
+ });
12959
+ }
12084
12960
  /**
12085
12961
  * Create a provider.
12086
12962
  *
@@ -12116,11 +12992,40 @@ var AIGatewayProvidersClient = class {
12116
12992
  baseUrl: this.baseUrl,
12117
12993
  path: AI_GW_PROVIDERS_PATH,
12118
12994
  body,
12995
+ requestSchema: GatewayProviderCreateRequestSchema,
12119
12996
  responseSchema: GatewayProviderCreateResponseSchema,
12120
12997
  auth: this.auth,
12121
12998
  numRetries: this.numRetries
12122
12999
  });
12123
13000
  }
13001
+ /**
13002
+ * Update a provider binding. Verified live 2026-08-29.
13003
+ * @param providerId - Provider UUID.
13004
+ * @param body - Fields to update.
13005
+ * @returns The gateway write response.
13006
+ * @example
13007
+ * ```ts
13008
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
13009
+ * const gw = new AIGatewayClient();
13010
+ * await gw.providers.update('f6692544-3265-49be-9711-bbdcebc079e4', {
13011
+ * name: 'Vertex production',
13012
+ * note: 'Updated by automation',
13013
+ * });
13014
+ * ```
13015
+ */
13016
+ async update(providerId, body) {
13017
+ assertUuid(providerId, "providerId");
13018
+ return request({
13019
+ method: "PUT",
13020
+ baseUrl: this.baseUrl,
13021
+ path: `${AI_GW_PROVIDERS_PATH}/${providerId}`,
13022
+ body,
13023
+ requestSchema: GatewayProviderUpdateRequestSchema,
13024
+ responseSchema: GatewayWriteResponseSchema,
13025
+ auth: this.auth,
13026
+ numRetries: this.numRetries
13027
+ });
13028
+ }
12124
13029
  /**
12125
13030
  * Delete a provider.
12126
13031
  *
@@ -12176,13 +13081,14 @@ var AIGatewayApiKeysClient = class {
12176
13081
  });
12177
13082
  }
12178
13083
  /** @internal */
12179
- writeAt(method, path, body) {
12180
- assertUuid(body.workspace_id, "workspace_id");
13084
+ writeAt(method, path, body, requestSchema, secretOperation) {
12181
13085
  return request({
12182
13086
  method,
12183
13087
  baseUrl: this.baseUrl,
12184
13088
  path,
12185
13089
  body,
13090
+ requestSchema,
13091
+ secretOperation,
12186
13092
  responseSchema: GatewayWriteResponseSchema,
12187
13093
  auth: this.auth,
12188
13094
  numRetries: this.numRetries
@@ -12220,6 +13126,65 @@ var AIGatewayApiKeysClient = class {
12220
13126
  async listUser(opts) {
12221
13127
  return this.listAt(AI_GW_API_KEYS_USER_PATH, opts);
12222
13128
  }
13129
+ getAt(path, keyId) {
13130
+ assertUuid(keyId, "keyId");
13131
+ return request({
13132
+ method: "GET",
13133
+ baseUrl: this.baseUrl,
13134
+ path: `${path}/${keyId}`,
13135
+ responseSchema: GatewayApiKeySchema,
13136
+ auth: this.auth,
13137
+ numRetries: this.numRetries
13138
+ });
13139
+ }
13140
+ async deleteAt(path, keyId) {
13141
+ assertUuid(keyId, "keyId");
13142
+ await request({
13143
+ method: "DELETE",
13144
+ baseUrl: this.baseUrl,
13145
+ path: `${path}/${keyId}`,
13146
+ auth: this.auth,
13147
+ numRetries: this.numRetries
13148
+ });
13149
+ }
13150
+ rotateAt(path, keyId, body, secretOperation) {
13151
+ assertUuid(keyId, "keyId");
13152
+ return request({
13153
+ method: "POST",
13154
+ baseUrl: this.baseUrl,
13155
+ path: `${path}/${keyId}/rotate`,
13156
+ body,
13157
+ requestSchema: GatewayApiKeyRotateRequestSchema,
13158
+ secretOperation,
13159
+ responseSchema: GatewayApiKeyRotateResponseSchema,
13160
+ auth: this.auth,
13161
+ numRetries: this.numRetries
13162
+ });
13163
+ }
13164
+ /** Get a service key. @example `await gw.apiKeys.getService(keyId);` */
13165
+ async getService(keyId) {
13166
+ return this.getAt(AI_GW_API_KEYS_SERVICE_PATH, keyId);
13167
+ }
13168
+ /** Get a user key. @example `await gw.apiKeys.getUser(keyId);` */
13169
+ async getUser(keyId) {
13170
+ return this.getAt(AI_GW_API_KEYS_USER_PATH, keyId);
13171
+ }
13172
+ /** Permanently delete a service key. @example `await gw.apiKeys.deleteService(keyId);` */
13173
+ async deleteService(keyId) {
13174
+ return this.deleteAt(AI_GW_API_KEYS_SERVICE_PATH, keyId);
13175
+ }
13176
+ /** Permanently delete a user key. @example `await gw.apiKeys.deleteUser(keyId);` */
13177
+ async deleteUser(keyId) {
13178
+ return this.deleteAt(AI_GW_API_KEYS_USER_PATH, keyId);
13179
+ }
13180
+ /** Rotate a service key; capture the returned secret. @example `const rotated = await gw.apiKeys.rotateService(keyId);` */
13181
+ async rotateService(keyId, body = {}) {
13182
+ return this.rotateAt(AI_GW_API_KEYS_SERVICE_PATH, keyId, body, "apiKeys.rotateService");
13183
+ }
13184
+ /** Rotate a user key; capture the returned secret. @example `const rotated = await gw.apiKeys.rotateUser(keyId);` */
13185
+ async rotateUser(keyId, body = {}) {
13186
+ return this.rotateAt(AI_GW_API_KEYS_USER_PATH, keyId, body, "apiKeys.rotateUser");
13187
+ }
12223
13188
  /**
12224
13189
  * Create a service API key.
12225
13190
  * @param body - Name, scopes, TSG, workspace UUID, and type.
@@ -12239,7 +13204,13 @@ var AIGatewayApiKeysClient = class {
12239
13204
  * ```
12240
13205
  */
12241
13206
  async createService(body) {
12242
- 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
+ );
12243
13214
  }
12244
13215
  /**
12245
13216
  * Create a user API key.
@@ -12261,12 +13232,18 @@ var AIGatewayApiKeysClient = class {
12261
13232
  * ```
12262
13233
  */
12263
13234
  async createUser(body) {
12264
- 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
+ );
12265
13242
  }
12266
13243
  /**
12267
13244
  * Update a service API key.
12268
13245
  * @param keyId - Key UUID.
12269
- * @param body - Replacement fields.
13246
+ * @param body - One or more fields to update.
12270
13247
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12271
13248
  * @example
12272
13249
  * ```ts
@@ -12284,12 +13261,17 @@ var AIGatewayApiKeysClient = class {
12284
13261
  */
12285
13262
  async updateService(keyId, body) {
12286
13263
  assertUuid(keyId, "keyId");
12287
- 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
+ );
12288
13270
  }
12289
13271
  /**
12290
13272
  * Update a user API key.
12291
13273
  * @param keyId - Key UUID.
12292
- * @param body - Replacement fields.
13274
+ * @param body - One or more fields to update.
12293
13275
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12294
13276
  * @example
12295
13277
  * ```ts
@@ -12308,7 +13290,12 @@ var AIGatewayApiKeysClient = class {
12308
13290
  */
12309
13291
  async updateUser(keyId, body) {
12310
13292
  assertUuid(keyId, "keyId");
12311
- 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
+ );
12312
13299
  }
12313
13300
  };
12314
13301
 
@@ -12372,8 +13359,8 @@ var AIGatewayIntegrationsClient = class {
12372
13359
  * Create an integration.
12373
13360
  *
12374
13361
  * @remarks
12375
- * `body.key` (the provider API key) is a live secret. Setting `PANW_AI_SEC_DEBUG` will
12376
- * 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.
12377
13364
  *
12378
13365
  * @param body - Provider id, name, slug, and provider-specific configuration.
12379
13366
  * @returns The raw create response. Shape unverified against a live tenant — see the PRD.
@@ -12398,6 +13385,8 @@ var AIGatewayIntegrationsClient = class {
12398
13385
  baseUrl: this.baseUrl,
12399
13386
  path: AI_GW_INTEGRATIONS_PATH,
12400
13387
  body,
13388
+ requestSchema: GatewayIntegrationCreateRequestSchema,
13389
+ secretOperation: "integrations.create",
12401
13390
  responseSchema: GatewayWriteResponseSchema,
12402
13391
  auth: this.auth,
12403
13392
  numRetries: this.numRetries
@@ -12406,7 +13395,7 @@ var AIGatewayIntegrationsClient = class {
12406
13395
  /**
12407
13396
  * Update an integration.
12408
13397
  * @param integrationId - Integration UUID.
12409
- * @param body - Replacement fields.
13398
+ * @param body - One or more fields to update.
12410
13399
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12411
13400
  * @example
12412
13401
  * ```ts
@@ -12421,12 +13410,13 @@ var AIGatewayIntegrationsClient = class {
12421
13410
  */
12422
13411
  async update(integrationId, body) {
12423
13412
  assertUuid(integrationId, "integrationId");
12424
- if (body.ai_provider_id !== void 0) assertUuid(body.ai_provider_id, "ai_provider_id");
12425
13413
  return request({
12426
13414
  method: "PUT",
12427
13415
  baseUrl: this.baseUrl,
12428
13416
  path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
12429
13417
  body,
13418
+ requestSchema: GatewayIntegrationUpdateRequestSchema,
13419
+ secretOperation: "integrations.update",
12430
13420
  responseSchema: GatewayWriteResponseSchema,
12431
13421
  auth: this.auth,
12432
13422
  numRetries: this.numRetries
@@ -12482,9 +13472,9 @@ var AIGatewayIntegrationsClient = class {
12482
13472
  });
12483
13473
  }
12484
13474
  /**
12485
- * Replace which models this integration exposes.
13475
+ * Bulk-update model enablement for this integration.
12486
13476
  * @param integrationId - Integration UUID.
12487
- * @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.
12488
13478
  * @returns The raw response. Shape unverified against a live tenant — see the PRD.
12489
13479
  * @example
12490
13480
  * ```ts
@@ -12503,6 +13493,7 @@ var AIGatewayIntegrationsClient = class {
12503
13493
  baseUrl: this.baseUrl,
12504
13494
  path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/models`,
12505
13495
  body,
13496
+ requestSchema: GatewayIntegrationModelsBulkUpdateRequestSchema,
12506
13497
  responseSchema: GatewayWriteResponseSchema,
12507
13498
  auth: this.auth,
12508
13499
  numRetries: this.numRetries
@@ -12514,7 +13505,7 @@ var AIGatewayIntegrationsClient = class {
12514
13505
  * @remarks
12515
13506
  * `global_workspace_access` is an **object** on this read, not a boolean, despite the
12516
13507
  * field name — `{ enabled, rate_limits, usage_limits }`. The corresponding write
12517
- * ({@link setWorkspaces}) DOES send a plain boolean; the two are not symmetric.
13508
+ * ({@link setWorkspaces}) uses the same object shape.
12518
13509
  *
12519
13510
  * @param integrationId - Integration UUID.
12520
13511
  * @returns Bound workspaces plus the `global_workspace_access` object.
@@ -12539,9 +13530,9 @@ var AIGatewayIntegrationsClient = class {
12539
13530
  });
12540
13531
  }
12541
13532
  /**
12542
- * Replace which workspaces may use this integration.
13533
+ * Bulk-update which workspaces may use this integration.
12543
13534
  * @param integrationId - Integration UUID.
12544
- * @param body - Workspace bindings or a global-access flag.
13535
+ * @param body - Workspace bindings, global-access settings, or explicit override behavior.
12545
13536
  * @returns The raw response. Shape unverified against a live tenant — see the PRD.
12546
13537
  * @example
12547
13538
  * ```ts
@@ -12549,7 +13540,7 @@ var AIGatewayIntegrationsClient = class {
12549
13540
  * const gw = new AIGatewayClient();
12550
13541
  *
12551
13542
  * await gw.integrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
12552
- * global_workspace_access: true,
13543
+ * global_workspace_access: { enabled: true },
12553
13544
  * });
12554
13545
  * ```
12555
13546
  */
@@ -12560,6 +13551,7 @@ var AIGatewayIntegrationsClient = class {
12560
13551
  baseUrl: this.baseUrl,
12561
13552
  path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/workspaces`,
12562
13553
  body,
13554
+ requestSchema: GatewayIntegrationWorkspacesBulkUpdateRequestSchema,
12563
13555
  responseSchema: GatewayWriteResponseSchema,
12564
13556
  auth: this.auth,
12565
13557
  numRetries: this.numRetries
@@ -12599,6 +13591,75 @@ var AIGatewayMcpIntegrationsClient = class {
12599
13591
  numRetries: this.numRetries
12600
13592
  });
12601
13593
  }
13594
+ /**
13595
+ * Fetch one MCP integration. Verified live 2026-08-29.
13596
+ * @param mcpIntegrationId - MCP integration UUID.
13597
+ * @returns Integration detail; unlike list rows, `configurations` is an object.
13598
+ * @example
13599
+ * ```ts
13600
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
13601
+ * const gw = new AIGatewayClient();
13602
+ * const integration = await gw.mcpIntegrations.get('2a6f4e2e-6f5a-4a1f-9d0e-9b2b6f6c3a11');
13603
+ * console.log(integration.url);
13604
+ * ```
13605
+ */
13606
+ async get(mcpIntegrationId) {
13607
+ assertUuid(mcpIntegrationId, "mcpIntegrationId");
13608
+ return request({
13609
+ method: "GET",
13610
+ baseUrl: this.baseUrl,
13611
+ path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}`,
13612
+ responseSchema: McpIntegrationDetailSchema,
13613
+ auth: this.auth,
13614
+ numRetries: this.numRetries
13615
+ });
13616
+ }
13617
+ /**
13618
+ * List capabilities discovered from an MCP integration. Verified live 2026-08-29.
13619
+ * @param mcpIntegrationId - MCP integration UUID.
13620
+ * @returns Tools, prompts, resources, and resource templates with enablement counts.
13621
+ * @example
13622
+ * ```ts
13623
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
13624
+ * const gw = new AIGatewayClient();
13625
+ * const capabilities = await gw.mcpIntegrations.getCapabilities('2a6f4e2e-6f5a-4a1f-9d0e-9b2b6f6c3a11');
13626
+ * console.log(capabilities.data.map((capability) => capability.name));
13627
+ * ```
13628
+ */
13629
+ async getCapabilities(mcpIntegrationId) {
13630
+ assertUuid(mcpIntegrationId, "mcpIntegrationId");
13631
+ return request({
13632
+ method: "GET",
13633
+ baseUrl: this.baseUrl,
13634
+ path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/capabilities`,
13635
+ responseSchema: McpIntegrationCapabilitiesResponseSchema,
13636
+ auth: this.auth,
13637
+ numRetries: this.numRetries
13638
+ });
13639
+ }
13640
+ /**
13641
+ * Fetch metadata discovered from an MCP server. Verified live 2026-08-29.
13642
+ * @param mcpIntegrationId - MCP integration UUID.
13643
+ * @returns Server identity, protocol, capability flags, and sync state.
13644
+ * @example
13645
+ * ```ts
13646
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
13647
+ * const gw = new AIGatewayClient();
13648
+ * const metadata = await gw.mcpIntegrations.getMetadata('2a6f4e2e-6f5a-4a1f-9d0e-9b2b6f6c3a11');
13649
+ * console.log(metadata.sync_status);
13650
+ * ```
13651
+ */
13652
+ async getMetadata(mcpIntegrationId) {
13653
+ assertUuid(mcpIntegrationId, "mcpIntegrationId");
13654
+ return request({
13655
+ method: "GET",
13656
+ baseUrl: this.baseUrl,
13657
+ path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/metadata`,
13658
+ responseSchema: McpIntegrationMetadataSchema,
13659
+ auth: this.auth,
13660
+ numRetries: this.numRetries
13661
+ });
13662
+ }
12602
13663
  /**
12603
13664
  * Register an MCP server.
12604
13665
  * @param body - Name, server URL, auth type, transport, and provider-specific configuration.
@@ -12624,23 +13685,68 @@ var AIGatewayMcpIntegrationsClient = class {
12624
13685
  baseUrl: this.baseUrl,
12625
13686
  path: AI_GW_MCP_INTEGRATIONS_PATH,
12626
13687
  body,
13688
+ requestSchema: McpIntegrationCreateRequestSchema,
13689
+ secretOperation: "mcpIntegrations.create",
12627
13690
  responseSchema: GatewayWriteResponseSchema,
12628
13691
  auth: this.auth,
12629
13692
  numRetries: this.numRetries
12630
13693
  });
12631
13694
  }
13695
+ /** Update an MCP integration. @example `await gw.mcpIntegrations.update(id, { name: 'Docs MCP' });` */
13696
+ async update(mcpIntegrationId, body) {
13697
+ assertUuid(mcpIntegrationId, "mcpIntegrationId");
13698
+ return request({
13699
+ method: "PUT",
13700
+ baseUrl: this.baseUrl,
13701
+ path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}`,
13702
+ body,
13703
+ requestSchema: McpIntegrationUpdateRequestSchema,
13704
+ secretOperation: "mcpIntegrations.update",
13705
+ responseSchema: GatewayWriteResponseSchema,
13706
+ auth: this.auth,
13707
+ numRetries: this.numRetries
13708
+ });
13709
+ }
13710
+ /** Permanently delete an MCP integration. @example `await gw.mcpIntegrations.delete(id);` */
13711
+ async delete(mcpIntegrationId) {
13712
+ assertUuid(mcpIntegrationId, "mcpIntegrationId");
13713
+ await request({
13714
+ method: "DELETE",
13715
+ baseUrl: this.baseUrl,
13716
+ path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}`,
13717
+ auth: this.auth,
13718
+ numRetries: this.numRetries
13719
+ });
13720
+ }
13721
+ /** Bulk-update capability enablement values. @example `await gw.mcpIntegrations.setCapabilities(id, { capabilities: [{ name: 'lookup', type: 'tool', enabled: true }] });` */
13722
+ async setCapabilities(mcpIntegrationId, body) {
13723
+ assertUuid(mcpIntegrationId, "mcpIntegrationId");
13724
+ return request({
13725
+ method: "PUT",
13726
+ baseUrl: this.baseUrl,
13727
+ path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/capabilities`,
13728
+ body,
13729
+ requestSchema: McpIntegrationCapabilitiesBulkUpdateRequestSchema,
13730
+ responseSchema: McpIntegrationCapabilitiesUpdateResponseSchema,
13731
+ auth: this.auth,
13732
+ numRetries: this.numRetries
13733
+ });
13734
+ }
12632
13735
  /**
12633
- * Replace which workspaces may use this MCP integration.
13736
+ * Bulk-update which workspaces may use this MCP integration.
12634
13737
  * @param mcpIntegrationId - MCP integration UUID.
12635
- * @param body - Workspace bindings or a global-access flag; this is a replace, not a merge.
12636
- * @returns The raw response. Shape unverified against a live tenant — see the PRD.
13738
+ * @param body - Workspace bindings or global-access settings. Use the explicit override flag
13739
+ * to request replacement behavior.
13740
+ * @returns An empty object. Verified live 2026-08-30.
12637
13741
  * @example
12638
13742
  * ```ts
12639
13743
  * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
12640
13744
  * const gw = new AIGatewayClient();
12641
13745
  *
12642
13746
  * await gw.mcpIntegrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
12643
- * global_workspace_access: true,
13747
+ * workspaces: [{ id: 'ws-development', enabled: true }],
13748
+ * global_workspace_access: { enabled: false },
13749
+ * override_existing_workspace_access: true,
12644
13750
  * });
12645
13751
  * ```
12646
13752
  */
@@ -12651,7 +13757,8 @@ var AIGatewayMcpIntegrationsClient = class {
12651
13757
  baseUrl: this.baseUrl,
12652
13758
  path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/workspaces`,
12653
13759
  body,
12654
- responseSchema: GatewayWriteResponseSchema,
13760
+ requestSchema: McpIntegrationWorkspacesBulkUpdateRequestSchema,
13761
+ responseSchema: McpIntegrationWorkspacesUpdateResponseSchema,
12655
13762
  auth: this.auth,
12656
13763
  numRetries: this.numRetries
12657
13764
  });
@@ -12729,8 +13836,8 @@ var AIGatewayDeploymentsClient = class {
12729
13836
  *
12730
13837
  * This is the **only** time `credentials.password` and `client_auth` are readable; the
12731
13838
  * detail read masks them. Capture them here or they are unrecoverable. Never log them.
12732
- * Note that setting `PANW_AI_SEC_DEBUG` will print the raw request/response, including
12733
- * `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.
12734
13841
  *
12735
13842
  * @param body - Name, type, TSG, and auth settings.
12736
13843
  * @returns The creation receipt including the deployment's gateway credentials.
@@ -12755,11 +13862,67 @@ var AIGatewayDeploymentsClient = class {
12755
13862
  baseUrl: this.baseUrl,
12756
13863
  path: AI_GW_DEPLOYMENTS_PATH,
12757
13864
  body,
13865
+ requestSchema: GatewayDeploymentCreateRequestSchema,
13866
+ secretOperation: "deployments.create",
12758
13867
  responseSchema: GatewayDeploymentCreateResponseSchema,
12759
13868
  auth: this.auth,
12760
13869
  numRetries: this.numRetries
12761
13870
  });
12762
13871
  }
13872
+ /**
13873
+ * Update deployment settings, including its externally deployed gateway URL and workspace scope.
13874
+ * @param deploymentId - Deployment UUID.
13875
+ * @param body - Fields to update.
13876
+ * @returns The gateway write response.
13877
+ * @example
13878
+ * ```ts
13879
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
13880
+ * const gw = new AIGatewayClient();
13881
+ * await gw.deployments.update('21414819-485e-4ba3-b3d3-3e1815580e43', {
13882
+ * auth_settings: {
13883
+ * gateway_base_url: 'https://gateway.example.com',
13884
+ * workspaces_allowed: ['ws-develo-71f8d8'],
13885
+ * },
13886
+ * });
13887
+ * ```
13888
+ */
13889
+ async update(deploymentId, body) {
13890
+ assertUuid(deploymentId, "deploymentId");
13891
+ return request({
13892
+ method: "PUT",
13893
+ baseUrl: this.baseUrl,
13894
+ path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}`,
13895
+ body,
13896
+ requestSchema: GatewayDeploymentUpdateRequestSchema,
13897
+ secretOperation: "deployments.update",
13898
+ responseSchema: GatewayWriteResponseSchema,
13899
+ auth: this.auth,
13900
+ numRetries: this.numRetries
13901
+ });
13902
+ }
13903
+ /**
13904
+ * Run SCM's outbound and inbound connectivity checks against a configured gateway.
13905
+ * @param deploymentId - Deployment UUID.
13906
+ * @returns Health of both connectivity directions.
13907
+ * @example
13908
+ * ```ts
13909
+ * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
13910
+ * const gw = new AIGatewayClient();
13911
+ * const health = await gw.deployments.ping('21414819-485e-4ba3-b3d3-3e1815580e43');
13912
+ * console.log(health.status, health.outbound.status, health.inbound.status);
13913
+ * ```
13914
+ */
13915
+ async ping(deploymentId) {
13916
+ assertUuid(deploymentId, "deploymentId");
13917
+ return request({
13918
+ method: "GET",
13919
+ baseUrl: this.baseUrl,
13920
+ path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}/ping`,
13921
+ responseSchema: GatewayDeploymentPingResponseSchema,
13922
+ auth: this.auth,
13923
+ numRetries: this.numRetries
13924
+ });
13925
+ }
12763
13926
  /**
12764
13927
  * Archive a deployment.
12765
13928
  *
@@ -12834,8 +13997,8 @@ var AIGatewayPluginsClient = class {
12834
13997
  * Bind a plugin to the organisation.
12835
13998
  *
12836
13999
  * @remarks
12837
- * `body.credentials` (e.g. `AIRS_API_KEY`) is a live secret. Setting `PANW_AI_SEC_DEBUG`
12838
- * 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.
12839
14002
  *
12840
14003
  * @param body - Integration id and provider-specific credentials.
12841
14004
  * @returns The raw create response. Shape unverified against a live tenant — see the PRD.
@@ -12858,6 +14021,8 @@ var AIGatewayPluginsClient = class {
12858
14021
  baseUrl: this.baseUrl,
12859
14022
  path: AI_GW_PLUGINS_PATH,
12860
14023
  body,
14024
+ requestSchema: GatewayPluginCreateRequestSchema,
14025
+ secretOperation: "plugins.create",
12861
14026
  responseSchema: GatewayWriteResponseSchema,
12862
14027
  auth: this.auth,
12863
14028
  numRetries: this.numRetries
@@ -12899,7 +14064,7 @@ var AIGatewayOrganisationsClient = class {
12899
14064
  }
12900
14065
  /**
12901
14066
  * Update the calling organisation's settings.
12902
- * @param body - Replacement fields.
14067
+ * @param body - One or more fields to update.
12903
14068
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12904
14069
  * @example
12905
14070
  * ```ts
@@ -12915,6 +14080,7 @@ var AIGatewayOrganisationsClient = class {
12915
14080
  baseUrl: this.baseUrl,
12916
14081
  path: AI_GW_ORGANISATIONS_SELF_PATH,
12917
14082
  body,
14083
+ requestSchema: GatewayOrganisationUpdateRequestSchema,
12918
14084
  responseSchema: GatewayWriteResponseSchema,
12919
14085
  auth: this.auth,
12920
14086
  numRetries: this.numRetries
@@ -12925,8 +14091,8 @@ var AIGatewayOrganisationsClient = class {
12925
14091
  *
12926
14092
  * @remarks
12927
14093
  * The response includes a `scim_token` — a live secret. Never log the returned object.
12928
- * Note that setting `PANW_AI_SEC_DEBUG` will print it (unredacted) to the SDK's own debug
12929
- * 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.
12930
14096
  *
12931
14097
  * @param tsgId - The TSG as a numeric string, not a UUID.
12932
14098
  * @returns Auth settings, including domains and the SCIM token.
@@ -12945,6 +14111,7 @@ var AIGatewayOrganisationsClient = class {
12945
14111
  method: "GET",
12946
14112
  baseUrl: this.baseUrl,
12947
14113
  path: aiGwOrganisationsAuthSettingsPath(tsgId),
14114
+ secretOperation: "organisations.getAuthSettings",
12948
14115
  responseSchema: AuthSettingsResponseSchema,
12949
14116
  auth: this.auth,
12950
14117
  numRetries: this.numRetries
@@ -12953,7 +14120,7 @@ var AIGatewayOrganisationsClient = class {
12953
14120
  /**
12954
14121
  * Update an organisation's auth settings.
12955
14122
  * @param tsgId - The TSG as a numeric string, not a UUID.
12956
- * @param body - Replacement fields.
14123
+ * @param body - One or more auth-setting fields to update.
12957
14124
  * @returns The raw update response. Shape unverified against a live tenant — see the PRD.
12958
14125
  * @example
12959
14126
  * ```ts
@@ -12972,6 +14139,8 @@ var AIGatewayOrganisationsClient = class {
12972
14139
  baseUrl: this.baseUrl,
12973
14140
  path: aiGwOrganisationsAuthSettingsPath(tsgId),
12974
14141
  body,
14142
+ requestSchema: GatewayOrganisationAuthSettingsUpdateRequestSchema,
14143
+ secretOperation: "organisations.updateAuthSettings",
12975
14144
  responseSchema: GatewayWriteResponseSchema,
12976
14145
  auth: this.auth,
12977
14146
  numRetries: this.numRetries
@@ -13089,6 +14258,165 @@ var AIGatewayClient = class {
13089
14258
  this.auditLogs = new AIGatewayAuditLogsClient(adminOpts);
13090
14259
  }
13091
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
+ }
13092
14420
  // Annotate the CommonJS export names for ESM import in node:
13093
14421
  0 && (module.exports = {
13094
14422
  AIGatewayApiKeysClient,
@@ -13106,6 +14434,18 @@ var AIGatewayClient = class {
13106
14434
  AIGatewayWorkspacesClient,
13107
14435
  AIRS_ENDPOINTS,
13108
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,
13109
14449
  AI_GW_ADMIN_ENDPOINT,
13110
14450
  AI_GW_API_KEYS_SERVICE_PATH,
13111
14451
  AI_GW_API_KEYS_USER_PATH,
@@ -13357,35 +14697,100 @@ var AIGatewayClient = class {
13357
14697
  FileScanDataSchema,
13358
14698
  FileScanResult,
13359
14699
  FileType,
14700
+ GatewayApiKeyCreateRequestSchema,
14701
+ GatewayApiKeyRotateRequestSchema,
14702
+ GatewayApiKeyRotateResponseSchema,
14703
+ GatewayApiKeyRotationPolicySchema,
13360
14704
  GatewayApiKeySchema,
14705
+ GatewayApiKeyScopeSchema,
14706
+ GatewayApiKeyUpdateRequestSchema,
13361
14707
  GatewayAuditLogRecordSchema,
13362
14708
  GatewayAuditLogsResponseSchema,
14709
+ GatewayAzureAIConfigurationSchema,
14710
+ GatewayAzureDeploymentConfigurationSchema,
14711
+ GatewayAzureOpenAIConfigurationSchema,
14712
+ GatewayBedrockConfigurationSchema,
13363
14713
  GatewayChartRecordSchema,
14714
+ GatewayConfigCacheModeSchema,
14715
+ GatewayConfigCreateRequestSchema,
13364
14716
  GatewayConfigCreateResponseSchema,
13365
14717
  GatewayConfigDetailSchema,
13366
14718
  GatewayConfigSchema,
14719
+ GatewayConfigStrategySchema,
14720
+ GatewayConfigUpdateRequestSchema,
14721
+ GatewayConfigVersionSchema,
14722
+ GatewayCortexConfigurationSchema,
14723
+ GatewayCustomHostConfigurationSchema,
14724
+ GatewayDefaultsInputSchema,
14725
+ GatewayDeploymentAuthSettingsInputSchema,
14726
+ GatewayDeploymentCreateRequestSchema,
13367
14727
  GatewayDeploymentCreateResponseSchema,
13368
14728
  GatewayDeploymentDetailSchema,
14729
+ GatewayDeploymentPingResponseSchema,
13369
14730
  GatewayDeploymentSchema,
14731
+ GatewayDeploymentStatusSchema,
14732
+ GatewayDeploymentTypeSchema,
14733
+ GatewayDeploymentUpdateRequestSchema,
14734
+ GatewayGlobalWorkspaceAccessInputSchema,
13370
14735
  GatewayGlobalWorkspaceAccessSchema,
13371
14736
  GatewayGroupRowSchema,
14737
+ GatewayGuardrailActionsSchema,
14738
+ GatewayGuardrailCheckSchema,
14739
+ GatewayGuardrailCreateRequestSchema,
13372
14740
  GatewayGuardrailCreateResponseSchema,
13373
14741
  GatewayGuardrailDetailSchema,
13374
14742
  GatewayGuardrailSchema,
14743
+ GatewayGuardrailUpdateRequestSchema,
14744
+ GatewayHuggingFaceConfigurationSchema,
14745
+ GatewayIntegrationCreateRequestSchema,
14746
+ GatewayIntegrationModelUpdateSchema,
14747
+ GatewayIntegrationModelsBulkUpdateRequestSchema,
13375
14748
  GatewayIntegrationModelsResponseSchema,
13376
14749
  GatewayIntegrationSchema,
14750
+ GatewayIntegrationUpdateRequestSchema,
13377
14751
  GatewayIntegrationWorkspaceSchema,
14752
+ GatewayIntegrationWorkspacesBulkUpdateRequestSchema,
13378
14753
  GatewayIntegrationWorkspacesResponseSchema,
14754
+ GatewayJsonObjectSchema,
14755
+ GatewayJsonValueSchema,
13379
14756
  GatewayLogRecordSchema,
13380
14757
  GatewayLogsResponseSchema,
14758
+ GatewayMcpAuthTypeSchema,
14759
+ GatewayMcpTransportSchema,
14760
+ GatewayMutableMcpCapabilityTypeSchema,
14761
+ GatewayOpenAIConfigurationSchema,
14762
+ GatewayOrganisationAuthSettingsUpdateRequestSchema,
14763
+ GatewayOrganisationUpdateRequestSchema,
14764
+ GatewayPluginCreateRequestSchema,
13381
14765
  GatewayPluginSchema,
14766
+ GatewayProviderCreateRequestSchema,
13382
14767
  GatewayProviderCreateResponseSchema,
14768
+ GatewayProviderDetailSchema,
13383
14769
  GatewayProviderSchema,
14770
+ GatewayProviderUpdateRequestSchema,
14771
+ GatewayRateLimitInputSchema,
13384
14772
  GatewayRateLimitSchema,
14773
+ GatewayRateLimitTypeSchema,
14774
+ GatewayRateLimitUnitSchema,
14775
+ GatewayRoutingCacheSchema,
14776
+ GatewayRoutingConfigSchema,
14777
+ GatewayRoutingRetrySchema,
14778
+ GatewayRoutingStrategySchema,
14779
+ GatewayRoutingTargetSchema,
14780
+ GatewaySageMakerConfigurationSchema,
14781
+ GatewaySecretMappingSchema,
14782
+ GatewayServiceApiKeyCreateRequestSchema,
14783
+ GatewayUsageLimitInputSchema,
13385
14784
  GatewayUsageLimitSchema,
14785
+ GatewayUserApiKeyCreateRequestSchema,
14786
+ GatewayVertexAIConfigurationSchema,
14787
+ GatewayWorkersAIConfigurationSchema,
14788
+ GatewayWorkspaceBindingSchema,
14789
+ GatewayWorkspaceCreateRequestSchema,
13386
14790
  GatewayWorkspaceCreateResponseSchema,
13387
14791
  GatewayWorkspaceDetailSchema,
13388
14792
  GatewayWorkspaceSchema,
14793
+ GatewayWorkspaceUpdateRequestSchema,
13389
14794
  GatewayWriteResponseSchema,
13390
14795
  GoalListResponseSchema,
13391
14796
  GoalSchema,
@@ -13420,6 +14825,7 @@ var AIGatewayClient = class {
13420
14825
  LanguageOptionSchema,
13421
14826
  LatencyChartResponseSchema,
13422
14827
  ListApiKeysResponseSchema,
14828
+ ListConfigVersionsResponseSchema,
13423
14829
  ListConfigsResponseSchema,
13424
14830
  ListDeploymentsResponseSchema,
13425
14831
  ListGuardrailsResponseSchema,
@@ -13488,7 +14894,18 @@ var AIGatewayClient = class {
13488
14894
  MaskedDataSchema,
13489
14895
  McEntrySchema,
13490
14896
  McReportSchema,
14897
+ McpIntegrationCapabilitiesBulkUpdateRequestSchema,
14898
+ McpIntegrationCapabilitiesResponseSchema,
14899
+ McpIntegrationCapabilitiesUpdateResponseSchema,
14900
+ McpIntegrationCapabilitySchema,
14901
+ McpIntegrationCapabilityUpdateSchema,
14902
+ McpIntegrationCreateRequestSchema,
14903
+ McpIntegrationDetailSchema,
14904
+ McpIntegrationMetadataSchema,
13491
14905
  McpIntegrationSchema,
14906
+ McpIntegrationUpdateRequestSchema,
14907
+ McpIntegrationWorkspacesBulkUpdateRequestSchema,
14908
+ McpIntegrationWorkspacesUpdateResponseSchema,
13492
14909
  MetadataCriterionSchema,
13493
14910
  MetadataSchema,
13494
14911
  ModelConfigurationSchema,
@@ -13731,6 +15148,7 @@ var AIGatewayClient = class {
13731
15148
  WebSocketConnectionParamsSchema,
13732
15149
  WeightedRegexSchema,
13733
15150
  aiGwOrganisationsAuthSettingsPath,
15151
+ buildDottedObject,
13734
15152
  collectAll,
13735
15153
  collectSkipPages,
13736
15154
  collectSpringPages,
@@ -13739,6 +15157,8 @@ var AIGatewayClient = class {
13739
15157
  jsonNullable,
13740
15158
  pageSchema,
13741
15159
  paginate,
13742
- serializeListing
15160
+ redactAIGatewaySecrets,
15161
+ serializeListing,
15162
+ setDottedValue
13743
15163
  });
13744
15164
  //# sourceMappingURL=index.cjs.map