@cdot65/prisma-airs-sdk 0.13.2 → 0.17.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/README.md +46 -2
- package/dist/index.cjs +3005 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13301 -2834
- package/dist/index.d.ts +13301 -2834
- package/dist/index.js +2900 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -20,13 +20,56 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
AIGatewayApiKeysClient: () => AIGatewayApiKeysClient,
|
|
24
|
+
AIGatewayAuditLogsClient: () => AIGatewayAuditLogsClient,
|
|
25
|
+
AIGatewayClient: () => AIGatewayClient,
|
|
26
|
+
AIGatewayConfigsClient: () => AIGatewayConfigsClient,
|
|
27
|
+
AIGatewayDeploymentsClient: () => AIGatewayDeploymentsClient,
|
|
28
|
+
AIGatewayGuardrailsClient: () => AIGatewayGuardrailsClient,
|
|
29
|
+
AIGatewayIntegrationsClient: () => AIGatewayIntegrationsClient,
|
|
30
|
+
AIGatewayMcpIntegrationsClient: () => AIGatewayMcpIntegrationsClient,
|
|
31
|
+
AIGatewayOrganisationsClient: () => AIGatewayOrganisationsClient,
|
|
32
|
+
AIGatewayPluginsClient: () => AIGatewayPluginsClient,
|
|
33
|
+
AIGatewayProvidersClient: () => AIGatewayProvidersClient,
|
|
34
|
+
AIGatewayTelemetryClient: () => AIGatewayTelemetryClient,
|
|
35
|
+
AIGatewayWorkspacesClient: () => AIGatewayWorkspacesClient,
|
|
23
36
|
AIRS_ENDPOINTS: () => AIRS_ENDPOINTS,
|
|
24
37
|
AISecSDKException: () => AISecSDKException,
|
|
38
|
+
AI_GW_ADMIN_ENDPOINT: () => AI_GW_ADMIN_ENDPOINT,
|
|
39
|
+
AI_GW_API_KEYS_SERVICE_PATH: () => AI_GW_API_KEYS_SERVICE_PATH,
|
|
40
|
+
AI_GW_API_KEYS_USER_PATH: () => AI_GW_API_KEYS_USER_PATH,
|
|
41
|
+
AI_GW_AUDIT_LOGS_PATH: () => AI_GW_AUDIT_LOGS_PATH,
|
|
42
|
+
AI_GW_CHARTS_PATH: () => AI_GW_CHARTS_PATH,
|
|
43
|
+
AI_GW_CHART_METRICS: () => AI_GW_CHART_METRICS,
|
|
44
|
+
AI_GW_CONFIGS_PATH: () => AI_GW_CONFIGS_PATH,
|
|
45
|
+
AI_GW_DATA_ENDPOINT: () => AI_GW_DATA_ENDPOINT,
|
|
46
|
+
AI_GW_DEPLOYMENTS_PATH: () => AI_GW_DEPLOYMENTS_PATH,
|
|
47
|
+
AI_GW_GROUPS_PATH: () => AI_GW_GROUPS_PATH,
|
|
48
|
+
AI_GW_GROUP_COLUMNS: () => AI_GW_GROUP_COLUMNS,
|
|
49
|
+
AI_GW_GROUP_DIMENSIONS: () => AI_GW_GROUP_DIMENSIONS,
|
|
50
|
+
AI_GW_GUARDRAILS_PATH: () => AI_GW_GUARDRAILS_PATH,
|
|
51
|
+
AI_GW_INTEGRATIONS_PATH: () => AI_GW_INTEGRATIONS_PATH,
|
|
52
|
+
AI_GW_LOGS_PATH: () => AI_GW_LOGS_PATH,
|
|
53
|
+
AI_GW_MCP_INTEGRATIONS_PATH: () => AI_GW_MCP_INTEGRATIONS_PATH,
|
|
54
|
+
AI_GW_ORGANISATIONS_SELF_PATH: () => AI_GW_ORGANISATIONS_SELF_PATH,
|
|
55
|
+
AI_GW_PLUGINS_PATH: () => AI_GW_PLUGINS_PATH,
|
|
56
|
+
AI_GW_PROVIDERS_PATH: () => AI_GW_PROVIDERS_PATH,
|
|
57
|
+
AI_GW_WORKSPACES_PATH: () => AI_GW_WORKSPACES_PATH,
|
|
25
58
|
AI_SEC_API_ENDPOINT: () => AI_SEC_API_ENDPOINT,
|
|
26
59
|
AI_SEC_API_KEY: () => AI_SEC_API_KEY,
|
|
27
60
|
AI_SEC_API_TOKEN: () => AI_SEC_API_TOKEN,
|
|
28
61
|
ASYNC_SCAN_PATH: () => ASYNC_SCAN_PATH,
|
|
29
62
|
Action: () => Action,
|
|
63
|
+
AdapterCreateRequestSchema: () => AdapterCreateRequestSchema,
|
|
64
|
+
AdapterListItemSchema: () => AdapterListItemSchema,
|
|
65
|
+
AdapterListSchema: () => AdapterListSchema,
|
|
66
|
+
AdapterResponseSchema: () => AdapterResponseSchema,
|
|
67
|
+
AdapterUpdateRequestSchema: () => AdapterUpdateRequestSchema,
|
|
68
|
+
AdapterValidateRequestSchema: () => AdapterValidateRequestSchema,
|
|
69
|
+
AdapterValidateResponseSchema: () => AdapterValidateResponseSchema,
|
|
70
|
+
AdapterVarResponseSchema: () => AdapterVarResponseSchema,
|
|
71
|
+
AdapterVarSchema: () => AdapterVarSchema,
|
|
72
|
+
AdapterVarTypeSchema: () => AdapterVarTypeSchema,
|
|
30
73
|
AdvancedDataProfileRequestSchema: () => AdvancedDataProfileRequestSchema,
|
|
31
74
|
AgentEntrySchema: () => AgentEntrySchema,
|
|
32
75
|
AgentMetaSchema: () => AgentMetaSchema,
|
|
@@ -55,6 +98,7 @@ __export(index_exports, {
|
|
|
55
98
|
AttackType: () => AttackType,
|
|
56
99
|
AuditResponseSchema: () => AuditResponseSchema,
|
|
57
100
|
AuthConfigSchema: () => AuthConfigSchema,
|
|
101
|
+
AuthSettingsResponseSchema: () => AuthSettingsResponseSchema,
|
|
58
102
|
AuthType: () => AuthType,
|
|
59
103
|
BEARER: () => BEARER,
|
|
60
104
|
BaseResponseSchema: () => BaseResponseSchema,
|
|
@@ -62,6 +106,8 @@ __export(index_exports, {
|
|
|
62
106
|
BasicAuthLocation: () => BasicAuthLocation,
|
|
63
107
|
BedrockAccessConnectionParamsSchema: () => BedrockAccessConnectionParamsSchema,
|
|
64
108
|
BrandSubCategory: () => BrandSubCategory,
|
|
109
|
+
CacheHitTrendResponseSchema: () => CacheHitTrendResponseSchema,
|
|
110
|
+
CacheSummaryResponseSchema: () => CacheSummaryResponseSchema,
|
|
65
111
|
Category: () => Category,
|
|
66
112
|
CategoryModelSchema: () => CategoryModelSchema,
|
|
67
113
|
CategoryReportSchema: () => CategoryReportSchema,
|
|
@@ -83,7 +129,9 @@ __export(index_exports, {
|
|
|
83
129
|
Content: () => Content,
|
|
84
130
|
ContentErrorSchema: () => ContentErrorSchema,
|
|
85
131
|
ContentErrorType: () => ContentErrorType,
|
|
132
|
+
CostChartResponseSchema: () => CostChartResponseSchema,
|
|
86
133
|
CountByNameSchema: () => CountByNameSchema,
|
|
134
|
+
CountChartResponseSchema: () => CountChartResponseSchema,
|
|
87
135
|
CountedQuotaEnum: () => CountedQuotaEnum,
|
|
88
136
|
CreateChannelRequestSchema: () => CreateChannelRequestSchema,
|
|
89
137
|
CreateCustomTopicRequestSchema: () => CreateCustomTopicRequestSchema,
|
|
@@ -113,6 +161,8 @@ __export(index_exports, {
|
|
|
113
161
|
CustomerAppSchema: () => CustomerAppSchema,
|
|
114
162
|
CustomerAppWithKeysSchema: () => CustomerAppWithKeysSchema,
|
|
115
163
|
CustomerAppsClient: () => CustomerAppsClient,
|
|
164
|
+
DEFAULT_AI_GW_ADMIN_ENDPOINT: () => DEFAULT_AI_GW_ADMIN_ENDPOINT,
|
|
165
|
+
DEFAULT_AI_GW_DATA_ENDPOINT: () => DEFAULT_AI_GW_DATA_ENDPOINT,
|
|
116
166
|
DEFAULT_DLP_ENDPOINT: () => DEFAULT_DLP_ENDPOINT,
|
|
117
167
|
DEFAULT_ENDPOINT: () => DEFAULT_ENDPOINT,
|
|
118
168
|
DEFAULT_MGMT_ENDPOINT: () => DEFAULT_MGMT_ENDPOINT,
|
|
@@ -217,6 +267,7 @@ __export(index_exports, {
|
|
|
217
267
|
ErrorResponseSchema: () => ErrorResponseSchema,
|
|
218
268
|
ErrorSource: () => ErrorSource,
|
|
219
269
|
ErrorStatus: () => ErrorStatus,
|
|
270
|
+
ErrorTrendsResponseSchema: () => ErrorTrendsResponseSchema,
|
|
220
271
|
ErrorType: () => ErrorType,
|
|
221
272
|
EulaAcceptRequestSchema: () => EulaAcceptRequestSchema,
|
|
222
273
|
EulaContentResponseSchema: () => EulaContentResponseSchema,
|
|
@@ -227,16 +278,49 @@ __export(index_exports, {
|
|
|
227
278
|
ExclusionsSchema: () => ExclusionsSchema,
|
|
228
279
|
ExpressionOperatorTypeSchema: () => ExpressionOperatorTypeSchema,
|
|
229
280
|
ExpressionTreeNodeSchema: () => ExpressionTreeNodeSchema,
|
|
281
|
+
FeedbackModelsResponseSchema: () => FeedbackModelsResponseSchema,
|
|
282
|
+
FeedbackScoreDistributionResponseSchema: () => FeedbackScoreDistributionResponseSchema,
|
|
230
283
|
FileFormat: () => FileFormat,
|
|
231
284
|
FileListSchema: () => FileListSchema,
|
|
232
285
|
FileResponseSchema: () => FileResponseSchema,
|
|
233
286
|
FileScanDataSchema: () => FileScanDataSchema,
|
|
234
287
|
FileScanResult: () => FileScanResult,
|
|
235
288
|
FileType: () => FileType,
|
|
289
|
+
GatewayApiKeySchema: () => GatewayApiKeySchema,
|
|
290
|
+
GatewayAuditLogRecordSchema: () => GatewayAuditLogRecordSchema,
|
|
291
|
+
GatewayAuditLogsResponseSchema: () => GatewayAuditLogsResponseSchema,
|
|
292
|
+
GatewayChartRecordSchema: () => GatewayChartRecordSchema,
|
|
293
|
+
GatewayConfigCreateResponseSchema: () => GatewayConfigCreateResponseSchema,
|
|
294
|
+
GatewayConfigDetailSchema: () => GatewayConfigDetailSchema,
|
|
295
|
+
GatewayConfigSchema: () => GatewayConfigSchema,
|
|
296
|
+
GatewayDeploymentCreateResponseSchema: () => GatewayDeploymentCreateResponseSchema,
|
|
297
|
+
GatewayDeploymentDetailSchema: () => GatewayDeploymentDetailSchema,
|
|
298
|
+
GatewayDeploymentSchema: () => GatewayDeploymentSchema,
|
|
299
|
+
GatewayGlobalWorkspaceAccessSchema: () => GatewayGlobalWorkspaceAccessSchema,
|
|
300
|
+
GatewayGroupRowSchema: () => GatewayGroupRowSchema,
|
|
301
|
+
GatewayGuardrailCreateResponseSchema: () => GatewayGuardrailCreateResponseSchema,
|
|
302
|
+
GatewayGuardrailDetailSchema: () => GatewayGuardrailDetailSchema,
|
|
303
|
+
GatewayGuardrailSchema: () => GatewayGuardrailSchema,
|
|
304
|
+
GatewayIntegrationModelsResponseSchema: () => GatewayIntegrationModelsResponseSchema,
|
|
305
|
+
GatewayIntegrationSchema: () => GatewayIntegrationSchema,
|
|
306
|
+
GatewayIntegrationWorkspaceSchema: () => GatewayIntegrationWorkspaceSchema,
|
|
307
|
+
GatewayIntegrationWorkspacesResponseSchema: () => GatewayIntegrationWorkspacesResponseSchema,
|
|
308
|
+
GatewayLogRecordSchema: () => GatewayLogRecordSchema,
|
|
309
|
+
GatewayLogsResponseSchema: () => GatewayLogsResponseSchema,
|
|
310
|
+
GatewayPluginSchema: () => GatewayPluginSchema,
|
|
311
|
+
GatewayProviderCreateResponseSchema: () => GatewayProviderCreateResponseSchema,
|
|
312
|
+
GatewayProviderSchema: () => GatewayProviderSchema,
|
|
313
|
+
GatewayRateLimitSchema: () => GatewayRateLimitSchema,
|
|
314
|
+
GatewayUsageLimitSchema: () => GatewayUsageLimitSchema,
|
|
315
|
+
GatewayWorkspaceCreateResponseSchema: () => GatewayWorkspaceCreateResponseSchema,
|
|
316
|
+
GatewayWorkspaceDetailSchema: () => GatewayWorkspaceDetailSchema,
|
|
317
|
+
GatewayWorkspaceSchema: () => GatewayWorkspaceSchema,
|
|
318
|
+
GatewayWriteResponseSchema: () => GatewayWriteResponseSchema,
|
|
236
319
|
GoalListResponseSchema: () => GoalListResponseSchema,
|
|
237
320
|
GoalSchema: () => GoalSchema,
|
|
238
321
|
GoalType: () => GoalType,
|
|
239
322
|
GoalTypeQueryParam: () => GoalTypeQueryParam,
|
|
323
|
+
GroupListResponseSchema: () => GroupListResponseSchema,
|
|
240
324
|
GuardrailAction: () => GuardrailAction,
|
|
241
325
|
HEADER_API_KEY: () => HEADER_API_KEY,
|
|
242
326
|
HEADER_AUTH_TOKEN: () => HEADER_AUTH_TOKEN,
|
|
@@ -263,9 +347,19 @@ __export(index_exports, {
|
|
|
263
347
|
LabelsCreateRequestSchema: () => LabelsCreateRequestSchema,
|
|
264
348
|
LabelsResponseSchema: () => LabelsResponseSchema,
|
|
265
349
|
LanguageOptionSchema: () => LanguageOptionSchema,
|
|
350
|
+
LatencyChartResponseSchema: () => LatencyChartResponseSchema,
|
|
351
|
+
ListApiKeysResponseSchema: () => ListApiKeysResponseSchema,
|
|
352
|
+
ListConfigsResponseSchema: () => ListConfigsResponseSchema,
|
|
353
|
+
ListDeploymentsResponseSchema: () => ListDeploymentsResponseSchema,
|
|
354
|
+
ListGuardrailsResponseSchema: () => ListGuardrailsResponseSchema,
|
|
355
|
+
ListIntegrationsResponseSchema: () => ListIntegrationsResponseSchema,
|
|
356
|
+
ListMcpIntegrationsResponseSchema: () => ListMcpIntegrationsResponseSchema,
|
|
266
357
|
ListModelSecurityGroupsResponseSchema: () => ListModelSecurityGroupsResponseSchema,
|
|
267
358
|
ListModelSecurityRuleInstancesResponseSchema: () => ListModelSecurityRuleInstancesResponseSchema,
|
|
268
359
|
ListModelSecurityRulesResponseSchema: () => ListModelSecurityRulesResponseSchema,
|
|
360
|
+
ListPluginsResponseSchema: () => ListPluginsResponseSchema,
|
|
361
|
+
ListProvidersResponseSchema: () => ListProvidersResponseSchema,
|
|
362
|
+
ListWorkspacesResponseSchema: () => ListWorkspacesResponseSchema,
|
|
269
363
|
MAX_AI_PROFILE_NAME_LENGTH: () => MAX_AI_PROFILE_NAME_LENGTH,
|
|
270
364
|
MAX_API_KEY_LENGTH: () => MAX_API_KEY_LENGTH,
|
|
271
365
|
MAX_CONNECTION_POOL_SIZE: () => MAX_CONNECTION_POOL_SIZE,
|
|
@@ -323,6 +417,7 @@ __export(index_exports, {
|
|
|
323
417
|
MaskedDataSchema: () => MaskedDataSchema,
|
|
324
418
|
McEntrySchema: () => McEntrySchema,
|
|
325
419
|
McReportSchema: () => McReportSchema,
|
|
420
|
+
McpIntegrationSchema: () => McpIntegrationSchema,
|
|
326
421
|
MetadataCriterionSchema: () => MetadataCriterionSchema,
|
|
327
422
|
MetadataSchema: () => MetadataSchema,
|
|
328
423
|
ModelConfigurationSchema: () => ModelConfigurationSchema,
|
|
@@ -356,6 +451,7 @@ __export(index_exports, {
|
|
|
356
451
|
Oauth2TokenSchema: () => Oauth2TokenSchema,
|
|
357
452
|
OffsetSchema: () => OffsetSchema,
|
|
358
453
|
OpenAIConnectionParamsSchema: () => OpenAIConnectionParamsSchema,
|
|
454
|
+
OrganisationSelfResponseSchema: () => OrganisationSelfResponseSchema,
|
|
359
455
|
PAYLOAD_HASH: () => PAYLOAD_HASH,
|
|
360
456
|
PageDataFilteringProfileResponseSchema: () => PageDataFilteringProfileResponseSchema,
|
|
361
457
|
PageDataPatternResponseSchema: () => PageDataPatternResponseSchema,
|
|
@@ -389,6 +485,8 @@ __export(index_exports, {
|
|
|
389
485
|
PyPIAuthResponseSchema: () => PyPIAuthResponseSchema,
|
|
390
486
|
QuotaDetailsSchema: () => QuotaDetailsSchema,
|
|
391
487
|
QuotaSummarySchema: () => QuotaSummarySchema,
|
|
488
|
+
RED_TEAM_ADAPTER_PATH: () => RED_TEAM_ADAPTER_PATH,
|
|
489
|
+
RED_TEAM_ADAPTER_VALIDATE_PATH: () => RED_TEAM_ADAPTER_VALIDATE_PATH,
|
|
392
490
|
RED_TEAM_CATEGORIES_PATH: () => RED_TEAM_CATEGORIES_PATH,
|
|
393
491
|
RED_TEAM_CHANNELS_PATH: () => RED_TEAM_CHANNELS_PATH,
|
|
394
492
|
RED_TEAM_CHANNELS_STATS_PATH: () => RED_TEAM_CHANNELS_STATS_PATH,
|
|
@@ -418,6 +516,7 @@ __export(index_exports, {
|
|
|
418
516
|
RED_TEAM_TEMPLATE_PATH: () => RED_TEAM_TEMPLATE_PATH,
|
|
419
517
|
RED_TEAM_TOKEN_ENDPOINT: () => RED_TEAM_TOKEN_ENDPOINT,
|
|
420
518
|
RED_TEAM_TSG_ID: () => RED_TEAM_TSG_ID,
|
|
519
|
+
RedTeamAdaptersClient: () => RedTeamAdaptersClient,
|
|
421
520
|
RedTeamCategory: () => RedTeamCategory,
|
|
422
521
|
RedTeamClient: () => RedTeamClient,
|
|
423
522
|
RedTeamCustomAttackReportsClient: () => RedTeamCustomAttackReportsClient,
|
|
@@ -433,6 +532,7 @@ __export(index_exports, {
|
|
|
433
532
|
RegistryCredentialsSchema: () => RegistryCredentialsSchema,
|
|
434
533
|
RemediationDetailSchema: () => RemediationDetailSchema,
|
|
435
534
|
RemediationResponseSchema: () => RemediationResponseSchema,
|
|
535
|
+
RescuedRetriesResponseSchema: () => RescuedRetriesResponseSchema,
|
|
436
536
|
ResourceModelExtensionSchema: () => ResourceModelExtensionSchema,
|
|
437
537
|
ResponseDetectedSchema: () => ResponseDetectedSchema,
|
|
438
538
|
ResponseDetectionDetailsSchema: () => ResponseDetectionDetailsSchema,
|
|
@@ -507,6 +607,7 @@ __export(index_exports, {
|
|
|
507
607
|
StreamingConnectionParamsSchema: () => StreamingConnectionParamsSchema,
|
|
508
608
|
SubCategoryModelSchema: () => SubCategoryModelSchema,
|
|
509
609
|
SubCategoryStatsSchema: () => SubCategoryStatsSchema,
|
|
610
|
+
TSG_ID_HEADER: () => TSG_ID_HEADER,
|
|
510
611
|
TargetAdditionalContextSchema: () => TargetAdditionalContextSchema,
|
|
511
612
|
TargetAuthType: () => TargetAuthType,
|
|
512
613
|
TargetAuthValidationRequestSchema: () => TargetAuthValidationRequestSchema,
|
|
@@ -533,6 +634,7 @@ __export(index_exports, {
|
|
|
533
634
|
ThreatCategory: () => ThreatCategory,
|
|
534
635
|
ThreatScanReportSchema: () => ThreatScanReportSchema,
|
|
535
636
|
TokenStatsSchema: () => TokenStatsSchema,
|
|
637
|
+
TokensChartResponseSchema: () => TokensChartResponseSchema,
|
|
536
638
|
ToolDetectedSchema: () => ToolDetectedSchema,
|
|
537
639
|
ToolDetectionDetailsSchema: () => ToolDetectionDetailsSchema,
|
|
538
640
|
ToolDetectionEntrySchema: () => ToolDetectionEntrySchema,
|
|
@@ -547,6 +649,8 @@ __export(index_exports, {
|
|
|
547
649
|
UpdateChannelRequestSchema: () => UpdateChannelRequestSchema,
|
|
548
650
|
UrlCategorySchema: () => UrlCategorySchema,
|
|
549
651
|
UrlfEntrySchema: () => UrlfEntrySchema,
|
|
652
|
+
UserGroupResponseSchema: () => UserGroupResponseSchema,
|
|
653
|
+
UserTrendsResponseSchema: () => UserTrendsResponseSchema,
|
|
550
654
|
ValidationErrorSchema: () => ValidationErrorSchema,
|
|
551
655
|
Verdict: () => Verdict,
|
|
552
656
|
ViolationListSchema: () => ViolationListSchema,
|
|
@@ -555,6 +659,7 @@ __export(index_exports, {
|
|
|
555
659
|
ViolationSeverityCountsSchema: () => ViolationSeverityCountsSchema,
|
|
556
660
|
WebSocketConnectionParamsSchema: () => WebSocketConnectionParamsSchema,
|
|
557
661
|
WeightedRegexSchema: () => WeightedRegexSchema,
|
|
662
|
+
aiGwOrganisationsAuthSettingsPath: () => aiGwOrganisationsAuthSettingsPath,
|
|
558
663
|
globalConfiguration: () => globalConfiguration,
|
|
559
664
|
init: () => init,
|
|
560
665
|
jsonNullable: () => jsonNullable,
|
|
@@ -593,7 +698,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
|
|
|
593
698
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
594
699
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
595
700
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
596
|
-
var SDK_VERSION = "0.
|
|
701
|
+
var SDK_VERSION = "0.17.0";
|
|
597
702
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
598
703
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
599
704
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -668,6 +773,8 @@ var RED_TEAM_LANGUAGES_PATH = "/v1/languages";
|
|
|
668
773
|
var RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH = "/v1/error-log/target-profile";
|
|
669
774
|
var RED_TEAM_TARGET_PATH = "/v1/target";
|
|
670
775
|
var RED_TEAM_TARGET_VALIDATE_AUTH_PATH = "/v1/target/validate-auth";
|
|
776
|
+
var RED_TEAM_ADAPTER_PATH = "/v1/adapters";
|
|
777
|
+
var RED_TEAM_ADAPTER_VALIDATE_PATH = "/v1/adapters/validate";
|
|
671
778
|
var RED_TEAM_TEMPLATE_PATH = "/v1/template";
|
|
672
779
|
var RED_TEAM_EULA_PATH = "/v1/eula";
|
|
673
780
|
var RED_TEAM_INSTANCES_PATH = "/v1/instances";
|
|
@@ -676,6 +783,55 @@ var RED_TEAM_CUSTOM_ATTACK_PATH = "/v1/custom-attack";
|
|
|
676
783
|
var RED_TEAM_MGMT_DASHBOARD_PATH = "/v1/dashboard/overview";
|
|
677
784
|
var RED_TEAM_CHANNELS_PATH = "/v1/channels";
|
|
678
785
|
var RED_TEAM_CHANNELS_STATS_PATH = "/v1/channels/stats";
|
|
786
|
+
var DEFAULT_AI_GW_DATA_ENDPOINT = "https://api.apps.paloaltonetworks.com/ai_gw/v2";
|
|
787
|
+
var DEFAULT_AI_GW_ADMIN_ENDPOINT = "https://api.apps.paloaltonetworks.com/ai_gw/admin/v2";
|
|
788
|
+
var AI_GW_DATA_ENDPOINT = "PANW_AI_GW_DATA_ENDPOINT";
|
|
789
|
+
var AI_GW_ADMIN_ENDPOINT = "PANW_AI_GW_ADMIN_ENDPOINT";
|
|
790
|
+
var TSG_ID_HEADER = "x-tsg-id";
|
|
791
|
+
var AI_GW_WORKSPACES_PATH = "/workspaces";
|
|
792
|
+
var AI_GW_CONFIGS_PATH = "/configs";
|
|
793
|
+
var AI_GW_GUARDRAILS_PATH = "/guardrails";
|
|
794
|
+
var AI_GW_PROVIDERS_PATH = "/providers";
|
|
795
|
+
var AI_GW_API_KEYS_SERVICE_PATH = "/api-keys/service";
|
|
796
|
+
var AI_GW_API_KEYS_USER_PATH = "/api-keys/user";
|
|
797
|
+
var AI_GW_LOGS_PATH = "/logs";
|
|
798
|
+
var AI_GW_CHARTS_PATH = "/logs/charts";
|
|
799
|
+
var AI_GW_GROUPS_PATH = "/logs/groups";
|
|
800
|
+
var AI_GW_INTEGRATIONS_PATH = "/integrations";
|
|
801
|
+
var AI_GW_MCP_INTEGRATIONS_PATH = "/mcp-integrations";
|
|
802
|
+
var AI_GW_DEPLOYMENTS_PATH = "/deployments";
|
|
803
|
+
var AI_GW_PLUGINS_PATH = "/plugins";
|
|
804
|
+
var AI_GW_ORGANISATIONS_SELF_PATH = "/organisations/self";
|
|
805
|
+
var AI_GW_AUDIT_LOGS_PATH = "/audit-logs";
|
|
806
|
+
function aiGwOrganisationsAuthSettingsPath(tsgId) {
|
|
807
|
+
return `/organisations/${tsgId}/auth-settings`;
|
|
808
|
+
}
|
|
809
|
+
var AI_GW_CHART_METRICS = [
|
|
810
|
+
"cost",
|
|
811
|
+
"requests",
|
|
812
|
+
"latency",
|
|
813
|
+
"tokens",
|
|
814
|
+
"errors",
|
|
815
|
+
"users",
|
|
816
|
+
"cache-summary",
|
|
817
|
+
"cache-hit-trend",
|
|
818
|
+
"user-trends",
|
|
819
|
+
"error-trends",
|
|
820
|
+
"rescued-retries",
|
|
821
|
+
"feedback-trend",
|
|
822
|
+
"feedback-weighted",
|
|
823
|
+
"feedback-score-distribution",
|
|
824
|
+
"feedback-models"
|
|
825
|
+
];
|
|
826
|
+
var AI_GW_GROUP_DIMENSIONS = ["ai_service", "model", "api_key", "provider"];
|
|
827
|
+
var AI_GW_GROUP_COLUMNS = [
|
|
828
|
+
"cost",
|
|
829
|
+
"avg_latency",
|
|
830
|
+
"avg_tokens",
|
|
831
|
+
"total_tokens",
|
|
832
|
+
"success_rate",
|
|
833
|
+
"last_seen"
|
|
834
|
+
];
|
|
679
835
|
|
|
680
836
|
// src/errors.ts
|
|
681
837
|
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
@@ -838,7 +994,10 @@ function classifyErrorType(status) {
|
|
|
838
994
|
function extractErrorMessage(body, status) {
|
|
839
995
|
try {
|
|
840
996
|
const parsed = JSON.parse(body);
|
|
841
|
-
|
|
997
|
+
const data = parsed.data;
|
|
998
|
+
const code = data?.errorCode ?? void 0;
|
|
999
|
+
const base = parsed.error_message ?? parsed.message ?? data?.message ?? parsed.error?.message ?? parsed.msg ?? `API error ${status}`;
|
|
1000
|
+
return code ? `${base} (errorCode: ${code})` : base;
|
|
842
1001
|
} catch {
|
|
843
1002
|
return body ? `API error ${status}: ${body}` : `API error ${status}`;
|
|
844
1003
|
}
|
|
@@ -4131,6 +4290,76 @@ var TenantLanguagesResponseSchema = import_zod33.z.object({
|
|
|
4131
4290
|
supported_job_types: import_zod33.z.array(import_zod33.z.string()),
|
|
4132
4291
|
languages: import_zod33.z.array(LanguageOptionSchema)
|
|
4133
4292
|
}).passthrough();
|
|
4293
|
+
var AdapterVarTypeSchema = import_zod33.z.enum(["VAR", "SECRET"]);
|
|
4294
|
+
var AdapterVarSchema = import_zod33.z.object({
|
|
4295
|
+
key: import_zod33.z.string().max(255),
|
|
4296
|
+
value: import_zod33.z.string().nullable().optional(),
|
|
4297
|
+
type: AdapterVarTypeSchema
|
|
4298
|
+
});
|
|
4299
|
+
var AdapterVarResponseSchema = AdapterVarSchema.extend({
|
|
4300
|
+
is_redacted: import_zod33.z.boolean().optional()
|
|
4301
|
+
}).passthrough();
|
|
4302
|
+
var AdapterCreateRequestSchema = import_zod33.z.object({
|
|
4303
|
+
name: import_zod33.z.string().max(255),
|
|
4304
|
+
description: import_zod33.z.string().nullable().optional(),
|
|
4305
|
+
script_b64: import_zod33.z.string(),
|
|
4306
|
+
/** Optional while the adapter is a DRAFT; required to activate (`validate: true`). */
|
|
4307
|
+
network_broker_channel_uuid: import_zod33.z.string().uuid().nullable().optional(),
|
|
4308
|
+
variables: import_zod33.z.array(AdapterVarSchema).optional(),
|
|
4309
|
+
/** Sample prompt used to exercise the adapter end-to-end during validation. Not stored. */
|
|
4310
|
+
prompt: import_zod33.z.string()
|
|
4311
|
+
}).strict();
|
|
4312
|
+
var AdapterUpdateRequestSchema = import_zod33.z.object({
|
|
4313
|
+
name: import_zod33.z.string().max(255),
|
|
4314
|
+
description: import_zod33.z.string().nullable().optional(),
|
|
4315
|
+
script_b64: import_zod33.z.string(),
|
|
4316
|
+
network_broker_channel_uuid: import_zod33.z.string().uuid().nullable().optional(),
|
|
4317
|
+
variables: import_zod33.z.array(AdapterVarSchema).optional(),
|
|
4318
|
+
prompt: import_zod33.z.string()
|
|
4319
|
+
}).strict();
|
|
4320
|
+
var AdapterResponseSchema = import_zod33.z.object({
|
|
4321
|
+
uuid: import_zod33.z.string().uuid(),
|
|
4322
|
+
tsg_id: import_zod33.z.string(),
|
|
4323
|
+
name: import_zod33.z.string(),
|
|
4324
|
+
script_b64: import_zod33.z.string(),
|
|
4325
|
+
status: import_zod33.z.string(),
|
|
4326
|
+
description: import_zod33.z.string().nullable().optional(),
|
|
4327
|
+
network_broker_channel_uuid: import_zod33.z.string().uuid().nullable().optional(),
|
|
4328
|
+
variables: import_zod33.z.array(AdapterVarResponseSchema).optional(),
|
|
4329
|
+
/** Number of targets currently referencing this adapter. */
|
|
4330
|
+
target_count: import_zod33.z.number().int().optional(),
|
|
4331
|
+
created_at: import_zod33.z.string().nullable().optional(),
|
|
4332
|
+
updated_at: import_zod33.z.string().nullable().optional(),
|
|
4333
|
+
created_by_user_id: import_zod33.z.string().uuid().nullable().optional(),
|
|
4334
|
+
updated_by_user_id: import_zod33.z.string().uuid().nullable().optional()
|
|
4335
|
+
}).passthrough();
|
|
4336
|
+
var AdapterListItemSchema = import_zod33.z.object({
|
|
4337
|
+
uuid: import_zod33.z.string().uuid(),
|
|
4338
|
+
name: import_zod33.z.string(),
|
|
4339
|
+
status: import_zod33.z.string(),
|
|
4340
|
+
created_at: import_zod33.z.string(),
|
|
4341
|
+
updated_at: import_zod33.z.string(),
|
|
4342
|
+
created_by_user_id: import_zod33.z.string().uuid().nullable().optional(),
|
|
4343
|
+
target_count: import_zod33.z.number().int().nullable().optional()
|
|
4344
|
+
}).passthrough();
|
|
4345
|
+
var AdapterListSchema = import_zod33.z.object({
|
|
4346
|
+
pagination: RedTeamPaginationSchema,
|
|
4347
|
+
data: import_zod33.z.array(AdapterListItemSchema).optional()
|
|
4348
|
+
}).passthrough();
|
|
4349
|
+
var AdapterValidateRequestSchema = import_zod33.z.object({
|
|
4350
|
+
script_b64: import_zod33.z.string(),
|
|
4351
|
+
network_broker_channel_uuid: import_zod33.z.string().uuid(),
|
|
4352
|
+
prompt: import_zod33.z.string(),
|
|
4353
|
+
variables: import_zod33.z.array(AdapterVarSchema).optional(),
|
|
4354
|
+
/** Omit when validating a brand-new adapter. */
|
|
4355
|
+
adapter_uuid: import_zod33.z.string().uuid().nullable().optional()
|
|
4356
|
+
}).strict();
|
|
4357
|
+
var AdapterValidateResponseSchema = import_zod33.z.object({
|
|
4358
|
+
validated: import_zod33.z.boolean(),
|
|
4359
|
+
stdout: import_zod33.z.string().nullable().optional(),
|
|
4360
|
+
stderr: import_zod33.z.string().nullable().optional(),
|
|
4361
|
+
traceback: import_zod33.z.string().nullable().optional()
|
|
4362
|
+
}).passthrough();
|
|
4134
4363
|
var TargetRequestBaseFields = {
|
|
4135
4364
|
name: import_zod33.z.string(),
|
|
4136
4365
|
description: import_zod33.z.string().nullable().optional(),
|
|
@@ -4144,7 +4373,11 @@ var TargetRequestBaseFields = {
|
|
|
4144
4373
|
target_background: TargetBackgroundSchema.nullable().optional(),
|
|
4145
4374
|
additional_context: TargetAdditionalContextSchema.nullable().optional(),
|
|
4146
4375
|
extra_info: import_zod33.z.record(import_zod33.z.unknown()).nullable().optional(),
|
|
4147
|
-
network_broker_channel_uuid: import_zod33.z.string().nullable().optional()
|
|
4376
|
+
network_broker_channel_uuid: import_zod33.z.string().nullable().optional(),
|
|
4377
|
+
/** UUID of the custom target adapter to use. Required when connection_type is CUSTOM_TARGET_ADAPTER. */
|
|
4378
|
+
adapter_uuid: import_zod33.z.string().uuid().nullable().optional(),
|
|
4379
|
+
/** Per-target overrides for the adapter's variables. Array of AdapterVar objects. */
|
|
4380
|
+
adapter_variable_overrides: import_zod33.z.array(AdapterVarSchema).nullable().optional()
|
|
4148
4381
|
};
|
|
4149
4382
|
var TargetCreateRequestSchema = import_zod33.z.object(TargetRequestBaseFields).strict();
|
|
4150
4383
|
var TargetUpdateRequestSchema = import_zod33.z.object(TargetRequestBaseFields).strict();
|
|
@@ -4527,6 +4760,505 @@ var ChannelStatsSchema = import_zod34.z.object({
|
|
|
4527
4760
|
client_version: import_zod34.z.string().nullable().optional()
|
|
4528
4761
|
}).passthrough();
|
|
4529
4762
|
|
|
4763
|
+
// src/models/ai-gateway.ts
|
|
4764
|
+
var import_zod35 = require("zod");
|
|
4765
|
+
var aiGatewayEnvelope = (data) => import_zod35.z.object({ success: import_zod35.z.boolean(), data }).passthrough();
|
|
4766
|
+
var aiGatewayList = (item) => import_zod35.z.object({
|
|
4767
|
+
object: import_zod35.z.string(),
|
|
4768
|
+
total: import_zod35.z.number(),
|
|
4769
|
+
has_more: import_zod35.z.boolean().optional(),
|
|
4770
|
+
data: import_zod35.z.array(item)
|
|
4771
|
+
}).passthrough();
|
|
4772
|
+
var GatewayUsageLimitSchema = import_zod35.z.object({
|
|
4773
|
+
credit_limit: import_zod35.z.number().optional(),
|
|
4774
|
+
type: import_zod35.z.string().optional(),
|
|
4775
|
+
alert_threshold: import_zod35.z.number().optional(),
|
|
4776
|
+
periodic_reset: import_zod35.z.string().nullable().optional(),
|
|
4777
|
+
periodic_reset_days: import_zod35.z.number().nullable().optional(),
|
|
4778
|
+
next_usage_reset_at: import_zod35.z.string().nullable().optional()
|
|
4779
|
+
}).passthrough();
|
|
4780
|
+
var GatewayRateLimitSchema = import_zod35.z.object({
|
|
4781
|
+
type: import_zod35.z.string().optional(),
|
|
4782
|
+
unit: import_zod35.z.string().optional(),
|
|
4783
|
+
value: import_zod35.z.number().optional()
|
|
4784
|
+
}).passthrough();
|
|
4785
|
+
var limitsField = (policy) => import_zod35.z.union([import_zod35.z.array(policy), import_zod35.z.record(import_zod35.z.unknown())]).nullable();
|
|
4786
|
+
var aiGatewayGroupList = (item) => import_zod35.z.object({
|
|
4787
|
+
object: import_zod35.z.string(),
|
|
4788
|
+
is_quota_exceeded: import_zod35.z.boolean(),
|
|
4789
|
+
total: import_zod35.z.number(),
|
|
4790
|
+
data: import_zod35.z.array(item)
|
|
4791
|
+
}).passthrough();
|
|
4792
|
+
var quotaFlag = { isQuotaExceeded: import_zod35.z.boolean() };
|
|
4793
|
+
var GatewayChartRecordSchema = import_zod35.z.object({ x: import_zod35.z.string(), y: import_zod35.z.number(), avg: import_zod35.z.number().optional() }).passthrough();
|
|
4794
|
+
var CostChartResponseSchema = aiGatewayEnvelope(
|
|
4795
|
+
import_zod35.z.object({
|
|
4796
|
+
records: import_zod35.z.array(GatewayChartRecordSchema),
|
|
4797
|
+
total: import_zod35.z.number(),
|
|
4798
|
+
avg: import_zod35.z.number(),
|
|
4799
|
+
...quotaFlag
|
|
4800
|
+
}).passthrough()
|
|
4801
|
+
);
|
|
4802
|
+
var CountChartResponseSchema = aiGatewayEnvelope(
|
|
4803
|
+
import_zod35.z.object({
|
|
4804
|
+
records: import_zod35.z.array(GatewayChartRecordSchema),
|
|
4805
|
+
total: import_zod35.z.number().nullable(),
|
|
4806
|
+
...quotaFlag
|
|
4807
|
+
}).passthrough()
|
|
4808
|
+
);
|
|
4809
|
+
var LatencyChartResponseSchema = aiGatewayEnvelope(
|
|
4810
|
+
import_zod35.z.object({
|
|
4811
|
+
records: import_zod35.z.array(
|
|
4812
|
+
import_zod35.z.object({
|
|
4813
|
+
x: import_zod35.z.string(),
|
|
4814
|
+
y: import_zod35.z.number(),
|
|
4815
|
+
p50: import_zod35.z.number(),
|
|
4816
|
+
p90: import_zod35.z.number(),
|
|
4817
|
+
p99: import_zod35.z.number()
|
|
4818
|
+
}).passthrough()
|
|
4819
|
+
),
|
|
4820
|
+
total: import_zod35.z.number(),
|
|
4821
|
+
p50: import_zod35.z.number(),
|
|
4822
|
+
p90: import_zod35.z.number(),
|
|
4823
|
+
p99: import_zod35.z.number(),
|
|
4824
|
+
...quotaFlag
|
|
4825
|
+
}).passthrough()
|
|
4826
|
+
);
|
|
4827
|
+
var TokensChartResponseSchema = aiGatewayEnvelope(
|
|
4828
|
+
import_zod35.z.object({
|
|
4829
|
+
records: import_zod35.z.array(
|
|
4830
|
+
import_zod35.z.object({
|
|
4831
|
+
x: import_zod35.z.string(),
|
|
4832
|
+
y: import_zod35.z.number(),
|
|
4833
|
+
total_request_units: import_zod35.z.number(),
|
|
4834
|
+
total_response_units: import_zod35.z.number(),
|
|
4835
|
+
avg: import_zod35.z.number()
|
|
4836
|
+
}).passthrough()
|
|
4837
|
+
),
|
|
4838
|
+
total: import_zod35.z.number(),
|
|
4839
|
+
avg: import_zod35.z.number(),
|
|
4840
|
+
total_request_units: import_zod35.z.number(),
|
|
4841
|
+
total_response_units: import_zod35.z.number(),
|
|
4842
|
+
...quotaFlag
|
|
4843
|
+
}).passthrough()
|
|
4844
|
+
);
|
|
4845
|
+
var CacheSummaryResponseSchema = aiGatewayEnvelope(
|
|
4846
|
+
import_zod35.z.object({
|
|
4847
|
+
summary: import_zod35.z.object({
|
|
4848
|
+
cacheHits: import_zod35.z.number(),
|
|
4849
|
+
avgCacheLatency: import_zod35.z.number().nullable(),
|
|
4850
|
+
totalRequests: import_zod35.z.number(),
|
|
4851
|
+
cacheSpeedup: import_zod35.z.number()
|
|
4852
|
+
}).passthrough(),
|
|
4853
|
+
...quotaFlag
|
|
4854
|
+
}).passthrough()
|
|
4855
|
+
);
|
|
4856
|
+
var CacheHitTrendResponseSchema = aiGatewayEnvelope(
|
|
4857
|
+
import_zod35.z.object({
|
|
4858
|
+
trend: import_zod35.z.array(
|
|
4859
|
+
import_zod35.z.object({
|
|
4860
|
+
x: import_zod35.z.string(),
|
|
4861
|
+
simpleHits: import_zod35.z.number(),
|
|
4862
|
+
semanticHits: import_zod35.z.number(),
|
|
4863
|
+
hitRate: import_zod35.z.number(),
|
|
4864
|
+
cumulativeSimpleHitSavings: import_zod35.z.number(),
|
|
4865
|
+
cumulativeSemanticHitSavings: import_zod35.z.number()
|
|
4866
|
+
}).passthrough()
|
|
4867
|
+
),
|
|
4868
|
+
total: import_zod35.z.number(),
|
|
4869
|
+
summary: import_zod35.z.object({ totalCacheHits: import_zod35.z.number(), hitRate: import_zod35.z.number() }).passthrough(),
|
|
4870
|
+
...quotaFlag
|
|
4871
|
+
}).passthrough()
|
|
4872
|
+
);
|
|
4873
|
+
var UserTrendsResponseSchema = aiGatewayEnvelope(
|
|
4874
|
+
import_zod35.z.object({
|
|
4875
|
+
summary: import_zod35.z.object({ total: import_zod35.z.number(), unique: import_zod35.z.number(), avg: import_zod35.z.number() }).passthrough(),
|
|
4876
|
+
trend: import_zod35.z.array(GatewayChartRecordSchema),
|
|
4877
|
+
...quotaFlag
|
|
4878
|
+
}).passthrough()
|
|
4879
|
+
);
|
|
4880
|
+
var ErrorTrendsResponseSchema = aiGatewayEnvelope(
|
|
4881
|
+
import_zod35.z.object({
|
|
4882
|
+
summary: import_zod35.z.object({ errorPercent: import_zod35.z.number() }).passthrough(),
|
|
4883
|
+
trend: import_zod35.z.array(GatewayChartRecordSchema),
|
|
4884
|
+
...quotaFlag
|
|
4885
|
+
}).passthrough()
|
|
4886
|
+
);
|
|
4887
|
+
var RescuedRetriesResponseSchema = aiGatewayEnvelope(
|
|
4888
|
+
import_zod35.z.object({
|
|
4889
|
+
trend: import_zod35.z.array(
|
|
4890
|
+
import_zod35.z.object({
|
|
4891
|
+
x: import_zod35.z.string(),
|
|
4892
|
+
// Element shape unobserved — sample tenants only ever produced an empty array.
|
|
4893
|
+
// Treated like the sibling trends[].retry/fallback below until a tenant with
|
|
4894
|
+
// actual gateway retries lets us confirm the real shape. See open questions in
|
|
4895
|
+
// PRD-ai-gateway-client.md.
|
|
4896
|
+
y: import_zod35.z.array(import_zod35.z.unknown())
|
|
4897
|
+
}).passthrough()
|
|
4898
|
+
),
|
|
4899
|
+
total: import_zod35.z.number(),
|
|
4900
|
+
trends: import_zod35.z.array(
|
|
4901
|
+
import_zod35.z.object({ x: import_zod35.z.string(), retry: import_zod35.z.array(import_zod35.z.unknown()), fallback: import_zod35.z.array(import_zod35.z.unknown()) }).passthrough()
|
|
4902
|
+
),
|
|
4903
|
+
retryTotal: import_zod35.z.number(),
|
|
4904
|
+
fallbackTotal: import_zod35.z.number(),
|
|
4905
|
+
...quotaFlag
|
|
4906
|
+
}).passthrough()
|
|
4907
|
+
);
|
|
4908
|
+
var FeedbackScoreDistributionResponseSchema = aiGatewayEnvelope(
|
|
4909
|
+
import_zod35.z.object({
|
|
4910
|
+
records: import_zod35.z.array(import_zod35.z.object({ x: import_zod35.z.number(), y: import_zod35.z.number() }).passthrough()),
|
|
4911
|
+
total: import_zod35.z.number().nullable(),
|
|
4912
|
+
...quotaFlag
|
|
4913
|
+
}).passthrough()
|
|
4914
|
+
);
|
|
4915
|
+
var FeedbackModelsResponseSchema = aiGatewayEnvelope(
|
|
4916
|
+
import_zod35.z.object({
|
|
4917
|
+
records: import_zod35.z.array(
|
|
4918
|
+
import_zod35.z.object({
|
|
4919
|
+
x: import_zod35.z.string(),
|
|
4920
|
+
y: import_zod35.z.object({ avgWeightedFeedback: import_zod35.z.number(), feedbackCount: import_zod35.z.number() }).passthrough()
|
|
4921
|
+
}).passthrough()
|
|
4922
|
+
),
|
|
4923
|
+
...quotaFlag
|
|
4924
|
+
}).passthrough()
|
|
4925
|
+
);
|
|
4926
|
+
var GatewayGroupRowSchema = import_zod35.z.object({
|
|
4927
|
+
requests: import_zod35.z.number(),
|
|
4928
|
+
cost: import_zod35.z.number().optional(),
|
|
4929
|
+
avg_latency: import_zod35.z.number().optional(),
|
|
4930
|
+
avg_tokens: import_zod35.z.number().optional(),
|
|
4931
|
+
total_tokens: import_zod35.z.number().optional(),
|
|
4932
|
+
success_rate: import_zod35.z.number().optional(),
|
|
4933
|
+
last_seen: import_zod35.z.string().optional(),
|
|
4934
|
+
object: import_zod35.z.string()
|
|
4935
|
+
}).passthrough();
|
|
4936
|
+
var GroupListResponseSchema = aiGatewayGroupList(GatewayGroupRowSchema);
|
|
4937
|
+
var UserGroupResponseSchema = aiGatewayEnvelope(
|
|
4938
|
+
import_zod35.z.object({
|
|
4939
|
+
records: import_zod35.z.array(
|
|
4940
|
+
import_zod35.z.object({ _user: import_zod35.z.string(), count: import_zod35.z.number(), cost: import_zod35.z.number() }).passthrough()
|
|
4941
|
+
),
|
|
4942
|
+
total: import_zod35.z.number(),
|
|
4943
|
+
...quotaFlag
|
|
4944
|
+
}).passthrough()
|
|
4945
|
+
);
|
|
4946
|
+
var GatewayLogRecordSchema = import_zod35.z.object({
|
|
4947
|
+
id: import_zod35.z.string(),
|
|
4948
|
+
workspace_slug: import_zod35.z.string(),
|
|
4949
|
+
ai_model: import_zod35.z.string(),
|
|
4950
|
+
_user: import_zod35.z.string(),
|
|
4951
|
+
total_units: import_zod35.z.number(),
|
|
4952
|
+
/** Cents. */
|
|
4953
|
+
cost: import_zod35.z.number(),
|
|
4954
|
+
trace_id: import_zod35.z.string(),
|
|
4955
|
+
/** 0/1, not boolean. */
|
|
4956
|
+
is_proxy_call: import_zod35.z.number(),
|
|
4957
|
+
created_at: import_zod35.z.string(),
|
|
4958
|
+
/** 0/1, not boolean. */
|
|
4959
|
+
is_success: import_zod35.z.number(),
|
|
4960
|
+
/** `HIT` | `MISS` | `DISABLED`. */
|
|
4961
|
+
cache_status: import_zod35.z.string(),
|
|
4962
|
+
retry_success_count: import_zod35.z.number(),
|
|
4963
|
+
mode: import_zod35.z.string(),
|
|
4964
|
+
last_used_option_index: import_zod35.z.number(),
|
|
4965
|
+
/** 200 success, 446 AIRS security block (cost 0), 400 validation. */
|
|
4966
|
+
response_status_code: import_zod35.z.number(),
|
|
4967
|
+
request_url: import_zod35.z.string(),
|
|
4968
|
+
request_method: import_zod35.z.string(),
|
|
4969
|
+
ai_org: import_zod35.z.string(),
|
|
4970
|
+
api_key_id: import_zod35.z.string(),
|
|
4971
|
+
license_id: import_zod35.z.string(),
|
|
4972
|
+
log_store_file_path_format: import_zod35.z.string(),
|
|
4973
|
+
metadataKey: import_zod35.z.array(import_zod35.z.string()),
|
|
4974
|
+
metadataValue: import_zod35.z.array(import_zod35.z.string()),
|
|
4975
|
+
prompt_slug: import_zod35.z.string(),
|
|
4976
|
+
feedback: import_zod35.z.array(import_zod35.z.unknown())
|
|
4977
|
+
}).passthrough();
|
|
4978
|
+
var GatewayLogsResponseSchema = aiGatewayEnvelope(
|
|
4979
|
+
import_zod35.z.object({
|
|
4980
|
+
records: import_zod35.z.array(GatewayLogRecordSchema),
|
|
4981
|
+
total: import_zod35.z.number(),
|
|
4982
|
+
capturedTotal: import_zod35.z.number(),
|
|
4983
|
+
...quotaFlag
|
|
4984
|
+
}).passthrough()
|
|
4985
|
+
);
|
|
4986
|
+
var GatewayWriteResponseSchema = import_zod35.z.object({}).passthrough();
|
|
4987
|
+
var GatewayWorkspaceSchema = import_zod35.z.object({
|
|
4988
|
+
id: import_zod35.z.string(),
|
|
4989
|
+
slug: import_zod35.z.string(),
|
|
4990
|
+
name: import_zod35.z.string(),
|
|
4991
|
+
icon: import_zod35.z.string().nullable(),
|
|
4992
|
+
// Nullable: a workspace created without one returns null, and upstream declares it
|
|
4993
|
+
// `nullable: true`. Observed on an archived workspace (#213).
|
|
4994
|
+
description: import_zod35.z.string().nullable(),
|
|
4995
|
+
created_at: import_zod35.z.string(),
|
|
4996
|
+
last_updated_at: import_zod35.z.string(),
|
|
4997
|
+
is_default: import_zod35.z.number(),
|
|
4998
|
+
status: import_zod35.z.string(),
|
|
4999
|
+
scope_name: import_zod35.z.string(),
|
|
5000
|
+
object: import_zod35.z.string()
|
|
5001
|
+
}).passthrough();
|
|
5002
|
+
var GatewayWorkspaceDetailSchema = import_zod35.z.object({
|
|
5003
|
+
id: import_zod35.z.string(),
|
|
5004
|
+
name: import_zod35.z.string(),
|
|
5005
|
+
/** Nullable — see `GatewayWorkspaceSchema.description`. */
|
|
5006
|
+
description: import_zod35.z.string().nullable(),
|
|
5007
|
+
created_at: import_zod35.z.string(),
|
|
5008
|
+
last_updated_at: import_zod35.z.string(),
|
|
5009
|
+
is_default: import_zod35.z.number(),
|
|
5010
|
+
slug: import_zod35.z.string(),
|
|
5011
|
+
icon: import_zod35.z.string().nullable(),
|
|
5012
|
+
defaults: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
|
|
5013
|
+
usage_limits: limitsField(GatewayUsageLimitSchema),
|
|
5014
|
+
rate_limits: limitsField(GatewayRateLimitSchema),
|
|
5015
|
+
security_settings: import_zod35.z.record(import_zod35.z.boolean()).optional(),
|
|
5016
|
+
data_plane_security_settings: import_zod35.z.record(import_zod35.z.unknown()).optional(),
|
|
5017
|
+
settings: import_zod35.z.record(import_zod35.z.unknown()).optional(),
|
|
5018
|
+
/**
|
|
5019
|
+
* Lifecycle state. **Diverges from the list row**: `list()` reports `'active'` for a
|
|
5020
|
+
* workspace whose `get()` reports `null` (observed live 2026-08-01). Prefer the list value,
|
|
5021
|
+
* or treat a `null` here as "unknown", not as "inactive".
|
|
5022
|
+
*/
|
|
5023
|
+
status: import_zod35.z.string().nullable().optional()
|
|
5024
|
+
}).passthrough();
|
|
5025
|
+
var GatewayWorkspaceCreateResponseSchema = import_zod35.z.object({
|
|
5026
|
+
id: import_zod35.z.string(),
|
|
5027
|
+
name: import_zod35.z.string(),
|
|
5028
|
+
slug: import_zod35.z.string(),
|
|
5029
|
+
description: import_zod35.z.string().nullable(),
|
|
5030
|
+
created_at: import_zod35.z.string(),
|
|
5031
|
+
last_updated_at: import_zod35.z.string(),
|
|
5032
|
+
scope_name: import_zod35.z.string(),
|
|
5033
|
+
object: import_zod35.z.string(),
|
|
5034
|
+
defaults: import_zod35.z.record(import_zod35.z.unknown()).nullable().optional(),
|
|
5035
|
+
/** Seeded workspace members. Present on create only. */
|
|
5036
|
+
users: import_zod35.z.array(import_zod35.z.unknown()).optional()
|
|
5037
|
+
}).passthrough();
|
|
5038
|
+
var ListWorkspacesResponseSchema = aiGatewayList(GatewayWorkspaceSchema);
|
|
5039
|
+
var GatewayConfigSchema = import_zod35.z.object({
|
|
5040
|
+
id: import_zod35.z.string(),
|
|
5041
|
+
name: import_zod35.z.string(),
|
|
5042
|
+
slug: import_zod35.z.string(),
|
|
5043
|
+
/** Internal organisation UUID — NOT the TSG that write requests take. */
|
|
5044
|
+
organisation_id: import_zod35.z.string(),
|
|
5045
|
+
is_default: import_zod35.z.number(),
|
|
5046
|
+
status: import_zod35.z.string(),
|
|
5047
|
+
owner_id: import_zod35.z.string(),
|
|
5048
|
+
updated_by: import_zod35.z.string(),
|
|
5049
|
+
created_at: import_zod35.z.string(),
|
|
5050
|
+
last_updated_at: import_zod35.z.string(),
|
|
5051
|
+
workspace_id: import_zod35.z.string(),
|
|
5052
|
+
object: import_zod35.z.string()
|
|
5053
|
+
}).passthrough();
|
|
5054
|
+
var ListConfigsResponseSchema = aiGatewayList(GatewayConfigSchema);
|
|
5055
|
+
var GatewayConfigDetailSchema = GatewayConfigSchema.extend({
|
|
5056
|
+
config: import_zod35.z.string(),
|
|
5057
|
+
format: import_zod35.z.string(),
|
|
5058
|
+
type: import_zod35.z.string(),
|
|
5059
|
+
version_id: import_zod35.z.string()
|
|
5060
|
+
}).passthrough();
|
|
5061
|
+
var GatewayConfigCreateResponseSchema = import_zod35.z.object({
|
|
5062
|
+
id: import_zod35.z.string(),
|
|
5063
|
+
version_id: import_zod35.z.string(),
|
|
5064
|
+
slug: import_zod35.z.string(),
|
|
5065
|
+
object: import_zod35.z.string()
|
|
5066
|
+
}).passthrough();
|
|
5067
|
+
var GatewayGuardrailSchema = import_zod35.z.object({
|
|
5068
|
+
id: import_zod35.z.string(),
|
|
5069
|
+
name: import_zod35.z.string(),
|
|
5070
|
+
slug: import_zod35.z.string(),
|
|
5071
|
+
organisation_id: import_zod35.z.string(),
|
|
5072
|
+
status: import_zod35.z.string(),
|
|
5073
|
+
owner_id: import_zod35.z.string(),
|
|
5074
|
+
updated_by: import_zod35.z.string().nullable(),
|
|
5075
|
+
created_at: import_zod35.z.string(),
|
|
5076
|
+
last_updated_at: import_zod35.z.string(),
|
|
5077
|
+
workspace_id: import_zod35.z.string(),
|
|
5078
|
+
object: import_zod35.z.string()
|
|
5079
|
+
}).passthrough();
|
|
5080
|
+
var ListGuardrailsResponseSchema = aiGatewayList(GatewayGuardrailSchema);
|
|
5081
|
+
var guardrailFeedbackActionSchema = import_zod35.z.object({
|
|
5082
|
+
feedback: import_zod35.z.object({ value: import_zod35.z.number(), weight: import_zod35.z.number(), metadata: import_zod35.z.string() }).passthrough()
|
|
5083
|
+
}).passthrough();
|
|
5084
|
+
var GatewayGuardrailDetailSchema = GatewayGuardrailSchema.extend({
|
|
5085
|
+
checks: import_zod35.z.array(
|
|
5086
|
+
import_zod35.z.object({
|
|
5087
|
+
/** e.g. `panw-prisma-airs.intercept`, the Prisma AIRS intercept check. */
|
|
5088
|
+
id: import_zod35.z.string(),
|
|
5089
|
+
parameters: import_zod35.z.record(import_zod35.z.unknown()),
|
|
5090
|
+
is_enabled: import_zod35.z.boolean()
|
|
5091
|
+
}).passthrough()
|
|
5092
|
+
),
|
|
5093
|
+
actions: import_zod35.z.object({
|
|
5094
|
+
deny: import_zod35.z.boolean(),
|
|
5095
|
+
async: import_zod35.z.boolean(),
|
|
5096
|
+
sequential: import_zod35.z.boolean(),
|
|
5097
|
+
/** Absent when the guardrail was created without a pass/fail feedback action. */
|
|
5098
|
+
on_success: guardrailFeedbackActionSchema.optional(),
|
|
5099
|
+
on_fail: guardrailFeedbackActionSchema.optional()
|
|
5100
|
+
}).passthrough(),
|
|
5101
|
+
version_id: import_zod35.z.string()
|
|
5102
|
+
}).passthrough();
|
|
5103
|
+
var GatewayGuardrailCreateResponseSchema = import_zod35.z.object({
|
|
5104
|
+
id: import_zod35.z.string(),
|
|
5105
|
+
version_id: import_zod35.z.string(),
|
|
5106
|
+
slug: import_zod35.z.string(),
|
|
5107
|
+
object: import_zod35.z.string()
|
|
5108
|
+
}).passthrough();
|
|
5109
|
+
var GatewayProviderSchema = import_zod35.z.object({
|
|
5110
|
+
id: import_zod35.z.string(),
|
|
5111
|
+
name: import_zod35.z.string().optional(),
|
|
5112
|
+
slug: import_zod35.z.string().optional(),
|
|
5113
|
+
object: import_zod35.z.string().optional()
|
|
5114
|
+
}).passthrough();
|
|
5115
|
+
var ListProvidersResponseSchema = aiGatewayList(GatewayProviderSchema);
|
|
5116
|
+
var GatewayProviderCreateResponseSchema = import_zod35.z.object({
|
|
5117
|
+
id: import_zod35.z.string(),
|
|
5118
|
+
slug: import_zod35.z.string(),
|
|
5119
|
+
object: import_zod35.z.string()
|
|
5120
|
+
}).passthrough();
|
|
5121
|
+
var GatewayApiKeySchema = import_zod35.z.object({
|
|
5122
|
+
id: import_zod35.z.string(),
|
|
5123
|
+
name: import_zod35.z.string().optional(),
|
|
5124
|
+
object: import_zod35.z.string().optional()
|
|
5125
|
+
}).passthrough();
|
|
5126
|
+
var ListApiKeysResponseSchema = aiGatewayList(GatewayApiKeySchema);
|
|
5127
|
+
var GatewayIntegrationSchema = import_zod35.z.object({
|
|
5128
|
+
id: import_zod35.z.string(),
|
|
5129
|
+
organisation_id: import_zod35.z.string().optional(),
|
|
5130
|
+
name: import_zod35.z.string(),
|
|
5131
|
+
owner_id: import_zod35.z.string(),
|
|
5132
|
+
status: import_zod35.z.string(),
|
|
5133
|
+
created_at: import_zod35.z.string(),
|
|
5134
|
+
last_updated_at: import_zod35.z.string(),
|
|
5135
|
+
slug: import_zod35.z.string(),
|
|
5136
|
+
tags: import_zod35.z.unknown().nullable(),
|
|
5137
|
+
description: import_zod35.z.string().nullable(),
|
|
5138
|
+
workspaces_count: import_zod35.z.number().optional(),
|
|
5139
|
+
type: import_zod35.z.string().optional(),
|
|
5140
|
+
workspace_id: import_zod35.z.string().nullable(),
|
|
5141
|
+
ai_provider_id: import_zod35.z.string(),
|
|
5142
|
+
object: import_zod35.z.string()
|
|
5143
|
+
}).passthrough();
|
|
5144
|
+
var ListIntegrationsResponseSchema = aiGatewayList(GatewayIntegrationSchema);
|
|
5145
|
+
var GatewayIntegrationModelsResponseSchema = import_zod35.z.object({
|
|
5146
|
+
models: import_zod35.z.array(import_zod35.z.object({ slug: import_zod35.z.string(), enabled: import_zod35.z.boolean() }).passthrough()),
|
|
5147
|
+
allow_all_models: import_zod35.z.boolean(),
|
|
5148
|
+
object: import_zod35.z.string()
|
|
5149
|
+
}).passthrough();
|
|
5150
|
+
var GatewayIntegrationWorkspaceSchema = import_zod35.z.object({
|
|
5151
|
+
id: import_zod35.z.string(),
|
|
5152
|
+
usage_limits: limitsField(GatewayUsageLimitSchema),
|
|
5153
|
+
rate_limits: limitsField(GatewayRateLimitSchema),
|
|
5154
|
+
enabled: import_zod35.z.boolean(),
|
|
5155
|
+
status: import_zod35.z.string(),
|
|
5156
|
+
created_at: import_zod35.z.string(),
|
|
5157
|
+
last_updated_at: import_zod35.z.string(),
|
|
5158
|
+
last_reset_at: import_zod35.z.string().nullable()
|
|
5159
|
+
}).passthrough();
|
|
5160
|
+
var GatewayGlobalWorkspaceAccessSchema = import_zod35.z.object({
|
|
5161
|
+
enabled: import_zod35.z.boolean(),
|
|
5162
|
+
rate_limits: limitsField(GatewayRateLimitSchema),
|
|
5163
|
+
usage_limits: limitsField(GatewayUsageLimitSchema)
|
|
5164
|
+
}).passthrough();
|
|
5165
|
+
var GatewayIntegrationWorkspacesResponseSchema = import_zod35.z.object({
|
|
5166
|
+
workspaces: import_zod35.z.array(GatewayIntegrationWorkspaceSchema),
|
|
5167
|
+
global_workspace_access: GatewayGlobalWorkspaceAccessSchema,
|
|
5168
|
+
object: import_zod35.z.string()
|
|
5169
|
+
}).passthrough();
|
|
5170
|
+
var McpIntegrationSchema = import_zod35.z.object({
|
|
5171
|
+
id: import_zod35.z.string(),
|
|
5172
|
+
organisation_id: import_zod35.z.string(),
|
|
5173
|
+
name: import_zod35.z.string(),
|
|
5174
|
+
owner_id: import_zod35.z.string(),
|
|
5175
|
+
status: import_zod35.z.string(),
|
|
5176
|
+
type: import_zod35.z.string(),
|
|
5177
|
+
url: import_zod35.z.string(),
|
|
5178
|
+
auth_type: import_zod35.z.string(),
|
|
5179
|
+
transport: import_zod35.z.string(),
|
|
5180
|
+
/**
|
|
5181
|
+
* JSON-encoded STRING on reads — the same request/response asymmetry as
|
|
5182
|
+
* `configs.config` (see {@link GatewayConfigDetailSchema}). The CREATE request
|
|
5183
|
+
* (`McpIntegrationCreateRequest.configurations`) sends an object; this is the read shape.
|
|
5184
|
+
*/
|
|
5185
|
+
configurations: import_zod35.z.string(),
|
|
5186
|
+
created_at: import_zod35.z.string(),
|
|
5187
|
+
last_updated_at: import_zod35.z.string()
|
|
5188
|
+
}).passthrough();
|
|
5189
|
+
var ListMcpIntegrationsResponseSchema = aiGatewayList(McpIntegrationSchema);
|
|
5190
|
+
var GatewayDeploymentSchema = import_zod35.z.object({
|
|
5191
|
+
id: import_zod35.z.string(),
|
|
5192
|
+
name: import_zod35.z.string(),
|
|
5193
|
+
slug: import_zod35.z.string(),
|
|
5194
|
+
type: import_zod35.z.string(),
|
|
5195
|
+
/** `active` | `archived`. DELETE archives rather than removes. */
|
|
5196
|
+
status: import_zod35.z.string(),
|
|
5197
|
+
created_at: import_zod35.z.string(),
|
|
5198
|
+
last_updated_at: import_zod35.z.string(),
|
|
5199
|
+
last_synced_at: import_zod35.z.string().nullable(),
|
|
5200
|
+
last_resynced_at: import_zod35.z.string().nullable(),
|
|
5201
|
+
is_default: import_zod35.z.number(),
|
|
5202
|
+
created_by: import_zod35.z.string(),
|
|
5203
|
+
object: import_zod35.z.string()
|
|
5204
|
+
}).passthrough();
|
|
5205
|
+
var GatewayDeploymentDetailSchema = GatewayDeploymentSchema.extend({
|
|
5206
|
+
credentials: import_zod35.z.object({ username: import_zod35.z.string(), password: import_zod35.z.string() }).passthrough().optional(),
|
|
5207
|
+
deployment_config: import_zod35.z.record(import_zod35.z.unknown()).nullable(),
|
|
5208
|
+
auth_settings: import_zod35.z.object({
|
|
5209
|
+
/** 0/1, not boolean — the create REQUEST sends a real boolean here. */
|
|
5210
|
+
disable_portkey_gateway: import_zod35.z.number(),
|
|
5211
|
+
workspaces_allowed: import_zod35.z.array(import_zod35.z.string()),
|
|
5212
|
+
allow_all_workspaces: import_zod35.z.number()
|
|
5213
|
+
}).passthrough().optional(),
|
|
5214
|
+
client_auth: import_zod35.z.string().optional(),
|
|
5215
|
+
workspaces: import_zod35.z.array(import_zod35.z.object({ id: import_zod35.z.string(), slug: import_zod35.z.string() }).passthrough()).optional()
|
|
5216
|
+
}).passthrough();
|
|
5217
|
+
var GatewayDeploymentCreateResponseSchema = import_zod35.z.object({
|
|
5218
|
+
id: import_zod35.z.string(),
|
|
5219
|
+
client_auth: import_zod35.z.string(),
|
|
5220
|
+
credentials: import_zod35.z.object({ username: import_zod35.z.string(), password: import_zod35.z.string() }).passthrough(),
|
|
5221
|
+
/** Internal organisation UUID — NOT the TSG sent in the request. */
|
|
5222
|
+
organisation_id: import_zod35.z.string(),
|
|
5223
|
+
object: import_zod35.z.string()
|
|
5224
|
+
}).passthrough();
|
|
5225
|
+
var ListDeploymentsResponseSchema = aiGatewayList(GatewayDeploymentSchema);
|
|
5226
|
+
var GatewayPluginSchema = import_zod35.z.object({
|
|
5227
|
+
id: import_zod35.z.string(),
|
|
5228
|
+
integration_id: import_zod35.z.string(),
|
|
5229
|
+
credentials: import_zod35.z.record(import_zod35.z.string()),
|
|
5230
|
+
owner_id: import_zod35.z.string(),
|
|
5231
|
+
created_at: import_zod35.z.string(),
|
|
5232
|
+
last_updated_at: import_zod35.z.string(),
|
|
5233
|
+
status: import_zod35.z.string(),
|
|
5234
|
+
integration_slug: import_zod35.z.string(),
|
|
5235
|
+
plugin_provider_id: import_zod35.z.string(),
|
|
5236
|
+
plugin_provider_slug: import_zod35.z.string(),
|
|
5237
|
+
object: import_zod35.z.string()
|
|
5238
|
+
}).passthrough();
|
|
5239
|
+
var ListPluginsResponseSchema = aiGatewayList(GatewayPluginSchema);
|
|
5240
|
+
var OrganisationSelfResponseSchema = import_zod35.z.object({ success: import_zod35.z.boolean(), data: import_zod35.z.record(import_zod35.z.unknown()) }).passthrough();
|
|
5241
|
+
var AuthSettingsResponseSchema = import_zod35.z.object({ success: import_zod35.z.boolean(), data: import_zod35.z.record(import_zod35.z.unknown()) }).passthrough();
|
|
5242
|
+
var GatewayAuditLogRecordSchema = import_zod35.z.object({
|
|
5243
|
+
timestamp: import_zod35.z.string(),
|
|
5244
|
+
method: import_zod35.z.string(),
|
|
5245
|
+
uri: import_zod35.z.string(),
|
|
5246
|
+
request_id: import_zod35.z.string(),
|
|
5247
|
+
request_body: import_zod35.z.string(),
|
|
5248
|
+
query_params: import_zod35.z.string(),
|
|
5249
|
+
request_headers: import_zod35.z.string(),
|
|
5250
|
+
user_id: import_zod35.z.string(),
|
|
5251
|
+
user_type: import_zod35.z.string(),
|
|
5252
|
+
organisation_id: import_zod35.z.string(),
|
|
5253
|
+
workspace_id: import_zod35.z.string(),
|
|
5254
|
+
response_status_code: import_zod35.z.number(),
|
|
5255
|
+
resource_type: import_zod35.z.string(),
|
|
5256
|
+
action: import_zod35.z.string(),
|
|
5257
|
+
client_ip: import_zod35.z.string(),
|
|
5258
|
+
country: import_zod35.z.string()
|
|
5259
|
+
}).passthrough();
|
|
5260
|
+
var GatewayAuditLogsResponseSchema = import_zod35.z.object({ records: import_zod35.z.array(GatewayAuditLogRecordSchema) }).passthrough();
|
|
5261
|
+
|
|
4530
5262
|
// src/http/auth/oauth.ts
|
|
4531
5263
|
var OAuthAuth = class {
|
|
4532
5264
|
constructor(oauthClient) {
|
|
@@ -4549,12 +5281,12 @@ var OAuthAuth = class {
|
|
|
4549
5281
|
};
|
|
4550
5282
|
|
|
4551
5283
|
// src/models/oauth-token.ts
|
|
4552
|
-
var
|
|
4553
|
-
var OAuthTokenResponseSchema =
|
|
4554
|
-
access_token:
|
|
4555
|
-
token_type:
|
|
4556
|
-
expires_in:
|
|
4557
|
-
scope:
|
|
5284
|
+
var import_zod36 = require("zod");
|
|
5285
|
+
var OAuthTokenResponseSchema = import_zod36.z.object({
|
|
5286
|
+
access_token: import_zod36.z.string(),
|
|
5287
|
+
token_type: import_zod36.z.string().optional(),
|
|
5288
|
+
expires_in: import_zod36.z.number(),
|
|
5289
|
+
scope: import_zod36.z.string().optional()
|
|
4558
5290
|
}).passthrough();
|
|
4559
5291
|
|
|
4560
5292
|
// src/management/oauth-client.ts
|
|
@@ -4780,6 +5512,22 @@ function assertUuid(value, fieldName) {
|
|
|
4780
5512
|
);
|
|
4781
5513
|
}
|
|
4782
5514
|
}
|
|
5515
|
+
function assertWorkspaceRef(value, fieldName) {
|
|
5516
|
+
if (!isValidUuid(value) && !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) {
|
|
5517
|
+
throw new AISecSDKException(
|
|
5518
|
+
`Invalid ${fieldName}: ${value} (expected a workspace UUID or slug)`,
|
|
5519
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
5520
|
+
);
|
|
5521
|
+
}
|
|
5522
|
+
}
|
|
5523
|
+
function assertNumericId(value, fieldName) {
|
|
5524
|
+
if (!/^\d+$/.test(value)) {
|
|
5525
|
+
throw new AISecSDKException(
|
|
5526
|
+
`Invalid ${fieldName}: ${value}`,
|
|
5527
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
5528
|
+
);
|
|
5529
|
+
}
|
|
5530
|
+
}
|
|
4783
5531
|
|
|
4784
5532
|
// src/management/profiles.ts
|
|
4785
5533
|
var ProfilesClient = class {
|
|
@@ -5539,7 +6287,7 @@ var ScanLogsClient = class {
|
|
|
5539
6287
|
};
|
|
5540
6288
|
|
|
5541
6289
|
// src/management/oauth-management.ts
|
|
5542
|
-
var
|
|
6290
|
+
var import_zod37 = require("zod");
|
|
5543
6291
|
var OAuthManagementClient = class {
|
|
5544
6292
|
baseUrl;
|
|
5545
6293
|
auth;
|
|
@@ -5573,7 +6321,7 @@ var OAuthManagementClient = class {
|
|
|
5573
6321
|
path: MGMT_OAUTH_INVALIDATE_PATH,
|
|
5574
6322
|
params: { token },
|
|
5575
6323
|
body,
|
|
5576
|
-
responseSchema:
|
|
6324
|
+
responseSchema: import_zod37.z.string(),
|
|
5577
6325
|
auth: this.auth,
|
|
5578
6326
|
numRetries: this.numRetries
|
|
5579
6327
|
});
|
|
@@ -7434,7 +8182,7 @@ var ModelSecurityClient = class {
|
|
|
7434
8182
|
};
|
|
7435
8183
|
|
|
7436
8184
|
// src/red-team/scans-client.ts
|
|
7437
|
-
var
|
|
8185
|
+
var import_zod38 = require("zod");
|
|
7438
8186
|
var RedTeamScansClient = class {
|
|
7439
8187
|
baseUrl;
|
|
7440
8188
|
auth;
|
|
@@ -7571,7 +8319,7 @@ var RedTeamScansClient = class {
|
|
|
7571
8319
|
method: "GET",
|
|
7572
8320
|
baseUrl: this.baseUrl,
|
|
7573
8321
|
path: RED_TEAM_CATEGORIES_PATH,
|
|
7574
|
-
responseSchema:
|
|
8322
|
+
responseSchema: import_zod38.z.array(CategoryModelSchema),
|
|
7575
8323
|
auth: this.auth,
|
|
7576
8324
|
numRetries: this.numRetries
|
|
7577
8325
|
});
|
|
@@ -7579,7 +8327,7 @@ var RedTeamScansClient = class {
|
|
|
7579
8327
|
};
|
|
7580
8328
|
|
|
7581
8329
|
// src/red-team/reports-client.ts
|
|
7582
|
-
var
|
|
8330
|
+
var import_zod39 = require("zod");
|
|
7583
8331
|
var RedTeamReportsClient = class {
|
|
7584
8332
|
baseUrl;
|
|
7585
8333
|
auth;
|
|
@@ -7954,7 +8702,7 @@ var RedTeamReportsClient = class {
|
|
|
7954
8702
|
baseUrl: this.baseUrl,
|
|
7955
8703
|
path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
|
|
7956
8704
|
params: { file_format: format },
|
|
7957
|
-
responseSchema:
|
|
8705
|
+
responseSchema: import_zod39.z.unknown(),
|
|
7958
8706
|
auth: this.auth,
|
|
7959
8707
|
numRetries: this.numRetries
|
|
7960
8708
|
});
|
|
@@ -7978,7 +8726,7 @@ var RedTeamReportsClient = class {
|
|
|
7978
8726
|
method: "POST",
|
|
7979
8727
|
baseUrl: this.baseUrl,
|
|
7980
8728
|
path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
|
|
7981
|
-
responseSchema:
|
|
8729
|
+
responseSchema: import_zod39.z.unknown(),
|
|
7982
8730
|
auth: this.auth,
|
|
7983
8731
|
numRetries: this.numRetries
|
|
7984
8732
|
});
|
|
@@ -7986,7 +8734,7 @@ var RedTeamReportsClient = class {
|
|
|
7986
8734
|
};
|
|
7987
8735
|
|
|
7988
8736
|
// src/red-team/custom-attack-reports-client.ts
|
|
7989
|
-
var
|
|
8737
|
+
var import_zod40 = require("zod");
|
|
7990
8738
|
var RedTeamCustomAttackReportsClient = class {
|
|
7991
8739
|
baseUrl;
|
|
7992
8740
|
auth;
|
|
@@ -8076,7 +8824,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
8076
8824
|
baseUrl: this.baseUrl,
|
|
8077
8825
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
8078
8826
|
params,
|
|
8079
|
-
responseSchema:
|
|
8827
|
+
responseSchema: import_zod40.z.array(PromptDetailResponseSchema),
|
|
8080
8828
|
auth: this.auth,
|
|
8081
8829
|
numRetries: this.numRetries
|
|
8082
8830
|
});
|
|
@@ -8170,7 +8918,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
8170
8918
|
method: "GET",
|
|
8171
8919
|
baseUrl: this.baseUrl,
|
|
8172
8920
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
|
|
8173
|
-
responseSchema:
|
|
8921
|
+
responseSchema: import_zod40.z.array(CustomAttackOutputSchema),
|
|
8174
8922
|
auth: this.auth,
|
|
8175
8923
|
numRetries: this.numRetries
|
|
8176
8924
|
});
|
|
@@ -8195,7 +8943,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
8195
8943
|
method: "GET",
|
|
8196
8944
|
baseUrl: this.baseUrl,
|
|
8197
8945
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
|
|
8198
|
-
responseSchema:
|
|
8946
|
+
responseSchema: import_zod40.z.array(PropertyStatisticSchema),
|
|
8199
8947
|
auth: this.auth,
|
|
8200
8948
|
numRetries: this.numRetries
|
|
8201
8949
|
});
|
|
@@ -8203,7 +8951,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
8203
8951
|
};
|
|
8204
8952
|
|
|
8205
8953
|
// src/red-team/targets-client.ts
|
|
8206
|
-
var
|
|
8954
|
+
var import_zod41 = require("zod");
|
|
8207
8955
|
var RedTeamTargetsClient = class {
|
|
8208
8956
|
baseUrl;
|
|
8209
8957
|
auth;
|
|
@@ -8496,7 +9244,7 @@ var RedTeamTargetsClient = class {
|
|
|
8496
9244
|
method: "GET",
|
|
8497
9245
|
baseUrl: this.baseUrl,
|
|
8498
9246
|
path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
|
|
8499
|
-
responseSchema:
|
|
9247
|
+
responseSchema: import_zod41.z.record(import_zod41.z.unknown()),
|
|
8500
9248
|
auth: this.auth,
|
|
8501
9249
|
numRetries: this.numRetries
|
|
8502
9250
|
});
|
|
@@ -9594,6 +10342,176 @@ var RedTeamNetworkBrokerClient = class {
|
|
|
9594
10342
|
}
|
|
9595
10343
|
};
|
|
9596
10344
|
|
|
10345
|
+
// src/red-team/adapters-client.ts
|
|
10346
|
+
var RedTeamAdaptersClient = class {
|
|
10347
|
+
baseUrl;
|
|
10348
|
+
auth;
|
|
10349
|
+
numRetries;
|
|
10350
|
+
constructor(opts) {
|
|
10351
|
+
this.baseUrl = opts.baseUrl;
|
|
10352
|
+
this.auth = opts.auth;
|
|
10353
|
+
this.numRetries = opts.numRetries;
|
|
10354
|
+
}
|
|
10355
|
+
/**
|
|
10356
|
+
* Create a new custom target adapter.
|
|
10357
|
+
* @param body - Adapter creation request (name, base64 script, variables, validation prompt).
|
|
10358
|
+
* @param opts - Set validate: false to save as DRAFT without running the script.
|
|
10359
|
+
* @returns The created adapter.
|
|
10360
|
+
* @example
|
|
10361
|
+
* ```ts
|
|
10362
|
+
* const adapter = await rt.adapters.create({
|
|
10363
|
+
* name: 'my-adapter',
|
|
10364
|
+
* script_b64: Buffer.from(script).toString('base64'),
|
|
10365
|
+
* network_broker_channel_uuid: '550e8400-...',
|
|
10366
|
+
* variables: [{ key: 'endpoint', value: 'http://...', type: 'VAR' }],
|
|
10367
|
+
* prompt: 'Hello',
|
|
10368
|
+
* }, { validate: true });
|
|
10369
|
+
* ```
|
|
10370
|
+
*/
|
|
10371
|
+
async create(body, opts) {
|
|
10372
|
+
const validate = opts?.validate ?? true;
|
|
10373
|
+
return request({
|
|
10374
|
+
method: "POST",
|
|
10375
|
+
baseUrl: this.baseUrl,
|
|
10376
|
+
path: RED_TEAM_ADAPTER_PATH,
|
|
10377
|
+
params: { validate: String(validate) },
|
|
10378
|
+
body,
|
|
10379
|
+
responseSchema: AdapterResponseSchema,
|
|
10380
|
+
auth: this.auth,
|
|
10381
|
+
numRetries: this.numRetries
|
|
10382
|
+
});
|
|
10383
|
+
}
|
|
10384
|
+
/**
|
|
10385
|
+
* List adapters with optional pagination.
|
|
10386
|
+
* @param opts - Optional limit/skip/search.
|
|
10387
|
+
* @returns Paginated list of adapters.
|
|
10388
|
+
* @example
|
|
10389
|
+
* ```ts
|
|
10390
|
+
* const { data } = await rt.adapters.list({ limit: 20 });
|
|
10391
|
+
* // data => [{ uuid: '...', name: 'my-adapter', status: 'ACTIVE' }]
|
|
10392
|
+
* ```
|
|
10393
|
+
*/
|
|
10394
|
+
async list(opts) {
|
|
10395
|
+
return request({
|
|
10396
|
+
method: "GET",
|
|
10397
|
+
baseUrl: this.baseUrl,
|
|
10398
|
+
path: RED_TEAM_ADAPTER_PATH,
|
|
10399
|
+
params: serializeListing(opts),
|
|
10400
|
+
responseSchema: AdapterListSchema,
|
|
10401
|
+
auth: this.auth,
|
|
10402
|
+
numRetries: this.numRetries
|
|
10403
|
+
});
|
|
10404
|
+
}
|
|
10405
|
+
/**
|
|
10406
|
+
* Get a single adapter by UUID.
|
|
10407
|
+
* @param uuid - Adapter UUID.
|
|
10408
|
+
* @returns The adapter detail.
|
|
10409
|
+
* @example
|
|
10410
|
+
* ```ts
|
|
10411
|
+
* const adapter = await rt.adapters.get('550e8400-e29b-41d4-a716-446655440000');
|
|
10412
|
+
* // adapter.status => 'ACTIVE'
|
|
10413
|
+
* ```
|
|
10414
|
+
*/
|
|
10415
|
+
async get(uuid) {
|
|
10416
|
+
assertUuid(uuid, "adapter uuid");
|
|
10417
|
+
return request({
|
|
10418
|
+
method: "GET",
|
|
10419
|
+
baseUrl: this.baseUrl,
|
|
10420
|
+
path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
|
|
10421
|
+
responseSchema: AdapterResponseSchema,
|
|
10422
|
+
auth: this.auth,
|
|
10423
|
+
numRetries: this.numRetries
|
|
10424
|
+
});
|
|
10425
|
+
}
|
|
10426
|
+
/**
|
|
10427
|
+
* Update an adapter. **Full replacement (PUT), not a patch** — `name`, `script_b64`, and
|
|
10428
|
+
* `prompt` are required just as on create. For `variables`, the list defines the complete
|
|
10429
|
+
* desired key set: a provided value sets it, `null` keeps the stored value (unchanged
|
|
10430
|
+
* secrets), and omitting a key **deletes** that variable.
|
|
10431
|
+
* @param uuid - Adapter UUID.
|
|
10432
|
+
* @param body - The complete adapter definition.
|
|
10433
|
+
* @param opts - Set validate: false to save as DRAFT without re-running the script.
|
|
10434
|
+
* @returns The updated adapter.
|
|
10435
|
+
* @example
|
|
10436
|
+
* ```ts
|
|
10437
|
+
* const updated = await rt.adapters.update('550e8400-...', {
|
|
10438
|
+
* name: 'my-keycloak-agent',
|
|
10439
|
+
* script_b64: Buffer.from(newScript).toString('base64'),
|
|
10440
|
+
* prompt: 'What is the capital of France?',
|
|
10441
|
+
* variables: [
|
|
10442
|
+
* { key: 'endpoint', value: 'http://agent.svc:8080', type: 'VAR' },
|
|
10443
|
+
* { key: 'client_secret', value: null, type: 'SECRET' }, // null keeps stored secret
|
|
10444
|
+
* ],
|
|
10445
|
+
* });
|
|
10446
|
+
* ```
|
|
10447
|
+
*/
|
|
10448
|
+
async update(uuid, body, opts) {
|
|
10449
|
+
assertUuid(uuid, "adapter uuid");
|
|
10450
|
+
const validate = opts?.validate ?? true;
|
|
10451
|
+
return request({
|
|
10452
|
+
method: "PUT",
|
|
10453
|
+
baseUrl: this.baseUrl,
|
|
10454
|
+
path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
|
|
10455
|
+
params: { validate: String(validate) },
|
|
10456
|
+
body,
|
|
10457
|
+
responseSchema: AdapterResponseSchema,
|
|
10458
|
+
auth: this.auth,
|
|
10459
|
+
numRetries: this.numRetries
|
|
10460
|
+
});
|
|
10461
|
+
}
|
|
10462
|
+
/**
|
|
10463
|
+
* Delete an adapter.
|
|
10464
|
+
* @param uuid - Adapter UUID.
|
|
10465
|
+
* @example
|
|
10466
|
+
* ```ts
|
|
10467
|
+
* await rt.adapters.delete('550e8400-e29b-41d4-a716-446655440000');
|
|
10468
|
+
* ```
|
|
10469
|
+
*/
|
|
10470
|
+
async delete(uuid) {
|
|
10471
|
+
assertUuid(uuid, "adapter uuid");
|
|
10472
|
+
return request({
|
|
10473
|
+
method: "DELETE",
|
|
10474
|
+
baseUrl: this.baseUrl,
|
|
10475
|
+
path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
|
|
10476
|
+
responseSchema: BaseResponseSchema.optional(),
|
|
10477
|
+
allowEmptyBody: true,
|
|
10478
|
+
auth: this.auth,
|
|
10479
|
+
numRetries: this.numRetries
|
|
10480
|
+
});
|
|
10481
|
+
}
|
|
10482
|
+
/**
|
|
10483
|
+
* Validate an adapter script without saving anything. Runs the script end-to-end through the
|
|
10484
|
+
* network broker channel using the sample prompt, and returns the execution outcome —
|
|
10485
|
+
* `validated` plus the script's `stdout` / `stderr` / `traceback` — not an adapter record.
|
|
10486
|
+
*
|
|
10487
|
+
* This endpoint has its own request shape: no `name`, `network_broker_channel_uuid` is
|
|
10488
|
+
* required, and `adapter_uuid` may reference an existing adapter so `null` variable values
|
|
10489
|
+
* are resolved from its stored secrets before the run.
|
|
10490
|
+
* @param body - Script, channel, prompt, and optionally variables / an existing adapter UUID.
|
|
10491
|
+
* @returns The validation outcome.
|
|
10492
|
+
* @example
|
|
10493
|
+
* ```ts
|
|
10494
|
+
* const result = await rt.adapters.validate({
|
|
10495
|
+
* script_b64: Buffer.from(script).toString('base64'),
|
|
10496
|
+
* network_broker_channel_uuid: '550e8400-...',
|
|
10497
|
+
* prompt: 'Hello',
|
|
10498
|
+
* });
|
|
10499
|
+
* if (!result.validated) console.error(result.stderr ?? result.traceback);
|
|
10500
|
+
* ```
|
|
10501
|
+
*/
|
|
10502
|
+
async validate(body) {
|
|
10503
|
+
return request({
|
|
10504
|
+
method: "POST",
|
|
10505
|
+
baseUrl: this.baseUrl,
|
|
10506
|
+
path: RED_TEAM_ADAPTER_VALIDATE_PATH,
|
|
10507
|
+
body,
|
|
10508
|
+
responseSchema: AdapterValidateResponseSchema,
|
|
10509
|
+
auth: this.auth,
|
|
10510
|
+
numRetries: this.numRetries
|
|
10511
|
+
});
|
|
10512
|
+
}
|
|
10513
|
+
};
|
|
10514
|
+
|
|
9597
10515
|
// src/red-team/client.ts
|
|
9598
10516
|
var RedTeamClient = class {
|
|
9599
10517
|
/** Data plane scan operations. */
|
|
@@ -9612,6 +10530,8 @@ var RedTeamClient = class {
|
|
|
9612
10530
|
instances;
|
|
9613
10531
|
/** Network broker channel operations (distinct network broker base URL). */
|
|
9614
10532
|
networkBroker;
|
|
10533
|
+
/** Management plane custom target adapter operations. */
|
|
10534
|
+
adapters;
|
|
9615
10535
|
dataEndpoint;
|
|
9616
10536
|
mgmtEndpoint;
|
|
9617
10537
|
auth;
|
|
@@ -9650,6 +10570,7 @@ var RedTeamClient = class {
|
|
|
9650
10570
|
});
|
|
9651
10571
|
this.eula = new RedTeamEulaClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
9652
10572
|
this.instances = new RedTeamInstancesClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
10573
|
+
this.adapters = new RedTeamAdaptersClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
9653
10574
|
this.networkBroker = new RedTeamNetworkBrokerClient({
|
|
9654
10575
|
baseUrl: networkBrokerEndpoint,
|
|
9655
10576
|
auth,
|
|
@@ -9919,15 +10840,2015 @@ var RedTeamClient = class {
|
|
|
9919
10840
|
});
|
|
9920
10841
|
}
|
|
9921
10842
|
};
|
|
10843
|
+
|
|
10844
|
+
// src/http/auth/tsg-header.ts
|
|
10845
|
+
var TsgHeaderAuth = class {
|
|
10846
|
+
constructor(inner, tsgId) {
|
|
10847
|
+
this.inner = inner;
|
|
10848
|
+
this.tsgId = tsgId;
|
|
10849
|
+
}
|
|
10850
|
+
async prepare(req) {
|
|
10851
|
+
const prepared = await this.inner.prepare(req);
|
|
10852
|
+
return {
|
|
10853
|
+
...prepared,
|
|
10854
|
+
headers: { ...prepared.headers, [TSG_ID_HEADER]: this.tsgId }
|
|
10855
|
+
};
|
|
10856
|
+
}
|
|
10857
|
+
async onUnauthorized(res) {
|
|
10858
|
+
return await this.inner.onUnauthorized?.(res) ?? false;
|
|
10859
|
+
}
|
|
10860
|
+
};
|
|
10861
|
+
|
|
10862
|
+
// src/ai-gateway/window.ts
|
|
10863
|
+
function toOffsetIso(d) {
|
|
10864
|
+
const pad = (n) => String(Math.floor(Math.abs(n))).padStart(2, "0");
|
|
10865
|
+
const offsetMin = -d.getTimezoneOffset();
|
|
10866
|
+
const sign = offsetMin >= 0 ? "+" : "-";
|
|
10867
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}${sign}${pad(offsetMin / 60)}:${pad(offsetMin % 60)}`;
|
|
10868
|
+
}
|
|
10869
|
+
function serializeWindow(tsgId, opts) {
|
|
10870
|
+
const end = opts.end ?? /* @__PURE__ */ new Date();
|
|
10871
|
+
const start = opts.start ?? new Date(end.getTime() - (opts.days ?? 7) * 864e5);
|
|
10872
|
+
return {
|
|
10873
|
+
organisationId: tsgId,
|
|
10874
|
+
workspaceSlug: opts.workspaceSlug,
|
|
10875
|
+
timeOfGenerationMin: toOffsetIso(start),
|
|
10876
|
+
timeOfGenerationMax: toOffsetIso(end)
|
|
10877
|
+
};
|
|
10878
|
+
}
|
|
10879
|
+
|
|
10880
|
+
// src/ai-gateway/telemetry-client.ts
|
|
10881
|
+
var AIGatewayTelemetryClient = class {
|
|
10882
|
+
baseUrl;
|
|
10883
|
+
auth;
|
|
10884
|
+
numRetries;
|
|
10885
|
+
tsgId;
|
|
10886
|
+
constructor(opts) {
|
|
10887
|
+
this.baseUrl = opts.baseUrl;
|
|
10888
|
+
this.auth = opts.auth;
|
|
10889
|
+
this.numRetries = opts.numRetries;
|
|
10890
|
+
this.tsgId = opts.tsgId;
|
|
10891
|
+
}
|
|
10892
|
+
/** @internal Shared GET for every `logs/charts/*` endpoint. */
|
|
10893
|
+
chart(metric, opts, schema) {
|
|
10894
|
+
return request({
|
|
10895
|
+
method: "GET",
|
|
10896
|
+
baseUrl: this.baseUrl,
|
|
10897
|
+
path: `${AI_GW_CHARTS_PATH}/${metric}`,
|
|
10898
|
+
params: serializeWindow(this.tsgId, opts),
|
|
10899
|
+
responseSchema: schema,
|
|
10900
|
+
auth: this.auth,
|
|
10901
|
+
numRetries: this.numRetries
|
|
10902
|
+
});
|
|
10903
|
+
}
|
|
10904
|
+
/**
|
|
10905
|
+
* Total and per-day spend. **Values are in cents.**
|
|
10906
|
+
* @param opts - Workspace slug and time window.
|
|
10907
|
+
* @returns Cost series plus the period total, in cents.
|
|
10908
|
+
* @example
|
|
10909
|
+
* ```ts
|
|
10910
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10911
|
+
* const gw = new AIGatewayClient();
|
|
10912
|
+
*
|
|
10913
|
+
* const cost = await gw.telemetry.cost({ workspaceSlug: 'ws-main-a-349e0e', days: 7 });
|
|
10914
|
+
* console.log(`$${(cost.data.total / 100).toFixed(2)}`); // => "$4110.83"
|
|
10915
|
+
* ```
|
|
10916
|
+
*/
|
|
10917
|
+
async cost(opts) {
|
|
10918
|
+
return this.chart("cost", opts, CostChartResponseSchema);
|
|
10919
|
+
}
|
|
10920
|
+
/**
|
|
10921
|
+
* Per-day request counts.
|
|
10922
|
+
* @param opts - Workspace slug and time window.
|
|
10923
|
+
* @returns Request-count series plus the period total.
|
|
10924
|
+
* @example
|
|
10925
|
+
* ```ts
|
|
10926
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10927
|
+
* const gw = new AIGatewayClient();
|
|
10928
|
+
*
|
|
10929
|
+
* const r = await gw.telemetry.requests({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10930
|
+
* // r.data.total => 25746
|
|
10931
|
+
* ```
|
|
10932
|
+
*/
|
|
10933
|
+
async requests(opts) {
|
|
10934
|
+
return this.chart("requests", opts, CountChartResponseSchema);
|
|
10935
|
+
}
|
|
10936
|
+
/**
|
|
10937
|
+
* Latency in milliseconds. Percentiles are returned per-bucket and for the period.
|
|
10938
|
+
* @param opts - Workspace slug and time window.
|
|
10939
|
+
* @returns Latency series with p50/p90/p99; `data.total` is the period mean, not a sum.
|
|
10940
|
+
* @example
|
|
10941
|
+
* ```ts
|
|
10942
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10943
|
+
* const gw = new AIGatewayClient();
|
|
10944
|
+
*
|
|
10945
|
+
* const l = await gw.telemetry.latency({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10946
|
+
* // l.data.p99 => 8329.14
|
|
10947
|
+
* ```
|
|
10948
|
+
*/
|
|
10949
|
+
async latency(opts) {
|
|
10950
|
+
return this.chart("latency", opts, LatencyChartResponseSchema);
|
|
10951
|
+
}
|
|
10952
|
+
/**
|
|
10953
|
+
* Token usage, split into request and response units.
|
|
10954
|
+
* @param opts - Workspace slug and time window.
|
|
10955
|
+
* @returns Token series plus request/response unit totals.
|
|
10956
|
+
* @example
|
|
10957
|
+
* ```ts
|
|
10958
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10959
|
+
* const gw = new AIGatewayClient();
|
|
10960
|
+
*
|
|
10961
|
+
* const t = await gw.telemetry.tokens({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10962
|
+
* // t.data.total_request_units => 4919015459
|
|
10963
|
+
* ```
|
|
10964
|
+
*/
|
|
10965
|
+
async tokens(opts) {
|
|
10966
|
+
return this.chart("tokens", opts, TokensChartResponseSchema);
|
|
10967
|
+
}
|
|
10968
|
+
/**
|
|
10969
|
+
* Per-day error counts.
|
|
10970
|
+
* @param opts - Workspace slug and time window.
|
|
10971
|
+
* @returns Error-count series plus the period total.
|
|
10972
|
+
* @example
|
|
10973
|
+
* ```ts
|
|
10974
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10975
|
+
* const gw = new AIGatewayClient();
|
|
10976
|
+
*
|
|
10977
|
+
* const e = await gw.telemetry.errors({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10978
|
+
* // e.data.total => 125
|
|
10979
|
+
* ```
|
|
10980
|
+
*/
|
|
10981
|
+
async errors(opts) {
|
|
10982
|
+
return this.chart("errors", opts, CountChartResponseSchema);
|
|
10983
|
+
}
|
|
10984
|
+
/**
|
|
10985
|
+
* Per-day distinct end-user counts.
|
|
10986
|
+
* @param opts - Workspace slug and time window.
|
|
10987
|
+
* @returns Unique-user series plus the period total.
|
|
10988
|
+
* @example
|
|
10989
|
+
* ```ts
|
|
10990
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10991
|
+
* const gw = new AIGatewayClient();
|
|
10992
|
+
*
|
|
10993
|
+
* const u = await gw.telemetry.users({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10994
|
+
* // u.data.total => 1
|
|
10995
|
+
* ```
|
|
10996
|
+
*/
|
|
10997
|
+
async users(opts) {
|
|
10998
|
+
return this.chart("users", opts, CountChartResponseSchema);
|
|
10999
|
+
}
|
|
11000
|
+
/**
|
|
11001
|
+
* Cache hit count, speedup, and average cached-response latency.
|
|
11002
|
+
* @param opts - Workspace slug and time window.
|
|
11003
|
+
* @returns Cache summary; `avgCacheLatency` is null when there were no hits.
|
|
11004
|
+
* @example
|
|
11005
|
+
* ```ts
|
|
11006
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11007
|
+
* const gw = new AIGatewayClient();
|
|
11008
|
+
*
|
|
11009
|
+
* const c = await gw.telemetry.cacheSummary({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11010
|
+
* // c.data.summary => { cacheHits: 0, avgCacheLatency: null, totalRequests: 25621, cacheSpeedup: 0 }
|
|
11011
|
+
* ```
|
|
11012
|
+
*/
|
|
11013
|
+
async cacheSummary(opts) {
|
|
11014
|
+
return this.chart("cache-summary", opts, CacheSummaryResponseSchema);
|
|
11015
|
+
}
|
|
11016
|
+
/**
|
|
11017
|
+
* Cache hit-rate trend and cumulative savings.
|
|
11018
|
+
* @param opts - Workspace slug and time window.
|
|
11019
|
+
* @returns Per-bucket hits and **cumulative** savings in cents — the last non-zero bucket is the period total.
|
|
11020
|
+
* @example
|
|
11021
|
+
* ```ts
|
|
11022
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11023
|
+
* const gw = new AIGatewayClient();
|
|
11024
|
+
*
|
|
11025
|
+
* const t = await gw.telemetry.cacheHitTrend({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11026
|
+
* const last = t.data.trend.at(-1);
|
|
11027
|
+
* const savedUsd = ((last?.cumulativeSimpleHitSavings ?? 0) + (last?.cumulativeSemanticHitSavings ?? 0)) / 100;
|
|
11028
|
+
* ```
|
|
11029
|
+
*/
|
|
11030
|
+
async cacheHitTrend(opts) {
|
|
11031
|
+
return this.chart("cache-hit-trend", opts, CacheHitTrendResponseSchema);
|
|
11032
|
+
}
|
|
11033
|
+
/**
|
|
11034
|
+
* Requests-per-user trend.
|
|
11035
|
+
* @param opts - Workspace slug and time window.
|
|
11036
|
+
* @returns Daily request counts plus `summary.avg` (requests per user).
|
|
11037
|
+
* @example
|
|
11038
|
+
* ```ts
|
|
11039
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11040
|
+
* const gw = new AIGatewayClient();
|
|
11041
|
+
*
|
|
11042
|
+
* const t = await gw.telemetry.userTrends({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11043
|
+
* // t.data.summary => { total: 25748, unique: 1, avg: 25748 }
|
|
11044
|
+
* ```
|
|
11045
|
+
*/
|
|
11046
|
+
async userTrends(opts) {
|
|
11047
|
+
return this.chart("user-trends", opts, UserTrendsResponseSchema);
|
|
11048
|
+
}
|
|
11049
|
+
/**
|
|
11050
|
+
* Error-rate trend as a percentage.
|
|
11051
|
+
* @param opts - Workspace slug and time window.
|
|
11052
|
+
* @returns Daily error percentages plus `summary.errorPercent` for the period.
|
|
11053
|
+
* @example
|
|
11054
|
+
* ```ts
|
|
11055
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11056
|
+
* const gw = new AIGatewayClient();
|
|
11057
|
+
*
|
|
11058
|
+
* const t = await gw.telemetry.errorTrends({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11059
|
+
* // t.data.summary.errorPercent => 0.485
|
|
11060
|
+
* ```
|
|
11061
|
+
*/
|
|
11062
|
+
async errorTrends(opts) {
|
|
11063
|
+
return this.chart("error-trends", opts, ErrorTrendsResponseSchema);
|
|
11064
|
+
}
|
|
11065
|
+
/**
|
|
11066
|
+
* Gateway auto-retry and fallback resilience. Sparse — only populated on upstream failures.
|
|
11067
|
+
* @param opts - Workspace slug and time window.
|
|
11068
|
+
* @returns Retry/fallback trends; note `trend[].y` is an **array**, not a scalar.
|
|
11069
|
+
* @example
|
|
11070
|
+
* ```ts
|
|
11071
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11072
|
+
* const gw = new AIGatewayClient();
|
|
11073
|
+
*
|
|
11074
|
+
* const r = await gw.telemetry.rescuedRetries({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11075
|
+
* // r.data.retryTotal => 0
|
|
11076
|
+
* ```
|
|
11077
|
+
*/
|
|
11078
|
+
async rescuedRetries(opts) {
|
|
11079
|
+
return this.chart("rescued-retries", opts, RescuedRetriesResponseSchema);
|
|
11080
|
+
}
|
|
11081
|
+
/**
|
|
11082
|
+
* Daily count of feedback submissions.
|
|
11083
|
+
* @param opts - Workspace slug and time window.
|
|
11084
|
+
* @returns Feedback-count series plus the period total.
|
|
11085
|
+
* @example
|
|
11086
|
+
* ```ts
|
|
11087
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11088
|
+
* const gw = new AIGatewayClient();
|
|
11089
|
+
*
|
|
11090
|
+
* const f = await gw.telemetry.feedbackTrend({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11091
|
+
* // f.data.total => 61
|
|
11092
|
+
* ```
|
|
11093
|
+
*/
|
|
11094
|
+
async feedbackTrend(opts) {
|
|
11095
|
+
return this.chart("feedback-trend", opts, CountChartResponseSchema);
|
|
11096
|
+
}
|
|
11097
|
+
/**
|
|
11098
|
+
* Weighted average feedback score, averaged over days.
|
|
11099
|
+
* @param opts - Workspace slug and time window.
|
|
11100
|
+
* @returns Weighted score series; `data.total` is null when there is no feedback.
|
|
11101
|
+
* @example
|
|
11102
|
+
* ```ts
|
|
11103
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11104
|
+
* const gw = new AIGatewayClient();
|
|
11105
|
+
*
|
|
11106
|
+
* const f = await gw.telemetry.feedbackWeighted({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11107
|
+
* // f.data.total => -2.58
|
|
11108
|
+
* ```
|
|
11109
|
+
*/
|
|
11110
|
+
async feedbackWeighted(opts) {
|
|
11111
|
+
return this.chart("feedback-weighted", opts, CountChartResponseSchema);
|
|
11112
|
+
}
|
|
11113
|
+
/**
|
|
11114
|
+
* Distribution of feedback scores. Feedback is binary: +5 (thumbs up) or -5 (thumbs down).
|
|
11115
|
+
* @param opts - Workspace slug and time window.
|
|
11116
|
+
* @returns Score histogram as `{x: score, y: count}` records.
|
|
11117
|
+
* @example
|
|
11118
|
+
* ```ts
|
|
11119
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11120
|
+
* const gw = new AIGatewayClient();
|
|
11121
|
+
*
|
|
11122
|
+
* const d = await gw.telemetry.feedbackScoreDistribution({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11123
|
+
* // d.data.records => [{ x: 5, y: 30 }, { x: -5, y: 33 }]
|
|
11124
|
+
* ```
|
|
11125
|
+
*/
|
|
11126
|
+
async feedbackScoreDistribution(opts) {
|
|
11127
|
+
return this.chart("feedback-score-distribution", opts, FeedbackScoreDistributionResponseSchema);
|
|
11128
|
+
}
|
|
11129
|
+
/**
|
|
11130
|
+
* Feedback broken down by AI model.
|
|
11131
|
+
* @param opts - Workspace slug and time window.
|
|
11132
|
+
* @returns Records where `x` is the model and `y` is an object, not a number.
|
|
11133
|
+
* @example
|
|
11134
|
+
* ```ts
|
|
11135
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11136
|
+
* const gw = new AIGatewayClient();
|
|
11137
|
+
*
|
|
11138
|
+
* const m = await gw.telemetry.feedbackModels({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11139
|
+
* // m.data.records[0] => { x: 'claude-sonnet-5', y: { avgWeightedFeedback: 4.2, feedbackCount: 12 } }
|
|
11140
|
+
* ```
|
|
11141
|
+
*/
|
|
11142
|
+
async feedbackModels(opts) {
|
|
11143
|
+
return this.chart("feedback-models", opts, FeedbackModelsResponseSchema);
|
|
11144
|
+
}
|
|
11145
|
+
/**
|
|
11146
|
+
* Aggregate requests by a dimension.
|
|
11147
|
+
* @param dimension - One of {@link AI_GW_GROUP_DIMENSIONS}. Underscore names only.
|
|
11148
|
+
* @param opts - Window plus optional extra columns.
|
|
11149
|
+
* @returns One row per distinct dimension value.
|
|
11150
|
+
* @example
|
|
11151
|
+
* ```ts
|
|
11152
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11153
|
+
* const gw = new AIGatewayClient();
|
|
11154
|
+
*
|
|
11155
|
+
* const byModel = await gw.telemetry.groupBy('model', {
|
|
11156
|
+
* workspaceSlug: 'ws-main-a-349e0e',
|
|
11157
|
+
* columns: ['cost', 'total_tokens'],
|
|
11158
|
+
* });
|
|
11159
|
+
* // byModel.data[0] => { model: 'claude-sonnet-5', requests: 10506, cost: 29704.16, ... }
|
|
11160
|
+
* ```
|
|
11161
|
+
*/
|
|
11162
|
+
async groupBy(dimension, opts) {
|
|
11163
|
+
const params = serializeWindow(this.tsgId, opts);
|
|
11164
|
+
if (opts.columns?.length) params.columns = opts.columns.join(",");
|
|
11165
|
+
return request({
|
|
11166
|
+
method: "GET",
|
|
11167
|
+
baseUrl: this.baseUrl,
|
|
11168
|
+
path: `${AI_GW_GROUPS_PATH}/${dimension}`,
|
|
11169
|
+
params,
|
|
11170
|
+
responseSchema: GroupListResponseSchema,
|
|
11171
|
+
auth: this.auth,
|
|
11172
|
+
numRetries: this.numRetries
|
|
11173
|
+
});
|
|
11174
|
+
}
|
|
11175
|
+
/**
|
|
11176
|
+
* Requests and cost per end user.
|
|
11177
|
+
* @param opts - Workspace slug and time window.
|
|
11178
|
+
* @returns One record per user; `_user: ''` means calls with no end-user id. Costs in cents.
|
|
11179
|
+
* @example
|
|
11180
|
+
* ```ts
|
|
11181
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11182
|
+
* const gw = new AIGatewayClient();
|
|
11183
|
+
*
|
|
11184
|
+
* const users = await gw.telemetry.byUser({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
11185
|
+
* // users.data.records[0] => { _user: '', count: 25748, cost: 411060.85 }
|
|
11186
|
+
* ```
|
|
11187
|
+
*/
|
|
11188
|
+
async byUser(opts) {
|
|
11189
|
+
return request({
|
|
11190
|
+
method: "GET",
|
|
11191
|
+
baseUrl: this.baseUrl,
|
|
11192
|
+
path: `${AI_GW_GROUPS_PATH}/users`,
|
|
11193
|
+
params: serializeWindow(this.tsgId, opts),
|
|
11194
|
+
responseSchema: UserGroupResponseSchema,
|
|
11195
|
+
auth: this.auth,
|
|
11196
|
+
numRetries: this.numRetries
|
|
11197
|
+
});
|
|
11198
|
+
}
|
|
11199
|
+
/**
|
|
11200
|
+
* Requests grouped by HTTP status code.
|
|
11201
|
+
* @param opts - Window plus optional extra columns.
|
|
11202
|
+
* @returns One row per status. **446 = AIRS security block** (cost 0, never reached the LLM).
|
|
11203
|
+
* @example
|
|
11204
|
+
* ```ts
|
|
11205
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11206
|
+
* const gw = new AIGatewayClient();
|
|
11207
|
+
*
|
|
11208
|
+
* const codes = await gw.telemetry.byStatusCode({
|
|
11209
|
+
* workspaceSlug: 'ws-main-a-349e0e',
|
|
11210
|
+
* columns: ['cost', 'avg_latency'],
|
|
11211
|
+
* });
|
|
11212
|
+
* // codes.data => [{ status_code: 200, requests: 25623, ... }, { status_code: 446, ... }]
|
|
11213
|
+
* ```
|
|
11214
|
+
*/
|
|
11215
|
+
async byStatusCode(opts) {
|
|
11216
|
+
const params = serializeWindow(this.tsgId, opts);
|
|
11217
|
+
if (opts.columns?.length) params.columns = opts.columns.join(",");
|
|
11218
|
+
return request({
|
|
11219
|
+
method: "GET",
|
|
11220
|
+
baseUrl: this.baseUrl,
|
|
11221
|
+
path: `${AI_GW_GROUPS_PATH}/status_code`,
|
|
11222
|
+
params,
|
|
11223
|
+
responseSchema: GroupListResponseSchema,
|
|
11224
|
+
auth: this.auth,
|
|
11225
|
+
numRetries: this.numRetries
|
|
11226
|
+
});
|
|
11227
|
+
}
|
|
11228
|
+
/**
|
|
11229
|
+
* Raw per-request log rows — the deepest granularity this API offers.
|
|
11230
|
+
*
|
|
11231
|
+
* @remarks
|
|
11232
|
+
* Upstream pagination is broken: only `pageSize` works, and an unfiltered call always
|
|
11233
|
+
* returns the same most-recent batch (~50 rows) regardless of offset. To read beyond that,
|
|
11234
|
+
* filter by `statusCode`, which bypasses the cap and returns every match in the window.
|
|
11235
|
+
*
|
|
11236
|
+
* @param opts - Window plus `pageSize` / `traceId` / `statusCode` filters.
|
|
11237
|
+
* @returns Log records plus the full-period `total` (which you cannot page to).
|
|
11238
|
+
* @example
|
|
11239
|
+
* ```ts
|
|
11240
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11241
|
+
* const gw = new AIGatewayClient();
|
|
11242
|
+
*
|
|
11243
|
+
* // Every AIRS security block in the window, not just the most recent page.
|
|
11244
|
+
* const blocked = await gw.telemetry.logs({
|
|
11245
|
+
* workspaceSlug: 'ws-main-a-349e0e',
|
|
11246
|
+
* statusCode: 446,
|
|
11247
|
+
* });
|
|
11248
|
+
* // blocked.data.records[0] => { response_status_code: 446, cost: 0, is_success: 0, ... }
|
|
11249
|
+
* ```
|
|
11250
|
+
*/
|
|
11251
|
+
async logs(opts) {
|
|
11252
|
+
const params = serializeWindow(this.tsgId, opts);
|
|
11253
|
+
if (opts.pageSize !== void 0) params.pageSize = String(opts.pageSize);
|
|
11254
|
+
if (opts.traceId !== void 0) params.traceId = opts.traceId;
|
|
11255
|
+
if (opts.statusCode !== void 0) params.statusCode = String(opts.statusCode);
|
|
11256
|
+
return request({
|
|
11257
|
+
method: "GET",
|
|
11258
|
+
baseUrl: this.baseUrl,
|
|
11259
|
+
path: AI_GW_LOGS_PATH,
|
|
11260
|
+
params,
|
|
11261
|
+
responseSchema: GatewayLogsResponseSchema,
|
|
11262
|
+
auth: this.auth,
|
|
11263
|
+
numRetries: this.numRetries
|
|
11264
|
+
});
|
|
11265
|
+
}
|
|
11266
|
+
};
|
|
11267
|
+
|
|
11268
|
+
// src/ai-gateway/workspaces-client.ts
|
|
11269
|
+
var AIGatewayWorkspacesClient = class {
|
|
11270
|
+
baseUrl;
|
|
11271
|
+
adminBaseUrl;
|
|
11272
|
+
auth;
|
|
11273
|
+
numRetries;
|
|
11274
|
+
constructor(opts) {
|
|
11275
|
+
this.baseUrl = opts.baseUrl;
|
|
11276
|
+
this.adminBaseUrl = opts.adminBaseUrl;
|
|
11277
|
+
this.auth = opts.auth;
|
|
11278
|
+
this.numRetries = opts.numRetries;
|
|
11279
|
+
}
|
|
11280
|
+
urlFor(plane) {
|
|
11281
|
+
return plane === "admin" ? this.adminBaseUrl : this.baseUrl;
|
|
11282
|
+
}
|
|
11283
|
+
/**
|
|
11284
|
+
* List workspaces.
|
|
11285
|
+
*
|
|
11286
|
+
* Two defaults worth knowing, because each one hides rows:
|
|
11287
|
+
*
|
|
11288
|
+
* 1. **Active only.** Without `status`, archived workspaces are omitted. Pass
|
|
11289
|
+
* `{ status: 'archived' }` to see them — that is where {@link AIGatewayWorkspacesClient.delete}
|
|
11290
|
+
* leaves a workspace.
|
|
11291
|
+
* 2. **Your scope only.** The data plane returns just the workspaces your service account holds a
|
|
11292
|
+
* workspace-scope grant on. Pass `{ plane: 'admin' }` to enumerate the whole tenant.
|
|
11293
|
+
*
|
|
11294
|
+
* @param options - Optional status filter and plane selection.
|
|
11295
|
+
* @returns Workspaces, each with the `scope_name` that grants data-plane access to it.
|
|
11296
|
+
* @example
|
|
11297
|
+
* ```ts
|
|
11298
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11299
|
+
* const gw = new AIGatewayClient();
|
|
11300
|
+
*
|
|
11301
|
+
* const mine = await gw.workspaces.list();
|
|
11302
|
+
* // mine.data[0] => { slug: 'ws-main-a-349e0e', scope_name: 'main_airs_workspace_1852583913', ... }
|
|
11303
|
+
*
|
|
11304
|
+
* const everything = await gw.workspaces.list({ plane: 'admin' });
|
|
11305
|
+
* const archived = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
|
|
11306
|
+
* ```
|
|
11307
|
+
*/
|
|
11308
|
+
async list(options = {}) {
|
|
11309
|
+
return request({
|
|
11310
|
+
method: "GET",
|
|
11311
|
+
baseUrl: this.urlFor(options.plane),
|
|
11312
|
+
path: AI_GW_WORKSPACES_PATH,
|
|
11313
|
+
params: options.status ? { status: options.status } : void 0,
|
|
11314
|
+
responseSchema: ListWorkspacesResponseSchema,
|
|
11315
|
+
auth: this.auth,
|
|
11316
|
+
numRetries: this.numRetries
|
|
11317
|
+
});
|
|
11318
|
+
}
|
|
11319
|
+
/**
|
|
11320
|
+
* Fetch one workspace, including its security and rate-limit settings.
|
|
11321
|
+
*
|
|
11322
|
+
* @param workspaceRef - Workspace UUID **or** slug; the API accepts both.
|
|
11323
|
+
* @param options - Plane selection. A workspace outside your workspace scope answers `403 AB03`
|
|
11324
|
+
* on the data plane, not `404`; re-read it with `{ plane: 'admin' }`.
|
|
11325
|
+
*
|
|
11326
|
+
* **Archived workspaces are not retrievable here.** Once
|
|
11327
|
+
* {@link AIGatewayWorkspacesClient.delete} has archived a workspace, this returns `404 AB08`
|
|
11328
|
+
* for both its UUID and its slug, on either plane (verified live 2026-08-01) — even though the
|
|
11329
|
+
* row is still listed by `list({ status: 'archived' })`. Treat a 404 after a delete as expected,
|
|
11330
|
+
* and use the list filter to inspect archived workspaces.
|
|
11331
|
+
* @returns Workspace detail; list rows do not carry the settings blocks.
|
|
11332
|
+
* @example
|
|
11333
|
+
* ```ts
|
|
11334
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11335
|
+
* const gw = new AIGatewayClient();
|
|
11336
|
+
*
|
|
11337
|
+
* const ws = await gw.workspaces.get('16f7e90d-382a-4e78-b577-1b01eb5f8297');
|
|
11338
|
+
* // ws.security_settings?.membersViewLogs => true
|
|
11339
|
+
*
|
|
11340
|
+
* // Slugs work too, and the admin plane reaches workspaces you aren't scoped to:
|
|
11341
|
+
* const other = await gw.workspaces.get('ws-produc-985697', { plane: 'admin' });
|
|
11342
|
+
* ```
|
|
11343
|
+
*/
|
|
11344
|
+
async get(workspaceRef, options = {}) {
|
|
11345
|
+
assertWorkspaceRef(workspaceRef, "workspaceRef");
|
|
11346
|
+
return request({
|
|
11347
|
+
method: "GET",
|
|
11348
|
+
baseUrl: this.urlFor(options.plane),
|
|
11349
|
+
path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
|
|
11350
|
+
responseSchema: GatewayWorkspaceDetailSchema,
|
|
11351
|
+
auth: this.auth,
|
|
11352
|
+
numRetries: this.numRetries
|
|
11353
|
+
});
|
|
11354
|
+
}
|
|
11355
|
+
/**
|
|
11356
|
+
* Create a workspace. **Admin plane** — needs a tenant-root admin role.
|
|
11357
|
+
*
|
|
11358
|
+
* @param body - `name` and `scope_name` are both required; the API rejects a body missing either.
|
|
11359
|
+
* @returns The created workspace. Unlike `configs`/`guardrails`/`providers`/`deployments`,
|
|
11360
|
+
* which return short receipts, this returns most of the record — but not `status`,
|
|
11361
|
+
* `is_default`, `icon`, `usage_limits`, `rate_limits`, or the settings blocks. Call
|
|
11362
|
+
* {@link AIGatewayWorkspacesClient.get} when you need those.
|
|
11363
|
+
* @example
|
|
11364
|
+
* ```ts
|
|
11365
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11366
|
+
* const gw = new AIGatewayClient();
|
|
11367
|
+
*
|
|
11368
|
+
* const created = await gw.workspaces.create({
|
|
11369
|
+
* name: 'Production',
|
|
11370
|
+
* scope_name: 'ws_production_bx7qw0', // the SCM scope, not derived from name
|
|
11371
|
+
* description: 'All production applications',
|
|
11372
|
+
* defaults: { metadata: { env: 'production' } },
|
|
11373
|
+
* rate_limits: [{ type: 'requests', unit: 'rpm', value: 100 }],
|
|
11374
|
+
* });
|
|
11375
|
+
* ```
|
|
11376
|
+
*/
|
|
11377
|
+
async create(body) {
|
|
11378
|
+
if (!body.name) {
|
|
11379
|
+
throw new AISecSDKException("Missing name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
11380
|
+
}
|
|
11381
|
+
if (!body.scope_name) {
|
|
11382
|
+
throw new AISecSDKException("Missing scope_name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
11383
|
+
}
|
|
11384
|
+
return request({
|
|
11385
|
+
method: "POST",
|
|
11386
|
+
baseUrl: this.adminBaseUrl,
|
|
11387
|
+
path: AI_GW_WORKSPACES_PATH,
|
|
11388
|
+
body,
|
|
11389
|
+
responseSchema: GatewayWorkspaceCreateResponseSchema,
|
|
11390
|
+
auth: this.auth,
|
|
11391
|
+
numRetries: this.numRetries
|
|
11392
|
+
});
|
|
11393
|
+
}
|
|
11394
|
+
/**
|
|
11395
|
+
* Update a workspace. **Admin plane.** Partial patch — send only the fields that change.
|
|
11396
|
+
*
|
|
11397
|
+
* @param workspaceRef - Workspace UUID or slug.
|
|
11398
|
+
* @param body - At least one field. An empty patch is rejected locally, mirroring the API's own
|
|
11399
|
+
* "No update fields provided" rejection, so a typo'd caller fails without a round trip.
|
|
11400
|
+
* @returns An **empty object** — the API acknowledges the write without echoing the record
|
|
11401
|
+
* (verified live 2026-08-01). The change does persist; re-read with
|
|
11402
|
+
* {@link AIGatewayWorkspacesClient.get} to see it.
|
|
11403
|
+
* @example
|
|
11404
|
+
* ```ts
|
|
11405
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11406
|
+
* const gw = new AIGatewayClient();
|
|
11407
|
+
*
|
|
11408
|
+
* await gw.workspaces.update('ws-produc-985697', {
|
|
11409
|
+
* description: 'Production workloads, us-east',
|
|
11410
|
+
* });
|
|
11411
|
+
* ```
|
|
11412
|
+
*/
|
|
11413
|
+
async update(workspaceRef, body) {
|
|
11414
|
+
assertWorkspaceRef(workspaceRef, "workspaceRef");
|
|
11415
|
+
if (Object.keys(body).length === 0) {
|
|
11416
|
+
throw new AISecSDKException(
|
|
11417
|
+
"Empty update: provide at least one of name, description, icon, defaults, usage_limits, rate_limits",
|
|
11418
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
11419
|
+
);
|
|
11420
|
+
}
|
|
11421
|
+
return request({
|
|
11422
|
+
method: "PUT",
|
|
11423
|
+
baseUrl: this.adminBaseUrl,
|
|
11424
|
+
path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
|
|
11425
|
+
body,
|
|
11426
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11427
|
+
auth: this.auth,
|
|
11428
|
+
numRetries: this.numRetries
|
|
11429
|
+
});
|
|
11430
|
+
}
|
|
11431
|
+
/**
|
|
11432
|
+
* Delete a workspace. **Admin plane.**
|
|
11433
|
+
*
|
|
11434
|
+
* This is a **soft delete**: the workspace is archived, not destroyed. It vanishes from a default
|
|
11435
|
+
* {@link AIGatewayWorkspacesClient.list} but stays visible via `list({ status: 'archived' })`.
|
|
11436
|
+
* Note that `list` is the *only* way to see it afterwards —
|
|
11437
|
+
* {@link AIGatewayWorkspacesClient.get} answers `404 AB08` for an archived workspace.
|
|
11438
|
+
* Same semantics as `deployments.delete()`, and the opposite of `configs`/`guardrails`/`providers`,
|
|
11439
|
+
* which hard delete. There is no hard delete for workspaces.
|
|
11440
|
+
*
|
|
11441
|
+
* Takes no query parameters — unlike `integrations.delete()` and `deployments.delete()`, which
|
|
11442
|
+
* both require `organisation_id`.
|
|
11443
|
+
*
|
|
11444
|
+
* @param workspaceRef - Workspace UUID or slug.
|
|
11445
|
+
* @example
|
|
11446
|
+
* ```ts
|
|
11447
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11448
|
+
* const gw = new AIGatewayClient();
|
|
11449
|
+
*
|
|
11450
|
+
* await gw.workspaces.delete('ws-produc-985697');
|
|
11451
|
+
*
|
|
11452
|
+
* // Still there, archived:
|
|
11453
|
+
* const gone = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
|
|
11454
|
+
* ```
|
|
11455
|
+
*/
|
|
11456
|
+
async delete(workspaceRef) {
|
|
11457
|
+
assertWorkspaceRef(workspaceRef, "workspaceRef");
|
|
11458
|
+
return request({
|
|
11459
|
+
method: "DELETE",
|
|
11460
|
+
baseUrl: this.adminBaseUrl,
|
|
11461
|
+
path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
|
|
11462
|
+
auth: this.auth,
|
|
11463
|
+
numRetries: this.numRetries
|
|
11464
|
+
});
|
|
11465
|
+
}
|
|
11466
|
+
};
|
|
11467
|
+
|
|
11468
|
+
// src/ai-gateway/configs-client.ts
|
|
11469
|
+
var AIGatewayConfigsClient = class {
|
|
11470
|
+
baseUrl;
|
|
11471
|
+
auth;
|
|
11472
|
+
numRetries;
|
|
11473
|
+
constructor(opts) {
|
|
11474
|
+
this.baseUrl = opts.baseUrl;
|
|
11475
|
+
this.auth = opts.auth;
|
|
11476
|
+
this.numRetries = opts.numRetries;
|
|
11477
|
+
}
|
|
11478
|
+
/**
|
|
11479
|
+
* List configs in a workspace.
|
|
11480
|
+
*
|
|
11481
|
+
* @remarks
|
|
11482
|
+
* List rows are a strict 12-field subset of the detail read — they do NOT carry `config`,
|
|
11483
|
+
* `format`, `type`, or `version_id`. Call {@link get} for those.
|
|
11484
|
+
*
|
|
11485
|
+
* @param opts - Must include the workspace UUID.
|
|
11486
|
+
* @returns Config list rows.
|
|
11487
|
+
* @example
|
|
11488
|
+
* ```ts
|
|
11489
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11490
|
+
* const gw = new AIGatewayClient();
|
|
11491
|
+
*
|
|
11492
|
+
* const cfgs = await gw.configs.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11493
|
+
* // cfgs.data[0] => { name: 'claude-code', slug: 'pc-claude-e46fe6', status: 'active', ... }
|
|
11494
|
+
* ```
|
|
11495
|
+
*/
|
|
11496
|
+
async list(opts) {
|
|
11497
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
11498
|
+
return request({
|
|
11499
|
+
method: "GET",
|
|
11500
|
+
baseUrl: this.baseUrl,
|
|
11501
|
+
path: AI_GW_CONFIGS_PATH,
|
|
11502
|
+
params: { workspace_id: opts.workspaceId },
|
|
11503
|
+
responseSchema: ListConfigsResponseSchema,
|
|
11504
|
+
auth: this.auth,
|
|
11505
|
+
numRetries: this.numRetries
|
|
11506
|
+
});
|
|
11507
|
+
}
|
|
11508
|
+
/**
|
|
11509
|
+
* Fetch one config.
|
|
11510
|
+
* @param configId - Config UUID.
|
|
11511
|
+
* @returns The config detail — adds `config` (a JSON-encoded string, not an object),
|
|
11512
|
+
* `format`, `type`, and `version_id` on top of the list row.
|
|
11513
|
+
* @example
|
|
11514
|
+
* ```ts
|
|
11515
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11516
|
+
* const gw = new AIGatewayClient();
|
|
11517
|
+
*
|
|
11518
|
+
* const cfg = await gw.configs.get('764cf9cd-4ebf-449e-b669-08149b0fbbbc');
|
|
11519
|
+
* const routing = JSON.parse(cfg.config) as Record<string, unknown>;
|
|
11520
|
+
* // routing.provider => '@anthropic-prod'
|
|
11521
|
+
* ```
|
|
11522
|
+
*/
|
|
11523
|
+
async get(configId) {
|
|
11524
|
+
assertUuid(configId, "configId");
|
|
11525
|
+
return request({
|
|
11526
|
+
method: "GET",
|
|
11527
|
+
baseUrl: this.baseUrl,
|
|
11528
|
+
path: `${AI_GW_CONFIGS_PATH}/${configId}`,
|
|
11529
|
+
responseSchema: GatewayConfigDetailSchema,
|
|
11530
|
+
auth: this.auth,
|
|
11531
|
+
numRetries: this.numRetries
|
|
11532
|
+
});
|
|
11533
|
+
}
|
|
11534
|
+
/**
|
|
11535
|
+
* Create a config.
|
|
11536
|
+
*
|
|
11537
|
+
* @remarks
|
|
11538
|
+
* The response is a **creation receipt** — `{ id, version_id, slug, object }` — not a
|
|
11539
|
+
* {@link GatewayConfigDetail}. Call {@link get} for the full record. Verified live
|
|
11540
|
+
* 2026-07-28.
|
|
11541
|
+
*
|
|
11542
|
+
* @param body - Name, workspace UUID, and the routing config object.
|
|
11543
|
+
* @returns The creation receipt.
|
|
11544
|
+
* @example
|
|
11545
|
+
* ```ts
|
|
11546
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11547
|
+
* const gw = new AIGatewayClient();
|
|
11548
|
+
*
|
|
11549
|
+
* const receipt = await gw.configs.create({
|
|
11550
|
+
* name: 'vertex-airs',
|
|
11551
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11552
|
+
* config: { retry: { attempts: 3 }, cache: { mode: 'simple' } },
|
|
11553
|
+
* });
|
|
11554
|
+
* // receipt => { id: '...', version_id: '...', slug: 'pc-sdk-ve-14620d', object: 'config' }
|
|
11555
|
+
* ```
|
|
11556
|
+
*/
|
|
11557
|
+
async create(body) {
|
|
11558
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11559
|
+
return request({
|
|
11560
|
+
method: "POST",
|
|
11561
|
+
baseUrl: this.baseUrl,
|
|
11562
|
+
path: AI_GW_CONFIGS_PATH,
|
|
11563
|
+
body,
|
|
11564
|
+
responseSchema: GatewayConfigCreateResponseSchema,
|
|
11565
|
+
auth: this.auth,
|
|
11566
|
+
numRetries: this.numRetries
|
|
11567
|
+
});
|
|
11568
|
+
}
|
|
11569
|
+
/**
|
|
11570
|
+
* Update a config.
|
|
11571
|
+
* @param configId - Config UUID.
|
|
11572
|
+
* @param body - Replacement fields.
|
|
11573
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11574
|
+
* @example
|
|
11575
|
+
* ```ts
|
|
11576
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11577
|
+
* const gw = new AIGatewayClient();
|
|
11578
|
+
*
|
|
11579
|
+
* await gw.configs.update('764cf9cd-4ebf-449e-b669-08149b0fbbbc', {
|
|
11580
|
+
* name: 'claude-code',
|
|
11581
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11582
|
+
* config: { retry: { attempts: 5 } },
|
|
11583
|
+
* });
|
|
11584
|
+
* ```
|
|
11585
|
+
*/
|
|
11586
|
+
async update(configId, body) {
|
|
11587
|
+
assertUuid(configId, "configId");
|
|
11588
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11589
|
+
return request({
|
|
11590
|
+
method: "PUT",
|
|
11591
|
+
baseUrl: this.baseUrl,
|
|
11592
|
+
path: `${AI_GW_CONFIGS_PATH}/${configId}`,
|
|
11593
|
+
body,
|
|
11594
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11595
|
+
auth: this.auth,
|
|
11596
|
+
numRetries: this.numRetries
|
|
11597
|
+
});
|
|
11598
|
+
}
|
|
11599
|
+
/**
|
|
11600
|
+
* Delete a config.
|
|
11601
|
+
*
|
|
11602
|
+
* @remarks
|
|
11603
|
+
* This is a **hard delete** — unlike {@link AIGatewayDeploymentsClient.delete | deployments.delete}
|
|
11604
|
+
* (which archives), the config disappears from {@link list} entirely. Verified live
|
|
11605
|
+
* 2026-07-28. No `organisation_id` query param is required, unlike deployments/integrations.
|
|
11606
|
+
*
|
|
11607
|
+
* @param configId - Config UUID.
|
|
11608
|
+
* @returns Nothing.
|
|
11609
|
+
* @example
|
|
11610
|
+
* ```ts
|
|
11611
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11612
|
+
* const gw = new AIGatewayClient();
|
|
11613
|
+
*
|
|
11614
|
+
* await gw.configs.delete('764cf9cd-4ebf-449e-b669-08149b0fbbbc');
|
|
11615
|
+
* // the config no longer appears in gw.configs.list()
|
|
11616
|
+
* ```
|
|
11617
|
+
*/
|
|
11618
|
+
async delete(configId) {
|
|
11619
|
+
assertUuid(configId, "configId");
|
|
11620
|
+
await request({
|
|
11621
|
+
method: "DELETE",
|
|
11622
|
+
baseUrl: this.baseUrl,
|
|
11623
|
+
path: `${AI_GW_CONFIGS_PATH}/${configId}`,
|
|
11624
|
+
auth: this.auth,
|
|
11625
|
+
numRetries: this.numRetries
|
|
11626
|
+
});
|
|
11627
|
+
}
|
|
11628
|
+
};
|
|
11629
|
+
|
|
11630
|
+
// src/ai-gateway/guardrails-client.ts
|
|
11631
|
+
var AIGatewayGuardrailsClient = class {
|
|
11632
|
+
baseUrl;
|
|
11633
|
+
auth;
|
|
11634
|
+
numRetries;
|
|
11635
|
+
constructor(opts) {
|
|
11636
|
+
this.baseUrl = opts.baseUrl;
|
|
11637
|
+
this.auth = opts.auth;
|
|
11638
|
+
this.numRetries = opts.numRetries;
|
|
11639
|
+
}
|
|
11640
|
+
/**
|
|
11641
|
+
* List guardrails in a workspace.
|
|
11642
|
+
* @param opts - Must include the workspace UUID.
|
|
11643
|
+
* @returns Guardrails defined on that workspace.
|
|
11644
|
+
* @example
|
|
11645
|
+
* ```ts
|
|
11646
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11647
|
+
* const gw = new AIGatewayClient();
|
|
11648
|
+
*
|
|
11649
|
+
* const g = await gw.guardrails.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11650
|
+
* // g.data[0].id => 'pg-prisma-099a16'
|
|
11651
|
+
* ```
|
|
11652
|
+
*/
|
|
11653
|
+
async list(opts) {
|
|
11654
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
11655
|
+
return request({
|
|
11656
|
+
method: "GET",
|
|
11657
|
+
baseUrl: this.baseUrl,
|
|
11658
|
+
path: AI_GW_GUARDRAILS_PATH,
|
|
11659
|
+
params: { workspace_id: opts.workspaceId },
|
|
11660
|
+
responseSchema: ListGuardrailsResponseSchema,
|
|
11661
|
+
auth: this.auth,
|
|
11662
|
+
numRetries: this.numRetries
|
|
11663
|
+
});
|
|
11664
|
+
}
|
|
11665
|
+
/**
|
|
11666
|
+
* Fetch one guardrail.
|
|
11667
|
+
* @param guardrailId - Guardrail UUID.
|
|
11668
|
+
* @returns Guardrail detail — adds `checks`, `actions`, and `version_id` on top of the list
|
|
11669
|
+
* row.
|
|
11670
|
+
* @example
|
|
11671
|
+
* ```ts
|
|
11672
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11673
|
+
* const gw = new AIGatewayClient();
|
|
11674
|
+
*
|
|
11675
|
+
* const g = await gw.guardrails.get('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b');
|
|
11676
|
+
* // g.checks[0].id => 'panw-prisma-airs.intercept'
|
|
11677
|
+
* ```
|
|
11678
|
+
*/
|
|
11679
|
+
async get(guardrailId) {
|
|
11680
|
+
assertUuid(guardrailId, "guardrailId");
|
|
11681
|
+
return request({
|
|
11682
|
+
method: "GET",
|
|
11683
|
+
baseUrl: this.baseUrl,
|
|
11684
|
+
path: `${AI_GW_GUARDRAILS_PATH}/${guardrailId}`,
|
|
11685
|
+
responseSchema: GatewayGuardrailDetailSchema,
|
|
11686
|
+
auth: this.auth,
|
|
11687
|
+
numRetries: this.numRetries
|
|
11688
|
+
});
|
|
11689
|
+
}
|
|
11690
|
+
/**
|
|
11691
|
+
* Create a guardrail.
|
|
11692
|
+
*
|
|
11693
|
+
* @remarks
|
|
11694
|
+
* The response is a **creation receipt** — `{ id, version_id, slug, object }` — not a
|
|
11695
|
+
* {@link GatewayGuardrailDetail}. Call {@link get} for the full record. Verified live
|
|
11696
|
+
* 2026-07-28.
|
|
11697
|
+
*
|
|
11698
|
+
* @param body - Workspace UUID, name, checks, and pass/fail actions.
|
|
11699
|
+
* @returns The creation receipt.
|
|
11700
|
+
* @example
|
|
11701
|
+
* ```ts
|
|
11702
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11703
|
+
* const gw = new AIGatewayClient();
|
|
11704
|
+
*
|
|
11705
|
+
* const receipt = await gw.guardrails.create({
|
|
11706
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11707
|
+
* name: 'PrismaAIRS',
|
|
11708
|
+
* checks: [{ id: 'panw-prisma-airs.intercept', parameters: { profile_name: 'AI Gateway - Strict' }, is_enabled: true }],
|
|
11709
|
+
* actions: { deny: false, async: false, sequential: false },
|
|
11710
|
+
* });
|
|
11711
|
+
* // receipt => { id: '...', version_id: '...', slug: 'pg-sdk-ve-874b62', object: 'guardrail' }
|
|
11712
|
+
* ```
|
|
11713
|
+
*/
|
|
11714
|
+
async create(body) {
|
|
11715
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11716
|
+
return request({
|
|
11717
|
+
method: "POST",
|
|
11718
|
+
baseUrl: this.baseUrl,
|
|
11719
|
+
path: AI_GW_GUARDRAILS_PATH,
|
|
11720
|
+
body,
|
|
11721
|
+
responseSchema: GatewayGuardrailCreateResponseSchema,
|
|
11722
|
+
auth: this.auth,
|
|
11723
|
+
numRetries: this.numRetries
|
|
11724
|
+
});
|
|
11725
|
+
}
|
|
11726
|
+
/**
|
|
11727
|
+
* Delete a guardrail.
|
|
11728
|
+
*
|
|
11729
|
+
* @remarks
|
|
11730
|
+
* This is a **hard delete** — unlike {@link AIGatewayDeploymentsClient.delete | deployments.delete}
|
|
11731
|
+
* (which archives), the guardrail disappears from {@link list} entirely. Verified live
|
|
11732
|
+
* 2026-07-28. No `organisation_id` query param is required, unlike deployments/integrations.
|
|
11733
|
+
*
|
|
11734
|
+
* @param guardrailId - Guardrail UUID.
|
|
11735
|
+
* @returns Nothing.
|
|
11736
|
+
* @example
|
|
11737
|
+
* ```ts
|
|
11738
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11739
|
+
* const gw = new AIGatewayClient();
|
|
11740
|
+
*
|
|
11741
|
+
* await gw.guardrails.delete('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b');
|
|
11742
|
+
* // the guardrail no longer appears in gw.guardrails.list()
|
|
11743
|
+
* ```
|
|
11744
|
+
*/
|
|
11745
|
+
async delete(guardrailId) {
|
|
11746
|
+
assertUuid(guardrailId, "guardrailId");
|
|
11747
|
+
await request({
|
|
11748
|
+
method: "DELETE",
|
|
11749
|
+
baseUrl: this.baseUrl,
|
|
11750
|
+
path: `${AI_GW_GUARDRAILS_PATH}/${guardrailId}`,
|
|
11751
|
+
auth: this.auth,
|
|
11752
|
+
numRetries: this.numRetries
|
|
11753
|
+
});
|
|
11754
|
+
}
|
|
11755
|
+
};
|
|
11756
|
+
|
|
11757
|
+
// src/ai-gateway/providers-client.ts
|
|
11758
|
+
var AIGatewayProvidersClient = class {
|
|
11759
|
+
baseUrl;
|
|
11760
|
+
auth;
|
|
11761
|
+
numRetries;
|
|
11762
|
+
constructor(opts) {
|
|
11763
|
+
this.baseUrl = opts.baseUrl;
|
|
11764
|
+
this.auth = opts.auth;
|
|
11765
|
+
this.numRetries = opts.numRetries;
|
|
11766
|
+
}
|
|
11767
|
+
/**
|
|
11768
|
+
* List providers in a workspace.
|
|
11769
|
+
* @param opts - Must include the workspace UUID.
|
|
11770
|
+
* @returns Providers bound into that workspace.
|
|
11771
|
+
* @example
|
|
11772
|
+
* ```ts
|
|
11773
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11774
|
+
* const gw = new AIGatewayClient();
|
|
11775
|
+
*
|
|
11776
|
+
* const p = await gw.providers.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11777
|
+
* // p.data[0].slug => 'openai-calvin'
|
|
11778
|
+
* ```
|
|
11779
|
+
*/
|
|
11780
|
+
async list(opts) {
|
|
11781
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
11782
|
+
return request({
|
|
11783
|
+
method: "GET",
|
|
11784
|
+
baseUrl: this.baseUrl,
|
|
11785
|
+
path: AI_GW_PROVIDERS_PATH,
|
|
11786
|
+
params: { workspace_id: opts.workspaceId },
|
|
11787
|
+
responseSchema: ListProvidersResponseSchema,
|
|
11788
|
+
auth: this.auth,
|
|
11789
|
+
numRetries: this.numRetries
|
|
11790
|
+
});
|
|
11791
|
+
}
|
|
11792
|
+
/**
|
|
11793
|
+
* Create a provider.
|
|
11794
|
+
*
|
|
11795
|
+
* @remarks
|
|
11796
|
+
* The response is a **creation receipt** — `{ id, slug, object }` — not a {@link
|
|
11797
|
+
* GatewayProvider}. Note it has **no `version_id`**, unlike the sibling receipts for
|
|
11798
|
+
* {@link AIGatewayConfigsClient.create | configs.create} and {@link
|
|
11799
|
+
* AIGatewayGuardrailsClient.create | guardrails.create}. Verified live 2026-07-28.
|
|
11800
|
+
*
|
|
11801
|
+
* @param body - Workspace UUID, upstream provider id, integration id, name, and slug.
|
|
11802
|
+
* @returns The creation receipt.
|
|
11803
|
+
* @example
|
|
11804
|
+
* ```ts
|
|
11805
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11806
|
+
* const gw = new AIGatewayClient();
|
|
11807
|
+
*
|
|
11808
|
+
* const receipt = await gw.providers.create({
|
|
11809
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11810
|
+
* ai_provider_id: 'de7d7d50-31cd-11ee-b93b-0e06f1aa7f7c',
|
|
11811
|
+
* integration_id: 'f6692544-3265-49be-9711-bbdcebc079e4',
|
|
11812
|
+
* name: 'openai-calvin',
|
|
11813
|
+
* slug: 'openai-calvin',
|
|
11814
|
+
* });
|
|
11815
|
+
* // receipt => { id: '...', slug: 'sdk-verify-delete-me-provider', object: 'provider' }
|
|
11816
|
+
* ```
|
|
11817
|
+
*/
|
|
11818
|
+
async create(body) {
|
|
11819
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11820
|
+
assertUuid(body.ai_provider_id, "ai_provider_id");
|
|
11821
|
+
assertUuid(body.integration_id, "integration_id");
|
|
11822
|
+
return request({
|
|
11823
|
+
method: "POST",
|
|
11824
|
+
baseUrl: this.baseUrl,
|
|
11825
|
+
path: AI_GW_PROVIDERS_PATH,
|
|
11826
|
+
body,
|
|
11827
|
+
responseSchema: GatewayProviderCreateResponseSchema,
|
|
11828
|
+
auth: this.auth,
|
|
11829
|
+
numRetries: this.numRetries
|
|
11830
|
+
});
|
|
11831
|
+
}
|
|
11832
|
+
/**
|
|
11833
|
+
* Delete a provider.
|
|
11834
|
+
*
|
|
11835
|
+
* @remarks
|
|
11836
|
+
* This is a **hard delete** — unlike {@link AIGatewayDeploymentsClient.delete | deployments.delete}
|
|
11837
|
+
* (which archives), the provider disappears from {@link list} entirely. Verified live
|
|
11838
|
+
* 2026-07-28. No `organisation_id` query param is required, unlike deployments/integrations.
|
|
11839
|
+
*
|
|
11840
|
+
* @param providerId - Provider UUID.
|
|
11841
|
+
* @returns Nothing.
|
|
11842
|
+
* @example
|
|
11843
|
+
* ```ts
|
|
11844
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11845
|
+
* const gw = new AIGatewayClient();
|
|
11846
|
+
*
|
|
11847
|
+
* await gw.providers.delete('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
11848
|
+
* // the provider no longer appears in gw.providers.list()
|
|
11849
|
+
* ```
|
|
11850
|
+
*/
|
|
11851
|
+
async delete(providerId) {
|
|
11852
|
+
assertUuid(providerId, "providerId");
|
|
11853
|
+
await request({
|
|
11854
|
+
method: "DELETE",
|
|
11855
|
+
baseUrl: this.baseUrl,
|
|
11856
|
+
path: `${AI_GW_PROVIDERS_PATH}/${providerId}`,
|
|
11857
|
+
auth: this.auth,
|
|
11858
|
+
numRetries: this.numRetries
|
|
11859
|
+
});
|
|
11860
|
+
}
|
|
11861
|
+
};
|
|
11862
|
+
|
|
11863
|
+
// src/ai-gateway/api-keys-client.ts
|
|
11864
|
+
var AIGatewayApiKeysClient = class {
|
|
11865
|
+
baseUrl;
|
|
11866
|
+
auth;
|
|
11867
|
+
numRetries;
|
|
11868
|
+
constructor(opts) {
|
|
11869
|
+
this.baseUrl = opts.baseUrl;
|
|
11870
|
+
this.auth = opts.auth;
|
|
11871
|
+
this.numRetries = opts.numRetries;
|
|
11872
|
+
}
|
|
11873
|
+
/** @internal */
|
|
11874
|
+
listAt(path, opts) {
|
|
11875
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
11876
|
+
return request({
|
|
11877
|
+
method: "GET",
|
|
11878
|
+
baseUrl: this.baseUrl,
|
|
11879
|
+
path,
|
|
11880
|
+
params: { workspace_id: opts.workspaceId },
|
|
11881
|
+
responseSchema: ListApiKeysResponseSchema,
|
|
11882
|
+
auth: this.auth,
|
|
11883
|
+
numRetries: this.numRetries
|
|
11884
|
+
});
|
|
11885
|
+
}
|
|
11886
|
+
/** @internal */
|
|
11887
|
+
writeAt(method, path, body) {
|
|
11888
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11889
|
+
return request({
|
|
11890
|
+
method,
|
|
11891
|
+
baseUrl: this.baseUrl,
|
|
11892
|
+
path,
|
|
11893
|
+
body,
|
|
11894
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11895
|
+
auth: this.auth,
|
|
11896
|
+
numRetries: this.numRetries
|
|
11897
|
+
});
|
|
11898
|
+
}
|
|
11899
|
+
/**
|
|
11900
|
+
* List service API keys in a workspace.
|
|
11901
|
+
* @param opts - Must include the workspace UUID.
|
|
11902
|
+
* @returns Service keys; the secret itself is only ever returned at creation.
|
|
11903
|
+
* @example
|
|
11904
|
+
* ```ts
|
|
11905
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11906
|
+
* const gw = new AIGatewayClient();
|
|
11907
|
+
*
|
|
11908
|
+
* const keys = await gw.apiKeys.listService({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11909
|
+
* // keys.total => 1
|
|
11910
|
+
* ```
|
|
11911
|
+
*/
|
|
11912
|
+
async listService(opts) {
|
|
11913
|
+
return this.listAt(AI_GW_API_KEYS_SERVICE_PATH, opts);
|
|
11914
|
+
}
|
|
11915
|
+
/**
|
|
11916
|
+
* List user API keys in a workspace.
|
|
11917
|
+
* @param opts - Must include the workspace UUID.
|
|
11918
|
+
* @returns User-scoped keys.
|
|
11919
|
+
* @example
|
|
11920
|
+
* ```ts
|
|
11921
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11922
|
+
* const gw = new AIGatewayClient();
|
|
11923
|
+
*
|
|
11924
|
+
* const keys = await gw.apiKeys.listUser({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11925
|
+
* // keys.total => 0
|
|
11926
|
+
* ```
|
|
11927
|
+
*/
|
|
11928
|
+
async listUser(opts) {
|
|
11929
|
+
return this.listAt(AI_GW_API_KEYS_USER_PATH, opts);
|
|
11930
|
+
}
|
|
11931
|
+
/**
|
|
11932
|
+
* Create a service API key.
|
|
11933
|
+
* @param body - Name, scopes, TSG, workspace UUID, and type.
|
|
11934
|
+
* @returns The raw create response — the only place the key secret appears. Capture it.
|
|
11935
|
+
* @example
|
|
11936
|
+
* ```ts
|
|
11937
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11938
|
+
* const gw = new AIGatewayClient();
|
|
11939
|
+
*
|
|
11940
|
+
* await gw.apiKeys.createService({
|
|
11941
|
+
* name: 'ci-runner',
|
|
11942
|
+
* scopes: ['completions.write', 'logs.write'],
|
|
11943
|
+
* organisation_id: '1852583913',
|
|
11944
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11945
|
+
* type: 'workspace',
|
|
11946
|
+
* });
|
|
11947
|
+
* ```
|
|
11948
|
+
*/
|
|
11949
|
+
async createService(body) {
|
|
11950
|
+
return this.writeAt("POST", AI_GW_API_KEYS_SERVICE_PATH, body);
|
|
11951
|
+
}
|
|
11952
|
+
/**
|
|
11953
|
+
* Create a user API key.
|
|
11954
|
+
* @param body - As {@link createService}, plus `user_id`.
|
|
11955
|
+
* @returns The raw create response — the only place the key secret appears. Capture it.
|
|
11956
|
+
* @example
|
|
11957
|
+
* ```ts
|
|
11958
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11959
|
+
* const gw = new AIGatewayClient();
|
|
11960
|
+
*
|
|
11961
|
+
* await gw.apiKeys.createUser({
|
|
11962
|
+
* name: 'calvin-laptop',
|
|
11963
|
+
* scopes: ['completions.write'],
|
|
11964
|
+
* organisation_id: '1852583913',
|
|
11965
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11966
|
+
* type: 'workspace',
|
|
11967
|
+
* user_id: 'fad91538-65a9-41f7-8b9c-6e4c0e8b9c5f',
|
|
11968
|
+
* });
|
|
11969
|
+
* ```
|
|
11970
|
+
*/
|
|
11971
|
+
async createUser(body) {
|
|
11972
|
+
return this.writeAt("POST", AI_GW_API_KEYS_USER_PATH, body);
|
|
11973
|
+
}
|
|
11974
|
+
/**
|
|
11975
|
+
* Update a service API key.
|
|
11976
|
+
* @param keyId - Key UUID.
|
|
11977
|
+
* @param body - Replacement fields.
|
|
11978
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11979
|
+
* @example
|
|
11980
|
+
* ```ts
|
|
11981
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11982
|
+
* const gw = new AIGatewayClient();
|
|
11983
|
+
*
|
|
11984
|
+
* await gw.apiKeys.updateService('11111111-1111-4111-8111-111111111111', {
|
|
11985
|
+
* name: 'ci-runner',
|
|
11986
|
+
* scopes: ['completions.write'],
|
|
11987
|
+
* organisation_id: '1852583913',
|
|
11988
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11989
|
+
* type: 'workspace',
|
|
11990
|
+
* });
|
|
11991
|
+
* ```
|
|
11992
|
+
*/
|
|
11993
|
+
async updateService(keyId, body) {
|
|
11994
|
+
assertUuid(keyId, "keyId");
|
|
11995
|
+
return this.writeAt("PUT", `${AI_GW_API_KEYS_SERVICE_PATH}/${keyId}`, body);
|
|
11996
|
+
}
|
|
11997
|
+
/**
|
|
11998
|
+
* Update a user API key.
|
|
11999
|
+
* @param keyId - Key UUID.
|
|
12000
|
+
* @param body - Replacement fields.
|
|
12001
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
12002
|
+
* @example
|
|
12003
|
+
* ```ts
|
|
12004
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12005
|
+
* const gw = new AIGatewayClient();
|
|
12006
|
+
*
|
|
12007
|
+
* await gw.apiKeys.updateUser('11111111-1111-4111-8111-111111111111', {
|
|
12008
|
+
* name: 'calvin-laptop',
|
|
12009
|
+
* scopes: ['completions.write'],
|
|
12010
|
+
* organisation_id: '1852583913',
|
|
12011
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
12012
|
+
* type: 'workspace',
|
|
12013
|
+
* user_id: 'fad91538-65a9-41f7-8b9c-6e4c0e8b9c5f',
|
|
12014
|
+
* });
|
|
12015
|
+
* ```
|
|
12016
|
+
*/
|
|
12017
|
+
async updateUser(keyId, body) {
|
|
12018
|
+
assertUuid(keyId, "keyId");
|
|
12019
|
+
return this.writeAt("PUT", `${AI_GW_API_KEYS_USER_PATH}/${keyId}`, body);
|
|
12020
|
+
}
|
|
12021
|
+
};
|
|
12022
|
+
|
|
12023
|
+
// src/ai-gateway/integrations-client.ts
|
|
12024
|
+
var AIGatewayIntegrationsClient = class {
|
|
12025
|
+
baseUrl;
|
|
12026
|
+
auth;
|
|
12027
|
+
numRetries;
|
|
12028
|
+
constructor(opts) {
|
|
12029
|
+
this.baseUrl = opts.baseUrl;
|
|
12030
|
+
this.auth = opts.auth;
|
|
12031
|
+
this.numRetries = opts.numRetries;
|
|
12032
|
+
}
|
|
12033
|
+
/**
|
|
12034
|
+
* List organisation integrations.
|
|
12035
|
+
* @returns All provider integrations defined on the organisation.
|
|
12036
|
+
* @example
|
|
12037
|
+
* ```ts
|
|
12038
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12039
|
+
* const gw = new AIGatewayClient();
|
|
12040
|
+
*
|
|
12041
|
+
* const ints = await gw.integrations.list();
|
|
12042
|
+
* // ints.data[0] => { name: 'openai-calvin', slug: 'openai-calvin', ... }
|
|
12043
|
+
* ```
|
|
12044
|
+
*/
|
|
12045
|
+
async list() {
|
|
12046
|
+
return request({
|
|
12047
|
+
method: "GET",
|
|
12048
|
+
baseUrl: this.baseUrl,
|
|
12049
|
+
path: AI_GW_INTEGRATIONS_PATH,
|
|
12050
|
+
responseSchema: ListIntegrationsResponseSchema,
|
|
12051
|
+
auth: this.auth,
|
|
12052
|
+
numRetries: this.numRetries
|
|
12053
|
+
});
|
|
12054
|
+
}
|
|
12055
|
+
/**
|
|
12056
|
+
* Fetch one integration.
|
|
12057
|
+
* @param integrationId - Integration UUID.
|
|
12058
|
+
* @returns The integration record.
|
|
12059
|
+
* @example
|
|
12060
|
+
* ```ts
|
|
12061
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12062
|
+
* const gw = new AIGatewayClient();
|
|
12063
|
+
*
|
|
12064
|
+
* const i = await gw.integrations.get('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
12065
|
+
* // i.name => 'openai-calvin'
|
|
12066
|
+
* ```
|
|
12067
|
+
*/
|
|
12068
|
+
async get(integrationId) {
|
|
12069
|
+
assertUuid(integrationId, "integrationId");
|
|
12070
|
+
return request({
|
|
12071
|
+
method: "GET",
|
|
12072
|
+
baseUrl: this.baseUrl,
|
|
12073
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
|
|
12074
|
+
responseSchema: GatewayIntegrationSchema,
|
|
12075
|
+
auth: this.auth,
|
|
12076
|
+
numRetries: this.numRetries
|
|
12077
|
+
});
|
|
12078
|
+
}
|
|
12079
|
+
/**
|
|
12080
|
+
* Create an integration.
|
|
12081
|
+
*
|
|
12082
|
+
* @remarks
|
|
12083
|
+
* `body.key` (the provider API key) is a live secret. Setting `PANW_AI_SEC_DEBUG` will
|
|
12084
|
+
* print it, unredacted, to the SDK's own debug log.
|
|
12085
|
+
*
|
|
12086
|
+
* @param body - Provider id, name, slug, and provider-specific configuration.
|
|
12087
|
+
* @returns The raw create response. Shape unverified against a live tenant — see the PRD.
|
|
12088
|
+
* @example
|
|
12089
|
+
* ```ts
|
|
12090
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12091
|
+
* const gw = new AIGatewayClient();
|
|
12092
|
+
*
|
|
12093
|
+
* await gw.integrations.create({
|
|
12094
|
+
* organisation_id: '1852583913',
|
|
12095
|
+
* ai_provider_id: 'de7d7d50-31cd-11ee-b93b-0e06f1aa7f7c',
|
|
12096
|
+
* name: 'openai-prod',
|
|
12097
|
+
* slug: 'openai-prod',
|
|
12098
|
+
* key: process.env.OPENAI_API_KEY,
|
|
12099
|
+
* });
|
|
12100
|
+
* ```
|
|
12101
|
+
*/
|
|
12102
|
+
async create(body) {
|
|
12103
|
+
assertUuid(body.ai_provider_id, "ai_provider_id");
|
|
12104
|
+
return request({
|
|
12105
|
+
method: "POST",
|
|
12106
|
+
baseUrl: this.baseUrl,
|
|
12107
|
+
path: AI_GW_INTEGRATIONS_PATH,
|
|
12108
|
+
body,
|
|
12109
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12110
|
+
auth: this.auth,
|
|
12111
|
+
numRetries: this.numRetries
|
|
12112
|
+
});
|
|
12113
|
+
}
|
|
12114
|
+
/**
|
|
12115
|
+
* Update an integration.
|
|
12116
|
+
* @param integrationId - Integration UUID.
|
|
12117
|
+
* @param body - Replacement fields.
|
|
12118
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
12119
|
+
* @example
|
|
12120
|
+
* ```ts
|
|
12121
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12122
|
+
* const gw = new AIGatewayClient();
|
|
12123
|
+
*
|
|
12124
|
+
* await gw.integrations.update('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
12125
|
+
* name: 'openai-prod',
|
|
12126
|
+
* description: 'Production OpenAI',
|
|
12127
|
+
* });
|
|
12128
|
+
* ```
|
|
12129
|
+
*/
|
|
12130
|
+
async update(integrationId, body) {
|
|
12131
|
+
assertUuid(integrationId, "integrationId");
|
|
12132
|
+
if (body.ai_provider_id !== void 0) assertUuid(body.ai_provider_id, "ai_provider_id");
|
|
12133
|
+
return request({
|
|
12134
|
+
method: "PUT",
|
|
12135
|
+
baseUrl: this.baseUrl,
|
|
12136
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
|
|
12137
|
+
body,
|
|
12138
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12139
|
+
auth: this.auth,
|
|
12140
|
+
numRetries: this.numRetries
|
|
12141
|
+
});
|
|
12142
|
+
}
|
|
12143
|
+
/**
|
|
12144
|
+
* Delete an integration.
|
|
12145
|
+
* @param integrationId - Integration UUID.
|
|
12146
|
+
* @param organisationId - The TSG as a numeric string; sent as a query param.
|
|
12147
|
+
* @returns Nothing — the API replies 200 with an empty body.
|
|
12148
|
+
* @example
|
|
12149
|
+
* ```ts
|
|
12150
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12151
|
+
* const gw = new AIGatewayClient();
|
|
12152
|
+
*
|
|
12153
|
+
* await gw.integrations.delete('f6692544-3265-49be-9711-bbdcebc079e4', '1852583913');
|
|
12154
|
+
* ```
|
|
12155
|
+
*/
|
|
12156
|
+
async delete(integrationId, organisationId) {
|
|
12157
|
+
assertUuid(integrationId, "integrationId");
|
|
12158
|
+
assertNumericId(organisationId, "organisationId");
|
|
12159
|
+
await request({
|
|
12160
|
+
method: "DELETE",
|
|
12161
|
+
baseUrl: this.baseUrl,
|
|
12162
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
|
|
12163
|
+
params: { organisation_id: organisationId },
|
|
12164
|
+
auth: this.auth,
|
|
12165
|
+
numRetries: this.numRetries
|
|
12166
|
+
});
|
|
12167
|
+
}
|
|
12168
|
+
/**
|
|
12169
|
+
* Read which models this integration exposes.
|
|
12170
|
+
* @param integrationId - Integration UUID.
|
|
12171
|
+
* @returns Per-model enablement plus the `allow_all_models` flag.
|
|
12172
|
+
* @example
|
|
12173
|
+
* ```ts
|
|
12174
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12175
|
+
* const gw = new AIGatewayClient();
|
|
12176
|
+
*
|
|
12177
|
+
* const m = await gw.integrations.getModels('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
12178
|
+
* // m.models[0] => { slug: 'gpt-4', enabled: true }
|
|
12179
|
+
* ```
|
|
12180
|
+
*/
|
|
12181
|
+
async getModels(integrationId) {
|
|
12182
|
+
assertUuid(integrationId, "integrationId");
|
|
12183
|
+
return request({
|
|
12184
|
+
method: "GET",
|
|
12185
|
+
baseUrl: this.baseUrl,
|
|
12186
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/models`,
|
|
12187
|
+
responseSchema: GatewayIntegrationModelsResponseSchema,
|
|
12188
|
+
auth: this.auth,
|
|
12189
|
+
numRetries: this.numRetries
|
|
12190
|
+
});
|
|
12191
|
+
}
|
|
12192
|
+
/**
|
|
12193
|
+
* Replace which models this integration exposes.
|
|
12194
|
+
* @param integrationId - Integration UUID.
|
|
12195
|
+
* @param body - Full model list; this is a replace, not a merge.
|
|
12196
|
+
* @returns The raw response. Shape unverified against a live tenant — see the PRD.
|
|
12197
|
+
* @example
|
|
12198
|
+
* ```ts
|
|
12199
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12200
|
+
* const gw = new AIGatewayClient();
|
|
12201
|
+
*
|
|
12202
|
+
* await gw.integrations.setModels('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
12203
|
+
* models: [{ slug: 'gpt-4', enabled: true }, { slug: 'gpt-4-32k', enabled: false }],
|
|
12204
|
+
* });
|
|
12205
|
+
* ```
|
|
12206
|
+
*/
|
|
12207
|
+
async setModels(integrationId, body) {
|
|
12208
|
+
assertUuid(integrationId, "integrationId");
|
|
12209
|
+
return request({
|
|
12210
|
+
method: "PUT",
|
|
12211
|
+
baseUrl: this.baseUrl,
|
|
12212
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/models`,
|
|
12213
|
+
body,
|
|
12214
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12215
|
+
auth: this.auth,
|
|
12216
|
+
numRetries: this.numRetries
|
|
12217
|
+
});
|
|
12218
|
+
}
|
|
12219
|
+
/**
|
|
12220
|
+
* Read which workspaces may use this integration.
|
|
12221
|
+
*
|
|
12222
|
+
* @remarks
|
|
12223
|
+
* `global_workspace_access` is an **object** on this read, not a boolean, despite the
|
|
12224
|
+
* field name — `{ enabled, rate_limits, usage_limits }`. The corresponding write
|
|
12225
|
+
* ({@link setWorkspaces}) DOES send a plain boolean; the two are not symmetric.
|
|
12226
|
+
*
|
|
12227
|
+
* @param integrationId - Integration UUID.
|
|
12228
|
+
* @returns Bound workspaces plus the `global_workspace_access` object.
|
|
12229
|
+
* @example
|
|
12230
|
+
* ```ts
|
|
12231
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12232
|
+
* const gw = new AIGatewayClient();
|
|
12233
|
+
*
|
|
12234
|
+
* const w = await gw.integrations.getWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
12235
|
+
* // w.global_workspace_access => { enabled: false, rate_limits: null, usage_limits: null }
|
|
12236
|
+
* ```
|
|
12237
|
+
*/
|
|
12238
|
+
async getWorkspaces(integrationId) {
|
|
12239
|
+
assertUuid(integrationId, "integrationId");
|
|
12240
|
+
return request({
|
|
12241
|
+
method: "GET",
|
|
12242
|
+
baseUrl: this.baseUrl,
|
|
12243
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/workspaces`,
|
|
12244
|
+
responseSchema: GatewayIntegrationWorkspacesResponseSchema,
|
|
12245
|
+
auth: this.auth,
|
|
12246
|
+
numRetries: this.numRetries
|
|
12247
|
+
});
|
|
12248
|
+
}
|
|
12249
|
+
/**
|
|
12250
|
+
* Replace which workspaces may use this integration.
|
|
12251
|
+
* @param integrationId - Integration UUID.
|
|
12252
|
+
* @param body - Workspace bindings or a global-access flag.
|
|
12253
|
+
* @returns The raw response. Shape unverified against a live tenant — see the PRD.
|
|
12254
|
+
* @example
|
|
12255
|
+
* ```ts
|
|
12256
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12257
|
+
* const gw = new AIGatewayClient();
|
|
12258
|
+
*
|
|
12259
|
+
* await gw.integrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
12260
|
+
* global_workspace_access: true,
|
|
12261
|
+
* });
|
|
12262
|
+
* ```
|
|
12263
|
+
*/
|
|
12264
|
+
async setWorkspaces(integrationId, body) {
|
|
12265
|
+
assertUuid(integrationId, "integrationId");
|
|
12266
|
+
return request({
|
|
12267
|
+
method: "PUT",
|
|
12268
|
+
baseUrl: this.baseUrl,
|
|
12269
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/workspaces`,
|
|
12270
|
+
body,
|
|
12271
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12272
|
+
auth: this.auth,
|
|
12273
|
+
numRetries: this.numRetries
|
|
12274
|
+
});
|
|
12275
|
+
}
|
|
12276
|
+
};
|
|
12277
|
+
|
|
12278
|
+
// src/ai-gateway/mcp-integrations-client.ts
|
|
12279
|
+
var AIGatewayMcpIntegrationsClient = class {
|
|
12280
|
+
baseUrl;
|
|
12281
|
+
auth;
|
|
12282
|
+
numRetries;
|
|
12283
|
+
constructor(opts) {
|
|
12284
|
+
this.baseUrl = opts.baseUrl;
|
|
12285
|
+
this.auth = opts.auth;
|
|
12286
|
+
this.numRetries = opts.numRetries;
|
|
12287
|
+
}
|
|
12288
|
+
/**
|
|
12289
|
+
* List organisation MCP integrations.
|
|
12290
|
+
* @returns All MCP server integrations defined on the organisation.
|
|
12291
|
+
* @example
|
|
12292
|
+
* ```ts
|
|
12293
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12294
|
+
* const gw = new AIGatewayClient();
|
|
12295
|
+
*
|
|
12296
|
+
* const mcp = await gw.mcpIntegrations.list();
|
|
12297
|
+
* // mcp.data[0] => { name: 'Context 7', url: 'https://mcp.context7.com/mcp', transport: 'http', ... }
|
|
12298
|
+
* ```
|
|
12299
|
+
*/
|
|
12300
|
+
async list() {
|
|
12301
|
+
return request({
|
|
12302
|
+
method: "GET",
|
|
12303
|
+
baseUrl: this.baseUrl,
|
|
12304
|
+
path: AI_GW_MCP_INTEGRATIONS_PATH,
|
|
12305
|
+
responseSchema: ListMcpIntegrationsResponseSchema,
|
|
12306
|
+
auth: this.auth,
|
|
12307
|
+
numRetries: this.numRetries
|
|
12308
|
+
});
|
|
12309
|
+
}
|
|
12310
|
+
/**
|
|
12311
|
+
* Register an MCP server.
|
|
12312
|
+
* @param body - Name, server URL, auth type, transport, and provider-specific configuration.
|
|
12313
|
+
* @returns The raw create response. Shape unverified against a live tenant — see the PRD.
|
|
12314
|
+
* @example
|
|
12315
|
+
* ```ts
|
|
12316
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12317
|
+
* const gw = new AIGatewayClient();
|
|
12318
|
+
*
|
|
12319
|
+
* await gw.mcpIntegrations.create({
|
|
12320
|
+
* name: 'Context 7',
|
|
12321
|
+
* organisation_id: '1852583913',
|
|
12322
|
+
* slug: 'context-7',
|
|
12323
|
+
* url: 'https://mcp.context7.com/mcp',
|
|
12324
|
+
* auth_type: 'none',
|
|
12325
|
+
* transport: 'http',
|
|
12326
|
+
* });
|
|
12327
|
+
* ```
|
|
12328
|
+
*/
|
|
12329
|
+
async create(body) {
|
|
12330
|
+
return request({
|
|
12331
|
+
method: "POST",
|
|
12332
|
+
baseUrl: this.baseUrl,
|
|
12333
|
+
path: AI_GW_MCP_INTEGRATIONS_PATH,
|
|
12334
|
+
body,
|
|
12335
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12336
|
+
auth: this.auth,
|
|
12337
|
+
numRetries: this.numRetries
|
|
12338
|
+
});
|
|
12339
|
+
}
|
|
12340
|
+
/**
|
|
12341
|
+
* Replace which workspaces may use this MCP integration.
|
|
12342
|
+
* @param mcpIntegrationId - MCP integration UUID.
|
|
12343
|
+
* @param body - Workspace bindings or a global-access flag; this is a replace, not a merge.
|
|
12344
|
+
* @returns The raw response. Shape unverified against a live tenant — see the PRD.
|
|
12345
|
+
* @example
|
|
12346
|
+
* ```ts
|
|
12347
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12348
|
+
* const gw = new AIGatewayClient();
|
|
12349
|
+
*
|
|
12350
|
+
* await gw.mcpIntegrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
12351
|
+
* global_workspace_access: true,
|
|
12352
|
+
* });
|
|
12353
|
+
* ```
|
|
12354
|
+
*/
|
|
12355
|
+
async setWorkspaces(mcpIntegrationId, body) {
|
|
12356
|
+
assertUuid(mcpIntegrationId, "mcpIntegrationId");
|
|
12357
|
+
return request({
|
|
12358
|
+
method: "PUT",
|
|
12359
|
+
baseUrl: this.baseUrl,
|
|
12360
|
+
path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/workspaces`,
|
|
12361
|
+
body,
|
|
12362
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12363
|
+
auth: this.auth,
|
|
12364
|
+
numRetries: this.numRetries
|
|
12365
|
+
});
|
|
12366
|
+
}
|
|
12367
|
+
};
|
|
12368
|
+
|
|
12369
|
+
// src/ai-gateway/deployments-client.ts
|
|
12370
|
+
var AIGatewayDeploymentsClient = class {
|
|
12371
|
+
baseUrl;
|
|
12372
|
+
auth;
|
|
12373
|
+
numRetries;
|
|
12374
|
+
constructor(opts) {
|
|
12375
|
+
this.baseUrl = opts.baseUrl;
|
|
12376
|
+
this.auth = opts.auth;
|
|
12377
|
+
this.numRetries = opts.numRetries;
|
|
12378
|
+
}
|
|
12379
|
+
/**
|
|
12380
|
+
* List deployments.
|
|
12381
|
+
*
|
|
12382
|
+
* @remarks
|
|
12383
|
+
* Archived deployments are included — `delete()` is a soft-delete. Filter on
|
|
12384
|
+
* `status === 'active'` if you only want live ones.
|
|
12385
|
+
*
|
|
12386
|
+
* @returns All deployments, active and archived.
|
|
12387
|
+
* @example
|
|
12388
|
+
* ```ts
|
|
12389
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12390
|
+
* const gw = new AIGatewayClient();
|
|
12391
|
+
*
|
|
12392
|
+
* const all = await gw.deployments.list();
|
|
12393
|
+
* const live = all.data.filter((d) => d.status === 'active');
|
|
12394
|
+
* // live[0] => { name: 'talos', slug: 'dp-talos-f3b74e', status: 'active', ... }
|
|
12395
|
+
* ```
|
|
12396
|
+
*/
|
|
12397
|
+
async list() {
|
|
12398
|
+
return request({
|
|
12399
|
+
method: "GET",
|
|
12400
|
+
baseUrl: this.baseUrl,
|
|
12401
|
+
path: AI_GW_DEPLOYMENTS_PATH,
|
|
12402
|
+
responseSchema: ListDeploymentsResponseSchema,
|
|
12403
|
+
auth: this.auth,
|
|
12404
|
+
numRetries: this.numRetries
|
|
12405
|
+
});
|
|
12406
|
+
}
|
|
12407
|
+
/**
|
|
12408
|
+
* Fetch one deployment.
|
|
12409
|
+
* @param deploymentId - Deployment UUID.
|
|
12410
|
+
* @returns Deployment detail, including bound workspaces and masked credentials.
|
|
12411
|
+
* @example
|
|
12412
|
+
* ```ts
|
|
12413
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12414
|
+
* const gw = new AIGatewayClient();
|
|
12415
|
+
*
|
|
12416
|
+
* const d = await gw.deployments.get('32e8314e-7e68-4384-aacb-a476f6c3f91d');
|
|
12417
|
+
* // d.auth_settings?.allow_all_workspaces => 1 (a number, not a boolean)
|
|
12418
|
+
* ```
|
|
12419
|
+
*/
|
|
12420
|
+
async get(deploymentId) {
|
|
12421
|
+
assertUuid(deploymentId, "deploymentId");
|
|
12422
|
+
return request({
|
|
12423
|
+
method: "GET",
|
|
12424
|
+
baseUrl: this.baseUrl,
|
|
12425
|
+
path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}`,
|
|
12426
|
+
responseSchema: GatewayDeploymentDetailSchema,
|
|
12427
|
+
auth: this.auth,
|
|
12428
|
+
numRetries: this.numRetries
|
|
12429
|
+
});
|
|
12430
|
+
}
|
|
12431
|
+
/**
|
|
12432
|
+
* Create a deployment.
|
|
12433
|
+
*
|
|
12434
|
+
* @remarks
|
|
12435
|
+
* The response is a **creation receipt**, not a deployment record — it has 5 fields and
|
|
12436
|
+
* carries no `name`, `slug`, or `status`. Call {@link get} for the full record.
|
|
12437
|
+
*
|
|
12438
|
+
* This is the **only** time `credentials.password` and `client_auth` are readable; the
|
|
12439
|
+
* detail read masks them. Capture them here or they are unrecoverable. Never log them.
|
|
12440
|
+
* Note that setting `PANW_AI_SEC_DEBUG` will print the raw request/response, including
|
|
12441
|
+
* `credentials.password`, to the SDK's own debug log regardless of this warning.
|
|
12442
|
+
*
|
|
12443
|
+
* @param body - Name, type, TSG, and auth settings.
|
|
12444
|
+
* @returns The creation receipt including the deployment's gateway credentials.
|
|
12445
|
+
* @example
|
|
12446
|
+
* ```ts
|
|
12447
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12448
|
+
* const gw = new AIGatewayClient();
|
|
12449
|
+
*
|
|
12450
|
+
* const receipt = await gw.deployments.create({
|
|
12451
|
+
* name: 'prod-us',
|
|
12452
|
+
* type: 'production',
|
|
12453
|
+
* organisation_id: '1852583913',
|
|
12454
|
+
* auth_settings: { allow_all_workspaces: true },
|
|
12455
|
+
* });
|
|
12456
|
+
* // receipt => { id: '2141...', client_auth: 'client-auth-...', credentials: { username, password }, ... }
|
|
12457
|
+
* const full = await gw.deployments.get(receipt.id);
|
|
12458
|
+
* ```
|
|
12459
|
+
*/
|
|
12460
|
+
async create(body) {
|
|
12461
|
+
return request({
|
|
12462
|
+
method: "POST",
|
|
12463
|
+
baseUrl: this.baseUrl,
|
|
12464
|
+
path: AI_GW_DEPLOYMENTS_PATH,
|
|
12465
|
+
body,
|
|
12466
|
+
responseSchema: GatewayDeploymentCreateResponseSchema,
|
|
12467
|
+
auth: this.auth,
|
|
12468
|
+
numRetries: this.numRetries
|
|
12469
|
+
});
|
|
12470
|
+
}
|
|
12471
|
+
/**
|
|
12472
|
+
* Archive a deployment.
|
|
12473
|
+
*
|
|
12474
|
+
* @remarks
|
|
12475
|
+
* This is a **soft delete** — the one exception to the gateway's usual delete semantics.
|
|
12476
|
+
* The API returns 200 with an empty body and the record persists with `status:
|
|
12477
|
+
* 'archived'`, still visible in {@link list}. There is no observed hard-delete for
|
|
12478
|
+
* deployments specifically. Contrast with {@link AIGatewayConfigsClient.delete |
|
|
12479
|
+
* configs.delete}, {@link AIGatewayGuardrailsClient.delete | guardrails.delete}, and
|
|
12480
|
+
* {@link AIGatewayProvidersClient.delete | providers.delete}, all of which hard-delete —
|
|
12481
|
+
* do not assume archive-on-delete is a gateway-wide convention.
|
|
12482
|
+
*
|
|
12483
|
+
* @param deploymentId - Deployment UUID.
|
|
12484
|
+
* @param organisationId - The TSG as a numeric string; sent as a query param.
|
|
12485
|
+
* @returns Nothing.
|
|
12486
|
+
* @example
|
|
12487
|
+
* ```ts
|
|
12488
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12489
|
+
* const gw = new AIGatewayClient();
|
|
12490
|
+
*
|
|
12491
|
+
* await gw.deployments.delete('21414819-485e-4ba3-b3d3-3e1815580e43', '1852583913');
|
|
12492
|
+
* // the record remains in list() with status 'archived'
|
|
12493
|
+
* ```
|
|
12494
|
+
*/
|
|
12495
|
+
async delete(deploymentId, organisationId) {
|
|
12496
|
+
assertUuid(deploymentId, "deploymentId");
|
|
12497
|
+
assertNumericId(organisationId, "organisationId");
|
|
12498
|
+
await request({
|
|
12499
|
+
method: "DELETE",
|
|
12500
|
+
baseUrl: this.baseUrl,
|
|
12501
|
+
path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}`,
|
|
12502
|
+
params: { organisation_id: organisationId },
|
|
12503
|
+
auth: this.auth,
|
|
12504
|
+
numRetries: this.numRetries
|
|
12505
|
+
});
|
|
12506
|
+
}
|
|
12507
|
+
};
|
|
12508
|
+
|
|
12509
|
+
// src/ai-gateway/plugins-client.ts
|
|
12510
|
+
var AIGatewayPluginsClient = class {
|
|
12511
|
+
baseUrl;
|
|
12512
|
+
auth;
|
|
12513
|
+
numRetries;
|
|
12514
|
+
constructor(opts) {
|
|
12515
|
+
this.baseUrl = opts.baseUrl;
|
|
12516
|
+
this.auth = opts.auth;
|
|
12517
|
+
this.numRetries = opts.numRetries;
|
|
12518
|
+
}
|
|
12519
|
+
/**
|
|
12520
|
+
* List organisation plugin bindings.
|
|
12521
|
+
* @returns All plugins bound to the organisation, with masked credentials.
|
|
12522
|
+
* @example
|
|
12523
|
+
* ```ts
|
|
12524
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12525
|
+
* const gw = new AIGatewayClient();
|
|
12526
|
+
*
|
|
12527
|
+
* const p = await gw.plugins.list();
|
|
12528
|
+
* // p.data[0] => { integration_slug: 'panw-prisma-airs', credentials: { AIRS_API_KEY: 'sn*****Gul' }, ... }
|
|
12529
|
+
* ```
|
|
12530
|
+
*/
|
|
12531
|
+
async list() {
|
|
12532
|
+
return request({
|
|
12533
|
+
method: "GET",
|
|
12534
|
+
baseUrl: this.baseUrl,
|
|
12535
|
+
path: AI_GW_PLUGINS_PATH,
|
|
12536
|
+
responseSchema: ListPluginsResponseSchema,
|
|
12537
|
+
auth: this.auth,
|
|
12538
|
+
numRetries: this.numRetries
|
|
12539
|
+
});
|
|
12540
|
+
}
|
|
12541
|
+
/**
|
|
12542
|
+
* Bind a plugin to the organisation.
|
|
12543
|
+
*
|
|
12544
|
+
* @remarks
|
|
12545
|
+
* `body.credentials` (e.g. `AIRS_API_KEY`) is a live secret. Setting `PANW_AI_SEC_DEBUG`
|
|
12546
|
+
* will print it, unredacted, to the SDK's own debug log.
|
|
12547
|
+
*
|
|
12548
|
+
* @param body - Integration id and provider-specific credentials.
|
|
12549
|
+
* @returns The raw create response. Shape unverified against a live tenant — see the PRD.
|
|
12550
|
+
* @example
|
|
12551
|
+
* ```ts
|
|
12552
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12553
|
+
* const gw = new AIGatewayClient();
|
|
12554
|
+
*
|
|
12555
|
+
* await gw.plugins.create({
|
|
12556
|
+
* organisation_id: '1852583913',
|
|
12557
|
+
* integration_id: '232e45c4-809a-11f1-af60-2ca2a760eb7b',
|
|
12558
|
+
* credentials: { AIRS_API_KEY: process.env.PANW_AI_SEC_API_KEY ?? '' },
|
|
12559
|
+
* });
|
|
12560
|
+
* ```
|
|
12561
|
+
*/
|
|
12562
|
+
async create(body) {
|
|
12563
|
+
assertUuid(body.integration_id, "integration_id");
|
|
12564
|
+
return request({
|
|
12565
|
+
method: "POST",
|
|
12566
|
+
baseUrl: this.baseUrl,
|
|
12567
|
+
path: AI_GW_PLUGINS_PATH,
|
|
12568
|
+
body,
|
|
12569
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12570
|
+
auth: this.auth,
|
|
12571
|
+
numRetries: this.numRetries
|
|
12572
|
+
});
|
|
12573
|
+
}
|
|
12574
|
+
};
|
|
12575
|
+
|
|
12576
|
+
// src/ai-gateway/organisations-client.ts
|
|
12577
|
+
var AIGatewayOrganisationsClient = class {
|
|
12578
|
+
baseUrl;
|
|
12579
|
+
auth;
|
|
12580
|
+
numRetries;
|
|
12581
|
+
constructor(opts) {
|
|
12582
|
+
this.baseUrl = opts.baseUrl;
|
|
12583
|
+
this.auth = opts.auth;
|
|
12584
|
+
this.numRetries = opts.numRetries;
|
|
12585
|
+
}
|
|
12586
|
+
/**
|
|
12587
|
+
* Fetch the calling organisation's settings.
|
|
12588
|
+
* @returns The organisation record.
|
|
12589
|
+
* @example
|
|
12590
|
+
* ```ts
|
|
12591
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12592
|
+
* const gw = new AIGatewayClient();
|
|
12593
|
+
*
|
|
12594
|
+
* const org = await gw.organisations.getSelf();
|
|
12595
|
+
* // org.data.name => 'Acme Corp'
|
|
12596
|
+
* ```
|
|
12597
|
+
*/
|
|
12598
|
+
async getSelf() {
|
|
12599
|
+
return request({
|
|
12600
|
+
method: "GET",
|
|
12601
|
+
baseUrl: this.baseUrl,
|
|
12602
|
+
path: AI_GW_ORGANISATIONS_SELF_PATH,
|
|
12603
|
+
responseSchema: OrganisationSelfResponseSchema,
|
|
12604
|
+
auth: this.auth,
|
|
12605
|
+
numRetries: this.numRetries
|
|
12606
|
+
});
|
|
12607
|
+
}
|
|
12608
|
+
/**
|
|
12609
|
+
* Update the calling organisation's settings.
|
|
12610
|
+
* @param body - Replacement fields.
|
|
12611
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
12612
|
+
* @example
|
|
12613
|
+
* ```ts
|
|
12614
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12615
|
+
* const gw = new AIGatewayClient();
|
|
12616
|
+
*
|
|
12617
|
+
* await gw.organisations.updateSelf({ name: 'Acme Corp' });
|
|
12618
|
+
* ```
|
|
12619
|
+
*/
|
|
12620
|
+
async updateSelf(body) {
|
|
12621
|
+
return request({
|
|
12622
|
+
method: "PUT",
|
|
12623
|
+
baseUrl: this.baseUrl,
|
|
12624
|
+
path: AI_GW_ORGANISATIONS_SELF_PATH,
|
|
12625
|
+
body,
|
|
12626
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12627
|
+
auth: this.auth,
|
|
12628
|
+
numRetries: this.numRetries
|
|
12629
|
+
});
|
|
12630
|
+
}
|
|
12631
|
+
/**
|
|
12632
|
+
* Fetch an organisation's auth settings.
|
|
12633
|
+
*
|
|
12634
|
+
* @remarks
|
|
12635
|
+
* The response includes a `scim_token` — a live secret. Never log the returned object.
|
|
12636
|
+
* Note that setting `PANW_AI_SEC_DEBUG` will print it (unredacted) to the SDK's own debug
|
|
12637
|
+
* log regardless of this warning, since debug logging only sanitizes header values.
|
|
12638
|
+
*
|
|
12639
|
+
* @param tsgId - The TSG as a numeric string, not a UUID.
|
|
12640
|
+
* @returns Auth settings, including domains and the SCIM token.
|
|
12641
|
+
* @example
|
|
12642
|
+
* ```ts
|
|
12643
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12644
|
+
* const gw = new AIGatewayClient();
|
|
12645
|
+
*
|
|
12646
|
+
* const auth = await gw.organisations.getAuthSettings('1852583913');
|
|
12647
|
+
* // Object.keys(auth.data) => ['auth_settings', 'domains', 'scim_token', ...]
|
|
12648
|
+
* ```
|
|
12649
|
+
*/
|
|
12650
|
+
async getAuthSettings(tsgId) {
|
|
12651
|
+
assertNumericId(tsgId, "tsgId");
|
|
12652
|
+
return request({
|
|
12653
|
+
method: "GET",
|
|
12654
|
+
baseUrl: this.baseUrl,
|
|
12655
|
+
path: aiGwOrganisationsAuthSettingsPath(tsgId),
|
|
12656
|
+
responseSchema: AuthSettingsResponseSchema,
|
|
12657
|
+
auth: this.auth,
|
|
12658
|
+
numRetries: this.numRetries
|
|
12659
|
+
});
|
|
12660
|
+
}
|
|
12661
|
+
/**
|
|
12662
|
+
* Update an organisation's auth settings.
|
|
12663
|
+
* @param tsgId - The TSG as a numeric string, not a UUID.
|
|
12664
|
+
* @param body - Replacement fields.
|
|
12665
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
12666
|
+
* @example
|
|
12667
|
+
* ```ts
|
|
12668
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12669
|
+
* const gw = new AIGatewayClient();
|
|
12670
|
+
*
|
|
12671
|
+
* await gw.organisations.updateAuthSettings('1852583913', {
|
|
12672
|
+
* domains: ['acme.com'],
|
|
12673
|
+
* });
|
|
12674
|
+
* ```
|
|
12675
|
+
*/
|
|
12676
|
+
async updateAuthSettings(tsgId, body) {
|
|
12677
|
+
assertNumericId(tsgId, "tsgId");
|
|
12678
|
+
return request({
|
|
12679
|
+
method: "PUT",
|
|
12680
|
+
baseUrl: this.baseUrl,
|
|
12681
|
+
path: aiGwOrganisationsAuthSettingsPath(tsgId),
|
|
12682
|
+
body,
|
|
12683
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12684
|
+
auth: this.auth,
|
|
12685
|
+
numRetries: this.numRetries
|
|
12686
|
+
});
|
|
12687
|
+
}
|
|
12688
|
+
};
|
|
12689
|
+
|
|
12690
|
+
// src/ai-gateway/audit-logs-client.ts
|
|
12691
|
+
var AIGatewayAuditLogsClient = class {
|
|
12692
|
+
baseUrl;
|
|
12693
|
+
auth;
|
|
12694
|
+
numRetries;
|
|
12695
|
+
constructor(opts) {
|
|
12696
|
+
this.baseUrl = opts.baseUrl;
|
|
12697
|
+
this.auth = opts.auth;
|
|
12698
|
+
this.numRetries = opts.numRetries;
|
|
12699
|
+
}
|
|
12700
|
+
/**
|
|
12701
|
+
* Read organisation audit logs.
|
|
12702
|
+
*
|
|
12703
|
+
* @remarks
|
|
12704
|
+
* **Handle the result as sensitive.** The API returns each entry's `request_body`
|
|
12705
|
+
* **unredacted**, so records for credential-bearing calls (integrations, plugins) can
|
|
12706
|
+
* contain live secrets — private keys, provider API keys — in plaintext. The sibling
|
|
12707
|
+
* `request_headers` field is masked, but `request_body` is not. The SDK returns the
|
|
12708
|
+
* response faithfully rather than altering it; never log these records wholesale, and
|
|
12709
|
+
* never forward them to a third-party sink. Note that setting `PANW_AI_SEC_DEBUG` will
|
|
12710
|
+
* print the raw response — including these unredacted secrets — to the SDK's own debug
|
|
12711
|
+
* log regardless of this warning.
|
|
12712
|
+
*
|
|
12713
|
+
* @param opts - Inclusive start and end of the window.
|
|
12714
|
+
* @returns Audit records, newest first.
|
|
12715
|
+
* @example
|
|
12716
|
+
* ```ts
|
|
12717
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12718
|
+
* const gw = new AIGatewayClient();
|
|
12719
|
+
*
|
|
12720
|
+
* const logs = await gw.auditLogs.list({
|
|
12721
|
+
* start: new Date('2026-07-20T00:00:00Z'),
|
|
12722
|
+
* end: new Date(),
|
|
12723
|
+
* });
|
|
12724
|
+
* // Safe projection — never log the whole record.
|
|
12725
|
+
* const summary = logs.records.map((r) => `${r.timestamp} ${r.method} ${r.uri}`);
|
|
12726
|
+
* ```
|
|
12727
|
+
*/
|
|
12728
|
+
async list(opts) {
|
|
12729
|
+
return request({
|
|
12730
|
+
method: "GET",
|
|
12731
|
+
baseUrl: this.baseUrl,
|
|
12732
|
+
path: AI_GW_AUDIT_LOGS_PATH,
|
|
12733
|
+
params: {
|
|
12734
|
+
start_time: opts.start.toISOString(),
|
|
12735
|
+
end_time: opts.end.toISOString()
|
|
12736
|
+
},
|
|
12737
|
+
responseSchema: GatewayAuditLogsResponseSchema,
|
|
12738
|
+
auth: this.auth,
|
|
12739
|
+
numRetries: this.numRetries
|
|
12740
|
+
});
|
|
12741
|
+
}
|
|
12742
|
+
};
|
|
12743
|
+
|
|
12744
|
+
// src/ai-gateway/client.ts
|
|
12745
|
+
var AIGatewayClient = class {
|
|
12746
|
+
/** Runtime telemetry: charts, group-bys, and raw request logs. */
|
|
12747
|
+
telemetry;
|
|
12748
|
+
/** Workspace reads (data plane). */
|
|
12749
|
+
workspaces;
|
|
12750
|
+
/** Gateway routing configs. */
|
|
12751
|
+
configs;
|
|
12752
|
+
/** Workspace guardrails. */
|
|
12753
|
+
guardrails;
|
|
12754
|
+
/** Workspace-scoped provider bindings. */
|
|
12755
|
+
providers;
|
|
12756
|
+
/** Service and user API keys. */
|
|
12757
|
+
apiKeys;
|
|
12758
|
+
/** Organisation-level provider integrations (admin plane). */
|
|
12759
|
+
integrations;
|
|
12760
|
+
/** MCP server integrations (admin plane). */
|
|
12761
|
+
mcpIntegrations;
|
|
12762
|
+
/** Gateway deployments (admin plane). */
|
|
12763
|
+
deployments;
|
|
12764
|
+
/** Plugin bindings such as the Prisma AIRS scanner (admin plane). */
|
|
12765
|
+
plugins;
|
|
12766
|
+
/** Organisation and auth settings (admin plane). */
|
|
12767
|
+
organisations;
|
|
12768
|
+
/** Organisation audit logs (admin plane). */
|
|
12769
|
+
auditLogs;
|
|
12770
|
+
constructor(opts = {}) {
|
|
12771
|
+
const dataEndpoint = opts.dataEndpoint ?? process.env[AI_GW_DATA_ENDPOINT] ?? DEFAULT_AI_GW_DATA_ENDPOINT;
|
|
12772
|
+
const adminEndpoint = opts.adminEndpoint ?? process.env[AI_GW_ADMIN_ENDPOINT] ?? DEFAULT_AI_GW_ADMIN_ENDPOINT;
|
|
12773
|
+
const { oauthClient, numRetries, tsgId } = resolveOAuthConfig({
|
|
12774
|
+
clientId: opts.clientId,
|
|
12775
|
+
clientSecret: opts.clientSecret,
|
|
12776
|
+
tsgId: opts.tsgId,
|
|
12777
|
+
baseUrl: dataEndpoint,
|
|
12778
|
+
numRetries: opts.numRetries,
|
|
12779
|
+
tokenEndpoint: opts.tokenEndpoint,
|
|
12780
|
+
primaryEnvPrefix: "PANW_AI_GW",
|
|
12781
|
+
fallbackEnvPrefix: "PANW_MGMT"
|
|
12782
|
+
});
|
|
12783
|
+
const auth = new TsgHeaderAuth(new OAuthAuth(oauthClient), tsgId);
|
|
12784
|
+
const dataOpts = { baseUrl: dataEndpoint, auth, numRetries };
|
|
12785
|
+
const adminOpts = { baseUrl: adminEndpoint, auth, numRetries };
|
|
12786
|
+
this.telemetry = new AIGatewayTelemetryClient({ ...dataOpts, tsgId });
|
|
12787
|
+
this.workspaces = new AIGatewayWorkspacesClient({ ...dataOpts, adminBaseUrl: adminEndpoint });
|
|
12788
|
+
this.configs = new AIGatewayConfigsClient(dataOpts);
|
|
12789
|
+
this.guardrails = new AIGatewayGuardrailsClient(dataOpts);
|
|
12790
|
+
this.providers = new AIGatewayProvidersClient(dataOpts);
|
|
12791
|
+
this.apiKeys = new AIGatewayApiKeysClient(dataOpts);
|
|
12792
|
+
this.integrations = new AIGatewayIntegrationsClient(adminOpts);
|
|
12793
|
+
this.mcpIntegrations = new AIGatewayMcpIntegrationsClient(adminOpts);
|
|
12794
|
+
this.deployments = new AIGatewayDeploymentsClient(adminOpts);
|
|
12795
|
+
this.plugins = new AIGatewayPluginsClient(adminOpts);
|
|
12796
|
+
this.organisations = new AIGatewayOrganisationsClient(adminOpts);
|
|
12797
|
+
this.auditLogs = new AIGatewayAuditLogsClient(adminOpts);
|
|
12798
|
+
}
|
|
12799
|
+
};
|
|
9922
12800
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9923
12801
|
0 && (module.exports = {
|
|
12802
|
+
AIGatewayApiKeysClient,
|
|
12803
|
+
AIGatewayAuditLogsClient,
|
|
12804
|
+
AIGatewayClient,
|
|
12805
|
+
AIGatewayConfigsClient,
|
|
12806
|
+
AIGatewayDeploymentsClient,
|
|
12807
|
+
AIGatewayGuardrailsClient,
|
|
12808
|
+
AIGatewayIntegrationsClient,
|
|
12809
|
+
AIGatewayMcpIntegrationsClient,
|
|
12810
|
+
AIGatewayOrganisationsClient,
|
|
12811
|
+
AIGatewayPluginsClient,
|
|
12812
|
+
AIGatewayProvidersClient,
|
|
12813
|
+
AIGatewayTelemetryClient,
|
|
12814
|
+
AIGatewayWorkspacesClient,
|
|
9924
12815
|
AIRS_ENDPOINTS,
|
|
9925
12816
|
AISecSDKException,
|
|
12817
|
+
AI_GW_ADMIN_ENDPOINT,
|
|
12818
|
+
AI_GW_API_KEYS_SERVICE_PATH,
|
|
12819
|
+
AI_GW_API_KEYS_USER_PATH,
|
|
12820
|
+
AI_GW_AUDIT_LOGS_PATH,
|
|
12821
|
+
AI_GW_CHARTS_PATH,
|
|
12822
|
+
AI_GW_CHART_METRICS,
|
|
12823
|
+
AI_GW_CONFIGS_PATH,
|
|
12824
|
+
AI_GW_DATA_ENDPOINT,
|
|
12825
|
+
AI_GW_DEPLOYMENTS_PATH,
|
|
12826
|
+
AI_GW_GROUPS_PATH,
|
|
12827
|
+
AI_GW_GROUP_COLUMNS,
|
|
12828
|
+
AI_GW_GROUP_DIMENSIONS,
|
|
12829
|
+
AI_GW_GUARDRAILS_PATH,
|
|
12830
|
+
AI_GW_INTEGRATIONS_PATH,
|
|
12831
|
+
AI_GW_LOGS_PATH,
|
|
12832
|
+
AI_GW_MCP_INTEGRATIONS_PATH,
|
|
12833
|
+
AI_GW_ORGANISATIONS_SELF_PATH,
|
|
12834
|
+
AI_GW_PLUGINS_PATH,
|
|
12835
|
+
AI_GW_PROVIDERS_PATH,
|
|
12836
|
+
AI_GW_WORKSPACES_PATH,
|
|
9926
12837
|
AI_SEC_API_ENDPOINT,
|
|
9927
12838
|
AI_SEC_API_KEY,
|
|
9928
12839
|
AI_SEC_API_TOKEN,
|
|
9929
12840
|
ASYNC_SCAN_PATH,
|
|
9930
12841
|
Action,
|
|
12842
|
+
AdapterCreateRequestSchema,
|
|
12843
|
+
AdapterListItemSchema,
|
|
12844
|
+
AdapterListSchema,
|
|
12845
|
+
AdapterResponseSchema,
|
|
12846
|
+
AdapterUpdateRequestSchema,
|
|
12847
|
+
AdapterValidateRequestSchema,
|
|
12848
|
+
AdapterValidateResponseSchema,
|
|
12849
|
+
AdapterVarResponseSchema,
|
|
12850
|
+
AdapterVarSchema,
|
|
12851
|
+
AdapterVarTypeSchema,
|
|
9931
12852
|
AdvancedDataProfileRequestSchema,
|
|
9932
12853
|
AgentEntrySchema,
|
|
9933
12854
|
AgentMetaSchema,
|
|
@@ -9956,6 +12877,7 @@ var RedTeamClient = class {
|
|
|
9956
12877
|
AttackType,
|
|
9957
12878
|
AuditResponseSchema,
|
|
9958
12879
|
AuthConfigSchema,
|
|
12880
|
+
AuthSettingsResponseSchema,
|
|
9959
12881
|
AuthType,
|
|
9960
12882
|
BEARER,
|
|
9961
12883
|
BaseResponseSchema,
|
|
@@ -9963,6 +12885,8 @@ var RedTeamClient = class {
|
|
|
9963
12885
|
BasicAuthLocation,
|
|
9964
12886
|
BedrockAccessConnectionParamsSchema,
|
|
9965
12887
|
BrandSubCategory,
|
|
12888
|
+
CacheHitTrendResponseSchema,
|
|
12889
|
+
CacheSummaryResponseSchema,
|
|
9966
12890
|
Category,
|
|
9967
12891
|
CategoryModelSchema,
|
|
9968
12892
|
CategoryReportSchema,
|
|
@@ -9984,7 +12908,9 @@ var RedTeamClient = class {
|
|
|
9984
12908
|
Content,
|
|
9985
12909
|
ContentErrorSchema,
|
|
9986
12910
|
ContentErrorType,
|
|
12911
|
+
CostChartResponseSchema,
|
|
9987
12912
|
CountByNameSchema,
|
|
12913
|
+
CountChartResponseSchema,
|
|
9988
12914
|
CountedQuotaEnum,
|
|
9989
12915
|
CreateChannelRequestSchema,
|
|
9990
12916
|
CreateCustomTopicRequestSchema,
|
|
@@ -10014,6 +12940,8 @@ var RedTeamClient = class {
|
|
|
10014
12940
|
CustomerAppSchema,
|
|
10015
12941
|
CustomerAppWithKeysSchema,
|
|
10016
12942
|
CustomerAppsClient,
|
|
12943
|
+
DEFAULT_AI_GW_ADMIN_ENDPOINT,
|
|
12944
|
+
DEFAULT_AI_GW_DATA_ENDPOINT,
|
|
10017
12945
|
DEFAULT_DLP_ENDPOINT,
|
|
10018
12946
|
DEFAULT_ENDPOINT,
|
|
10019
12947
|
DEFAULT_MGMT_ENDPOINT,
|
|
@@ -10118,6 +13046,7 @@ var RedTeamClient = class {
|
|
|
10118
13046
|
ErrorResponseSchema,
|
|
10119
13047
|
ErrorSource,
|
|
10120
13048
|
ErrorStatus,
|
|
13049
|
+
ErrorTrendsResponseSchema,
|
|
10121
13050
|
ErrorType,
|
|
10122
13051
|
EulaAcceptRequestSchema,
|
|
10123
13052
|
EulaContentResponseSchema,
|
|
@@ -10128,16 +13057,49 @@ var RedTeamClient = class {
|
|
|
10128
13057
|
ExclusionsSchema,
|
|
10129
13058
|
ExpressionOperatorTypeSchema,
|
|
10130
13059
|
ExpressionTreeNodeSchema,
|
|
13060
|
+
FeedbackModelsResponseSchema,
|
|
13061
|
+
FeedbackScoreDistributionResponseSchema,
|
|
10131
13062
|
FileFormat,
|
|
10132
13063
|
FileListSchema,
|
|
10133
13064
|
FileResponseSchema,
|
|
10134
13065
|
FileScanDataSchema,
|
|
10135
13066
|
FileScanResult,
|
|
10136
13067
|
FileType,
|
|
13068
|
+
GatewayApiKeySchema,
|
|
13069
|
+
GatewayAuditLogRecordSchema,
|
|
13070
|
+
GatewayAuditLogsResponseSchema,
|
|
13071
|
+
GatewayChartRecordSchema,
|
|
13072
|
+
GatewayConfigCreateResponseSchema,
|
|
13073
|
+
GatewayConfigDetailSchema,
|
|
13074
|
+
GatewayConfigSchema,
|
|
13075
|
+
GatewayDeploymentCreateResponseSchema,
|
|
13076
|
+
GatewayDeploymentDetailSchema,
|
|
13077
|
+
GatewayDeploymentSchema,
|
|
13078
|
+
GatewayGlobalWorkspaceAccessSchema,
|
|
13079
|
+
GatewayGroupRowSchema,
|
|
13080
|
+
GatewayGuardrailCreateResponseSchema,
|
|
13081
|
+
GatewayGuardrailDetailSchema,
|
|
13082
|
+
GatewayGuardrailSchema,
|
|
13083
|
+
GatewayIntegrationModelsResponseSchema,
|
|
13084
|
+
GatewayIntegrationSchema,
|
|
13085
|
+
GatewayIntegrationWorkspaceSchema,
|
|
13086
|
+
GatewayIntegrationWorkspacesResponseSchema,
|
|
13087
|
+
GatewayLogRecordSchema,
|
|
13088
|
+
GatewayLogsResponseSchema,
|
|
13089
|
+
GatewayPluginSchema,
|
|
13090
|
+
GatewayProviderCreateResponseSchema,
|
|
13091
|
+
GatewayProviderSchema,
|
|
13092
|
+
GatewayRateLimitSchema,
|
|
13093
|
+
GatewayUsageLimitSchema,
|
|
13094
|
+
GatewayWorkspaceCreateResponseSchema,
|
|
13095
|
+
GatewayWorkspaceDetailSchema,
|
|
13096
|
+
GatewayWorkspaceSchema,
|
|
13097
|
+
GatewayWriteResponseSchema,
|
|
10137
13098
|
GoalListResponseSchema,
|
|
10138
13099
|
GoalSchema,
|
|
10139
13100
|
GoalType,
|
|
10140
13101
|
GoalTypeQueryParam,
|
|
13102
|
+
GroupListResponseSchema,
|
|
10141
13103
|
GuardrailAction,
|
|
10142
13104
|
HEADER_API_KEY,
|
|
10143
13105
|
HEADER_AUTH_TOKEN,
|
|
@@ -10164,9 +13126,19 @@ var RedTeamClient = class {
|
|
|
10164
13126
|
LabelsCreateRequestSchema,
|
|
10165
13127
|
LabelsResponseSchema,
|
|
10166
13128
|
LanguageOptionSchema,
|
|
13129
|
+
LatencyChartResponseSchema,
|
|
13130
|
+
ListApiKeysResponseSchema,
|
|
13131
|
+
ListConfigsResponseSchema,
|
|
13132
|
+
ListDeploymentsResponseSchema,
|
|
13133
|
+
ListGuardrailsResponseSchema,
|
|
13134
|
+
ListIntegrationsResponseSchema,
|
|
13135
|
+
ListMcpIntegrationsResponseSchema,
|
|
10167
13136
|
ListModelSecurityGroupsResponseSchema,
|
|
10168
13137
|
ListModelSecurityRuleInstancesResponseSchema,
|
|
10169
13138
|
ListModelSecurityRulesResponseSchema,
|
|
13139
|
+
ListPluginsResponseSchema,
|
|
13140
|
+
ListProvidersResponseSchema,
|
|
13141
|
+
ListWorkspacesResponseSchema,
|
|
10170
13142
|
MAX_AI_PROFILE_NAME_LENGTH,
|
|
10171
13143
|
MAX_API_KEY_LENGTH,
|
|
10172
13144
|
MAX_CONNECTION_POOL_SIZE,
|
|
@@ -10224,6 +13196,7 @@ var RedTeamClient = class {
|
|
|
10224
13196
|
MaskedDataSchema,
|
|
10225
13197
|
McEntrySchema,
|
|
10226
13198
|
McReportSchema,
|
|
13199
|
+
McpIntegrationSchema,
|
|
10227
13200
|
MetadataCriterionSchema,
|
|
10228
13201
|
MetadataSchema,
|
|
10229
13202
|
ModelConfigurationSchema,
|
|
@@ -10257,6 +13230,7 @@ var RedTeamClient = class {
|
|
|
10257
13230
|
Oauth2TokenSchema,
|
|
10258
13231
|
OffsetSchema,
|
|
10259
13232
|
OpenAIConnectionParamsSchema,
|
|
13233
|
+
OrganisationSelfResponseSchema,
|
|
10260
13234
|
PAYLOAD_HASH,
|
|
10261
13235
|
PageDataFilteringProfileResponseSchema,
|
|
10262
13236
|
PageDataPatternResponseSchema,
|
|
@@ -10290,6 +13264,8 @@ var RedTeamClient = class {
|
|
|
10290
13264
|
PyPIAuthResponseSchema,
|
|
10291
13265
|
QuotaDetailsSchema,
|
|
10292
13266
|
QuotaSummarySchema,
|
|
13267
|
+
RED_TEAM_ADAPTER_PATH,
|
|
13268
|
+
RED_TEAM_ADAPTER_VALIDATE_PATH,
|
|
10293
13269
|
RED_TEAM_CATEGORIES_PATH,
|
|
10294
13270
|
RED_TEAM_CHANNELS_PATH,
|
|
10295
13271
|
RED_TEAM_CHANNELS_STATS_PATH,
|
|
@@ -10319,6 +13295,7 @@ var RedTeamClient = class {
|
|
|
10319
13295
|
RED_TEAM_TEMPLATE_PATH,
|
|
10320
13296
|
RED_TEAM_TOKEN_ENDPOINT,
|
|
10321
13297
|
RED_TEAM_TSG_ID,
|
|
13298
|
+
RedTeamAdaptersClient,
|
|
10322
13299
|
RedTeamCategory,
|
|
10323
13300
|
RedTeamClient,
|
|
10324
13301
|
RedTeamCustomAttackReportsClient,
|
|
@@ -10334,6 +13311,7 @@ var RedTeamClient = class {
|
|
|
10334
13311
|
RegistryCredentialsSchema,
|
|
10335
13312
|
RemediationDetailSchema,
|
|
10336
13313
|
RemediationResponseSchema,
|
|
13314
|
+
RescuedRetriesResponseSchema,
|
|
10337
13315
|
ResourceModelExtensionSchema,
|
|
10338
13316
|
ResponseDetectedSchema,
|
|
10339
13317
|
ResponseDetectionDetailsSchema,
|
|
@@ -10408,6 +13386,7 @@ var RedTeamClient = class {
|
|
|
10408
13386
|
StreamingConnectionParamsSchema,
|
|
10409
13387
|
SubCategoryModelSchema,
|
|
10410
13388
|
SubCategoryStatsSchema,
|
|
13389
|
+
TSG_ID_HEADER,
|
|
10411
13390
|
TargetAdditionalContextSchema,
|
|
10412
13391
|
TargetAuthType,
|
|
10413
13392
|
TargetAuthValidationRequestSchema,
|
|
@@ -10434,6 +13413,7 @@ var RedTeamClient = class {
|
|
|
10434
13413
|
ThreatCategory,
|
|
10435
13414
|
ThreatScanReportSchema,
|
|
10436
13415
|
TokenStatsSchema,
|
|
13416
|
+
TokensChartResponseSchema,
|
|
10437
13417
|
ToolDetectedSchema,
|
|
10438
13418
|
ToolDetectionDetailsSchema,
|
|
10439
13419
|
ToolDetectionEntrySchema,
|
|
@@ -10448,6 +13428,8 @@ var RedTeamClient = class {
|
|
|
10448
13428
|
UpdateChannelRequestSchema,
|
|
10449
13429
|
UrlCategorySchema,
|
|
10450
13430
|
UrlfEntrySchema,
|
|
13431
|
+
UserGroupResponseSchema,
|
|
13432
|
+
UserTrendsResponseSchema,
|
|
10451
13433
|
ValidationErrorSchema,
|
|
10452
13434
|
Verdict,
|
|
10453
13435
|
ViolationListSchema,
|
|
@@ -10456,6 +13438,7 @@ var RedTeamClient = class {
|
|
|
10456
13438
|
ViolationSeverityCountsSchema,
|
|
10457
13439
|
WebSocketConnectionParamsSchema,
|
|
10458
13440
|
WeightedRegexSchema,
|
|
13441
|
+
aiGwOrganisationsAuthSettingsPath,
|
|
10459
13442
|
globalConfiguration,
|
|
10460
13443
|
init,
|
|
10461
13444
|
jsonNullable,
|