@cdot65/prisma-airs-sdk 0.6.2 → 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.js CHANGED
@@ -29,7 +29,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
29
29
  var MAX_CONNECTION_POOL_SIZE = 100;
30
30
  var MAX_NUMBER_OF_RETRIES = 5;
31
31
  var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
32
- var SDK_VERSION = "0.6.2";
32
+ var SDK_VERSION = "0.6.3";
33
33
  var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
34
34
  var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
35
35
  var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
@@ -437,6 +437,11 @@ var Content = class _Content {
437
437
  _codePrompt;
438
438
  _codeResponse;
439
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
+ */
440
445
  constructor(opts) {
441
446
  if (!opts.prompt && !opts.response && !opts.codePrompt && !opts.codeResponse && !opts.toolEvent) {
442
447
  throw new AISecSDKException(
@@ -604,7 +609,7 @@ import { z } from "zod";
604
609
  var AiProfileSchema = z.object({
605
610
  profile_id: z.string().uuid().optional(),
606
611
  profile_name: z.string().max(MAX_AI_PROFILE_NAME_LENGTH).optional()
607
- }).refine((d) => d.profile_id || d.profile_name, {
612
+ }).passthrough().refine((d) => d.profile_id || d.profile_name, {
608
613
  message: "Either profile_id or profile_name must be provided"
609
614
  });
610
615
 
@@ -614,14 +619,14 @@ var AgentMetaSchema = z2.object({
614
619
  agent_id: z2.string().optional(),
615
620
  agent_version: z2.string().optional(),
616
621
  agent_arn: z2.string().optional()
617
- });
622
+ }).passthrough();
618
623
  var MetadataSchema = z2.object({
619
624
  app_name: z2.string().optional(),
620
625
  app_user: z2.string().optional(),
621
626
  ai_model: z2.string().optional(),
622
627
  user_ip: z2.string().optional(),
623
628
  agent_meta: AgentMetaSchema.optional()
624
- });
629
+ }).passthrough();
625
630
 
626
631
  // src/models/tool-event.ts
627
632
  import { z as z3 } from "zod";
@@ -630,12 +635,12 @@ var ToolEventMetadataSchema = z3.object({
630
635
  method: z3.string(),
631
636
  server_name: z3.string(),
632
637
  tool_invoked: z3.string().optional()
633
- });
638
+ }).passthrough();
634
639
  var ToolEventSchema = z3.object({
635
640
  metadata: ToolEventMetadataSchema.optional(),
636
641
  input: z3.string().optional(),
637
642
  output: z3.string().optional()
638
- });
643
+ }).passthrough();
639
644
 
640
645
  // src/models/scan-request.ts
641
646
  import { z as z4 } from "zod";
@@ -646,14 +651,14 @@ var ScanRequestContentsInnerSchema = z4.object({
646
651
  code_response: z4.string().optional(),
647
652
  context: z4.string().optional(),
648
653
  tool_event: ToolEventSchema.optional()
649
- });
654
+ }).passthrough();
650
655
  var ScanRequestSchema = z4.object({
651
656
  tr_id: z4.string().max(MAX_TRANSACTION_ID_STR_LENGTH).optional(),
652
657
  session_id: z4.string().max(MAX_SESSION_ID_STR_LENGTH).optional(),
653
658
  ai_profile: AiProfileSchema,
654
659
  metadata: MetadataSchema.optional(),
655
660
  contents: z4.array(ScanRequestContentsInnerSchema).min(1)
656
- });
661
+ }).passthrough();
657
662
 
658
663
  // src/models/scan-response.ts
659
664
  import { z as z8 } from "zod";
@@ -662,7 +667,7 @@ import { z as z8 } from "zod";
662
667
  import { z as z5 } from "zod";
663
668
  var PromptDetectionDetailsSchema = z5.object({
664
669
  topic_guardrails_details: z5.record(z5.unknown()).optional()
665
- });
670
+ }).passthrough();
666
671
  var PromptDetectedSchema = z5.object({
667
672
  url_cats: z5.boolean().optional(),
668
673
  dlp: z5.boolean().optional(),
@@ -671,13 +676,13 @@ var PromptDetectedSchema = z5.object({
671
676
  malicious_code: z5.boolean().optional(),
672
677
  agent: z5.boolean().optional(),
673
678
  topic_violation: z5.boolean().optional()
674
- });
679
+ }).passthrough();
675
680
 
676
681
  // src/models/response-detected.ts
677
682
  import { z as z6 } from "zod";
678
683
  var ResponseDetectionDetailsSchema = z6.object({
679
684
  topic_guardrails_details: z6.record(z6.unknown()).optional()
680
- });
685
+ }).passthrough();
681
686
  var ResponseDetectedSchema = z6.object({
682
687
  url_cats: z6.boolean().optional(),
683
688
  dlp: z6.boolean().optional(),
@@ -687,7 +692,7 @@ var ResponseDetectedSchema = z6.object({
687
692
  agent: z6.boolean().optional(),
688
693
  ungrounded: z6.boolean().optional(),
689
694
  topic_violation: z6.boolean().optional()
690
- });
695
+ }).passthrough();
691
696
 
692
697
  // src/models/detection-reports.ts
693
698
  import { z as z7 } from "zod";
@@ -763,7 +768,7 @@ var ContentErrorSchema = z7.object({
763
768
  var MaskedDataSchema = z8.object({
764
769
  data: z8.string().optional(),
765
770
  pattern_detections: z8.array(PatternDetectionSchema).optional()
766
- });
771
+ }).passthrough();
767
772
  var IODetectedSchema = z8.object({
768
773
  url_cats: z8.boolean().optional(),
769
774
  dlp: z8.boolean().optional(),
@@ -781,7 +786,7 @@ var ToolDetectedSchema = z8.object({
781
786
  summary: ScanSummarySchema.optional(),
782
787
  input_detected: IODetectedSchema.optional(),
783
788
  output_detected: IODetectedSchema.optional()
784
- });
789
+ }).passthrough();
785
790
  var ScanResponseSchema = z8.object({
786
791
  source: z8.string().optional(),
787
792
  report_id: z8.string(),
@@ -804,20 +809,20 @@ var ScanResponseSchema = z8.object({
804
809
  tool_detected: ToolDetectedSchema.optional(),
805
810
  created_at: z8.string().optional(),
806
811
  completed_at: z8.string().optional()
807
- });
812
+ }).passthrough();
808
813
 
809
814
  // src/models/async-scan.ts
810
815
  import { z as z9 } from "zod";
811
816
  var AsyncScanObjectSchema = z9.object({
812
817
  req_id: z9.number().int(),
813
818
  scan_req: ScanRequestSchema
814
- });
819
+ }).passthrough();
815
820
  var AsyncScanResponseSchema = z9.object({
816
821
  received: z9.string(),
817
822
  scan_id: z9.string(),
818
823
  report_id: z9.string().optional(),
819
824
  source: z9.string().optional()
820
- });
825
+ }).passthrough();
821
826
 
822
827
  // src/models/scan-id-result.ts
823
828
  import { z as z10 } from "zod";
@@ -827,7 +832,7 @@ var ScanIdResultSchema = z10.object({
827
832
  status: z10.string().optional(),
828
833
  scan_id: z10.string().optional(),
829
834
  result: ScanResponseSchema.optional()
830
- });
835
+ }).passthrough();
831
836
 
832
837
  // src/models/threat-report.ts
833
838
  import { z as z14 } from "zod";
@@ -845,7 +850,7 @@ var DlpReportSchema = z11.object({
845
850
  data_pattern_rule1_verdict: z11.string().optional(),
846
851
  data_pattern_rule2_verdict: z11.string().optional(),
847
852
  data_pattern_detection_offsets: z11.array(DlpPatternDetectionSchema).optional()
848
- });
853
+ }).passthrough();
849
854
 
850
855
  // src/models/urlf-report.ts
851
856
  import { z as z12 } from "zod";
@@ -854,7 +859,7 @@ var UrlfEntrySchema = z12.object({
854
859
  risk_level: z12.string().optional(),
855
860
  action: z12.string().optional(),
856
861
  categories: z12.array(z12.string()).optional()
857
- });
862
+ }).passthrough();
858
863
 
859
864
  // src/models/detection.ts
860
865
  var DSDetailResultSchema = z13.object({
@@ -883,7 +888,7 @@ var DetectionServiceResultSchema = z13.object({
883
888
  action: z13.string().optional(),
884
889
  metadata: DSResultMetadataSchema.optional(),
885
890
  result_detail: DSDetailResultSchema.optional()
886
- });
891
+ }).passthrough();
887
892
 
888
893
  // src/models/threat-report.ts
889
894
  var ThreatScanReportSchema = z14.object({
@@ -894,7 +899,7 @@ var ThreatScanReportSchema = z14.object({
894
899
  transaction_id: z14.string().optional(),
895
900
  session_id: z14.string().optional(),
896
901
  detection_results: z14.array(DetectionServiceResultSchema).optional()
897
- });
902
+ }).passthrough();
898
903
 
899
904
  // src/models/error-response.ts
900
905
  import { z as z15 } from "zod";
@@ -2701,7 +2706,7 @@ var OAuthTokenResponseSchema = z26.object({
2701
2706
  token_type: z26.string().optional(),
2702
2707
  expires_in: z26.number(),
2703
2708
  scope: z26.string().optional()
2704
- });
2709
+ }).passthrough();
2705
2710
 
2706
2711
  // src/management/oauth-client.ts
2707
2712
  var DEFAULT_TOKEN_BUFFER_MS = 3e4;
@@ -3717,6 +3722,7 @@ var ModelSecurityScansClient = class {
3717
3722
  * Delete labels from a scan by key.
3718
3723
  * @param scanUuid - Scan UUID.
3719
3724
  * @param keys - Label keys to delete.
3725
+ * @returns Resolves when the labels are deleted.
3720
3726
  */
3721
3727
  async deleteLabels(scanUuid, keys) {
3722
3728
  if (!isValidUuid(scanUuid)) {
@@ -4200,7 +4206,11 @@ var RedTeamScansClient = class {
4200
4206
  this.oauthClient = opts.oauthClient;
4201
4207
  this.numRetries = opts.numRetries;
4202
4208
  }
4203
- /** Create a new red team scan job. */
4209
+ /**
4210
+ * Create a new red team scan job.
4211
+ * @param request - Job creation request body.
4212
+ * @returns The created job response.
4213
+ */
4204
4214
  async create(request) {
4205
4215
  const res = await managementHttpRequest({
4206
4216
  method: "POST",
@@ -4660,7 +4670,12 @@ var RedTeamTargetsClient = class {
4660
4670
  this.oauthClient = opts.oauthClient;
4661
4671
  this.numRetries = opts.numRetries;
4662
4672
  }
4663
- /** Create a new target. */
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
+ */
4664
4679
  async create(request, opts) {
4665
4680
  const params = {};
4666
4681
  if (opts?.validate !== void 0) params.validate = String(opts.validate);