@cdot65/prisma-airs-sdk 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2241 -1367
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24897 -2444
- package/dist/index.d.ts +24897 -2444
- package/dist/index.js +2188 -1367
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,12 @@ var HEADER_AUTH_TOKEN = "Authorization";
|
|
|
4
4
|
var PAYLOAD_HASH = "x-payload-hash";
|
|
5
5
|
var BEARER = "Bearer ";
|
|
6
6
|
var DEFAULT_ENDPOINT = "https://service.api.aisecurity.paloaltonetworks.com";
|
|
7
|
+
var AIRS_ENDPOINTS = {
|
|
8
|
+
US: "https://service.api.aisecurity.paloaltonetworks.com",
|
|
9
|
+
EU: "https://service-de.api.aisecurity.paloaltonetworks.com",
|
|
10
|
+
INDIA: "https://service-in.api.aisecurity.paloaltonetworks.com",
|
|
11
|
+
SINGAPORE: "https://service-sg.api.aisecurity.paloaltonetworks.com"
|
|
12
|
+
};
|
|
7
13
|
var AI_SEC_API_KEY = "PANW_AI_SEC_API_KEY";
|
|
8
14
|
var AI_SEC_API_TOKEN = "PANW_AI_SEC_API_TOKEN";
|
|
9
15
|
var AI_SEC_API_ENDPOINT = "PANW_AI_SEC_API_ENDPOINT";
|
|
@@ -23,7 +29,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
23
29
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
24
30
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
25
31
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
26
|
-
var SDK_VERSION = "0.6.
|
|
32
|
+
var SDK_VERSION = "0.6.3";
|
|
27
33
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
28
34
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
29
35
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -41,6 +47,15 @@ var MGMT_PROFILES_TSG_PATH = "/v1/mgmt/profiles/tsg";
|
|
|
41
47
|
var MGMT_TOPIC_PATH = "/v1/mgmt/topic";
|
|
42
48
|
var MGMT_TOPICS_TSG_PATH = "/v1/mgmt/topics/tsg";
|
|
43
49
|
var MGMT_TOPIC_FORCE_PATH = "/v1/mgmt/topic/force";
|
|
50
|
+
var MGMT_API_KEY_PATH = "/v1/mgmt/apikey";
|
|
51
|
+
var MGMT_API_KEYS_TSG_PATH = "/v1/mgmt/apikeys/tsg";
|
|
52
|
+
var MGMT_DLP_PROFILES_PATH = "/v1/mgmt/dlpprofiles";
|
|
53
|
+
var MGMT_DEPLOYMENT_PROFILES_PATH = "/v1/mgmt/deploymentprofiles";
|
|
54
|
+
var MGMT_SCAN_LOGS_PATH = "/v1/mgmt/scanlogs";
|
|
55
|
+
var MGMT_CUSTOMER_APP_PATH = "/v1/mgmt/customerapp";
|
|
56
|
+
var MGMT_CUSTOMER_APPS_TSG_PATH = "/v1/mgmt/customerapp/tsg";
|
|
57
|
+
var MGMT_OAUTH_INVALIDATE_PATH = "/v1/mgmt/oauth/invalidateToken";
|
|
58
|
+
var MGMT_OAUTH_TOKEN_PATH = "/v1/mgmt/oauth/client_credential/accesstoken";
|
|
44
59
|
var DEFAULT_MODEL_SEC_DATA_ENDPOINT = "https://api.sase.paloaltonetworks.com/aims/data";
|
|
45
60
|
var DEFAULT_MODEL_SEC_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aims/mgmt";
|
|
46
61
|
var MODEL_SEC_CLIENT_ID = "PANW_MODEL_SEC_CLIENT_ID";
|
|
@@ -422,6 +437,11 @@ var Content = class _Content {
|
|
|
422
437
|
_codePrompt;
|
|
423
438
|
_codeResponse;
|
|
424
439
|
_toolEvent;
|
|
440
|
+
/**
|
|
441
|
+
* Create a new Content instance.
|
|
442
|
+
* @param opts - Content fields; at least one of prompt, response, codePrompt, codeResponse, or toolEvent is required.
|
|
443
|
+
* @throws {AISecSDKException} If no content field is provided or a field exceeds its byte-length limit.
|
|
444
|
+
*/
|
|
425
445
|
constructor(opts) {
|
|
426
446
|
if (!opts.prompt && !opts.response && !opts.codePrompt && !opts.codeResponse && !opts.toolEvent) {
|
|
427
447
|
throw new AISecSDKException(
|
|
@@ -564,13 +584,32 @@ var Category = {
|
|
|
564
584
|
MALICIOUS: "malicious",
|
|
565
585
|
UNKNOWN: "unknown"
|
|
566
586
|
};
|
|
587
|
+
var DetectionServiceName = {
|
|
588
|
+
DLP: "dlp",
|
|
589
|
+
INJECTION: "injection",
|
|
590
|
+
URL_CATS: "url_cats",
|
|
591
|
+
TOXIC_CONTENT: "toxic_content",
|
|
592
|
+
MALICIOUS_CODE: "malicious_code",
|
|
593
|
+
AGENT: "agent",
|
|
594
|
+
TOPIC_VIOLATION: "topic_violation",
|
|
595
|
+
DB_SECURITY: "db_security",
|
|
596
|
+
UNGROUNDED: "ungrounded"
|
|
597
|
+
};
|
|
598
|
+
var ContentErrorType = {
|
|
599
|
+
PROMPT: "prompt",
|
|
600
|
+
RESPONSE: "response"
|
|
601
|
+
};
|
|
602
|
+
var ErrorStatus = {
|
|
603
|
+
ERROR: "error",
|
|
604
|
+
TIMEOUT: "timeout"
|
|
605
|
+
};
|
|
567
606
|
|
|
568
607
|
// src/models/ai-profile.ts
|
|
569
608
|
import { z } from "zod";
|
|
570
609
|
var AiProfileSchema = z.object({
|
|
571
610
|
profile_id: z.string().uuid().optional(),
|
|
572
611
|
profile_name: z.string().max(MAX_AI_PROFILE_NAME_LENGTH).optional()
|
|
573
|
-
}).refine((d) => d.profile_id || d.profile_name, {
|
|
612
|
+
}).passthrough().refine((d) => d.profile_id || d.profile_name, {
|
|
574
613
|
message: "Either profile_id or profile_name must be provided"
|
|
575
614
|
});
|
|
576
615
|
|
|
@@ -580,14 +619,14 @@ var AgentMetaSchema = z2.object({
|
|
|
580
619
|
agent_id: z2.string().optional(),
|
|
581
620
|
agent_version: z2.string().optional(),
|
|
582
621
|
agent_arn: z2.string().optional()
|
|
583
|
-
});
|
|
622
|
+
}).passthrough();
|
|
584
623
|
var MetadataSchema = z2.object({
|
|
585
624
|
app_name: z2.string().optional(),
|
|
586
625
|
app_user: z2.string().optional(),
|
|
587
626
|
ai_model: z2.string().optional(),
|
|
588
627
|
user_ip: z2.string().optional(),
|
|
589
628
|
agent_meta: AgentMetaSchema.optional()
|
|
590
|
-
});
|
|
629
|
+
}).passthrough();
|
|
591
630
|
|
|
592
631
|
// src/models/tool-event.ts
|
|
593
632
|
import { z as z3 } from "zod";
|
|
@@ -596,12 +635,12 @@ var ToolEventMetadataSchema = z3.object({
|
|
|
596
635
|
method: z3.string(),
|
|
597
636
|
server_name: z3.string(),
|
|
598
637
|
tool_invoked: z3.string().optional()
|
|
599
|
-
});
|
|
638
|
+
}).passthrough();
|
|
600
639
|
var ToolEventSchema = z3.object({
|
|
601
640
|
metadata: ToolEventMetadataSchema.optional(),
|
|
602
641
|
input: z3.string().optional(),
|
|
603
642
|
output: z3.string().optional()
|
|
604
|
-
});
|
|
643
|
+
}).passthrough();
|
|
605
644
|
|
|
606
645
|
// src/models/scan-request.ts
|
|
607
646
|
import { z as z4 } from "zod";
|
|
@@ -612,23 +651,23 @@ var ScanRequestContentsInnerSchema = z4.object({
|
|
|
612
651
|
code_response: z4.string().optional(),
|
|
613
652
|
context: z4.string().optional(),
|
|
614
653
|
tool_event: ToolEventSchema.optional()
|
|
615
|
-
});
|
|
654
|
+
}).passthrough();
|
|
616
655
|
var ScanRequestSchema = z4.object({
|
|
617
656
|
tr_id: z4.string().max(MAX_TRANSACTION_ID_STR_LENGTH).optional(),
|
|
618
657
|
session_id: z4.string().max(MAX_SESSION_ID_STR_LENGTH).optional(),
|
|
619
658
|
ai_profile: AiProfileSchema,
|
|
620
659
|
metadata: MetadataSchema.optional(),
|
|
621
660
|
contents: z4.array(ScanRequestContentsInnerSchema).min(1)
|
|
622
|
-
});
|
|
661
|
+
}).passthrough();
|
|
623
662
|
|
|
624
663
|
// src/models/scan-response.ts
|
|
625
|
-
import { z as
|
|
664
|
+
import { z as z8 } from "zod";
|
|
626
665
|
|
|
627
666
|
// src/models/prompt-detected.ts
|
|
628
667
|
import { z as z5 } from "zod";
|
|
629
668
|
var PromptDetectionDetailsSchema = z5.object({
|
|
630
669
|
topic_guardrails_details: z5.record(z5.unknown()).optional()
|
|
631
|
-
});
|
|
670
|
+
}).passthrough();
|
|
632
671
|
var PromptDetectedSchema = z5.object({
|
|
633
672
|
url_cats: z5.boolean().optional(),
|
|
634
673
|
dlp: z5.boolean().optional(),
|
|
@@ -637,13 +676,13 @@ var PromptDetectedSchema = z5.object({
|
|
|
637
676
|
malicious_code: z5.boolean().optional(),
|
|
638
677
|
agent: z5.boolean().optional(),
|
|
639
678
|
topic_violation: z5.boolean().optional()
|
|
640
|
-
});
|
|
679
|
+
}).passthrough();
|
|
641
680
|
|
|
642
681
|
// src/models/response-detected.ts
|
|
643
682
|
import { z as z6 } from "zod";
|
|
644
683
|
var ResponseDetectionDetailsSchema = z6.object({
|
|
645
684
|
topic_guardrails_details: z6.record(z6.unknown()).optional()
|
|
646
|
-
});
|
|
685
|
+
}).passthrough();
|
|
647
686
|
var ResponseDetectedSchema = z6.object({
|
|
648
687
|
url_cats: z6.boolean().optional(),
|
|
649
688
|
dlp: z6.boolean().optional(),
|
|
@@ -653,41 +692,114 @@ var ResponseDetectedSchema = z6.object({
|
|
|
653
692
|
agent: z6.boolean().optional(),
|
|
654
693
|
ungrounded: z6.boolean().optional(),
|
|
655
694
|
topic_violation: z6.boolean().optional()
|
|
656
|
-
});
|
|
695
|
+
}).passthrough();
|
|
657
696
|
|
|
658
|
-
// src/models/
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
injection: z7.boolean().optional(),
|
|
667
|
-
toxic_content: z7.boolean().optional(),
|
|
668
|
-
malicious_code: z7.boolean().optional()
|
|
669
|
-
}).passthrough();
|
|
670
|
-
var ScanSummarySchema = z7.object({
|
|
697
|
+
// src/models/detection-reports.ts
|
|
698
|
+
import { z as z7 } from "zod";
|
|
699
|
+
var TcReportSchema = z7.object({
|
|
700
|
+
confidence: z7.string().optional(),
|
|
701
|
+
verdict: z7.string().optional()
|
|
702
|
+
}).passthrough();
|
|
703
|
+
var DbsEntrySchema = z7.object({
|
|
704
|
+
sub_type: z7.string().optional(),
|
|
671
705
|
verdict: z7.string().optional(),
|
|
672
706
|
action: z7.string().optional()
|
|
673
707
|
}).passthrough();
|
|
674
|
-
var
|
|
708
|
+
var DbsReportSchema = z7.array(DbsEntrySchema);
|
|
709
|
+
var McEntrySchema = z7.object({
|
|
710
|
+
file_type: z7.string().optional(),
|
|
711
|
+
code_sha256: z7.string().optional()
|
|
712
|
+
}).passthrough();
|
|
713
|
+
var MalwareReportSchema = z7.object({
|
|
714
|
+
verdict: z7.string().optional()
|
|
715
|
+
}).passthrough();
|
|
716
|
+
var CmdEntrySchema = z7.object({
|
|
717
|
+
code_block: z7.string().optional(),
|
|
718
|
+
verdict: z7.string().optional()
|
|
719
|
+
}).passthrough();
|
|
720
|
+
var CmdInjectReportSchema = z7.array(CmdEntrySchema);
|
|
721
|
+
var McReportSchema = z7.object({
|
|
722
|
+
all_code_blocks: z7.array(z7.string()).optional(),
|
|
723
|
+
code_analysis_by_type: z7.array(McEntrySchema).optional(),
|
|
675
724
|
verdict: z7.string().optional(),
|
|
725
|
+
malware_script_report: MalwareReportSchema.optional(),
|
|
726
|
+
command_injection_report: CmdInjectReportSchema.optional()
|
|
727
|
+
}).passthrough();
|
|
728
|
+
var AgentEntrySchema = z7.object({
|
|
729
|
+
category_type: z7.string().optional(),
|
|
730
|
+
verdict: z7.string().optional()
|
|
731
|
+
}).passthrough();
|
|
732
|
+
var AgentReportSchema = z7.object({
|
|
733
|
+
model_verdict: z7.string().optional(),
|
|
734
|
+
agent_framework: z7.string().optional(),
|
|
735
|
+
agent_patterns: z7.array(AgentEntrySchema).optional()
|
|
736
|
+
}).passthrough();
|
|
737
|
+
var TgReportSchema = z7.object({
|
|
738
|
+
allowed_topic_list: z7.string().optional(),
|
|
739
|
+
blocked_topic_list: z7.string().optional(),
|
|
740
|
+
allowedTopics: z7.array(z7.string()).optional(),
|
|
741
|
+
blockedTopics: z7.array(z7.string()).optional()
|
|
742
|
+
}).passthrough();
|
|
743
|
+
var CgReportSchema = z7.object({
|
|
744
|
+
status: z7.string().optional(),
|
|
745
|
+
explanation: z7.string().optional(),
|
|
746
|
+
category: z7.string().optional()
|
|
747
|
+
}).passthrough();
|
|
748
|
+
var OffsetSchema = z7.array(z7.array(z7.number()));
|
|
749
|
+
var DlpPatternDetectionSchema = z7.object({
|
|
750
|
+
data_pattern_id: z7.string().optional(),
|
|
751
|
+
version: z7.number().optional(),
|
|
752
|
+
name: z7.string().optional(),
|
|
753
|
+
high_confidence_detections: OffsetSchema.optional(),
|
|
754
|
+
medium_confidence_detections: OffsetSchema.optional(),
|
|
755
|
+
low_confidence_detections: OffsetSchema.optional()
|
|
756
|
+
}).passthrough();
|
|
757
|
+
var PatternDetectionSchema = z7.object({
|
|
758
|
+
pattern: z7.string().optional(),
|
|
759
|
+
locations: OffsetSchema.optional()
|
|
760
|
+
}).passthrough();
|
|
761
|
+
var ContentErrorSchema = z7.object({
|
|
762
|
+
content_type: z7.string().optional(),
|
|
763
|
+
feature: z7.string().optional(),
|
|
764
|
+
status: z7.string().optional()
|
|
765
|
+
}).passthrough();
|
|
766
|
+
|
|
767
|
+
// src/models/scan-response.ts
|
|
768
|
+
var MaskedDataSchema = z8.object({
|
|
769
|
+
data: z8.string().optional(),
|
|
770
|
+
pattern_detections: z8.array(PatternDetectionSchema).optional()
|
|
771
|
+
}).passthrough();
|
|
772
|
+
var IODetectedSchema = z8.object({
|
|
773
|
+
url_cats: z8.boolean().optional(),
|
|
774
|
+
dlp: z8.boolean().optional(),
|
|
775
|
+
injection: z8.boolean().optional(),
|
|
776
|
+
toxic_content: z8.boolean().optional(),
|
|
777
|
+
malicious_code: z8.boolean().optional()
|
|
778
|
+
}).passthrough();
|
|
779
|
+
var ScanSummarySchema = z8.object({
|
|
780
|
+
verdict: z8.string().optional(),
|
|
781
|
+
action: z8.string().optional()
|
|
782
|
+
}).passthrough();
|
|
783
|
+
var ToolDetectedSchema = z8.object({
|
|
784
|
+
verdict: z8.string().optional(),
|
|
676
785
|
metadata: ToolEventMetadataSchema.optional(),
|
|
677
786
|
summary: ScanSummarySchema.optional(),
|
|
678
787
|
input_detected: IODetectedSchema.optional(),
|
|
679
788
|
output_detected: IODetectedSchema.optional()
|
|
680
|
-
});
|
|
681
|
-
var ScanResponseSchema =
|
|
682
|
-
source:
|
|
683
|
-
report_id:
|
|
684
|
-
scan_id:
|
|
685
|
-
tr_id:
|
|
686
|
-
session_id:
|
|
687
|
-
profile_id:
|
|
688
|
-
profile_name:
|
|
689
|
-
category:
|
|
690
|
-
action:
|
|
789
|
+
}).passthrough();
|
|
790
|
+
var ScanResponseSchema = z8.object({
|
|
791
|
+
source: z8.string().optional(),
|
|
792
|
+
report_id: z8.string(),
|
|
793
|
+
scan_id: z8.string(),
|
|
794
|
+
tr_id: z8.string().optional(),
|
|
795
|
+
session_id: z8.string().optional(),
|
|
796
|
+
profile_id: z8.string().optional(),
|
|
797
|
+
profile_name: z8.string().optional(),
|
|
798
|
+
category: z8.string(),
|
|
799
|
+
action: z8.string(),
|
|
800
|
+
timeout: z8.boolean().optional(),
|
|
801
|
+
error: z8.boolean().optional(),
|
|
802
|
+
errors: z8.array(ContentErrorSchema).optional(),
|
|
691
803
|
prompt_detected: PromptDetectedSchema.optional(),
|
|
692
804
|
response_detected: ResponseDetectedSchema.optional(),
|
|
693
805
|
prompt_masked_data: MaskedDataSchema.optional(),
|
|
@@ -695,221 +807,459 @@ var ScanResponseSchema = z7.object({
|
|
|
695
807
|
prompt_detection_details: PromptDetectionDetailsSchema.optional(),
|
|
696
808
|
response_detection_details: ResponseDetectionDetailsSchema.optional(),
|
|
697
809
|
tool_detected: ToolDetectedSchema.optional(),
|
|
698
|
-
created_at:
|
|
699
|
-
completed_at:
|
|
700
|
-
});
|
|
810
|
+
created_at: z8.string().optional(),
|
|
811
|
+
completed_at: z8.string().optional()
|
|
812
|
+
}).passthrough();
|
|
701
813
|
|
|
702
814
|
// src/models/async-scan.ts
|
|
703
|
-
import { z as
|
|
704
|
-
var AsyncScanObjectSchema =
|
|
705
|
-
req_id:
|
|
815
|
+
import { z as z9 } from "zod";
|
|
816
|
+
var AsyncScanObjectSchema = z9.object({
|
|
817
|
+
req_id: z9.number().int(),
|
|
706
818
|
scan_req: ScanRequestSchema
|
|
707
|
-
});
|
|
708
|
-
var AsyncScanResponseSchema =
|
|
709
|
-
received:
|
|
710
|
-
scan_id:
|
|
711
|
-
report_id:
|
|
712
|
-
source:
|
|
713
|
-
});
|
|
819
|
+
}).passthrough();
|
|
820
|
+
var AsyncScanResponseSchema = z9.object({
|
|
821
|
+
received: z9.string(),
|
|
822
|
+
scan_id: z9.string(),
|
|
823
|
+
report_id: z9.string().optional(),
|
|
824
|
+
source: z9.string().optional()
|
|
825
|
+
}).passthrough();
|
|
714
826
|
|
|
715
827
|
// src/models/scan-id-result.ts
|
|
716
|
-
import { z as
|
|
717
|
-
var ScanIdResultSchema =
|
|
718
|
-
source:
|
|
719
|
-
req_id:
|
|
720
|
-
status:
|
|
721
|
-
scan_id:
|
|
828
|
+
import { z as z10 } from "zod";
|
|
829
|
+
var ScanIdResultSchema = z10.object({
|
|
830
|
+
source: z10.string().optional(),
|
|
831
|
+
req_id: z10.number().optional(),
|
|
832
|
+
status: z10.string().optional(),
|
|
833
|
+
scan_id: z10.string().optional(),
|
|
722
834
|
result: ScanResponseSchema.optional()
|
|
723
|
-
});
|
|
835
|
+
}).passthrough();
|
|
724
836
|
|
|
725
837
|
// src/models/threat-report.ts
|
|
726
|
-
import { z as
|
|
838
|
+
import { z as z14 } from "zod";
|
|
727
839
|
|
|
728
840
|
// src/models/detection.ts
|
|
729
|
-
import { z as
|
|
841
|
+
import { z as z13 } from "zod";
|
|
730
842
|
|
|
731
843
|
// src/models/dlp-report.ts
|
|
732
|
-
import { z as
|
|
733
|
-
var DlpReportSchema =
|
|
734
|
-
dlp_report_id:
|
|
735
|
-
dlp_profile_name:
|
|
736
|
-
dlp_profile_id:
|
|
737
|
-
dlp_profile_version:
|
|
738
|
-
data_pattern_rule1_verdict:
|
|
739
|
-
data_pattern_rule2_verdict:
|
|
740
|
-
|
|
844
|
+
import { z as z11 } from "zod";
|
|
845
|
+
var DlpReportSchema = z11.object({
|
|
846
|
+
dlp_report_id: z11.string().optional(),
|
|
847
|
+
dlp_profile_name: z11.string().optional(),
|
|
848
|
+
dlp_profile_id: z11.string().optional(),
|
|
849
|
+
dlp_profile_version: z11.number().optional(),
|
|
850
|
+
data_pattern_rule1_verdict: z11.string().optional(),
|
|
851
|
+
data_pattern_rule2_verdict: z11.string().optional(),
|
|
852
|
+
data_pattern_detection_offsets: z11.array(DlpPatternDetectionSchema).optional()
|
|
853
|
+
}).passthrough();
|
|
741
854
|
|
|
742
855
|
// src/models/urlf-report.ts
|
|
743
|
-
import { z as
|
|
744
|
-
var UrlfEntrySchema =
|
|
745
|
-
url:
|
|
746
|
-
risk_level:
|
|
747
|
-
|
|
748
|
-
|
|
856
|
+
import { z as z12 } from "zod";
|
|
857
|
+
var UrlfEntrySchema = z12.object({
|
|
858
|
+
url: z12.string().optional(),
|
|
859
|
+
risk_level: z12.string().optional(),
|
|
860
|
+
action: z12.string().optional(),
|
|
861
|
+
categories: z12.array(z12.string()).optional()
|
|
862
|
+
}).passthrough();
|
|
749
863
|
|
|
750
864
|
// src/models/detection.ts
|
|
751
|
-
var DSDetailResultSchema =
|
|
752
|
-
urlf_report:
|
|
753
|
-
dlp_report: DlpReportSchema.optional()
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
865
|
+
var DSDetailResultSchema = z13.object({
|
|
866
|
+
urlf_report: z13.array(UrlfEntrySchema).optional(),
|
|
867
|
+
dlp_report: DlpReportSchema.optional(),
|
|
868
|
+
dbs_report: DbsReportSchema.optional(),
|
|
869
|
+
tc_report: TcReportSchema.optional(),
|
|
870
|
+
mc_report: McReportSchema.optional(),
|
|
871
|
+
agent_report: AgentReportSchema.optional(),
|
|
872
|
+
topic_guardrails_report: TgReportSchema.optional(),
|
|
873
|
+
cg_report: CgReportSchema.optional()
|
|
874
|
+
}).passthrough();
|
|
875
|
+
var DSResultMetadataSchema = z13.object({
|
|
876
|
+
score: z13.number().optional(),
|
|
877
|
+
confidence: z13.string().optional(),
|
|
878
|
+
ecosystem: z13.string().optional(),
|
|
879
|
+
method: z13.string().optional(),
|
|
880
|
+
server_name: z13.string().optional(),
|
|
881
|
+
tool_invoked: z13.string().optional(),
|
|
882
|
+
direction: z13.string().optional()
|
|
883
|
+
}).passthrough();
|
|
884
|
+
var DetectionServiceResultSchema = z13.object({
|
|
885
|
+
data_type: z13.string().optional(),
|
|
886
|
+
detection_service: z13.string().optional(),
|
|
887
|
+
verdict: z13.string().optional(),
|
|
888
|
+
action: z13.string().optional(),
|
|
764
889
|
metadata: DSResultMetadataSchema.optional(),
|
|
765
890
|
result_detail: DSDetailResultSchema.optional()
|
|
766
|
-
});
|
|
891
|
+
}).passthrough();
|
|
767
892
|
|
|
768
893
|
// src/models/threat-report.ts
|
|
769
|
-
var ThreatScanReportSchema =
|
|
770
|
-
source:
|
|
771
|
-
report_id:
|
|
772
|
-
scan_id:
|
|
773
|
-
req_id:
|
|
774
|
-
transaction_id:
|
|
775
|
-
session_id:
|
|
776
|
-
detection_results:
|
|
777
|
-
});
|
|
894
|
+
var ThreatScanReportSchema = z14.object({
|
|
895
|
+
source: z14.string().optional(),
|
|
896
|
+
report_id: z14.string().optional(),
|
|
897
|
+
scan_id: z14.string().optional(),
|
|
898
|
+
req_id: z14.number().optional(),
|
|
899
|
+
transaction_id: z14.string().optional(),
|
|
900
|
+
session_id: z14.string().optional(),
|
|
901
|
+
detection_results: z14.array(DetectionServiceResultSchema).optional()
|
|
902
|
+
}).passthrough();
|
|
778
903
|
|
|
779
904
|
// src/models/error-response.ts
|
|
780
|
-
import { z as
|
|
781
|
-
var ErrorResponseSchema =
|
|
782
|
-
status_code:
|
|
783
|
-
message:
|
|
784
|
-
error:
|
|
785
|
-
message:
|
|
905
|
+
import { z as z15 } from "zod";
|
|
906
|
+
var ErrorResponseSchema = z15.object({
|
|
907
|
+
status_code: z15.number().optional(),
|
|
908
|
+
message: z15.string().optional(),
|
|
909
|
+
error: z15.object({
|
|
910
|
+
message: z15.string().optional()
|
|
786
911
|
}).passthrough().optional(),
|
|
787
|
-
retry_after:
|
|
788
|
-
interval:
|
|
789
|
-
unit:
|
|
912
|
+
retry_after: z15.object({
|
|
913
|
+
interval: z15.number().optional(),
|
|
914
|
+
unit: z15.string().optional()
|
|
790
915
|
}).optional()
|
|
791
916
|
});
|
|
792
917
|
|
|
793
918
|
// src/models/mgmt-security-profile.ts
|
|
794
|
-
import { z as
|
|
795
|
-
var DlpDataProfileSchema =
|
|
796
|
-
profile_name:
|
|
797
|
-
active:
|
|
919
|
+
import { z as z16 } from "zod";
|
|
920
|
+
var DlpDataProfileSchema = z16.object({
|
|
921
|
+
profile_name: z16.string(),
|
|
922
|
+
active: z16.boolean().optional()
|
|
798
923
|
}).passthrough();
|
|
799
|
-
var DlpSchema =
|
|
800
|
-
dlp_status:
|
|
801
|
-
data_profiles:
|
|
924
|
+
var DlpSchema = z16.object({
|
|
925
|
+
dlp_status: z16.string().optional(),
|
|
926
|
+
data_profiles: z16.array(DlpDataProfileSchema).optional()
|
|
802
927
|
}).passthrough();
|
|
803
|
-
var DataLeakDetectionSchema =
|
|
804
|
-
"data-leak-detection-status":
|
|
928
|
+
var DataLeakDetectionSchema = z16.object({
|
|
929
|
+
"data-leak-detection-status": z16.string().optional(),
|
|
805
930
|
dlp: DlpSchema.optional()
|
|
806
931
|
}).passthrough();
|
|
807
|
-
var AppProtectionSchema =
|
|
808
|
-
"prompt-injection":
|
|
809
|
-
"jailbreak-detection":
|
|
932
|
+
var AppProtectionSchema = z16.object({
|
|
933
|
+
"prompt-injection": z16.string().optional(),
|
|
934
|
+
"jailbreak-detection": z16.string().optional()
|
|
810
935
|
}).passthrough();
|
|
811
|
-
var ModelProtectionSchema =
|
|
812
|
-
"model-denial-of-service":
|
|
936
|
+
var ModelProtectionSchema = z16.object({
|
|
937
|
+
"model-denial-of-service": z16.string().optional()
|
|
813
938
|
}).passthrough();
|
|
814
|
-
var AgentProtectionSchema =
|
|
815
|
-
"malicious-agent-activity":
|
|
939
|
+
var AgentProtectionSchema = z16.object({
|
|
940
|
+
"malicious-agent-activity": z16.string().optional()
|
|
816
941
|
}).passthrough();
|
|
817
|
-
var LatencySchema =
|
|
818
|
-
status:
|
|
819
|
-
max_latency_ms:
|
|
942
|
+
var LatencySchema = z16.object({
|
|
943
|
+
status: z16.string().optional(),
|
|
944
|
+
max_latency_ms: z16.number().optional()
|
|
820
945
|
}).passthrough();
|
|
821
|
-
var ModelConfigurationSchema =
|
|
946
|
+
var ModelConfigurationSchema = z16.object({
|
|
822
947
|
latency: LatencySchema.optional()
|
|
823
948
|
}).passthrough();
|
|
824
|
-
var PolicySchema =
|
|
949
|
+
var PolicySchema = z16.object({
|
|
825
950
|
"data-leak-detection": DataLeakDetectionSchema.optional(),
|
|
826
951
|
"app-protection": AppProtectionSchema.optional(),
|
|
827
952
|
"model-protection": ModelProtectionSchema.optional(),
|
|
828
953
|
"agent-protection": AgentProtectionSchema.optional(),
|
|
829
954
|
"model-configuration": ModelConfigurationSchema.optional()
|
|
830
955
|
}).passthrough();
|
|
831
|
-
var SecurityProfileSchema =
|
|
832
|
-
profile_id:
|
|
833
|
-
profile_name:
|
|
834
|
-
revision: z15.number().optional(),
|
|
835
|
-
active: z15.boolean().optional(),
|
|
836
|
-
policy: PolicySchema.optional(),
|
|
837
|
-
created_by: z15.string().optional(),
|
|
838
|
-
updated_by: z15.string().optional(),
|
|
839
|
-
last_modified_ts: z15.string().optional()
|
|
840
|
-
}).passthrough();
|
|
841
|
-
var CreateSecurityProfileRequestSchema = z15.object({
|
|
842
|
-
profile_id: z15.string().optional(),
|
|
843
|
-
profile_name: z15.string(),
|
|
844
|
-
revision: z15.number().optional(),
|
|
845
|
-
active: z15.boolean().optional(),
|
|
846
|
-
policy: PolicySchema.optional(),
|
|
847
|
-
created_by: z15.string().optional(),
|
|
848
|
-
updated_by: z15.string().optional(),
|
|
849
|
-
last_modified_ts: z15.string().optional()
|
|
850
|
-
}).passthrough();
|
|
851
|
-
var SecurityProfileListResponseSchema = z15.object({
|
|
852
|
-
ai_profiles: z15.array(SecurityProfileSchema),
|
|
853
|
-
next_offset: z15.number().optional()
|
|
854
|
-
}).passthrough();
|
|
855
|
-
var DeleteProfileResponseSchema = z15.object({
|
|
856
|
-
message: z15.string()
|
|
857
|
-
}).passthrough();
|
|
858
|
-
var DeleteProfileConflictSchema = z15.object({
|
|
859
|
-
message: z15.string(),
|
|
860
|
-
payload: z15.array(
|
|
861
|
-
z15.object({
|
|
862
|
-
policy_id: z15.string(),
|
|
863
|
-
policy_name: z15.string(),
|
|
864
|
-
priority: z15.number()
|
|
865
|
-
}).passthrough()
|
|
866
|
-
)
|
|
867
|
-
}).passthrough();
|
|
868
|
-
|
|
869
|
-
// src/models/mgmt-custom-topic.ts
|
|
870
|
-
import { z as z16 } from "zod";
|
|
871
|
-
var CustomTopicSchema = z16.object({
|
|
872
|
-
topic_id: z16.string().optional(),
|
|
873
|
-
topic_name: z16.string(),
|
|
956
|
+
var SecurityProfileSchema = z16.object({
|
|
957
|
+
profile_id: z16.string().optional(),
|
|
958
|
+
profile_name: z16.string(),
|
|
874
959
|
revision: z16.number().optional(),
|
|
875
960
|
active: z16.boolean().optional(),
|
|
876
|
-
|
|
877
|
-
examples: z16.array(z16.string()).optional(),
|
|
961
|
+
policy: PolicySchema.optional(),
|
|
878
962
|
created_by: z16.string().optional(),
|
|
879
963
|
updated_by: z16.string().optional(),
|
|
880
|
-
last_modified_ts: z16.string().optional()
|
|
881
|
-
created_ts: z16.string().optional()
|
|
964
|
+
last_modified_ts: z16.string().optional()
|
|
882
965
|
}).passthrough();
|
|
883
|
-
var
|
|
884
|
-
|
|
885
|
-
|
|
966
|
+
var CreateSecurityProfileRequestSchema = z16.object({
|
|
967
|
+
profile_id: z16.string().optional(),
|
|
968
|
+
profile_name: z16.string(),
|
|
886
969
|
revision: z16.number().optional(),
|
|
887
970
|
active: z16.boolean().optional(),
|
|
888
|
-
|
|
889
|
-
examples: z16.array(z16.string()).optional(),
|
|
971
|
+
policy: PolicySchema.optional(),
|
|
890
972
|
created_by: z16.string().optional(),
|
|
891
973
|
updated_by: z16.string().optional(),
|
|
892
|
-
last_modified_ts: z16.string().optional()
|
|
893
|
-
created_ts: z16.string().optional()
|
|
974
|
+
last_modified_ts: z16.string().optional()
|
|
894
975
|
}).passthrough();
|
|
895
|
-
var
|
|
896
|
-
|
|
976
|
+
var SecurityProfileListResponseSchema = z16.object({
|
|
977
|
+
ai_profiles: z16.array(SecurityProfileSchema),
|
|
897
978
|
next_offset: z16.number().optional()
|
|
898
979
|
}).passthrough();
|
|
899
|
-
var
|
|
980
|
+
var DeleteProfileResponseSchema = z16.object({
|
|
900
981
|
message: z16.string()
|
|
901
982
|
}).passthrough();
|
|
902
|
-
var
|
|
983
|
+
var DeleteProfileConflictSchema = z16.object({
|
|
903
984
|
message: z16.string(),
|
|
904
985
|
payload: z16.array(
|
|
905
986
|
z16.object({
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
987
|
+
policy_id: z16.string(),
|
|
988
|
+
policy_name: z16.string(),
|
|
989
|
+
priority: z16.number()
|
|
990
|
+
}).passthrough()
|
|
991
|
+
)
|
|
992
|
+
}).passthrough();
|
|
993
|
+
|
|
994
|
+
// src/models/mgmt-custom-topic.ts
|
|
995
|
+
import { z as z17 } from "zod";
|
|
996
|
+
var CustomTopicSchema = z17.object({
|
|
997
|
+
topic_id: z17.string().optional(),
|
|
998
|
+
topic_name: z17.string(),
|
|
999
|
+
revision: z17.number().optional(),
|
|
1000
|
+
active: z17.boolean().optional(),
|
|
1001
|
+
description: z17.string().optional(),
|
|
1002
|
+
examples: z17.array(z17.string()).optional(),
|
|
1003
|
+
created_by: z17.string().optional(),
|
|
1004
|
+
updated_by: z17.string().optional(),
|
|
1005
|
+
last_modified_ts: z17.string().optional(),
|
|
1006
|
+
created_ts: z17.string().optional()
|
|
1007
|
+
}).passthrough();
|
|
1008
|
+
var CreateCustomTopicRequestSchema = z17.object({
|
|
1009
|
+
topic_id: z17.string().optional(),
|
|
1010
|
+
topic_name: z17.string(),
|
|
1011
|
+
revision: z17.number().optional(),
|
|
1012
|
+
active: z17.boolean().optional(),
|
|
1013
|
+
description: z17.string().optional(),
|
|
1014
|
+
examples: z17.array(z17.string()).optional(),
|
|
1015
|
+
created_by: z17.string().optional(),
|
|
1016
|
+
updated_by: z17.string().optional(),
|
|
1017
|
+
last_modified_ts: z17.string().optional(),
|
|
1018
|
+
created_ts: z17.string().optional()
|
|
1019
|
+
}).passthrough();
|
|
1020
|
+
var CustomTopicListResponseSchema = z17.object({
|
|
1021
|
+
custom_topics: z17.array(CustomTopicSchema),
|
|
1022
|
+
next_offset: z17.number().optional()
|
|
1023
|
+
}).passthrough();
|
|
1024
|
+
var DeleteTopicResponseSchema = z17.object({
|
|
1025
|
+
message: z17.string()
|
|
1026
|
+
}).passthrough();
|
|
1027
|
+
var DeleteTopicConflictSchema = z17.object({
|
|
1028
|
+
message: z17.string(),
|
|
1029
|
+
payload: z17.array(
|
|
1030
|
+
z17.object({
|
|
1031
|
+
profile_id: z17.string(),
|
|
1032
|
+
profile_name: z17.string(),
|
|
1033
|
+
revision: z17.number()
|
|
909
1034
|
}).passthrough()
|
|
910
1035
|
)
|
|
911
1036
|
}).passthrough();
|
|
912
1037
|
|
|
1038
|
+
// src/models/mgmt-api-key.ts
|
|
1039
|
+
import { z as z18 } from "zod";
|
|
1040
|
+
var ApiKeySchema = z18.object({
|
|
1041
|
+
api_key_id: z18.string(),
|
|
1042
|
+
api_key_last8: z18.string(),
|
|
1043
|
+
api_key_name: z18.string().optional(),
|
|
1044
|
+
auth_code: z18.string(),
|
|
1045
|
+
csp_id: z18.string().optional(),
|
|
1046
|
+
tsg_id: z18.string().optional(),
|
|
1047
|
+
expiration: z18.string(),
|
|
1048
|
+
revoked: z18.boolean(),
|
|
1049
|
+
revoke_reason: z18.string().optional(),
|
|
1050
|
+
cust_app: z18.string().optional(),
|
|
1051
|
+
cust_env: z18.string().optional(),
|
|
1052
|
+
cust_ai_agent_framework: z18.string().optional(),
|
|
1053
|
+
cust_cloud_provider: z18.string().optional(),
|
|
1054
|
+
created_by: z18.string().optional(),
|
|
1055
|
+
updated_by: z18.string().optional(),
|
|
1056
|
+
last_modified_ts: z18.string().optional(),
|
|
1057
|
+
rotation_time_interval: z18.number().optional(),
|
|
1058
|
+
rotation_time_unit: z18.string().optional(),
|
|
1059
|
+
dp_name: z18.string().optional(),
|
|
1060
|
+
status: z18.string().optional(),
|
|
1061
|
+
api_key: z18.string().optional(),
|
|
1062
|
+
lic_expiration: z18.string().optional(),
|
|
1063
|
+
avg_text_records: z18.number().optional(),
|
|
1064
|
+
creation_ts: z18.string().optional(),
|
|
1065
|
+
customer_appId: z18.string().optional()
|
|
1066
|
+
}).passthrough();
|
|
1067
|
+
var ApiKeyCreateRequestSchema = z18.object({
|
|
1068
|
+
dp_name: z18.string().optional(),
|
|
1069
|
+
auth_code: z18.string(),
|
|
1070
|
+
cust_app: z18.string(),
|
|
1071
|
+
cust_env: z18.string().optional(),
|
|
1072
|
+
cust_cloud_provider: z18.string().optional(),
|
|
1073
|
+
cust_ai_agent_framework: z18.string().optional(),
|
|
1074
|
+
revoked: z18.boolean(),
|
|
1075
|
+
created_by: z18.string(),
|
|
1076
|
+
api_key_name: z18.string(),
|
|
1077
|
+
rotation_time_interval: z18.number(),
|
|
1078
|
+
rotation_time_unit: z18.string()
|
|
1079
|
+
});
|
|
1080
|
+
var ApiKeyRegenerateRequestSchema = z18.object({
|
|
1081
|
+
rotation_time_interval: z18.number(),
|
|
1082
|
+
rotation_time_unit: z18.string(),
|
|
1083
|
+
updated_by: z18.string().optional()
|
|
1084
|
+
});
|
|
1085
|
+
var ApiKeyListResponseSchema = z18.object({
|
|
1086
|
+
api_keys: z18.array(ApiKeySchema).optional(),
|
|
1087
|
+
next_offset: z18.number().optional()
|
|
1088
|
+
}).passthrough();
|
|
1089
|
+
var ApiKeyDeleteResponseSchema = z18.object({
|
|
1090
|
+
message: z18.string().optional()
|
|
1091
|
+
}).passthrough();
|
|
1092
|
+
|
|
1093
|
+
// src/models/mgmt-customer-app.ts
|
|
1094
|
+
import { z as z19 } from "zod";
|
|
1095
|
+
var ApiKeyDPInfoSchema = z19.object({
|
|
1096
|
+
api_key_name: z19.string(),
|
|
1097
|
+
dp_name: z19.string(),
|
|
1098
|
+
auth_code: z19.string()
|
|
1099
|
+
}).passthrough();
|
|
1100
|
+
var CustomerAppSchema = z19.object({
|
|
1101
|
+
customer_appId: z19.string().optional(),
|
|
1102
|
+
tsg_id: z19.string(),
|
|
1103
|
+
app_name: z19.string(),
|
|
1104
|
+
model_name: z19.string().optional(),
|
|
1105
|
+
cloud_provider: z19.string(),
|
|
1106
|
+
environment: z19.string(),
|
|
1107
|
+
status: z19.string().optional(),
|
|
1108
|
+
created_by: z19.string().optional(),
|
|
1109
|
+
updated_by: z19.string().optional(),
|
|
1110
|
+
ai_agent_framework: z19.string().optional()
|
|
1111
|
+
}).passthrough();
|
|
1112
|
+
var CustomerAppWithKeysSchema = z19.object({
|
|
1113
|
+
customer_appId: z19.string(),
|
|
1114
|
+
tsg_id: z19.string(),
|
|
1115
|
+
app_name: z19.string(),
|
|
1116
|
+
model_name: z19.string().optional(),
|
|
1117
|
+
cloud_provider: z19.string(),
|
|
1118
|
+
environment: z19.string(),
|
|
1119
|
+
ai_agent_framework: z19.string().optional(),
|
|
1120
|
+
api_keys_dp_info: z19.array(ApiKeyDPInfoSchema).optional()
|
|
1121
|
+
}).passthrough();
|
|
1122
|
+
var CustomerAppListResponseSchema = z19.object({
|
|
1123
|
+
customer_apps: z19.array(CustomerAppWithKeysSchema).optional(),
|
|
1124
|
+
next_offset: z19.number().optional()
|
|
1125
|
+
}).passthrough();
|
|
1126
|
+
|
|
1127
|
+
// src/models/mgmt-deployment-profile.ts
|
|
1128
|
+
import { z as z20 } from "zod";
|
|
1129
|
+
var DeploymentProfileEntrySchema = z20.object({
|
|
1130
|
+
dp_name: z20.string(),
|
|
1131
|
+
auth_code: z20.string(),
|
|
1132
|
+
tsg_id: z20.string().optional(),
|
|
1133
|
+
status: z20.string().optional(),
|
|
1134
|
+
expiration_date: z20.string().optional(),
|
|
1135
|
+
ave_text_records: z20.number().optional()
|
|
1136
|
+
}).passthrough();
|
|
1137
|
+
var DeploymentProfilesResponseSchema = z20.object({
|
|
1138
|
+
deployment_profiles: z20.array(DeploymentProfileEntrySchema),
|
|
1139
|
+
status: z20.string()
|
|
1140
|
+
}).passthrough();
|
|
1141
|
+
|
|
1142
|
+
// src/models/mgmt-dlp-profile.ts
|
|
1143
|
+
import { z as z21 } from "zod";
|
|
1144
|
+
var DlpDataProfileSchema2 = z21.object({
|
|
1145
|
+
name: z21.string(),
|
|
1146
|
+
uuid: z21.string(),
|
|
1147
|
+
id: z21.string().optional(),
|
|
1148
|
+
version: z21.string().optional(),
|
|
1149
|
+
rule1: z21.object({ action: z21.string().optional() }).passthrough().optional(),
|
|
1150
|
+
rule2: z21.object({ action: z21.string().optional() }).passthrough().optional(),
|
|
1151
|
+
"log-severity": z21.string().optional(),
|
|
1152
|
+
"non-file-based": z21.string().optional(),
|
|
1153
|
+
"file-based": z21.string().optional()
|
|
1154
|
+
}).passthrough();
|
|
1155
|
+
var DlpProfileListResponseSchema = z21.object({
|
|
1156
|
+
dlp_profiles: z21.array(DlpDataProfileSchema2).optional()
|
|
1157
|
+
}).passthrough();
|
|
1158
|
+
|
|
1159
|
+
// src/models/mgmt-scan-log.ts
|
|
1160
|
+
import { z as z22 } from "zod";
|
|
1161
|
+
var ScanResultEntrySchema = z22.object({
|
|
1162
|
+
csp_id: z22.string(),
|
|
1163
|
+
tsg_id: z22.string(),
|
|
1164
|
+
scan_id: z22.string(),
|
|
1165
|
+
scan_sub_req_id: z22.number(),
|
|
1166
|
+
api_key_name: z22.string(),
|
|
1167
|
+
app_name: z22.string(),
|
|
1168
|
+
tokens: z22.number(),
|
|
1169
|
+
text_records: z22.number(),
|
|
1170
|
+
transaction_id: z22.string().optional(),
|
|
1171
|
+
profile_id: z22.string().optional(),
|
|
1172
|
+
profile_name: z22.string().optional(),
|
|
1173
|
+
model_name: z22.string().optional(),
|
|
1174
|
+
user: z22.string().optional(),
|
|
1175
|
+
environment: z22.string().optional(),
|
|
1176
|
+
cloud_provider: z22.string().optional(),
|
|
1177
|
+
agent_framework: z22.string().optional(),
|
|
1178
|
+
report_id: z22.string().optional(),
|
|
1179
|
+
received_ts: z22.string().optional(),
|
|
1180
|
+
completed_ts: z22.string().optional(),
|
|
1181
|
+
status: z22.string().optional(),
|
|
1182
|
+
verdict: z22.string().optional(),
|
|
1183
|
+
action: z22.string().optional(),
|
|
1184
|
+
is_prompt: z22.boolean().optional(),
|
|
1185
|
+
is_response: z22.boolean().optional(),
|
|
1186
|
+
pi_final_verdict: z22.string().optional(),
|
|
1187
|
+
uf_final_verdict: z22.string().optional(),
|
|
1188
|
+
dlp_final_verdict: z22.string().optional(),
|
|
1189
|
+
dbs_final_verdict: z22.string().optional(),
|
|
1190
|
+
tc_final_verdict: z22.string().optional(),
|
|
1191
|
+
mc_final_verdict: z22.string().optional(),
|
|
1192
|
+
agent_final_verdict: z22.string().optional(),
|
|
1193
|
+
cg_final_verdict: z22.string().optional(),
|
|
1194
|
+
tg_final_verdict: z22.string().optional(),
|
|
1195
|
+
prompt_pi_verdict: z22.string().optional(),
|
|
1196
|
+
prompt_uf_verdict: z22.string().optional(),
|
|
1197
|
+
prompt_dlp_verdict: z22.string().optional(),
|
|
1198
|
+
prompt_tc_verdict: z22.string().optional(),
|
|
1199
|
+
prompt_mc_verdict: z22.string().optional(),
|
|
1200
|
+
prompt_agent_verdict: z22.string().optional(),
|
|
1201
|
+
prompt_tg_verdict: z22.string().optional(),
|
|
1202
|
+
prompt_verdict: z22.string().optional(),
|
|
1203
|
+
prompt_pi_action: z22.string().optional(),
|
|
1204
|
+
prompt_uf_action: z22.string().optional(),
|
|
1205
|
+
prompt_dlp_action: z22.string().optional(),
|
|
1206
|
+
prompt_tc_action: z22.string().optional(),
|
|
1207
|
+
prompt_mc_action: z22.string().optional(),
|
|
1208
|
+
prompt_agent_action: z22.string().optional(),
|
|
1209
|
+
prompt_tg_action: z22.string().optional(),
|
|
1210
|
+
response_uf_verdict: z22.string().optional(),
|
|
1211
|
+
response_dlp_verdict: z22.string().optional(),
|
|
1212
|
+
response_dbs_verdict: z22.string().optional(),
|
|
1213
|
+
response_tc_verdict: z22.string().optional(),
|
|
1214
|
+
response_mc_verdict: z22.string().optional(),
|
|
1215
|
+
response_agent_verdict: z22.string().optional(),
|
|
1216
|
+
response_cg_verdict: z22.string().optional(),
|
|
1217
|
+
response_tg_verdict: z22.string().optional(),
|
|
1218
|
+
response_uf_action: z22.string().optional(),
|
|
1219
|
+
response_dlp_action: z22.string().optional(),
|
|
1220
|
+
response_dbs_action: z22.string().optional(),
|
|
1221
|
+
response_tc_action: z22.string().optional(),
|
|
1222
|
+
response_mc_action: z22.string().optional(),
|
|
1223
|
+
response_agent_action: z22.string().optional(),
|
|
1224
|
+
response_cg_action: z22.string().optional(),
|
|
1225
|
+
response_tg_action: z22.string().optional(),
|
|
1226
|
+
response_verdict: z22.string().optional(),
|
|
1227
|
+
detection_service_flags: z22.number().optional(),
|
|
1228
|
+
content_masked: z22.boolean().optional(),
|
|
1229
|
+
user_ip: z22.string().optional()
|
|
1230
|
+
}).passthrough();
|
|
1231
|
+
var ScanResultForDashboardSchema = z22.object({
|
|
1232
|
+
text_records_count: z22.number().optional(),
|
|
1233
|
+
api_calls_count: z22.number().optional(),
|
|
1234
|
+
threats_count: z22.number().optional(),
|
|
1235
|
+
all_transactions_count: z22.number().optional(),
|
|
1236
|
+
benign_transaction_count: z22.number().optional(),
|
|
1237
|
+
scan_result_entries: z22.array(ScanResultEntrySchema).optional()
|
|
1238
|
+
}).passthrough();
|
|
1239
|
+
var PaginatedScanResultsSchema = z22.object({
|
|
1240
|
+
scan_result_for_dashboard: ScanResultForDashboardSchema.optional(),
|
|
1241
|
+
total_pages: z22.number().optional(),
|
|
1242
|
+
page_number: z22.number().optional(),
|
|
1243
|
+
page_size: z22.number().optional(),
|
|
1244
|
+
page_token: z22.string().optional(),
|
|
1245
|
+
revision: z22.number().optional()
|
|
1246
|
+
}).passthrough();
|
|
1247
|
+
|
|
1248
|
+
// src/models/mgmt-oauth.ts
|
|
1249
|
+
import { z as z23 } from "zod";
|
|
1250
|
+
var ClientIdAndCustomerAppSchema = z23.object({
|
|
1251
|
+
client_id: z23.string(),
|
|
1252
|
+
customer_app: z23.string()
|
|
1253
|
+
});
|
|
1254
|
+
var Oauth2TokenSchema = z23.object({
|
|
1255
|
+
token_type: z23.string().optional(),
|
|
1256
|
+
issued_at: z23.string().optional(),
|
|
1257
|
+
client_id: z23.string().optional(),
|
|
1258
|
+
access_token: z23.string(),
|
|
1259
|
+
expires_in: z23.string().optional(),
|
|
1260
|
+
status: z23.string().optional()
|
|
1261
|
+
}).passthrough();
|
|
1262
|
+
|
|
913
1263
|
// src/models/model-security-enums.ts
|
|
914
1264
|
var ErrorCodes = {
|
|
915
1265
|
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
@@ -1040,240 +1390,240 @@ var RuleFieldValueKey = {
|
|
|
1040
1390
|
};
|
|
1041
1391
|
|
|
1042
1392
|
// src/models/model-security.ts
|
|
1043
|
-
import { z as
|
|
1044
|
-
var ModelSecurityPaginationSchema =
|
|
1045
|
-
total_items:
|
|
1393
|
+
import { z as z24 } from "zod";
|
|
1394
|
+
var ModelSecurityPaginationSchema = z24.object({
|
|
1395
|
+
total_items: z24.number().int().nullable().optional()
|
|
1046
1396
|
}).passthrough();
|
|
1047
|
-
var LabelSchema =
|
|
1048
|
-
key:
|
|
1049
|
-
value:
|
|
1397
|
+
var LabelSchema = z24.object({
|
|
1398
|
+
key: z24.string(),
|
|
1399
|
+
value: z24.string()
|
|
1050
1400
|
});
|
|
1051
|
-
var LabelsCreateRequestSchema =
|
|
1052
|
-
labels:
|
|
1401
|
+
var LabelsCreateRequestSchema = z24.object({
|
|
1402
|
+
labels: z24.array(LabelSchema)
|
|
1053
1403
|
});
|
|
1054
|
-
var LabelsResponseSchema =
|
|
1055
|
-
var LabelKeyListSchema =
|
|
1404
|
+
var LabelsResponseSchema = z24.object({}).passthrough();
|
|
1405
|
+
var LabelKeyListSchema = z24.object({
|
|
1056
1406
|
pagination: ModelSecurityPaginationSchema,
|
|
1057
|
-
keys:
|
|
1407
|
+
keys: z24.array(z24.string())
|
|
1058
1408
|
}).passthrough();
|
|
1059
|
-
var LabelValueListSchema =
|
|
1409
|
+
var LabelValueListSchema = z24.object({
|
|
1060
1410
|
pagination: ModelSecurityPaginationSchema,
|
|
1061
|
-
values:
|
|
1062
|
-
}).passthrough();
|
|
1063
|
-
var EvalSummarySchema =
|
|
1064
|
-
rules_failed:
|
|
1065
|
-
rules_passed:
|
|
1066
|
-
total_rules:
|
|
1067
|
-
}).passthrough();
|
|
1068
|
-
var ModelScanIssueSchema =
|
|
1069
|
-
description:
|
|
1070
|
-
source:
|
|
1071
|
-
threat:
|
|
1072
|
-
module:
|
|
1073
|
-
operator:
|
|
1074
|
-
}).passthrough();
|
|
1075
|
-
var FileScanDataSchema =
|
|
1076
|
-
file_path:
|
|
1077
|
-
modelscan_status:
|
|
1078
|
-
blob_id:
|
|
1079
|
-
error_message:
|
|
1080
|
-
formats:
|
|
1081
|
-
issues_detected:
|
|
1082
|
-
}).passthrough();
|
|
1083
|
-
var ScanDetailsSchema =
|
|
1084
|
-
scanner_version:
|
|
1085
|
-
time_started:
|
|
1086
|
-
files:
|
|
1087
|
-
total_files_scanned:
|
|
1088
|
-
total_files_skipped:
|
|
1089
|
-
model_formats:
|
|
1090
|
-
model_size_bytes:
|
|
1091
|
-
scan_duration_ms:
|
|
1092
|
-
error_code:
|
|
1093
|
-
error_message:
|
|
1411
|
+
values: z24.array(z24.string())
|
|
1412
|
+
}).passthrough();
|
|
1413
|
+
var EvalSummarySchema = z24.object({
|
|
1414
|
+
rules_failed: z24.number().int().optional().default(0),
|
|
1415
|
+
rules_passed: z24.number().int().optional().default(0),
|
|
1416
|
+
total_rules: z24.number().int().optional().default(0)
|
|
1417
|
+
}).passthrough();
|
|
1418
|
+
var ModelScanIssueSchema = z24.object({
|
|
1419
|
+
description: z24.string(),
|
|
1420
|
+
source: z24.string(),
|
|
1421
|
+
threat: z24.string().nullable().optional(),
|
|
1422
|
+
module: z24.string().nullable().optional(),
|
|
1423
|
+
operator: z24.string().nullable().optional()
|
|
1424
|
+
}).passthrough();
|
|
1425
|
+
var FileScanDataSchema = z24.object({
|
|
1426
|
+
file_path: z24.string(),
|
|
1427
|
+
modelscan_status: z24.string(),
|
|
1428
|
+
blob_id: z24.string(),
|
|
1429
|
+
error_message: z24.string().nullable().optional(),
|
|
1430
|
+
formats: z24.array(z24.string()).nullable().optional(),
|
|
1431
|
+
issues_detected: z24.array(ModelScanIssueSchema).nullable().optional()
|
|
1432
|
+
}).passthrough();
|
|
1433
|
+
var ScanDetailsSchema = z24.object({
|
|
1434
|
+
scanner_version: z24.string(),
|
|
1435
|
+
time_started: z24.string(),
|
|
1436
|
+
files: z24.array(FileScanDataSchema),
|
|
1437
|
+
total_files_scanned: z24.number().int(),
|
|
1438
|
+
total_files_skipped: z24.number().int(),
|
|
1439
|
+
model_formats: z24.array(z24.string()),
|
|
1440
|
+
model_size_bytes: z24.number().int(),
|
|
1441
|
+
scan_duration_ms: z24.number().int(),
|
|
1442
|
+
error_code: z24.string().nullable().optional(),
|
|
1443
|
+
error_message: z24.string().nullable().optional()
|
|
1094
1444
|
});
|
|
1095
|
-
var ScanCreateRequestSchema =
|
|
1096
|
-
model_uri:
|
|
1097
|
-
security_group_uuid:
|
|
1098
|
-
scan_origin:
|
|
1099
|
-
allow_patterns:
|
|
1100
|
-
ignore_patterns:
|
|
1101
|
-
labels:
|
|
1102
|
-
model_author:
|
|
1103
|
-
model_name:
|
|
1104
|
-
model_version:
|
|
1445
|
+
var ScanCreateRequestSchema = z24.object({
|
|
1446
|
+
model_uri: z24.string(),
|
|
1447
|
+
security_group_uuid: z24.string(),
|
|
1448
|
+
scan_origin: z24.string(),
|
|
1449
|
+
allow_patterns: z24.array(z24.string()).nullable().optional(),
|
|
1450
|
+
ignore_patterns: z24.array(z24.string()).nullable().optional(),
|
|
1451
|
+
labels: z24.array(LabelSchema).nullable().optional(),
|
|
1452
|
+
model_author: z24.string().nullable().optional(),
|
|
1453
|
+
model_name: z24.string().nullable().optional(),
|
|
1454
|
+
model_version: z24.string().nullable().optional(),
|
|
1105
1455
|
scan_details: ScanDetailsSchema.nullable().optional()
|
|
1106
1456
|
});
|
|
1107
|
-
var ScanBaseResponseSchema =
|
|
1108
|
-
uuid:
|
|
1109
|
-
tsg_id:
|
|
1110
|
-
created_at:
|
|
1111
|
-
updated_at:
|
|
1112
|
-
model_uri:
|
|
1113
|
-
owner:
|
|
1114
|
-
scan_origin:
|
|
1115
|
-
security_group_uuid:
|
|
1116
|
-
security_group_name:
|
|
1117
|
-
model_version_uuid:
|
|
1118
|
-
eval_outcome:
|
|
1119
|
-
source_type:
|
|
1120
|
-
created_by:
|
|
1121
|
-
enabled_rule_count_snapshot:
|
|
1122
|
-
error_code:
|
|
1123
|
-
error_message:
|
|
1457
|
+
var ScanBaseResponseSchema = z24.object({
|
|
1458
|
+
uuid: z24.string(),
|
|
1459
|
+
tsg_id: z24.string(),
|
|
1460
|
+
created_at: z24.string(),
|
|
1461
|
+
updated_at: z24.string(),
|
|
1462
|
+
model_uri: z24.string(),
|
|
1463
|
+
owner: z24.string(),
|
|
1464
|
+
scan_origin: z24.string(),
|
|
1465
|
+
security_group_uuid: z24.string(),
|
|
1466
|
+
security_group_name: z24.string(),
|
|
1467
|
+
model_version_uuid: z24.string(),
|
|
1468
|
+
eval_outcome: z24.string(),
|
|
1469
|
+
source_type: z24.string(),
|
|
1470
|
+
created_by: z24.string().nullable().optional(),
|
|
1471
|
+
enabled_rule_count_snapshot: z24.number().int().nullable().optional(),
|
|
1472
|
+
error_code: z24.string().nullable().optional(),
|
|
1473
|
+
error_message: z24.string().nullable().optional(),
|
|
1124
1474
|
eval_summary: EvalSummarySchema.nullable().optional(),
|
|
1125
|
-
labels:
|
|
1126
|
-
model_formats:
|
|
1127
|
-
scanner_version:
|
|
1128
|
-
time_started:
|
|
1129
|
-
total_files_scanned:
|
|
1130
|
-
total_files_skipped:
|
|
1131
|
-
}).passthrough();
|
|
1132
|
-
var ScanListSchema =
|
|
1475
|
+
labels: z24.array(LabelSchema).optional(),
|
|
1476
|
+
model_formats: z24.array(z24.string()).nullable().optional(),
|
|
1477
|
+
scanner_version: z24.string().nullable().optional(),
|
|
1478
|
+
time_started: z24.string().nullable().optional(),
|
|
1479
|
+
total_files_scanned: z24.number().int().nullable().optional(),
|
|
1480
|
+
total_files_skipped: z24.number().int().nullable().optional()
|
|
1481
|
+
}).passthrough();
|
|
1482
|
+
var ScanListSchema = z24.object({
|
|
1133
1483
|
pagination: ModelSecurityPaginationSchema,
|
|
1134
|
-
scans:
|
|
1135
|
-
}).passthrough();
|
|
1136
|
-
var FileResponseSchema =
|
|
1137
|
-
uuid:
|
|
1138
|
-
tsg_id:
|
|
1139
|
-
created_at:
|
|
1140
|
-
updated_at:
|
|
1141
|
-
path:
|
|
1142
|
-
parent_path:
|
|
1143
|
-
type:
|
|
1144
|
-
result:
|
|
1145
|
-
model_version_uuid:
|
|
1146
|
-
blob_id:
|
|
1147
|
-
formats:
|
|
1148
|
-
scan_uuid:
|
|
1149
|
-
}).passthrough();
|
|
1150
|
-
var FileListSchema =
|
|
1484
|
+
scans: z24.array(ScanBaseResponseSchema)
|
|
1485
|
+
}).passthrough();
|
|
1486
|
+
var FileResponseSchema = z24.object({
|
|
1487
|
+
uuid: z24.string(),
|
|
1488
|
+
tsg_id: z24.string(),
|
|
1489
|
+
created_at: z24.string(),
|
|
1490
|
+
updated_at: z24.string(),
|
|
1491
|
+
path: z24.string(),
|
|
1492
|
+
parent_path: z24.string(),
|
|
1493
|
+
type: z24.string(),
|
|
1494
|
+
result: z24.string(),
|
|
1495
|
+
model_version_uuid: z24.string(),
|
|
1496
|
+
blob_id: z24.string().nullable().optional(),
|
|
1497
|
+
formats: z24.array(z24.string()).nullable().optional(),
|
|
1498
|
+
scan_uuid: z24.string().nullable().optional()
|
|
1499
|
+
}).passthrough();
|
|
1500
|
+
var FileListSchema = z24.object({
|
|
1151
1501
|
pagination: ModelSecurityPaginationSchema,
|
|
1152
|
-
files:
|
|
1153
|
-
}).passthrough();
|
|
1154
|
-
var RuleEvaluationResponseSchema =
|
|
1155
|
-
uuid:
|
|
1156
|
-
tsg_id:
|
|
1157
|
-
created_at:
|
|
1158
|
-
updated_at:
|
|
1159
|
-
result:
|
|
1160
|
-
violation_count:
|
|
1161
|
-
rule_instance_uuid:
|
|
1162
|
-
scan_uuid:
|
|
1163
|
-
rule_name:
|
|
1164
|
-
rule_description:
|
|
1165
|
-
rule_instance_state:
|
|
1166
|
-
}).passthrough();
|
|
1167
|
-
var RuleEvaluationListSchema =
|
|
1502
|
+
files: z24.array(FileResponseSchema)
|
|
1503
|
+
}).passthrough();
|
|
1504
|
+
var RuleEvaluationResponseSchema = z24.object({
|
|
1505
|
+
uuid: z24.string(),
|
|
1506
|
+
tsg_id: z24.string(),
|
|
1507
|
+
created_at: z24.string(),
|
|
1508
|
+
updated_at: z24.string(),
|
|
1509
|
+
result: z24.string(),
|
|
1510
|
+
violation_count: z24.number().int(),
|
|
1511
|
+
rule_instance_uuid: z24.string(),
|
|
1512
|
+
scan_uuid: z24.string(),
|
|
1513
|
+
rule_name: z24.string(),
|
|
1514
|
+
rule_description: z24.string(),
|
|
1515
|
+
rule_instance_state: z24.string()
|
|
1516
|
+
}).passthrough();
|
|
1517
|
+
var RuleEvaluationListSchema = z24.object({
|
|
1168
1518
|
pagination: ModelSecurityPaginationSchema,
|
|
1169
|
-
evaluations:
|
|
1170
|
-
}).passthrough();
|
|
1171
|
-
var ViolationResponseSchema =
|
|
1172
|
-
uuid:
|
|
1173
|
-
tsg_id:
|
|
1174
|
-
created_at:
|
|
1175
|
-
updated_at:
|
|
1176
|
-
description:
|
|
1177
|
-
rule_instance_uuid:
|
|
1178
|
-
rule_name:
|
|
1179
|
-
rule_description:
|
|
1180
|
-
rule_instance_state:
|
|
1181
|
-
file:
|
|
1182
|
-
hash:
|
|
1183
|
-
module:
|
|
1184
|
-
operator:
|
|
1185
|
-
threat:
|
|
1186
|
-
threat_description:
|
|
1187
|
-
}).passthrough();
|
|
1188
|
-
var ViolationListSchema =
|
|
1519
|
+
evaluations: z24.array(RuleEvaluationResponseSchema)
|
|
1520
|
+
}).passthrough();
|
|
1521
|
+
var ViolationResponseSchema = z24.object({
|
|
1522
|
+
uuid: z24.string(),
|
|
1523
|
+
tsg_id: z24.string(),
|
|
1524
|
+
created_at: z24.string(),
|
|
1525
|
+
updated_at: z24.string(),
|
|
1526
|
+
description: z24.string(),
|
|
1527
|
+
rule_instance_uuid: z24.string(),
|
|
1528
|
+
rule_name: z24.string(),
|
|
1529
|
+
rule_description: z24.string(),
|
|
1530
|
+
rule_instance_state: z24.string(),
|
|
1531
|
+
file: z24.string().nullable().optional(),
|
|
1532
|
+
hash: z24.string().nullable().optional(),
|
|
1533
|
+
module: z24.string().nullable().optional(),
|
|
1534
|
+
operator: z24.string().nullable().optional(),
|
|
1535
|
+
threat: z24.string().nullable().optional(),
|
|
1536
|
+
threat_description: z24.string().nullable().optional()
|
|
1537
|
+
}).passthrough();
|
|
1538
|
+
var ViolationListSchema = z24.object({
|
|
1189
1539
|
pagination: ModelSecurityPaginationSchema,
|
|
1190
|
-
violations:
|
|
1191
|
-
}).passthrough();
|
|
1192
|
-
var RuleEditableFieldDropdownSchema =
|
|
1193
|
-
value:
|
|
1194
|
-
label:
|
|
1195
|
-
}).passthrough();
|
|
1196
|
-
var RuleEditableFieldSchema =
|
|
1197
|
-
attribute_name:
|
|
1198
|
-
type:
|
|
1199
|
-
display_name:
|
|
1200
|
-
display_type:
|
|
1201
|
-
description:
|
|
1202
|
-
dropdown_values:
|
|
1203
|
-
}).passthrough();
|
|
1204
|
-
var RuleRemediationSchema =
|
|
1205
|
-
description:
|
|
1206
|
-
steps:
|
|
1207
|
-
url:
|
|
1208
|
-
}).passthrough();
|
|
1209
|
-
var RuleConfigurationSchema =
|
|
1210
|
-
field_values:
|
|
1211
|
-
state:
|
|
1212
|
-
}).passthrough();
|
|
1213
|
-
var ModelSecurityRuleResponseSchema =
|
|
1214
|
-
uuid:
|
|
1215
|
-
name:
|
|
1216
|
-
description:
|
|
1217
|
-
rule_type:
|
|
1218
|
-
compatible_sources:
|
|
1219
|
-
default_state:
|
|
1540
|
+
violations: z24.array(ViolationResponseSchema)
|
|
1541
|
+
}).passthrough();
|
|
1542
|
+
var RuleEditableFieldDropdownSchema = z24.object({
|
|
1543
|
+
value: z24.string(),
|
|
1544
|
+
label: z24.string()
|
|
1545
|
+
}).passthrough();
|
|
1546
|
+
var RuleEditableFieldSchema = z24.object({
|
|
1547
|
+
attribute_name: z24.string(),
|
|
1548
|
+
type: z24.string(),
|
|
1549
|
+
display_name: z24.string(),
|
|
1550
|
+
display_type: z24.string(),
|
|
1551
|
+
description: z24.string().nullable().optional(),
|
|
1552
|
+
dropdown_values: z24.array(RuleEditableFieldDropdownSchema).nullable().optional()
|
|
1553
|
+
}).passthrough();
|
|
1554
|
+
var RuleRemediationSchema = z24.object({
|
|
1555
|
+
description: z24.string(),
|
|
1556
|
+
steps: z24.array(z24.string()),
|
|
1557
|
+
url: z24.string()
|
|
1558
|
+
}).passthrough();
|
|
1559
|
+
var RuleConfigurationSchema = z24.object({
|
|
1560
|
+
field_values: z24.record(z24.unknown()).optional(),
|
|
1561
|
+
state: z24.string().nullable().optional()
|
|
1562
|
+
}).passthrough();
|
|
1563
|
+
var ModelSecurityRuleResponseSchema = z24.object({
|
|
1564
|
+
uuid: z24.string(),
|
|
1565
|
+
name: z24.string(),
|
|
1566
|
+
description: z24.string(),
|
|
1567
|
+
rule_type: z24.string(),
|
|
1568
|
+
compatible_sources: z24.array(z24.string()),
|
|
1569
|
+
default_state: z24.string(),
|
|
1220
1570
|
remediation: RuleRemediationSchema,
|
|
1221
|
-
editable_fields:
|
|
1222
|
-
constant_values:
|
|
1223
|
-
default_values:
|
|
1571
|
+
editable_fields: z24.array(RuleEditableFieldSchema),
|
|
1572
|
+
constant_values: z24.record(z24.unknown()),
|
|
1573
|
+
default_values: z24.record(z24.unknown())
|
|
1224
1574
|
}).passthrough();
|
|
1225
|
-
var ListModelSecurityRulesResponseSchema =
|
|
1575
|
+
var ListModelSecurityRulesResponseSchema = z24.object({
|
|
1226
1576
|
pagination: ModelSecurityPaginationSchema,
|
|
1227
|
-
rules:
|
|
1228
|
-
}).passthrough();
|
|
1229
|
-
var ModelSecurityRuleInstanceResponseSchema =
|
|
1230
|
-
uuid:
|
|
1231
|
-
tsg_id:
|
|
1232
|
-
created_at:
|
|
1233
|
-
updated_at:
|
|
1234
|
-
security_group_uuid:
|
|
1235
|
-
security_rule_uuid:
|
|
1236
|
-
state:
|
|
1577
|
+
rules: z24.array(ModelSecurityRuleResponseSchema)
|
|
1578
|
+
}).passthrough();
|
|
1579
|
+
var ModelSecurityRuleInstanceResponseSchema = z24.object({
|
|
1580
|
+
uuid: z24.string(),
|
|
1581
|
+
tsg_id: z24.string(),
|
|
1582
|
+
created_at: z24.string(),
|
|
1583
|
+
updated_at: z24.string(),
|
|
1584
|
+
security_group_uuid: z24.string(),
|
|
1585
|
+
security_rule_uuid: z24.string(),
|
|
1586
|
+
state: z24.string(),
|
|
1237
1587
|
rule: ModelSecurityRuleResponseSchema,
|
|
1238
|
-
field_values:
|
|
1588
|
+
field_values: z24.record(z24.unknown()).optional()
|
|
1239
1589
|
}).passthrough();
|
|
1240
|
-
var ModelSecurityRuleInstanceUpdateRequestSchema =
|
|
1241
|
-
security_group_uuid:
|
|
1242
|
-
state:
|
|
1243
|
-
field_values:
|
|
1590
|
+
var ModelSecurityRuleInstanceUpdateRequestSchema = z24.object({
|
|
1591
|
+
security_group_uuid: z24.string(),
|
|
1592
|
+
state: z24.string().nullable().optional(),
|
|
1593
|
+
field_values: z24.record(z24.unknown()).nullable().optional()
|
|
1244
1594
|
});
|
|
1245
|
-
var ListModelSecurityRuleInstancesResponseSchema =
|
|
1595
|
+
var ListModelSecurityRuleInstancesResponseSchema = z24.object({
|
|
1246
1596
|
pagination: ModelSecurityPaginationSchema,
|
|
1247
|
-
rule_instances:
|
|
1597
|
+
rule_instances: z24.array(ModelSecurityRuleInstanceResponseSchema)
|
|
1248
1598
|
}).passthrough();
|
|
1249
|
-
var ModelSecurityGroupCreateRequestSchema =
|
|
1250
|
-
name:
|
|
1251
|
-
source_type:
|
|
1252
|
-
description:
|
|
1253
|
-
rule_configurations:
|
|
1599
|
+
var ModelSecurityGroupCreateRequestSchema = z24.object({
|
|
1600
|
+
name: z24.string(),
|
|
1601
|
+
source_type: z24.string(),
|
|
1602
|
+
description: z24.string().optional().default(""),
|
|
1603
|
+
rule_configurations: z24.record(RuleConfigurationSchema).optional()
|
|
1254
1604
|
});
|
|
1255
|
-
var ModelSecurityGroupResponseSchema =
|
|
1256
|
-
uuid:
|
|
1257
|
-
tsg_id:
|
|
1258
|
-
created_at:
|
|
1259
|
-
updated_at:
|
|
1260
|
-
name:
|
|
1261
|
-
description:
|
|
1262
|
-
source_type:
|
|
1263
|
-
state:
|
|
1264
|
-
is_tombstone:
|
|
1265
|
-
}).passthrough();
|
|
1266
|
-
var ModelSecurityGroupUpdateRequestSchema =
|
|
1267
|
-
name:
|
|
1268
|
-
description:
|
|
1605
|
+
var ModelSecurityGroupResponseSchema = z24.object({
|
|
1606
|
+
uuid: z24.string(),
|
|
1607
|
+
tsg_id: z24.string(),
|
|
1608
|
+
created_at: z24.string(),
|
|
1609
|
+
updated_at: z24.string(),
|
|
1610
|
+
name: z24.string(),
|
|
1611
|
+
description: z24.string(),
|
|
1612
|
+
source_type: z24.string(),
|
|
1613
|
+
state: z24.string(),
|
|
1614
|
+
is_tombstone: z24.boolean()
|
|
1615
|
+
}).passthrough();
|
|
1616
|
+
var ModelSecurityGroupUpdateRequestSchema = z24.object({
|
|
1617
|
+
name: z24.string().nullable().optional(),
|
|
1618
|
+
description: z24.string().nullable().optional()
|
|
1269
1619
|
});
|
|
1270
|
-
var ListModelSecurityGroupsResponseSchema =
|
|
1620
|
+
var ListModelSecurityGroupsResponseSchema = z24.object({
|
|
1271
1621
|
pagination: ModelSecurityPaginationSchema,
|
|
1272
|
-
security_groups:
|
|
1622
|
+
security_groups: z24.array(ModelSecurityGroupResponseSchema)
|
|
1273
1623
|
}).passthrough();
|
|
1274
|
-
var PyPIAuthResponseSchema =
|
|
1275
|
-
url:
|
|
1276
|
-
expires_at:
|
|
1624
|
+
var PyPIAuthResponseSchema = z24.object({
|
|
1625
|
+
url: z24.string(),
|
|
1626
|
+
expires_at: z24.string()
|
|
1277
1627
|
}).passthrough();
|
|
1278
1628
|
|
|
1279
1629
|
// src/models/red-team-enums.ts
|
|
@@ -1471,892 +1821,892 @@ var TargetType = {
|
|
|
1471
1821
|
};
|
|
1472
1822
|
|
|
1473
1823
|
// src/models/red-team.ts
|
|
1474
|
-
import { z as
|
|
1475
|
-
var RedTeamPaginationSchema =
|
|
1476
|
-
var CountByNameSchema =
|
|
1477
|
-
var ValidationErrorSchema =
|
|
1478
|
-
loc:
|
|
1479
|
-
msg:
|
|
1480
|
-
type:
|
|
1824
|
+
import { z as z25 } from "zod";
|
|
1825
|
+
var RedTeamPaginationSchema = z25.object({ total_items: z25.number().int().nullable().optional() }).passthrough();
|
|
1826
|
+
var CountByNameSchema = z25.object({ name: z25.string(), count: z25.number().int() });
|
|
1827
|
+
var ValidationErrorSchema = z25.object({
|
|
1828
|
+
loc: z25.array(z25.union([z25.string(), z25.number()])),
|
|
1829
|
+
msg: z25.string(),
|
|
1830
|
+
type: z25.string()
|
|
1481
1831
|
});
|
|
1482
|
-
var HTTPValidationErrorSchema =
|
|
1483
|
-
var TargetBackgroundSchema =
|
|
1484
|
-
industry:
|
|
1485
|
-
use_case:
|
|
1486
|
-
competitors:
|
|
1487
|
-
}).passthrough();
|
|
1488
|
-
var TargetAdditionalContextSchema =
|
|
1489
|
-
base_model:
|
|
1490
|
-
core_architecture:
|
|
1491
|
-
system_prompt:
|
|
1492
|
-
languages_supported:
|
|
1493
|
-
banned_keywords:
|
|
1494
|
-
tools_accessible:
|
|
1495
|
-
}).passthrough();
|
|
1496
|
-
var TargetMetadataSchema =
|
|
1497
|
-
multi_turn:
|
|
1498
|
-
multi_turn_error_message:
|
|
1499
|
-
rate_limit:
|
|
1500
|
-
rate_limit_enabled:
|
|
1501
|
-
rate_limit_error_code:
|
|
1502
|
-
rate_limit_error_json:
|
|
1503
|
-
rate_limit_error_message:
|
|
1504
|
-
content_filter_enabled:
|
|
1505
|
-
content_filter_error_code:
|
|
1506
|
-
content_filter_error_json:
|
|
1507
|
-
content_filter_error_message:
|
|
1508
|
-
probe_message:
|
|
1509
|
-
request_timeout:
|
|
1510
|
-
}).passthrough();
|
|
1511
|
-
var MultiTurnStatefulConfigSchema =
|
|
1512
|
-
type:
|
|
1513
|
-
response_id_field:
|
|
1514
|
-
request_id_field:
|
|
1515
|
-
}).passthrough();
|
|
1516
|
-
var MultiTurnStatelessConfigSchema =
|
|
1517
|
-
type:
|
|
1518
|
-
assistant_role:
|
|
1519
|
-
}).passthrough();
|
|
1520
|
-
var OpenAIConnectionParamsSchema =
|
|
1521
|
-
api_key:
|
|
1522
|
-
model_name:
|
|
1523
|
-
}).passthrough();
|
|
1524
|
-
var HuggingfaceConnectionParamsSchema =
|
|
1525
|
-
api_key:
|
|
1526
|
-
model_name:
|
|
1527
|
-
}).passthrough();
|
|
1528
|
-
var DatabricksConnectionParamsSchema =
|
|
1529
|
-
auth_type:
|
|
1530
|
-
workspace_url:
|
|
1531
|
-
model_name:
|
|
1532
|
-
access_token:
|
|
1533
|
-
client_id:
|
|
1534
|
-
secret:
|
|
1535
|
-
}).passthrough();
|
|
1536
|
-
var BedrockAccessConnectionParamsSchema =
|
|
1537
|
-
access_id:
|
|
1538
|
-
access_secret:
|
|
1539
|
-
region:
|
|
1540
|
-
model_id:
|
|
1541
|
-
session_token:
|
|
1542
|
-
}).passthrough();
|
|
1543
|
-
var RestConnectionParamsSchema =
|
|
1544
|
-
api_endpoint:
|
|
1545
|
-
request_headers:
|
|
1546
|
-
request_json:
|
|
1547
|
-
response_json:
|
|
1548
|
-
response_key:
|
|
1549
|
-
target_connection_config:
|
|
1550
|
-
curl:
|
|
1551
|
-
multi_turn_config:
|
|
1832
|
+
var HTTPValidationErrorSchema = z25.object({ detail: z25.array(ValidationErrorSchema).optional() }).passthrough();
|
|
1833
|
+
var TargetBackgroundSchema = z25.object({
|
|
1834
|
+
industry: z25.string().nullable().optional(),
|
|
1835
|
+
use_case: z25.string().nullable().optional(),
|
|
1836
|
+
competitors: z25.array(z25.string()).nullable().optional()
|
|
1837
|
+
}).passthrough();
|
|
1838
|
+
var TargetAdditionalContextSchema = z25.object({
|
|
1839
|
+
base_model: z25.string().nullable().optional(),
|
|
1840
|
+
core_architecture: z25.string().nullable().optional(),
|
|
1841
|
+
system_prompt: z25.string().nullable().optional(),
|
|
1842
|
+
languages_supported: z25.array(z25.string()).nullable().optional(),
|
|
1843
|
+
banned_keywords: z25.array(z25.string()).nullable().optional(),
|
|
1844
|
+
tools_accessible: z25.array(z25.string()).nullable().optional()
|
|
1845
|
+
}).passthrough();
|
|
1846
|
+
var TargetMetadataSchema = z25.object({
|
|
1847
|
+
multi_turn: z25.boolean().optional(),
|
|
1848
|
+
multi_turn_error_message: z25.string().nullable().optional(),
|
|
1849
|
+
rate_limit: z25.number().int().nullable().optional(),
|
|
1850
|
+
rate_limit_enabled: z25.boolean().optional(),
|
|
1851
|
+
rate_limit_error_code: z25.number().int().nullable().optional(),
|
|
1852
|
+
rate_limit_error_json: z25.record(z25.unknown()).nullable().optional(),
|
|
1853
|
+
rate_limit_error_message: z25.string().nullable().optional(),
|
|
1854
|
+
content_filter_enabled: z25.boolean().optional(),
|
|
1855
|
+
content_filter_error_code: z25.number().int().nullable().optional(),
|
|
1856
|
+
content_filter_error_json: z25.record(z25.unknown()).nullable().optional(),
|
|
1857
|
+
content_filter_error_message: z25.string().nullable().optional(),
|
|
1858
|
+
probe_message: z25.string().optional(),
|
|
1859
|
+
request_timeout: z25.number().optional()
|
|
1860
|
+
}).passthrough();
|
|
1861
|
+
var MultiTurnStatefulConfigSchema = z25.object({
|
|
1862
|
+
type: z25.string().default("stateful"),
|
|
1863
|
+
response_id_field: z25.string(),
|
|
1864
|
+
request_id_field: z25.string()
|
|
1865
|
+
}).passthrough();
|
|
1866
|
+
var MultiTurnStatelessConfigSchema = z25.object({
|
|
1867
|
+
type: z25.string().default("stateless"),
|
|
1868
|
+
assistant_role: z25.string().nullable().optional()
|
|
1869
|
+
}).passthrough();
|
|
1870
|
+
var OpenAIConnectionParamsSchema = z25.object({
|
|
1871
|
+
api_key: z25.string(),
|
|
1872
|
+
model_name: z25.string()
|
|
1873
|
+
}).passthrough();
|
|
1874
|
+
var HuggingfaceConnectionParamsSchema = z25.object({
|
|
1875
|
+
api_key: z25.string(),
|
|
1876
|
+
model_name: z25.string()
|
|
1877
|
+
}).passthrough();
|
|
1878
|
+
var DatabricksConnectionParamsSchema = z25.object({
|
|
1879
|
+
auth_type: z25.string(),
|
|
1880
|
+
workspace_url: z25.string(),
|
|
1881
|
+
model_name: z25.string(),
|
|
1882
|
+
access_token: z25.string().nullable().optional(),
|
|
1883
|
+
client_id: z25.string().nullable().optional(),
|
|
1884
|
+
secret: z25.string().nullable().optional()
|
|
1885
|
+
}).passthrough();
|
|
1886
|
+
var BedrockAccessConnectionParamsSchema = z25.object({
|
|
1887
|
+
access_id: z25.string(),
|
|
1888
|
+
access_secret: z25.string(),
|
|
1889
|
+
region: z25.string(),
|
|
1890
|
+
model_id: z25.string(),
|
|
1891
|
+
session_token: z25.string().nullable().optional()
|
|
1892
|
+
}).passthrough();
|
|
1893
|
+
var RestConnectionParamsSchema = z25.object({
|
|
1894
|
+
api_endpoint: z25.string().nullable().optional(),
|
|
1895
|
+
request_headers: z25.record(z25.unknown()).nullable().optional(),
|
|
1896
|
+
request_json: z25.record(z25.unknown()).nullable().optional(),
|
|
1897
|
+
response_json: z25.record(z25.unknown()).nullable().optional(),
|
|
1898
|
+
response_key: z25.string().nullable().optional(),
|
|
1899
|
+
target_connection_config: z25.unknown().nullable().optional(),
|
|
1900
|
+
curl: z25.string().nullable().optional(),
|
|
1901
|
+
multi_turn_config: z25.unknown().nullable().optional()
|
|
1552
1902
|
}).passthrough();
|
|
1553
1903
|
var StreamingConnectionParamsSchema = RestConnectionParamsSchema.extend({
|
|
1554
|
-
response_stop_key:
|
|
1555
|
-
response_stop_value:
|
|
1904
|
+
response_stop_key: z25.string(),
|
|
1905
|
+
response_stop_value: z25.string()
|
|
1556
1906
|
}).passthrough();
|
|
1557
|
-
var ConnectionParamsSchema =
|
|
1907
|
+
var ConnectionParamsSchema = z25.union([
|
|
1558
1908
|
StreamingConnectionParamsSchema,
|
|
1559
1909
|
RestConnectionParamsSchema
|
|
1560
1910
|
]);
|
|
1561
|
-
var TargetJobRequestSchema =
|
|
1562
|
-
uuid:
|
|
1563
|
-
version:
|
|
1911
|
+
var TargetJobRequestSchema = z25.object({
|
|
1912
|
+
uuid: z25.string(),
|
|
1913
|
+
version: z25.number().int().nullable().optional()
|
|
1564
1914
|
});
|
|
1565
|
-
var JobTimeRecordSchema =
|
|
1566
|
-
queued_at:
|
|
1567
|
-
started_at:
|
|
1568
|
-
completed_at:
|
|
1569
|
-
time_taken:
|
|
1570
|
-
}).passthrough();
|
|
1571
|
-
var StaticJobMetadataSchema =
|
|
1572
|
-
categories:
|
|
1573
|
-
rate_limit_enabled:
|
|
1574
|
-
rate_limit:
|
|
1575
|
-
rate_limit_error_code:
|
|
1576
|
-
rate_limit_error_message:
|
|
1577
|
-
rate_limit_error_json:
|
|
1578
|
-
content_filter_enabled:
|
|
1579
|
-
content_filter_error_code:
|
|
1580
|
-
content_filter_error_message:
|
|
1581
|
-
content_filter_error_json:
|
|
1582
|
-
}).passthrough();
|
|
1583
|
-
var DynamicJobMetadataSchema =
|
|
1584
|
-
rate_limit_enabled:
|
|
1585
|
-
rate_limit:
|
|
1586
|
-
rate_limit_error_code:
|
|
1587
|
-
rate_limit_error_message:
|
|
1588
|
-
rate_limit_error_json:
|
|
1589
|
-
content_filter_enabled:
|
|
1590
|
-
content_filter_error_code:
|
|
1591
|
-
content_filter_error_message:
|
|
1592
|
-
content_filter_error_json:
|
|
1593
|
-
stream_breadth:
|
|
1594
|
-
stream_depth:
|
|
1595
|
-
max_tokens:
|
|
1596
|
-
context_size:
|
|
1597
|
-
attack_goals:
|
|
1598
|
-
base_model:
|
|
1599
|
-
use_case:
|
|
1600
|
-
system_prompt:
|
|
1601
|
-
}).passthrough();
|
|
1602
|
-
var CustomJobMetadataSchema =
|
|
1603
|
-
custom_prompt_sets:
|
|
1604
|
-
rate_limit_enabled:
|
|
1605
|
-
rate_limit:
|
|
1606
|
-
rate_limit_error_code:
|
|
1607
|
-
rate_limit_error_message:
|
|
1608
|
-
rate_limit_error_json:
|
|
1609
|
-
content_filter_enabled:
|
|
1610
|
-
content_filter_error_code:
|
|
1611
|
-
content_filter_error_message:
|
|
1612
|
-
content_filter_error_json:
|
|
1613
|
-
}).passthrough();
|
|
1614
|
-
var JobCreateRequestSchema =
|
|
1615
|
-
name:
|
|
1915
|
+
var JobTimeRecordSchema = z25.object({
|
|
1916
|
+
queued_at: z25.string().nullable().optional(),
|
|
1917
|
+
started_at: z25.string().nullable().optional(),
|
|
1918
|
+
completed_at: z25.string().nullable().optional(),
|
|
1919
|
+
time_taken: z25.string().nullable().optional()
|
|
1920
|
+
}).passthrough();
|
|
1921
|
+
var StaticJobMetadataSchema = z25.object({
|
|
1922
|
+
categories: z25.record(z25.unknown()),
|
|
1923
|
+
rate_limit_enabled: z25.boolean().optional(),
|
|
1924
|
+
rate_limit: z25.number().int().nullable().optional(),
|
|
1925
|
+
rate_limit_error_code: z25.number().int().nullable().optional(),
|
|
1926
|
+
rate_limit_error_message: z25.string().nullable().optional(),
|
|
1927
|
+
rate_limit_error_json: z25.unknown().optional(),
|
|
1928
|
+
content_filter_enabled: z25.boolean().optional(),
|
|
1929
|
+
content_filter_error_code: z25.number().int().nullable().optional(),
|
|
1930
|
+
content_filter_error_message: z25.string().nullable().optional(),
|
|
1931
|
+
content_filter_error_json: z25.unknown().optional()
|
|
1932
|
+
}).passthrough();
|
|
1933
|
+
var DynamicJobMetadataSchema = z25.object({
|
|
1934
|
+
rate_limit_enabled: z25.boolean().optional(),
|
|
1935
|
+
rate_limit: z25.number().int().nullable().optional(),
|
|
1936
|
+
rate_limit_error_code: z25.number().int().nullable().optional(),
|
|
1937
|
+
rate_limit_error_message: z25.string().nullable().optional(),
|
|
1938
|
+
rate_limit_error_json: z25.unknown().optional(),
|
|
1939
|
+
content_filter_enabled: z25.boolean().optional(),
|
|
1940
|
+
content_filter_error_code: z25.number().int().nullable().optional(),
|
|
1941
|
+
content_filter_error_message: z25.string().nullable().optional(),
|
|
1942
|
+
content_filter_error_json: z25.unknown().optional(),
|
|
1943
|
+
stream_breadth: z25.number().int().optional(),
|
|
1944
|
+
stream_depth: z25.number().int().optional(),
|
|
1945
|
+
max_tokens: z25.number().int().optional(),
|
|
1946
|
+
context_size: z25.number().int().optional(),
|
|
1947
|
+
attack_goals: z25.array(z25.unknown()).optional(),
|
|
1948
|
+
base_model: z25.string().nullable().optional(),
|
|
1949
|
+
use_case: z25.string().nullable().optional(),
|
|
1950
|
+
system_prompt: z25.string().nullable().optional()
|
|
1951
|
+
}).passthrough();
|
|
1952
|
+
var CustomJobMetadataSchema = z25.object({
|
|
1953
|
+
custom_prompt_sets: z25.array(z25.unknown()),
|
|
1954
|
+
rate_limit_enabled: z25.boolean().optional(),
|
|
1955
|
+
rate_limit: z25.number().int().nullable().optional(),
|
|
1956
|
+
rate_limit_error_code: z25.number().int().nullable().optional(),
|
|
1957
|
+
rate_limit_error_message: z25.string().nullable().optional(),
|
|
1958
|
+
rate_limit_error_json: z25.unknown().optional(),
|
|
1959
|
+
content_filter_enabled: z25.boolean().optional(),
|
|
1960
|
+
content_filter_error_code: z25.number().int().nullable().optional(),
|
|
1961
|
+
content_filter_error_message: z25.string().nullable().optional(),
|
|
1962
|
+
content_filter_error_json: z25.unknown().optional()
|
|
1963
|
+
}).passthrough();
|
|
1964
|
+
var JobCreateRequestSchema = z25.object({
|
|
1965
|
+
name: z25.string(),
|
|
1616
1966
|
target: TargetJobRequestSchema,
|
|
1617
|
-
job_type:
|
|
1618
|
-
job_metadata:
|
|
1967
|
+
job_type: z25.string(),
|
|
1968
|
+
job_metadata: z25.union([
|
|
1619
1969
|
StaticJobMetadataSchema,
|
|
1620
1970
|
DynamicJobMetadataSchema,
|
|
1621
1971
|
CustomJobMetadataSchema
|
|
1622
1972
|
]),
|
|
1623
|
-
version:
|
|
1624
|
-
extra_info:
|
|
1973
|
+
version: z25.number().int().nullable().optional(),
|
|
1974
|
+
extra_info: z25.record(z25.unknown()).nullable().optional()
|
|
1625
1975
|
});
|
|
1626
|
-
var StaticJobReportStatsSchema =
|
|
1627
|
-
output_completion_percentage:
|
|
1628
|
-
partial_report_unlocked:
|
|
1629
|
-
partial_report_unlocked_at:
|
|
1630
|
-
report_summary:
|
|
1631
|
-
}).passthrough();
|
|
1632
|
-
var DynamicJobReportStatsSchema =
|
|
1633
|
-
total_goals:
|
|
1634
|
-
total_streams:
|
|
1635
|
-
total_threats:
|
|
1636
|
-
goals_achieved:
|
|
1637
|
-
report_summary:
|
|
1638
|
-
}).passthrough();
|
|
1639
|
-
var TargetReferenceSchema =
|
|
1640
|
-
uuid:
|
|
1641
|
-
tsg_id:
|
|
1642
|
-
name:
|
|
1643
|
-
description:
|
|
1644
|
-
target_type:
|
|
1645
|
-
connection_type:
|
|
1646
|
-
api_endpoint_type:
|
|
1647
|
-
response_mode:
|
|
1648
|
-
session_supported:
|
|
1649
|
-
extra_info:
|
|
1650
|
-
status:
|
|
1651
|
-
active:
|
|
1652
|
-
validated:
|
|
1653
|
-
version:
|
|
1654
|
-
secret_version:
|
|
1655
|
-
created_by_user_id:
|
|
1656
|
-
updated_by_user_id:
|
|
1657
|
-
created_at:
|
|
1658
|
-
updated_at:
|
|
1976
|
+
var StaticJobReportStatsSchema = z25.object({
|
|
1977
|
+
output_completion_percentage: z25.number(),
|
|
1978
|
+
partial_report_unlocked: z25.boolean().optional(),
|
|
1979
|
+
partial_report_unlocked_at: z25.string().nullable().optional(),
|
|
1980
|
+
report_summary: z25.string().nullable().optional()
|
|
1981
|
+
}).passthrough();
|
|
1982
|
+
var DynamicJobReportStatsSchema = z25.object({
|
|
1983
|
+
total_goals: z25.number().int().optional(),
|
|
1984
|
+
total_streams: z25.number().int().optional(),
|
|
1985
|
+
total_threats: z25.number().int().optional(),
|
|
1986
|
+
goals_achieved: z25.number().int().optional(),
|
|
1987
|
+
report_summary: z25.string().nullable().optional()
|
|
1988
|
+
}).passthrough();
|
|
1989
|
+
var TargetReferenceSchema = z25.object({
|
|
1990
|
+
uuid: z25.string(),
|
|
1991
|
+
tsg_id: z25.string(),
|
|
1992
|
+
name: z25.string(),
|
|
1993
|
+
description: z25.string().nullable().optional(),
|
|
1994
|
+
target_type: z25.string().nullable().optional(),
|
|
1995
|
+
connection_type: z25.string().nullable().optional(),
|
|
1996
|
+
api_endpoint_type: z25.string().nullable().optional(),
|
|
1997
|
+
response_mode: z25.string().nullable().optional(),
|
|
1998
|
+
session_supported: z25.boolean().optional(),
|
|
1999
|
+
extra_info: z25.record(z25.unknown()).nullable().optional(),
|
|
2000
|
+
status: z25.string(),
|
|
2001
|
+
active: z25.boolean(),
|
|
2002
|
+
validated: z25.boolean(),
|
|
2003
|
+
version: z25.number().int().nullable().optional(),
|
|
2004
|
+
secret_version: z25.string().nullable().optional(),
|
|
2005
|
+
created_by_user_id: z25.string().nullable().optional(),
|
|
2006
|
+
updated_by_user_id: z25.string().nullable().optional(),
|
|
2007
|
+
created_at: z25.string(),
|
|
2008
|
+
updated_at: z25.string(),
|
|
1659
2009
|
target_metadata: TargetMetadataSchema.optional(),
|
|
1660
2010
|
target_background: TargetBackgroundSchema.nullable().optional(),
|
|
1661
|
-
profiling_status:
|
|
2011
|
+
profiling_status: z25.string().nullable().optional(),
|
|
1662
2012
|
additional_context: TargetAdditionalContextSchema.nullable().optional()
|
|
1663
2013
|
}).passthrough();
|
|
1664
|
-
var JobResponseSchema =
|
|
1665
|
-
uuid:
|
|
1666
|
-
tsg_id:
|
|
1667
|
-
name:
|
|
2014
|
+
var JobResponseSchema = z25.object({
|
|
2015
|
+
uuid: z25.string(),
|
|
2016
|
+
tsg_id: z25.string(),
|
|
2017
|
+
name: z25.string(),
|
|
1668
2018
|
target: TargetReferenceSchema,
|
|
1669
|
-
job_type:
|
|
1670
|
-
job_metadata:
|
|
1671
|
-
version:
|
|
1672
|
-
extra_info:
|
|
1673
|
-
target_id:
|
|
1674
|
-
target_type:
|
|
1675
|
-
total:
|
|
1676
|
-
completed:
|
|
1677
|
-
status:
|
|
1678
|
-
score:
|
|
1679
|
-
asr:
|
|
2019
|
+
job_type: z25.string(),
|
|
2020
|
+
job_metadata: z25.unknown(),
|
|
2021
|
+
version: z25.number().int().nullable().optional(),
|
|
2022
|
+
extra_info: z25.record(z25.unknown()).nullable().optional(),
|
|
2023
|
+
target_id: z25.string(),
|
|
2024
|
+
target_type: z25.string(),
|
|
2025
|
+
total: z25.number().int().nullable().optional(),
|
|
2026
|
+
completed: z25.number().int().nullable().optional(),
|
|
2027
|
+
status: z25.string().optional(),
|
|
2028
|
+
score: z25.number().nullable().optional(),
|
|
2029
|
+
asr: z25.number().nullable().optional(),
|
|
1680
2030
|
time_record: JobTimeRecordSchema.nullable().optional(),
|
|
1681
|
-
created_at:
|
|
1682
|
-
updated_at:
|
|
1683
|
-
created_by_user_id:
|
|
1684
|
-
report_stats:
|
|
1685
|
-
metering_quota_uuid:
|
|
1686
|
-
counted_towards_quota:
|
|
1687
|
-
invocation_id:
|
|
1688
|
-
}).passthrough();
|
|
1689
|
-
var JobListResponseSchema =
|
|
2031
|
+
created_at: z25.string().nullable().optional(),
|
|
2032
|
+
updated_at: z25.string().nullable().optional(),
|
|
2033
|
+
created_by_user_id: z25.string().nullable().optional(),
|
|
2034
|
+
report_stats: z25.unknown().optional(),
|
|
2035
|
+
metering_quota_uuid: z25.string().nullable().optional(),
|
|
2036
|
+
counted_towards_quota: z25.string().optional(),
|
|
2037
|
+
invocation_id: z25.string().nullable().optional()
|
|
2038
|
+
}).passthrough();
|
|
2039
|
+
var JobListResponseSchema = z25.object({
|
|
1690
2040
|
pagination: RedTeamPaginationSchema,
|
|
1691
|
-
data:
|
|
2041
|
+
data: z25.array(JobResponseSchema)
|
|
1692
2042
|
}).passthrough();
|
|
1693
|
-
var JobAbortResponseSchema =
|
|
1694
|
-
job_id:
|
|
1695
|
-
message:
|
|
2043
|
+
var JobAbortResponseSchema = z25.object({
|
|
2044
|
+
job_id: z25.string(),
|
|
2045
|
+
message: z25.string()
|
|
1696
2046
|
});
|
|
1697
|
-
var PrerequisiteModelSchema =
|
|
1698
|
-
id:
|
|
1699
|
-
display_name:
|
|
1700
|
-
description:
|
|
2047
|
+
var PrerequisiteModelSchema = z25.object({
|
|
2048
|
+
id: z25.string(),
|
|
2049
|
+
display_name: z25.string(),
|
|
2050
|
+
description: z25.string()
|
|
1701
2051
|
});
|
|
1702
|
-
var SubCategoryModelSchema =
|
|
1703
|
-
id:
|
|
1704
|
-
display_name:
|
|
1705
|
-
description:
|
|
1706
|
-
preselect:
|
|
1707
|
-
prerequisites:
|
|
1708
|
-
active:
|
|
1709
|
-
}).passthrough();
|
|
1710
|
-
var CategoryModelSchema =
|
|
1711
|
-
id:
|
|
1712
|
-
display_name:
|
|
1713
|
-
description:
|
|
1714
|
-
preselect:
|
|
1715
|
-
sub_categories:
|
|
1716
|
-
}).passthrough();
|
|
1717
|
-
var AttackOutputSchema =
|
|
1718
|
-
uuid:
|
|
1719
|
-
tsg_id:
|
|
1720
|
-
attack_id:
|
|
1721
|
-
job_id:
|
|
1722
|
-
target_id:
|
|
1723
|
-
output:
|
|
1724
|
-
threat:
|
|
1725
|
-
marked_safe:
|
|
1726
|
-
}).passthrough();
|
|
1727
|
-
var AttackMultiTurnOutputSchema =
|
|
1728
|
-
uuid:
|
|
1729
|
-
tsg_id:
|
|
1730
|
-
attack_id:
|
|
1731
|
-
job_id:
|
|
1732
|
-
target_id:
|
|
1733
|
-
output:
|
|
1734
|
-
prompt:
|
|
1735
|
-
turn:
|
|
1736
|
-
threat:
|
|
1737
|
-
marked_safe:
|
|
1738
|
-
generation:
|
|
1739
|
-
multi_turn:
|
|
1740
|
-
}).passthrough();
|
|
1741
|
-
var AttackListItemSchema =
|
|
1742
|
-
uuid:
|
|
1743
|
-
tsg_id:
|
|
1744
|
-
job_id:
|
|
1745
|
-
target_id:
|
|
1746
|
-
prompt:
|
|
1747
|
-
prompt_mapping_id:
|
|
1748
|
-
prompt_id:
|
|
1749
|
-
category:
|
|
1750
|
-
sub_category:
|
|
1751
|
-
category_display_name:
|
|
1752
|
-
sub_category_display_name:
|
|
1753
|
-
status:
|
|
1754
|
-
marked_safe:
|
|
1755
|
-
extra_info:
|
|
1756
|
-
threat:
|
|
1757
|
-
attack_type:
|
|
1758
|
-
multi_turn:
|
|
1759
|
-
asr:
|
|
1760
|
-
version:
|
|
1761
|
-
severity:
|
|
1762
|
-
}).passthrough();
|
|
1763
|
-
var AttackListResponseSchema =
|
|
2052
|
+
var SubCategoryModelSchema = z25.object({
|
|
2053
|
+
id: z25.string(),
|
|
2054
|
+
display_name: z25.string(),
|
|
2055
|
+
description: z25.string(),
|
|
2056
|
+
preselect: z25.boolean().optional(),
|
|
2057
|
+
prerequisites: z25.array(PrerequisiteModelSchema).nullable().optional(),
|
|
2058
|
+
active: z25.boolean().optional()
|
|
2059
|
+
}).passthrough();
|
|
2060
|
+
var CategoryModelSchema = z25.object({
|
|
2061
|
+
id: z25.string(),
|
|
2062
|
+
display_name: z25.string(),
|
|
2063
|
+
description: z25.string(),
|
|
2064
|
+
preselect: z25.boolean().optional(),
|
|
2065
|
+
sub_categories: z25.array(SubCategoryModelSchema)
|
|
2066
|
+
}).passthrough();
|
|
2067
|
+
var AttackOutputSchema = z25.object({
|
|
2068
|
+
uuid: z25.string(),
|
|
2069
|
+
tsg_id: z25.string(),
|
|
2070
|
+
attack_id: z25.string(),
|
|
2071
|
+
job_id: z25.string(),
|
|
2072
|
+
target_id: z25.string(),
|
|
2073
|
+
output: z25.string(),
|
|
2074
|
+
threat: z25.boolean().nullable().optional(),
|
|
2075
|
+
marked_safe: z25.boolean().nullable().optional()
|
|
2076
|
+
}).passthrough();
|
|
2077
|
+
var AttackMultiTurnOutputSchema = z25.object({
|
|
2078
|
+
uuid: z25.string(),
|
|
2079
|
+
tsg_id: z25.string(),
|
|
2080
|
+
attack_id: z25.string(),
|
|
2081
|
+
job_id: z25.string(),
|
|
2082
|
+
target_id: z25.string(),
|
|
2083
|
+
output: z25.string(),
|
|
2084
|
+
prompt: z25.string(),
|
|
2085
|
+
turn: z25.number().int(),
|
|
2086
|
+
threat: z25.boolean().nullable().optional(),
|
|
2087
|
+
marked_safe: z25.boolean().nullable().optional(),
|
|
2088
|
+
generation: z25.number().int().optional(),
|
|
2089
|
+
multi_turn: z25.boolean().optional()
|
|
2090
|
+
}).passthrough();
|
|
2091
|
+
var AttackListItemSchema = z25.object({
|
|
2092
|
+
uuid: z25.string(),
|
|
2093
|
+
tsg_id: z25.string(),
|
|
2094
|
+
job_id: z25.string(),
|
|
2095
|
+
target_id: z25.string(),
|
|
2096
|
+
prompt: z25.string(),
|
|
2097
|
+
prompt_mapping_id: z25.string(),
|
|
2098
|
+
prompt_id: z25.string(),
|
|
2099
|
+
category: z25.string(),
|
|
2100
|
+
sub_category: z25.string(),
|
|
2101
|
+
category_display_name: z25.string(),
|
|
2102
|
+
sub_category_display_name: z25.string(),
|
|
2103
|
+
status: z25.string().optional(),
|
|
2104
|
+
marked_safe: z25.boolean().nullable().optional(),
|
|
2105
|
+
extra_info: z25.record(z25.unknown()).optional(),
|
|
2106
|
+
threat: z25.boolean().nullable().optional(),
|
|
2107
|
+
attack_type: z25.string().optional(),
|
|
2108
|
+
multi_turn: z25.boolean().optional(),
|
|
2109
|
+
asr: z25.number().nullable().optional(),
|
|
2110
|
+
version: z25.number().int().nullable().optional(),
|
|
2111
|
+
severity: z25.string().optional()
|
|
2112
|
+
}).passthrough();
|
|
2113
|
+
var AttackListResponseSchema = z25.object({
|
|
1764
2114
|
pagination: RedTeamPaginationSchema,
|
|
1765
|
-
data:
|
|
1766
|
-
}).passthrough();
|
|
1767
|
-
var AttackDetailResponseSchema =
|
|
1768
|
-
uuid:
|
|
1769
|
-
tsg_id:
|
|
1770
|
-
job_id:
|
|
1771
|
-
target_id:
|
|
1772
|
-
prompt:
|
|
1773
|
-
prompt_mapping_id:
|
|
1774
|
-
prompt_id:
|
|
1775
|
-
category:
|
|
1776
|
-
sub_category:
|
|
1777
|
-
category_display_name:
|
|
1778
|
-
sub_category_display_name:
|
|
1779
|
-
compliance_frameworks:
|
|
1780
|
-
goal:
|
|
1781
|
-
status:
|
|
1782
|
-
marked_safe:
|
|
1783
|
-
extra_info:
|
|
1784
|
-
threat:
|
|
1785
|
-
attack_type:
|
|
1786
|
-
multi_turn:
|
|
1787
|
-
asr:
|
|
1788
|
-
version:
|
|
1789
|
-
severity:
|
|
1790
|
-
outputs:
|
|
1791
|
-
}).passthrough();
|
|
1792
|
-
var AttackMultiTurnDetailResponseSchema =
|
|
1793
|
-
uuid:
|
|
1794
|
-
tsg_id:
|
|
1795
|
-
job_id:
|
|
1796
|
-
target_id:
|
|
1797
|
-
prompt:
|
|
1798
|
-
prompt_mapping_id:
|
|
1799
|
-
prompt_id:
|
|
1800
|
-
category:
|
|
1801
|
-
sub_category:
|
|
1802
|
-
category_display_name:
|
|
1803
|
-
sub_category_display_name:
|
|
1804
|
-
compliance_frameworks:
|
|
1805
|
-
goal:
|
|
1806
|
-
status:
|
|
1807
|
-
marked_safe:
|
|
1808
|
-
extra_info:
|
|
1809
|
-
threat:
|
|
1810
|
-
attack_type:
|
|
1811
|
-
multi_turn:
|
|
1812
|
-
asr:
|
|
1813
|
-
version:
|
|
1814
|
-
severity:
|
|
1815
|
-
outputs:
|
|
1816
|
-
}).passthrough();
|
|
1817
|
-
var SubCategoryStatsSchema =
|
|
1818
|
-
id:
|
|
1819
|
-
display_name:
|
|
1820
|
-
description:
|
|
1821
|
-
preselect:
|
|
1822
|
-
prerequisites:
|
|
1823
|
-
active:
|
|
1824
|
-
successful:
|
|
1825
|
-
failed:
|
|
1826
|
-
total:
|
|
1827
|
-
}).passthrough();
|
|
1828
|
-
var CategoryReportSchema =
|
|
1829
|
-
id:
|
|
1830
|
-
display_name:
|
|
1831
|
-
description:
|
|
1832
|
-
preselect:
|
|
1833
|
-
sub_categories:
|
|
1834
|
-
asr:
|
|
1835
|
-
total_prompts:
|
|
1836
|
-
total_attacks:
|
|
1837
|
-
successful:
|
|
1838
|
-
failed:
|
|
1839
|
-
}).passthrough();
|
|
1840
|
-
var SeverityStatsSchema =
|
|
1841
|
-
severity:
|
|
1842
|
-
successful:
|
|
1843
|
-
failed:
|
|
1844
|
-
}).passthrough();
|
|
1845
|
-
var SeverityReportSchema =
|
|
1846
|
-
stats:
|
|
1847
|
-
successful:
|
|
1848
|
-
failed:
|
|
1849
|
-
total_attacks:
|
|
1850
|
-
}).passthrough();
|
|
1851
|
-
var ComplianceTechniqueSchema =
|
|
1852
|
-
id:
|
|
1853
|
-
display_name:
|
|
1854
|
-
compliance_id:
|
|
1855
|
-
description:
|
|
1856
|
-
link:
|
|
1857
|
-
version:
|
|
1858
|
-
active:
|
|
1859
|
-
successful:
|
|
1860
|
-
failed:
|
|
1861
|
-
total:
|
|
1862
|
-
}).passthrough();
|
|
1863
|
-
var ComplianceReportSchema =
|
|
1864
|
-
id:
|
|
1865
|
-
display_name:
|
|
1866
|
-
description:
|
|
1867
|
-
active:
|
|
1868
|
-
version:
|
|
1869
|
-
link:
|
|
1870
|
-
techniques:
|
|
1871
|
-
score:
|
|
1872
|
-
}).passthrough();
|
|
1873
|
-
var RuntimeSecurityPolicySchema =
|
|
1874
|
-
policy_id:
|
|
1875
|
-
display_name:
|
|
1876
|
-
config:
|
|
1877
|
-
}).passthrough();
|
|
1878
|
-
var StaticJobRemediationSchema =
|
|
1879
|
-
remediation:
|
|
1880
|
-
description:
|
|
1881
|
-
mapping_remediation_id:
|
|
1882
|
-
subcategories:
|
|
1883
|
-
effectiveness:
|
|
1884
|
-
ease_of_implementation:
|
|
1885
|
-
priority:
|
|
1886
|
-
resource_links:
|
|
1887
|
-
categories:
|
|
1888
|
-
}).passthrough();
|
|
1889
|
-
var StaticJobRemediationRecommendationSchema =
|
|
1890
|
-
runtime_security_policy_configuration:
|
|
1891
|
-
other_measures:
|
|
1892
|
-
}).passthrough();
|
|
1893
|
-
var StaticJobReportSchema =
|
|
2115
|
+
data: z25.array(AttackListItemSchema)
|
|
2116
|
+
}).passthrough();
|
|
2117
|
+
var AttackDetailResponseSchema = z25.object({
|
|
2118
|
+
uuid: z25.string(),
|
|
2119
|
+
tsg_id: z25.string(),
|
|
2120
|
+
job_id: z25.string(),
|
|
2121
|
+
target_id: z25.string(),
|
|
2122
|
+
prompt: z25.string(),
|
|
2123
|
+
prompt_mapping_id: z25.string(),
|
|
2124
|
+
prompt_id: z25.string(),
|
|
2125
|
+
category: z25.string(),
|
|
2126
|
+
sub_category: z25.string(),
|
|
2127
|
+
category_display_name: z25.string(),
|
|
2128
|
+
sub_category_display_name: z25.string(),
|
|
2129
|
+
compliance_frameworks: z25.array(z25.unknown()),
|
|
2130
|
+
goal: z25.string().nullable(),
|
|
2131
|
+
status: z25.string().optional(),
|
|
2132
|
+
marked_safe: z25.boolean().nullable().optional(),
|
|
2133
|
+
extra_info: z25.record(z25.unknown()).optional(),
|
|
2134
|
+
threat: z25.boolean().nullable().optional(),
|
|
2135
|
+
attack_type: z25.string().optional(),
|
|
2136
|
+
multi_turn: z25.boolean().optional(),
|
|
2137
|
+
asr: z25.number().nullable().optional(),
|
|
2138
|
+
version: z25.number().int().nullable().optional(),
|
|
2139
|
+
severity: z25.string().optional(),
|
|
2140
|
+
outputs: z25.array(AttackOutputSchema).optional()
|
|
2141
|
+
}).passthrough();
|
|
2142
|
+
var AttackMultiTurnDetailResponseSchema = z25.object({
|
|
2143
|
+
uuid: z25.string(),
|
|
2144
|
+
tsg_id: z25.string(),
|
|
2145
|
+
job_id: z25.string(),
|
|
2146
|
+
target_id: z25.string(),
|
|
2147
|
+
prompt: z25.string(),
|
|
2148
|
+
prompt_mapping_id: z25.string(),
|
|
2149
|
+
prompt_id: z25.string(),
|
|
2150
|
+
category: z25.string(),
|
|
2151
|
+
sub_category: z25.string(),
|
|
2152
|
+
category_display_name: z25.string(),
|
|
2153
|
+
sub_category_display_name: z25.string(),
|
|
2154
|
+
compliance_frameworks: z25.array(z25.unknown()),
|
|
2155
|
+
goal: z25.string().nullable(),
|
|
2156
|
+
status: z25.string().optional(),
|
|
2157
|
+
marked_safe: z25.boolean().nullable().optional(),
|
|
2158
|
+
extra_info: z25.record(z25.unknown()).optional(),
|
|
2159
|
+
threat: z25.boolean().nullable().optional(),
|
|
2160
|
+
attack_type: z25.string().optional(),
|
|
2161
|
+
multi_turn: z25.boolean().optional(),
|
|
2162
|
+
asr: z25.number().nullable().optional(),
|
|
2163
|
+
version: z25.number().int().nullable().optional(),
|
|
2164
|
+
severity: z25.string().optional(),
|
|
2165
|
+
outputs: z25.array(AttackMultiTurnOutputSchema).optional()
|
|
2166
|
+
}).passthrough();
|
|
2167
|
+
var SubCategoryStatsSchema = z25.object({
|
|
2168
|
+
id: z25.string(),
|
|
2169
|
+
display_name: z25.string(),
|
|
2170
|
+
description: z25.string(),
|
|
2171
|
+
preselect: z25.boolean().optional(),
|
|
2172
|
+
prerequisites: z25.array(PrerequisiteModelSchema).nullable().optional(),
|
|
2173
|
+
active: z25.boolean().optional(),
|
|
2174
|
+
successful: z25.number().int(),
|
|
2175
|
+
failed: z25.number().int(),
|
|
2176
|
+
total: z25.number().int().optional()
|
|
2177
|
+
}).passthrough();
|
|
2178
|
+
var CategoryReportSchema = z25.object({
|
|
2179
|
+
id: z25.string(),
|
|
2180
|
+
display_name: z25.string(),
|
|
2181
|
+
description: z25.string(),
|
|
2182
|
+
preselect: z25.boolean().optional(),
|
|
2183
|
+
sub_categories: z25.array(SubCategoryStatsSchema),
|
|
2184
|
+
asr: z25.number(),
|
|
2185
|
+
total_prompts: z25.number().int(),
|
|
2186
|
+
total_attacks: z25.number().int(),
|
|
2187
|
+
successful: z25.number().int(),
|
|
2188
|
+
failed: z25.number().int()
|
|
2189
|
+
}).passthrough();
|
|
2190
|
+
var SeverityStatsSchema = z25.object({
|
|
2191
|
+
severity: z25.string(),
|
|
2192
|
+
successful: z25.number().int().optional(),
|
|
2193
|
+
failed: z25.number().int().optional()
|
|
2194
|
+
}).passthrough();
|
|
2195
|
+
var SeverityReportSchema = z25.object({
|
|
2196
|
+
stats: z25.array(SeverityStatsSchema),
|
|
2197
|
+
successful: z25.number().int().optional(),
|
|
2198
|
+
failed: z25.number().int().optional(),
|
|
2199
|
+
total_attacks: z25.number().int().optional()
|
|
2200
|
+
}).passthrough();
|
|
2201
|
+
var ComplianceTechniqueSchema = z25.object({
|
|
2202
|
+
id: z25.string(),
|
|
2203
|
+
display_name: z25.string(),
|
|
2204
|
+
compliance_id: z25.string(),
|
|
2205
|
+
description: z25.string(),
|
|
2206
|
+
link: z25.string(),
|
|
2207
|
+
version: z25.string(),
|
|
2208
|
+
active: z25.boolean(),
|
|
2209
|
+
successful: z25.number().int().optional(),
|
|
2210
|
+
failed: z25.number().int().optional(),
|
|
2211
|
+
total: z25.number().int().optional()
|
|
2212
|
+
}).passthrough();
|
|
2213
|
+
var ComplianceReportSchema = z25.object({
|
|
2214
|
+
id: z25.string(),
|
|
2215
|
+
display_name: z25.string(),
|
|
2216
|
+
description: z25.string(),
|
|
2217
|
+
active: z25.boolean(),
|
|
2218
|
+
version: z25.string(),
|
|
2219
|
+
link: z25.string(),
|
|
2220
|
+
techniques: z25.array(ComplianceTechniqueSchema),
|
|
2221
|
+
score: z25.number().int().optional()
|
|
2222
|
+
}).passthrough();
|
|
2223
|
+
var RuntimeSecurityPolicySchema = z25.object({
|
|
2224
|
+
policy_id: z25.string(),
|
|
2225
|
+
display_name: z25.string(),
|
|
2226
|
+
config: z25.record(z25.unknown())
|
|
2227
|
+
}).passthrough();
|
|
2228
|
+
var StaticJobRemediationSchema = z25.object({
|
|
2229
|
+
remediation: z25.string(),
|
|
2230
|
+
description: z25.string(),
|
|
2231
|
+
mapping_remediation_id: z25.string().nullable().optional(),
|
|
2232
|
+
subcategories: z25.array(z25.string()).nullable().optional(),
|
|
2233
|
+
effectiveness: z25.number().int().optional(),
|
|
2234
|
+
ease_of_implementation: z25.number().int().optional(),
|
|
2235
|
+
priority: z25.number().int().optional(),
|
|
2236
|
+
resource_links: z25.array(z25.string()).optional(),
|
|
2237
|
+
categories: z25.array(z25.string()).nullable().optional()
|
|
2238
|
+
}).passthrough();
|
|
2239
|
+
var StaticJobRemediationRecommendationSchema = z25.object({
|
|
2240
|
+
runtime_security_policy_configuration: z25.array(RuntimeSecurityPolicySchema).nullable().optional(),
|
|
2241
|
+
other_measures: z25.array(StaticJobRemediationSchema).optional()
|
|
2242
|
+
}).passthrough();
|
|
2243
|
+
var StaticJobReportSchema = z25.object({
|
|
1894
2244
|
severity_report: SeverityReportSchema,
|
|
1895
|
-
asr:
|
|
1896
|
-
score:
|
|
2245
|
+
asr: z25.number().nullable().optional(),
|
|
2246
|
+
score: z25.number().nullable().optional(),
|
|
1897
2247
|
security_report: CategoryReportSchema.nullable().optional(),
|
|
1898
2248
|
safety_report: CategoryReportSchema.nullable().optional(),
|
|
1899
2249
|
brand_report: CategoryReportSchema.nullable().optional(),
|
|
1900
|
-
compliance_report:
|
|
1901
|
-
report_summary:
|
|
2250
|
+
compliance_report: z25.array(ComplianceReportSchema).nullable().optional(),
|
|
2251
|
+
report_summary: z25.string().nullable().optional(),
|
|
1902
2252
|
recommendations: StaticJobRemediationRecommendationSchema.nullable().optional()
|
|
1903
2253
|
}).passthrough();
|
|
1904
|
-
var DynamicJobReportSchema =
|
|
1905
|
-
total_goals:
|
|
1906
|
-
total_streams:
|
|
1907
|
-
total_threats:
|
|
1908
|
-
goals_achieved:
|
|
1909
|
-
report_summary:
|
|
1910
|
-
score:
|
|
1911
|
-
asr:
|
|
1912
|
-
}).passthrough();
|
|
1913
|
-
var RemediationDetailSchema =
|
|
1914
|
-
remediation:
|
|
1915
|
-
description:
|
|
1916
|
-
resource_links:
|
|
1917
|
-
priority_level:
|
|
1918
|
-
ease_of_implementation_level:
|
|
1919
|
-
effectiveness_level:
|
|
1920
|
-
}).passthrough();
|
|
1921
|
-
var RemediationResponseSchema =
|
|
1922
|
-
var RuntimeSecurityProfileResponseSchema =
|
|
1923
|
-
runtime_security_profile:
|
|
1924
|
-
}).passthrough();
|
|
1925
|
-
var GoalSchema =
|
|
1926
|
-
goal:
|
|
1927
|
-
safe_response:
|
|
1928
|
-
jailbroken_response:
|
|
1929
|
-
goal_metadata:
|
|
1930
|
-
custom_goal:
|
|
1931
|
-
goal_type:
|
|
1932
|
-
uuid:
|
|
1933
|
-
tsg_id:
|
|
1934
|
-
job_id:
|
|
1935
|
-
goal_to_show:
|
|
1936
|
-
threat:
|
|
1937
|
-
version:
|
|
1938
|
-
extra_info:
|
|
1939
|
-
}).passthrough();
|
|
1940
|
-
var GoalListResponseSchema =
|
|
1941
|
-
var StreamIterationDataSchema =
|
|
1942
|
-
uuid:
|
|
1943
|
-
tsg_id:
|
|
1944
|
-
job_id:
|
|
1945
|
-
stream_id:
|
|
1946
|
-
goal_id:
|
|
1947
|
-
iteration:
|
|
1948
|
-
prompt:
|
|
1949
|
-
techniques:
|
|
1950
|
-
improvement:
|
|
1951
|
-
prompts_objective:
|
|
1952
|
-
summary:
|
|
1953
|
-
output:
|
|
1954
|
-
score:
|
|
1955
|
-
judge_reasoning:
|
|
1956
|
-
threat:
|
|
1957
|
-
created_at:
|
|
1958
|
-
updated_at:
|
|
1959
|
-
extra_info:
|
|
1960
|
-
version:
|
|
1961
|
-
}).passthrough();
|
|
1962
|
-
var StreamDetailResponseSchema =
|
|
1963
|
-
uuid:
|
|
1964
|
-
tsg_id:
|
|
1965
|
-
job_id:
|
|
1966
|
-
target_id:
|
|
1967
|
-
goal_id:
|
|
1968
|
-
stream_idx:
|
|
1969
|
-
iteration:
|
|
1970
|
-
goal:
|
|
1971
|
-
marked_safe:
|
|
1972
|
-
stream_type:
|
|
1973
|
-
threat:
|
|
2254
|
+
var DynamicJobReportSchema = z25.object({
|
|
2255
|
+
total_goals: z25.number().int().optional(),
|
|
2256
|
+
total_streams: z25.number().int().optional(),
|
|
2257
|
+
total_threats: z25.number().int().optional(),
|
|
2258
|
+
goals_achieved: z25.number().int().optional(),
|
|
2259
|
+
report_summary: z25.string().nullable().optional(),
|
|
2260
|
+
score: z25.number().optional(),
|
|
2261
|
+
asr: z25.number().optional()
|
|
2262
|
+
}).passthrough();
|
|
2263
|
+
var RemediationDetailSchema = z25.object({
|
|
2264
|
+
remediation: z25.string(),
|
|
2265
|
+
description: z25.string(),
|
|
2266
|
+
resource_links: z25.array(z25.string()).optional(),
|
|
2267
|
+
priority_level: z25.string().optional(),
|
|
2268
|
+
ease_of_implementation_level: z25.string().optional(),
|
|
2269
|
+
effectiveness_level: z25.string().optional()
|
|
2270
|
+
}).passthrough();
|
|
2271
|
+
var RemediationResponseSchema = z25.object({ remediations: z25.array(RemediationDetailSchema).optional() }).passthrough();
|
|
2272
|
+
var RuntimeSecurityProfileResponseSchema = z25.object({
|
|
2273
|
+
runtime_security_profile: z25.array(RuntimeSecurityPolicySchema).nullable().optional()
|
|
2274
|
+
}).passthrough();
|
|
2275
|
+
var GoalSchema = z25.object({
|
|
2276
|
+
goal: z25.string(),
|
|
2277
|
+
safe_response: z25.string(),
|
|
2278
|
+
jailbroken_response: z25.string(),
|
|
2279
|
+
goal_metadata: z25.record(z25.unknown()).optional(),
|
|
2280
|
+
custom_goal: z25.boolean().optional(),
|
|
2281
|
+
goal_type: z25.string().optional(),
|
|
2282
|
+
uuid: z25.string(),
|
|
2283
|
+
tsg_id: z25.string(),
|
|
2284
|
+
job_id: z25.string(),
|
|
2285
|
+
goal_to_show: z25.string().nullable().optional(),
|
|
2286
|
+
threat: z25.boolean().optional(),
|
|
2287
|
+
version: z25.number().int().nullable().optional(),
|
|
2288
|
+
extra_info: z25.record(z25.unknown()).nullable().optional()
|
|
2289
|
+
}).passthrough();
|
|
2290
|
+
var GoalListResponseSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(GoalSchema) }).passthrough();
|
|
2291
|
+
var StreamIterationDataSchema = z25.object({
|
|
2292
|
+
uuid: z25.string(),
|
|
2293
|
+
tsg_id: z25.string(),
|
|
2294
|
+
job_id: z25.string(),
|
|
2295
|
+
stream_id: z25.string(),
|
|
2296
|
+
goal_id: z25.string(),
|
|
2297
|
+
iteration: z25.number().int(),
|
|
2298
|
+
prompt: z25.string(),
|
|
2299
|
+
techniques: z25.string(),
|
|
2300
|
+
improvement: z25.string(),
|
|
2301
|
+
prompts_objective: z25.string(),
|
|
2302
|
+
summary: z25.string(),
|
|
2303
|
+
output: z25.string().nullable().optional(),
|
|
2304
|
+
score: z25.number().int().nullable().optional(),
|
|
2305
|
+
judge_reasoning: z25.string().nullable().optional(),
|
|
2306
|
+
threat: z25.boolean().optional(),
|
|
2307
|
+
created_at: z25.string().nullable().optional(),
|
|
2308
|
+
updated_at: z25.string().nullable().optional(),
|
|
2309
|
+
extra_info: z25.record(z25.unknown()).nullable().optional(),
|
|
2310
|
+
version: z25.number().int().nullable().optional()
|
|
2311
|
+
}).passthrough();
|
|
2312
|
+
var StreamDetailResponseSchema = z25.object({
|
|
2313
|
+
uuid: z25.string(),
|
|
2314
|
+
tsg_id: z25.string(),
|
|
2315
|
+
job_id: z25.string(),
|
|
2316
|
+
target_id: z25.string(),
|
|
2317
|
+
goal_id: z25.string(),
|
|
2318
|
+
stream_idx: z25.number().int().optional(),
|
|
2319
|
+
iteration: z25.number().int().optional(),
|
|
2320
|
+
goal: z25.unknown().optional(),
|
|
2321
|
+
marked_safe: z25.boolean().optional(),
|
|
2322
|
+
stream_type: z25.string().nullable().optional(),
|
|
2323
|
+
threat: z25.boolean().optional(),
|
|
1974
2324
|
first_threat_iteration: StreamIterationDataSchema.nullable().optional(),
|
|
1975
|
-
created_at:
|
|
1976
|
-
updated_at:
|
|
1977
|
-
extra_info:
|
|
1978
|
-
version:
|
|
1979
|
-
iterations:
|
|
1980
|
-
}).passthrough();
|
|
1981
|
-
var StreamListResponseSchema =
|
|
1982
|
-
var CustomAttackOutputSchema =
|
|
1983
|
-
uuid:
|
|
1984
|
-
tsg_id:
|
|
1985
|
-
custom_attack_id:
|
|
1986
|
-
job_id:
|
|
1987
|
-
target_id:
|
|
1988
|
-
output:
|
|
1989
|
-
threat:
|
|
1990
|
-
marked_safe:
|
|
1991
|
-
}).passthrough();
|
|
1992
|
-
var PropertyAssignmentSchema =
|
|
1993
|
-
name:
|
|
1994
|
-
value:
|
|
2325
|
+
created_at: z25.string().nullable().optional(),
|
|
2326
|
+
updated_at: z25.string().nullable().optional(),
|
|
2327
|
+
extra_info: z25.record(z25.unknown()).optional(),
|
|
2328
|
+
version: z25.number().int().nullable().optional(),
|
|
2329
|
+
iterations: z25.array(StreamIterationDataSchema).optional()
|
|
2330
|
+
}).passthrough();
|
|
2331
|
+
var StreamListResponseSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(StreamDetailResponseSchema) }).passthrough();
|
|
2332
|
+
var CustomAttackOutputSchema = z25.object({
|
|
2333
|
+
uuid: z25.string(),
|
|
2334
|
+
tsg_id: z25.string(),
|
|
2335
|
+
custom_attack_id: z25.string(),
|
|
2336
|
+
job_id: z25.string(),
|
|
2337
|
+
target_id: z25.string(),
|
|
2338
|
+
output: z25.string(),
|
|
2339
|
+
threat: z25.boolean().nullable().optional(),
|
|
2340
|
+
marked_safe: z25.boolean().nullable().optional()
|
|
2341
|
+
}).passthrough();
|
|
2342
|
+
var PropertyAssignmentSchema = z25.object({
|
|
2343
|
+
name: z25.string(),
|
|
2344
|
+
value: z25.string()
|
|
1995
2345
|
});
|
|
1996
|
-
var PropertyValueStatisticSchema =
|
|
1997
|
-
value:
|
|
1998
|
-
successful_attack_count:
|
|
1999
|
-
total_attack_count:
|
|
2000
|
-
success_rate:
|
|
2346
|
+
var PropertyValueStatisticSchema = z25.object({
|
|
2347
|
+
value: z25.string(),
|
|
2348
|
+
successful_attack_count: z25.number().int(),
|
|
2349
|
+
total_attack_count: z25.number().int(),
|
|
2350
|
+
success_rate: z25.number()
|
|
2001
2351
|
});
|
|
2002
|
-
var PropertyStatisticSchema =
|
|
2003
|
-
property_name:
|
|
2004
|
-
values:
|
|
2352
|
+
var PropertyStatisticSchema = z25.object({
|
|
2353
|
+
property_name: z25.string(),
|
|
2354
|
+
values: z25.array(PropertyValueStatisticSchema)
|
|
2005
2355
|
});
|
|
2006
|
-
var PromptSetSummarySchema =
|
|
2007
|
-
prompt_set_id:
|
|
2008
|
-
prompt_set_name:
|
|
2009
|
-
total_prompts:
|
|
2010
|
-
total_attacks:
|
|
2011
|
-
total_threats:
|
|
2012
|
-
failed_attacks:
|
|
2013
|
-
threat_rate:
|
|
2014
|
-
property_names:
|
|
2015
|
-
property_statistics:
|
|
2016
|
-
}).passthrough();
|
|
2017
|
-
var CustomAttackReportResponseSchema =
|
|
2018
|
-
total_prompts:
|
|
2019
|
-
total_attacks:
|
|
2020
|
-
total_threats:
|
|
2021
|
-
failed_attacks:
|
|
2022
|
-
score:
|
|
2023
|
-
asr:
|
|
2024
|
-
custom_attack_reports:
|
|
2025
|
-
property_statistics:
|
|
2026
|
-
}).passthrough();
|
|
2027
|
-
var PromptSetsReportResponseSchema =
|
|
2028
|
-
prompt_sets:
|
|
2029
|
-
total_prompt_sets:
|
|
2030
|
-
applied_filters:
|
|
2031
|
-
}).passthrough();
|
|
2032
|
-
var PromptDetailResponseSchema =
|
|
2033
|
-
prompt_id:
|
|
2034
|
-
prompt_text:
|
|
2035
|
-
goal:
|
|
2036
|
-
user_defined_goal:
|
|
2037
|
-
properties:
|
|
2038
|
-
attack_id:
|
|
2039
|
-
threat:
|
|
2040
|
-
attack_outputs:
|
|
2041
|
-
asr:
|
|
2042
|
-
prompt_set_id:
|
|
2043
|
-
prompt_set_name:
|
|
2044
|
-
}).passthrough();
|
|
2045
|
-
var CustomAttacksListResponseSchema =
|
|
2356
|
+
var PromptSetSummarySchema = z25.object({
|
|
2357
|
+
prompt_set_id: z25.string(),
|
|
2358
|
+
prompt_set_name: z25.string(),
|
|
2359
|
+
total_prompts: z25.number().int(),
|
|
2360
|
+
total_attacks: z25.number().int(),
|
|
2361
|
+
total_threats: z25.number().int(),
|
|
2362
|
+
failed_attacks: z25.number().int(),
|
|
2363
|
+
threat_rate: z25.number(),
|
|
2364
|
+
property_names: z25.array(z25.string()).optional(),
|
|
2365
|
+
property_statistics: z25.array(PropertyStatisticSchema).optional()
|
|
2366
|
+
}).passthrough();
|
|
2367
|
+
var CustomAttackReportResponseSchema = z25.object({
|
|
2368
|
+
total_prompts: z25.number().int(),
|
|
2369
|
+
total_attacks: z25.number().int(),
|
|
2370
|
+
total_threats: z25.number().int(),
|
|
2371
|
+
failed_attacks: z25.number().int(),
|
|
2372
|
+
score: z25.number(),
|
|
2373
|
+
asr: z25.number(),
|
|
2374
|
+
custom_attack_reports: z25.array(PromptSetSummarySchema).optional(),
|
|
2375
|
+
property_statistics: z25.array(PropertyStatisticSchema).optional()
|
|
2376
|
+
}).passthrough();
|
|
2377
|
+
var PromptSetsReportResponseSchema = z25.object({
|
|
2378
|
+
prompt_sets: z25.array(PromptSetSummarySchema),
|
|
2379
|
+
total_prompt_sets: z25.number().int(),
|
|
2380
|
+
applied_filters: z25.record(z25.unknown()).optional()
|
|
2381
|
+
}).passthrough();
|
|
2382
|
+
var PromptDetailResponseSchema = z25.object({
|
|
2383
|
+
prompt_id: z25.string(),
|
|
2384
|
+
prompt_text: z25.string(),
|
|
2385
|
+
goal: z25.string().nullable().optional(),
|
|
2386
|
+
user_defined_goal: z25.boolean().optional(),
|
|
2387
|
+
properties: z25.array(PropertyAssignmentSchema).optional(),
|
|
2388
|
+
attack_id: z25.string().nullable().optional(),
|
|
2389
|
+
threat: z25.boolean().nullable().optional(),
|
|
2390
|
+
attack_outputs: z25.array(CustomAttackOutputSchema).optional(),
|
|
2391
|
+
asr: z25.number().nullable().optional(),
|
|
2392
|
+
prompt_set_id: z25.string().nullable().optional(),
|
|
2393
|
+
prompt_set_name: z25.string().nullable().optional()
|
|
2394
|
+
}).passthrough();
|
|
2395
|
+
var CustomAttacksListResponseSchema = z25.object({
|
|
2046
2396
|
pagination: RedTeamPaginationSchema,
|
|
2047
|
-
data:
|
|
2048
|
-
total_attacks:
|
|
2049
|
-
total_threats:
|
|
2050
|
-
}).passthrough();
|
|
2051
|
-
var RiskLevelSchema =
|
|
2052
|
-
risk_rating:
|
|
2053
|
-
total:
|
|
2054
|
-
targets_by_type:
|
|
2055
|
-
}).passthrough();
|
|
2056
|
-
var ScanStatisticsResponseSchema =
|
|
2057
|
-
total_scans:
|
|
2058
|
-
targets_scanned:
|
|
2059
|
-
targets_scanned_by_type:
|
|
2060
|
-
scan_status:
|
|
2061
|
-
risk_profile:
|
|
2062
|
-
}).passthrough();
|
|
2063
|
-
var ScoreTrendSeriesSchema =
|
|
2064
|
-
label:
|
|
2065
|
-
data:
|
|
2397
|
+
data: z25.array(z25.unknown()),
|
|
2398
|
+
total_attacks: z25.number().int(),
|
|
2399
|
+
total_threats: z25.number().int()
|
|
2400
|
+
}).passthrough();
|
|
2401
|
+
var RiskLevelSchema = z25.object({
|
|
2402
|
+
risk_rating: z25.string(),
|
|
2403
|
+
total: z25.number().int(),
|
|
2404
|
+
targets_by_type: z25.array(CountByNameSchema).optional()
|
|
2405
|
+
}).passthrough();
|
|
2406
|
+
var ScanStatisticsResponseSchema = z25.object({
|
|
2407
|
+
total_scans: z25.number().int(),
|
|
2408
|
+
targets_scanned: z25.number().int(),
|
|
2409
|
+
targets_scanned_by_type: z25.array(CountByNameSchema).optional(),
|
|
2410
|
+
scan_status: z25.array(CountByNameSchema).optional(),
|
|
2411
|
+
risk_profile: z25.array(RiskLevelSchema).optional()
|
|
2412
|
+
}).passthrough();
|
|
2413
|
+
var ScoreTrendSeriesSchema = z25.object({
|
|
2414
|
+
label: z25.string(),
|
|
2415
|
+
data: z25.array(z25.number().nullable())
|
|
2066
2416
|
});
|
|
2067
|
-
var ScoreTrendResponseSchema =
|
|
2068
|
-
labels:
|
|
2069
|
-
series:
|
|
2417
|
+
var ScoreTrendResponseSchema = z25.object({
|
|
2418
|
+
labels: z25.array(z25.string()),
|
|
2419
|
+
series: z25.array(ScoreTrendSeriesSchema)
|
|
2070
2420
|
});
|
|
2071
|
-
var SentimentRequestSchema =
|
|
2072
|
-
job_id:
|
|
2073
|
-
up_vote:
|
|
2074
|
-
down_vote:
|
|
2421
|
+
var SentimentRequestSchema = z25.object({
|
|
2422
|
+
job_id: z25.string(),
|
|
2423
|
+
up_vote: z25.boolean().optional(),
|
|
2424
|
+
down_vote: z25.boolean().optional()
|
|
2075
2425
|
});
|
|
2076
|
-
var SentimentResponseSchema =
|
|
2077
|
-
job_id:
|
|
2078
|
-
up_vote:
|
|
2079
|
-
down_vote:
|
|
2080
|
-
}).passthrough();
|
|
2081
|
-
var QuotaDetailsSchema =
|
|
2082
|
-
allocated:
|
|
2083
|
-
unlimited:
|
|
2084
|
-
consumed:
|
|
2426
|
+
var SentimentResponseSchema = z25.object({
|
|
2427
|
+
job_id: z25.string(),
|
|
2428
|
+
up_vote: z25.boolean().optional(),
|
|
2429
|
+
down_vote: z25.boolean().optional()
|
|
2430
|
+
}).passthrough();
|
|
2431
|
+
var QuotaDetailsSchema = z25.object({
|
|
2432
|
+
allocated: z25.number().int(),
|
|
2433
|
+
unlimited: z25.boolean(),
|
|
2434
|
+
consumed: z25.number().int()
|
|
2085
2435
|
});
|
|
2086
|
-
var QuotaSummarySchema =
|
|
2436
|
+
var QuotaSummarySchema = z25.object({
|
|
2087
2437
|
static: QuotaDetailsSchema,
|
|
2088
2438
|
dynamic: QuotaDetailsSchema,
|
|
2089
2439
|
custom: QuotaDetailsSchema
|
|
2090
2440
|
});
|
|
2091
|
-
var ErrorLogSchema =
|
|
2092
|
-
created_at:
|
|
2093
|
-
updated_at:
|
|
2094
|
-
job_id:
|
|
2095
|
-
target_id:
|
|
2096
|
-
target_version:
|
|
2097
|
-
attack_id:
|
|
2098
|
-
error_type:
|
|
2099
|
-
error_source:
|
|
2100
|
-
error_message:
|
|
2101
|
-
target_object:
|
|
2102
|
-
extra_info:
|
|
2103
|
-
version:
|
|
2104
|
-
}).passthrough();
|
|
2105
|
-
var ErrorLogListResponseSchema =
|
|
2106
|
-
var TargetCreateRequestSchema =
|
|
2107
|
-
name:
|
|
2108
|
-
description:
|
|
2109
|
-
target_type:
|
|
2110
|
-
connection_type:
|
|
2111
|
-
api_endpoint_type:
|
|
2112
|
-
response_mode:
|
|
2113
|
-
connection_params:
|
|
2114
|
-
session_supported:
|
|
2115
|
-
target_metadata:
|
|
2116
|
-
target_background:
|
|
2117
|
-
additional_context:
|
|
2118
|
-
extra_info:
|
|
2119
|
-
network_broker_channel_uuid:
|
|
2120
|
-
}).passthrough();
|
|
2121
|
-
var TargetUpdateRequestSchema =
|
|
2122
|
-
name:
|
|
2123
|
-
description:
|
|
2124
|
-
target_type:
|
|
2125
|
-
connection_type:
|
|
2126
|
-
api_endpoint_type:
|
|
2127
|
-
response_mode:
|
|
2128
|
-
connection_params:
|
|
2129
|
-
session_supported:
|
|
2130
|
-
target_metadata:
|
|
2131
|
-
target_background:
|
|
2132
|
-
additional_context:
|
|
2133
|
-
extra_info:
|
|
2134
|
-
network_broker_channel_uuid:
|
|
2135
|
-
}).passthrough();
|
|
2136
|
-
var TargetContextUpdateSchema =
|
|
2137
|
-
target_background:
|
|
2138
|
-
additional_context:
|
|
2139
|
-
}).passthrough();
|
|
2140
|
-
var TargetResponseSchema =
|
|
2141
|
-
uuid:
|
|
2142
|
-
tsg_id:
|
|
2143
|
-
name:
|
|
2144
|
-
status:
|
|
2145
|
-
active:
|
|
2146
|
-
validated:
|
|
2147
|
-
created_at:
|
|
2148
|
-
updated_at:
|
|
2149
|
-
description:
|
|
2150
|
-
target_type:
|
|
2151
|
-
connection_type:
|
|
2152
|
-
api_endpoint_type:
|
|
2153
|
-
response_mode:
|
|
2154
|
-
session_supported:
|
|
2155
|
-
extra_info:
|
|
2156
|
-
version:
|
|
2157
|
-
secret_version:
|
|
2158
|
-
created_by_user_id:
|
|
2159
|
-
updated_by_user_id:
|
|
2160
|
-
target_metadata:
|
|
2161
|
-
target_background:
|
|
2162
|
-
profiling_status:
|
|
2163
|
-
additional_context:
|
|
2164
|
-
}).passthrough();
|
|
2165
|
-
var TargetListItemSchema =
|
|
2166
|
-
uuid:
|
|
2167
|
-
tsg_id:
|
|
2168
|
-
name:
|
|
2169
|
-
status:
|
|
2170
|
-
active:
|
|
2171
|
-
validated:
|
|
2172
|
-
created_at:
|
|
2173
|
-
updated_at:
|
|
2174
|
-
description:
|
|
2175
|
-
target_type:
|
|
2176
|
-
connection_type:
|
|
2177
|
-
api_endpoint_type:
|
|
2178
|
-
response_mode:
|
|
2179
|
-
session_supported:
|
|
2180
|
-
extra_info:
|
|
2181
|
-
version:
|
|
2182
|
-
secret_version:
|
|
2183
|
-
created_by_user_id:
|
|
2184
|
-
updated_by_user_id:
|
|
2185
|
-
}).passthrough();
|
|
2186
|
-
var TargetListSchema =
|
|
2187
|
-
var TargetProbeRequestSchema =
|
|
2188
|
-
name:
|
|
2189
|
-
uuid:
|
|
2190
|
-
description:
|
|
2191
|
-
target_type:
|
|
2192
|
-
connection_type:
|
|
2193
|
-
api_endpoint_type:
|
|
2194
|
-
response_mode:
|
|
2195
|
-
connection_params:
|
|
2196
|
-
session_supported:
|
|
2197
|
-
target_metadata:
|
|
2198
|
-
target_background:
|
|
2199
|
-
additional_context:
|
|
2200
|
-
extra_info:
|
|
2201
|
-
network_broker_channel_uuid:
|
|
2202
|
-
probe_fields:
|
|
2203
|
-
}).passthrough();
|
|
2204
|
-
var TargetProfileResponseSchema =
|
|
2205
|
-
target_id:
|
|
2206
|
-
target_version:
|
|
2207
|
-
status:
|
|
2208
|
-
profiling_status:
|
|
2209
|
-
target_background:
|
|
2210
|
-
additional_context:
|
|
2211
|
-
ai_generated_fields:
|
|
2212
|
-
other_details:
|
|
2213
|
-
}).passthrough();
|
|
2214
|
-
var BaseResponseSchema =
|
|
2215
|
-
message:
|
|
2216
|
-
status:
|
|
2441
|
+
var ErrorLogSchema = z25.object({
|
|
2442
|
+
created_at: z25.string(),
|
|
2443
|
+
updated_at: z25.string(),
|
|
2444
|
+
job_id: z25.string().nullable().optional(),
|
|
2445
|
+
target_id: z25.string().nullable().optional(),
|
|
2446
|
+
target_version: z25.number().int().nullable().optional(),
|
|
2447
|
+
attack_id: z25.string().nullable().optional(),
|
|
2448
|
+
error_type: z25.string().nullable().optional(),
|
|
2449
|
+
error_source: z25.string().nullable().optional(),
|
|
2450
|
+
error_message: z25.string().nullable().optional(),
|
|
2451
|
+
target_object: z25.record(z25.unknown()).nullable().optional(),
|
|
2452
|
+
extra_info: z25.record(z25.unknown()).nullable().optional(),
|
|
2453
|
+
version: z25.number().int().optional()
|
|
2454
|
+
}).passthrough();
|
|
2455
|
+
var ErrorLogListResponseSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(ErrorLogSchema) }).passthrough();
|
|
2456
|
+
var TargetCreateRequestSchema = z25.object({
|
|
2457
|
+
name: z25.string(),
|
|
2458
|
+
description: z25.unknown().optional(),
|
|
2459
|
+
target_type: z25.unknown().optional(),
|
|
2460
|
+
connection_type: z25.unknown().optional(),
|
|
2461
|
+
api_endpoint_type: z25.unknown().optional(),
|
|
2462
|
+
response_mode: z25.unknown().optional(),
|
|
2463
|
+
connection_params: z25.unknown().optional(),
|
|
2464
|
+
session_supported: z25.boolean().optional(),
|
|
2465
|
+
target_metadata: z25.unknown().optional(),
|
|
2466
|
+
target_background: z25.unknown().optional(),
|
|
2467
|
+
additional_context: z25.unknown().optional(),
|
|
2468
|
+
extra_info: z25.unknown().optional(),
|
|
2469
|
+
network_broker_channel_uuid: z25.unknown().optional()
|
|
2470
|
+
}).passthrough();
|
|
2471
|
+
var TargetUpdateRequestSchema = z25.object({
|
|
2472
|
+
name: z25.string(),
|
|
2473
|
+
description: z25.unknown().optional(),
|
|
2474
|
+
target_type: z25.unknown().optional(),
|
|
2475
|
+
connection_type: z25.unknown().optional(),
|
|
2476
|
+
api_endpoint_type: z25.unknown().optional(),
|
|
2477
|
+
response_mode: z25.unknown().optional(),
|
|
2478
|
+
connection_params: z25.unknown().optional(),
|
|
2479
|
+
session_supported: z25.boolean().optional(),
|
|
2480
|
+
target_metadata: z25.unknown().optional(),
|
|
2481
|
+
target_background: z25.unknown().optional(),
|
|
2482
|
+
additional_context: z25.unknown().optional(),
|
|
2483
|
+
extra_info: z25.unknown().optional(),
|
|
2484
|
+
network_broker_channel_uuid: z25.unknown().optional()
|
|
2485
|
+
}).passthrough();
|
|
2486
|
+
var TargetContextUpdateSchema = z25.object({
|
|
2487
|
+
target_background: z25.unknown().optional(),
|
|
2488
|
+
additional_context: z25.unknown().optional()
|
|
2489
|
+
}).passthrough();
|
|
2490
|
+
var TargetResponseSchema = z25.object({
|
|
2491
|
+
uuid: z25.string(),
|
|
2492
|
+
tsg_id: z25.string(),
|
|
2493
|
+
name: z25.string(),
|
|
2494
|
+
status: z25.unknown(),
|
|
2495
|
+
active: z25.boolean(),
|
|
2496
|
+
validated: z25.boolean(),
|
|
2497
|
+
created_at: z25.string(),
|
|
2498
|
+
updated_at: z25.string(),
|
|
2499
|
+
description: z25.unknown().optional(),
|
|
2500
|
+
target_type: z25.unknown().optional(),
|
|
2501
|
+
connection_type: z25.unknown().optional(),
|
|
2502
|
+
api_endpoint_type: z25.unknown().optional(),
|
|
2503
|
+
response_mode: z25.unknown().optional(),
|
|
2504
|
+
session_supported: z25.boolean().optional(),
|
|
2505
|
+
extra_info: z25.unknown().optional(),
|
|
2506
|
+
version: z25.unknown().optional(),
|
|
2507
|
+
secret_version: z25.unknown().optional(),
|
|
2508
|
+
created_by_user_id: z25.unknown().optional(),
|
|
2509
|
+
updated_by_user_id: z25.unknown().optional(),
|
|
2510
|
+
target_metadata: z25.unknown().optional(),
|
|
2511
|
+
target_background: z25.unknown().optional(),
|
|
2512
|
+
profiling_status: z25.unknown().optional(),
|
|
2513
|
+
additional_context: z25.unknown().optional()
|
|
2514
|
+
}).passthrough();
|
|
2515
|
+
var TargetListItemSchema = z25.object({
|
|
2516
|
+
uuid: z25.string(),
|
|
2517
|
+
tsg_id: z25.string(),
|
|
2518
|
+
name: z25.string(),
|
|
2519
|
+
status: z25.unknown(),
|
|
2520
|
+
active: z25.boolean(),
|
|
2521
|
+
validated: z25.boolean(),
|
|
2522
|
+
created_at: z25.string(),
|
|
2523
|
+
updated_at: z25.string(),
|
|
2524
|
+
description: z25.unknown().optional(),
|
|
2525
|
+
target_type: z25.unknown().optional(),
|
|
2526
|
+
connection_type: z25.unknown().optional(),
|
|
2527
|
+
api_endpoint_type: z25.unknown().optional(),
|
|
2528
|
+
response_mode: z25.unknown().optional(),
|
|
2529
|
+
session_supported: z25.boolean().optional(),
|
|
2530
|
+
extra_info: z25.unknown().optional(),
|
|
2531
|
+
version: z25.unknown().optional(),
|
|
2532
|
+
secret_version: z25.unknown().optional(),
|
|
2533
|
+
created_by_user_id: z25.unknown().optional(),
|
|
2534
|
+
updated_by_user_id: z25.unknown().optional()
|
|
2535
|
+
}).passthrough();
|
|
2536
|
+
var TargetListSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(TargetListItemSchema).optional() }).passthrough();
|
|
2537
|
+
var TargetProbeRequestSchema = z25.object({
|
|
2538
|
+
name: z25.string(),
|
|
2539
|
+
uuid: z25.unknown().optional(),
|
|
2540
|
+
description: z25.unknown().optional(),
|
|
2541
|
+
target_type: z25.unknown().optional(),
|
|
2542
|
+
connection_type: z25.unknown().optional(),
|
|
2543
|
+
api_endpoint_type: z25.unknown().optional(),
|
|
2544
|
+
response_mode: z25.unknown().optional(),
|
|
2545
|
+
connection_params: z25.unknown().optional(),
|
|
2546
|
+
session_supported: z25.boolean().optional(),
|
|
2547
|
+
target_metadata: z25.unknown().optional(),
|
|
2548
|
+
target_background: z25.unknown().optional(),
|
|
2549
|
+
additional_context: z25.unknown().optional(),
|
|
2550
|
+
extra_info: z25.unknown().optional(),
|
|
2551
|
+
network_broker_channel_uuid: z25.unknown().optional(),
|
|
2552
|
+
probe_fields: z25.unknown().optional()
|
|
2553
|
+
}).passthrough();
|
|
2554
|
+
var TargetProfileResponseSchema = z25.object({
|
|
2555
|
+
target_id: z25.string(),
|
|
2556
|
+
target_version: z25.number().int(),
|
|
2557
|
+
status: z25.string(),
|
|
2558
|
+
profiling_status: z25.unknown().optional(),
|
|
2559
|
+
target_background: z25.unknown().optional(),
|
|
2560
|
+
additional_context: z25.unknown().optional(),
|
|
2561
|
+
ai_generated_fields: z25.unknown().optional(),
|
|
2562
|
+
other_details: z25.unknown().optional()
|
|
2563
|
+
}).passthrough();
|
|
2564
|
+
var BaseResponseSchema = z25.object({
|
|
2565
|
+
message: z25.string(),
|
|
2566
|
+
status: z25.number().int()
|
|
2217
2567
|
});
|
|
2218
|
-
var PromptSetStatsSchema =
|
|
2219
|
-
total_prompts:
|
|
2220
|
-
active_prompts:
|
|
2221
|
-
inactive_prompts:
|
|
2222
|
-
failed_prompts:
|
|
2223
|
-
validation_prompts:
|
|
2224
|
-
}).passthrough();
|
|
2225
|
-
var CustomPromptSetCreateRequestSchema =
|
|
2226
|
-
name:
|
|
2227
|
-
description:
|
|
2228
|
-
property_names:
|
|
2568
|
+
var PromptSetStatsSchema = z25.object({
|
|
2569
|
+
total_prompts: z25.number().int(),
|
|
2570
|
+
active_prompts: z25.number().int(),
|
|
2571
|
+
inactive_prompts: z25.number().int(),
|
|
2572
|
+
failed_prompts: z25.number().int().optional(),
|
|
2573
|
+
validation_prompts: z25.number().int().optional()
|
|
2574
|
+
}).passthrough();
|
|
2575
|
+
var CustomPromptSetCreateRequestSchema = z25.object({
|
|
2576
|
+
name: z25.string(),
|
|
2577
|
+
description: z25.unknown().optional(),
|
|
2578
|
+
property_names: z25.array(z25.string()).optional()
|
|
2229
2579
|
});
|
|
2230
|
-
var CustomPromptSetUpdateRequestSchema =
|
|
2231
|
-
name:
|
|
2232
|
-
description:
|
|
2233
|
-
archive:
|
|
2234
|
-
property_names:
|
|
2235
|
-
}).passthrough();
|
|
2236
|
-
var CustomPromptSetArchiveRequestSchema =
|
|
2237
|
-
var CustomPromptSetResponseSchema =
|
|
2238
|
-
uuid:
|
|
2239
|
-
name:
|
|
2240
|
-
active:
|
|
2241
|
-
archive:
|
|
2242
|
-
status:
|
|
2243
|
-
created_at:
|
|
2244
|
-
updated_at:
|
|
2245
|
-
description:
|
|
2246
|
-
property_names:
|
|
2247
|
-
properties:
|
|
2248
|
-
stats:
|
|
2249
|
-
extra_info:
|
|
2250
|
-
version:
|
|
2251
|
-
created_by_user_id:
|
|
2252
|
-
updated_by_user_id:
|
|
2253
|
-
}).passthrough();
|
|
2254
|
-
var CustomPromptSetListItemSchema =
|
|
2255
|
-
uuid:
|
|
2256
|
-
name:
|
|
2257
|
-
active:
|
|
2258
|
-
archive:
|
|
2259
|
-
status:
|
|
2260
|
-
created_at:
|
|
2261
|
-
updated_at:
|
|
2262
|
-
description:
|
|
2263
|
-
property_names:
|
|
2264
|
-
stats:
|
|
2265
|
-
created_by_user_id:
|
|
2266
|
-
}).passthrough();
|
|
2267
|
-
var CustomPromptSetListSchema =
|
|
2580
|
+
var CustomPromptSetUpdateRequestSchema = z25.object({
|
|
2581
|
+
name: z25.unknown().optional(),
|
|
2582
|
+
description: z25.unknown().optional(),
|
|
2583
|
+
archive: z25.unknown().optional(),
|
|
2584
|
+
property_names: z25.unknown().optional()
|
|
2585
|
+
}).passthrough();
|
|
2586
|
+
var CustomPromptSetArchiveRequestSchema = z25.object({ archive: z25.boolean() });
|
|
2587
|
+
var CustomPromptSetResponseSchema = z25.object({
|
|
2588
|
+
uuid: z25.string(),
|
|
2589
|
+
name: z25.string(),
|
|
2590
|
+
active: z25.boolean(),
|
|
2591
|
+
archive: z25.boolean(),
|
|
2592
|
+
status: z25.string(),
|
|
2593
|
+
created_at: z25.string(),
|
|
2594
|
+
updated_at: z25.string(),
|
|
2595
|
+
description: z25.unknown().optional(),
|
|
2596
|
+
property_names: z25.array(z25.string()).optional(),
|
|
2597
|
+
properties: z25.array(z25.unknown()).optional(),
|
|
2598
|
+
stats: z25.unknown().optional(),
|
|
2599
|
+
extra_info: z25.unknown().optional(),
|
|
2600
|
+
version: z25.unknown().optional(),
|
|
2601
|
+
created_by_user_id: z25.unknown().optional(),
|
|
2602
|
+
updated_by_user_id: z25.unknown().optional()
|
|
2603
|
+
}).passthrough();
|
|
2604
|
+
var CustomPromptSetListItemSchema = z25.object({
|
|
2605
|
+
uuid: z25.string(),
|
|
2606
|
+
name: z25.string(),
|
|
2607
|
+
active: z25.boolean(),
|
|
2608
|
+
archive: z25.boolean(),
|
|
2609
|
+
status: z25.string(),
|
|
2610
|
+
created_at: z25.string(),
|
|
2611
|
+
updated_at: z25.string(),
|
|
2612
|
+
description: z25.unknown().optional(),
|
|
2613
|
+
property_names: z25.array(z25.string()).optional(),
|
|
2614
|
+
stats: z25.unknown().optional(),
|
|
2615
|
+
created_by_user_id: z25.unknown().optional()
|
|
2616
|
+
}).passthrough();
|
|
2617
|
+
var CustomPromptSetListSchema = z25.object({
|
|
2268
2618
|
pagination: RedTeamPaginationSchema,
|
|
2269
|
-
data:
|
|
2270
|
-
}).passthrough();
|
|
2271
|
-
var CustomPromptSetListActiveSchema =
|
|
2272
|
-
var CustomPromptSetReferenceSchema =
|
|
2273
|
-
uuid:
|
|
2274
|
-
name:
|
|
2275
|
-
status:
|
|
2276
|
-
active:
|
|
2277
|
-
tsg_id:
|
|
2278
|
-
created_at:
|
|
2279
|
-
updated_at:
|
|
2280
|
-
version:
|
|
2281
|
-
}).passthrough();
|
|
2282
|
-
var CustomPromptSetVersionInfoSchema =
|
|
2283
|
-
uuid:
|
|
2284
|
-
status:
|
|
2285
|
-
is_latest:
|
|
2286
|
-
version:
|
|
2619
|
+
data: z25.array(CustomPromptSetListItemSchema).optional()
|
|
2620
|
+
}).passthrough();
|
|
2621
|
+
var CustomPromptSetListActiveSchema = z25.object({ data: z25.array(CustomPromptSetListItemSchema).optional() }).passthrough();
|
|
2622
|
+
var CustomPromptSetReferenceSchema = z25.object({
|
|
2623
|
+
uuid: z25.string(),
|
|
2624
|
+
name: z25.string(),
|
|
2625
|
+
status: z25.string(),
|
|
2626
|
+
active: z25.boolean(),
|
|
2627
|
+
tsg_id: z25.string(),
|
|
2628
|
+
created_at: z25.string(),
|
|
2629
|
+
updated_at: z25.string(),
|
|
2630
|
+
version: z25.unknown().optional()
|
|
2631
|
+
}).passthrough();
|
|
2632
|
+
var CustomPromptSetVersionInfoSchema = z25.object({
|
|
2633
|
+
uuid: z25.string(),
|
|
2634
|
+
status: z25.string(),
|
|
2635
|
+
is_latest: z25.boolean(),
|
|
2636
|
+
version: z25.string().nullable().optional(),
|
|
2287
2637
|
stats: PromptSetStatsSchema.nullable().optional(),
|
|
2288
|
-
snapshot_created_at:
|
|
2638
|
+
snapshot_created_at: z25.string().nullable().optional()
|
|
2289
2639
|
}).passthrough();
|
|
2290
|
-
var CustomPromptCreateRequestSchema =
|
|
2291
|
-
prompt:
|
|
2292
|
-
prompt_set_id:
|
|
2293
|
-
goal:
|
|
2294
|
-
properties:
|
|
2640
|
+
var CustomPromptCreateRequestSchema = z25.object({
|
|
2641
|
+
prompt: z25.string(),
|
|
2642
|
+
prompt_set_id: z25.string(),
|
|
2643
|
+
goal: z25.unknown().optional(),
|
|
2644
|
+
properties: z25.unknown().optional()
|
|
2295
2645
|
});
|
|
2296
|
-
var CustomPromptUpdateRequestSchema =
|
|
2297
|
-
prompt:
|
|
2298
|
-
goal:
|
|
2299
|
-
properties:
|
|
2300
|
-
}).passthrough();
|
|
2301
|
-
var CustomPromptResponseSchema =
|
|
2302
|
-
uuid:
|
|
2303
|
-
prompt:
|
|
2304
|
-
user_defined_goal:
|
|
2305
|
-
status:
|
|
2306
|
-
active:
|
|
2307
|
-
prompt_set_id:
|
|
2308
|
-
created_at:
|
|
2309
|
-
updated_at:
|
|
2310
|
-
goal:
|
|
2311
|
-
properties:
|
|
2312
|
-
property_assignments:
|
|
2313
|
-
detector_category:
|
|
2314
|
-
severity:
|
|
2315
|
-
extra_info:
|
|
2316
|
-
}).passthrough();
|
|
2317
|
-
var CustomPromptListItemSchema =
|
|
2318
|
-
uuid:
|
|
2319
|
-
prompt:
|
|
2320
|
-
user_defined_goal:
|
|
2321
|
-
status:
|
|
2322
|
-
active:
|
|
2323
|
-
created_at:
|
|
2324
|
-
updated_at:
|
|
2325
|
-
goal:
|
|
2326
|
-
properties:
|
|
2327
|
-
}).passthrough();
|
|
2328
|
-
var CustomPromptListSchema =
|
|
2646
|
+
var CustomPromptUpdateRequestSchema = z25.object({
|
|
2647
|
+
prompt: z25.unknown().optional(),
|
|
2648
|
+
goal: z25.unknown().optional(),
|
|
2649
|
+
properties: z25.unknown().optional()
|
|
2650
|
+
}).passthrough();
|
|
2651
|
+
var CustomPromptResponseSchema = z25.object({
|
|
2652
|
+
uuid: z25.string(),
|
|
2653
|
+
prompt: z25.string(),
|
|
2654
|
+
user_defined_goal: z25.boolean(),
|
|
2655
|
+
status: z25.string(),
|
|
2656
|
+
active: z25.boolean(),
|
|
2657
|
+
prompt_set_id: z25.string(),
|
|
2658
|
+
created_at: z25.string(),
|
|
2659
|
+
updated_at: z25.string(),
|
|
2660
|
+
goal: z25.unknown().optional(),
|
|
2661
|
+
properties: z25.unknown().optional(),
|
|
2662
|
+
property_assignments: z25.array(z25.unknown()).optional(),
|
|
2663
|
+
detector_category: z25.unknown().optional(),
|
|
2664
|
+
severity: z25.unknown().optional(),
|
|
2665
|
+
extra_info: z25.unknown().optional()
|
|
2666
|
+
}).passthrough();
|
|
2667
|
+
var CustomPromptListItemSchema = z25.object({
|
|
2668
|
+
uuid: z25.string(),
|
|
2669
|
+
prompt: z25.string(),
|
|
2670
|
+
user_defined_goal: z25.boolean(),
|
|
2671
|
+
status: z25.string(),
|
|
2672
|
+
active: z25.boolean(),
|
|
2673
|
+
created_at: z25.string(),
|
|
2674
|
+
updated_at: z25.string(),
|
|
2675
|
+
goal: z25.unknown().optional(),
|
|
2676
|
+
properties: z25.unknown().optional()
|
|
2677
|
+
}).passthrough();
|
|
2678
|
+
var CustomPromptListSchema = z25.object({
|
|
2329
2679
|
pagination: RedTeamPaginationSchema,
|
|
2330
|
-
data:
|
|
2680
|
+
data: z25.array(CustomPromptListItemSchema).optional()
|
|
2331
2681
|
}).passthrough();
|
|
2332
|
-
var PropertyNameCreateRequestSchema =
|
|
2333
|
-
var PropertyValueCreateRequestSchema =
|
|
2334
|
-
property_name:
|
|
2335
|
-
property_value:
|
|
2682
|
+
var PropertyNameCreateRequestSchema = z25.object({ name: z25.string() });
|
|
2683
|
+
var PropertyValueCreateRequestSchema = z25.object({
|
|
2684
|
+
property_name: z25.string(),
|
|
2685
|
+
property_value: z25.string()
|
|
2336
2686
|
});
|
|
2337
|
-
var PropertyDefinitionSchema =
|
|
2338
|
-
property_name:
|
|
2339
|
-
created_at:
|
|
2687
|
+
var PropertyDefinitionSchema = z25.object({
|
|
2688
|
+
property_name: z25.string(),
|
|
2689
|
+
created_at: z25.string()
|
|
2340
2690
|
});
|
|
2341
|
-
var PropertyNamesListResponseSchema =
|
|
2342
|
-
var PropertyValuesResponseSchema =
|
|
2343
|
-
name:
|
|
2344
|
-
values:
|
|
2691
|
+
var PropertyNamesListResponseSchema = z25.object({ data: z25.array(PropertyDefinitionSchema).optional() }).passthrough();
|
|
2692
|
+
var PropertyValuesResponseSchema = z25.object({
|
|
2693
|
+
name: z25.string(),
|
|
2694
|
+
values: z25.array(z25.string()).optional()
|
|
2345
2695
|
}).passthrough();
|
|
2346
|
-
var PropertyValuesMultipleResponseSchema =
|
|
2347
|
-
var DashboardOverviewResponseSchema =
|
|
2348
|
-
total_targets:
|
|
2349
|
-
targets_by_type:
|
|
2696
|
+
var PropertyValuesMultipleResponseSchema = z25.object({ data: z25.record(z25.array(z25.string())).optional() }).passthrough();
|
|
2697
|
+
var DashboardOverviewResponseSchema = z25.object({
|
|
2698
|
+
total_targets: z25.number().int(),
|
|
2699
|
+
targets_by_type: z25.array(CountByNameSchema).optional()
|
|
2350
2700
|
}).passthrough();
|
|
2351
2701
|
|
|
2352
2702
|
// src/models/oauth-token.ts
|
|
2353
|
-
import { z as
|
|
2354
|
-
var OAuthTokenResponseSchema =
|
|
2355
|
-
access_token:
|
|
2356
|
-
token_type:
|
|
2357
|
-
expires_in:
|
|
2358
|
-
scope:
|
|
2359
|
-
});
|
|
2703
|
+
import { z as z26 } from "zod";
|
|
2704
|
+
var OAuthTokenResponseSchema = z26.object({
|
|
2705
|
+
access_token: z26.string(),
|
|
2706
|
+
token_type: z26.string().optional(),
|
|
2707
|
+
expires_in: z26.number(),
|
|
2708
|
+
scope: z26.string().optional()
|
|
2709
|
+
}).passthrough();
|
|
2360
2710
|
|
|
2361
2711
|
// src/management/oauth-client.ts
|
|
2362
2712
|
var DEFAULT_TOKEN_BUFFER_MS = 3e4;
|
|
@@ -2524,8 +2874,327 @@ async function managementHttpRequest(opts) {
|
|
|
2524
2874
|
return { status: response.status, data };
|
|
2525
2875
|
}
|
|
2526
2876
|
|
|
2527
|
-
// src/management/profiles.ts
|
|
2528
|
-
var ProfilesClient = class {
|
|
2877
|
+
// src/management/profiles.ts
|
|
2878
|
+
var ProfilesClient = class {
|
|
2879
|
+
baseUrl;
|
|
2880
|
+
oauthClient;
|
|
2881
|
+
tsgId;
|
|
2882
|
+
numRetries;
|
|
2883
|
+
constructor(opts) {
|
|
2884
|
+
this.baseUrl = opts.baseUrl;
|
|
2885
|
+
this.oauthClient = opts.oauthClient;
|
|
2886
|
+
this.tsgId = opts.tsgId;
|
|
2887
|
+
this.numRetries = opts.numRetries;
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* Create a new security profile.
|
|
2891
|
+
* @param request - Profile configuration.
|
|
2892
|
+
* @returns The created security profile.
|
|
2893
|
+
*/
|
|
2894
|
+
async create(request) {
|
|
2895
|
+
const res = await managementHttpRequest({
|
|
2896
|
+
method: "POST",
|
|
2897
|
+
baseUrl: this.baseUrl,
|
|
2898
|
+
path: MGMT_PROFILE_PATH,
|
|
2899
|
+
body: request,
|
|
2900
|
+
oauthClient: this.oauthClient,
|
|
2901
|
+
numRetries: this.numRetries
|
|
2902
|
+
});
|
|
2903
|
+
return res.data;
|
|
2904
|
+
}
|
|
2905
|
+
/**
|
|
2906
|
+
* List security profiles for the TSG.
|
|
2907
|
+
* @param opts - Pagination options.
|
|
2908
|
+
* @returns Paginated list of security profiles.
|
|
2909
|
+
*/
|
|
2910
|
+
async list(opts) {
|
|
2911
|
+
const params = {
|
|
2912
|
+
offset: String(opts?.offset ?? 0),
|
|
2913
|
+
limit: String(opts?.limit ?? 100)
|
|
2914
|
+
};
|
|
2915
|
+
const res = await managementHttpRequest({
|
|
2916
|
+
method: "GET",
|
|
2917
|
+
baseUrl: this.baseUrl,
|
|
2918
|
+
path: `${MGMT_PROFILES_TSG_PATH}/${this.tsgId}`,
|
|
2919
|
+
params,
|
|
2920
|
+
oauthClient: this.oauthClient,
|
|
2921
|
+
numRetries: this.numRetries
|
|
2922
|
+
});
|
|
2923
|
+
return res.data;
|
|
2924
|
+
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Update an existing security profile.
|
|
2927
|
+
* @param profileId - UUID of the profile to update.
|
|
2928
|
+
* @param request - Updated profile configuration.
|
|
2929
|
+
* @returns The updated security profile.
|
|
2930
|
+
*/
|
|
2931
|
+
async update(profileId, request) {
|
|
2932
|
+
if (!isValidUuid(profileId)) {
|
|
2933
|
+
throw new AISecSDKException(
|
|
2934
|
+
`Invalid profile_id: ${profileId}`,
|
|
2935
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2936
|
+
);
|
|
2937
|
+
}
|
|
2938
|
+
const res = await managementHttpRequest({
|
|
2939
|
+
method: "PUT",
|
|
2940
|
+
baseUrl: this.baseUrl,
|
|
2941
|
+
path: `${MGMT_PROFILE_PATH}/uuid/${profileId}`,
|
|
2942
|
+
body: request,
|
|
2943
|
+
oauthClient: this.oauthClient,
|
|
2944
|
+
numRetries: this.numRetries
|
|
2945
|
+
});
|
|
2946
|
+
return res.data;
|
|
2947
|
+
}
|
|
2948
|
+
/**
|
|
2949
|
+
* Delete a security profile.
|
|
2950
|
+
* @param profileId - UUID of the profile to delete.
|
|
2951
|
+
* @returns Deletion confirmation message.
|
|
2952
|
+
*/
|
|
2953
|
+
async delete(profileId) {
|
|
2954
|
+
if (!isValidUuid(profileId)) {
|
|
2955
|
+
throw new AISecSDKException(
|
|
2956
|
+
`Invalid profile_id: ${profileId}`,
|
|
2957
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2958
|
+
);
|
|
2959
|
+
}
|
|
2960
|
+
const res = await managementHttpRequest({
|
|
2961
|
+
method: "DELETE",
|
|
2962
|
+
baseUrl: this.baseUrl,
|
|
2963
|
+
path: `${MGMT_PROFILE_PATH}/${profileId}`,
|
|
2964
|
+
oauthClient: this.oauthClient,
|
|
2965
|
+
numRetries: this.numRetries
|
|
2966
|
+
});
|
|
2967
|
+
return res.data;
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Force-delete a security profile, bypassing safety checks.
|
|
2971
|
+
* @param profileId - UUID of the profile to force-delete.
|
|
2972
|
+
* @param updatedBy - Email of the user performing the deletion.
|
|
2973
|
+
* @returns Deletion confirmation message.
|
|
2974
|
+
*/
|
|
2975
|
+
async forceDelete(profileId, updatedBy) {
|
|
2976
|
+
if (!isValidUuid(profileId)) {
|
|
2977
|
+
throw new AISecSDKException(
|
|
2978
|
+
`Invalid profile_id: ${profileId}`,
|
|
2979
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2980
|
+
);
|
|
2981
|
+
}
|
|
2982
|
+
const res = await managementHttpRequest({
|
|
2983
|
+
method: "DELETE",
|
|
2984
|
+
baseUrl: this.baseUrl,
|
|
2985
|
+
path: `${MGMT_PROFILE_PATH}/${profileId}/force`,
|
|
2986
|
+
params: { updated_by: updatedBy },
|
|
2987
|
+
oauthClient: this.oauthClient,
|
|
2988
|
+
numRetries: this.numRetries
|
|
2989
|
+
});
|
|
2990
|
+
return res.data;
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
|
|
2994
|
+
// src/management/topics.ts
|
|
2995
|
+
var TopicsClient = class {
|
|
2996
|
+
baseUrl;
|
|
2997
|
+
oauthClient;
|
|
2998
|
+
tsgId;
|
|
2999
|
+
numRetries;
|
|
3000
|
+
constructor(opts) {
|
|
3001
|
+
this.baseUrl = opts.baseUrl;
|
|
3002
|
+
this.oauthClient = opts.oauthClient;
|
|
3003
|
+
this.tsgId = opts.tsgId;
|
|
3004
|
+
this.numRetries = opts.numRetries;
|
|
3005
|
+
}
|
|
3006
|
+
/**
|
|
3007
|
+
* Create a new custom topic.
|
|
3008
|
+
* @param request - Topic definition with name, description, and examples.
|
|
3009
|
+
* @returns The created custom topic.
|
|
3010
|
+
*/
|
|
3011
|
+
async create(request) {
|
|
3012
|
+
const res = await managementHttpRequest({
|
|
3013
|
+
method: "POST",
|
|
3014
|
+
baseUrl: this.baseUrl,
|
|
3015
|
+
path: MGMT_TOPIC_PATH,
|
|
3016
|
+
body: request,
|
|
3017
|
+
oauthClient: this.oauthClient,
|
|
3018
|
+
numRetries: this.numRetries
|
|
3019
|
+
});
|
|
3020
|
+
return res.data;
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* List custom topics for the TSG.
|
|
3024
|
+
* @param opts - Pagination options.
|
|
3025
|
+
* @returns Paginated list of custom topics.
|
|
3026
|
+
*/
|
|
3027
|
+
async list(opts) {
|
|
3028
|
+
const params = {
|
|
3029
|
+
offset: String(opts?.offset ?? 0),
|
|
3030
|
+
limit: String(opts?.limit ?? 100)
|
|
3031
|
+
};
|
|
3032
|
+
const res = await managementHttpRequest({
|
|
3033
|
+
method: "GET",
|
|
3034
|
+
baseUrl: this.baseUrl,
|
|
3035
|
+
path: `${MGMT_TOPICS_TSG_PATH}/${this.tsgId}`,
|
|
3036
|
+
params,
|
|
3037
|
+
oauthClient: this.oauthClient,
|
|
3038
|
+
numRetries: this.numRetries
|
|
3039
|
+
});
|
|
3040
|
+
return res.data;
|
|
3041
|
+
}
|
|
3042
|
+
/**
|
|
3043
|
+
* Update an existing custom topic.
|
|
3044
|
+
* @param topicId - UUID of the topic to update.
|
|
3045
|
+
* @param request - Updated topic definition.
|
|
3046
|
+
* @returns The updated custom topic.
|
|
3047
|
+
*/
|
|
3048
|
+
async update(topicId, request) {
|
|
3049
|
+
if (!isValidUuid(topicId)) {
|
|
3050
|
+
throw new AISecSDKException(
|
|
3051
|
+
`Invalid topic_id: ${topicId}`,
|
|
3052
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3053
|
+
);
|
|
3054
|
+
}
|
|
3055
|
+
const res = await managementHttpRequest({
|
|
3056
|
+
method: "PUT",
|
|
3057
|
+
baseUrl: this.baseUrl,
|
|
3058
|
+
path: `${MGMT_TOPIC_PATH}/uuid/${topicId}`,
|
|
3059
|
+
body: request,
|
|
3060
|
+
oauthClient: this.oauthClient,
|
|
3061
|
+
numRetries: this.numRetries
|
|
3062
|
+
});
|
|
3063
|
+
return res.data;
|
|
3064
|
+
}
|
|
3065
|
+
/**
|
|
3066
|
+
* Delete a custom topic. Fails if topic is referenced by a profile.
|
|
3067
|
+
* @param topicId - UUID of the topic to delete.
|
|
3068
|
+
* @returns Deletion confirmation message.
|
|
3069
|
+
*/
|
|
3070
|
+
async delete(topicId) {
|
|
3071
|
+
if (!isValidUuid(topicId)) {
|
|
3072
|
+
throw new AISecSDKException(
|
|
3073
|
+
`Invalid topic_id: ${topicId}`,
|
|
3074
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3075
|
+
);
|
|
3076
|
+
}
|
|
3077
|
+
const res = await managementHttpRequest({
|
|
3078
|
+
method: "DELETE",
|
|
3079
|
+
baseUrl: this.baseUrl,
|
|
3080
|
+
path: `${MGMT_TOPIC_PATH}/${topicId}`,
|
|
3081
|
+
oauthClient: this.oauthClient,
|
|
3082
|
+
numRetries: this.numRetries
|
|
3083
|
+
});
|
|
3084
|
+
return res.data;
|
|
3085
|
+
}
|
|
3086
|
+
/**
|
|
3087
|
+
* Force-delete a custom topic, removing it from any referencing profiles.
|
|
3088
|
+
* @param topicId - UUID of the topic to force-delete.
|
|
3089
|
+
* @param updatedBy - Email of the user performing the deletion.
|
|
3090
|
+
* @returns Deletion confirmation message.
|
|
3091
|
+
*/
|
|
3092
|
+
async forceDelete(topicId, updatedBy) {
|
|
3093
|
+
if (!isValidUuid(topicId)) {
|
|
3094
|
+
throw new AISecSDKException(
|
|
3095
|
+
`Invalid topic_id: ${topicId}`,
|
|
3096
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3097
|
+
);
|
|
3098
|
+
}
|
|
3099
|
+
const params = updatedBy ? { updated_by: updatedBy } : void 0;
|
|
3100
|
+
const res = await managementHttpRequest({
|
|
3101
|
+
method: "DELETE",
|
|
3102
|
+
baseUrl: this.baseUrl,
|
|
3103
|
+
path: `${MGMT_TOPIC_FORCE_PATH}/${topicId}`,
|
|
3104
|
+
params,
|
|
3105
|
+
oauthClient: this.oauthClient,
|
|
3106
|
+
numRetries: this.numRetries
|
|
3107
|
+
});
|
|
3108
|
+
return res.data;
|
|
3109
|
+
}
|
|
3110
|
+
};
|
|
3111
|
+
|
|
3112
|
+
// src/management/api-keys.ts
|
|
3113
|
+
var ApiKeysClient = class {
|
|
3114
|
+
baseUrl;
|
|
3115
|
+
oauthClient;
|
|
3116
|
+
tsgId;
|
|
3117
|
+
numRetries;
|
|
3118
|
+
constructor(opts) {
|
|
3119
|
+
this.baseUrl = opts.baseUrl;
|
|
3120
|
+
this.oauthClient = opts.oauthClient;
|
|
3121
|
+
this.tsgId = opts.tsgId;
|
|
3122
|
+
this.numRetries = opts.numRetries;
|
|
3123
|
+
}
|
|
3124
|
+
/**
|
|
3125
|
+
* Create a new API key.
|
|
3126
|
+
* @param request - API key creation request.
|
|
3127
|
+
* @returns The created API key.
|
|
3128
|
+
*/
|
|
3129
|
+
async create(request) {
|
|
3130
|
+
const res = await managementHttpRequest({
|
|
3131
|
+
method: "POST",
|
|
3132
|
+
baseUrl: this.baseUrl,
|
|
3133
|
+
path: MGMT_API_KEY_PATH,
|
|
3134
|
+
body: request,
|
|
3135
|
+
oauthClient: this.oauthClient,
|
|
3136
|
+
numRetries: this.numRetries
|
|
3137
|
+
});
|
|
3138
|
+
return res.data;
|
|
3139
|
+
}
|
|
3140
|
+
/**
|
|
3141
|
+
* List API keys for the TSG.
|
|
3142
|
+
* @param opts - Pagination options.
|
|
3143
|
+
* @returns Paginated list of API keys.
|
|
3144
|
+
*/
|
|
3145
|
+
async list(opts) {
|
|
3146
|
+
const params = {
|
|
3147
|
+
offset: String(opts?.offset ?? 0),
|
|
3148
|
+
limit: String(opts?.limit ?? 100)
|
|
3149
|
+
};
|
|
3150
|
+
const res = await managementHttpRequest({
|
|
3151
|
+
method: "GET",
|
|
3152
|
+
baseUrl: this.baseUrl,
|
|
3153
|
+
path: `${MGMT_API_KEYS_TSG_PATH}/${this.tsgId}`,
|
|
3154
|
+
params,
|
|
3155
|
+
oauthClient: this.oauthClient,
|
|
3156
|
+
numRetries: this.numRetries
|
|
3157
|
+
});
|
|
3158
|
+
return res.data;
|
|
3159
|
+
}
|
|
3160
|
+
/**
|
|
3161
|
+
* Delete an API key by name.
|
|
3162
|
+
* @param apiKeyName - Name of the API key to delete.
|
|
3163
|
+
* @param updatedBy - Email of user performing the deletion.
|
|
3164
|
+
* @returns Deletion confirmation.
|
|
3165
|
+
*/
|
|
3166
|
+
async delete(apiKeyName, updatedBy) {
|
|
3167
|
+
const res = await managementHttpRequest({
|
|
3168
|
+
method: "DELETE",
|
|
3169
|
+
baseUrl: this.baseUrl,
|
|
3170
|
+
path: `${MGMT_API_KEY_PATH}/delete/${encodeURIComponent(apiKeyName)}`,
|
|
3171
|
+
params: { updated_by: updatedBy },
|
|
3172
|
+
oauthClient: this.oauthClient,
|
|
3173
|
+
numRetries: this.numRetries
|
|
3174
|
+
});
|
|
3175
|
+
return res.data;
|
|
3176
|
+
}
|
|
3177
|
+
/**
|
|
3178
|
+
* Regenerate an API key.
|
|
3179
|
+
* @param apiKeyId - UUID of the API key to regenerate.
|
|
3180
|
+
* @param request - Regeneration request with rotation config.
|
|
3181
|
+
* @returns The regenerated API key.
|
|
3182
|
+
*/
|
|
3183
|
+
async regenerate(apiKeyId, request) {
|
|
3184
|
+
const res = await managementHttpRequest({
|
|
3185
|
+
method: "POST",
|
|
3186
|
+
baseUrl: this.baseUrl,
|
|
3187
|
+
path: `${MGMT_API_KEY_PATH}/regenerate/${encodeURIComponent(apiKeyId)}`,
|
|
3188
|
+
body: request,
|
|
3189
|
+
oauthClient: this.oauthClient,
|
|
3190
|
+
numRetries: this.numRetries
|
|
3191
|
+
});
|
|
3192
|
+
return res.data;
|
|
3193
|
+
}
|
|
3194
|
+
};
|
|
3195
|
+
|
|
3196
|
+
// src/management/customer-apps.ts
|
|
3197
|
+
var CustomerAppsClient = class {
|
|
2529
3198
|
baseUrl;
|
|
2530
3199
|
oauthClient;
|
|
2531
3200
|
tsgId;
|
|
@@ -2537,25 +3206,25 @@ var ProfilesClient = class {
|
|
|
2537
3206
|
this.numRetries = opts.numRetries;
|
|
2538
3207
|
}
|
|
2539
3208
|
/**
|
|
2540
|
-
*
|
|
2541
|
-
* @param
|
|
2542
|
-
* @returns The
|
|
3209
|
+
* Get a customer app by name.
|
|
3210
|
+
* @param appName - Name of the customer app.
|
|
3211
|
+
* @returns The customer app.
|
|
2543
3212
|
*/
|
|
2544
|
-
async
|
|
3213
|
+
async get(appName) {
|
|
2545
3214
|
const res = await managementHttpRequest({
|
|
2546
|
-
method: "
|
|
3215
|
+
method: "GET",
|
|
2547
3216
|
baseUrl: this.baseUrl,
|
|
2548
|
-
path:
|
|
2549
|
-
|
|
3217
|
+
path: MGMT_CUSTOMER_APP_PATH,
|
|
3218
|
+
params: { app_name: appName },
|
|
2550
3219
|
oauthClient: this.oauthClient,
|
|
2551
3220
|
numRetries: this.numRetries
|
|
2552
3221
|
});
|
|
2553
3222
|
return res.data;
|
|
2554
3223
|
}
|
|
2555
3224
|
/**
|
|
2556
|
-
* List
|
|
3225
|
+
* List customer apps for the TSG.
|
|
2557
3226
|
* @param opts - Pagination options.
|
|
2558
|
-
* @returns Paginated list of
|
|
3227
|
+
* @returns Paginated list of customer apps.
|
|
2559
3228
|
*/
|
|
2560
3229
|
async list(opts) {
|
|
2561
3230
|
const params = {
|
|
@@ -2565,7 +3234,7 @@ var ProfilesClient = class {
|
|
|
2565
3234
|
const res = await managementHttpRequest({
|
|
2566
3235
|
method: "GET",
|
|
2567
3236
|
baseUrl: this.baseUrl,
|
|
2568
|
-
path: `${
|
|
3237
|
+
path: `${MGMT_CUSTOMER_APPS_TSG_PATH}/${this.tsgId}`,
|
|
2569
3238
|
params,
|
|
2570
3239
|
oauthClient: this.oauthClient,
|
|
2571
3240
|
numRetries: this.numRetries
|
|
@@ -2573,22 +3242,17 @@ var ProfilesClient = class {
|
|
|
2573
3242
|
return res.data;
|
|
2574
3243
|
}
|
|
2575
3244
|
/**
|
|
2576
|
-
* Update
|
|
2577
|
-
* @param
|
|
2578
|
-
* @param request - Updated
|
|
2579
|
-
* @returns The updated
|
|
3245
|
+
* Update a customer app.
|
|
3246
|
+
* @param customerAppId - UUID of the customer app to update.
|
|
3247
|
+
* @param request - Updated customer app data.
|
|
3248
|
+
* @returns The updated customer app.
|
|
2580
3249
|
*/
|
|
2581
|
-
async update(
|
|
2582
|
-
if (!isValidUuid(profileId)) {
|
|
2583
|
-
throw new AISecSDKException(
|
|
2584
|
-
`Invalid profile_id: ${profileId}`,
|
|
2585
|
-
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2586
|
-
);
|
|
2587
|
-
}
|
|
3250
|
+
async update(customerAppId, request) {
|
|
2588
3251
|
const res = await managementHttpRequest({
|
|
2589
3252
|
method: "PUT",
|
|
2590
3253
|
baseUrl: this.baseUrl,
|
|
2591
|
-
path:
|
|
3254
|
+
path: MGMT_CUSTOMER_APP_PATH,
|
|
3255
|
+
params: { customer_app_id: customerAppId },
|
|
2592
3256
|
body: request,
|
|
2593
3257
|
oauthClient: this.oauthClient,
|
|
2594
3258
|
numRetries: this.numRetries
|
|
@@ -2596,21 +3260,17 @@ var ProfilesClient = class {
|
|
|
2596
3260
|
return res.data;
|
|
2597
3261
|
}
|
|
2598
3262
|
/**
|
|
2599
|
-
* Delete a
|
|
2600
|
-
* @param
|
|
2601
|
-
* @
|
|
3263
|
+
* Delete a customer app.
|
|
3264
|
+
* @param appName - Name of the customer app to delete.
|
|
3265
|
+
* @param updatedBy - Email of user performing the deletion.
|
|
3266
|
+
* @returns The deleted customer app.
|
|
2602
3267
|
*/
|
|
2603
|
-
async delete(
|
|
2604
|
-
if (!isValidUuid(profileId)) {
|
|
2605
|
-
throw new AISecSDKException(
|
|
2606
|
-
`Invalid profile_id: ${profileId}`,
|
|
2607
|
-
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2608
|
-
);
|
|
2609
|
-
}
|
|
3268
|
+
async delete(appName, updatedBy) {
|
|
2610
3269
|
const res = await managementHttpRequest({
|
|
2611
3270
|
method: "DELETE",
|
|
2612
3271
|
baseUrl: this.baseUrl,
|
|
2613
|
-
path:
|
|
3272
|
+
path: MGMT_CUSTOMER_APP_PATH,
|
|
3273
|
+
params: { app_name: appName, updated_by: updatedBy },
|
|
2614
3274
|
oauthClient: this.oauthClient,
|
|
2615
3275
|
numRetries: this.numRetries
|
|
2616
3276
|
});
|
|
@@ -2618,114 +3278,143 @@ var ProfilesClient = class {
|
|
|
2618
3278
|
}
|
|
2619
3279
|
};
|
|
2620
3280
|
|
|
2621
|
-
// src/management/
|
|
2622
|
-
var
|
|
3281
|
+
// src/management/dlp-profiles.ts
|
|
3282
|
+
var DlpProfilesClient = class {
|
|
2623
3283
|
baseUrl;
|
|
2624
3284
|
oauthClient;
|
|
2625
|
-
tsgId;
|
|
2626
3285
|
numRetries;
|
|
2627
3286
|
constructor(opts) {
|
|
2628
3287
|
this.baseUrl = opts.baseUrl;
|
|
2629
3288
|
this.oauthClient = opts.oauthClient;
|
|
2630
|
-
this.tsgId = opts.tsgId;
|
|
2631
3289
|
this.numRetries = opts.numRetries;
|
|
2632
3290
|
}
|
|
2633
3291
|
/**
|
|
2634
|
-
*
|
|
2635
|
-
* @
|
|
2636
|
-
* @returns The created custom topic.
|
|
3292
|
+
* List all DLP profiles for the TSG.
|
|
3293
|
+
* @returns List of DLP profiles.
|
|
2637
3294
|
*/
|
|
2638
|
-
async
|
|
3295
|
+
async list() {
|
|
2639
3296
|
const res = await managementHttpRequest({
|
|
2640
|
-
method: "
|
|
3297
|
+
method: "GET",
|
|
2641
3298
|
baseUrl: this.baseUrl,
|
|
2642
|
-
path:
|
|
2643
|
-
body: request,
|
|
3299
|
+
path: MGMT_DLP_PROFILES_PATH,
|
|
2644
3300
|
oauthClient: this.oauthClient,
|
|
2645
3301
|
numRetries: this.numRetries
|
|
2646
3302
|
});
|
|
2647
3303
|
return res.data;
|
|
2648
3304
|
}
|
|
3305
|
+
};
|
|
3306
|
+
|
|
3307
|
+
// src/management/deployment-profiles.ts
|
|
3308
|
+
var DeploymentProfilesClient = class {
|
|
3309
|
+
baseUrl;
|
|
3310
|
+
oauthClient;
|
|
3311
|
+
numRetries;
|
|
3312
|
+
constructor(opts) {
|
|
3313
|
+
this.baseUrl = opts.baseUrl;
|
|
3314
|
+
this.oauthClient = opts.oauthClient;
|
|
3315
|
+
this.numRetries = opts.numRetries;
|
|
3316
|
+
}
|
|
2649
3317
|
/**
|
|
2650
|
-
* List
|
|
2651
|
-
* @param opts -
|
|
2652
|
-
* @returns
|
|
3318
|
+
* List deployment profiles for the TSG.
|
|
3319
|
+
* @param opts - Optional filter options.
|
|
3320
|
+
* @returns Deployment profiles response.
|
|
2653
3321
|
*/
|
|
2654
3322
|
async list(opts) {
|
|
2655
|
-
const params = {
|
|
2656
|
-
|
|
2657
|
-
limit: String(opts?.limit ?? 100)
|
|
2658
|
-
};
|
|
3323
|
+
const params = {};
|
|
3324
|
+
if (opts?.unactivated !== void 0) params.unactivated = String(opts.unactivated);
|
|
2659
3325
|
const res = await managementHttpRequest({
|
|
2660
3326
|
method: "GET",
|
|
2661
3327
|
baseUrl: this.baseUrl,
|
|
2662
|
-
path:
|
|
2663
|
-
params,
|
|
3328
|
+
path: MGMT_DEPLOYMENT_PROFILES_PATH,
|
|
3329
|
+
params: Object.keys(params).length > 0 ? params : void 0,
|
|
2664
3330
|
oauthClient: this.oauthClient,
|
|
2665
3331
|
numRetries: this.numRetries
|
|
2666
3332
|
});
|
|
2667
3333
|
return res.data;
|
|
2668
3334
|
}
|
|
3335
|
+
};
|
|
3336
|
+
|
|
3337
|
+
// src/management/scan-logs.ts
|
|
3338
|
+
var ScanLogsClient = class {
|
|
3339
|
+
baseUrl;
|
|
3340
|
+
oauthClient;
|
|
3341
|
+
numRetries;
|
|
3342
|
+
constructor(opts) {
|
|
3343
|
+
this.baseUrl = opts.baseUrl;
|
|
3344
|
+
this.oauthClient = opts.oauthClient;
|
|
3345
|
+
this.numRetries = opts.numRetries;
|
|
3346
|
+
}
|
|
2669
3347
|
/**
|
|
2670
|
-
*
|
|
2671
|
-
* @param
|
|
2672
|
-
* @
|
|
2673
|
-
* @returns The updated custom topic.
|
|
3348
|
+
* Retrieve scan logs by time interval.
|
|
3349
|
+
* @param opts - Query options including time range, pagination, and filter.
|
|
3350
|
+
* @returns Paginated scan results.
|
|
2674
3351
|
*/
|
|
2675
|
-
async
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
)
|
|
2681
|
-
|
|
3352
|
+
async query(opts) {
|
|
3353
|
+
const params = {
|
|
3354
|
+
time_interval: String(opts.time_interval),
|
|
3355
|
+
time_unit: opts.time_unit,
|
|
3356
|
+
pageNumber: String(opts.pageNumber),
|
|
3357
|
+
pageSize: String(opts.pageSize),
|
|
3358
|
+
filter: opts.filter
|
|
3359
|
+
};
|
|
3360
|
+
const body = opts.page_token ? { page_token: opts.page_token } : void 0;
|
|
2682
3361
|
const res = await managementHttpRequest({
|
|
2683
|
-
method: "
|
|
3362
|
+
method: "POST",
|
|
2684
3363
|
baseUrl: this.baseUrl,
|
|
2685
|
-
path:
|
|
2686
|
-
|
|
3364
|
+
path: MGMT_SCAN_LOGS_PATH,
|
|
3365
|
+
params,
|
|
3366
|
+
body,
|
|
2687
3367
|
oauthClient: this.oauthClient,
|
|
2688
3368
|
numRetries: this.numRetries
|
|
2689
3369
|
});
|
|
2690
3370
|
return res.data;
|
|
2691
3371
|
}
|
|
3372
|
+
};
|
|
3373
|
+
|
|
3374
|
+
// src/management/oauth-management.ts
|
|
3375
|
+
var OAuthManagementClient = class {
|
|
3376
|
+
baseUrl;
|
|
3377
|
+
oauthClient;
|
|
3378
|
+
numRetries;
|
|
3379
|
+
constructor(opts) {
|
|
3380
|
+
this.baseUrl = opts.baseUrl;
|
|
3381
|
+
this.oauthClient = opts.oauthClient;
|
|
3382
|
+
this.numRetries = opts.numRetries;
|
|
3383
|
+
}
|
|
2692
3384
|
/**
|
|
2693
|
-
*
|
|
2694
|
-
* @param
|
|
2695
|
-
* @
|
|
3385
|
+
* Invalidate an OAuth token.
|
|
3386
|
+
* @param token - The OAuth token to invalidate.
|
|
3387
|
+
* @param body - Client ID and customer app.
|
|
3388
|
+
* @returns Confirmation string.
|
|
2696
3389
|
*/
|
|
2697
|
-
async
|
|
2698
|
-
if (!isValidUuid(topicId)) {
|
|
2699
|
-
throw new AISecSDKException(
|
|
2700
|
-
`Invalid topic_id: ${topicId}`,
|
|
2701
|
-
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2702
|
-
);
|
|
2703
|
-
}
|
|
3390
|
+
async invalidateToken(token, body) {
|
|
2704
3391
|
const res = await managementHttpRequest({
|
|
2705
|
-
method: "
|
|
3392
|
+
method: "POST",
|
|
2706
3393
|
baseUrl: this.baseUrl,
|
|
2707
|
-
path:
|
|
3394
|
+
path: MGMT_OAUTH_INVALIDATE_PATH,
|
|
3395
|
+
params: { token },
|
|
3396
|
+
body,
|
|
2708
3397
|
oauthClient: this.oauthClient,
|
|
2709
3398
|
numRetries: this.numRetries
|
|
2710
3399
|
});
|
|
2711
3400
|
return res.data;
|
|
2712
3401
|
}
|
|
2713
3402
|
/**
|
|
2714
|
-
*
|
|
2715
|
-
* @param
|
|
2716
|
-
* @returns
|
|
3403
|
+
* Get an OAuth token for client credentials.
|
|
3404
|
+
* @param opts - Token request options.
|
|
3405
|
+
* @returns OAuth2 token response.
|
|
2717
3406
|
*/
|
|
2718
|
-
async
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
);
|
|
2724
|
-
}
|
|
3407
|
+
async getAccessToken(opts) {
|
|
3408
|
+
const params = {};
|
|
3409
|
+
if (opts.tokenTtlInterval !== void 0)
|
|
3410
|
+
params.tokenTtlInterval = String(opts.tokenTtlInterval);
|
|
3411
|
+
if (opts.tokenTtlUnit !== void 0) params.tokenTtlUnit = opts.tokenTtlUnit;
|
|
2725
3412
|
const res = await managementHttpRequest({
|
|
2726
|
-
method: "
|
|
3413
|
+
method: "POST",
|
|
2727
3414
|
baseUrl: this.baseUrl,
|
|
2728
|
-
path:
|
|
3415
|
+
path: MGMT_OAUTH_TOKEN_PATH,
|
|
3416
|
+
params: Object.keys(params).length > 0 ? params : void 0,
|
|
3417
|
+
body: opts.body,
|
|
2729
3418
|
oauthClient: this.oauthClient,
|
|
2730
3419
|
numRetries: this.numRetries
|
|
2731
3420
|
});
|
|
@@ -2737,6 +3426,12 @@ var TopicsClient = class {
|
|
|
2737
3426
|
var ManagementClient = class {
|
|
2738
3427
|
profiles;
|
|
2739
3428
|
topics;
|
|
3429
|
+
apiKeys;
|
|
3430
|
+
customerApps;
|
|
3431
|
+
dlpProfiles;
|
|
3432
|
+
deploymentProfiles;
|
|
3433
|
+
scanLogs;
|
|
3434
|
+
oauth;
|
|
2740
3435
|
constructor(opts = {}) {
|
|
2741
3436
|
const clientId = opts.clientId ?? process.env[MGMT_CLIENT_ID];
|
|
2742
3437
|
const clientSecret = opts.clientSecret ?? process.env[MGMT_CLIENT_SECRET];
|
|
@@ -2783,19 +3478,92 @@ var ManagementClient = class {
|
|
|
2783
3478
|
tsgId,
|
|
2784
3479
|
numRetries
|
|
2785
3480
|
});
|
|
3481
|
+
this.apiKeys = new ApiKeysClient({
|
|
3482
|
+
baseUrl: apiEndpoint,
|
|
3483
|
+
oauthClient,
|
|
3484
|
+
tsgId,
|
|
3485
|
+
numRetries
|
|
3486
|
+
});
|
|
3487
|
+
this.customerApps = new CustomerAppsClient({
|
|
3488
|
+
baseUrl: apiEndpoint,
|
|
3489
|
+
oauthClient,
|
|
3490
|
+
tsgId,
|
|
3491
|
+
numRetries
|
|
3492
|
+
});
|
|
3493
|
+
this.dlpProfiles = new DlpProfilesClient({
|
|
3494
|
+
baseUrl: apiEndpoint,
|
|
3495
|
+
oauthClient,
|
|
3496
|
+
numRetries
|
|
3497
|
+
});
|
|
3498
|
+
this.deploymentProfiles = new DeploymentProfilesClient({
|
|
3499
|
+
baseUrl: apiEndpoint,
|
|
3500
|
+
oauthClient,
|
|
3501
|
+
numRetries
|
|
3502
|
+
});
|
|
3503
|
+
this.scanLogs = new ScanLogsClient({
|
|
3504
|
+
baseUrl: apiEndpoint,
|
|
3505
|
+
oauthClient,
|
|
3506
|
+
numRetries
|
|
3507
|
+
});
|
|
3508
|
+
this.oauth = new OAuthManagementClient({
|
|
3509
|
+
baseUrl: apiEndpoint,
|
|
3510
|
+
oauthClient,
|
|
3511
|
+
numRetries
|
|
3512
|
+
});
|
|
2786
3513
|
}
|
|
2787
3514
|
};
|
|
2788
3515
|
|
|
2789
3516
|
// src/model-security/scans-client.ts
|
|
2790
|
-
function
|
|
3517
|
+
function buildScanListParams(opts) {
|
|
2791
3518
|
const params = {};
|
|
2792
3519
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
2793
3520
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
2794
3521
|
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
2795
|
-
if (opts?.
|
|
3522
|
+
if (opts?.sort_order !== void 0) params.sort_order = opts.sort_order;
|
|
3523
|
+
if (opts?.search_query !== void 0) params.search_query = opts.search_query;
|
|
3524
|
+
if (opts?.eval_outcomes !== void 0) params.eval_outcomes = opts.eval_outcomes;
|
|
3525
|
+
if (opts?.source_types !== void 0) params.source_types = opts.source_types;
|
|
3526
|
+
if (opts?.security_group_uuid !== void 0)
|
|
3527
|
+
params.security_group_uuid = opts.security_group_uuid;
|
|
3528
|
+
if (opts?.start_time !== void 0) params.start_time = opts.start_time;
|
|
3529
|
+
if (opts?.end_time !== void 0) params.end_time = opts.end_time;
|
|
3530
|
+
if (opts?.labels_query !== void 0) params.labels_query = opts.labels_query;
|
|
3531
|
+
return params;
|
|
3532
|
+
}
|
|
3533
|
+
function buildEvaluationListParams(opts) {
|
|
3534
|
+
const params = {};
|
|
3535
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3536
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3537
|
+
if (opts?.sort_field !== void 0) params.sort_field = opts.sort_field;
|
|
3538
|
+
if (opts?.sort_order !== void 0) params.sort_order = opts.sort_order;
|
|
3539
|
+
if (opts?.result !== void 0) params.result = opts.result;
|
|
3540
|
+
if (opts?.rule_instance_uuid !== void 0) params.rule_instance_uuid = opts.rule_instance_uuid;
|
|
3541
|
+
return params;
|
|
3542
|
+
}
|
|
3543
|
+
function buildFileListParams(opts) {
|
|
3544
|
+
const params = {};
|
|
3545
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3546
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3547
|
+
if (opts?.sort_field !== void 0) params.sort_field = opts.sort_field;
|
|
3548
|
+
if (opts?.sort_dir !== void 0) params.sort_dir = opts.sort_dir;
|
|
3549
|
+
if (opts?.type !== void 0) params.type = opts.type;
|
|
3550
|
+
if (opts?.result !== void 0) params.result = opts.result;
|
|
3551
|
+
if (opts?.query_path !== void 0) params.query_path = opts.query_path;
|
|
3552
|
+
return params;
|
|
3553
|
+
}
|
|
3554
|
+
function buildLabelListParams(opts) {
|
|
3555
|
+
const params = {};
|
|
3556
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3557
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
2796
3558
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
2797
3559
|
return params;
|
|
2798
3560
|
}
|
|
3561
|
+
function buildViolationListParams(opts) {
|
|
3562
|
+
const params = {};
|
|
3563
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3564
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3565
|
+
return params;
|
|
3566
|
+
}
|
|
2799
3567
|
var ModelSecurityScansClient = class {
|
|
2800
3568
|
baseUrl;
|
|
2801
3569
|
oauthClient;
|
|
@@ -2827,15 +3595,11 @@ var ModelSecurityScansClient = class {
|
|
|
2827
3595
|
* @returns Paginated list of scans.
|
|
2828
3596
|
*/
|
|
2829
3597
|
async list(opts) {
|
|
2830
|
-
const params = buildListParams(opts);
|
|
2831
|
-
if (opts?.eval_outcome !== void 0) params.eval_outcome = opts.eval_outcome;
|
|
2832
|
-
if (opts?.source_type !== void 0) params.source_type = opts.source_type;
|
|
2833
|
-
if (opts?.scan_origin !== void 0) params.scan_origin = opts.scan_origin;
|
|
2834
3598
|
const res = await managementHttpRequest({
|
|
2835
3599
|
method: "GET",
|
|
2836
3600
|
baseUrl: this.baseUrl,
|
|
2837
3601
|
path: MODEL_SEC_SCANS_PATH,
|
|
2838
|
-
params,
|
|
3602
|
+
params: buildScanListParams(opts),
|
|
2839
3603
|
oauthClient: this.oauthClient,
|
|
2840
3604
|
numRetries: this.numRetries
|
|
2841
3605
|
});
|
|
@@ -2865,7 +3629,7 @@ var ModelSecurityScansClient = class {
|
|
|
2865
3629
|
/**
|
|
2866
3630
|
* Get rule evaluations for a scan.
|
|
2867
3631
|
* @param scanUuid - Scan UUID.
|
|
2868
|
-
* @param opts - Pagination options.
|
|
3632
|
+
* @param opts - Pagination and filter options.
|
|
2869
3633
|
* @returns Paginated list of rule evaluations.
|
|
2870
3634
|
*/
|
|
2871
3635
|
async getEvaluations(scanUuid, opts) {
|
|
@@ -2879,7 +3643,7 @@ var ModelSecurityScansClient = class {
|
|
|
2879
3643
|
method: "GET",
|
|
2880
3644
|
baseUrl: this.baseUrl,
|
|
2881
3645
|
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/evaluations`,
|
|
2882
|
-
params:
|
|
3646
|
+
params: buildEvaluationListParams(opts),
|
|
2883
3647
|
oauthClient: this.oauthClient,
|
|
2884
3648
|
numRetries: this.numRetries
|
|
2885
3649
|
});
|
|
@@ -2898,14 +3662,11 @@ var ModelSecurityScansClient = class {
|
|
|
2898
3662
|
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2899
3663
|
);
|
|
2900
3664
|
}
|
|
2901
|
-
const params = buildListParams(opts);
|
|
2902
|
-
if (opts?.type !== void 0) params.type = opts.type;
|
|
2903
|
-
if (opts?.result !== void 0) params.result = opts.result;
|
|
2904
3665
|
const res = await managementHttpRequest({
|
|
2905
3666
|
method: "GET",
|
|
2906
3667
|
baseUrl: this.baseUrl,
|
|
2907
3668
|
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/files`,
|
|
2908
|
-
params,
|
|
3669
|
+
params: buildFileListParams(opts),
|
|
2909
3670
|
oauthClient: this.oauthClient,
|
|
2910
3671
|
numRetries: this.numRetries
|
|
2911
3672
|
});
|
|
@@ -2961,6 +3722,7 @@ var ModelSecurityScansClient = class {
|
|
|
2961
3722
|
* Delete labels from a scan by key.
|
|
2962
3723
|
* @param scanUuid - Scan UUID.
|
|
2963
3724
|
* @param keys - Label keys to delete.
|
|
3725
|
+
* @returns Resolves when the labels are deleted.
|
|
2964
3726
|
*/
|
|
2965
3727
|
async deleteLabels(scanUuid, keys) {
|
|
2966
3728
|
if (!isValidUuid(scanUuid)) {
|
|
@@ -3000,7 +3762,7 @@ var ModelSecurityScansClient = class {
|
|
|
3000
3762
|
method: "GET",
|
|
3001
3763
|
baseUrl: this.baseUrl,
|
|
3002
3764
|
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/rule-violations`,
|
|
3003
|
-
params:
|
|
3765
|
+
params: buildViolationListParams(opts),
|
|
3004
3766
|
oauthClient: this.oauthClient,
|
|
3005
3767
|
numRetries: this.numRetries
|
|
3006
3768
|
});
|
|
@@ -3016,7 +3778,7 @@ var ModelSecurityScansClient = class {
|
|
|
3016
3778
|
method: "GET",
|
|
3017
3779
|
baseUrl: this.baseUrl,
|
|
3018
3780
|
path: `${MODEL_SEC_SCANS_PATH}/label-keys`,
|
|
3019
|
-
params:
|
|
3781
|
+
params: buildLabelListParams(opts),
|
|
3020
3782
|
oauthClient: this.oauthClient,
|
|
3021
3783
|
numRetries: this.numRetries
|
|
3022
3784
|
});
|
|
@@ -3033,7 +3795,7 @@ var ModelSecurityScansClient = class {
|
|
|
3033
3795
|
method: "GET",
|
|
3034
3796
|
baseUrl: this.baseUrl,
|
|
3035
3797
|
path: `${MODEL_SEC_SCANS_PATH}/label-keys/${encodeURIComponent(key)}/values`,
|
|
3036
|
-
params:
|
|
3798
|
+
params: buildLabelListParams(opts),
|
|
3037
3799
|
oauthClient: this.oauthClient,
|
|
3038
3800
|
numRetries: this.numRetries
|
|
3039
3801
|
});
|
|
@@ -3428,12 +4190,10 @@ var ModelSecurityClient = class {
|
|
|
3428
4190
|
};
|
|
3429
4191
|
|
|
3430
4192
|
// src/red-team/scans-client.ts
|
|
3431
|
-
function
|
|
4193
|
+
function buildListParams(opts) {
|
|
3432
4194
|
const params = {};
|
|
3433
4195
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3434
4196
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3435
|
-
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3436
|
-
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3437
4197
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
3438
4198
|
return params;
|
|
3439
4199
|
}
|
|
@@ -3446,7 +4206,11 @@ var RedTeamScansClient = class {
|
|
|
3446
4206
|
this.oauthClient = opts.oauthClient;
|
|
3447
4207
|
this.numRetries = opts.numRetries;
|
|
3448
4208
|
}
|
|
3449
|
-
/**
|
|
4209
|
+
/**
|
|
4210
|
+
* Create a new red team scan job.
|
|
4211
|
+
* @param request - Job creation request body.
|
|
4212
|
+
* @returns The created job response.
|
|
4213
|
+
*/
|
|
3450
4214
|
async create(request) {
|
|
3451
4215
|
const res = await managementHttpRequest({
|
|
3452
4216
|
method: "POST",
|
|
@@ -3460,7 +4224,7 @@ var RedTeamScansClient = class {
|
|
|
3460
4224
|
}
|
|
3461
4225
|
/** List red team scan jobs with optional filters. */
|
|
3462
4226
|
async list(opts) {
|
|
3463
|
-
const params =
|
|
4227
|
+
const params = buildListParams(opts);
|
|
3464
4228
|
if (opts?.status !== void 0) params.status = opts.status;
|
|
3465
4229
|
if (opts?.job_type !== void 0) params.job_type = opts.job_type;
|
|
3466
4230
|
if (opts?.target_id !== void 0) params.target_id = opts.target_id;
|
|
@@ -3516,12 +4280,10 @@ var RedTeamScansClient = class {
|
|
|
3516
4280
|
};
|
|
3517
4281
|
|
|
3518
4282
|
// src/red-team/reports-client.ts
|
|
3519
|
-
function
|
|
4283
|
+
function buildListParams2(opts) {
|
|
3520
4284
|
const params = {};
|
|
3521
4285
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3522
4286
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3523
|
-
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3524
|
-
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3525
4287
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
3526
4288
|
return params;
|
|
3527
4289
|
}
|
|
@@ -3545,11 +4307,13 @@ var RedTeamReportsClient = class {
|
|
|
3545
4307
|
/** List attacks for a static scan. */
|
|
3546
4308
|
async listAttacks(jobId, opts) {
|
|
3547
4309
|
validateJobId(jobId);
|
|
3548
|
-
const params =
|
|
4310
|
+
const params = buildListParams2(opts);
|
|
3549
4311
|
if (opts?.status !== void 0) params.status = opts.status;
|
|
3550
4312
|
if (opts?.severity !== void 0) params.severity = opts.severity;
|
|
3551
4313
|
if (opts?.category !== void 0) params.category = opts.category;
|
|
3552
4314
|
if (opts?.sub_category !== void 0) params.sub_category = opts.sub_category;
|
|
4315
|
+
if (opts?.attack_type !== void 0) params.attack_type = opts.attack_type;
|
|
4316
|
+
if (opts?.threat !== void 0) params.threat = String(opts.threat);
|
|
3553
4317
|
const res = await managementHttpRequest({
|
|
3554
4318
|
method: "GET",
|
|
3555
4319
|
baseUrl: this.baseUrl,
|
|
@@ -3674,8 +4438,10 @@ var RedTeamReportsClient = class {
|
|
|
3674
4438
|
/** List goals for a dynamic scan. */
|
|
3675
4439
|
async listGoals(jobId, opts) {
|
|
3676
4440
|
validateJobId(jobId);
|
|
3677
|
-
const params =
|
|
4441
|
+
const params = buildListParams2(opts);
|
|
3678
4442
|
if (opts?.goal_type !== void 0) params.goal_type = opts.goal_type;
|
|
4443
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
4444
|
+
if (opts?.count !== void 0) params.count = String(opts.count);
|
|
3679
4445
|
const res = await managementHttpRequest({
|
|
3680
4446
|
method: "GET",
|
|
3681
4447
|
baseUrl: this.baseUrl,
|
|
@@ -3699,7 +4465,7 @@ var RedTeamReportsClient = class {
|
|
|
3699
4465
|
method: "GET",
|
|
3700
4466
|
baseUrl: this.baseUrl,
|
|
3701
4467
|
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/goal/${goalId}/list-streams`,
|
|
3702
|
-
params:
|
|
4468
|
+
params: buildListParams2(opts),
|
|
3703
4469
|
oauthClient: this.oauthClient,
|
|
3704
4470
|
numRetries: this.numRetries
|
|
3705
4471
|
});
|
|
@@ -3728,8 +4494,7 @@ var RedTeamReportsClient = class {
|
|
|
3728
4494
|
/** Download a report in the specified format. */
|
|
3729
4495
|
async downloadReport(jobId, format) {
|
|
3730
4496
|
validateJobId(jobId);
|
|
3731
|
-
const params = {};
|
|
3732
|
-
if (format !== void 0) params.file_format = format;
|
|
4497
|
+
const params = { file_format: format };
|
|
3733
4498
|
const res = await managementHttpRequest({
|
|
3734
4499
|
method: "GET",
|
|
3735
4500
|
baseUrl: this.baseUrl,
|
|
@@ -3755,12 +4520,10 @@ var RedTeamReportsClient = class {
|
|
|
3755
4520
|
};
|
|
3756
4521
|
|
|
3757
4522
|
// src/red-team/custom-attack-reports-client.ts
|
|
3758
|
-
function
|
|
4523
|
+
function buildListParams3(opts) {
|
|
3759
4524
|
const params = {};
|
|
3760
4525
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3761
4526
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3762
|
-
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3763
|
-
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3764
4527
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
3765
4528
|
return params;
|
|
3766
4529
|
}
|
|
@@ -3811,11 +4574,13 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
3811
4574
|
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3812
4575
|
);
|
|
3813
4576
|
}
|
|
4577
|
+
const params = buildListParams3(opts);
|
|
4578
|
+
if (opts?.is_threat !== void 0) params.is_threat = String(opts.is_threat);
|
|
3814
4579
|
const res = await managementHttpRequest({
|
|
3815
4580
|
method: "GET",
|
|
3816
4581
|
baseUrl: this.baseUrl,
|
|
3817
4582
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
3818
|
-
params
|
|
4583
|
+
params,
|
|
3819
4584
|
oauthClient: this.oauthClient,
|
|
3820
4585
|
numRetries: this.numRetries
|
|
3821
4586
|
});
|
|
@@ -3842,11 +4607,15 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
3842
4607
|
/** List custom attacks for a scan. */
|
|
3843
4608
|
async listCustomAttacks(jobId, opts) {
|
|
3844
4609
|
validateJobId2(jobId);
|
|
4610
|
+
const params = buildListParams3(opts);
|
|
4611
|
+
if (opts?.threat !== void 0) params.threat = String(opts.threat);
|
|
4612
|
+
if (opts?.prompt_set_id !== void 0) params.prompt_set_id = opts.prompt_set_id;
|
|
4613
|
+
if (opts?.property_value !== void 0) params.property_value = opts.property_value;
|
|
3845
4614
|
const res = await managementHttpRequest({
|
|
3846
4615
|
method: "GET",
|
|
3847
4616
|
baseUrl: this.baseUrl,
|
|
3848
4617
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/list-custom-attacks`,
|
|
3849
|
-
params
|
|
4618
|
+
params,
|
|
3850
4619
|
oauthClient: this.oauthClient,
|
|
3851
4620
|
numRetries: this.numRetries
|
|
3852
4621
|
});
|
|
@@ -3885,12 +4654,10 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
3885
4654
|
};
|
|
3886
4655
|
|
|
3887
4656
|
// src/red-team/targets-client.ts
|
|
3888
|
-
function
|
|
4657
|
+
function buildListParams4(opts) {
|
|
3889
4658
|
const params = {};
|
|
3890
4659
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3891
4660
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3892
|
-
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3893
|
-
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3894
4661
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
3895
4662
|
return params;
|
|
3896
4663
|
}
|
|
@@ -3903,7 +4670,12 @@ var RedTeamTargetsClient = class {
|
|
|
3903
4670
|
this.oauthClient = opts.oauthClient;
|
|
3904
4671
|
this.numRetries = opts.numRetries;
|
|
3905
4672
|
}
|
|
3906
|
-
/**
|
|
4673
|
+
/**
|
|
4674
|
+
* Create a new target.
|
|
4675
|
+
* @param request - Target creation request body.
|
|
4676
|
+
* @param opts - Optional operation options (e.g. validate connection).
|
|
4677
|
+
* @returns The created target response.
|
|
4678
|
+
*/
|
|
3907
4679
|
async create(request, opts) {
|
|
3908
4680
|
const params = {};
|
|
3909
4681
|
if (opts?.validate !== void 0) params.validate = String(opts.validate);
|
|
@@ -3920,10 +4692,9 @@ var RedTeamTargetsClient = class {
|
|
|
3920
4692
|
}
|
|
3921
4693
|
/** List targets with optional filters. */
|
|
3922
4694
|
async list(opts) {
|
|
3923
|
-
const params =
|
|
4695
|
+
const params = buildListParams4(opts);
|
|
3924
4696
|
if (opts?.target_type !== void 0) params.target_type = opts.target_type;
|
|
3925
4697
|
if (opts?.status !== void 0) params.status = opts.status;
|
|
3926
|
-
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
3927
4698
|
const res = await managementHttpRequest({
|
|
3928
4699
|
method: "GET",
|
|
3929
4700
|
baseUrl: this.baseUrl,
|
|
@@ -4039,12 +4810,10 @@ var RedTeamTargetsClient = class {
|
|
|
4039
4810
|
};
|
|
4040
4811
|
|
|
4041
4812
|
// src/red-team/custom-attacks-client.ts
|
|
4042
|
-
function
|
|
4813
|
+
function buildListParams5(opts) {
|
|
4043
4814
|
const params = {};
|
|
4044
4815
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4045
4816
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4046
|
-
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4047
|
-
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4048
4817
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
4049
4818
|
return params;
|
|
4050
4819
|
}
|
|
@@ -4079,7 +4848,8 @@ var RedTeamCustomAttacksClient = class {
|
|
|
4079
4848
|
}
|
|
4080
4849
|
/** List custom prompt sets. */
|
|
4081
4850
|
async listPromptSets(opts) {
|
|
4082
|
-
const params =
|
|
4851
|
+
const params = buildListParams5(opts);
|
|
4852
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
4083
4853
|
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4084
4854
|
if (opts?.archive !== void 0) params.archive = String(opts.archive);
|
|
4085
4855
|
const res = await managementHttpRequest({
|
|
@@ -4222,7 +4992,7 @@ var RedTeamCustomAttacksClient = class {
|
|
|
4222
4992
|
/** List prompts in a prompt set. */
|
|
4223
4993
|
async listPrompts(promptSetUuid, opts) {
|
|
4224
4994
|
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4225
|
-
const params =
|
|
4995
|
+
const params = buildListParams5(opts);
|
|
4226
4996
|
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4227
4997
|
const res = await managementHttpRequest({
|
|
4228
4998
|
method: "GET",
|
|
@@ -4343,12 +5113,10 @@ var RedTeamCustomAttacksClient = class {
|
|
|
4343
5113
|
};
|
|
4344
5114
|
|
|
4345
5115
|
// src/red-team/client.ts
|
|
4346
|
-
function
|
|
5116
|
+
function buildListParams6(opts) {
|
|
4347
5117
|
const params = {};
|
|
4348
5118
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4349
5119
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4350
|
-
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4351
|
-
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4352
5120
|
if (opts?.search !== void 0) params.search = opts.search;
|
|
4353
5121
|
return params;
|
|
4354
5122
|
}
|
|
@@ -4482,7 +5250,7 @@ var RedTeamClient = class {
|
|
|
4482
5250
|
method: "GET",
|
|
4483
5251
|
baseUrl: this.dataEndpoint,
|
|
4484
5252
|
path: `${RED_TEAM_ERROR_LOG_PATH}/${jobId}`,
|
|
4485
|
-
params:
|
|
5253
|
+
params: buildListParams6(opts),
|
|
4486
5254
|
oauthClient: this.oauthClient,
|
|
4487
5255
|
numRetries: this.numRetries
|
|
4488
5256
|
});
|
|
@@ -4530,15 +5298,25 @@ var RedTeamClient = class {
|
|
|
4530
5298
|
}
|
|
4531
5299
|
};
|
|
4532
5300
|
export {
|
|
5301
|
+
AIRS_ENDPOINTS,
|
|
4533
5302
|
AISecSDKException,
|
|
4534
5303
|
AI_SEC_API_ENDPOINT,
|
|
4535
5304
|
AI_SEC_API_KEY,
|
|
4536
5305
|
AI_SEC_API_TOKEN,
|
|
4537
5306
|
ASYNC_SCAN_PATH,
|
|
4538
5307
|
Action,
|
|
5308
|
+
AgentEntrySchema,
|
|
4539
5309
|
AgentMetaSchema,
|
|
5310
|
+
AgentReportSchema,
|
|
4540
5311
|
AiProfileSchema,
|
|
4541
5312
|
ApiEndpointType,
|
|
5313
|
+
ApiKeyCreateRequestSchema,
|
|
5314
|
+
ApiKeyDPInfoSchema,
|
|
5315
|
+
ApiKeyDeleteResponseSchema,
|
|
5316
|
+
ApiKeyListResponseSchema,
|
|
5317
|
+
ApiKeyRegenerateRequestSchema,
|
|
5318
|
+
ApiKeySchema,
|
|
5319
|
+
ApiKeysClient,
|
|
4542
5320
|
AsyncScanObjectSchema,
|
|
4543
5321
|
AsyncScanResponseSchema,
|
|
4544
5322
|
AttackDetailResponseSchema,
|
|
@@ -4557,11 +5335,17 @@ export {
|
|
|
4557
5335
|
Category,
|
|
4558
5336
|
CategoryModelSchema,
|
|
4559
5337
|
CategoryReportSchema,
|
|
5338
|
+
CgReportSchema,
|
|
5339
|
+
ClientIdAndCustomerAppSchema,
|
|
5340
|
+
CmdEntrySchema,
|
|
5341
|
+
CmdInjectReportSchema,
|
|
4560
5342
|
ComplianceReportSchema,
|
|
4561
5343
|
ComplianceSubCategory,
|
|
4562
5344
|
ComplianceTechniqueSchema,
|
|
4563
5345
|
ConnectionParamsSchema,
|
|
4564
5346
|
Content,
|
|
5347
|
+
ContentErrorSchema,
|
|
5348
|
+
ContentErrorType,
|
|
4565
5349
|
CountByNameSchema,
|
|
4566
5350
|
CountedQuotaEnum,
|
|
4567
5351
|
CreateCustomTopicRequestSchema,
|
|
@@ -4586,6 +5370,10 @@ export {
|
|
|
4586
5370
|
CustomPromptUpdateRequestSchema,
|
|
4587
5371
|
CustomTopicListResponseSchema,
|
|
4588
5372
|
CustomTopicSchema,
|
|
5373
|
+
CustomerAppListResponseSchema,
|
|
5374
|
+
CustomerAppSchema,
|
|
5375
|
+
CustomerAppWithKeysSchema,
|
|
5376
|
+
CustomerAppsClient,
|
|
4589
5377
|
DEFAULT_ENDPOINT,
|
|
4590
5378
|
DEFAULT_MGMT_ENDPOINT,
|
|
4591
5379
|
DEFAULT_MODEL_SEC_DATA_ENDPOINT,
|
|
@@ -4598,11 +5386,21 @@ export {
|
|
|
4598
5386
|
DashboardOverviewResponseSchema,
|
|
4599
5387
|
DatabricksConnectionParamsSchema,
|
|
4600
5388
|
DateRangeFilter,
|
|
5389
|
+
DbsEntrySchema,
|
|
5390
|
+
DbsReportSchema,
|
|
4601
5391
|
DeleteProfileConflictSchema,
|
|
4602
5392
|
DeleteProfileResponseSchema,
|
|
4603
5393
|
DeleteTopicConflictSchema,
|
|
4604
5394
|
DeleteTopicResponseSchema,
|
|
5395
|
+
DeploymentProfileEntrySchema,
|
|
5396
|
+
DeploymentProfilesClient,
|
|
5397
|
+
DeploymentProfilesResponseSchema,
|
|
5398
|
+
DetectionServiceName,
|
|
4605
5399
|
DetectionServiceResultSchema,
|
|
5400
|
+
DlpDataProfileSchema2 as DlpDataProfileSchema,
|
|
5401
|
+
DlpPatternDetectionSchema,
|
|
5402
|
+
DlpProfileListResponseSchema,
|
|
5403
|
+
DlpProfilesClient,
|
|
4606
5404
|
DlpReportSchema,
|
|
4607
5405
|
DynamicJobMetadataSchema,
|
|
4608
5406
|
DynamicJobReportSchema,
|
|
@@ -4612,6 +5410,7 @@ export {
|
|
|
4612
5410
|
ErrorLogSchema,
|
|
4613
5411
|
ErrorResponseSchema,
|
|
4614
5412
|
ErrorSource,
|
|
5413
|
+
ErrorStatus,
|
|
4615
5414
|
ErrorType,
|
|
4616
5415
|
EvalOutcome,
|
|
4617
5416
|
EvalSummarySchema,
|
|
@@ -4663,11 +5462,20 @@ export {
|
|
|
4663
5462
|
MAX_SESSION_ID_STR_LENGTH,
|
|
4664
5463
|
MAX_TOKEN_LENGTH,
|
|
4665
5464
|
MAX_TRANSACTION_ID_STR_LENGTH,
|
|
5465
|
+
MGMT_API_KEYS_TSG_PATH,
|
|
5466
|
+
MGMT_API_KEY_PATH,
|
|
4666
5467
|
MGMT_CLIENT_ID,
|
|
4667
5468
|
MGMT_CLIENT_SECRET,
|
|
5469
|
+
MGMT_CUSTOMER_APPS_TSG_PATH,
|
|
5470
|
+
MGMT_CUSTOMER_APP_PATH,
|
|
5471
|
+
MGMT_DEPLOYMENT_PROFILES_PATH,
|
|
5472
|
+
MGMT_DLP_PROFILES_PATH,
|
|
4668
5473
|
MGMT_ENDPOINT,
|
|
5474
|
+
MGMT_OAUTH_INVALIDATE_PATH,
|
|
5475
|
+
MGMT_OAUTH_TOKEN_PATH,
|
|
4669
5476
|
MGMT_PROFILES_TSG_PATH,
|
|
4670
5477
|
MGMT_PROFILE_PATH,
|
|
5478
|
+
MGMT_SCAN_LOGS_PATH,
|
|
4671
5479
|
MGMT_TOKEN_ENDPOINT,
|
|
4672
5480
|
MGMT_TOPICS_TSG_PATH,
|
|
4673
5481
|
MGMT_TOPIC_FORCE_PATH,
|
|
@@ -4685,8 +5493,11 @@ export {
|
|
|
4685
5493
|
MODEL_SEC_TOKEN_ENDPOINT,
|
|
4686
5494
|
MODEL_SEC_TSG_ID,
|
|
4687
5495
|
MODEL_SEC_VIOLATIONS_PATH,
|
|
5496
|
+
MalwareReportSchema,
|
|
4688
5497
|
ManagementClient,
|
|
4689
5498
|
MaskedDataSchema,
|
|
5499
|
+
McEntrySchema,
|
|
5500
|
+
McReportSchema,
|
|
4690
5501
|
MetadataSchema,
|
|
4691
5502
|
ModelScanIssueSchema,
|
|
4692
5503
|
ModelScanStatus,
|
|
@@ -4705,8 +5516,13 @@ export {
|
|
|
4705
5516
|
MultiTurnStatefulConfigSchema,
|
|
4706
5517
|
MultiTurnStatelessConfigSchema,
|
|
4707
5518
|
OAuthClient,
|
|
5519
|
+
OAuthManagementClient,
|
|
5520
|
+
Oauth2TokenSchema,
|
|
5521
|
+
OffsetSchema,
|
|
4708
5522
|
OpenAIConnectionParamsSchema,
|
|
4709
5523
|
PAYLOAD_HASH,
|
|
5524
|
+
PaginatedScanResultsSchema,
|
|
5525
|
+
PatternDetectionSchema,
|
|
4710
5526
|
PolicySchema,
|
|
4711
5527
|
PolicyType,
|
|
4712
5528
|
PrerequisiteModelSchema,
|
|
@@ -4789,10 +5605,13 @@ export {
|
|
|
4789
5605
|
ScanDetailsSchema,
|
|
4790
5606
|
ScanIdResultSchema,
|
|
4791
5607
|
ScanListSchema,
|
|
5608
|
+
ScanLogsClient,
|
|
4792
5609
|
ScanOrigin,
|
|
4793
5610
|
ScanRequestContentsInnerSchema,
|
|
4794
5611
|
ScanRequestSchema,
|
|
4795
5612
|
ScanResponseSchema,
|
|
5613
|
+
ScanResultEntrySchema,
|
|
5614
|
+
ScanResultForDashboardSchema,
|
|
4796
5615
|
ScanStatisticsResponseSchema,
|
|
4797
5616
|
ScanSummarySchema,
|
|
4798
5617
|
Scanner,
|
|
@@ -4839,6 +5658,8 @@ export {
|
|
|
4839
5658
|
TargetStatus,
|
|
4840
5659
|
TargetType,
|
|
4841
5660
|
TargetUpdateRequestSchema,
|
|
5661
|
+
TcReportSchema,
|
|
5662
|
+
TgReportSchema,
|
|
4842
5663
|
ThreatCategory,
|
|
4843
5664
|
ThreatScanReportSchema,
|
|
4844
5665
|
ToolDetectedSchema,
|