@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.cjs +40 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17708 -3777
- package/dist/index.d.ts +17708 -3777
- package/dist/index.js +40 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -430,7 +430,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
430
430
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
431
431
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
432
432
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
433
|
-
var SDK_VERSION = "0.6.
|
|
433
|
+
var SDK_VERSION = "0.6.3";
|
|
434
434
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
435
435
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
436
436
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -838,6 +838,11 @@ var Content = class _Content {
|
|
|
838
838
|
_codePrompt;
|
|
839
839
|
_codeResponse;
|
|
840
840
|
_toolEvent;
|
|
841
|
+
/**
|
|
842
|
+
* Create a new Content instance.
|
|
843
|
+
* @param opts - Content fields; at least one of prompt, response, codePrompt, codeResponse, or toolEvent is required.
|
|
844
|
+
* @throws {AISecSDKException} If no content field is provided or a field exceeds its byte-length limit.
|
|
845
|
+
*/
|
|
841
846
|
constructor(opts) {
|
|
842
847
|
if (!opts.prompt && !opts.response && !opts.codePrompt && !opts.codeResponse && !opts.toolEvent) {
|
|
843
848
|
throw new AISecSDKException(
|
|
@@ -1005,7 +1010,7 @@ var import_zod = require("zod");
|
|
|
1005
1010
|
var AiProfileSchema = import_zod.z.object({
|
|
1006
1011
|
profile_id: import_zod.z.string().uuid().optional(),
|
|
1007
1012
|
profile_name: import_zod.z.string().max(MAX_AI_PROFILE_NAME_LENGTH).optional()
|
|
1008
|
-
}).refine((d) => d.profile_id || d.profile_name, {
|
|
1013
|
+
}).passthrough().refine((d) => d.profile_id || d.profile_name, {
|
|
1009
1014
|
message: "Either profile_id or profile_name must be provided"
|
|
1010
1015
|
});
|
|
1011
1016
|
|
|
@@ -1015,14 +1020,14 @@ var AgentMetaSchema = import_zod2.z.object({
|
|
|
1015
1020
|
agent_id: import_zod2.z.string().optional(),
|
|
1016
1021
|
agent_version: import_zod2.z.string().optional(),
|
|
1017
1022
|
agent_arn: import_zod2.z.string().optional()
|
|
1018
|
-
});
|
|
1023
|
+
}).passthrough();
|
|
1019
1024
|
var MetadataSchema = import_zod2.z.object({
|
|
1020
1025
|
app_name: import_zod2.z.string().optional(),
|
|
1021
1026
|
app_user: import_zod2.z.string().optional(),
|
|
1022
1027
|
ai_model: import_zod2.z.string().optional(),
|
|
1023
1028
|
user_ip: import_zod2.z.string().optional(),
|
|
1024
1029
|
agent_meta: AgentMetaSchema.optional()
|
|
1025
|
-
});
|
|
1030
|
+
}).passthrough();
|
|
1026
1031
|
|
|
1027
1032
|
// src/models/tool-event.ts
|
|
1028
1033
|
var import_zod3 = require("zod");
|
|
@@ -1031,12 +1036,12 @@ var ToolEventMetadataSchema = import_zod3.z.object({
|
|
|
1031
1036
|
method: import_zod3.z.string(),
|
|
1032
1037
|
server_name: import_zod3.z.string(),
|
|
1033
1038
|
tool_invoked: import_zod3.z.string().optional()
|
|
1034
|
-
});
|
|
1039
|
+
}).passthrough();
|
|
1035
1040
|
var ToolEventSchema = import_zod3.z.object({
|
|
1036
1041
|
metadata: ToolEventMetadataSchema.optional(),
|
|
1037
1042
|
input: import_zod3.z.string().optional(),
|
|
1038
1043
|
output: import_zod3.z.string().optional()
|
|
1039
|
-
});
|
|
1044
|
+
}).passthrough();
|
|
1040
1045
|
|
|
1041
1046
|
// src/models/scan-request.ts
|
|
1042
1047
|
var import_zod4 = require("zod");
|
|
@@ -1047,14 +1052,14 @@ var ScanRequestContentsInnerSchema = import_zod4.z.object({
|
|
|
1047
1052
|
code_response: import_zod4.z.string().optional(),
|
|
1048
1053
|
context: import_zod4.z.string().optional(),
|
|
1049
1054
|
tool_event: ToolEventSchema.optional()
|
|
1050
|
-
});
|
|
1055
|
+
}).passthrough();
|
|
1051
1056
|
var ScanRequestSchema = import_zod4.z.object({
|
|
1052
1057
|
tr_id: import_zod4.z.string().max(MAX_TRANSACTION_ID_STR_LENGTH).optional(),
|
|
1053
1058
|
session_id: import_zod4.z.string().max(MAX_SESSION_ID_STR_LENGTH).optional(),
|
|
1054
1059
|
ai_profile: AiProfileSchema,
|
|
1055
1060
|
metadata: MetadataSchema.optional(),
|
|
1056
1061
|
contents: import_zod4.z.array(ScanRequestContentsInnerSchema).min(1)
|
|
1057
|
-
});
|
|
1062
|
+
}).passthrough();
|
|
1058
1063
|
|
|
1059
1064
|
// src/models/scan-response.ts
|
|
1060
1065
|
var import_zod8 = require("zod");
|
|
@@ -1063,7 +1068,7 @@ var import_zod8 = require("zod");
|
|
|
1063
1068
|
var import_zod5 = require("zod");
|
|
1064
1069
|
var PromptDetectionDetailsSchema = import_zod5.z.object({
|
|
1065
1070
|
topic_guardrails_details: import_zod5.z.record(import_zod5.z.unknown()).optional()
|
|
1066
|
-
});
|
|
1071
|
+
}).passthrough();
|
|
1067
1072
|
var PromptDetectedSchema = import_zod5.z.object({
|
|
1068
1073
|
url_cats: import_zod5.z.boolean().optional(),
|
|
1069
1074
|
dlp: import_zod5.z.boolean().optional(),
|
|
@@ -1072,13 +1077,13 @@ var PromptDetectedSchema = import_zod5.z.object({
|
|
|
1072
1077
|
malicious_code: import_zod5.z.boolean().optional(),
|
|
1073
1078
|
agent: import_zod5.z.boolean().optional(),
|
|
1074
1079
|
topic_violation: import_zod5.z.boolean().optional()
|
|
1075
|
-
});
|
|
1080
|
+
}).passthrough();
|
|
1076
1081
|
|
|
1077
1082
|
// src/models/response-detected.ts
|
|
1078
1083
|
var import_zod6 = require("zod");
|
|
1079
1084
|
var ResponseDetectionDetailsSchema = import_zod6.z.object({
|
|
1080
1085
|
topic_guardrails_details: import_zod6.z.record(import_zod6.z.unknown()).optional()
|
|
1081
|
-
});
|
|
1086
|
+
}).passthrough();
|
|
1082
1087
|
var ResponseDetectedSchema = import_zod6.z.object({
|
|
1083
1088
|
url_cats: import_zod6.z.boolean().optional(),
|
|
1084
1089
|
dlp: import_zod6.z.boolean().optional(),
|
|
@@ -1088,7 +1093,7 @@ var ResponseDetectedSchema = import_zod6.z.object({
|
|
|
1088
1093
|
agent: import_zod6.z.boolean().optional(),
|
|
1089
1094
|
ungrounded: import_zod6.z.boolean().optional(),
|
|
1090
1095
|
topic_violation: import_zod6.z.boolean().optional()
|
|
1091
|
-
});
|
|
1096
|
+
}).passthrough();
|
|
1092
1097
|
|
|
1093
1098
|
// src/models/detection-reports.ts
|
|
1094
1099
|
var import_zod7 = require("zod");
|
|
@@ -1164,7 +1169,7 @@ var ContentErrorSchema = import_zod7.z.object({
|
|
|
1164
1169
|
var MaskedDataSchema = import_zod8.z.object({
|
|
1165
1170
|
data: import_zod8.z.string().optional(),
|
|
1166
1171
|
pattern_detections: import_zod8.z.array(PatternDetectionSchema).optional()
|
|
1167
|
-
});
|
|
1172
|
+
}).passthrough();
|
|
1168
1173
|
var IODetectedSchema = import_zod8.z.object({
|
|
1169
1174
|
url_cats: import_zod8.z.boolean().optional(),
|
|
1170
1175
|
dlp: import_zod8.z.boolean().optional(),
|
|
@@ -1182,7 +1187,7 @@ var ToolDetectedSchema = import_zod8.z.object({
|
|
|
1182
1187
|
summary: ScanSummarySchema.optional(),
|
|
1183
1188
|
input_detected: IODetectedSchema.optional(),
|
|
1184
1189
|
output_detected: IODetectedSchema.optional()
|
|
1185
|
-
});
|
|
1190
|
+
}).passthrough();
|
|
1186
1191
|
var ScanResponseSchema = import_zod8.z.object({
|
|
1187
1192
|
source: import_zod8.z.string().optional(),
|
|
1188
1193
|
report_id: import_zod8.z.string(),
|
|
@@ -1205,20 +1210,20 @@ var ScanResponseSchema = import_zod8.z.object({
|
|
|
1205
1210
|
tool_detected: ToolDetectedSchema.optional(),
|
|
1206
1211
|
created_at: import_zod8.z.string().optional(),
|
|
1207
1212
|
completed_at: import_zod8.z.string().optional()
|
|
1208
|
-
});
|
|
1213
|
+
}).passthrough();
|
|
1209
1214
|
|
|
1210
1215
|
// src/models/async-scan.ts
|
|
1211
1216
|
var import_zod9 = require("zod");
|
|
1212
1217
|
var AsyncScanObjectSchema = import_zod9.z.object({
|
|
1213
1218
|
req_id: import_zod9.z.number().int(),
|
|
1214
1219
|
scan_req: ScanRequestSchema
|
|
1215
|
-
});
|
|
1220
|
+
}).passthrough();
|
|
1216
1221
|
var AsyncScanResponseSchema = import_zod9.z.object({
|
|
1217
1222
|
received: import_zod9.z.string(),
|
|
1218
1223
|
scan_id: import_zod9.z.string(),
|
|
1219
1224
|
report_id: import_zod9.z.string().optional(),
|
|
1220
1225
|
source: import_zod9.z.string().optional()
|
|
1221
|
-
});
|
|
1226
|
+
}).passthrough();
|
|
1222
1227
|
|
|
1223
1228
|
// src/models/scan-id-result.ts
|
|
1224
1229
|
var import_zod10 = require("zod");
|
|
@@ -1228,7 +1233,7 @@ var ScanIdResultSchema = import_zod10.z.object({
|
|
|
1228
1233
|
status: import_zod10.z.string().optional(),
|
|
1229
1234
|
scan_id: import_zod10.z.string().optional(),
|
|
1230
1235
|
result: ScanResponseSchema.optional()
|
|
1231
|
-
});
|
|
1236
|
+
}).passthrough();
|
|
1232
1237
|
|
|
1233
1238
|
// src/models/threat-report.ts
|
|
1234
1239
|
var import_zod14 = require("zod");
|
|
@@ -1246,7 +1251,7 @@ var DlpReportSchema = import_zod11.z.object({
|
|
|
1246
1251
|
data_pattern_rule1_verdict: import_zod11.z.string().optional(),
|
|
1247
1252
|
data_pattern_rule2_verdict: import_zod11.z.string().optional(),
|
|
1248
1253
|
data_pattern_detection_offsets: import_zod11.z.array(DlpPatternDetectionSchema).optional()
|
|
1249
|
-
});
|
|
1254
|
+
}).passthrough();
|
|
1250
1255
|
|
|
1251
1256
|
// src/models/urlf-report.ts
|
|
1252
1257
|
var import_zod12 = require("zod");
|
|
@@ -1255,7 +1260,7 @@ var UrlfEntrySchema = import_zod12.z.object({
|
|
|
1255
1260
|
risk_level: import_zod12.z.string().optional(),
|
|
1256
1261
|
action: import_zod12.z.string().optional(),
|
|
1257
1262
|
categories: import_zod12.z.array(import_zod12.z.string()).optional()
|
|
1258
|
-
});
|
|
1263
|
+
}).passthrough();
|
|
1259
1264
|
|
|
1260
1265
|
// src/models/detection.ts
|
|
1261
1266
|
var DSDetailResultSchema = import_zod13.z.object({
|
|
@@ -1284,7 +1289,7 @@ var DetectionServiceResultSchema = import_zod13.z.object({
|
|
|
1284
1289
|
action: import_zod13.z.string().optional(),
|
|
1285
1290
|
metadata: DSResultMetadataSchema.optional(),
|
|
1286
1291
|
result_detail: DSDetailResultSchema.optional()
|
|
1287
|
-
});
|
|
1292
|
+
}).passthrough();
|
|
1288
1293
|
|
|
1289
1294
|
// src/models/threat-report.ts
|
|
1290
1295
|
var ThreatScanReportSchema = import_zod14.z.object({
|
|
@@ -1295,7 +1300,7 @@ var ThreatScanReportSchema = import_zod14.z.object({
|
|
|
1295
1300
|
transaction_id: import_zod14.z.string().optional(),
|
|
1296
1301
|
session_id: import_zod14.z.string().optional(),
|
|
1297
1302
|
detection_results: import_zod14.z.array(DetectionServiceResultSchema).optional()
|
|
1298
|
-
});
|
|
1303
|
+
}).passthrough();
|
|
1299
1304
|
|
|
1300
1305
|
// src/models/error-response.ts
|
|
1301
1306
|
var import_zod15 = require("zod");
|
|
@@ -3102,7 +3107,7 @@ var OAuthTokenResponseSchema = import_zod26.z.object({
|
|
|
3102
3107
|
token_type: import_zod26.z.string().optional(),
|
|
3103
3108
|
expires_in: import_zod26.z.number(),
|
|
3104
3109
|
scope: import_zod26.z.string().optional()
|
|
3105
|
-
});
|
|
3110
|
+
}).passthrough();
|
|
3106
3111
|
|
|
3107
3112
|
// src/management/oauth-client.ts
|
|
3108
3113
|
var DEFAULT_TOKEN_BUFFER_MS = 3e4;
|
|
@@ -4118,6 +4123,7 @@ var ModelSecurityScansClient = class {
|
|
|
4118
4123
|
* Delete labels from a scan by key.
|
|
4119
4124
|
* @param scanUuid - Scan UUID.
|
|
4120
4125
|
* @param keys - Label keys to delete.
|
|
4126
|
+
* @returns Resolves when the labels are deleted.
|
|
4121
4127
|
*/
|
|
4122
4128
|
async deleteLabels(scanUuid, keys) {
|
|
4123
4129
|
if (!isValidUuid(scanUuid)) {
|
|
@@ -4601,7 +4607,11 @@ var RedTeamScansClient = class {
|
|
|
4601
4607
|
this.oauthClient = opts.oauthClient;
|
|
4602
4608
|
this.numRetries = opts.numRetries;
|
|
4603
4609
|
}
|
|
4604
|
-
/**
|
|
4610
|
+
/**
|
|
4611
|
+
* Create a new red team scan job.
|
|
4612
|
+
* @param request - Job creation request body.
|
|
4613
|
+
* @returns The created job response.
|
|
4614
|
+
*/
|
|
4605
4615
|
async create(request) {
|
|
4606
4616
|
const res = await managementHttpRequest({
|
|
4607
4617
|
method: "POST",
|
|
@@ -5061,7 +5071,12 @@ var RedTeamTargetsClient = class {
|
|
|
5061
5071
|
this.oauthClient = opts.oauthClient;
|
|
5062
5072
|
this.numRetries = opts.numRetries;
|
|
5063
5073
|
}
|
|
5064
|
-
/**
|
|
5074
|
+
/**
|
|
5075
|
+
* Create a new target.
|
|
5076
|
+
* @param request - Target creation request body.
|
|
5077
|
+
* @param opts - Optional operation options (e.g. validate connection).
|
|
5078
|
+
* @returns The created target response.
|
|
5079
|
+
*/
|
|
5065
5080
|
async create(request, opts) {
|
|
5066
5081
|
const params = {};
|
|
5067
5082
|
if (opts?.validate !== void 0) params.validate = String(opts.validate);
|