@cdot65/prisma-airs-sdk 0.11.0 → 0.13.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 +16 -100
- package/dist/index.cjs +712 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1837 -23
- package/dist/index.d.ts +1837 -23
- package/dist/index.js +682 -24
- package/dist/index.js.map +1 -1
- package/package.json +4 -22
package/dist/index.cjs
CHANGED
|
@@ -66,6 +66,12 @@ __export(index_exports, {
|
|
|
66
66
|
CategoryModelSchema: () => CategoryModelSchema,
|
|
67
67
|
CategoryReportSchema: () => CategoryReportSchema,
|
|
68
68
|
CgReportSchema: () => CgReportSchema,
|
|
69
|
+
ChannelListPaginationSchema: () => ChannelListPaginationSchema,
|
|
70
|
+
ChannelListResponseSchema: () => ChannelListResponseSchema,
|
|
71
|
+
ChannelSchema: () => ChannelSchema,
|
|
72
|
+
ChannelStatsSchema: () => ChannelStatsSchema,
|
|
73
|
+
ChannelStatus: () => ChannelStatus,
|
|
74
|
+
ChannelStatusSchema: () => ChannelStatusSchema,
|
|
69
75
|
ClientIdAndCustomerAppSchema: () => ClientIdAndCustomerAppSchema,
|
|
70
76
|
CmdEntrySchema: () => CmdEntrySchema,
|
|
71
77
|
CmdInjectReportSchema: () => CmdInjectReportSchema,
|
|
@@ -79,6 +85,7 @@ __export(index_exports, {
|
|
|
79
85
|
ContentErrorType: () => ContentErrorType,
|
|
80
86
|
CountByNameSchema: () => CountByNameSchema,
|
|
81
87
|
CountedQuotaEnum: () => CountedQuotaEnum,
|
|
88
|
+
CreateChannelRequestSchema: () => CreateChannelRequestSchema,
|
|
82
89
|
CreateCustomTopicRequestSchema: () => CreateCustomTopicRequestSchema,
|
|
83
90
|
CreateSecurityProfileRequestSchema: () => CreateSecurityProfileRequestSchema,
|
|
84
91
|
CustomAttackOutputSchema: () => CustomAttackOutputSchema,
|
|
@@ -113,6 +120,7 @@ __export(index_exports, {
|
|
|
113
120
|
DEFAULT_MODEL_SEC_MGMT_ENDPOINT: () => DEFAULT_MODEL_SEC_MGMT_ENDPOINT,
|
|
114
121
|
DEFAULT_RED_TEAM_DATA_ENDPOINT: () => DEFAULT_RED_TEAM_DATA_ENDPOINT,
|
|
115
122
|
DEFAULT_RED_TEAM_MGMT_ENDPOINT: () => DEFAULT_RED_TEAM_MGMT_ENDPOINT,
|
|
123
|
+
DEFAULT_RED_TEAM_NETWORK_BROKER_ENDPOINT: () => DEFAULT_RED_TEAM_NETWORK_BROKER_ENDPOINT,
|
|
116
124
|
DEFAULT_TOKEN_ENDPOINT: () => DEFAULT_TOKEN_ENDPOINT,
|
|
117
125
|
DLP_DATA_FILTERING_PROFILES_PATH: () => DLP_DATA_FILTERING_PROFILES_PATH,
|
|
118
126
|
DLP_DATA_PATTERNS_PATH: () => DLP_DATA_PATTERNS_PATH,
|
|
@@ -121,9 +129,13 @@ __export(index_exports, {
|
|
|
121
129
|
DSDetailResultSchema: () => DSDetailResultSchema,
|
|
122
130
|
DSResultMetadataSchema: () => DSResultMetadataSchema,
|
|
123
131
|
DashboardApplicationSchema: () => DashboardApplicationSchema,
|
|
132
|
+
DashboardApplicationSessionsBucketSchema: () => DashboardApplicationSessionsBucketSchema,
|
|
124
133
|
DashboardApplicationViolationBreakdownSchema: () => DashboardApplicationViolationBreakdownSchema,
|
|
134
|
+
DashboardApplicationsOverviewItemSchema: () => DashboardApplicationsOverviewItemSchema,
|
|
135
|
+
DashboardApplicationsOverviewSchema: () => DashboardApplicationsOverviewSchema,
|
|
125
136
|
DashboardClient: () => DashboardClient,
|
|
126
137
|
DashboardOverviewResponseSchema: () => DashboardOverviewResponseSchema,
|
|
138
|
+
DashboardPaginationSchema: () => DashboardPaginationSchema,
|
|
127
139
|
DashboardSessionStatsSchema: () => DashboardSessionStatsSchema,
|
|
128
140
|
DataFilteringDetailsSchema: () => DataFilteringDetailsSchema,
|
|
129
141
|
DataFilteringProfileRequestSchema: () => DataFilteringProfileRequestSchema,
|
|
@@ -250,6 +262,7 @@ __export(index_exports, {
|
|
|
250
262
|
LabelValueListSchema: () => LabelValueListSchema,
|
|
251
263
|
LabelsCreateRequestSchema: () => LabelsCreateRequestSchema,
|
|
252
264
|
LabelsResponseSchema: () => LabelsResponseSchema,
|
|
265
|
+
LanguageOptionSchema: () => LanguageOptionSchema,
|
|
253
266
|
ListModelSecurityGroupsResponseSchema: () => ListModelSecurityGroupsResponseSchema,
|
|
254
267
|
ListModelSecurityRuleInstancesResponseSchema: () => ListModelSecurityRuleInstancesResponseSchema,
|
|
255
268
|
ListModelSecurityRulesResponseSchema: () => ListModelSecurityRulesResponseSchema,
|
|
@@ -274,6 +287,7 @@ __export(index_exports, {
|
|
|
274
287
|
MGMT_CLIENT_SECRET: () => MGMT_CLIENT_SECRET,
|
|
275
288
|
MGMT_CUSTOMER_APPS_TSG_PATH: () => MGMT_CUSTOMER_APPS_TSG_PATH,
|
|
276
289
|
MGMT_CUSTOMER_APP_PATH: () => MGMT_CUSTOMER_APP_PATH,
|
|
290
|
+
MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH: () => MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
|
|
277
291
|
MGMT_DASHBOARD_APPLICATION_PATH: () => MGMT_DASHBOARD_APPLICATION_PATH,
|
|
278
292
|
MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH: () => MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH,
|
|
279
293
|
MGMT_DEPLOYMENT_PROFILES_PATH: () => MGMT_DEPLOYMENT_PROFILES_PATH,
|
|
@@ -294,6 +308,8 @@ __export(index_exports, {
|
|
|
294
308
|
MODEL_SEC_DATA_ENDPOINT: () => MODEL_SEC_DATA_ENDPOINT,
|
|
295
309
|
MODEL_SEC_EVALUATIONS_PATH: () => MODEL_SEC_EVALUATIONS_PATH,
|
|
296
310
|
MODEL_SEC_MGMT_ENDPOINT: () => MODEL_SEC_MGMT_ENDPOINT,
|
|
311
|
+
MODEL_SEC_MODELS_PATH: () => MODEL_SEC_MODELS_PATH,
|
|
312
|
+
MODEL_SEC_MODEL_VERSIONS_PATH: () => MODEL_SEC_MODEL_VERSIONS_PATH,
|
|
297
313
|
MODEL_SEC_PYPI_AUTH_PATH: () => MODEL_SEC_PYPI_AUTH_PATH,
|
|
298
314
|
MODEL_SEC_SCANS_PATH: () => MODEL_SEC_SCANS_PATH,
|
|
299
315
|
MODEL_SEC_SECURITY_GROUPS_PATH: () => MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
@@ -310,7 +326,9 @@ __export(index_exports, {
|
|
|
310
326
|
MetadataCriterionSchema: () => MetadataCriterionSchema,
|
|
311
327
|
MetadataSchema: () => MetadataSchema,
|
|
312
328
|
ModelConfigurationSchema: () => ModelConfigurationSchema,
|
|
329
|
+
ModelListSchema: () => ModelListSchema,
|
|
313
330
|
ModelProtectionItemSchema: () => ModelProtectionItemSchema,
|
|
331
|
+
ModelResponseSchema: () => ModelResponseSchema,
|
|
314
332
|
ModelScanIssueSchema: () => ModelScanIssueSchema,
|
|
315
333
|
ModelScanStatus: () => ModelScanStatus,
|
|
316
334
|
ModelSecurityClient: () => ModelSecurityClient,
|
|
@@ -319,12 +337,15 @@ __export(index_exports, {
|
|
|
319
337
|
ModelSecurityGroupState: () => ModelSecurityGroupState,
|
|
320
338
|
ModelSecurityGroupUpdateRequestSchema: () => ModelSecurityGroupUpdateRequestSchema,
|
|
321
339
|
ModelSecurityGroupsClient: () => ModelSecurityGroupsClient,
|
|
340
|
+
ModelSecurityModelsClient: () => ModelSecurityModelsClient,
|
|
322
341
|
ModelSecurityPaginationSchema: () => ModelSecurityPaginationSchema,
|
|
323
342
|
ModelSecurityRuleInstanceResponseSchema: () => ModelSecurityRuleInstanceResponseSchema,
|
|
324
343
|
ModelSecurityRuleInstanceUpdateRequestSchema: () => ModelSecurityRuleInstanceUpdateRequestSchema,
|
|
325
344
|
ModelSecurityRuleResponseSchema: () => ModelSecurityRuleResponseSchema,
|
|
326
345
|
ModelSecurityRulesClient: () => ModelSecurityRulesClient,
|
|
327
346
|
ModelSecurityScansClient: () => ModelSecurityScansClient,
|
|
347
|
+
ModelVersionListSchema: () => ModelVersionListSchema,
|
|
348
|
+
ModelVersionResponseSchema: () => ModelVersionResponseSchema,
|
|
328
349
|
MultiProfileDataNodeSchema: () => MultiProfileDataNodeSchema,
|
|
329
350
|
MultiProfileDetectionRuleSchema: () => MultiProfileDetectionRuleSchema,
|
|
330
351
|
MultiTurnStatefulConfigSchema: () => MultiTurnStatefulConfigSchema,
|
|
@@ -369,6 +390,8 @@ __export(index_exports, {
|
|
|
369
390
|
QuotaDetailsSchema: () => QuotaDetailsSchema,
|
|
370
391
|
QuotaSummarySchema: () => QuotaSummarySchema,
|
|
371
392
|
RED_TEAM_CATEGORIES_PATH: () => RED_TEAM_CATEGORIES_PATH,
|
|
393
|
+
RED_TEAM_CHANNELS_PATH: () => RED_TEAM_CHANNELS_PATH,
|
|
394
|
+
RED_TEAM_CHANNELS_STATS_PATH: () => RED_TEAM_CHANNELS_STATS_PATH,
|
|
372
395
|
RED_TEAM_CLIENT_ID: () => RED_TEAM_CLIENT_ID,
|
|
373
396
|
RED_TEAM_CLIENT_SECRET: () => RED_TEAM_CLIENT_SECRET,
|
|
374
397
|
RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH: () => RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH,
|
|
@@ -376,10 +399,13 @@ __export(index_exports, {
|
|
|
376
399
|
RED_TEAM_DASHBOARD_PATH: () => RED_TEAM_DASHBOARD_PATH,
|
|
377
400
|
RED_TEAM_DATA_ENDPOINT: () => RED_TEAM_DATA_ENDPOINT,
|
|
378
401
|
RED_TEAM_ERROR_LOG_PATH: () => RED_TEAM_ERROR_LOG_PATH,
|
|
402
|
+
RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH: () => RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH,
|
|
379
403
|
RED_TEAM_EULA_PATH: () => RED_TEAM_EULA_PATH,
|
|
380
404
|
RED_TEAM_INSTANCES_PATH: () => RED_TEAM_INSTANCES_PATH,
|
|
405
|
+
RED_TEAM_LANGUAGES_PATH: () => RED_TEAM_LANGUAGES_PATH,
|
|
381
406
|
RED_TEAM_MGMT_DASHBOARD_PATH: () => RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
382
407
|
RED_TEAM_MGMT_ENDPOINT: () => RED_TEAM_MGMT_ENDPOINT,
|
|
408
|
+
RED_TEAM_NETWORK_BROKER_ENDPOINT: () => RED_TEAM_NETWORK_BROKER_ENDPOINT,
|
|
383
409
|
RED_TEAM_QUOTA_PATH: () => RED_TEAM_QUOTA_PATH,
|
|
384
410
|
RED_TEAM_REGISTRY_CREDENTIALS_PATH: () => RED_TEAM_REGISTRY_CREDENTIALS_PATH,
|
|
385
411
|
RED_TEAM_REPORT_DYNAMIC_PATH: () => RED_TEAM_REPORT_DYNAMIC_PATH,
|
|
@@ -399,6 +425,7 @@ __export(index_exports, {
|
|
|
399
425
|
RedTeamErrorType: () => RedTeamErrorType,
|
|
400
426
|
RedTeamEulaClient: () => RedTeamEulaClient,
|
|
401
427
|
RedTeamInstancesClient: () => RedTeamInstancesClient,
|
|
428
|
+
RedTeamNetworkBrokerClient: () => RedTeamNetworkBrokerClient,
|
|
402
429
|
RedTeamPaginationSchema: () => RedTeamPaginationSchema,
|
|
403
430
|
RedTeamReportsClient: () => RedTeamReportsClient,
|
|
404
431
|
RedTeamScansClient: () => RedTeamScansClient,
|
|
@@ -501,6 +528,7 @@ __export(index_exports, {
|
|
|
501
528
|
TargetType: () => TargetType,
|
|
502
529
|
TargetUpdateRequestSchema: () => TargetUpdateRequestSchema,
|
|
503
530
|
TcReportSchema: () => TcReportSchema,
|
|
531
|
+
TenantLanguagesResponseSchema: () => TenantLanguagesResponseSchema,
|
|
504
532
|
TgReportSchema: () => TgReportSchema,
|
|
505
533
|
ThreatCategory: () => ThreatCategory,
|
|
506
534
|
ThreatScanReportSchema: () => ThreatScanReportSchema,
|
|
@@ -516,11 +544,13 @@ __export(index_exports, {
|
|
|
516
544
|
TopicsClient: () => TopicsClient,
|
|
517
545
|
URLExclusionSchema: () => URLExclusionSchema,
|
|
518
546
|
USER_AGENT: () => USER_AGENT,
|
|
547
|
+
UpdateChannelRequestSchema: () => UpdateChannelRequestSchema,
|
|
519
548
|
UrlCategorySchema: () => UrlCategorySchema,
|
|
520
549
|
UrlfEntrySchema: () => UrlfEntrySchema,
|
|
521
550
|
ValidationErrorSchema: () => ValidationErrorSchema,
|
|
522
551
|
Verdict: () => Verdict,
|
|
523
552
|
ViolationListSchema: () => ViolationListSchema,
|
|
553
|
+
ViolationRemediationSchema: () => ViolationRemediationSchema,
|
|
524
554
|
ViolationResponseSchema: () => ViolationResponseSchema,
|
|
525
555
|
ViolationSeverityCountsSchema: () => ViolationSeverityCountsSchema,
|
|
526
556
|
WebSocketConnectionParamsSchema: () => WebSocketConnectionParamsSchema,
|
|
@@ -563,7 +593,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
563
593
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
564
594
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
565
595
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
566
|
-
var SDK_VERSION = "0.
|
|
596
|
+
var SDK_VERSION = "0.13.0";
|
|
567
597
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
568
598
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
569
599
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -592,6 +622,7 @@ var MGMT_OAUTH_INVALIDATE_PATH = "/v1/mgmt/oauth/invalidateToken";
|
|
|
592
622
|
var MGMT_OAUTH_TOKEN_PATH = "/v1/mgmt/oauth/client_credential/accesstoken";
|
|
593
623
|
var MGMT_DASHBOARD_APPLICATION_PATH = "/v1/mgmt/dashboard/v2/apps/application";
|
|
594
624
|
var MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH = "/v1/mgmt/dashboard/v2/apps/applicationviolationbreakdown";
|
|
625
|
+
var MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH = "/v1/mgmt/dashboard/v2/apps/applicationsoverview";
|
|
595
626
|
var DEFAULT_DLP_ENDPOINT = "https://api.dlp.paloaltonetworks.com";
|
|
596
627
|
var DLP_DATA_FILTERING_PROFILES_PATH = "/v2/api/data-filtering-profiles";
|
|
597
628
|
var DLP_DATA_PATTERNS_PATH = "/v2/api/data-patterns";
|
|
@@ -608,17 +639,21 @@ var MODEL_SEC_TOKEN_ENDPOINT = "PANW_MODEL_SEC_TOKEN_ENDPOINT";
|
|
|
608
639
|
var MODEL_SEC_SCANS_PATH = "/v1/scans";
|
|
609
640
|
var MODEL_SEC_EVALUATIONS_PATH = "/v1/evaluations";
|
|
610
641
|
var MODEL_SEC_VIOLATIONS_PATH = "/v1/violations";
|
|
642
|
+
var MODEL_SEC_MODELS_PATH = "/v1/models";
|
|
643
|
+
var MODEL_SEC_MODEL_VERSIONS_PATH = "/v1/model-versions";
|
|
611
644
|
var MODEL_SEC_SECURITY_GROUPS_PATH = "/v1/security-groups";
|
|
612
645
|
var MODEL_SEC_SECURITY_RULES_PATH = "/v1/security-rules";
|
|
613
646
|
var MODEL_SEC_PYPI_AUTH_PATH = "/v1/pypi/authenticate";
|
|
614
647
|
var DEFAULT_RED_TEAM_DATA_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/data-plane";
|
|
615
648
|
var DEFAULT_RED_TEAM_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/mgmt-plane";
|
|
649
|
+
var DEFAULT_RED_TEAM_NETWORK_BROKER_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/data-plane/network-broker";
|
|
616
650
|
var RED_TEAM_CLIENT_ID = "PANW_RED_TEAM_CLIENT_ID";
|
|
617
651
|
var RED_TEAM_CLIENT_SECRET = "PANW_RED_TEAM_CLIENT_SECRET";
|
|
618
652
|
var RED_TEAM_TSG_ID = "PANW_RED_TEAM_TSG_ID";
|
|
619
653
|
var RED_TEAM_DATA_ENDPOINT = "PANW_RED_TEAM_DATA_ENDPOINT";
|
|
620
654
|
var RED_TEAM_MGMT_ENDPOINT = "PANW_RED_TEAM_MGMT_ENDPOINT";
|
|
621
655
|
var RED_TEAM_TOKEN_ENDPOINT = "PANW_RED_TEAM_TOKEN_ENDPOINT";
|
|
656
|
+
var RED_TEAM_NETWORK_BROKER_ENDPOINT = "PANW_RED_TEAM_NETWORK_BROKER_ENDPOINT";
|
|
622
657
|
var RED_TEAM_SCAN_PATH = "/v1/scan";
|
|
623
658
|
var RED_TEAM_CATEGORIES_PATH = "/v1/categories";
|
|
624
659
|
var RED_TEAM_REPORT_STATIC_PATH = "/v1/report/static";
|
|
@@ -629,6 +664,8 @@ var RED_TEAM_DASHBOARD_PATH = "/v1/dashboard";
|
|
|
629
664
|
var RED_TEAM_QUOTA_PATH = "/v1/metering/quota";
|
|
630
665
|
var RED_TEAM_ERROR_LOG_PATH = "/v1/error-log/job";
|
|
631
666
|
var RED_TEAM_SENTIMENT_PATH = "/v1/sentiment";
|
|
667
|
+
var RED_TEAM_LANGUAGES_PATH = "/v1/languages";
|
|
668
|
+
var RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH = "/v1/error-log/target-profile";
|
|
632
669
|
var RED_TEAM_TARGET_PATH = "/v1/target";
|
|
633
670
|
var RED_TEAM_TARGET_VALIDATE_AUTH_PATH = "/v1/target/validate-auth";
|
|
634
671
|
var RED_TEAM_TEMPLATE_PATH = "/v1/template";
|
|
@@ -637,6 +674,8 @@ var RED_TEAM_INSTANCES_PATH = "/v1/instances";
|
|
|
637
674
|
var RED_TEAM_REGISTRY_CREDENTIALS_PATH = "/v1/registry-credentials";
|
|
638
675
|
var RED_TEAM_CUSTOM_ATTACK_PATH = "/v1/custom-attack";
|
|
639
676
|
var RED_TEAM_MGMT_DASHBOARD_PATH = "/v1/dashboard/overview";
|
|
677
|
+
var RED_TEAM_CHANNELS_PATH = "/v1/channels";
|
|
678
|
+
var RED_TEAM_CHANNELS_STATS_PATH = "/v1/channels/stats";
|
|
640
679
|
|
|
641
680
|
// src/errors.ts
|
|
642
681
|
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
@@ -841,9 +880,38 @@ async function executeWithRetry(opts) {
|
|
|
841
880
|
);
|
|
842
881
|
}
|
|
843
882
|
|
|
883
|
+
// src/http/debug.ts
|
|
884
|
+
var import_node_crypto2 = require("crypto");
|
|
885
|
+
var TRUTHY = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
886
|
+
var SENSITIVE_HEADERS = /* @__PURE__ */ new Set([HEADER_AUTH_TOKEN.toLowerCase(), HEADER_API_KEY.toLowerCase()]);
|
|
887
|
+
var PREFIX = "[airs-sdk]";
|
|
888
|
+
function isDebugEnabled() {
|
|
889
|
+
const raw = process.env.PANW_AI_SEC_DEBUG;
|
|
890
|
+
return raw !== void 0 && TRUTHY.has(raw.trim().toLowerCase());
|
|
891
|
+
}
|
|
892
|
+
function hashToken(value) {
|
|
893
|
+
return "sha256:" + (0, import_node_crypto2.createHash)("sha256").update(value).digest("hex").slice(0, 12);
|
|
894
|
+
}
|
|
895
|
+
function sanitizeHeaders(headers) {
|
|
896
|
+
const out = {};
|
|
897
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
898
|
+
out[key] = SENSITIVE_HEADERS.has(key.toLowerCase()) ? hashToken(value) : value;
|
|
899
|
+
}
|
|
900
|
+
return out;
|
|
901
|
+
}
|
|
902
|
+
function logRequest(method, url, headers, body) {
|
|
903
|
+
console.error(`${PREFIX} \u2192 ${method} ${url}`);
|
|
904
|
+
console.error(`${PREFIX} headers ${JSON.stringify(sanitizeHeaders(headers))}`);
|
|
905
|
+
if (body !== void 0) console.error(`${PREFIX} body ${body}`);
|
|
906
|
+
}
|
|
907
|
+
function logResponse(status, ms, body) {
|
|
908
|
+
console.error(`${PREFIX} \u2190 ${status} (${ms}ms)${body !== void 0 ? ` ${body}` : ""}`);
|
|
909
|
+
}
|
|
910
|
+
|
|
844
911
|
// src/http/request.ts
|
|
845
912
|
async function request(spec) {
|
|
846
913
|
let hasRetriedAuth = false;
|
|
914
|
+
const debug = isDebugEnabled();
|
|
847
915
|
const response = await executeWithRetry({
|
|
848
916
|
maxRetries: spec.numRetries,
|
|
849
917
|
execute: async () => {
|
|
@@ -873,11 +941,25 @@ async function request(spec) {
|
|
|
873
941
|
}
|
|
874
942
|
const prepared = { method: spec.method, url, headers, bodyText };
|
|
875
943
|
const final = await spec.auth.prepare(prepared);
|
|
876
|
-
|
|
944
|
+
const startedAt = debug ? Date.now() : 0;
|
|
945
|
+
if (debug) {
|
|
946
|
+
const logBody = spec.formData !== void 0 ? "[multipart/form-data]" : final.bodyText;
|
|
947
|
+
logRequest(final.method, final.url.toString(), final.headers, logBody);
|
|
948
|
+
}
|
|
949
|
+
const res = await fetch(final.url.toString(), {
|
|
877
950
|
method: final.method,
|
|
878
951
|
headers: final.headers,
|
|
879
952
|
body: spec.formData !== void 0 ? bodyForFetch : final.bodyText
|
|
880
953
|
});
|
|
954
|
+
if (debug) {
|
|
955
|
+
let respBody;
|
|
956
|
+
try {
|
|
957
|
+
respBody = await res.clone().text();
|
|
958
|
+
} catch {
|
|
959
|
+
}
|
|
960
|
+
logResponse(res.status, Date.now() - startedAt, respBody);
|
|
961
|
+
}
|
|
962
|
+
return res;
|
|
881
963
|
},
|
|
882
964
|
onRetryableFailure: async (res) => {
|
|
883
965
|
if (hasRetriedAuth) return false;
|
|
@@ -2044,6 +2126,31 @@ var DashboardApplicationViolationBreakdownSchema = import_zod21.z.object({
|
|
|
2044
2126
|
detection_type_violation_breakdown: import_zod21.z.array(DetectorViolationBreakdownEntrySchema).optional(),
|
|
2045
2127
|
total_violating: import_zod21.z.number().optional()
|
|
2046
2128
|
}).passthrough();
|
|
2129
|
+
var DashboardApplicationSessionsBucketSchema = import_zod21.z.object({
|
|
2130
|
+
bucket_number: import_zod21.z.number().optional(),
|
|
2131
|
+
date: import_zod21.z.string().nullable().optional(),
|
|
2132
|
+
total: import_zod21.z.number().optional(),
|
|
2133
|
+
violated: import_zod21.z.number().optional()
|
|
2134
|
+
}).passthrough();
|
|
2135
|
+
var DashboardApplicationsOverviewItemSchema = import_zod21.z.object({
|
|
2136
|
+
id: import_zod21.z.string().nullable().optional(),
|
|
2137
|
+
name: import_zod21.z.string().nullable().optional(),
|
|
2138
|
+
cloud: import_zod21.z.string().nullable().optional(),
|
|
2139
|
+
source: import_zod21.z.string().nullable().optional(),
|
|
2140
|
+
created_at: import_zod21.z.string().nullable().optional(),
|
|
2141
|
+
sessions: import_zod21.z.array(DashboardApplicationSessionsBucketSchema).nullable().optional(),
|
|
2142
|
+
sessions_total: import_zod21.z.number().nullable().optional(),
|
|
2143
|
+
sessions_violated: import_zod21.z.number().nullable().optional()
|
|
2144
|
+
}).passthrough();
|
|
2145
|
+
var DashboardPaginationSchema = import_zod21.z.object({
|
|
2146
|
+
limit: import_zod21.z.number().optional(),
|
|
2147
|
+
skip: import_zod21.z.number().optional(),
|
|
2148
|
+
total_items: import_zod21.z.number().optional()
|
|
2149
|
+
}).passthrough();
|
|
2150
|
+
var DashboardApplicationsOverviewSchema = import_zod21.z.object({
|
|
2151
|
+
items: import_zod21.z.array(DashboardApplicationsOverviewItemSchema).optional(),
|
|
2152
|
+
pagination: DashboardPaginationSchema.optional()
|
|
2153
|
+
}).passthrough();
|
|
2047
2154
|
|
|
2048
2155
|
// src/models/mgmt-deployment-profile.ts
|
|
2049
2156
|
var import_zod22 = require("zod");
|
|
@@ -2814,7 +2921,8 @@ var ScanDetailsSchema = import_zod32.z.object({
|
|
|
2814
2921
|
var ScanCreateRequestSchema = import_zod32.z.object({
|
|
2815
2922
|
model_uri: import_zod32.z.string(),
|
|
2816
2923
|
security_group_uuid: import_zod32.z.string(),
|
|
2817
|
-
|
|
2924
|
+
// Optional per the OpenAPI spec (server defaults it); the scans-client example still sets it.
|
|
2925
|
+
scan_origin: import_zod32.z.string().optional(),
|
|
2818
2926
|
allow_patterns: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
2819
2927
|
ignore_patterns: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
2820
2928
|
labels: import_zod32.z.array(LabelSchema).nullable().optional(),
|
|
@@ -2833,7 +2941,8 @@ var ScanBaseResponseSchema = import_zod32.z.object({
|
|
|
2833
2941
|
scan_origin: import_zod32.z.string(),
|
|
2834
2942
|
security_group_uuid: import_zod32.z.string(),
|
|
2835
2943
|
security_group_name: import_zod32.z.string(),
|
|
2836
|
-
|
|
2944
|
+
// Optional per the OpenAPI spec — a scan may not have a resolved model version yet.
|
|
2945
|
+
model_version_uuid: import_zod32.z.string().nullable().optional(),
|
|
2837
2946
|
eval_outcome: import_zod32.z.string(),
|
|
2838
2947
|
source_type: import_zod32.z.string(),
|
|
2839
2948
|
created_by: import_zod32.z.string().nullable().optional(),
|
|
@@ -2870,6 +2979,50 @@ var FileListSchema = import_zod32.z.object({
|
|
|
2870
2979
|
pagination: ModelSecurityPaginationSchema,
|
|
2871
2980
|
files: import_zod32.z.array(FileResponseSchema)
|
|
2872
2981
|
}).passthrough();
|
|
2982
|
+
var ModelResponseSchema = import_zod32.z.object({
|
|
2983
|
+
uuid: import_zod32.z.string(),
|
|
2984
|
+
tsg_id: import_zod32.z.string(),
|
|
2985
|
+
created_at: import_zod32.z.string(),
|
|
2986
|
+
updated_at: import_zod32.z.string(),
|
|
2987
|
+
name: import_zod32.z.string(),
|
|
2988
|
+
latest_version_uuid: import_zod32.z.string().nullable().optional(),
|
|
2989
|
+
latest_version_fingerprint: import_zod32.z.string().nullable().optional(),
|
|
2990
|
+
latest_version_revision: import_zod32.z.string().nullable().optional(),
|
|
2991
|
+
latest_version_hf_commit_sha: import_zod32.z.string().nullable().optional(),
|
|
2992
|
+
latest_version_outcome: import_zod32.z.string().nullable().optional(),
|
|
2993
|
+
latest_version_formats: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
2994
|
+
latest_version_source_types: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
2995
|
+
latest_version_scan_time: import_zod32.z.string().nullable().optional()
|
|
2996
|
+
}).passthrough();
|
|
2997
|
+
var ModelListSchema = import_zod32.z.object({
|
|
2998
|
+
pagination: ModelSecurityPaginationSchema,
|
|
2999
|
+
models: import_zod32.z.array(ModelResponseSchema)
|
|
3000
|
+
}).passthrough();
|
|
3001
|
+
var ModelVersionResponseSchema = import_zod32.z.object({
|
|
3002
|
+
uuid: import_zod32.z.string(),
|
|
3003
|
+
tsg_id: import_zod32.z.string(),
|
|
3004
|
+
created_at: import_zod32.z.string(),
|
|
3005
|
+
updated_at: import_zod32.z.string(),
|
|
3006
|
+
revision: import_zod32.z.string(),
|
|
3007
|
+
model_uuid: import_zod32.z.string(),
|
|
3008
|
+
fingerprint: import_zod32.z.string().nullable().optional(),
|
|
3009
|
+
file_count: import_zod32.z.number().int().nullable().optional(),
|
|
3010
|
+
license: import_zod32.z.string().nullable().optional(),
|
|
3011
|
+
latest_scan_time: import_zod32.z.string().nullable().optional(),
|
|
3012
|
+
hf_commit_sha: import_zod32.z.string().nullable().optional(),
|
|
3013
|
+
hf_commit_title: import_zod32.z.string().nullable().optional(),
|
|
3014
|
+
hf_commit_authors: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
3015
|
+
hf_model_name: import_zod32.z.string().nullable().optional(),
|
|
3016
|
+
hf_organization: import_zod32.z.string().nullable().optional(),
|
|
3017
|
+
model_formats: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
3018
|
+
source_types: import_zod32.z.array(import_zod32.z.string()).nullable().optional(),
|
|
3019
|
+
last_eval_outcome: import_zod32.z.string().nullable().optional(),
|
|
3020
|
+
last_eval_summary: EvalSummarySchema.nullable().optional()
|
|
3021
|
+
}).passthrough();
|
|
3022
|
+
var ModelVersionListSchema = import_zod32.z.object({
|
|
3023
|
+
pagination: ModelSecurityPaginationSchema,
|
|
3024
|
+
model_versions: import_zod32.z.array(ModelVersionResponseSchema)
|
|
3025
|
+
}).passthrough();
|
|
2873
3026
|
var RuleEvaluationResponseSchema = import_zod32.z.object({
|
|
2874
3027
|
uuid: import_zod32.z.string(),
|
|
2875
3028
|
tsg_id: import_zod32.z.string(),
|
|
@@ -2887,6 +3040,10 @@ var RuleEvaluationListSchema = import_zod32.z.object({
|
|
|
2887
3040
|
pagination: ModelSecurityPaginationSchema,
|
|
2888
3041
|
evaluations: import_zod32.z.array(RuleEvaluationResponseSchema)
|
|
2889
3042
|
}).passthrough();
|
|
3043
|
+
var ViolationRemediationSchema = import_zod32.z.object({
|
|
3044
|
+
steps: import_zod32.z.array(import_zod32.z.string()),
|
|
3045
|
+
url: import_zod32.z.string()
|
|
3046
|
+
}).passthrough();
|
|
2890
3047
|
var ViolationResponseSchema = import_zod32.z.object({
|
|
2891
3048
|
uuid: import_zod32.z.string(),
|
|
2892
3049
|
tsg_id: import_zod32.z.string(),
|
|
@@ -2897,6 +3054,7 @@ var ViolationResponseSchema = import_zod32.z.object({
|
|
|
2897
3054
|
rule_name: import_zod32.z.string(),
|
|
2898
3055
|
rule_description: import_zod32.z.string(),
|
|
2899
3056
|
rule_instance_state: import_zod32.z.string(),
|
|
3057
|
+
remediation: ViolationRemediationSchema,
|
|
2900
3058
|
file: import_zod32.z.string().nullable().optional(),
|
|
2901
3059
|
hash: import_zod32.z.string().nullable().optional(),
|
|
2902
3060
|
module: import_zod32.z.string().nullable().optional(),
|
|
@@ -3032,6 +3190,11 @@ var BrandSubCategory = {
|
|
|
3032
3190
|
DISCRIMINATING_CLAIMS: "DISCRIMINATING_CLAIMS",
|
|
3033
3191
|
POLITICAL_ENDORSEMENTS: "POLITICAL_ENDORSEMENTS"
|
|
3034
3192
|
};
|
|
3193
|
+
var ChannelStatus = {
|
|
3194
|
+
ONLINE: "ONLINE",
|
|
3195
|
+
OFFLINE: "OFFLINE",
|
|
3196
|
+
DRAFT: "DRAFT"
|
|
3197
|
+
};
|
|
3035
3198
|
var ComplianceSubCategory = {
|
|
3036
3199
|
OWASP: "OWASP",
|
|
3037
3200
|
MITRE_ATLAS: "MITRE_ATLAS",
|
|
@@ -3855,6 +4018,12 @@ var ErrorLogSchema = import_zod33.z.object({
|
|
|
3855
4018
|
version: import_zod33.z.number().int().optional()
|
|
3856
4019
|
}).passthrough();
|
|
3857
4020
|
var ErrorLogListResponseSchema = import_zod33.z.object({ pagination: RedTeamPaginationSchema, data: import_zod33.z.array(ErrorLogSchema) }).passthrough();
|
|
4021
|
+
var LanguageOptionSchema = import_zod33.z.object({ code: import_zod33.z.string(), name: import_zod33.z.string() }).passthrough();
|
|
4022
|
+
var TenantLanguagesResponseSchema = import_zod33.z.object({
|
|
4023
|
+
multilingual_enabled: import_zod33.z.boolean(),
|
|
4024
|
+
supported_job_types: import_zod33.z.array(import_zod33.z.string()),
|
|
4025
|
+
languages: import_zod33.z.array(LanguageOptionSchema)
|
|
4026
|
+
}).passthrough();
|
|
3858
4027
|
var TargetRequestBaseFields = {
|
|
3859
4028
|
name: import_zod33.z.string(),
|
|
3860
4029
|
description: import_zod33.z.string().nullable().optional(),
|
|
@@ -4209,6 +4378,48 @@ var RegistryCredentialsSchema = import_zod33.z.object({
|
|
|
4209
4378
|
expiry: import_zod33.z.string()
|
|
4210
4379
|
}).passthrough();
|
|
4211
4380
|
|
|
4381
|
+
// src/models/red-team-network-broker.ts
|
|
4382
|
+
var import_zod34 = require("zod");
|
|
4383
|
+
var ChannelStatusSchema = import_zod34.z.nativeEnum(ChannelStatus);
|
|
4384
|
+
var CreateChannelRequestSchema = import_zod34.z.object({
|
|
4385
|
+
name: import_zod34.z.string(),
|
|
4386
|
+
description: import_zod34.z.string().optional()
|
|
4387
|
+
}).passthrough();
|
|
4388
|
+
var UpdateChannelRequestSchema = import_zod34.z.object({
|
|
4389
|
+
name: import_zod34.z.string().optional(),
|
|
4390
|
+
description: import_zod34.z.string().optional()
|
|
4391
|
+
}).passthrough();
|
|
4392
|
+
var ChannelSchema = import_zod34.z.object({
|
|
4393
|
+
uuid: import_zod34.z.string().optional(),
|
|
4394
|
+
name: import_zod34.z.string().nullable().optional(),
|
|
4395
|
+
description: import_zod34.z.string().nullable().optional(),
|
|
4396
|
+
// Kept as a plain string (not the enum) so unknown upstream statuses never fail parsing.
|
|
4397
|
+
status: import_zod34.z.string().nullable().optional(),
|
|
4398
|
+
added_by: import_zod34.z.string().nullable().optional(),
|
|
4399
|
+
created_at: import_zod34.z.string().nullable().optional(),
|
|
4400
|
+
updated_at: import_zod34.z.string().nullable().optional(),
|
|
4401
|
+
last_online_at: import_zod34.z.string().nullable().optional(),
|
|
4402
|
+
// Present on live responses (not in the base OpenAPI Channel schema).
|
|
4403
|
+
connected_clients_count: import_zod34.z.number().int().nullable().optional(),
|
|
4404
|
+
outdated_clients_count: import_zod34.z.number().int().nullable().optional(),
|
|
4405
|
+
features: import_zod34.z.record(import_zod34.z.boolean()).nullable().optional()
|
|
4406
|
+
}).passthrough();
|
|
4407
|
+
var ChannelListPaginationSchema = import_zod34.z.object({ total_items: import_zod34.z.number().int().nullable().optional() }).passthrough();
|
|
4408
|
+
var ChannelListResponseSchema = import_zod34.z.object({
|
|
4409
|
+
pagination: ChannelListPaginationSchema.optional(),
|
|
4410
|
+
data: import_zod34.z.array(ChannelSchema).default([])
|
|
4411
|
+
}).passthrough();
|
|
4412
|
+
var ChannelStatsSchema = import_zod34.z.object({
|
|
4413
|
+
network_channels_server_domain: import_zod34.z.string().nullable().optional(),
|
|
4414
|
+
docker_registry: import_zod34.z.string().nullable().optional(),
|
|
4415
|
+
helm_chart: import_zod34.z.string().nullable().optional(),
|
|
4416
|
+
docker_image: import_zod34.z.string().nullable().optional(),
|
|
4417
|
+
online_channels: import_zod34.z.number().int().nullable().optional(),
|
|
4418
|
+
total_channels: import_zod34.z.number().int().nullable().optional(),
|
|
4419
|
+
// Present on live responses (not in the base OpenAPI ChannelStats schema).
|
|
4420
|
+
client_version: import_zod34.z.string().nullable().optional()
|
|
4421
|
+
}).passthrough();
|
|
4422
|
+
|
|
4212
4423
|
// src/http/auth/oauth.ts
|
|
4213
4424
|
var OAuthAuth = class {
|
|
4214
4425
|
constructor(oauthClient) {
|
|
@@ -4231,12 +4442,12 @@ var OAuthAuth = class {
|
|
|
4231
4442
|
};
|
|
4232
4443
|
|
|
4233
4444
|
// src/models/oauth-token.ts
|
|
4234
|
-
var
|
|
4235
|
-
var OAuthTokenResponseSchema =
|
|
4236
|
-
access_token:
|
|
4237
|
-
token_type:
|
|
4238
|
-
expires_in:
|
|
4239
|
-
scope:
|
|
4445
|
+
var import_zod35 = require("zod");
|
|
4446
|
+
var OAuthTokenResponseSchema = import_zod35.z.object({
|
|
4447
|
+
access_token: import_zod35.z.string(),
|
|
4448
|
+
token_type: import_zod35.z.string().optional(),
|
|
4449
|
+
expires_in: import_zod35.z.number(),
|
|
4450
|
+
scope: import_zod35.z.string().optional()
|
|
4240
4451
|
}).passthrough();
|
|
4241
4452
|
|
|
4242
4453
|
// src/management/oauth-client.ts
|
|
@@ -5027,7 +5238,7 @@ var CustomerAppsClient = class {
|
|
|
5027
5238
|
return request({
|
|
5028
5239
|
method: "GET",
|
|
5029
5240
|
baseUrl: this.baseUrl,
|
|
5030
|
-
path: `${MGMT_CUSTOMER_APPS_TSG_PATH}/${this.tsgId}`,
|
|
5241
|
+
path: `${MGMT_CUSTOMER_APPS_TSG_PATH}/${encodeURIComponent(this.tsgId)}`,
|
|
5031
5242
|
params,
|
|
5032
5243
|
responseSchema: CustomerAppListResponseSchema,
|
|
5033
5244
|
auth: this.auth,
|
|
@@ -5221,7 +5432,7 @@ var ScanLogsClient = class {
|
|
|
5221
5432
|
};
|
|
5222
5433
|
|
|
5223
5434
|
// src/management/oauth-management.ts
|
|
5224
|
-
var
|
|
5435
|
+
var import_zod36 = require("zod");
|
|
5225
5436
|
var OAuthManagementClient = class {
|
|
5226
5437
|
baseUrl;
|
|
5227
5438
|
auth;
|
|
@@ -5255,7 +5466,7 @@ var OAuthManagementClient = class {
|
|
|
5255
5466
|
path: MGMT_OAUTH_INVALIDATE_PATH,
|
|
5256
5467
|
params: { token },
|
|
5257
5468
|
body,
|
|
5258
|
-
responseSchema:
|
|
5469
|
+
responseSchema: import_zod36.z.string(),
|
|
5259
5470
|
auth: this.auth,
|
|
5260
5471
|
numRetries: this.numRetries
|
|
5261
5472
|
});
|
|
@@ -5389,6 +5600,53 @@ var DashboardClient = class {
|
|
|
5389
5600
|
numRetries: this.numRetries
|
|
5390
5601
|
});
|
|
5391
5602
|
}
|
|
5603
|
+
/**
|
|
5604
|
+
* Enumerate all dashboard application buckets the tenant has data for.
|
|
5605
|
+
*
|
|
5606
|
+
* This is the canonical apps-list source for the dashboard. The customer-apps endpoint
|
|
5607
|
+
* (`mgmt.customerApps.list`) lists registered customer applications, but each registered
|
|
5608
|
+
* customer-app can have **multiple dashboard buckets** when its API key is used to send scan
|
|
5609
|
+
* requests carrying different `metadata.app_name` values - one bucket per distinct
|
|
5610
|
+
* scan-payload name. This endpoint returns every bucket, so it is what you want for
|
|
5611
|
+
* per-app token-consumption reporting and dashboard inventory.
|
|
5612
|
+
*
|
|
5613
|
+
* The `id` field on each item is the registered `customer_appId` UUID; the `name` field is
|
|
5614
|
+
* the scan-payload value. Pass that `(id, name)` pair to {@link application} or
|
|
5615
|
+
* {@link applicationViolationBreakdown} to retrieve drill-down data for a specific bucket.
|
|
5616
|
+
*
|
|
5617
|
+
* @param query - Time window and pagination.
|
|
5618
|
+
* @returns Paginated bucket list plus pagination metadata.
|
|
5619
|
+
* @example
|
|
5620
|
+
* ```ts
|
|
5621
|
+
* import { ManagementClient } from '@cdot65/prisma-airs-sdk';
|
|
5622
|
+
* const mgmt = new ManagementClient();
|
|
5623
|
+
*
|
|
5624
|
+
* const { items } = await mgmt.dashboard.applicationsOverview();
|
|
5625
|
+
* for (const item of items ?? []) {
|
|
5626
|
+
* const overview = await mgmt.dashboard.application({
|
|
5627
|
+
* appId: item.id ?? '',
|
|
5628
|
+
* appName: item.name ?? '',
|
|
5629
|
+
* });
|
|
5630
|
+
* console.log(item.name, overview.token_stats?.monthly_total_tokens);
|
|
5631
|
+
* }
|
|
5632
|
+
* ```
|
|
5633
|
+
*/
|
|
5634
|
+
async applicationsOverview(query) {
|
|
5635
|
+
return request({
|
|
5636
|
+
method: "GET",
|
|
5637
|
+
baseUrl: this.baseUrl,
|
|
5638
|
+
path: MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
|
|
5639
|
+
params: {
|
|
5640
|
+
time_interval: String(query?.timeInterval ?? 30),
|
|
5641
|
+
time_unit: query?.timeUnit ?? "days",
|
|
5642
|
+
limit: String(query?.limit ?? 25),
|
|
5643
|
+
offset: String(query?.offset ?? 0)
|
|
5644
|
+
},
|
|
5645
|
+
responseSchema: DashboardApplicationsOverviewSchema,
|
|
5646
|
+
auth: this.auth,
|
|
5647
|
+
numRetries: this.numRetries
|
|
5648
|
+
});
|
|
5649
|
+
}
|
|
5392
5650
|
};
|
|
5393
5651
|
|
|
5394
5652
|
// src/management/dlp/data-filtering-profiles.ts
|
|
@@ -6836,6 +7094,170 @@ var ModelSecurityRulesClient = class {
|
|
|
6836
7094
|
}
|
|
6837
7095
|
};
|
|
6838
7096
|
|
|
7097
|
+
// src/model-security/models-client.ts
|
|
7098
|
+
function buildModelListParams(opts) {
|
|
7099
|
+
const params = serializeListing(opts);
|
|
7100
|
+
if (opts?.search_query !== void 0) params.search_query = opts.search_query;
|
|
7101
|
+
if (opts?.sort_field !== void 0) params.sort_field = opts.sort_field;
|
|
7102
|
+
if (opts?.sort_order !== void 0) params.sort_order = opts.sort_order;
|
|
7103
|
+
if (opts?.latest_version_outcomes !== void 0)
|
|
7104
|
+
params.latest_version_outcomes = opts.latest_version_outcomes;
|
|
7105
|
+
if (opts?.latest_version_formats !== void 0)
|
|
7106
|
+
params.latest_version_formats = opts.latest_version_formats;
|
|
7107
|
+
if (opts?.latest_version_source_types !== void 0)
|
|
7108
|
+
params.latest_version_source_types = opts.latest_version_source_types;
|
|
7109
|
+
if (opts?.latest_version_scan_time_before !== void 0)
|
|
7110
|
+
params.latest_version_scan_time_before = opts.latest_version_scan_time_before;
|
|
7111
|
+
if (opts?.start_time !== void 0) params.start_time = opts.start_time;
|
|
7112
|
+
if (opts?.end_time !== void 0) params.end_time = opts.end_time;
|
|
7113
|
+
return params;
|
|
7114
|
+
}
|
|
7115
|
+
var ModelSecurityModelsClient = class {
|
|
7116
|
+
baseUrl;
|
|
7117
|
+
auth;
|
|
7118
|
+
numRetries;
|
|
7119
|
+
constructor(opts) {
|
|
7120
|
+
this.baseUrl = opts.baseUrl;
|
|
7121
|
+
this.auth = opts.auth;
|
|
7122
|
+
this.numRetries = opts.numRetries;
|
|
7123
|
+
}
|
|
7124
|
+
/**
|
|
7125
|
+
* List models with optional search, sort, and latest-version filters.
|
|
7126
|
+
* @param opts - Pagination and filter options.
|
|
7127
|
+
* @returns Paginated list of models.
|
|
7128
|
+
* @example
|
|
7129
|
+
* ```ts
|
|
7130
|
+
* import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
|
|
7131
|
+
* const ms = new ModelSecurityClient();
|
|
7132
|
+
*
|
|
7133
|
+
* const models = await ms.models.listModels({ limit: 10, search_query: 'llama' });
|
|
7134
|
+
* // models =>
|
|
7135
|
+
* // { pagination: { total_items: 3 }, models: [{ uuid: '550e8400-...', name: 'org/llama', latest_version_outcome: 'PASSED' }] }
|
|
7136
|
+
* ```
|
|
7137
|
+
*/
|
|
7138
|
+
async listModels(opts) {
|
|
7139
|
+
return request({
|
|
7140
|
+
method: "GET",
|
|
7141
|
+
baseUrl: this.baseUrl,
|
|
7142
|
+
path: MODEL_SEC_MODELS_PATH,
|
|
7143
|
+
params: buildModelListParams(opts),
|
|
7144
|
+
responseSchema: ModelListSchema,
|
|
7145
|
+
auth: this.auth,
|
|
7146
|
+
numRetries: this.numRetries
|
|
7147
|
+
});
|
|
7148
|
+
}
|
|
7149
|
+
/**
|
|
7150
|
+
* Get a single model by UUID.
|
|
7151
|
+
* @param uuid - Model UUID.
|
|
7152
|
+
* @returns The model.
|
|
7153
|
+
* @example
|
|
7154
|
+
* ```ts
|
|
7155
|
+
* import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
|
|
7156
|
+
* const ms = new ModelSecurityClient();
|
|
7157
|
+
*
|
|
7158
|
+
* const model = await ms.models.getModel('550e8400-e29b-41d4-a716-446655440000');
|
|
7159
|
+
* // model =>
|
|
7160
|
+
* // { uuid: '550e8400-...', name: 'org/model', latest_version_uuid: '660e8400-...', latest_version_outcome: 'PASSED' }
|
|
7161
|
+
* ```
|
|
7162
|
+
*/
|
|
7163
|
+
async getModel(uuid) {
|
|
7164
|
+
assertUuid(uuid, "model uuid");
|
|
7165
|
+
return request({
|
|
7166
|
+
method: "GET",
|
|
7167
|
+
baseUrl: this.baseUrl,
|
|
7168
|
+
path: `${MODEL_SEC_MODELS_PATH}/${uuid}`,
|
|
7169
|
+
responseSchema: ModelResponseSchema,
|
|
7170
|
+
auth: this.auth,
|
|
7171
|
+
numRetries: this.numRetries
|
|
7172
|
+
});
|
|
7173
|
+
}
|
|
7174
|
+
/**
|
|
7175
|
+
* List the versions of a model.
|
|
7176
|
+
* @param modelUuid - Model UUID.
|
|
7177
|
+
* @param opts - Pagination and sort options.
|
|
7178
|
+
* @returns Paginated list of model versions.
|
|
7179
|
+
* @example
|
|
7180
|
+
* ```ts
|
|
7181
|
+
* import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
|
|
7182
|
+
* const ms = new ModelSecurityClient();
|
|
7183
|
+
*
|
|
7184
|
+
* const versions = await ms.models.listModelVersions('550e8400-e29b-41d4-a716-446655440000', {
|
|
7185
|
+
* sort_order: 'desc',
|
|
7186
|
+
* });
|
|
7187
|
+
* // versions =>
|
|
7188
|
+
* // { pagination: { total_items: 2 }, model_versions: [{ uuid: '660e8400-...', revision: 'main', file_count: 12 }] }
|
|
7189
|
+
* ```
|
|
7190
|
+
*/
|
|
7191
|
+
async listModelVersions(modelUuid, opts) {
|
|
7192
|
+
assertUuid(modelUuid, "model uuid");
|
|
7193
|
+
const params = serializeListing(opts);
|
|
7194
|
+
if (opts?.sort_order !== void 0) params.sort_order = opts.sort_order;
|
|
7195
|
+
return request({
|
|
7196
|
+
method: "GET",
|
|
7197
|
+
baseUrl: this.baseUrl,
|
|
7198
|
+
path: `${MODEL_SEC_MODELS_PATH}/${modelUuid}/model-versions`,
|
|
7199
|
+
params,
|
|
7200
|
+
responseSchema: ModelVersionListSchema,
|
|
7201
|
+
auth: this.auth,
|
|
7202
|
+
numRetries: this.numRetries
|
|
7203
|
+
});
|
|
7204
|
+
}
|
|
7205
|
+
/**
|
|
7206
|
+
* Get a single model version by UUID.
|
|
7207
|
+
* @param uuid - Model version UUID.
|
|
7208
|
+
* @returns The model version.
|
|
7209
|
+
* @example
|
|
7210
|
+
* ```ts
|
|
7211
|
+
* import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
|
|
7212
|
+
* const ms = new ModelSecurityClient();
|
|
7213
|
+
*
|
|
7214
|
+
* const version = await ms.models.getModelVersion('660e8400-e29b-41d4-a716-446655440000');
|
|
7215
|
+
* // version =>
|
|
7216
|
+
* // { uuid: '660e8400-...', revision: 'main', model_uuid: '550e8400-...', last_eval_outcome: 'PASSED' }
|
|
7217
|
+
* ```
|
|
7218
|
+
*/
|
|
7219
|
+
async getModelVersion(uuid) {
|
|
7220
|
+
assertUuid(uuid, "model version uuid");
|
|
7221
|
+
return request({
|
|
7222
|
+
method: "GET",
|
|
7223
|
+
baseUrl: this.baseUrl,
|
|
7224
|
+
path: `${MODEL_SEC_MODEL_VERSIONS_PATH}/${uuid}`,
|
|
7225
|
+
responseSchema: ModelVersionResponseSchema,
|
|
7226
|
+
auth: this.auth,
|
|
7227
|
+
numRetries: this.numRetries
|
|
7228
|
+
});
|
|
7229
|
+
}
|
|
7230
|
+
/**
|
|
7231
|
+
* List the files of a model version.
|
|
7232
|
+
* @param modelVersionUuid - Model version UUID.
|
|
7233
|
+
* @param opts - Pagination options.
|
|
7234
|
+
* @returns Paginated list of files (same shape as scan files).
|
|
7235
|
+
* @example
|
|
7236
|
+
* ```ts
|
|
7237
|
+
* import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
|
|
7238
|
+
* const ms = new ModelSecurityClient();
|
|
7239
|
+
*
|
|
7240
|
+
* const files = await ms.models.listModelVersionFiles('660e8400-e29b-41d4-a716-446655440000', {
|
|
7241
|
+
* limit: 50,
|
|
7242
|
+
* });
|
|
7243
|
+
* // files =>
|
|
7244
|
+
* // { pagination: { total_items: 12 }, files: [{ uuid: '770e8400-...', path: '/model.safetensors', type: 'FILE', result: 'SUCCESS' }] }
|
|
7245
|
+
* ```
|
|
7246
|
+
*/
|
|
7247
|
+
async listModelVersionFiles(modelVersionUuid, opts) {
|
|
7248
|
+
assertUuid(modelVersionUuid, "model version uuid");
|
|
7249
|
+
return request({
|
|
7250
|
+
method: "GET",
|
|
7251
|
+
baseUrl: this.baseUrl,
|
|
7252
|
+
path: `${MODEL_SEC_MODEL_VERSIONS_PATH}/${modelVersionUuid}/files`,
|
|
7253
|
+
params: serializeListing(opts),
|
|
7254
|
+
responseSchema: FileListSchema,
|
|
7255
|
+
auth: this.auth,
|
|
7256
|
+
numRetries: this.numRetries
|
|
7257
|
+
});
|
|
7258
|
+
}
|
|
7259
|
+
};
|
|
7260
|
+
|
|
6839
7261
|
// src/model-security/client.ts
|
|
6840
7262
|
var ModelSecurityClient = class {
|
|
6841
7263
|
/** Data plane scan operations. */
|
|
@@ -6844,6 +7266,8 @@ var ModelSecurityClient = class {
|
|
|
6844
7266
|
securityGroups;
|
|
6845
7267
|
/** Management plane security rule operations (read-only). */
|
|
6846
7268
|
securityRules;
|
|
7269
|
+
/** Data plane model and model-version operations (read-only). */
|
|
7270
|
+
models;
|
|
6847
7271
|
mgmtEndpoint;
|
|
6848
7272
|
auth;
|
|
6849
7273
|
numRetries;
|
|
@@ -6865,6 +7289,7 @@ var ModelSecurityClient = class {
|
|
|
6865
7289
|
this.mgmtEndpoint = mgmtEndpoint;
|
|
6866
7290
|
this.numRetries = numRetries;
|
|
6867
7291
|
this.scans = new ModelSecurityScansClient({ baseUrl: dataEndpoint, auth, numRetries });
|
|
7292
|
+
this.models = new ModelSecurityModelsClient({ baseUrl: dataEndpoint, auth, numRetries });
|
|
6868
7293
|
this.securityGroups = new ModelSecurityGroupsClient({
|
|
6869
7294
|
baseUrl: mgmtEndpoint,
|
|
6870
7295
|
auth,
|
|
@@ -6902,7 +7327,7 @@ var ModelSecurityClient = class {
|
|
|
6902
7327
|
};
|
|
6903
7328
|
|
|
6904
7329
|
// src/red-team/scans-client.ts
|
|
6905
|
-
var
|
|
7330
|
+
var import_zod37 = require("zod");
|
|
6906
7331
|
var RedTeamScansClient = class {
|
|
6907
7332
|
baseUrl;
|
|
6908
7333
|
auth;
|
|
@@ -7039,7 +7464,7 @@ var RedTeamScansClient = class {
|
|
|
7039
7464
|
method: "GET",
|
|
7040
7465
|
baseUrl: this.baseUrl,
|
|
7041
7466
|
path: RED_TEAM_CATEGORIES_PATH,
|
|
7042
|
-
responseSchema:
|
|
7467
|
+
responseSchema: import_zod37.z.array(CategoryModelSchema),
|
|
7043
7468
|
auth: this.auth,
|
|
7044
7469
|
numRetries: this.numRetries
|
|
7045
7470
|
});
|
|
@@ -7047,7 +7472,7 @@ var RedTeamScansClient = class {
|
|
|
7047
7472
|
};
|
|
7048
7473
|
|
|
7049
7474
|
// src/red-team/reports-client.ts
|
|
7050
|
-
var
|
|
7475
|
+
var import_zod38 = require("zod");
|
|
7051
7476
|
var RedTeamReportsClient = class {
|
|
7052
7477
|
baseUrl;
|
|
7053
7478
|
auth;
|
|
@@ -7422,7 +7847,7 @@ var RedTeamReportsClient = class {
|
|
|
7422
7847
|
baseUrl: this.baseUrl,
|
|
7423
7848
|
path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
|
|
7424
7849
|
params: { file_format: format },
|
|
7425
|
-
responseSchema:
|
|
7850
|
+
responseSchema: import_zod38.z.unknown(),
|
|
7426
7851
|
auth: this.auth,
|
|
7427
7852
|
numRetries: this.numRetries
|
|
7428
7853
|
});
|
|
@@ -7446,7 +7871,7 @@ var RedTeamReportsClient = class {
|
|
|
7446
7871
|
method: "POST",
|
|
7447
7872
|
baseUrl: this.baseUrl,
|
|
7448
7873
|
path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
|
|
7449
|
-
responseSchema:
|
|
7874
|
+
responseSchema: import_zod38.z.unknown(),
|
|
7450
7875
|
auth: this.auth,
|
|
7451
7876
|
numRetries: this.numRetries
|
|
7452
7877
|
});
|
|
@@ -7454,7 +7879,7 @@ var RedTeamReportsClient = class {
|
|
|
7454
7879
|
};
|
|
7455
7880
|
|
|
7456
7881
|
// src/red-team/custom-attack-reports-client.ts
|
|
7457
|
-
var
|
|
7882
|
+
var import_zod39 = require("zod");
|
|
7458
7883
|
var RedTeamCustomAttackReportsClient = class {
|
|
7459
7884
|
baseUrl;
|
|
7460
7885
|
auth;
|
|
@@ -7544,7 +7969,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7544
7969
|
baseUrl: this.baseUrl,
|
|
7545
7970
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
7546
7971
|
params,
|
|
7547
|
-
responseSchema:
|
|
7972
|
+
responseSchema: import_zod39.z.array(PromptDetailResponseSchema),
|
|
7548
7973
|
auth: this.auth,
|
|
7549
7974
|
numRetries: this.numRetries
|
|
7550
7975
|
});
|
|
@@ -7638,7 +8063,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7638
8063
|
method: "GET",
|
|
7639
8064
|
baseUrl: this.baseUrl,
|
|
7640
8065
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
|
|
7641
|
-
responseSchema:
|
|
8066
|
+
responseSchema: import_zod39.z.array(CustomAttackOutputSchema),
|
|
7642
8067
|
auth: this.auth,
|
|
7643
8068
|
numRetries: this.numRetries
|
|
7644
8069
|
});
|
|
@@ -7663,7 +8088,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7663
8088
|
method: "GET",
|
|
7664
8089
|
baseUrl: this.baseUrl,
|
|
7665
8090
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
|
|
7666
|
-
responseSchema:
|
|
8091
|
+
responseSchema: import_zod39.z.array(PropertyStatisticSchema),
|
|
7667
8092
|
auth: this.auth,
|
|
7668
8093
|
numRetries: this.numRetries
|
|
7669
8094
|
});
|
|
@@ -7671,7 +8096,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7671
8096
|
};
|
|
7672
8097
|
|
|
7673
8098
|
// src/red-team/targets-client.ts
|
|
7674
|
-
var
|
|
8099
|
+
var import_zod40 = require("zod");
|
|
7675
8100
|
var RedTeamTargetsClient = class {
|
|
7676
8101
|
baseUrl;
|
|
7677
8102
|
auth;
|
|
@@ -7964,7 +8389,7 @@ var RedTeamTargetsClient = class {
|
|
|
7964
8389
|
method: "GET",
|
|
7965
8390
|
baseUrl: this.baseUrl,
|
|
7966
8391
|
path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
|
|
7967
|
-
responseSchema:
|
|
8392
|
+
responseSchema: import_zod40.z.record(import_zod40.z.unknown()),
|
|
7968
8393
|
auth: this.auth,
|
|
7969
8394
|
numRetries: this.numRetries
|
|
7970
8395
|
});
|
|
@@ -8913,6 +9338,155 @@ var RedTeamInstancesClient = class {
|
|
|
8913
9338
|
}
|
|
8914
9339
|
};
|
|
8915
9340
|
|
|
9341
|
+
// src/red-team/network-broker-client.ts
|
|
9342
|
+
var RedTeamNetworkBrokerClient = class {
|
|
9343
|
+
baseUrl;
|
|
9344
|
+
auth;
|
|
9345
|
+
numRetries;
|
|
9346
|
+
constructor(opts) {
|
|
9347
|
+
this.baseUrl = opts.baseUrl;
|
|
9348
|
+
this.auth = opts.auth;
|
|
9349
|
+
this.numRetries = opts.numRetries;
|
|
9350
|
+
}
|
|
9351
|
+
/**
|
|
9352
|
+
* List network broker channels with optional filters.
|
|
9353
|
+
* @param opts - Optional pagination, search, and status filter options.
|
|
9354
|
+
* @returns The paginated list of channels.
|
|
9355
|
+
* @example
|
|
9356
|
+
* ```ts
|
|
9357
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9358
|
+
* const rt = new RedTeamClient();
|
|
9359
|
+
*
|
|
9360
|
+
* const channels = await rt.networkBroker.listChannels({ status: ['ONLINE', 'DRAFT'], limit: 10 });
|
|
9361
|
+
* // channels =>
|
|
9362
|
+
* // { pagination: { total_items: 2 }, data: [{ uuid: '550e8400-...', name: 'prod-broker', status: 'ONLINE' }] }
|
|
9363
|
+
* ```
|
|
9364
|
+
*/
|
|
9365
|
+
async listChannels(opts) {
|
|
9366
|
+
const params = serializeListing(opts);
|
|
9367
|
+
if (opts?.status !== void 0) {
|
|
9368
|
+
params.status = Array.isArray(opts.status) ? opts.status : [opts.status];
|
|
9369
|
+
}
|
|
9370
|
+
if (opts?.include_all_if_empty !== void 0) {
|
|
9371
|
+
params.include_all_if_empty = String(opts.include_all_if_empty);
|
|
9372
|
+
}
|
|
9373
|
+
return request({
|
|
9374
|
+
method: "GET",
|
|
9375
|
+
baseUrl: this.baseUrl,
|
|
9376
|
+
path: RED_TEAM_CHANNELS_PATH,
|
|
9377
|
+
params,
|
|
9378
|
+
responseSchema: ChannelListResponseSchema,
|
|
9379
|
+
auth: this.auth,
|
|
9380
|
+
numRetries: this.numRetries
|
|
9381
|
+
});
|
|
9382
|
+
}
|
|
9383
|
+
/**
|
|
9384
|
+
* Create a network broker channel.
|
|
9385
|
+
* @param body - Channel creation request body (requires `name`).
|
|
9386
|
+
* @returns The created channel.
|
|
9387
|
+
* @example
|
|
9388
|
+
* ```ts
|
|
9389
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9390
|
+
* const rt = new RedTeamClient();
|
|
9391
|
+
*
|
|
9392
|
+
* const channel = await rt.networkBroker.createChannel({
|
|
9393
|
+
* name: 'prod-broker',
|
|
9394
|
+
* description: 'Production network broker channel',
|
|
9395
|
+
* });
|
|
9396
|
+
* // channel =>
|
|
9397
|
+
* // { uuid: '550e8400-...', name: 'prod-broker', status: 'DRAFT' }
|
|
9398
|
+
* ```
|
|
9399
|
+
*/
|
|
9400
|
+
async createChannel(body) {
|
|
9401
|
+
return request({
|
|
9402
|
+
method: "POST",
|
|
9403
|
+
baseUrl: this.baseUrl,
|
|
9404
|
+
path: RED_TEAM_CHANNELS_PATH,
|
|
9405
|
+
body,
|
|
9406
|
+
responseSchema: ChannelSchema,
|
|
9407
|
+
auth: this.auth,
|
|
9408
|
+
numRetries: this.numRetries
|
|
9409
|
+
});
|
|
9410
|
+
}
|
|
9411
|
+
/**
|
|
9412
|
+
* Get network broker channel stats.
|
|
9413
|
+
* @returns The channel stats (broker server, registry, chart, image, channel counts).
|
|
9414
|
+
* @example
|
|
9415
|
+
* ```ts
|
|
9416
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9417
|
+
* const rt = new RedTeamClient();
|
|
9418
|
+
*
|
|
9419
|
+
* const stats = await rt.networkBroker.getChannelStats();
|
|
9420
|
+
* // stats =>
|
|
9421
|
+
* // { network_channels_server_domain: 'broker.example.com', online_channels: 3, total_channels: 5, client_version: '1.4.0' }
|
|
9422
|
+
* ```
|
|
9423
|
+
*/
|
|
9424
|
+
async getChannelStats() {
|
|
9425
|
+
return request({
|
|
9426
|
+
method: "GET",
|
|
9427
|
+
baseUrl: this.baseUrl,
|
|
9428
|
+
path: RED_TEAM_CHANNELS_STATS_PATH,
|
|
9429
|
+
responseSchema: ChannelStatsSchema,
|
|
9430
|
+
auth: this.auth,
|
|
9431
|
+
numRetries: this.numRetries
|
|
9432
|
+
});
|
|
9433
|
+
}
|
|
9434
|
+
/**
|
|
9435
|
+
* Get a network broker channel by UUID.
|
|
9436
|
+
* @param channelId - The channel UUID.
|
|
9437
|
+
* @returns The channel.
|
|
9438
|
+
* @example
|
|
9439
|
+
* ```ts
|
|
9440
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9441
|
+
* const rt = new RedTeamClient();
|
|
9442
|
+
*
|
|
9443
|
+
* const channel = await rt.networkBroker.getChannel('550e8400-e29b-41d4-a716-446655440000');
|
|
9444
|
+
* // channel =>
|
|
9445
|
+
* // { uuid: '550e8400-...', name: 'prod-broker', status: 'ONLINE' }
|
|
9446
|
+
* ```
|
|
9447
|
+
*/
|
|
9448
|
+
async getChannel(channelId) {
|
|
9449
|
+
assertUuid(channelId, "channel id");
|
|
9450
|
+
return request({
|
|
9451
|
+
method: "GET",
|
|
9452
|
+
baseUrl: this.baseUrl,
|
|
9453
|
+
path: `${RED_TEAM_CHANNELS_PATH}/${channelId}`,
|
|
9454
|
+
responseSchema: ChannelSchema,
|
|
9455
|
+
auth: this.auth,
|
|
9456
|
+
numRetries: this.numRetries
|
|
9457
|
+
});
|
|
9458
|
+
}
|
|
9459
|
+
/**
|
|
9460
|
+
* Update a network broker channel's name or description.
|
|
9461
|
+
* @param channelId - The channel UUID.
|
|
9462
|
+
* @param body - Channel update request body.
|
|
9463
|
+
* @returns The updated channel.
|
|
9464
|
+
* @example
|
|
9465
|
+
* ```ts
|
|
9466
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9467
|
+
* const rt = new RedTeamClient();
|
|
9468
|
+
*
|
|
9469
|
+
* const channel = await rt.networkBroker.updateChannel('550e8400-e29b-41d4-a716-446655440000', {
|
|
9470
|
+
* description: 'Updated description',
|
|
9471
|
+
* });
|
|
9472
|
+
* // channel =>
|
|
9473
|
+
* // { uuid: '550e8400-...', name: 'prod-broker', description: 'Updated description', status: 'ONLINE' }
|
|
9474
|
+
* ```
|
|
9475
|
+
*/
|
|
9476
|
+
async updateChannel(channelId, body) {
|
|
9477
|
+
assertUuid(channelId, "channel id");
|
|
9478
|
+
return request({
|
|
9479
|
+
method: "PATCH",
|
|
9480
|
+
baseUrl: this.baseUrl,
|
|
9481
|
+
path: `${RED_TEAM_CHANNELS_PATH}/${channelId}`,
|
|
9482
|
+
body,
|
|
9483
|
+
responseSchema: ChannelSchema,
|
|
9484
|
+
auth: this.auth,
|
|
9485
|
+
numRetries: this.numRetries
|
|
9486
|
+
});
|
|
9487
|
+
}
|
|
9488
|
+
};
|
|
9489
|
+
|
|
8916
9490
|
// src/red-team/client.ts
|
|
8917
9491
|
var RedTeamClient = class {
|
|
8918
9492
|
/** Data plane scan operations. */
|
|
@@ -8929,6 +9503,8 @@ var RedTeamClient = class {
|
|
|
8929
9503
|
eula;
|
|
8930
9504
|
/** Management plane instance/licensing operations. */
|
|
8931
9505
|
instances;
|
|
9506
|
+
/** Network broker channel operations (distinct network broker base URL). */
|
|
9507
|
+
networkBroker;
|
|
8932
9508
|
dataEndpoint;
|
|
8933
9509
|
mgmtEndpoint;
|
|
8934
9510
|
auth;
|
|
@@ -8936,6 +9512,7 @@ var RedTeamClient = class {
|
|
|
8936
9512
|
constructor(opts = {}) {
|
|
8937
9513
|
const dataEndpoint = opts.dataEndpoint ?? process.env[RED_TEAM_DATA_ENDPOINT] ?? DEFAULT_RED_TEAM_DATA_ENDPOINT;
|
|
8938
9514
|
const mgmtEndpoint = opts.mgmtEndpoint ?? process.env[RED_TEAM_MGMT_ENDPOINT] ?? DEFAULT_RED_TEAM_MGMT_ENDPOINT;
|
|
9515
|
+
const networkBrokerEndpoint = opts.networkBrokerEndpoint ?? process.env[RED_TEAM_NETWORK_BROKER_ENDPOINT] ?? DEFAULT_RED_TEAM_NETWORK_BROKER_ENDPOINT;
|
|
8939
9516
|
const { oauthClient, numRetries } = resolveOAuthConfig({
|
|
8940
9517
|
clientId: opts.clientId,
|
|
8941
9518
|
clientSecret: opts.clientSecret,
|
|
@@ -8966,6 +9543,11 @@ var RedTeamClient = class {
|
|
|
8966
9543
|
});
|
|
8967
9544
|
this.eula = new RedTeamEulaClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
8968
9545
|
this.instances = new RedTeamInstancesClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
9546
|
+
this.networkBroker = new RedTeamNetworkBrokerClient({
|
|
9547
|
+
baseUrl: networkBrokerEndpoint,
|
|
9548
|
+
auth,
|
|
9549
|
+
numRetries
|
|
9550
|
+
});
|
|
8969
9551
|
}
|
|
8970
9552
|
// -----------------------------------------------------------------------
|
|
8971
9553
|
// Data plane convenience methods
|
|
@@ -9074,6 +9656,82 @@ var RedTeamClient = class {
|
|
|
9074
9656
|
numRetries: this.numRetries
|
|
9075
9657
|
});
|
|
9076
9658
|
}
|
|
9659
|
+
/**
|
|
9660
|
+
* List profiling error logs for a target (data plane).
|
|
9661
|
+
* @param targetId - The target UUID.
|
|
9662
|
+
* @param opts - Optional pagination/search options (the endpoint honors `limit`).
|
|
9663
|
+
* @returns The paginated list of target-profile error logs.
|
|
9664
|
+
* @example
|
|
9665
|
+
* ```ts
|
|
9666
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9667
|
+
* const rt = new RedTeamClient();
|
|
9668
|
+
*
|
|
9669
|
+
* const logs = await rt.getTargetProfileErrorLogs('550e8400-e29b-41d4-a716-446655440000', { limit: 10 });
|
|
9670
|
+
* // logs =>
|
|
9671
|
+
* // { pagination: { total_items: 1 }, data: [{ target_id: '550e8400-...', error_type: 'PROBE', error_message: '...', created_at: '2025-01-01T00:00:00Z' }] }
|
|
9672
|
+
* ```
|
|
9673
|
+
*/
|
|
9674
|
+
async getTargetProfileErrorLogs(targetId, opts) {
|
|
9675
|
+
assertUuid(targetId, "target id");
|
|
9676
|
+
return request({
|
|
9677
|
+
method: "GET",
|
|
9678
|
+
baseUrl: this.dataEndpoint,
|
|
9679
|
+
path: `${RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH}/${targetId}`,
|
|
9680
|
+
params: serializeListing(opts),
|
|
9681
|
+
responseSchema: ErrorLogListResponseSchema,
|
|
9682
|
+
auth: this.auth,
|
|
9683
|
+
numRetries: this.numRetries
|
|
9684
|
+
});
|
|
9685
|
+
}
|
|
9686
|
+
/**
|
|
9687
|
+
* Get the tenant's allowed languages for Red Team scans (data plane).
|
|
9688
|
+
* @returns The supported-languages response.
|
|
9689
|
+
* @example
|
|
9690
|
+
* ```ts
|
|
9691
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9692
|
+
* const rt = new RedTeamClient();
|
|
9693
|
+
*
|
|
9694
|
+
* const langs = await rt.getLanguages();
|
|
9695
|
+
* // langs =>
|
|
9696
|
+
* // { multilingual_enabled: true, supported_job_types: ['STATIC', 'DYNAMIC'],
|
|
9697
|
+
* // languages: [{ code: 'en', name: 'English' }, { code: 'es', name: 'Spanish' }] }
|
|
9698
|
+
* ```
|
|
9699
|
+
*/
|
|
9700
|
+
async getLanguages() {
|
|
9701
|
+
return request({
|
|
9702
|
+
method: "GET",
|
|
9703
|
+
baseUrl: this.dataEndpoint,
|
|
9704
|
+
path: RED_TEAM_LANGUAGES_PATH,
|
|
9705
|
+
responseSchema: TenantLanguagesResponseSchema,
|
|
9706
|
+
auth: this.auth,
|
|
9707
|
+
numRetries: this.numRetries
|
|
9708
|
+
});
|
|
9709
|
+
}
|
|
9710
|
+
/**
|
|
9711
|
+
* Get the tenant's allowed languages from the management plane.
|
|
9712
|
+
* Same response shape as {@link RedTeamClient.getLanguages}, served from the management endpoint.
|
|
9713
|
+
* @returns The supported-languages response.
|
|
9714
|
+
* @example
|
|
9715
|
+
* ```ts
|
|
9716
|
+
* import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
|
|
9717
|
+
* const rt = new RedTeamClient();
|
|
9718
|
+
*
|
|
9719
|
+
* const langs = await rt.getManagementLanguages();
|
|
9720
|
+
* // langs =>
|
|
9721
|
+
* // { multilingual_enabled: true, supported_job_types: ['STATIC', 'DYNAMIC'],
|
|
9722
|
+
* // languages: [{ code: 'en', name: 'English' }] }
|
|
9723
|
+
* ```
|
|
9724
|
+
*/
|
|
9725
|
+
async getManagementLanguages() {
|
|
9726
|
+
return request({
|
|
9727
|
+
method: "GET",
|
|
9728
|
+
baseUrl: this.mgmtEndpoint,
|
|
9729
|
+
path: RED_TEAM_LANGUAGES_PATH,
|
|
9730
|
+
responseSchema: TenantLanguagesResponseSchema,
|
|
9731
|
+
auth: this.auth,
|
|
9732
|
+
numRetries: this.numRetries
|
|
9733
|
+
});
|
|
9734
|
+
}
|
|
9077
9735
|
/**
|
|
9078
9736
|
* Update sentiment for a scan report.
|
|
9079
9737
|
* @param body - The sentiment request body.
|
|
@@ -9202,6 +9860,12 @@ var RedTeamClient = class {
|
|
|
9202
9860
|
CategoryModelSchema,
|
|
9203
9861
|
CategoryReportSchema,
|
|
9204
9862
|
CgReportSchema,
|
|
9863
|
+
ChannelListPaginationSchema,
|
|
9864
|
+
ChannelListResponseSchema,
|
|
9865
|
+
ChannelSchema,
|
|
9866
|
+
ChannelStatsSchema,
|
|
9867
|
+
ChannelStatus,
|
|
9868
|
+
ChannelStatusSchema,
|
|
9205
9869
|
ClientIdAndCustomerAppSchema,
|
|
9206
9870
|
CmdEntrySchema,
|
|
9207
9871
|
CmdInjectReportSchema,
|
|
@@ -9215,6 +9879,7 @@ var RedTeamClient = class {
|
|
|
9215
9879
|
ContentErrorType,
|
|
9216
9880
|
CountByNameSchema,
|
|
9217
9881
|
CountedQuotaEnum,
|
|
9882
|
+
CreateChannelRequestSchema,
|
|
9218
9883
|
CreateCustomTopicRequestSchema,
|
|
9219
9884
|
CreateSecurityProfileRequestSchema,
|
|
9220
9885
|
CustomAttackOutputSchema,
|
|
@@ -9249,6 +9914,7 @@ var RedTeamClient = class {
|
|
|
9249
9914
|
DEFAULT_MODEL_SEC_MGMT_ENDPOINT,
|
|
9250
9915
|
DEFAULT_RED_TEAM_DATA_ENDPOINT,
|
|
9251
9916
|
DEFAULT_RED_TEAM_MGMT_ENDPOINT,
|
|
9917
|
+
DEFAULT_RED_TEAM_NETWORK_BROKER_ENDPOINT,
|
|
9252
9918
|
DEFAULT_TOKEN_ENDPOINT,
|
|
9253
9919
|
DLP_DATA_FILTERING_PROFILES_PATH,
|
|
9254
9920
|
DLP_DATA_PATTERNS_PATH,
|
|
@@ -9257,9 +9923,13 @@ var RedTeamClient = class {
|
|
|
9257
9923
|
DSDetailResultSchema,
|
|
9258
9924
|
DSResultMetadataSchema,
|
|
9259
9925
|
DashboardApplicationSchema,
|
|
9926
|
+
DashboardApplicationSessionsBucketSchema,
|
|
9260
9927
|
DashboardApplicationViolationBreakdownSchema,
|
|
9928
|
+
DashboardApplicationsOverviewItemSchema,
|
|
9929
|
+
DashboardApplicationsOverviewSchema,
|
|
9261
9930
|
DashboardClient,
|
|
9262
9931
|
DashboardOverviewResponseSchema,
|
|
9932
|
+
DashboardPaginationSchema,
|
|
9263
9933
|
DashboardSessionStatsSchema,
|
|
9264
9934
|
DataFilteringDetailsSchema,
|
|
9265
9935
|
DataFilteringProfileRequestSchema,
|
|
@@ -9386,6 +10056,7 @@ var RedTeamClient = class {
|
|
|
9386
10056
|
LabelValueListSchema,
|
|
9387
10057
|
LabelsCreateRequestSchema,
|
|
9388
10058
|
LabelsResponseSchema,
|
|
10059
|
+
LanguageOptionSchema,
|
|
9389
10060
|
ListModelSecurityGroupsResponseSchema,
|
|
9390
10061
|
ListModelSecurityRuleInstancesResponseSchema,
|
|
9391
10062
|
ListModelSecurityRulesResponseSchema,
|
|
@@ -9410,6 +10081,7 @@ var RedTeamClient = class {
|
|
|
9410
10081
|
MGMT_CLIENT_SECRET,
|
|
9411
10082
|
MGMT_CUSTOMER_APPS_TSG_PATH,
|
|
9412
10083
|
MGMT_CUSTOMER_APP_PATH,
|
|
10084
|
+
MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
|
|
9413
10085
|
MGMT_DASHBOARD_APPLICATION_PATH,
|
|
9414
10086
|
MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH,
|
|
9415
10087
|
MGMT_DEPLOYMENT_PROFILES_PATH,
|
|
@@ -9430,6 +10102,8 @@ var RedTeamClient = class {
|
|
|
9430
10102
|
MODEL_SEC_DATA_ENDPOINT,
|
|
9431
10103
|
MODEL_SEC_EVALUATIONS_PATH,
|
|
9432
10104
|
MODEL_SEC_MGMT_ENDPOINT,
|
|
10105
|
+
MODEL_SEC_MODELS_PATH,
|
|
10106
|
+
MODEL_SEC_MODEL_VERSIONS_PATH,
|
|
9433
10107
|
MODEL_SEC_PYPI_AUTH_PATH,
|
|
9434
10108
|
MODEL_SEC_SCANS_PATH,
|
|
9435
10109
|
MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
@@ -9446,7 +10120,9 @@ var RedTeamClient = class {
|
|
|
9446
10120
|
MetadataCriterionSchema,
|
|
9447
10121
|
MetadataSchema,
|
|
9448
10122
|
ModelConfigurationSchema,
|
|
10123
|
+
ModelListSchema,
|
|
9449
10124
|
ModelProtectionItemSchema,
|
|
10125
|
+
ModelResponseSchema,
|
|
9450
10126
|
ModelScanIssueSchema,
|
|
9451
10127
|
ModelScanStatus,
|
|
9452
10128
|
ModelSecurityClient,
|
|
@@ -9455,12 +10131,15 @@ var RedTeamClient = class {
|
|
|
9455
10131
|
ModelSecurityGroupState,
|
|
9456
10132
|
ModelSecurityGroupUpdateRequestSchema,
|
|
9457
10133
|
ModelSecurityGroupsClient,
|
|
10134
|
+
ModelSecurityModelsClient,
|
|
9458
10135
|
ModelSecurityPaginationSchema,
|
|
9459
10136
|
ModelSecurityRuleInstanceResponseSchema,
|
|
9460
10137
|
ModelSecurityRuleInstanceUpdateRequestSchema,
|
|
9461
10138
|
ModelSecurityRuleResponseSchema,
|
|
9462
10139
|
ModelSecurityRulesClient,
|
|
9463
10140
|
ModelSecurityScansClient,
|
|
10141
|
+
ModelVersionListSchema,
|
|
10142
|
+
ModelVersionResponseSchema,
|
|
9464
10143
|
MultiProfileDataNodeSchema,
|
|
9465
10144
|
MultiProfileDetectionRuleSchema,
|
|
9466
10145
|
MultiTurnStatefulConfigSchema,
|
|
@@ -9505,6 +10184,8 @@ var RedTeamClient = class {
|
|
|
9505
10184
|
QuotaDetailsSchema,
|
|
9506
10185
|
QuotaSummarySchema,
|
|
9507
10186
|
RED_TEAM_CATEGORIES_PATH,
|
|
10187
|
+
RED_TEAM_CHANNELS_PATH,
|
|
10188
|
+
RED_TEAM_CHANNELS_STATS_PATH,
|
|
9508
10189
|
RED_TEAM_CLIENT_ID,
|
|
9509
10190
|
RED_TEAM_CLIENT_SECRET,
|
|
9510
10191
|
RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH,
|
|
@@ -9512,10 +10193,13 @@ var RedTeamClient = class {
|
|
|
9512
10193
|
RED_TEAM_DASHBOARD_PATH,
|
|
9513
10194
|
RED_TEAM_DATA_ENDPOINT,
|
|
9514
10195
|
RED_TEAM_ERROR_LOG_PATH,
|
|
10196
|
+
RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH,
|
|
9515
10197
|
RED_TEAM_EULA_PATH,
|
|
9516
10198
|
RED_TEAM_INSTANCES_PATH,
|
|
10199
|
+
RED_TEAM_LANGUAGES_PATH,
|
|
9517
10200
|
RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
9518
10201
|
RED_TEAM_MGMT_ENDPOINT,
|
|
10202
|
+
RED_TEAM_NETWORK_BROKER_ENDPOINT,
|
|
9519
10203
|
RED_TEAM_QUOTA_PATH,
|
|
9520
10204
|
RED_TEAM_REGISTRY_CREDENTIALS_PATH,
|
|
9521
10205
|
RED_TEAM_REPORT_DYNAMIC_PATH,
|
|
@@ -9535,6 +10219,7 @@ var RedTeamClient = class {
|
|
|
9535
10219
|
RedTeamErrorType,
|
|
9536
10220
|
RedTeamEulaClient,
|
|
9537
10221
|
RedTeamInstancesClient,
|
|
10222
|
+
RedTeamNetworkBrokerClient,
|
|
9538
10223
|
RedTeamPaginationSchema,
|
|
9539
10224
|
RedTeamReportsClient,
|
|
9540
10225
|
RedTeamScansClient,
|
|
@@ -9637,6 +10322,7 @@ var RedTeamClient = class {
|
|
|
9637
10322
|
TargetType,
|
|
9638
10323
|
TargetUpdateRequestSchema,
|
|
9639
10324
|
TcReportSchema,
|
|
10325
|
+
TenantLanguagesResponseSchema,
|
|
9640
10326
|
TgReportSchema,
|
|
9641
10327
|
ThreatCategory,
|
|
9642
10328
|
ThreatScanReportSchema,
|
|
@@ -9652,11 +10338,13 @@ var RedTeamClient = class {
|
|
|
9652
10338
|
TopicsClient,
|
|
9653
10339
|
URLExclusionSchema,
|
|
9654
10340
|
USER_AGENT,
|
|
10341
|
+
UpdateChannelRequestSchema,
|
|
9655
10342
|
UrlCategorySchema,
|
|
9656
10343
|
UrlfEntrySchema,
|
|
9657
10344
|
ValidationErrorSchema,
|
|
9658
10345
|
Verdict,
|
|
9659
10346
|
ViolationListSchema,
|
|
10347
|
+
ViolationRemediationSchema,
|
|
9660
10348
|
ViolationResponseSchema,
|
|
9661
10349
|
ViolationSeverityCountsSchema,
|
|
9662
10350
|
WebSocketConnectionParamsSchema,
|