@cdot65/prisma-airs-sdk 0.2.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3626 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21860 -3
- package/dist/index.d.ts +21860 -3
- package/dist/index.js +3403 -10
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/dist/index.cjs
CHANGED
|
@@ -28,32 +28,112 @@ __export(index_exports, {
|
|
|
28
28
|
Action: () => Action,
|
|
29
29
|
AgentMetaSchema: () => AgentMetaSchema,
|
|
30
30
|
AiProfileSchema: () => AiProfileSchema,
|
|
31
|
+
ApiEndpointType: () => ApiEndpointType,
|
|
31
32
|
AsyncScanObjectSchema: () => AsyncScanObjectSchema,
|
|
32
33
|
AsyncScanResponseSchema: () => AsyncScanResponseSchema,
|
|
34
|
+
AttackDetailResponseSchema: () => AttackDetailResponseSchema,
|
|
35
|
+
AttackListItemSchema: () => AttackListItemSchema,
|
|
36
|
+
AttackListResponseSchema: () => AttackListResponseSchema,
|
|
37
|
+
AttackMultiTurnDetailResponseSchema: () => AttackMultiTurnDetailResponseSchema,
|
|
38
|
+
AttackMultiTurnOutputSchema: () => AttackMultiTurnOutputSchema,
|
|
39
|
+
AttackOutputSchema: () => AttackOutputSchema,
|
|
40
|
+
AttackStatus: () => AttackStatus,
|
|
41
|
+
AttackType: () => AttackType,
|
|
42
|
+
AuthType: () => AuthType,
|
|
33
43
|
BEARER: () => BEARER,
|
|
44
|
+
BaseResponseSchema: () => BaseResponseSchema,
|
|
45
|
+
BrandSubCategory: () => BrandSubCategory,
|
|
34
46
|
Category: () => Category,
|
|
47
|
+
CategoryModelSchema: () => CategoryModelSchema,
|
|
48
|
+
CategoryReportSchema: () => CategoryReportSchema,
|
|
49
|
+
ComplianceReportSchema: () => ComplianceReportSchema,
|
|
50
|
+
ComplianceSubCategory: () => ComplianceSubCategory,
|
|
51
|
+
ComplianceTechniqueSchema: () => ComplianceTechniqueSchema,
|
|
35
52
|
Content: () => Content,
|
|
53
|
+
CountByNameSchema: () => CountByNameSchema,
|
|
54
|
+
CountedQuotaEnum: () => CountedQuotaEnum,
|
|
36
55
|
CreateCustomTopicRequestSchema: () => CreateCustomTopicRequestSchema,
|
|
37
56
|
CreateSecurityProfileRequestSchema: () => CreateSecurityProfileRequestSchema,
|
|
57
|
+
CustomAttackOutputSchema: () => CustomAttackOutputSchema,
|
|
58
|
+
CustomAttackReportResponseSchema: () => CustomAttackReportResponseSchema,
|
|
59
|
+
CustomAttacksListResponseSchema: () => CustomAttacksListResponseSchema,
|
|
60
|
+
CustomJobMetadataSchema: () => CustomJobMetadataSchema,
|
|
61
|
+
CustomPromptCreateRequestSchema: () => CustomPromptCreateRequestSchema,
|
|
62
|
+
CustomPromptListItemSchema: () => CustomPromptListItemSchema,
|
|
63
|
+
CustomPromptListSchema: () => CustomPromptListSchema,
|
|
64
|
+
CustomPromptResponseSchema: () => CustomPromptResponseSchema,
|
|
65
|
+
CustomPromptSetArchiveRequestSchema: () => CustomPromptSetArchiveRequestSchema,
|
|
66
|
+
CustomPromptSetCreateRequestSchema: () => CustomPromptSetCreateRequestSchema,
|
|
67
|
+
CustomPromptSetListActiveSchema: () => CustomPromptSetListActiveSchema,
|
|
68
|
+
CustomPromptSetListItemSchema: () => CustomPromptSetListItemSchema,
|
|
69
|
+
CustomPromptSetListSchema: () => CustomPromptSetListSchema,
|
|
70
|
+
CustomPromptSetReferenceSchema: () => CustomPromptSetReferenceSchema,
|
|
71
|
+
CustomPromptSetResponseSchema: () => CustomPromptSetResponseSchema,
|
|
72
|
+
CustomPromptSetUpdateRequestSchema: () => CustomPromptSetUpdateRequestSchema,
|
|
73
|
+
CustomPromptSetVersionInfoSchema: () => CustomPromptSetVersionInfoSchema,
|
|
74
|
+
CustomPromptUpdateRequestSchema: () => CustomPromptUpdateRequestSchema,
|
|
38
75
|
CustomTopicListResponseSchema: () => CustomTopicListResponseSchema,
|
|
39
76
|
CustomTopicSchema: () => CustomTopicSchema,
|
|
40
77
|
DEFAULT_ENDPOINT: () => DEFAULT_ENDPOINT,
|
|
41
78
|
DEFAULT_MGMT_ENDPOINT: () => DEFAULT_MGMT_ENDPOINT,
|
|
79
|
+
DEFAULT_MODEL_SEC_DATA_ENDPOINT: () => DEFAULT_MODEL_SEC_DATA_ENDPOINT,
|
|
80
|
+
DEFAULT_MODEL_SEC_MGMT_ENDPOINT: () => DEFAULT_MODEL_SEC_MGMT_ENDPOINT,
|
|
81
|
+
DEFAULT_RED_TEAM_DATA_ENDPOINT: () => DEFAULT_RED_TEAM_DATA_ENDPOINT,
|
|
82
|
+
DEFAULT_RED_TEAM_MGMT_ENDPOINT: () => DEFAULT_RED_TEAM_MGMT_ENDPOINT,
|
|
42
83
|
DEFAULT_TOKEN_ENDPOINT: () => DEFAULT_TOKEN_ENDPOINT,
|
|
43
84
|
DSDetailResultSchema: () => DSDetailResultSchema,
|
|
44
85
|
DSResultMetadataSchema: () => DSResultMetadataSchema,
|
|
86
|
+
DashboardOverviewResponseSchema: () => DashboardOverviewResponseSchema,
|
|
87
|
+
DateRangeFilter: () => DateRangeFilter,
|
|
45
88
|
DeleteProfileConflictSchema: () => DeleteProfileConflictSchema,
|
|
46
89
|
DeleteProfileResponseSchema: () => DeleteProfileResponseSchema,
|
|
47
90
|
DeleteTopicConflictSchema: () => DeleteTopicConflictSchema,
|
|
48
91
|
DeleteTopicResponseSchema: () => DeleteTopicResponseSchema,
|
|
49
92
|
DetectionServiceResultSchema: () => DetectionServiceResultSchema,
|
|
50
93
|
DlpReportSchema: () => DlpReportSchema,
|
|
94
|
+
DynamicJobMetadataSchema: () => DynamicJobMetadataSchema,
|
|
95
|
+
DynamicJobReportSchema: () => DynamicJobReportSchema,
|
|
96
|
+
DynamicJobReportStatsSchema: () => DynamicJobReportStatsSchema,
|
|
97
|
+
ErrorCodes: () => ErrorCodes,
|
|
98
|
+
ErrorLogListResponseSchema: () => ErrorLogListResponseSchema,
|
|
99
|
+
ErrorLogSchema: () => ErrorLogSchema,
|
|
51
100
|
ErrorResponseSchema: () => ErrorResponseSchema,
|
|
101
|
+
ErrorSource: () => ErrorSource,
|
|
52
102
|
ErrorType: () => ErrorType,
|
|
103
|
+
EvalOutcome: () => EvalOutcome,
|
|
104
|
+
EvalSummarySchema: () => EvalSummarySchema,
|
|
105
|
+
FileFormat: () => FileFormat,
|
|
106
|
+
FileListSchema: () => FileListSchema,
|
|
107
|
+
FileResponseSchema: () => FileResponseSchema,
|
|
108
|
+
FileScanDataSchema: () => FileScanDataSchema,
|
|
109
|
+
FileScanResult: () => FileScanResult,
|
|
110
|
+
FileType: () => FileType,
|
|
111
|
+
GoalListResponseSchema: () => GoalListResponseSchema,
|
|
112
|
+
GoalSchema: () => GoalSchema,
|
|
113
|
+
GoalType: () => GoalType,
|
|
114
|
+
GoalTypeQueryParam: () => GoalTypeQueryParam,
|
|
115
|
+
GuardrailAction: () => GuardrailAction,
|
|
53
116
|
HEADER_API_KEY: () => HEADER_API_KEY,
|
|
54
117
|
HEADER_AUTH_TOKEN: () => HEADER_AUTH_TOKEN,
|
|
118
|
+
HTTPValidationErrorSchema: () => HTTPValidationErrorSchema,
|
|
55
119
|
HTTP_FORCE_RETRY_STATUS_CODES: () => HTTP_FORCE_RETRY_STATUS_CODES,
|
|
56
120
|
IODetectedSchema: () => IODetectedSchema,
|
|
121
|
+
JobAbortResponseSchema: () => JobAbortResponseSchema,
|
|
122
|
+
JobCreateRequestSchema: () => JobCreateRequestSchema,
|
|
123
|
+
JobListResponseSchema: () => JobListResponseSchema,
|
|
124
|
+
JobResponseSchema: () => JobResponseSchema,
|
|
125
|
+
JobStatus: () => JobStatus,
|
|
126
|
+
JobStatusFilter: () => JobStatusFilter,
|
|
127
|
+
JobTimeRecordSchema: () => JobTimeRecordSchema,
|
|
128
|
+
JobType: () => JobType,
|
|
129
|
+
LabelKeyListSchema: () => LabelKeyListSchema,
|
|
130
|
+
LabelSchema: () => LabelSchema,
|
|
131
|
+
LabelValueListSchema: () => LabelValueListSchema,
|
|
132
|
+
LabelsCreateRequestSchema: () => LabelsCreateRequestSchema,
|
|
133
|
+
LabelsResponseSchema: () => LabelsResponseSchema,
|
|
134
|
+
ListModelSecurityGroupsResponseSchema: () => ListModelSecurityGroupsResponseSchema,
|
|
135
|
+
ListModelSecurityRuleInstancesResponseSchema: () => ListModelSecurityRuleInstancesResponseSchema,
|
|
136
|
+
ListModelSecurityRulesResponseSchema: () => ListModelSecurityRulesResponseSchema,
|
|
57
137
|
MAX_AI_PROFILE_NAME_LENGTH: () => MAX_AI_PROFILE_NAME_LENGTH,
|
|
58
138
|
MAX_API_KEY_LENGTH: () => MAX_API_KEY_LENGTH,
|
|
59
139
|
MAX_CONNECTION_POOL_SIZE: () => MAX_CONNECTION_POOL_SIZE,
|
|
@@ -79,28 +159,168 @@ __export(index_exports, {
|
|
|
79
159
|
MGMT_TOPIC_FORCE_PATH: () => MGMT_TOPIC_FORCE_PATH,
|
|
80
160
|
MGMT_TOPIC_PATH: () => MGMT_TOPIC_PATH,
|
|
81
161
|
MGMT_TSG_ID: () => MGMT_TSG_ID,
|
|
162
|
+
MODEL_SEC_CLIENT_ID: () => MODEL_SEC_CLIENT_ID,
|
|
163
|
+
MODEL_SEC_CLIENT_SECRET: () => MODEL_SEC_CLIENT_SECRET,
|
|
164
|
+
MODEL_SEC_DATA_ENDPOINT: () => MODEL_SEC_DATA_ENDPOINT,
|
|
165
|
+
MODEL_SEC_EVALUATIONS_PATH: () => MODEL_SEC_EVALUATIONS_PATH,
|
|
166
|
+
MODEL_SEC_MGMT_ENDPOINT: () => MODEL_SEC_MGMT_ENDPOINT,
|
|
167
|
+
MODEL_SEC_PYPI_AUTH_PATH: () => MODEL_SEC_PYPI_AUTH_PATH,
|
|
168
|
+
MODEL_SEC_SCANS_PATH: () => MODEL_SEC_SCANS_PATH,
|
|
169
|
+
MODEL_SEC_SECURITY_GROUPS_PATH: () => MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
170
|
+
MODEL_SEC_SECURITY_RULES_PATH: () => MODEL_SEC_SECURITY_RULES_PATH,
|
|
171
|
+
MODEL_SEC_TOKEN_ENDPOINT: () => MODEL_SEC_TOKEN_ENDPOINT,
|
|
172
|
+
MODEL_SEC_TSG_ID: () => MODEL_SEC_TSG_ID,
|
|
173
|
+
MODEL_SEC_VIOLATIONS_PATH: () => MODEL_SEC_VIOLATIONS_PATH,
|
|
82
174
|
ManagementClient: () => ManagementClient,
|
|
83
175
|
MaskedDataSchema: () => MaskedDataSchema,
|
|
84
176
|
MetadataSchema: () => MetadataSchema,
|
|
177
|
+
ModelScanIssueSchema: () => ModelScanIssueSchema,
|
|
178
|
+
ModelScanStatus: () => ModelScanStatus,
|
|
179
|
+
ModelSecurityClient: () => ModelSecurityClient,
|
|
180
|
+
ModelSecurityGroupCreateRequestSchema: () => ModelSecurityGroupCreateRequestSchema,
|
|
181
|
+
ModelSecurityGroupResponseSchema: () => ModelSecurityGroupResponseSchema,
|
|
182
|
+
ModelSecurityGroupState: () => ModelSecurityGroupState,
|
|
183
|
+
ModelSecurityGroupUpdateRequestSchema: () => ModelSecurityGroupUpdateRequestSchema,
|
|
184
|
+
ModelSecurityGroupsClient: () => ModelSecurityGroupsClient,
|
|
185
|
+
ModelSecurityPaginationSchema: () => ModelSecurityPaginationSchema,
|
|
186
|
+
ModelSecurityRuleInstanceResponseSchema: () => ModelSecurityRuleInstanceResponseSchema,
|
|
187
|
+
ModelSecurityRuleInstanceUpdateRequestSchema: () => ModelSecurityRuleInstanceUpdateRequestSchema,
|
|
188
|
+
ModelSecurityRuleResponseSchema: () => ModelSecurityRuleResponseSchema,
|
|
189
|
+
ModelSecurityRulesClient: () => ModelSecurityRulesClient,
|
|
190
|
+
ModelSecurityScansClient: () => ModelSecurityScansClient,
|
|
191
|
+
OAuthClient: () => OAuthClient,
|
|
85
192
|
PAYLOAD_HASH: () => PAYLOAD_HASH,
|
|
86
193
|
PolicySchema: () => PolicySchema,
|
|
194
|
+
PolicyType: () => PolicyType,
|
|
195
|
+
PrerequisiteModelSchema: () => PrerequisiteModelSchema,
|
|
87
196
|
ProfilesClient: () => ProfilesClient,
|
|
197
|
+
ProfilingStatus: () => ProfilingStatus,
|
|
198
|
+
PromptDetailResponseSchema: () => PromptDetailResponseSchema,
|
|
88
199
|
PromptDetectedSchema: () => PromptDetectedSchema,
|
|
89
200
|
PromptDetectionDetailsSchema: () => PromptDetectionDetailsSchema,
|
|
201
|
+
PromptSetStatsSchema: () => PromptSetStatsSchema,
|
|
202
|
+
PromptSetSummarySchema: () => PromptSetSummarySchema,
|
|
203
|
+
PromptSetsReportResponseSchema: () => PromptSetsReportResponseSchema,
|
|
204
|
+
PropertyAssignmentSchema: () => PropertyAssignmentSchema,
|
|
205
|
+
PropertyDefinitionSchema: () => PropertyDefinitionSchema,
|
|
206
|
+
PropertyNameCreateRequestSchema: () => PropertyNameCreateRequestSchema,
|
|
207
|
+
PropertyNamesListResponseSchema: () => PropertyNamesListResponseSchema,
|
|
208
|
+
PropertyStatisticSchema: () => PropertyStatisticSchema,
|
|
209
|
+
PropertyValueCreateRequestSchema: () => PropertyValueCreateRequestSchema,
|
|
210
|
+
PropertyValueStatisticSchema: () => PropertyValueStatisticSchema,
|
|
211
|
+
PropertyValuesMultipleResponseSchema: () => PropertyValuesMultipleResponseSchema,
|
|
212
|
+
PropertyValuesResponseSchema: () => PropertyValuesResponseSchema,
|
|
213
|
+
PyPIAuthResponseSchema: () => PyPIAuthResponseSchema,
|
|
214
|
+
QuotaDetailsSchema: () => QuotaDetailsSchema,
|
|
215
|
+
QuotaSummarySchema: () => QuotaSummarySchema,
|
|
216
|
+
RED_TEAM_CATEGORIES_PATH: () => RED_TEAM_CATEGORIES_PATH,
|
|
217
|
+
RED_TEAM_CLIENT_ID: () => RED_TEAM_CLIENT_ID,
|
|
218
|
+
RED_TEAM_CLIENT_SECRET: () => RED_TEAM_CLIENT_SECRET,
|
|
219
|
+
RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH: () => RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH,
|
|
220
|
+
RED_TEAM_CUSTOM_ATTACK_PATH: () => RED_TEAM_CUSTOM_ATTACK_PATH,
|
|
221
|
+
RED_TEAM_DASHBOARD_PATH: () => RED_TEAM_DASHBOARD_PATH,
|
|
222
|
+
RED_TEAM_DATA_ENDPOINT: () => RED_TEAM_DATA_ENDPOINT,
|
|
223
|
+
RED_TEAM_ERROR_LOG_PATH: () => RED_TEAM_ERROR_LOG_PATH,
|
|
224
|
+
RED_TEAM_MGMT_DASHBOARD_PATH: () => RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
225
|
+
RED_TEAM_MGMT_ENDPOINT: () => RED_TEAM_MGMT_ENDPOINT,
|
|
226
|
+
RED_TEAM_QUOTA_PATH: () => RED_TEAM_QUOTA_PATH,
|
|
227
|
+
RED_TEAM_REPORT_DYNAMIC_PATH: () => RED_TEAM_REPORT_DYNAMIC_PATH,
|
|
228
|
+
RED_TEAM_REPORT_PATH: () => RED_TEAM_REPORT_PATH,
|
|
229
|
+
RED_TEAM_REPORT_STATIC_PATH: () => RED_TEAM_REPORT_STATIC_PATH,
|
|
230
|
+
RED_TEAM_SCAN_PATH: () => RED_TEAM_SCAN_PATH,
|
|
231
|
+
RED_TEAM_SENTIMENT_PATH: () => RED_TEAM_SENTIMENT_PATH,
|
|
232
|
+
RED_TEAM_TARGET_PATH: () => RED_TEAM_TARGET_PATH,
|
|
233
|
+
RED_TEAM_TOKEN_ENDPOINT: () => RED_TEAM_TOKEN_ENDPOINT,
|
|
234
|
+
RED_TEAM_TSG_ID: () => RED_TEAM_TSG_ID,
|
|
235
|
+
RedTeamCategory: () => RedTeamCategory,
|
|
236
|
+
RedTeamClient: () => RedTeamClient,
|
|
237
|
+
RedTeamCustomAttackReportsClient: () => RedTeamCustomAttackReportsClient,
|
|
238
|
+
RedTeamCustomAttacksClient: () => RedTeamCustomAttacksClient,
|
|
239
|
+
RedTeamErrorType: () => RedTeamErrorType,
|
|
240
|
+
RedTeamPaginationSchema: () => RedTeamPaginationSchema,
|
|
241
|
+
RedTeamReportsClient: () => RedTeamReportsClient,
|
|
242
|
+
RedTeamScansClient: () => RedTeamScansClient,
|
|
243
|
+
RedTeamTargetsClient: () => RedTeamTargetsClient,
|
|
244
|
+
RemediationDetailSchema: () => RemediationDetailSchema,
|
|
245
|
+
RemediationResponseSchema: () => RemediationResponseSchema,
|
|
90
246
|
ResponseDetectedSchema: () => ResponseDetectedSchema,
|
|
91
247
|
ResponseDetectionDetailsSchema: () => ResponseDetectionDetailsSchema,
|
|
248
|
+
ResponseMode: () => ResponseMode,
|
|
249
|
+
RiskLevelSchema: () => RiskLevelSchema,
|
|
250
|
+
RiskRating: () => RiskRating,
|
|
251
|
+
RuleConfigurationSchema: () => RuleConfigurationSchema,
|
|
252
|
+
RuleEditableFieldDropdownSchema: () => RuleEditableFieldDropdownSchema,
|
|
253
|
+
RuleEditableFieldSchema: () => RuleEditableFieldSchema,
|
|
254
|
+
RuleEditableFieldType: () => RuleEditableFieldType,
|
|
255
|
+
RuleEvaluationListSchema: () => RuleEvaluationListSchema,
|
|
256
|
+
RuleEvaluationResponseSchema: () => RuleEvaluationResponseSchema,
|
|
257
|
+
RuleEvaluationResult: () => RuleEvaluationResult,
|
|
258
|
+
RuleFieldValueKey: () => RuleFieldValueKey,
|
|
259
|
+
RuleRemediationSchema: () => RuleRemediationSchema,
|
|
260
|
+
RuleState: () => RuleState,
|
|
261
|
+
RuleType: () => RuleType,
|
|
262
|
+
RuntimeSecurityPolicySchema: () => RuntimeSecurityPolicySchema,
|
|
263
|
+
RuntimeSecurityProfileResponseSchema: () => RuntimeSecurityProfileResponseSchema,
|
|
92
264
|
SCAN_REPORTS_PATH: () => SCAN_REPORTS_PATH,
|
|
93
265
|
SCAN_RESULTS_PATH: () => SCAN_RESULTS_PATH,
|
|
94
266
|
SDK_VERSION: () => SDK_VERSION,
|
|
95
267
|
SYNC_SCAN_PATH: () => SYNC_SCAN_PATH,
|
|
268
|
+
SafetySubCategory: () => SafetySubCategory,
|
|
269
|
+
ScanBaseResponseSchema: () => ScanBaseResponseSchema,
|
|
270
|
+
ScanCreateRequestSchema: () => ScanCreateRequestSchema,
|
|
271
|
+
ScanDetailsSchema: () => ScanDetailsSchema,
|
|
96
272
|
ScanIdResultSchema: () => ScanIdResultSchema,
|
|
273
|
+
ScanListSchema: () => ScanListSchema,
|
|
274
|
+
ScanOrigin: () => ScanOrigin,
|
|
97
275
|
ScanRequestContentsInnerSchema: () => ScanRequestContentsInnerSchema,
|
|
98
276
|
ScanRequestSchema: () => ScanRequestSchema,
|
|
99
277
|
ScanResponseSchema: () => ScanResponseSchema,
|
|
278
|
+
ScanStatisticsResponseSchema: () => ScanStatisticsResponseSchema,
|
|
100
279
|
ScanSummarySchema: () => ScanSummarySchema,
|
|
101
280
|
Scanner: () => Scanner,
|
|
281
|
+
ScoreTrendResponseSchema: () => ScoreTrendResponseSchema,
|
|
282
|
+
ScoreTrendSeriesSchema: () => ScoreTrendSeriesSchema,
|
|
102
283
|
SecurityProfileListResponseSchema: () => SecurityProfileListResponseSchema,
|
|
103
284
|
SecurityProfileSchema: () => SecurityProfileSchema,
|
|
285
|
+
SecuritySubCategory: () => SecuritySubCategory,
|
|
286
|
+
SentimentRequestSchema: () => SentimentRequestSchema,
|
|
287
|
+
SentimentResponseSchema: () => SentimentResponseSchema,
|
|
288
|
+
SeverityFilter: () => SeverityFilter,
|
|
289
|
+
SeverityReportSchema: () => SeverityReportSchema,
|
|
290
|
+
SeverityStatsSchema: () => SeverityStatsSchema,
|
|
291
|
+
SortByDateField: () => SortByDateField,
|
|
292
|
+
SortByFileField: () => SortByFileField,
|
|
293
|
+
SortDirection: () => SortDirection,
|
|
294
|
+
SourceType: () => SourceType,
|
|
295
|
+
StaticJobMetadataSchema: () => StaticJobMetadataSchema,
|
|
296
|
+
StaticJobRemediationRecommendationSchema: () => StaticJobRemediationRecommendationSchema,
|
|
297
|
+
StaticJobRemediationSchema: () => StaticJobRemediationSchema,
|
|
298
|
+
StaticJobReportSchema: () => StaticJobReportSchema,
|
|
299
|
+
StaticJobReportStatsSchema: () => StaticJobReportStatsSchema,
|
|
300
|
+
StatusQueryParam: () => StatusQueryParam,
|
|
301
|
+
StreamDetailResponseSchema: () => StreamDetailResponseSchema,
|
|
302
|
+
StreamIterationDataSchema: () => StreamIterationDataSchema,
|
|
303
|
+
StreamListResponseSchema: () => StreamListResponseSchema,
|
|
304
|
+
StreamType: () => StreamType,
|
|
305
|
+
SubCategoryModelSchema: () => SubCategoryModelSchema,
|
|
306
|
+
SubCategoryStatsSchema: () => SubCategoryStatsSchema,
|
|
307
|
+
TargetAdditionalContextSchema: () => TargetAdditionalContextSchema,
|
|
308
|
+
TargetBackgroundSchema: () => TargetBackgroundSchema,
|
|
309
|
+
TargetConnectionType: () => TargetConnectionType,
|
|
310
|
+
TargetContextUpdateSchema: () => TargetContextUpdateSchema,
|
|
311
|
+
TargetCreateRequestSchema: () => TargetCreateRequestSchema,
|
|
312
|
+
TargetJobRequestSchema: () => TargetJobRequestSchema,
|
|
313
|
+
TargetListItemSchema: () => TargetListItemSchema,
|
|
314
|
+
TargetListSchema: () => TargetListSchema,
|
|
315
|
+
TargetMetadataSchema: () => TargetMetadataSchema,
|
|
316
|
+
TargetProbeRequestSchema: () => TargetProbeRequestSchema,
|
|
317
|
+
TargetProfileResponseSchema: () => TargetProfileResponseSchema,
|
|
318
|
+
TargetReferenceSchema: () => TargetReferenceSchema,
|
|
319
|
+
TargetResponseSchema: () => TargetResponseSchema,
|
|
320
|
+
TargetStatus: () => TargetStatus,
|
|
321
|
+
TargetType: () => TargetType,
|
|
322
|
+
TargetUpdateRequestSchema: () => TargetUpdateRequestSchema,
|
|
323
|
+
ThreatCategory: () => ThreatCategory,
|
|
104
324
|
ThreatScanReportSchema: () => ThreatScanReportSchema,
|
|
105
325
|
ToolDetectedSchema: () => ToolDetectedSchema,
|
|
106
326
|
ToolEventMetadataSchema: () => ToolEventMetadataSchema,
|
|
@@ -108,7 +328,10 @@ __export(index_exports, {
|
|
|
108
328
|
TopicsClient: () => TopicsClient,
|
|
109
329
|
USER_AGENT: () => USER_AGENT,
|
|
110
330
|
UrlfEntrySchema: () => UrlfEntrySchema,
|
|
331
|
+
ValidationErrorSchema: () => ValidationErrorSchema,
|
|
111
332
|
Verdict: () => Verdict,
|
|
333
|
+
ViolationListSchema: () => ViolationListSchema,
|
|
334
|
+
ViolationResponseSchema: () => ViolationResponseSchema,
|
|
112
335
|
globalConfiguration: () => globalConfiguration,
|
|
113
336
|
init: () => init
|
|
114
337
|
});
|
|
@@ -139,7 +362,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
139
362
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
140
363
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
141
364
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
142
|
-
var SDK_VERSION = "0.
|
|
365
|
+
var SDK_VERSION = "0.5.0";
|
|
143
366
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
144
367
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
145
368
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -157,6 +380,41 @@ var MGMT_PROFILES_TSG_PATH = "/v1/mgmt/profiles/tsg";
|
|
|
157
380
|
var MGMT_TOPIC_PATH = "/v1/mgmt/topic";
|
|
158
381
|
var MGMT_TOPICS_TSG_PATH = "/v1/mgmt/topics/tsg";
|
|
159
382
|
var MGMT_TOPIC_FORCE_PATH = "/v1/mgmt/topic/force";
|
|
383
|
+
var DEFAULT_MODEL_SEC_DATA_ENDPOINT = "https://api.sase.paloaltonetworks.com/aims/data";
|
|
384
|
+
var DEFAULT_MODEL_SEC_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aims/mgmt";
|
|
385
|
+
var MODEL_SEC_CLIENT_ID = "PANW_MODEL_SEC_CLIENT_ID";
|
|
386
|
+
var MODEL_SEC_CLIENT_SECRET = "PANW_MODEL_SEC_CLIENT_SECRET";
|
|
387
|
+
var MODEL_SEC_TSG_ID = "PANW_MODEL_SEC_TSG_ID";
|
|
388
|
+
var MODEL_SEC_DATA_ENDPOINT = "PANW_MODEL_SEC_DATA_ENDPOINT";
|
|
389
|
+
var MODEL_SEC_MGMT_ENDPOINT = "PANW_MODEL_SEC_MGMT_ENDPOINT";
|
|
390
|
+
var MODEL_SEC_TOKEN_ENDPOINT = "PANW_MODEL_SEC_TOKEN_ENDPOINT";
|
|
391
|
+
var MODEL_SEC_SCANS_PATH = "/v1/scans";
|
|
392
|
+
var MODEL_SEC_EVALUATIONS_PATH = "/v1/evaluations";
|
|
393
|
+
var MODEL_SEC_VIOLATIONS_PATH = "/v1/violations";
|
|
394
|
+
var MODEL_SEC_SECURITY_GROUPS_PATH = "/v1/security-groups";
|
|
395
|
+
var MODEL_SEC_SECURITY_RULES_PATH = "/v1/security-rules";
|
|
396
|
+
var MODEL_SEC_PYPI_AUTH_PATH = "/v1/pypi/authenticate";
|
|
397
|
+
var DEFAULT_RED_TEAM_DATA_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/data-plane";
|
|
398
|
+
var DEFAULT_RED_TEAM_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/mgmt-plane";
|
|
399
|
+
var RED_TEAM_CLIENT_ID = "PANW_RED_TEAM_CLIENT_ID";
|
|
400
|
+
var RED_TEAM_CLIENT_SECRET = "PANW_RED_TEAM_CLIENT_SECRET";
|
|
401
|
+
var RED_TEAM_TSG_ID = "PANW_RED_TEAM_TSG_ID";
|
|
402
|
+
var RED_TEAM_DATA_ENDPOINT = "PANW_RED_TEAM_DATA_ENDPOINT";
|
|
403
|
+
var RED_TEAM_MGMT_ENDPOINT = "PANW_RED_TEAM_MGMT_ENDPOINT";
|
|
404
|
+
var RED_TEAM_TOKEN_ENDPOINT = "PANW_RED_TEAM_TOKEN_ENDPOINT";
|
|
405
|
+
var RED_TEAM_SCAN_PATH = "/v1/scan";
|
|
406
|
+
var RED_TEAM_CATEGORIES_PATH = "/v1/categories";
|
|
407
|
+
var RED_TEAM_REPORT_STATIC_PATH = "/v1/report/static";
|
|
408
|
+
var RED_TEAM_REPORT_DYNAMIC_PATH = "/v1/report/dynamic";
|
|
409
|
+
var RED_TEAM_REPORT_PATH = "/v1/report";
|
|
410
|
+
var RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH = "/v1/custom-attacks";
|
|
411
|
+
var RED_TEAM_DASHBOARD_PATH = "/v1/dashboard";
|
|
412
|
+
var RED_TEAM_QUOTA_PATH = "/v1/metering/quota";
|
|
413
|
+
var RED_TEAM_ERROR_LOG_PATH = "/v1/error-log/job";
|
|
414
|
+
var RED_TEAM_SENTIMENT_PATH = "/v1/sentiment";
|
|
415
|
+
var RED_TEAM_TARGET_PATH = "/v1/target";
|
|
416
|
+
var RED_TEAM_CUSTOM_ATTACK_PATH = "/v1/custom-attack";
|
|
417
|
+
var RED_TEAM_MGMT_DASHBOARD_PATH = "/v1/dashboard/overview";
|
|
160
418
|
|
|
161
419
|
// src/errors.ts
|
|
162
420
|
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
@@ -991,22 +1249,1413 @@ var DeleteTopicConflictSchema = import_zod16.z.object({
|
|
|
991
1249
|
)
|
|
992
1250
|
}).passthrough();
|
|
993
1251
|
|
|
994
|
-
// src/models/
|
|
1252
|
+
// src/models/model-security-enums.ts
|
|
1253
|
+
var ErrorCodes = {
|
|
1254
|
+
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
1255
|
+
SCAN_ERROR: "SCAN_ERROR",
|
|
1256
|
+
INVALID_RESPONSE: "INVALID_RESPONSE",
|
|
1257
|
+
ACCESS_DENIED: "ACCESS_DENIED",
|
|
1258
|
+
MISSING_CREDENTIALS: "MISSING_CREDENTIALS",
|
|
1259
|
+
NO_SUCH_KEY: "NO_SUCH_KEY",
|
|
1260
|
+
NO_SUCH_BUCKET: "NO_SUCH_BUCKET",
|
|
1261
|
+
INVALID_BUCKET_NAME: "INVALID_BUCKET_NAME",
|
|
1262
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
1263
|
+
SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE",
|
|
1264
|
+
INVALID_OBJECT_STATE: "INVALID_OBJECT_STATE",
|
|
1265
|
+
UNKNOWN_REMOTE_SERVICE_ERROR: "UNKNOWN_REMOTE_SERVICE_ERROR",
|
|
1266
|
+
UNSUPPORTED_REMOTE_STORAGE: "UNSUPPORTED_REMOTE_STORAGE",
|
|
1267
|
+
MISSING_ARTIFACTS: "MISSING_ARTIFACTS",
|
|
1268
|
+
WORKER_ERROR: "WORKER_ERROR",
|
|
1269
|
+
POLICY_EVAL_ERROR: "POLICY_EVAL_ERROR"
|
|
1270
|
+
};
|
|
1271
|
+
var EvalOutcome = {
|
|
1272
|
+
PENDING: "PENDING",
|
|
1273
|
+
ALLOWED: "ALLOWED",
|
|
1274
|
+
BLOCKED: "BLOCKED",
|
|
1275
|
+
ERROR: "ERROR"
|
|
1276
|
+
};
|
|
1277
|
+
var FileScanResult = {
|
|
1278
|
+
SKIPPED: "SKIPPED",
|
|
1279
|
+
SUCCESS: "SUCCESS",
|
|
1280
|
+
ERROR: "ERROR",
|
|
1281
|
+
FAILED: "FAILED"
|
|
1282
|
+
};
|
|
1283
|
+
var FileType = {
|
|
1284
|
+
DIRECTORY: "DIRECTORY",
|
|
1285
|
+
FILE: "FILE"
|
|
1286
|
+
};
|
|
1287
|
+
var ModelScanStatus = {
|
|
1288
|
+
SCANNED: "SCANNED",
|
|
1289
|
+
SKIPPED: "SKIPPED",
|
|
1290
|
+
ERROR: "ERROR"
|
|
1291
|
+
};
|
|
1292
|
+
var RuleEvaluationResult = {
|
|
1293
|
+
PASSED: "PASSED",
|
|
1294
|
+
FAILED: "FAILED",
|
|
1295
|
+
ERROR: "ERROR"
|
|
1296
|
+
};
|
|
1297
|
+
var RuleState = {
|
|
1298
|
+
DISABLED: "DISABLED",
|
|
1299
|
+
ALLOWING: "ALLOWING",
|
|
1300
|
+
BLOCKING: "BLOCKING"
|
|
1301
|
+
};
|
|
1302
|
+
var ScanOrigin = {
|
|
1303
|
+
MODEL_SECURITY_SDK: "MODEL_SECURITY_SDK",
|
|
1304
|
+
HUGGING_FACE: "HUGGING_FACE"
|
|
1305
|
+
};
|
|
1306
|
+
var SortByDateField = {
|
|
1307
|
+
CREATED_AT: "created_at",
|
|
1308
|
+
UPDATED_AT: "updated_at"
|
|
1309
|
+
};
|
|
1310
|
+
var SortByFileField = {
|
|
1311
|
+
PATH: "path",
|
|
1312
|
+
TYPE: "type"
|
|
1313
|
+
};
|
|
1314
|
+
var SortDirection = {
|
|
1315
|
+
ASC: "asc",
|
|
1316
|
+
DESC: "desc"
|
|
1317
|
+
};
|
|
1318
|
+
var SourceType = {
|
|
1319
|
+
LOCAL: "LOCAL",
|
|
1320
|
+
HUGGING_FACE: "HUGGING_FACE",
|
|
1321
|
+
S3: "S3",
|
|
1322
|
+
GCS: "GCS",
|
|
1323
|
+
AZURE: "AZURE",
|
|
1324
|
+
ARTIFACTORY: "ARTIFACTORY",
|
|
1325
|
+
GITLAB: "GITLAB",
|
|
1326
|
+
ALL: "ALL"
|
|
1327
|
+
};
|
|
1328
|
+
var ThreatCategory = {
|
|
1329
|
+
PAIT_ARV_100: "PAIT-ARV-100",
|
|
1330
|
+
PAIT_GGUF_100: "PAIT-GGUF-100",
|
|
1331
|
+
PAIT_GGUF_101: "PAIT-GGUF-101",
|
|
1332
|
+
PAIT_KERAS_100: "PAIT-KERAS-100",
|
|
1333
|
+
PAIT_KERAS_101: "PAIT-KERAS-101",
|
|
1334
|
+
PAIT_KERAS_102: "PAIT-KERAS-102",
|
|
1335
|
+
PAIT_JOBLIB_100: "PAIT-JOBLIB-100",
|
|
1336
|
+
PAIT_JOBLIB_101: "PAIT-JOBLIB-101",
|
|
1337
|
+
PAIT_PKL_100: "PAIT-PKL-100",
|
|
1338
|
+
PAIT_PKL_101: "PAIT-PKL-101",
|
|
1339
|
+
PAIT_PYTCH_100: "PAIT-PYTCH-100",
|
|
1340
|
+
PAIT_PYTCH_101: "PAIT-PYTCH-101",
|
|
1341
|
+
PAIT_EXDIR_100: "PAIT-EXDIR-100",
|
|
1342
|
+
PAIT_EXDIR_101: "PAIT-EXDIR-101",
|
|
1343
|
+
PAIT_ONNX_200: "PAIT-ONNX-200",
|
|
1344
|
+
PAIT_TF_200: "PAIT-TF-200",
|
|
1345
|
+
PAIT_LMAFL_300: "PAIT-LMAFL-300",
|
|
1346
|
+
PAIT_LITERT_300: "PAIT-LITERT-300",
|
|
1347
|
+
PAIT_LITERT_301: "PAIT-LITERT-301",
|
|
1348
|
+
PAIT_LITERT_302: "PAIT-LITERT-302",
|
|
1349
|
+
PAIT_KERAS_300: "PAIT-KERAS-300",
|
|
1350
|
+
PAIT_KERAS_301: "PAIT-KERAS-301",
|
|
1351
|
+
PAIT_TCHST_300: "PAIT-TCHST-300",
|
|
1352
|
+
PAIT_TCHST_301: "PAIT-TCHST-301",
|
|
1353
|
+
PAIT_TF_300: "PAIT-TF-300",
|
|
1354
|
+
PAIT_TF_301: "PAIT-TF-301",
|
|
1355
|
+
PAIT_TF_302: "PAIT-TF-302",
|
|
1356
|
+
PAIT_TMT_300: "PAIT-TMT-300",
|
|
1357
|
+
PAIT_TMT_301: "PAIT-TMT-301",
|
|
1358
|
+
UNAPPROVED_FORMATS: "UNAPPROVED_FORMATS"
|
|
1359
|
+
};
|
|
1360
|
+
var ModelSecurityGroupState = {
|
|
1361
|
+
PENDING: "PENDING",
|
|
1362
|
+
ACTIVE: "ACTIVE"
|
|
1363
|
+
};
|
|
1364
|
+
var RuleType = {
|
|
1365
|
+
METADATA: "METADATA",
|
|
1366
|
+
ARTIFACT: "ARTIFACT"
|
|
1367
|
+
};
|
|
1368
|
+
var RuleEditableFieldType = {
|
|
1369
|
+
SELECT: "SELECT",
|
|
1370
|
+
LIST: "LIST"
|
|
1371
|
+
};
|
|
1372
|
+
var RuleFieldValueKey = {
|
|
1373
|
+
APPROVED_FORMATS: "approved_formats",
|
|
1374
|
+
APPROVED_LOCATIONS: "approved_locations",
|
|
1375
|
+
APPROVED_LICENSES: "approved_licenses",
|
|
1376
|
+
DENY_ORGS: "deny_orgs",
|
|
1377
|
+
DENIED_ORG_MODELS: "denied_org_models",
|
|
1378
|
+
APPROVED_ORG_MODELS: "approved_org_models"
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
// src/models/model-security.ts
|
|
995
1382
|
var import_zod17 = require("zod");
|
|
996
|
-
var
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1383
|
+
var ModelSecurityPaginationSchema = import_zod17.z.object({
|
|
1384
|
+
total_items: import_zod17.z.number().int().nullable().optional()
|
|
1385
|
+
}).passthrough();
|
|
1386
|
+
var LabelSchema = import_zod17.z.object({
|
|
1387
|
+
key: import_zod17.z.string(),
|
|
1388
|
+
value: import_zod17.z.string()
|
|
1389
|
+
});
|
|
1390
|
+
var LabelsCreateRequestSchema = import_zod17.z.object({
|
|
1391
|
+
labels: import_zod17.z.array(LabelSchema)
|
|
1392
|
+
});
|
|
1393
|
+
var LabelsResponseSchema = import_zod17.z.object({}).passthrough();
|
|
1394
|
+
var LabelKeyListSchema = import_zod17.z.object({
|
|
1395
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1396
|
+
keys: import_zod17.z.array(import_zod17.z.string())
|
|
1397
|
+
}).passthrough();
|
|
1398
|
+
var LabelValueListSchema = import_zod17.z.object({
|
|
1399
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1400
|
+
values: import_zod17.z.array(import_zod17.z.string())
|
|
1401
|
+
}).passthrough();
|
|
1402
|
+
var EvalSummarySchema = import_zod17.z.object({
|
|
1403
|
+
rules_failed: import_zod17.z.number().int().optional().default(0),
|
|
1404
|
+
rules_passed: import_zod17.z.number().int().optional().default(0),
|
|
1405
|
+
total_rules: import_zod17.z.number().int().optional().default(0)
|
|
1406
|
+
}).passthrough();
|
|
1407
|
+
var ModelScanIssueSchema = import_zod17.z.object({
|
|
1408
|
+
description: import_zod17.z.string(),
|
|
1409
|
+
source: import_zod17.z.string(),
|
|
1410
|
+
threat: import_zod17.z.string().nullable().optional(),
|
|
1411
|
+
module: import_zod17.z.string().nullable().optional(),
|
|
1412
|
+
operator: import_zod17.z.string().nullable().optional()
|
|
1413
|
+
}).passthrough();
|
|
1414
|
+
var FileScanDataSchema = import_zod17.z.object({
|
|
1415
|
+
file_path: import_zod17.z.string(),
|
|
1416
|
+
modelscan_status: import_zod17.z.string(),
|
|
1417
|
+
blob_id: import_zod17.z.string(),
|
|
1418
|
+
error_message: import_zod17.z.string().nullable().optional(),
|
|
1419
|
+
formats: import_zod17.z.array(import_zod17.z.string()).nullable().optional(),
|
|
1420
|
+
issues_detected: import_zod17.z.array(ModelScanIssueSchema).nullable().optional()
|
|
1421
|
+
}).passthrough();
|
|
1422
|
+
var ScanDetailsSchema = import_zod17.z.object({
|
|
1423
|
+
scanner_version: import_zod17.z.string(),
|
|
1424
|
+
time_started: import_zod17.z.string(),
|
|
1425
|
+
files: import_zod17.z.array(FileScanDataSchema),
|
|
1426
|
+
total_files_scanned: import_zod17.z.number().int(),
|
|
1427
|
+
total_files_skipped: import_zod17.z.number().int(),
|
|
1428
|
+
model_formats: import_zod17.z.array(import_zod17.z.string()),
|
|
1429
|
+
model_size_bytes: import_zod17.z.number().int(),
|
|
1430
|
+
scan_duration_ms: import_zod17.z.number().int(),
|
|
1431
|
+
error_code: import_zod17.z.string().nullable().optional(),
|
|
1432
|
+
error_message: import_zod17.z.string().nullable().optional()
|
|
1433
|
+
});
|
|
1434
|
+
var ScanCreateRequestSchema = import_zod17.z.object({
|
|
1435
|
+
model_uri: import_zod17.z.string(),
|
|
1436
|
+
security_group_uuid: import_zod17.z.string(),
|
|
1437
|
+
scan_origin: import_zod17.z.string(),
|
|
1438
|
+
allow_patterns: import_zod17.z.array(import_zod17.z.string()).nullable().optional(),
|
|
1439
|
+
ignore_patterns: import_zod17.z.array(import_zod17.z.string()).nullable().optional(),
|
|
1440
|
+
labels: import_zod17.z.array(LabelSchema).nullable().optional(),
|
|
1441
|
+
model_author: import_zod17.z.string().nullable().optional(),
|
|
1442
|
+
model_name: import_zod17.z.string().nullable().optional(),
|
|
1443
|
+
model_version: import_zod17.z.string().nullable().optional(),
|
|
1444
|
+
scan_details: ScanDetailsSchema.nullable().optional()
|
|
1445
|
+
});
|
|
1446
|
+
var ScanBaseResponseSchema = import_zod17.z.object({
|
|
1447
|
+
uuid: import_zod17.z.string(),
|
|
1448
|
+
tsg_id: import_zod17.z.string(),
|
|
1449
|
+
created_at: import_zod17.z.string(),
|
|
1450
|
+
updated_at: import_zod17.z.string(),
|
|
1451
|
+
model_uri: import_zod17.z.string(),
|
|
1452
|
+
owner: import_zod17.z.string(),
|
|
1453
|
+
scan_origin: import_zod17.z.string(),
|
|
1454
|
+
security_group_uuid: import_zod17.z.string(),
|
|
1455
|
+
security_group_name: import_zod17.z.string(),
|
|
1456
|
+
model_version_uuid: import_zod17.z.string(),
|
|
1457
|
+
eval_outcome: import_zod17.z.string(),
|
|
1458
|
+
source_type: import_zod17.z.string(),
|
|
1459
|
+
created_by: import_zod17.z.string().nullable().optional(),
|
|
1460
|
+
enabled_rule_count_snapshot: import_zod17.z.number().int().nullable().optional(),
|
|
1461
|
+
error_code: import_zod17.z.string().nullable().optional(),
|
|
1462
|
+
error_message: import_zod17.z.string().nullable().optional(),
|
|
1463
|
+
eval_summary: EvalSummarySchema.nullable().optional(),
|
|
1464
|
+
labels: import_zod17.z.array(LabelSchema).optional(),
|
|
1465
|
+
model_formats: import_zod17.z.array(import_zod17.z.string()).nullable().optional(),
|
|
1466
|
+
scanner_version: import_zod17.z.string().nullable().optional(),
|
|
1467
|
+
time_started: import_zod17.z.string().nullable().optional(),
|
|
1468
|
+
total_files_scanned: import_zod17.z.number().int().nullable().optional(),
|
|
1469
|
+
total_files_skipped: import_zod17.z.number().int().nullable().optional()
|
|
1470
|
+
}).passthrough();
|
|
1471
|
+
var ScanListSchema = import_zod17.z.object({
|
|
1472
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1473
|
+
scans: import_zod17.z.array(ScanBaseResponseSchema)
|
|
1474
|
+
}).passthrough();
|
|
1475
|
+
var FileResponseSchema = import_zod17.z.object({
|
|
1476
|
+
uuid: import_zod17.z.string(),
|
|
1477
|
+
tsg_id: import_zod17.z.string(),
|
|
1478
|
+
created_at: import_zod17.z.string(),
|
|
1479
|
+
updated_at: import_zod17.z.string(),
|
|
1480
|
+
path: import_zod17.z.string(),
|
|
1481
|
+
parent_path: import_zod17.z.string(),
|
|
1482
|
+
type: import_zod17.z.string(),
|
|
1483
|
+
result: import_zod17.z.string(),
|
|
1484
|
+
model_version_uuid: import_zod17.z.string(),
|
|
1485
|
+
blob_id: import_zod17.z.string().nullable().optional(),
|
|
1486
|
+
formats: import_zod17.z.array(import_zod17.z.string()).nullable().optional(),
|
|
1487
|
+
scan_uuid: import_zod17.z.string().nullable().optional()
|
|
1488
|
+
}).passthrough();
|
|
1489
|
+
var FileListSchema = import_zod17.z.object({
|
|
1490
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1491
|
+
files: import_zod17.z.array(FileResponseSchema)
|
|
1492
|
+
}).passthrough();
|
|
1493
|
+
var RuleEvaluationResponseSchema = import_zod17.z.object({
|
|
1494
|
+
uuid: import_zod17.z.string(),
|
|
1495
|
+
tsg_id: import_zod17.z.string(),
|
|
1496
|
+
created_at: import_zod17.z.string(),
|
|
1497
|
+
updated_at: import_zod17.z.string(),
|
|
1498
|
+
result: import_zod17.z.string(),
|
|
1499
|
+
violation_count: import_zod17.z.number().int(),
|
|
1500
|
+
rule_instance_uuid: import_zod17.z.string(),
|
|
1501
|
+
scan_uuid: import_zod17.z.string(),
|
|
1502
|
+
rule_name: import_zod17.z.string(),
|
|
1503
|
+
rule_description: import_zod17.z.string(),
|
|
1504
|
+
rule_instance_state: import_zod17.z.string()
|
|
1505
|
+
}).passthrough();
|
|
1506
|
+
var RuleEvaluationListSchema = import_zod17.z.object({
|
|
1507
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1508
|
+
evaluations: import_zod17.z.array(RuleEvaluationResponseSchema)
|
|
1509
|
+
}).passthrough();
|
|
1510
|
+
var ViolationResponseSchema = import_zod17.z.object({
|
|
1511
|
+
uuid: import_zod17.z.string(),
|
|
1512
|
+
tsg_id: import_zod17.z.string(),
|
|
1513
|
+
created_at: import_zod17.z.string(),
|
|
1514
|
+
updated_at: import_zod17.z.string(),
|
|
1515
|
+
description: import_zod17.z.string(),
|
|
1516
|
+
rule_instance_uuid: import_zod17.z.string(),
|
|
1517
|
+
rule_name: import_zod17.z.string(),
|
|
1518
|
+
rule_description: import_zod17.z.string(),
|
|
1519
|
+
rule_instance_state: import_zod17.z.string(),
|
|
1520
|
+
file: import_zod17.z.string().nullable().optional(),
|
|
1521
|
+
hash: import_zod17.z.string().nullable().optional(),
|
|
1522
|
+
module: import_zod17.z.string().nullable().optional(),
|
|
1523
|
+
operator: import_zod17.z.string().nullable().optional(),
|
|
1524
|
+
threat: import_zod17.z.string().nullable().optional(),
|
|
1525
|
+
threat_description: import_zod17.z.string().nullable().optional()
|
|
1526
|
+
}).passthrough();
|
|
1527
|
+
var ViolationListSchema = import_zod17.z.object({
|
|
1528
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1529
|
+
violations: import_zod17.z.array(ViolationResponseSchema)
|
|
1530
|
+
}).passthrough();
|
|
1531
|
+
var RuleEditableFieldDropdownSchema = import_zod17.z.object({
|
|
1532
|
+
value: import_zod17.z.string(),
|
|
1533
|
+
label: import_zod17.z.string()
|
|
1534
|
+
}).passthrough();
|
|
1535
|
+
var RuleEditableFieldSchema = import_zod17.z.object({
|
|
1536
|
+
attribute_name: import_zod17.z.string(),
|
|
1537
|
+
type: import_zod17.z.string(),
|
|
1538
|
+
display_name: import_zod17.z.string(),
|
|
1539
|
+
display_type: import_zod17.z.string(),
|
|
1540
|
+
description: import_zod17.z.string().nullable().optional(),
|
|
1541
|
+
dropdown_values: import_zod17.z.array(RuleEditableFieldDropdownSchema).nullable().optional()
|
|
1542
|
+
}).passthrough();
|
|
1543
|
+
var RuleRemediationSchema = import_zod17.z.object({
|
|
1544
|
+
description: import_zod17.z.string(),
|
|
1545
|
+
steps: import_zod17.z.array(import_zod17.z.string()),
|
|
1546
|
+
url: import_zod17.z.string()
|
|
1547
|
+
}).passthrough();
|
|
1548
|
+
var RuleConfigurationSchema = import_zod17.z.object({
|
|
1549
|
+
field_values: import_zod17.z.record(import_zod17.z.unknown()).optional(),
|
|
1550
|
+
state: import_zod17.z.string().nullable().optional()
|
|
1551
|
+
}).passthrough();
|
|
1552
|
+
var ModelSecurityRuleResponseSchema = import_zod17.z.object({
|
|
1553
|
+
uuid: import_zod17.z.string(),
|
|
1554
|
+
name: import_zod17.z.string(),
|
|
1555
|
+
description: import_zod17.z.string(),
|
|
1556
|
+
rule_type: import_zod17.z.string(),
|
|
1557
|
+
compatible_sources: import_zod17.z.array(import_zod17.z.string()),
|
|
1558
|
+
default_state: import_zod17.z.string(),
|
|
1559
|
+
remediation: RuleRemediationSchema,
|
|
1560
|
+
editable_fields: import_zod17.z.array(RuleEditableFieldSchema),
|
|
1561
|
+
constant_values: import_zod17.z.record(import_zod17.z.unknown()),
|
|
1562
|
+
default_values: import_zod17.z.record(import_zod17.z.unknown())
|
|
1563
|
+
}).passthrough();
|
|
1564
|
+
var ListModelSecurityRulesResponseSchema = import_zod17.z.object({
|
|
1565
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1566
|
+
rules: import_zod17.z.array(ModelSecurityRuleResponseSchema)
|
|
1567
|
+
}).passthrough();
|
|
1568
|
+
var ModelSecurityRuleInstanceResponseSchema = import_zod17.z.object({
|
|
1569
|
+
uuid: import_zod17.z.string(),
|
|
1570
|
+
tsg_id: import_zod17.z.string(),
|
|
1571
|
+
created_at: import_zod17.z.string(),
|
|
1572
|
+
updated_at: import_zod17.z.string(),
|
|
1573
|
+
security_group_uuid: import_zod17.z.string(),
|
|
1574
|
+
security_rule_uuid: import_zod17.z.string(),
|
|
1575
|
+
state: import_zod17.z.string(),
|
|
1576
|
+
rule: ModelSecurityRuleResponseSchema,
|
|
1577
|
+
field_values: import_zod17.z.record(import_zod17.z.unknown()).optional()
|
|
1578
|
+
}).passthrough();
|
|
1579
|
+
var ModelSecurityRuleInstanceUpdateRequestSchema = import_zod17.z.object({
|
|
1580
|
+
security_group_uuid: import_zod17.z.string(),
|
|
1581
|
+
state: import_zod17.z.string().nullable().optional(),
|
|
1582
|
+
field_values: import_zod17.z.record(import_zod17.z.unknown()).nullable().optional()
|
|
1583
|
+
});
|
|
1584
|
+
var ListModelSecurityRuleInstancesResponseSchema = import_zod17.z.object({
|
|
1585
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1586
|
+
rule_instances: import_zod17.z.array(ModelSecurityRuleInstanceResponseSchema)
|
|
1587
|
+
}).passthrough();
|
|
1588
|
+
var ModelSecurityGroupCreateRequestSchema = import_zod17.z.object({
|
|
1589
|
+
name: import_zod17.z.string(),
|
|
1590
|
+
source_type: import_zod17.z.string(),
|
|
1591
|
+
description: import_zod17.z.string().optional().default(""),
|
|
1592
|
+
rule_configurations: import_zod17.z.record(RuleConfigurationSchema).optional()
|
|
1593
|
+
});
|
|
1594
|
+
var ModelSecurityGroupResponseSchema = import_zod17.z.object({
|
|
1595
|
+
uuid: import_zod17.z.string(),
|
|
1596
|
+
tsg_id: import_zod17.z.string(),
|
|
1597
|
+
created_at: import_zod17.z.string(),
|
|
1598
|
+
updated_at: import_zod17.z.string(),
|
|
1599
|
+
name: import_zod17.z.string(),
|
|
1600
|
+
description: import_zod17.z.string(),
|
|
1601
|
+
source_type: import_zod17.z.string(),
|
|
1602
|
+
state: import_zod17.z.string(),
|
|
1603
|
+
is_tombstone: import_zod17.z.boolean()
|
|
1604
|
+
}).passthrough();
|
|
1605
|
+
var ModelSecurityGroupUpdateRequestSchema = import_zod17.z.object({
|
|
1606
|
+
name: import_zod17.z.string().nullable().optional(),
|
|
1607
|
+
description: import_zod17.z.string().nullable().optional()
|
|
1608
|
+
});
|
|
1609
|
+
var ListModelSecurityGroupsResponseSchema = import_zod17.z.object({
|
|
1610
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1611
|
+
security_groups: import_zod17.z.array(ModelSecurityGroupResponseSchema)
|
|
1612
|
+
}).passthrough();
|
|
1613
|
+
var PyPIAuthResponseSchema = import_zod17.z.object({
|
|
1614
|
+
url: import_zod17.z.string(),
|
|
1615
|
+
expires_at: import_zod17.z.string()
|
|
1616
|
+
}).passthrough();
|
|
1617
|
+
|
|
1618
|
+
// src/models/red-team-enums.ts
|
|
1619
|
+
var ApiEndpointType = {
|
|
1620
|
+
PUBLIC: "PUBLIC",
|
|
1621
|
+
PRIVATE: "PRIVATE",
|
|
1622
|
+
NETWORK_BROKER: "NETWORK_BROKER"
|
|
1623
|
+
};
|
|
1624
|
+
var AttackStatus = {
|
|
1625
|
+
INIT: "INIT",
|
|
1626
|
+
ATTACK: "ATTACK",
|
|
1627
|
+
DETECTION: "DETECTION",
|
|
1628
|
+
REPORT: "REPORT",
|
|
1629
|
+
COMPLETED: "COMPLETED",
|
|
1630
|
+
FAILED: "FAILED"
|
|
1631
|
+
};
|
|
1632
|
+
var AttackType = {
|
|
1633
|
+
NORMAL: "NORMAL",
|
|
1634
|
+
CUSTOM: "CUSTOM"
|
|
1635
|
+
};
|
|
1636
|
+
var AuthType = {
|
|
1637
|
+
OAUTH: "OAUTH",
|
|
1638
|
+
ACCESS_TOKEN: "ACCESS_TOKEN"
|
|
1639
|
+
};
|
|
1640
|
+
var BrandSubCategory = {
|
|
1641
|
+
COMPETITOR_ENDORSEMENTS: "COMPETITOR_ENDORSEMENTS",
|
|
1642
|
+
BRAND_TARNISHING_SELF_CRITICISM: "BRAND_TARNISHING_SELF_CRITICISM",
|
|
1643
|
+
DISCRIMINATING_CLAIMS: "DISCRIMINATING_CLAIMS",
|
|
1644
|
+
POLITICAL_ENDORSEMENTS: "POLITICAL_ENDORSEMENTS"
|
|
1645
|
+
};
|
|
1646
|
+
var ComplianceSubCategory = {
|
|
1647
|
+
OWASP: "OWASP",
|
|
1648
|
+
MITRE_ATLAS: "MITRE_ATLAS",
|
|
1649
|
+
NIST: "NIST",
|
|
1650
|
+
DASF_V2: "DASF_V2"
|
|
1651
|
+
};
|
|
1652
|
+
var CountedQuotaEnum = {
|
|
1653
|
+
HELD: "HELD",
|
|
1654
|
+
COUNTED: "COUNTED",
|
|
1655
|
+
NOT_COUNTED: "NOT_COUNTED"
|
|
1656
|
+
};
|
|
1657
|
+
var DateRangeFilter = {
|
|
1658
|
+
LAST_7_DAYS: "LAST_7_DAYS",
|
|
1659
|
+
LAST_15_DAYS: "LAST_15_DAYS",
|
|
1660
|
+
LAST_30_DAYS: "LAST_30_DAYS",
|
|
1661
|
+
ALL: "ALL"
|
|
1662
|
+
};
|
|
1663
|
+
var ErrorSource = {
|
|
1664
|
+
TARGET: "TARGET",
|
|
1665
|
+
JOB: "JOB",
|
|
1666
|
+
SYSTEM: "SYSTEM",
|
|
1667
|
+
VALIDATION: "VALIDATION",
|
|
1668
|
+
TARGET_PROFILING: "TARGET_PROFILING"
|
|
1669
|
+
};
|
|
1670
|
+
var RedTeamErrorType = {
|
|
1671
|
+
CONTENT_FILTER: "CONTENT_FILTER",
|
|
1672
|
+
RATE_LIMIT: "RATE_LIMIT",
|
|
1673
|
+
AUTHENTICATION: "AUTHENTICATION",
|
|
1674
|
+
NETWORK: "NETWORK",
|
|
1675
|
+
VALIDATION: "VALIDATION",
|
|
1676
|
+
NETWORK_CHANNEL: "NETWORK_CHANNEL",
|
|
1677
|
+
UNKNOWN: "UNKNOWN"
|
|
1678
|
+
};
|
|
1679
|
+
var FileFormat = {
|
|
1680
|
+
CSV: "CSV",
|
|
1681
|
+
JSON: "JSON",
|
|
1682
|
+
ALL: "ALL"
|
|
1683
|
+
};
|
|
1684
|
+
var GoalType = {
|
|
1685
|
+
BASE: "BASE",
|
|
1686
|
+
TOOL_MISUSE: "TOOL_MISUSE",
|
|
1687
|
+
GOAL_MANIPULATION: "GOAL_MANIPULATION"
|
|
1688
|
+
};
|
|
1689
|
+
var GoalTypeQueryParam = {
|
|
1690
|
+
AGENT: "AGENT",
|
|
1691
|
+
HUMAN_AUGMENTED: "HUMAN_AUGMENTED"
|
|
1692
|
+
};
|
|
1693
|
+
var GuardrailAction = {
|
|
1694
|
+
ALLOW: "ALLOW",
|
|
1695
|
+
BLOCK: "BLOCK"
|
|
1696
|
+
};
|
|
1697
|
+
var JobStatus = {
|
|
1698
|
+
INIT: "INIT",
|
|
1699
|
+
QUEUED: "QUEUED",
|
|
1700
|
+
RUNNING: "RUNNING",
|
|
1701
|
+
COMPLETED: "COMPLETED",
|
|
1702
|
+
PARTIALLY_COMPLETE: "PARTIALLY_COMPLETE",
|
|
1703
|
+
FAILED: "FAILED",
|
|
1704
|
+
ABORTED: "ABORTED"
|
|
1705
|
+
};
|
|
1706
|
+
var JobStatusFilter = {
|
|
1707
|
+
QUEUED: "QUEUED",
|
|
1708
|
+
RUNNING: "RUNNING",
|
|
1709
|
+
COMPLETED: "COMPLETED",
|
|
1710
|
+
PARTIALLY_COMPLETE: "PARTIALLY_COMPLETE",
|
|
1711
|
+
FAILED: "FAILED",
|
|
1712
|
+
ABORTED: "ABORTED"
|
|
1713
|
+
};
|
|
1714
|
+
var JobType = {
|
|
1715
|
+
STATIC: "STATIC",
|
|
1716
|
+
DYNAMIC: "DYNAMIC",
|
|
1717
|
+
CUSTOM: "CUSTOM"
|
|
1718
|
+
};
|
|
1719
|
+
var PolicyType = {
|
|
1720
|
+
PROMPT_INJECTION: "PROMPT_INJECTION",
|
|
1721
|
+
TOXIC_CONTENT: "TOXIC_CONTENT",
|
|
1722
|
+
CUSTOM_TOPIC_GUARDRAILS: "CUSTOM_TOPIC_GUARDRAILS",
|
|
1723
|
+
MALICIOUS_CODE_DETECTION: "MALICIOUS_CODE_DETECTION",
|
|
1724
|
+
MALICIOUS_URL_DETECTION: "MALICIOUS_URL_DETECTION",
|
|
1725
|
+
SENSITIVE_DATA_PROTECTION: "SENSITIVE_DATA_PROTECTION"
|
|
1726
|
+
};
|
|
1727
|
+
var ProfilingStatus = {
|
|
1728
|
+
INIT: "INIT",
|
|
1729
|
+
QUEUED: "QUEUED",
|
|
1730
|
+
IN_PROGRESS: "IN_PROGRESS",
|
|
1731
|
+
COMPLETED: "COMPLETED",
|
|
1732
|
+
FAILED: "FAILED"
|
|
1733
|
+
};
|
|
1734
|
+
var RedTeamCategory = {
|
|
1735
|
+
SECURITY: "SECURITY",
|
|
1736
|
+
SAFETY: "SAFETY",
|
|
1737
|
+
COMPLIANCE: "COMPLIANCE",
|
|
1738
|
+
BRAND: "BRAND"
|
|
1739
|
+
};
|
|
1740
|
+
var ResponseMode = {
|
|
1741
|
+
REST: "REST",
|
|
1742
|
+
STREAMING: "STREAMING"
|
|
1743
|
+
};
|
|
1744
|
+
var RiskRating = {
|
|
1745
|
+
LOW: "LOW",
|
|
1746
|
+
MEDIUM: "MEDIUM",
|
|
1747
|
+
HIGH: "HIGH",
|
|
1748
|
+
CRITICAL: "CRITICAL"
|
|
1749
|
+
};
|
|
1750
|
+
var SafetySubCategory = {
|
|
1751
|
+
BIAS: "BIAS",
|
|
1752
|
+
CBRN: "CBRN",
|
|
1753
|
+
CYBERCRIME: "CYBERCRIME",
|
|
1754
|
+
DRUGS: "DRUGS",
|
|
1755
|
+
HATE_TOXIC_ABUSE: "HATE_TOXIC_ABUSE",
|
|
1756
|
+
NON_VIOLENT_CRIMES: "NON_VIOLENT_CRIMES",
|
|
1757
|
+
POLITICAL: "POLITICAL",
|
|
1758
|
+
SELF_HARM: "SELF_HARM",
|
|
1759
|
+
SEXUAL: "SEXUAL",
|
|
1760
|
+
VIOLENT_CRIMES_WEAPONS: "VIOLENT_CRIMES_WEAPONS"
|
|
1761
|
+
};
|
|
1762
|
+
var SecuritySubCategory = {
|
|
1763
|
+
ADVERSARIAL_SUFFIX: "ADVERSARIAL_SUFFIX",
|
|
1764
|
+
EVASION: "EVASION",
|
|
1765
|
+
INDIRECT_PROMPT_INJECTION: "INDIRECT_PROMPT_INJECTION",
|
|
1766
|
+
JAILBREAK: "JAILBREAK",
|
|
1767
|
+
MULTI_TURN: "MULTI_TURN",
|
|
1768
|
+
PROMPT_INJECTION: "PROMPT_INJECTION",
|
|
1769
|
+
REMOTE_CODE_EXECUTION: "REMOTE_CODE_EXECUTION",
|
|
1770
|
+
SYSTEM_PROMPT_LEAK: "SYSTEM_PROMPT_LEAK",
|
|
1771
|
+
TOOL_LEAK: "TOOL_LEAK",
|
|
1772
|
+
MALWARE_GENERATION: "MALWARE_GENERATION"
|
|
1773
|
+
};
|
|
1774
|
+
var SeverityFilter = {
|
|
1775
|
+
LOW: "LOW",
|
|
1776
|
+
MEDIUM: "MEDIUM",
|
|
1777
|
+
HIGH: "HIGH",
|
|
1778
|
+
CRITICAL: "CRITICAL"
|
|
1779
|
+
};
|
|
1780
|
+
var StatusQueryParam = {
|
|
1781
|
+
SUCCESSFUL: "SUCCESSFUL",
|
|
1782
|
+
FAILED: "FAILED"
|
|
1783
|
+
};
|
|
1784
|
+
var StreamType = {
|
|
1785
|
+
NORMAL: "NORMAL",
|
|
1786
|
+
ADVERSARIAL: "ADVERSARIAL"
|
|
1787
|
+
};
|
|
1788
|
+
var TargetConnectionType = {
|
|
1789
|
+
DATABRICKS: "DATABRICKS",
|
|
1790
|
+
BEDROCK: "BEDROCK",
|
|
1791
|
+
OPENAI: "OPENAI",
|
|
1792
|
+
HUGGING_FACE: "HUGGING_FACE",
|
|
1793
|
+
CUSTOM: "CUSTOM",
|
|
1794
|
+
REST: "REST",
|
|
1795
|
+
STREAMING: "STREAMING"
|
|
1796
|
+
};
|
|
1797
|
+
var TargetStatus = {
|
|
1798
|
+
DRAFT: "DRAFT",
|
|
1799
|
+
VALIDATING: "VALIDATING",
|
|
1800
|
+
VALIDATED: "VALIDATED",
|
|
1801
|
+
ACTIVE: "ACTIVE",
|
|
1802
|
+
INACTIVE: "INACTIVE",
|
|
1803
|
+
FAILED: "FAILED",
|
|
1804
|
+
PENDING_AUTH: "PENDING_AUTH"
|
|
1805
|
+
};
|
|
1806
|
+
var TargetType = {
|
|
1807
|
+
APPLICATION: "APPLICATION",
|
|
1808
|
+
AGENT: "AGENT",
|
|
1809
|
+
MODEL: "MODEL"
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1812
|
+
// src/models/red-team.ts
|
|
1813
|
+
var import_zod18 = require("zod");
|
|
1814
|
+
var RedTeamPaginationSchema = import_zod18.z.object({ total_items: import_zod18.z.number().int().nullable().optional() }).passthrough();
|
|
1815
|
+
var CountByNameSchema = import_zod18.z.object({ name: import_zod18.z.string(), count: import_zod18.z.number().int() });
|
|
1816
|
+
var ValidationErrorSchema = import_zod18.z.object({
|
|
1817
|
+
loc: import_zod18.z.array(import_zod18.z.union([import_zod18.z.string(), import_zod18.z.number()])),
|
|
1818
|
+
msg: import_zod18.z.string(),
|
|
1819
|
+
type: import_zod18.z.string()
|
|
1820
|
+
});
|
|
1821
|
+
var HTTPValidationErrorSchema = import_zod18.z.object({ detail: import_zod18.z.array(ValidationErrorSchema).optional() }).passthrough();
|
|
1822
|
+
var TargetBackgroundSchema = import_zod18.z.object({
|
|
1823
|
+
industry: import_zod18.z.unknown().optional(),
|
|
1824
|
+
use_case: import_zod18.z.unknown().optional(),
|
|
1825
|
+
competitors: import_zod18.z.unknown().optional()
|
|
1826
|
+
}).passthrough();
|
|
1827
|
+
var TargetAdditionalContextSchema = import_zod18.z.object({
|
|
1828
|
+
base_model: import_zod18.z.unknown().optional(),
|
|
1829
|
+
core_architecture: import_zod18.z.unknown().optional(),
|
|
1830
|
+
system_prompt: import_zod18.z.unknown().optional(),
|
|
1831
|
+
languages_supported: import_zod18.z.unknown().optional(),
|
|
1832
|
+
banned_keywords: import_zod18.z.unknown().optional(),
|
|
1833
|
+
tools_accessible: import_zod18.z.unknown().optional()
|
|
1834
|
+
}).passthrough();
|
|
1835
|
+
var TargetMetadataSchema = import_zod18.z.object({
|
|
1836
|
+
multi_turn: import_zod18.z.boolean().optional(),
|
|
1837
|
+
multi_turn_error_message: import_zod18.z.unknown().optional(),
|
|
1838
|
+
rate_limit: import_zod18.z.unknown().optional(),
|
|
1839
|
+
rate_limit_enabled: import_zod18.z.boolean().optional(),
|
|
1840
|
+
rate_limit_error_code: import_zod18.z.unknown().optional(),
|
|
1841
|
+
rate_limit_error_json: import_zod18.z.unknown().optional(),
|
|
1842
|
+
rate_limit_error_message: import_zod18.z.unknown().optional(),
|
|
1843
|
+
content_filter_enabled: import_zod18.z.boolean().optional(),
|
|
1844
|
+
content_filter_error_code: import_zod18.z.unknown().optional(),
|
|
1845
|
+
content_filter_error_json: import_zod18.z.unknown().optional(),
|
|
1846
|
+
content_filter_error_message: import_zod18.z.unknown().optional(),
|
|
1847
|
+
probe_message: import_zod18.z.string().optional(),
|
|
1848
|
+
request_timeout: import_zod18.z.number().optional()
|
|
1849
|
+
}).passthrough();
|
|
1850
|
+
var TargetJobRequestSchema = import_zod18.z.object({
|
|
1851
|
+
uuid: import_zod18.z.string(),
|
|
1852
|
+
version: import_zod18.z.number().int().nullable().optional()
|
|
1853
|
+
});
|
|
1854
|
+
var JobTimeRecordSchema = import_zod18.z.object({
|
|
1855
|
+
queued_at: import_zod18.z.string().nullable().optional(),
|
|
1856
|
+
started_at: import_zod18.z.string().nullable().optional(),
|
|
1857
|
+
completed_at: import_zod18.z.string().nullable().optional(),
|
|
1858
|
+
time_taken: import_zod18.z.string().nullable().optional()
|
|
1859
|
+
}).passthrough();
|
|
1860
|
+
var StaticJobMetadataSchema = import_zod18.z.object({
|
|
1861
|
+
categories: import_zod18.z.record(import_zod18.z.unknown()),
|
|
1862
|
+
rate_limit_enabled: import_zod18.z.boolean().optional(),
|
|
1863
|
+
rate_limit: import_zod18.z.number().int().nullable().optional(),
|
|
1864
|
+
rate_limit_error_code: import_zod18.z.number().int().nullable().optional(),
|
|
1865
|
+
rate_limit_error_message: import_zod18.z.string().nullable().optional(),
|
|
1866
|
+
rate_limit_error_json: import_zod18.z.unknown().optional(),
|
|
1867
|
+
content_filter_enabled: import_zod18.z.boolean().optional(),
|
|
1868
|
+
content_filter_error_code: import_zod18.z.number().int().nullable().optional(),
|
|
1869
|
+
content_filter_error_message: import_zod18.z.string().nullable().optional(),
|
|
1870
|
+
content_filter_error_json: import_zod18.z.unknown().optional()
|
|
1871
|
+
}).passthrough();
|
|
1872
|
+
var DynamicJobMetadataSchema = import_zod18.z.object({
|
|
1873
|
+
rate_limit_enabled: import_zod18.z.boolean().optional(),
|
|
1874
|
+
rate_limit: import_zod18.z.number().int().nullable().optional(),
|
|
1875
|
+
rate_limit_error_code: import_zod18.z.number().int().nullable().optional(),
|
|
1876
|
+
rate_limit_error_message: import_zod18.z.string().nullable().optional(),
|
|
1877
|
+
rate_limit_error_json: import_zod18.z.unknown().optional(),
|
|
1878
|
+
content_filter_enabled: import_zod18.z.boolean().optional(),
|
|
1879
|
+
content_filter_error_code: import_zod18.z.number().int().nullable().optional(),
|
|
1880
|
+
content_filter_error_message: import_zod18.z.string().nullable().optional(),
|
|
1881
|
+
content_filter_error_json: import_zod18.z.unknown().optional(),
|
|
1882
|
+
stream_breadth: import_zod18.z.number().int().optional(),
|
|
1883
|
+
stream_depth: import_zod18.z.number().int().optional(),
|
|
1884
|
+
max_tokens: import_zod18.z.number().int().optional(),
|
|
1885
|
+
context_size: import_zod18.z.number().int().optional(),
|
|
1886
|
+
attack_goals: import_zod18.z.array(import_zod18.z.unknown()).optional(),
|
|
1887
|
+
base_model: import_zod18.z.string().nullable().optional(),
|
|
1888
|
+
use_case: import_zod18.z.string().nullable().optional(),
|
|
1889
|
+
system_prompt: import_zod18.z.string().nullable().optional()
|
|
1890
|
+
}).passthrough();
|
|
1891
|
+
var CustomJobMetadataSchema = import_zod18.z.object({
|
|
1892
|
+
custom_prompt_sets: import_zod18.z.array(import_zod18.z.unknown()),
|
|
1893
|
+
rate_limit_enabled: import_zod18.z.boolean().optional(),
|
|
1894
|
+
rate_limit: import_zod18.z.number().int().nullable().optional(),
|
|
1895
|
+
rate_limit_error_code: import_zod18.z.number().int().nullable().optional(),
|
|
1896
|
+
rate_limit_error_message: import_zod18.z.string().nullable().optional(),
|
|
1897
|
+
rate_limit_error_json: import_zod18.z.unknown().optional(),
|
|
1898
|
+
content_filter_enabled: import_zod18.z.boolean().optional(),
|
|
1899
|
+
content_filter_error_code: import_zod18.z.number().int().nullable().optional(),
|
|
1900
|
+
content_filter_error_message: import_zod18.z.string().nullable().optional(),
|
|
1901
|
+
content_filter_error_json: import_zod18.z.unknown().optional()
|
|
1902
|
+
}).passthrough();
|
|
1903
|
+
var JobCreateRequestSchema = import_zod18.z.object({
|
|
1904
|
+
name: import_zod18.z.string(),
|
|
1905
|
+
target: TargetJobRequestSchema,
|
|
1906
|
+
job_type: import_zod18.z.string(),
|
|
1907
|
+
job_metadata: import_zod18.z.union([
|
|
1908
|
+
StaticJobMetadataSchema,
|
|
1909
|
+
DynamicJobMetadataSchema,
|
|
1910
|
+
CustomJobMetadataSchema
|
|
1911
|
+
]),
|
|
1912
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
1913
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional()
|
|
1914
|
+
});
|
|
1915
|
+
var StaticJobReportStatsSchema = import_zod18.z.object({
|
|
1916
|
+
output_completion_percentage: import_zod18.z.number(),
|
|
1917
|
+
partial_report_unlocked: import_zod18.z.boolean().optional(),
|
|
1918
|
+
partial_report_unlocked_at: import_zod18.z.string().nullable().optional(),
|
|
1919
|
+
report_summary: import_zod18.z.string().nullable().optional()
|
|
1920
|
+
}).passthrough();
|
|
1921
|
+
var DynamicJobReportStatsSchema = import_zod18.z.object({
|
|
1922
|
+
total_goals: import_zod18.z.number().int().optional(),
|
|
1923
|
+
total_streams: import_zod18.z.number().int().optional(),
|
|
1924
|
+
total_threats: import_zod18.z.number().int().optional(),
|
|
1925
|
+
goals_achieved: import_zod18.z.number().int().optional(),
|
|
1926
|
+
report_summary: import_zod18.z.string().nullable().optional()
|
|
1927
|
+
}).passthrough();
|
|
1928
|
+
var TargetReferenceSchema = import_zod18.z.object({
|
|
1929
|
+
uuid: import_zod18.z.string(),
|
|
1930
|
+
tsg_id: import_zod18.z.string(),
|
|
1931
|
+
name: import_zod18.z.string(),
|
|
1932
|
+
description: import_zod18.z.string().nullable().optional(),
|
|
1933
|
+
target_type: import_zod18.z.string().nullable().optional(),
|
|
1934
|
+
connection_type: import_zod18.z.string().nullable().optional(),
|
|
1935
|
+
api_endpoint_type: import_zod18.z.string().nullable().optional(),
|
|
1936
|
+
response_mode: import_zod18.z.string().nullable().optional(),
|
|
1937
|
+
session_supported: import_zod18.z.boolean().optional(),
|
|
1938
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional(),
|
|
1939
|
+
status: import_zod18.z.string(),
|
|
1940
|
+
active: import_zod18.z.boolean(),
|
|
1941
|
+
validated: import_zod18.z.boolean(),
|
|
1942
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
1943
|
+
secret_version: import_zod18.z.string().nullable().optional(),
|
|
1944
|
+
created_by_user_id: import_zod18.z.string().nullable().optional(),
|
|
1945
|
+
updated_by_user_id: import_zod18.z.string().nullable().optional(),
|
|
1946
|
+
created_at: import_zod18.z.string(),
|
|
1947
|
+
updated_at: import_zod18.z.string(),
|
|
1948
|
+
target_metadata: TargetMetadataSchema.optional(),
|
|
1949
|
+
target_background: TargetBackgroundSchema.nullable().optional(),
|
|
1950
|
+
profiling_status: import_zod18.z.string().nullable().optional(),
|
|
1951
|
+
additional_context: TargetAdditionalContextSchema.nullable().optional()
|
|
1952
|
+
}).passthrough();
|
|
1953
|
+
var JobResponseSchema = import_zod18.z.object({
|
|
1954
|
+
uuid: import_zod18.z.string(),
|
|
1955
|
+
tsg_id: import_zod18.z.string(),
|
|
1956
|
+
name: import_zod18.z.string(),
|
|
1957
|
+
target: TargetReferenceSchema,
|
|
1958
|
+
job_type: import_zod18.z.string(),
|
|
1959
|
+
job_metadata: import_zod18.z.unknown(),
|
|
1960
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
1961
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional(),
|
|
1962
|
+
target_id: import_zod18.z.string(),
|
|
1963
|
+
target_type: import_zod18.z.string(),
|
|
1964
|
+
total: import_zod18.z.number().int().nullable().optional(),
|
|
1965
|
+
completed: import_zod18.z.number().int().nullable().optional(),
|
|
1966
|
+
status: import_zod18.z.string().optional(),
|
|
1967
|
+
score: import_zod18.z.number().nullable().optional(),
|
|
1968
|
+
asr: import_zod18.z.number().nullable().optional(),
|
|
1969
|
+
time_record: JobTimeRecordSchema.nullable().optional(),
|
|
1970
|
+
created_at: import_zod18.z.string().nullable().optional(),
|
|
1971
|
+
updated_at: import_zod18.z.string().nullable().optional(),
|
|
1972
|
+
created_by_user_id: import_zod18.z.string().nullable().optional(),
|
|
1973
|
+
report_stats: import_zod18.z.unknown().optional(),
|
|
1974
|
+
metering_quota_uuid: import_zod18.z.string().nullable().optional(),
|
|
1975
|
+
counted_towards_quota: import_zod18.z.string().optional(),
|
|
1976
|
+
invocation_id: import_zod18.z.string().nullable().optional()
|
|
1977
|
+
}).passthrough();
|
|
1978
|
+
var JobListResponseSchema = import_zod18.z.object({
|
|
1979
|
+
pagination: RedTeamPaginationSchema,
|
|
1980
|
+
data: import_zod18.z.array(JobResponseSchema)
|
|
1981
|
+
}).passthrough();
|
|
1982
|
+
var JobAbortResponseSchema = import_zod18.z.object({
|
|
1983
|
+
job_id: import_zod18.z.string(),
|
|
1984
|
+
message: import_zod18.z.string()
|
|
1985
|
+
});
|
|
1986
|
+
var PrerequisiteModelSchema = import_zod18.z.object({
|
|
1987
|
+
id: import_zod18.z.string(),
|
|
1988
|
+
display_name: import_zod18.z.string(),
|
|
1989
|
+
description: import_zod18.z.string()
|
|
1990
|
+
});
|
|
1991
|
+
var SubCategoryModelSchema = import_zod18.z.object({
|
|
1992
|
+
id: import_zod18.z.string(),
|
|
1993
|
+
display_name: import_zod18.z.string(),
|
|
1994
|
+
description: import_zod18.z.string(),
|
|
1995
|
+
preselect: import_zod18.z.boolean().optional(),
|
|
1996
|
+
prerequisites: import_zod18.z.array(PrerequisiteModelSchema).nullable().optional(),
|
|
1997
|
+
active: import_zod18.z.boolean().optional()
|
|
1998
|
+
}).passthrough();
|
|
1999
|
+
var CategoryModelSchema = import_zod18.z.object({
|
|
2000
|
+
id: import_zod18.z.string(),
|
|
2001
|
+
display_name: import_zod18.z.string(),
|
|
2002
|
+
description: import_zod18.z.string(),
|
|
2003
|
+
preselect: import_zod18.z.boolean().optional(),
|
|
2004
|
+
sub_categories: import_zod18.z.array(SubCategoryModelSchema)
|
|
2005
|
+
}).passthrough();
|
|
2006
|
+
var AttackOutputSchema = import_zod18.z.object({
|
|
2007
|
+
uuid: import_zod18.z.string(),
|
|
2008
|
+
tsg_id: import_zod18.z.string(),
|
|
2009
|
+
attack_id: import_zod18.z.string(),
|
|
2010
|
+
job_id: import_zod18.z.string(),
|
|
2011
|
+
target_id: import_zod18.z.string(),
|
|
2012
|
+
output: import_zod18.z.string(),
|
|
2013
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2014
|
+
marked_safe: import_zod18.z.boolean().nullable().optional()
|
|
2015
|
+
}).passthrough();
|
|
2016
|
+
var AttackMultiTurnOutputSchema = import_zod18.z.object({
|
|
2017
|
+
uuid: import_zod18.z.string(),
|
|
2018
|
+
tsg_id: import_zod18.z.string(),
|
|
2019
|
+
attack_id: import_zod18.z.string(),
|
|
2020
|
+
job_id: import_zod18.z.string(),
|
|
2021
|
+
target_id: import_zod18.z.string(),
|
|
2022
|
+
output: import_zod18.z.string(),
|
|
2023
|
+
prompt: import_zod18.z.string(),
|
|
2024
|
+
turn: import_zod18.z.number().int(),
|
|
2025
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2026
|
+
marked_safe: import_zod18.z.boolean().nullable().optional(),
|
|
2027
|
+
generation: import_zod18.z.number().int().optional(),
|
|
2028
|
+
multi_turn: import_zod18.z.boolean().optional()
|
|
2029
|
+
}).passthrough();
|
|
2030
|
+
var AttackListItemSchema = import_zod18.z.object({
|
|
2031
|
+
uuid: import_zod18.z.string(),
|
|
2032
|
+
tsg_id: import_zod18.z.string(),
|
|
2033
|
+
job_id: import_zod18.z.string(),
|
|
2034
|
+
target_id: import_zod18.z.string(),
|
|
2035
|
+
prompt: import_zod18.z.string(),
|
|
2036
|
+
prompt_mapping_id: import_zod18.z.string(),
|
|
2037
|
+
prompt_id: import_zod18.z.string(),
|
|
2038
|
+
category: import_zod18.z.string(),
|
|
2039
|
+
sub_category: import_zod18.z.string(),
|
|
2040
|
+
category_display_name: import_zod18.z.string(),
|
|
2041
|
+
sub_category_display_name: import_zod18.z.string(),
|
|
2042
|
+
status: import_zod18.z.string().optional(),
|
|
2043
|
+
marked_safe: import_zod18.z.boolean().nullable().optional(),
|
|
2044
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).optional(),
|
|
2045
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2046
|
+
attack_type: import_zod18.z.string().optional(),
|
|
2047
|
+
multi_turn: import_zod18.z.boolean().optional(),
|
|
2048
|
+
asr: import_zod18.z.number().nullable().optional(),
|
|
2049
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
2050
|
+
severity: import_zod18.z.string().optional()
|
|
2051
|
+
}).passthrough();
|
|
2052
|
+
var AttackListResponseSchema = import_zod18.z.object({
|
|
2053
|
+
pagination: RedTeamPaginationSchema,
|
|
2054
|
+
data: import_zod18.z.array(AttackListItemSchema)
|
|
2055
|
+
}).passthrough();
|
|
2056
|
+
var AttackDetailResponseSchema = import_zod18.z.object({
|
|
2057
|
+
uuid: import_zod18.z.string(),
|
|
2058
|
+
tsg_id: import_zod18.z.string(),
|
|
2059
|
+
job_id: import_zod18.z.string(),
|
|
2060
|
+
target_id: import_zod18.z.string(),
|
|
2061
|
+
prompt: import_zod18.z.string(),
|
|
2062
|
+
prompt_mapping_id: import_zod18.z.string(),
|
|
2063
|
+
prompt_id: import_zod18.z.string(),
|
|
2064
|
+
category: import_zod18.z.string(),
|
|
2065
|
+
sub_category: import_zod18.z.string(),
|
|
2066
|
+
category_display_name: import_zod18.z.string(),
|
|
2067
|
+
sub_category_display_name: import_zod18.z.string(),
|
|
2068
|
+
compliance_frameworks: import_zod18.z.array(import_zod18.z.unknown()),
|
|
2069
|
+
goal: import_zod18.z.string().nullable(),
|
|
2070
|
+
status: import_zod18.z.string().optional(),
|
|
2071
|
+
marked_safe: import_zod18.z.boolean().nullable().optional(),
|
|
2072
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).optional(),
|
|
2073
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2074
|
+
attack_type: import_zod18.z.string().optional(),
|
|
2075
|
+
multi_turn: import_zod18.z.boolean().optional(),
|
|
2076
|
+
asr: import_zod18.z.number().nullable().optional(),
|
|
2077
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
2078
|
+
severity: import_zod18.z.string().optional(),
|
|
2079
|
+
outputs: import_zod18.z.array(AttackOutputSchema).optional()
|
|
2080
|
+
}).passthrough();
|
|
2081
|
+
var AttackMultiTurnDetailResponseSchema = import_zod18.z.object({
|
|
2082
|
+
uuid: import_zod18.z.string(),
|
|
2083
|
+
tsg_id: import_zod18.z.string(),
|
|
2084
|
+
job_id: import_zod18.z.string(),
|
|
2085
|
+
target_id: import_zod18.z.string(),
|
|
2086
|
+
prompt: import_zod18.z.string(),
|
|
2087
|
+
prompt_mapping_id: import_zod18.z.string(),
|
|
2088
|
+
prompt_id: import_zod18.z.string(),
|
|
2089
|
+
category: import_zod18.z.string(),
|
|
2090
|
+
sub_category: import_zod18.z.string(),
|
|
2091
|
+
category_display_name: import_zod18.z.string(),
|
|
2092
|
+
sub_category_display_name: import_zod18.z.string(),
|
|
2093
|
+
compliance_frameworks: import_zod18.z.array(import_zod18.z.unknown()),
|
|
2094
|
+
goal: import_zod18.z.string().nullable(),
|
|
2095
|
+
status: import_zod18.z.string().optional(),
|
|
2096
|
+
marked_safe: import_zod18.z.boolean().nullable().optional(),
|
|
2097
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).optional(),
|
|
2098
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2099
|
+
attack_type: import_zod18.z.string().optional(),
|
|
2100
|
+
multi_turn: import_zod18.z.boolean().optional(),
|
|
2101
|
+
asr: import_zod18.z.number().nullable().optional(),
|
|
2102
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
2103
|
+
severity: import_zod18.z.string().optional(),
|
|
2104
|
+
outputs: import_zod18.z.array(AttackMultiTurnOutputSchema).optional()
|
|
2105
|
+
}).passthrough();
|
|
2106
|
+
var SubCategoryStatsSchema = import_zod18.z.object({
|
|
2107
|
+
id: import_zod18.z.string(),
|
|
2108
|
+
display_name: import_zod18.z.string(),
|
|
2109
|
+
description: import_zod18.z.string(),
|
|
2110
|
+
preselect: import_zod18.z.boolean().optional(),
|
|
2111
|
+
prerequisites: import_zod18.z.array(PrerequisiteModelSchema).nullable().optional(),
|
|
2112
|
+
active: import_zod18.z.boolean().optional(),
|
|
2113
|
+
successful: import_zod18.z.number().int(),
|
|
2114
|
+
failed: import_zod18.z.number().int(),
|
|
2115
|
+
total: import_zod18.z.number().int().optional()
|
|
2116
|
+
}).passthrough();
|
|
2117
|
+
var CategoryReportSchema = import_zod18.z.object({
|
|
2118
|
+
id: import_zod18.z.string(),
|
|
2119
|
+
display_name: import_zod18.z.string(),
|
|
2120
|
+
description: import_zod18.z.string(),
|
|
2121
|
+
preselect: import_zod18.z.boolean().optional(),
|
|
2122
|
+
sub_categories: import_zod18.z.array(SubCategoryStatsSchema),
|
|
2123
|
+
asr: import_zod18.z.number(),
|
|
2124
|
+
total_prompts: import_zod18.z.number().int(),
|
|
2125
|
+
total_attacks: import_zod18.z.number().int(),
|
|
2126
|
+
successful: import_zod18.z.number().int(),
|
|
2127
|
+
failed: import_zod18.z.number().int()
|
|
2128
|
+
}).passthrough();
|
|
2129
|
+
var SeverityStatsSchema = import_zod18.z.object({
|
|
2130
|
+
severity: import_zod18.z.string(),
|
|
2131
|
+
successful: import_zod18.z.number().int().optional(),
|
|
2132
|
+
failed: import_zod18.z.number().int().optional()
|
|
2133
|
+
}).passthrough();
|
|
2134
|
+
var SeverityReportSchema = import_zod18.z.object({
|
|
2135
|
+
stats: import_zod18.z.array(SeverityStatsSchema),
|
|
2136
|
+
successful: import_zod18.z.number().int().optional(),
|
|
2137
|
+
failed: import_zod18.z.number().int().optional(),
|
|
2138
|
+
total_attacks: import_zod18.z.number().int().optional()
|
|
2139
|
+
}).passthrough();
|
|
2140
|
+
var ComplianceTechniqueSchema = import_zod18.z.object({
|
|
2141
|
+
id: import_zod18.z.string(),
|
|
2142
|
+
display_name: import_zod18.z.string(),
|
|
2143
|
+
compliance_id: import_zod18.z.string(),
|
|
2144
|
+
description: import_zod18.z.string(),
|
|
2145
|
+
link: import_zod18.z.string(),
|
|
2146
|
+
version: import_zod18.z.string(),
|
|
2147
|
+
active: import_zod18.z.boolean(),
|
|
2148
|
+
successful: import_zod18.z.number().int().optional(),
|
|
2149
|
+
failed: import_zod18.z.number().int().optional(),
|
|
2150
|
+
total: import_zod18.z.number().int().optional()
|
|
2151
|
+
}).passthrough();
|
|
2152
|
+
var ComplianceReportSchema = import_zod18.z.object({
|
|
2153
|
+
id: import_zod18.z.string(),
|
|
2154
|
+
display_name: import_zod18.z.string(),
|
|
2155
|
+
description: import_zod18.z.string(),
|
|
2156
|
+
active: import_zod18.z.boolean(),
|
|
2157
|
+
version: import_zod18.z.string(),
|
|
2158
|
+
link: import_zod18.z.string(),
|
|
2159
|
+
techniques: import_zod18.z.array(ComplianceTechniqueSchema),
|
|
2160
|
+
score: import_zod18.z.number().int().optional()
|
|
2161
|
+
}).passthrough();
|
|
2162
|
+
var RuntimeSecurityPolicySchema = import_zod18.z.object({
|
|
2163
|
+
policy_id: import_zod18.z.string(),
|
|
2164
|
+
display_name: import_zod18.z.string(),
|
|
2165
|
+
config: import_zod18.z.record(import_zod18.z.unknown())
|
|
2166
|
+
}).passthrough();
|
|
2167
|
+
var StaticJobRemediationSchema = import_zod18.z.object({
|
|
2168
|
+
remediation: import_zod18.z.string(),
|
|
2169
|
+
description: import_zod18.z.string(),
|
|
2170
|
+
mapping_remediation_id: import_zod18.z.string().nullable().optional(),
|
|
2171
|
+
subcategories: import_zod18.z.array(import_zod18.z.string()).nullable().optional(),
|
|
2172
|
+
effectiveness: import_zod18.z.number().int().optional(),
|
|
2173
|
+
ease_of_implementation: import_zod18.z.number().int().optional(),
|
|
2174
|
+
priority: import_zod18.z.number().int().optional(),
|
|
2175
|
+
resource_links: import_zod18.z.array(import_zod18.z.string()).optional(),
|
|
2176
|
+
categories: import_zod18.z.array(import_zod18.z.string()).nullable().optional()
|
|
2177
|
+
}).passthrough();
|
|
2178
|
+
var StaticJobRemediationRecommendationSchema = import_zod18.z.object({
|
|
2179
|
+
runtime_security_policy_configuration: import_zod18.z.array(RuntimeSecurityPolicySchema).nullable().optional(),
|
|
2180
|
+
other_measures: import_zod18.z.array(StaticJobRemediationSchema).optional()
|
|
2181
|
+
}).passthrough();
|
|
2182
|
+
var StaticJobReportSchema = import_zod18.z.object({
|
|
2183
|
+
severity_report: SeverityReportSchema,
|
|
2184
|
+
asr: import_zod18.z.number().nullable().optional(),
|
|
2185
|
+
score: import_zod18.z.number().nullable().optional(),
|
|
2186
|
+
security_report: CategoryReportSchema.nullable().optional(),
|
|
2187
|
+
safety_report: CategoryReportSchema.nullable().optional(),
|
|
2188
|
+
brand_report: CategoryReportSchema.nullable().optional(),
|
|
2189
|
+
compliance_report: import_zod18.z.array(ComplianceReportSchema).nullable().optional(),
|
|
2190
|
+
report_summary: import_zod18.z.string().nullable().optional(),
|
|
2191
|
+
recommendations: StaticJobRemediationRecommendationSchema.nullable().optional()
|
|
2192
|
+
}).passthrough();
|
|
2193
|
+
var DynamicJobReportSchema = import_zod18.z.object({
|
|
2194
|
+
total_goals: import_zod18.z.number().int().optional(),
|
|
2195
|
+
total_streams: import_zod18.z.number().int().optional(),
|
|
2196
|
+
total_threats: import_zod18.z.number().int().optional(),
|
|
2197
|
+
goals_achieved: import_zod18.z.number().int().optional(),
|
|
2198
|
+
report_summary: import_zod18.z.string().nullable().optional(),
|
|
2199
|
+
score: import_zod18.z.number().optional(),
|
|
2200
|
+
asr: import_zod18.z.number().optional()
|
|
2201
|
+
}).passthrough();
|
|
2202
|
+
var RemediationDetailSchema = import_zod18.z.object({
|
|
2203
|
+
remediation: import_zod18.z.string(),
|
|
2204
|
+
description: import_zod18.z.string(),
|
|
2205
|
+
resource_links: import_zod18.z.array(import_zod18.z.string()).optional(),
|
|
2206
|
+
priority_level: import_zod18.z.string().optional(),
|
|
2207
|
+
ease_of_implementation_level: import_zod18.z.string().optional(),
|
|
2208
|
+
effectiveness_level: import_zod18.z.string().optional()
|
|
2209
|
+
}).passthrough();
|
|
2210
|
+
var RemediationResponseSchema = import_zod18.z.object({ remediations: import_zod18.z.array(RemediationDetailSchema).optional() }).passthrough();
|
|
2211
|
+
var RuntimeSecurityProfileResponseSchema = import_zod18.z.object({
|
|
2212
|
+
runtime_security_profile: import_zod18.z.array(RuntimeSecurityPolicySchema).nullable().optional()
|
|
2213
|
+
}).passthrough();
|
|
2214
|
+
var GoalSchema = import_zod18.z.object({
|
|
2215
|
+
goal: import_zod18.z.string(),
|
|
2216
|
+
safe_response: import_zod18.z.string(),
|
|
2217
|
+
jailbroken_response: import_zod18.z.string(),
|
|
2218
|
+
goal_metadata: import_zod18.z.record(import_zod18.z.unknown()).optional(),
|
|
2219
|
+
custom_goal: import_zod18.z.boolean().optional(),
|
|
2220
|
+
goal_type: import_zod18.z.string().optional(),
|
|
2221
|
+
uuid: import_zod18.z.string(),
|
|
2222
|
+
tsg_id: import_zod18.z.string(),
|
|
2223
|
+
job_id: import_zod18.z.string(),
|
|
2224
|
+
goal_to_show: import_zod18.z.string().nullable().optional(),
|
|
2225
|
+
threat: import_zod18.z.boolean().optional(),
|
|
2226
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
2227
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional()
|
|
2228
|
+
}).passthrough();
|
|
2229
|
+
var GoalListResponseSchema = import_zod18.z.object({ pagination: RedTeamPaginationSchema, data: import_zod18.z.array(GoalSchema) }).passthrough();
|
|
2230
|
+
var StreamIterationDataSchema = import_zod18.z.object({
|
|
2231
|
+
uuid: import_zod18.z.string(),
|
|
2232
|
+
tsg_id: import_zod18.z.string(),
|
|
2233
|
+
job_id: import_zod18.z.string(),
|
|
2234
|
+
stream_id: import_zod18.z.string(),
|
|
2235
|
+
goal_id: import_zod18.z.string(),
|
|
2236
|
+
iteration: import_zod18.z.number().int(),
|
|
2237
|
+
prompt: import_zod18.z.string(),
|
|
2238
|
+
techniques: import_zod18.z.string(),
|
|
2239
|
+
improvement: import_zod18.z.string(),
|
|
2240
|
+
prompts_objective: import_zod18.z.string(),
|
|
2241
|
+
summary: import_zod18.z.string(),
|
|
2242
|
+
output: import_zod18.z.string().nullable().optional(),
|
|
2243
|
+
score: import_zod18.z.number().int().nullable().optional(),
|
|
2244
|
+
judge_reasoning: import_zod18.z.string().nullable().optional(),
|
|
2245
|
+
threat: import_zod18.z.boolean().optional(),
|
|
2246
|
+
created_at: import_zod18.z.string().nullable().optional(),
|
|
2247
|
+
updated_at: import_zod18.z.string().nullable().optional(),
|
|
2248
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional(),
|
|
2249
|
+
version: import_zod18.z.number().int().nullable().optional()
|
|
2250
|
+
}).passthrough();
|
|
2251
|
+
var StreamDetailResponseSchema = import_zod18.z.object({
|
|
2252
|
+
uuid: import_zod18.z.string(),
|
|
2253
|
+
tsg_id: import_zod18.z.string(),
|
|
2254
|
+
job_id: import_zod18.z.string(),
|
|
2255
|
+
target_id: import_zod18.z.string(),
|
|
2256
|
+
goal_id: import_zod18.z.string(),
|
|
2257
|
+
stream_idx: import_zod18.z.number().int().optional(),
|
|
2258
|
+
iteration: import_zod18.z.number().int().optional(),
|
|
2259
|
+
goal: import_zod18.z.unknown().optional(),
|
|
2260
|
+
marked_safe: import_zod18.z.boolean().optional(),
|
|
2261
|
+
stream_type: import_zod18.z.string().nullable().optional(),
|
|
2262
|
+
threat: import_zod18.z.boolean().optional(),
|
|
2263
|
+
first_threat_iteration: StreamIterationDataSchema.nullable().optional(),
|
|
2264
|
+
created_at: import_zod18.z.string().nullable().optional(),
|
|
2265
|
+
updated_at: import_zod18.z.string().nullable().optional(),
|
|
2266
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).optional(),
|
|
2267
|
+
version: import_zod18.z.number().int().nullable().optional(),
|
|
2268
|
+
iterations: import_zod18.z.array(StreamIterationDataSchema).optional()
|
|
2269
|
+
}).passthrough();
|
|
2270
|
+
var StreamListResponseSchema = import_zod18.z.object({ pagination: RedTeamPaginationSchema, data: import_zod18.z.array(StreamDetailResponseSchema) }).passthrough();
|
|
2271
|
+
var CustomAttackOutputSchema = import_zod18.z.object({
|
|
2272
|
+
uuid: import_zod18.z.string(),
|
|
2273
|
+
tsg_id: import_zod18.z.string(),
|
|
2274
|
+
custom_attack_id: import_zod18.z.string(),
|
|
2275
|
+
job_id: import_zod18.z.string(),
|
|
2276
|
+
target_id: import_zod18.z.string(),
|
|
2277
|
+
output: import_zod18.z.string(),
|
|
2278
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2279
|
+
marked_safe: import_zod18.z.boolean().nullable().optional()
|
|
2280
|
+
}).passthrough();
|
|
2281
|
+
var PropertyAssignmentSchema = import_zod18.z.object({
|
|
2282
|
+
name: import_zod18.z.string(),
|
|
2283
|
+
value: import_zod18.z.string()
|
|
2284
|
+
});
|
|
2285
|
+
var PropertyValueStatisticSchema = import_zod18.z.object({
|
|
2286
|
+
value: import_zod18.z.string(),
|
|
2287
|
+
successful_attack_count: import_zod18.z.number().int(),
|
|
2288
|
+
total_attack_count: import_zod18.z.number().int(),
|
|
2289
|
+
success_rate: import_zod18.z.number()
|
|
2290
|
+
});
|
|
2291
|
+
var PropertyStatisticSchema = import_zod18.z.object({
|
|
2292
|
+
property_name: import_zod18.z.string(),
|
|
2293
|
+
values: import_zod18.z.array(PropertyValueStatisticSchema)
|
|
2294
|
+
});
|
|
2295
|
+
var PromptSetSummarySchema = import_zod18.z.object({
|
|
2296
|
+
prompt_set_id: import_zod18.z.string(),
|
|
2297
|
+
prompt_set_name: import_zod18.z.string(),
|
|
2298
|
+
total_prompts: import_zod18.z.number().int(),
|
|
2299
|
+
total_attacks: import_zod18.z.number().int(),
|
|
2300
|
+
total_threats: import_zod18.z.number().int(),
|
|
2301
|
+
failed_attacks: import_zod18.z.number().int(),
|
|
2302
|
+
threat_rate: import_zod18.z.number(),
|
|
2303
|
+
property_names: import_zod18.z.array(import_zod18.z.string()).optional(),
|
|
2304
|
+
property_statistics: import_zod18.z.array(PropertyStatisticSchema).optional()
|
|
2305
|
+
}).passthrough();
|
|
2306
|
+
var CustomAttackReportResponseSchema = import_zod18.z.object({
|
|
2307
|
+
total_prompts: import_zod18.z.number().int(),
|
|
2308
|
+
total_attacks: import_zod18.z.number().int(),
|
|
2309
|
+
total_threats: import_zod18.z.number().int(),
|
|
2310
|
+
failed_attacks: import_zod18.z.number().int(),
|
|
2311
|
+
score: import_zod18.z.number(),
|
|
2312
|
+
asr: import_zod18.z.number(),
|
|
2313
|
+
custom_attack_reports: import_zod18.z.array(PromptSetSummarySchema).optional(),
|
|
2314
|
+
property_statistics: import_zod18.z.array(PropertyStatisticSchema).optional()
|
|
2315
|
+
}).passthrough();
|
|
2316
|
+
var PromptSetsReportResponseSchema = import_zod18.z.object({
|
|
2317
|
+
prompt_sets: import_zod18.z.array(PromptSetSummarySchema),
|
|
2318
|
+
total_prompt_sets: import_zod18.z.number().int(),
|
|
2319
|
+
applied_filters: import_zod18.z.record(import_zod18.z.unknown()).optional()
|
|
2320
|
+
}).passthrough();
|
|
2321
|
+
var PromptDetailResponseSchema = import_zod18.z.object({
|
|
2322
|
+
prompt_id: import_zod18.z.string(),
|
|
2323
|
+
prompt_text: import_zod18.z.string(),
|
|
2324
|
+
goal: import_zod18.z.string().nullable().optional(),
|
|
2325
|
+
user_defined_goal: import_zod18.z.boolean().optional(),
|
|
2326
|
+
properties: import_zod18.z.array(PropertyAssignmentSchema).optional(),
|
|
2327
|
+
attack_id: import_zod18.z.string().nullable().optional(),
|
|
2328
|
+
threat: import_zod18.z.boolean().nullable().optional(),
|
|
2329
|
+
attack_outputs: import_zod18.z.array(CustomAttackOutputSchema).optional(),
|
|
2330
|
+
asr: import_zod18.z.number().nullable().optional(),
|
|
2331
|
+
prompt_set_id: import_zod18.z.string().nullable().optional(),
|
|
2332
|
+
prompt_set_name: import_zod18.z.string().nullable().optional()
|
|
2333
|
+
}).passthrough();
|
|
2334
|
+
var CustomAttacksListResponseSchema = import_zod18.z.object({
|
|
2335
|
+
pagination: RedTeamPaginationSchema,
|
|
2336
|
+
data: import_zod18.z.array(import_zod18.z.unknown()),
|
|
2337
|
+
total_attacks: import_zod18.z.number().int(),
|
|
2338
|
+
total_threats: import_zod18.z.number().int()
|
|
2339
|
+
}).passthrough();
|
|
2340
|
+
var RiskLevelSchema = import_zod18.z.object({
|
|
2341
|
+
risk_rating: import_zod18.z.string(),
|
|
2342
|
+
total: import_zod18.z.number().int(),
|
|
2343
|
+
targets_by_type: import_zod18.z.array(CountByNameSchema).optional()
|
|
2344
|
+
}).passthrough();
|
|
2345
|
+
var ScanStatisticsResponseSchema = import_zod18.z.object({
|
|
2346
|
+
total_scans: import_zod18.z.number().int(),
|
|
2347
|
+
targets_scanned: import_zod18.z.number().int(),
|
|
2348
|
+
targets_scanned_by_type: import_zod18.z.array(CountByNameSchema).optional(),
|
|
2349
|
+
scan_status: import_zod18.z.array(CountByNameSchema).optional(),
|
|
2350
|
+
risk_profile: import_zod18.z.array(RiskLevelSchema).optional()
|
|
2351
|
+
}).passthrough();
|
|
2352
|
+
var ScoreTrendSeriesSchema = import_zod18.z.object({
|
|
2353
|
+
label: import_zod18.z.string(),
|
|
2354
|
+
data: import_zod18.z.array(import_zod18.z.number().nullable())
|
|
2355
|
+
});
|
|
2356
|
+
var ScoreTrendResponseSchema = import_zod18.z.object({
|
|
2357
|
+
labels: import_zod18.z.array(import_zod18.z.string()),
|
|
2358
|
+
series: import_zod18.z.array(ScoreTrendSeriesSchema)
|
|
2359
|
+
});
|
|
2360
|
+
var SentimentRequestSchema = import_zod18.z.object({
|
|
2361
|
+
job_id: import_zod18.z.string(),
|
|
2362
|
+
up_vote: import_zod18.z.boolean().optional(),
|
|
2363
|
+
down_vote: import_zod18.z.boolean().optional()
|
|
2364
|
+
});
|
|
2365
|
+
var SentimentResponseSchema = import_zod18.z.object({
|
|
2366
|
+
job_id: import_zod18.z.string(),
|
|
2367
|
+
up_vote: import_zod18.z.boolean().optional(),
|
|
2368
|
+
down_vote: import_zod18.z.boolean().optional()
|
|
2369
|
+
}).passthrough();
|
|
2370
|
+
var QuotaDetailsSchema = import_zod18.z.object({
|
|
2371
|
+
allocated: import_zod18.z.number().int(),
|
|
2372
|
+
unlimited: import_zod18.z.boolean(),
|
|
2373
|
+
consumed: import_zod18.z.number().int()
|
|
2374
|
+
});
|
|
2375
|
+
var QuotaSummarySchema = import_zod18.z.object({
|
|
2376
|
+
static: QuotaDetailsSchema,
|
|
2377
|
+
dynamic: QuotaDetailsSchema,
|
|
2378
|
+
custom: QuotaDetailsSchema
|
|
2379
|
+
});
|
|
2380
|
+
var ErrorLogSchema = import_zod18.z.object({
|
|
2381
|
+
created_at: import_zod18.z.string(),
|
|
2382
|
+
updated_at: import_zod18.z.string(),
|
|
2383
|
+
job_id: import_zod18.z.string().nullable().optional(),
|
|
2384
|
+
target_id: import_zod18.z.string().nullable().optional(),
|
|
2385
|
+
target_version: import_zod18.z.number().int().nullable().optional(),
|
|
2386
|
+
attack_id: import_zod18.z.string().nullable().optional(),
|
|
2387
|
+
error_type: import_zod18.z.string().nullable().optional(),
|
|
2388
|
+
error_source: import_zod18.z.string().nullable().optional(),
|
|
2389
|
+
error_message: import_zod18.z.string().nullable().optional(),
|
|
2390
|
+
target_object: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional(),
|
|
2391
|
+
extra_info: import_zod18.z.record(import_zod18.z.unknown()).nullable().optional(),
|
|
2392
|
+
version: import_zod18.z.number().int().optional()
|
|
2393
|
+
}).passthrough();
|
|
2394
|
+
var ErrorLogListResponseSchema = import_zod18.z.object({ pagination: RedTeamPaginationSchema, data: import_zod18.z.array(ErrorLogSchema) }).passthrough();
|
|
2395
|
+
var TargetCreateRequestSchema = import_zod18.z.object({
|
|
2396
|
+
name: import_zod18.z.string(),
|
|
2397
|
+
description: import_zod18.z.unknown().optional(),
|
|
2398
|
+
target_type: import_zod18.z.unknown().optional(),
|
|
2399
|
+
connection_type: import_zod18.z.unknown().optional(),
|
|
2400
|
+
api_endpoint_type: import_zod18.z.unknown().optional(),
|
|
2401
|
+
response_mode: import_zod18.z.unknown().optional(),
|
|
2402
|
+
connection_params: import_zod18.z.unknown().optional(),
|
|
2403
|
+
session_supported: import_zod18.z.boolean().optional(),
|
|
2404
|
+
target_metadata: import_zod18.z.unknown().optional(),
|
|
2405
|
+
target_background: import_zod18.z.unknown().optional(),
|
|
2406
|
+
additional_context: import_zod18.z.unknown().optional(),
|
|
2407
|
+
extra_info: import_zod18.z.unknown().optional(),
|
|
2408
|
+
network_broker_channel_uuid: import_zod18.z.unknown().optional()
|
|
2409
|
+
}).passthrough();
|
|
2410
|
+
var TargetUpdateRequestSchema = import_zod18.z.object({
|
|
2411
|
+
name: import_zod18.z.string(),
|
|
2412
|
+
description: import_zod18.z.unknown().optional(),
|
|
2413
|
+
target_type: import_zod18.z.unknown().optional(),
|
|
2414
|
+
connection_type: import_zod18.z.unknown().optional(),
|
|
2415
|
+
api_endpoint_type: import_zod18.z.unknown().optional(),
|
|
2416
|
+
response_mode: import_zod18.z.unknown().optional(),
|
|
2417
|
+
connection_params: import_zod18.z.unknown().optional(),
|
|
2418
|
+
session_supported: import_zod18.z.boolean().optional(),
|
|
2419
|
+
target_metadata: import_zod18.z.unknown().optional(),
|
|
2420
|
+
target_background: import_zod18.z.unknown().optional(),
|
|
2421
|
+
additional_context: import_zod18.z.unknown().optional(),
|
|
2422
|
+
extra_info: import_zod18.z.unknown().optional(),
|
|
2423
|
+
network_broker_channel_uuid: import_zod18.z.unknown().optional()
|
|
2424
|
+
}).passthrough();
|
|
2425
|
+
var TargetContextUpdateSchema = import_zod18.z.object({
|
|
2426
|
+
target_background: import_zod18.z.unknown().optional(),
|
|
2427
|
+
additional_context: import_zod18.z.unknown().optional()
|
|
2428
|
+
}).passthrough();
|
|
2429
|
+
var TargetResponseSchema = import_zod18.z.object({
|
|
2430
|
+
uuid: import_zod18.z.string(),
|
|
2431
|
+
tsg_id: import_zod18.z.string(),
|
|
2432
|
+
name: import_zod18.z.string(),
|
|
2433
|
+
status: import_zod18.z.unknown(),
|
|
2434
|
+
active: import_zod18.z.boolean(),
|
|
2435
|
+
validated: import_zod18.z.boolean(),
|
|
2436
|
+
created_at: import_zod18.z.string(),
|
|
2437
|
+
updated_at: import_zod18.z.string(),
|
|
2438
|
+
description: import_zod18.z.unknown().optional(),
|
|
2439
|
+
target_type: import_zod18.z.unknown().optional(),
|
|
2440
|
+
connection_type: import_zod18.z.unknown().optional(),
|
|
2441
|
+
api_endpoint_type: import_zod18.z.unknown().optional(),
|
|
2442
|
+
response_mode: import_zod18.z.unknown().optional(),
|
|
2443
|
+
session_supported: import_zod18.z.boolean().optional(),
|
|
2444
|
+
extra_info: import_zod18.z.unknown().optional(),
|
|
2445
|
+
version: import_zod18.z.unknown().optional(),
|
|
2446
|
+
secret_version: import_zod18.z.unknown().optional(),
|
|
2447
|
+
created_by_user_id: import_zod18.z.unknown().optional(),
|
|
2448
|
+
updated_by_user_id: import_zod18.z.unknown().optional(),
|
|
2449
|
+
target_metadata: import_zod18.z.unknown().optional(),
|
|
2450
|
+
target_background: import_zod18.z.unknown().optional(),
|
|
2451
|
+
profiling_status: import_zod18.z.unknown().optional(),
|
|
2452
|
+
additional_context: import_zod18.z.unknown().optional()
|
|
2453
|
+
}).passthrough();
|
|
2454
|
+
var TargetListItemSchema = import_zod18.z.object({
|
|
2455
|
+
uuid: import_zod18.z.string(),
|
|
2456
|
+
tsg_id: import_zod18.z.string(),
|
|
2457
|
+
name: import_zod18.z.string(),
|
|
2458
|
+
status: import_zod18.z.unknown(),
|
|
2459
|
+
active: import_zod18.z.boolean(),
|
|
2460
|
+
validated: import_zod18.z.boolean(),
|
|
2461
|
+
created_at: import_zod18.z.string(),
|
|
2462
|
+
updated_at: import_zod18.z.string(),
|
|
2463
|
+
description: import_zod18.z.unknown().optional(),
|
|
2464
|
+
target_type: import_zod18.z.unknown().optional(),
|
|
2465
|
+
connection_type: import_zod18.z.unknown().optional(),
|
|
2466
|
+
api_endpoint_type: import_zod18.z.unknown().optional(),
|
|
2467
|
+
response_mode: import_zod18.z.unknown().optional(),
|
|
2468
|
+
session_supported: import_zod18.z.boolean().optional(),
|
|
2469
|
+
extra_info: import_zod18.z.unknown().optional(),
|
|
2470
|
+
version: import_zod18.z.unknown().optional(),
|
|
2471
|
+
secret_version: import_zod18.z.unknown().optional(),
|
|
2472
|
+
created_by_user_id: import_zod18.z.unknown().optional(),
|
|
2473
|
+
updated_by_user_id: import_zod18.z.unknown().optional()
|
|
2474
|
+
}).passthrough();
|
|
2475
|
+
var TargetListSchema = import_zod18.z.object({ pagination: RedTeamPaginationSchema, data: import_zod18.z.array(TargetListItemSchema).optional() }).passthrough();
|
|
2476
|
+
var TargetProbeRequestSchema = import_zod18.z.object({
|
|
2477
|
+
name: import_zod18.z.string(),
|
|
2478
|
+
uuid: import_zod18.z.unknown().optional(),
|
|
2479
|
+
description: import_zod18.z.unknown().optional(),
|
|
2480
|
+
target_type: import_zod18.z.unknown().optional(),
|
|
2481
|
+
connection_type: import_zod18.z.unknown().optional(),
|
|
2482
|
+
api_endpoint_type: import_zod18.z.unknown().optional(),
|
|
2483
|
+
response_mode: import_zod18.z.unknown().optional(),
|
|
2484
|
+
connection_params: import_zod18.z.unknown().optional(),
|
|
2485
|
+
session_supported: import_zod18.z.boolean().optional(),
|
|
2486
|
+
target_metadata: import_zod18.z.unknown().optional(),
|
|
2487
|
+
target_background: import_zod18.z.unknown().optional(),
|
|
2488
|
+
additional_context: import_zod18.z.unknown().optional(),
|
|
2489
|
+
extra_info: import_zod18.z.unknown().optional(),
|
|
2490
|
+
network_broker_channel_uuid: import_zod18.z.unknown().optional(),
|
|
2491
|
+
probe_fields: import_zod18.z.unknown().optional()
|
|
2492
|
+
}).passthrough();
|
|
2493
|
+
var TargetProfileResponseSchema = import_zod18.z.object({
|
|
2494
|
+
target_id: import_zod18.z.string(),
|
|
2495
|
+
target_version: import_zod18.z.number().int(),
|
|
2496
|
+
status: import_zod18.z.string(),
|
|
2497
|
+
profiling_status: import_zod18.z.unknown().optional(),
|
|
2498
|
+
target_background: import_zod18.z.unknown().optional(),
|
|
2499
|
+
additional_context: import_zod18.z.unknown().optional(),
|
|
2500
|
+
ai_generated_fields: import_zod18.z.unknown().optional(),
|
|
2501
|
+
other_details: import_zod18.z.unknown().optional()
|
|
2502
|
+
}).passthrough();
|
|
2503
|
+
var BaseResponseSchema = import_zod18.z.object({
|
|
2504
|
+
message: import_zod18.z.string(),
|
|
2505
|
+
status: import_zod18.z.number().int()
|
|
2506
|
+
});
|
|
2507
|
+
var PromptSetStatsSchema = import_zod18.z.object({
|
|
2508
|
+
total_prompts: import_zod18.z.number().int(),
|
|
2509
|
+
active_prompts: import_zod18.z.number().int(),
|
|
2510
|
+
inactive_prompts: import_zod18.z.number().int(),
|
|
2511
|
+
failed_prompts: import_zod18.z.number().int().optional(),
|
|
2512
|
+
validation_prompts: import_zod18.z.number().int().optional()
|
|
2513
|
+
}).passthrough();
|
|
2514
|
+
var CustomPromptSetCreateRequestSchema = import_zod18.z.object({
|
|
2515
|
+
name: import_zod18.z.string(),
|
|
2516
|
+
description: import_zod18.z.unknown().optional(),
|
|
2517
|
+
property_names: import_zod18.z.array(import_zod18.z.string()).optional()
|
|
2518
|
+
});
|
|
2519
|
+
var CustomPromptSetUpdateRequestSchema = import_zod18.z.object({
|
|
2520
|
+
name: import_zod18.z.unknown().optional(),
|
|
2521
|
+
description: import_zod18.z.unknown().optional(),
|
|
2522
|
+
archive: import_zod18.z.unknown().optional(),
|
|
2523
|
+
property_names: import_zod18.z.unknown().optional()
|
|
2524
|
+
}).passthrough();
|
|
2525
|
+
var CustomPromptSetArchiveRequestSchema = import_zod18.z.object({ archive: import_zod18.z.boolean() });
|
|
2526
|
+
var CustomPromptSetResponseSchema = import_zod18.z.object({
|
|
2527
|
+
uuid: import_zod18.z.string(),
|
|
2528
|
+
name: import_zod18.z.string(),
|
|
2529
|
+
active: import_zod18.z.boolean(),
|
|
2530
|
+
archive: import_zod18.z.boolean(),
|
|
2531
|
+
status: import_zod18.z.string(),
|
|
2532
|
+
created_at: import_zod18.z.string(),
|
|
2533
|
+
updated_at: import_zod18.z.string(),
|
|
2534
|
+
description: import_zod18.z.unknown().optional(),
|
|
2535
|
+
property_names: import_zod18.z.array(import_zod18.z.string()).optional(),
|
|
2536
|
+
properties: import_zod18.z.array(import_zod18.z.unknown()).optional(),
|
|
2537
|
+
stats: import_zod18.z.unknown().optional(),
|
|
2538
|
+
extra_info: import_zod18.z.unknown().optional(),
|
|
2539
|
+
version: import_zod18.z.unknown().optional(),
|
|
2540
|
+
created_by_user_id: import_zod18.z.unknown().optional(),
|
|
2541
|
+
updated_by_user_id: import_zod18.z.unknown().optional()
|
|
2542
|
+
}).passthrough();
|
|
2543
|
+
var CustomPromptSetListItemSchema = import_zod18.z.object({
|
|
2544
|
+
uuid: import_zod18.z.string(),
|
|
2545
|
+
name: import_zod18.z.string(),
|
|
2546
|
+
active: import_zod18.z.boolean(),
|
|
2547
|
+
archive: import_zod18.z.boolean(),
|
|
2548
|
+
status: import_zod18.z.string(),
|
|
2549
|
+
created_at: import_zod18.z.string(),
|
|
2550
|
+
updated_at: import_zod18.z.string(),
|
|
2551
|
+
description: import_zod18.z.unknown().optional(),
|
|
2552
|
+
property_names: import_zod18.z.array(import_zod18.z.string()).optional(),
|
|
2553
|
+
stats: import_zod18.z.unknown().optional(),
|
|
2554
|
+
created_by_user_id: import_zod18.z.unknown().optional()
|
|
2555
|
+
}).passthrough();
|
|
2556
|
+
var CustomPromptSetListSchema = import_zod18.z.object({
|
|
2557
|
+
pagination: RedTeamPaginationSchema,
|
|
2558
|
+
data: import_zod18.z.array(CustomPromptSetListItemSchema).optional()
|
|
2559
|
+
}).passthrough();
|
|
2560
|
+
var CustomPromptSetListActiveSchema = import_zod18.z.object({ data: import_zod18.z.array(CustomPromptSetListItemSchema).optional() }).passthrough();
|
|
2561
|
+
var CustomPromptSetReferenceSchema = import_zod18.z.object({
|
|
2562
|
+
uuid: import_zod18.z.string(),
|
|
2563
|
+
name: import_zod18.z.string(),
|
|
2564
|
+
status: import_zod18.z.string(),
|
|
2565
|
+
active: import_zod18.z.boolean(),
|
|
2566
|
+
tsg_id: import_zod18.z.string(),
|
|
2567
|
+
created_at: import_zod18.z.string(),
|
|
2568
|
+
updated_at: import_zod18.z.string(),
|
|
2569
|
+
version: import_zod18.z.unknown().optional()
|
|
2570
|
+
}).passthrough();
|
|
2571
|
+
var CustomPromptSetVersionInfoSchema = import_zod18.z.object({
|
|
2572
|
+
uuid: import_zod18.z.string(),
|
|
2573
|
+
status: import_zod18.z.string(),
|
|
2574
|
+
is_latest: import_zod18.z.boolean(),
|
|
2575
|
+
version: import_zod18.z.unknown().optional(),
|
|
2576
|
+
stats: import_zod18.z.unknown().optional(),
|
|
2577
|
+
snapshot_created_at: import_zod18.z.unknown().optional()
|
|
2578
|
+
}).passthrough();
|
|
2579
|
+
var CustomPromptCreateRequestSchema = import_zod18.z.object({
|
|
2580
|
+
prompt: import_zod18.z.string(),
|
|
2581
|
+
prompt_set_id: import_zod18.z.string(),
|
|
2582
|
+
goal: import_zod18.z.unknown().optional(),
|
|
2583
|
+
properties: import_zod18.z.unknown().optional()
|
|
2584
|
+
});
|
|
2585
|
+
var CustomPromptUpdateRequestSchema = import_zod18.z.object({
|
|
2586
|
+
prompt: import_zod18.z.unknown().optional(),
|
|
2587
|
+
goal: import_zod18.z.unknown().optional(),
|
|
2588
|
+
properties: import_zod18.z.unknown().optional()
|
|
2589
|
+
}).passthrough();
|
|
2590
|
+
var CustomPromptResponseSchema = import_zod18.z.object({
|
|
2591
|
+
uuid: import_zod18.z.string(),
|
|
2592
|
+
prompt: import_zod18.z.string(),
|
|
2593
|
+
user_defined_goal: import_zod18.z.boolean(),
|
|
2594
|
+
status: import_zod18.z.string(),
|
|
2595
|
+
active: import_zod18.z.boolean(),
|
|
2596
|
+
prompt_set_id: import_zod18.z.string(),
|
|
2597
|
+
created_at: import_zod18.z.string(),
|
|
2598
|
+
updated_at: import_zod18.z.string(),
|
|
2599
|
+
goal: import_zod18.z.unknown().optional(),
|
|
2600
|
+
properties: import_zod18.z.unknown().optional(),
|
|
2601
|
+
property_assignments: import_zod18.z.array(import_zod18.z.unknown()).optional(),
|
|
2602
|
+
detector_category: import_zod18.z.unknown().optional(),
|
|
2603
|
+
severity: import_zod18.z.unknown().optional(),
|
|
2604
|
+
extra_info: import_zod18.z.unknown().optional()
|
|
2605
|
+
}).passthrough();
|
|
2606
|
+
var CustomPromptListItemSchema = import_zod18.z.object({
|
|
2607
|
+
uuid: import_zod18.z.string(),
|
|
2608
|
+
prompt: import_zod18.z.string(),
|
|
2609
|
+
user_defined_goal: import_zod18.z.boolean(),
|
|
2610
|
+
status: import_zod18.z.string(),
|
|
2611
|
+
active: import_zod18.z.boolean(),
|
|
2612
|
+
created_at: import_zod18.z.string(),
|
|
2613
|
+
updated_at: import_zod18.z.string(),
|
|
2614
|
+
goal: import_zod18.z.unknown().optional(),
|
|
2615
|
+
properties: import_zod18.z.unknown().optional()
|
|
2616
|
+
}).passthrough();
|
|
2617
|
+
var CustomPromptListSchema = import_zod18.z.object({
|
|
2618
|
+
pagination: RedTeamPaginationSchema,
|
|
2619
|
+
data: import_zod18.z.array(CustomPromptListItemSchema).optional()
|
|
2620
|
+
}).passthrough();
|
|
2621
|
+
var PropertyNameCreateRequestSchema = import_zod18.z.object({ name: import_zod18.z.string() });
|
|
2622
|
+
var PropertyValueCreateRequestSchema = import_zod18.z.object({
|
|
2623
|
+
property_name: import_zod18.z.string(),
|
|
2624
|
+
property_value: import_zod18.z.string()
|
|
2625
|
+
});
|
|
2626
|
+
var PropertyDefinitionSchema = import_zod18.z.object({
|
|
2627
|
+
property_name: import_zod18.z.string(),
|
|
2628
|
+
created_at: import_zod18.z.string()
|
|
2629
|
+
});
|
|
2630
|
+
var PropertyNamesListResponseSchema = import_zod18.z.object({ data: import_zod18.z.array(PropertyDefinitionSchema).optional() }).passthrough();
|
|
2631
|
+
var PropertyValuesResponseSchema = import_zod18.z.object({
|
|
2632
|
+
name: import_zod18.z.string(),
|
|
2633
|
+
values: import_zod18.z.array(import_zod18.z.string()).optional()
|
|
2634
|
+
}).passthrough();
|
|
2635
|
+
var PropertyValuesMultipleResponseSchema = import_zod18.z.object({ data: import_zod18.z.record(import_zod18.z.array(import_zod18.z.string())).optional() }).passthrough();
|
|
2636
|
+
var DashboardOverviewResponseSchema = import_zod18.z.object({
|
|
2637
|
+
total_targets: import_zod18.z.number().int(),
|
|
2638
|
+
targets_by_type: import_zod18.z.array(CountByNameSchema).optional()
|
|
2639
|
+
}).passthrough();
|
|
2640
|
+
|
|
2641
|
+
// src/models/oauth-token.ts
|
|
2642
|
+
var import_zod19 = require("zod");
|
|
2643
|
+
var OAuthTokenResponseSchema = import_zod19.z.object({
|
|
2644
|
+
access_token: import_zod19.z.string(),
|
|
2645
|
+
token_type: import_zod19.z.string().optional(),
|
|
2646
|
+
expires_in: import_zod19.z.number(),
|
|
2647
|
+
scope: import_zod19.z.string().optional()
|
|
1001
2648
|
});
|
|
1002
2649
|
|
|
1003
2650
|
// src/management/oauth-client.ts
|
|
1004
|
-
var
|
|
2651
|
+
var DEFAULT_TOKEN_BUFFER_MS = 3e4;
|
|
1005
2652
|
var OAuthClient = class {
|
|
1006
2653
|
tokenEndpoint;
|
|
1007
2654
|
clientId;
|
|
1008
2655
|
clientSecret;
|
|
1009
2656
|
tsgId;
|
|
2657
|
+
tokenBufferMs;
|
|
2658
|
+
onTokenRefresh;
|
|
1010
2659
|
accessToken = null;
|
|
1011
2660
|
expiresAt = 0;
|
|
1012
2661
|
pendingFetch = null;
|
|
@@ -1015,13 +2664,15 @@ var OAuthClient = class {
|
|
|
1015
2664
|
this.clientSecret = opts.clientSecret;
|
|
1016
2665
|
this.tsgId = opts.tsgId;
|
|
1017
2666
|
this.tokenEndpoint = opts.tokenEndpoint ?? DEFAULT_TOKEN_ENDPOINT;
|
|
2667
|
+
this.tokenBufferMs = opts.tokenBufferMs ?? DEFAULT_TOKEN_BUFFER_MS;
|
|
2668
|
+
this.onTokenRefresh = opts.onTokenRefresh;
|
|
1018
2669
|
}
|
|
1019
2670
|
/**
|
|
1020
2671
|
* Get a valid access token, refreshing if needed.
|
|
1021
2672
|
* @returns Bearer access token string.
|
|
1022
2673
|
*/
|
|
1023
2674
|
async getToken() {
|
|
1024
|
-
if (this.accessToken && Date.now() < this.expiresAt -
|
|
2675
|
+
if (this.accessToken && Date.now() < this.expiresAt - this.tokenBufferMs) {
|
|
1025
2676
|
return this.accessToken;
|
|
1026
2677
|
}
|
|
1027
2678
|
if (this.pendingFetch) {
|
|
@@ -1037,6 +2688,40 @@ var OAuthClient = class {
|
|
|
1037
2688
|
this.accessToken = null;
|
|
1038
2689
|
this.expiresAt = 0;
|
|
1039
2690
|
}
|
|
2691
|
+
/** Check if the current token has passed its expiry time. Returns true if no token exists. */
|
|
2692
|
+
isTokenExpired() {
|
|
2693
|
+
if (!this.accessToken) return true;
|
|
2694
|
+
return Date.now() >= this.expiresAt;
|
|
2695
|
+
}
|
|
2696
|
+
/**
|
|
2697
|
+
* Check if the token is within the pre-expiry buffer window.
|
|
2698
|
+
* Returns true if no token exists.
|
|
2699
|
+
* @param bufferMs - Custom buffer in ms. Defaults to the configured `tokenBufferMs`.
|
|
2700
|
+
*/
|
|
2701
|
+
isTokenExpiringSoon(bufferMs) {
|
|
2702
|
+
if (!this.accessToken) return true;
|
|
2703
|
+
const buffer = bufferMs ?? this.tokenBufferMs;
|
|
2704
|
+
return Date.now() >= this.expiresAt - buffer;
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Get a snapshot of the current token state without exposing the actual token value.
|
|
2708
|
+
* @returns Current {@link TokenInfo}.
|
|
2709
|
+
*/
|
|
2710
|
+
getTokenInfo() {
|
|
2711
|
+
const now = Date.now();
|
|
2712
|
+
const hasToken = this.accessToken !== null;
|
|
2713
|
+
const isExpired = !hasToken || now >= this.expiresAt;
|
|
2714
|
+
const isExpiringSoon = !hasToken || now >= this.expiresAt - this.tokenBufferMs;
|
|
2715
|
+
const expiresInMs = hasToken ? Math.max(0, this.expiresAt - now) : 0;
|
|
2716
|
+
return {
|
|
2717
|
+
hasToken,
|
|
2718
|
+
isValid: hasToken && !isExpiringSoon,
|
|
2719
|
+
isExpired,
|
|
2720
|
+
isExpiringSoon,
|
|
2721
|
+
expiresInMs,
|
|
2722
|
+
expiresAt: hasToken ? this.expiresAt : 0
|
|
2723
|
+
};
|
|
2724
|
+
}
|
|
1040
2725
|
async fetchToken() {
|
|
1041
2726
|
const credentials = btoa(`${this.clientId}:${this.clientSecret}`);
|
|
1042
2727
|
const body = new URLSearchParams({
|
|
@@ -1072,6 +2757,12 @@ var OAuthClient = class {
|
|
|
1072
2757
|
const data = OAuthTokenResponseSchema.parse(await response.json());
|
|
1073
2758
|
this.accessToken = data.access_token;
|
|
1074
2759
|
this.expiresAt = Date.now() + data.expires_in * 1e3;
|
|
2760
|
+
if (this.onTokenRefresh) {
|
|
2761
|
+
try {
|
|
2762
|
+
this.onTokenRefresh(this.getTokenInfo());
|
|
2763
|
+
} catch {
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
1075
2766
|
return this.accessToken;
|
|
1076
2767
|
}
|
|
1077
2768
|
};
|
|
@@ -1103,7 +2794,7 @@ async function managementHttpRequest(opts) {
|
|
|
1103
2794
|
return fetch(url.toString(), { method, headers, body: bodyStr });
|
|
1104
2795
|
},
|
|
1105
2796
|
onRetryableFailure: async (response2) => {
|
|
1106
|
-
if (response2.status === 401 && !hadTokenRefresh) {
|
|
2797
|
+
if ((response2.status === 401 || response2.status === 403) && !hadTokenRefresh) {
|
|
1107
2798
|
hadTokenRefresh = true;
|
|
1108
2799
|
oauthClient.clearToken();
|
|
1109
2800
|
return true;
|
|
@@ -1377,6 +3068,1708 @@ var ManagementClient = class {
|
|
|
1377
3068
|
});
|
|
1378
3069
|
}
|
|
1379
3070
|
};
|
|
3071
|
+
|
|
3072
|
+
// src/model-security/scans-client.ts
|
|
3073
|
+
function buildListParams(opts) {
|
|
3074
|
+
const params = {};
|
|
3075
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3076
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3077
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3078
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3079
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3080
|
+
return params;
|
|
3081
|
+
}
|
|
3082
|
+
var ModelSecurityScansClient = class {
|
|
3083
|
+
baseUrl;
|
|
3084
|
+
oauthClient;
|
|
3085
|
+
numRetries;
|
|
3086
|
+
constructor(opts) {
|
|
3087
|
+
this.baseUrl = opts.baseUrl;
|
|
3088
|
+
this.oauthClient = opts.oauthClient;
|
|
3089
|
+
this.numRetries = opts.numRetries;
|
|
3090
|
+
}
|
|
3091
|
+
/**
|
|
3092
|
+
* Create a new model security scan.
|
|
3093
|
+
* @param request - Scan creation request body.
|
|
3094
|
+
* @returns The created scan response.
|
|
3095
|
+
*/
|
|
3096
|
+
async create(request) {
|
|
3097
|
+
const res = await managementHttpRequest({
|
|
3098
|
+
method: "POST",
|
|
3099
|
+
baseUrl: this.baseUrl,
|
|
3100
|
+
path: MODEL_SEC_SCANS_PATH,
|
|
3101
|
+
body: request,
|
|
3102
|
+
oauthClient: this.oauthClient,
|
|
3103
|
+
numRetries: this.numRetries
|
|
3104
|
+
});
|
|
3105
|
+
return res.data;
|
|
3106
|
+
}
|
|
3107
|
+
/**
|
|
3108
|
+
* List model security scans with optional filters.
|
|
3109
|
+
* @param opts - Pagination and filter options.
|
|
3110
|
+
* @returns Paginated list of scans.
|
|
3111
|
+
*/
|
|
3112
|
+
async list(opts) {
|
|
3113
|
+
const params = buildListParams(opts);
|
|
3114
|
+
if (opts?.eval_outcome !== void 0) params.eval_outcome = opts.eval_outcome;
|
|
3115
|
+
if (opts?.source_type !== void 0) params.source_type = opts.source_type;
|
|
3116
|
+
if (opts?.scan_origin !== void 0) params.scan_origin = opts.scan_origin;
|
|
3117
|
+
const res = await managementHttpRequest({
|
|
3118
|
+
method: "GET",
|
|
3119
|
+
baseUrl: this.baseUrl,
|
|
3120
|
+
path: MODEL_SEC_SCANS_PATH,
|
|
3121
|
+
params,
|
|
3122
|
+
oauthClient: this.oauthClient,
|
|
3123
|
+
numRetries: this.numRetries
|
|
3124
|
+
});
|
|
3125
|
+
return res.data;
|
|
3126
|
+
}
|
|
3127
|
+
/**
|
|
3128
|
+
* Get a single scan by UUID.
|
|
3129
|
+
* @param uuid - Scan UUID.
|
|
3130
|
+
* @returns The scan response.
|
|
3131
|
+
*/
|
|
3132
|
+
async get(uuid) {
|
|
3133
|
+
if (!isValidUuid(uuid)) {
|
|
3134
|
+
throw new AISecSDKException(
|
|
3135
|
+
`Invalid scan uuid: ${uuid}`,
|
|
3136
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3137
|
+
);
|
|
3138
|
+
}
|
|
3139
|
+
const res = await managementHttpRequest({
|
|
3140
|
+
method: "GET",
|
|
3141
|
+
baseUrl: this.baseUrl,
|
|
3142
|
+
path: `${MODEL_SEC_SCANS_PATH}/${uuid}`,
|
|
3143
|
+
oauthClient: this.oauthClient,
|
|
3144
|
+
numRetries: this.numRetries
|
|
3145
|
+
});
|
|
3146
|
+
return res.data;
|
|
3147
|
+
}
|
|
3148
|
+
/**
|
|
3149
|
+
* Get rule evaluations for a scan.
|
|
3150
|
+
* @param scanUuid - Scan UUID.
|
|
3151
|
+
* @param opts - Pagination options.
|
|
3152
|
+
* @returns Paginated list of rule evaluations.
|
|
3153
|
+
*/
|
|
3154
|
+
async getEvaluations(scanUuid, opts) {
|
|
3155
|
+
if (!isValidUuid(scanUuid)) {
|
|
3156
|
+
throw new AISecSDKException(
|
|
3157
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
3158
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3159
|
+
);
|
|
3160
|
+
}
|
|
3161
|
+
const res = await managementHttpRequest({
|
|
3162
|
+
method: "GET",
|
|
3163
|
+
baseUrl: this.baseUrl,
|
|
3164
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/evaluations`,
|
|
3165
|
+
params: buildListParams(opts),
|
|
3166
|
+
oauthClient: this.oauthClient,
|
|
3167
|
+
numRetries: this.numRetries
|
|
3168
|
+
});
|
|
3169
|
+
return res.data;
|
|
3170
|
+
}
|
|
3171
|
+
/**
|
|
3172
|
+
* Get files for a scan.
|
|
3173
|
+
* @param scanUuid - Scan UUID.
|
|
3174
|
+
* @param opts - Pagination and file filter options.
|
|
3175
|
+
* @returns Paginated list of files.
|
|
3176
|
+
*/
|
|
3177
|
+
async getFiles(scanUuid, opts) {
|
|
3178
|
+
if (!isValidUuid(scanUuid)) {
|
|
3179
|
+
throw new AISecSDKException(
|
|
3180
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
3181
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3182
|
+
);
|
|
3183
|
+
}
|
|
3184
|
+
const params = buildListParams(opts);
|
|
3185
|
+
if (opts?.type !== void 0) params.type = opts.type;
|
|
3186
|
+
if (opts?.result !== void 0) params.result = opts.result;
|
|
3187
|
+
const res = await managementHttpRequest({
|
|
3188
|
+
method: "GET",
|
|
3189
|
+
baseUrl: this.baseUrl,
|
|
3190
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/files`,
|
|
3191
|
+
params,
|
|
3192
|
+
oauthClient: this.oauthClient,
|
|
3193
|
+
numRetries: this.numRetries
|
|
3194
|
+
});
|
|
3195
|
+
return res.data;
|
|
3196
|
+
}
|
|
3197
|
+
/**
|
|
3198
|
+
* Add labels to a scan (merge with existing).
|
|
3199
|
+
* @param scanUuid - Scan UUID.
|
|
3200
|
+
* @param request - Labels to add.
|
|
3201
|
+
* @returns Labels response.
|
|
3202
|
+
*/
|
|
3203
|
+
async addLabels(scanUuid, request) {
|
|
3204
|
+
if (!isValidUuid(scanUuid)) {
|
|
3205
|
+
throw new AISecSDKException(
|
|
3206
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
3207
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3208
|
+
);
|
|
3209
|
+
}
|
|
3210
|
+
const res = await managementHttpRequest({
|
|
3211
|
+
method: "POST",
|
|
3212
|
+
baseUrl: this.baseUrl,
|
|
3213
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels`,
|
|
3214
|
+
body: request,
|
|
3215
|
+
oauthClient: this.oauthClient,
|
|
3216
|
+
numRetries: this.numRetries
|
|
3217
|
+
});
|
|
3218
|
+
return res.data;
|
|
3219
|
+
}
|
|
3220
|
+
/**
|
|
3221
|
+
* Set labels on a scan (replace all existing).
|
|
3222
|
+
* @param scanUuid - Scan UUID.
|
|
3223
|
+
* @param request - Labels to set.
|
|
3224
|
+
* @returns Labels response.
|
|
3225
|
+
*/
|
|
3226
|
+
async setLabels(scanUuid, request) {
|
|
3227
|
+
if (!isValidUuid(scanUuid)) {
|
|
3228
|
+
throw new AISecSDKException(
|
|
3229
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
3230
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3231
|
+
);
|
|
3232
|
+
}
|
|
3233
|
+
const res = await managementHttpRequest({
|
|
3234
|
+
method: "PUT",
|
|
3235
|
+
baseUrl: this.baseUrl,
|
|
3236
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels`,
|
|
3237
|
+
body: request,
|
|
3238
|
+
oauthClient: this.oauthClient,
|
|
3239
|
+
numRetries: this.numRetries
|
|
3240
|
+
});
|
|
3241
|
+
return res.data;
|
|
3242
|
+
}
|
|
3243
|
+
/**
|
|
3244
|
+
* Delete labels from a scan by key.
|
|
3245
|
+
* @param scanUuid - Scan UUID.
|
|
3246
|
+
* @param keys - Label keys to delete.
|
|
3247
|
+
*/
|
|
3248
|
+
async deleteLabels(scanUuid, keys) {
|
|
3249
|
+
if (!isValidUuid(scanUuid)) {
|
|
3250
|
+
throw new AISecSDKException(
|
|
3251
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
3252
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3253
|
+
);
|
|
3254
|
+
}
|
|
3255
|
+
const url = new URL(`https://placeholder${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels`);
|
|
3256
|
+
for (const key of keys) {
|
|
3257
|
+
url.searchParams.append("keys", key);
|
|
3258
|
+
}
|
|
3259
|
+
const queryString = url.searchParams.toString();
|
|
3260
|
+
const pathWithQuery = `${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels${queryString ? `?${queryString}` : ""}`;
|
|
3261
|
+
await managementHttpRequest({
|
|
3262
|
+
method: "DELETE",
|
|
3263
|
+
baseUrl: this.baseUrl,
|
|
3264
|
+
path: pathWithQuery,
|
|
3265
|
+
oauthClient: this.oauthClient,
|
|
3266
|
+
numRetries: this.numRetries
|
|
3267
|
+
});
|
|
3268
|
+
}
|
|
3269
|
+
/**
|
|
3270
|
+
* Get rule violations for a scan.
|
|
3271
|
+
* @param scanUuid - Scan UUID.
|
|
3272
|
+
* @param opts - Pagination options.
|
|
3273
|
+
* @returns Paginated list of violations.
|
|
3274
|
+
*/
|
|
3275
|
+
async getViolations(scanUuid, opts) {
|
|
3276
|
+
if (!isValidUuid(scanUuid)) {
|
|
3277
|
+
throw new AISecSDKException(
|
|
3278
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
3279
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3280
|
+
);
|
|
3281
|
+
}
|
|
3282
|
+
const res = await managementHttpRequest({
|
|
3283
|
+
method: "GET",
|
|
3284
|
+
baseUrl: this.baseUrl,
|
|
3285
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/rule-violations`,
|
|
3286
|
+
params: buildListParams(opts),
|
|
3287
|
+
oauthClient: this.oauthClient,
|
|
3288
|
+
numRetries: this.numRetries
|
|
3289
|
+
});
|
|
3290
|
+
return res.data;
|
|
3291
|
+
}
|
|
3292
|
+
/**
|
|
3293
|
+
* Get distinct label keys across all scans.
|
|
3294
|
+
* @param opts - Pagination options.
|
|
3295
|
+
* @returns Paginated list of label keys.
|
|
3296
|
+
*/
|
|
3297
|
+
async getLabelKeys(opts) {
|
|
3298
|
+
const res = await managementHttpRequest({
|
|
3299
|
+
method: "GET",
|
|
3300
|
+
baseUrl: this.baseUrl,
|
|
3301
|
+
path: `${MODEL_SEC_SCANS_PATH}/label-keys`,
|
|
3302
|
+
params: buildListParams(opts),
|
|
3303
|
+
oauthClient: this.oauthClient,
|
|
3304
|
+
numRetries: this.numRetries
|
|
3305
|
+
});
|
|
3306
|
+
return res.data;
|
|
3307
|
+
}
|
|
3308
|
+
/**
|
|
3309
|
+
* Get distinct values for a label key.
|
|
3310
|
+
* @param key - Label key to get values for.
|
|
3311
|
+
* @param opts - Pagination options.
|
|
3312
|
+
* @returns Paginated list of label values.
|
|
3313
|
+
*/
|
|
3314
|
+
async getLabelValues(key, opts) {
|
|
3315
|
+
const res = await managementHttpRequest({
|
|
3316
|
+
method: "GET",
|
|
3317
|
+
baseUrl: this.baseUrl,
|
|
3318
|
+
path: `${MODEL_SEC_SCANS_PATH}/label-keys/${encodeURIComponent(key)}/values`,
|
|
3319
|
+
params: buildListParams(opts),
|
|
3320
|
+
oauthClient: this.oauthClient,
|
|
3321
|
+
numRetries: this.numRetries
|
|
3322
|
+
});
|
|
3323
|
+
return res.data;
|
|
3324
|
+
}
|
|
3325
|
+
/**
|
|
3326
|
+
* Get a single rule evaluation by UUID.
|
|
3327
|
+
* @param uuid - Evaluation UUID.
|
|
3328
|
+
* @returns The rule evaluation response.
|
|
3329
|
+
*/
|
|
3330
|
+
async getEvaluation(uuid) {
|
|
3331
|
+
if (!isValidUuid(uuid)) {
|
|
3332
|
+
throw new AISecSDKException(
|
|
3333
|
+
`Invalid evaluation uuid: ${uuid}`,
|
|
3334
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3335
|
+
);
|
|
3336
|
+
}
|
|
3337
|
+
const res = await managementHttpRequest({
|
|
3338
|
+
method: "GET",
|
|
3339
|
+
baseUrl: this.baseUrl,
|
|
3340
|
+
path: `${MODEL_SEC_EVALUATIONS_PATH}/${uuid}`,
|
|
3341
|
+
oauthClient: this.oauthClient,
|
|
3342
|
+
numRetries: this.numRetries
|
|
3343
|
+
});
|
|
3344
|
+
return res.data;
|
|
3345
|
+
}
|
|
3346
|
+
/**
|
|
3347
|
+
* Get a single violation by UUID.
|
|
3348
|
+
* @param uuid - Violation UUID.
|
|
3349
|
+
* @returns The violation response.
|
|
3350
|
+
*/
|
|
3351
|
+
async getViolation(uuid) {
|
|
3352
|
+
if (!isValidUuid(uuid)) {
|
|
3353
|
+
throw new AISecSDKException(
|
|
3354
|
+
`Invalid violation uuid: ${uuid}`,
|
|
3355
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3356
|
+
);
|
|
3357
|
+
}
|
|
3358
|
+
const res = await managementHttpRequest({
|
|
3359
|
+
method: "GET",
|
|
3360
|
+
baseUrl: this.baseUrl,
|
|
3361
|
+
path: `${MODEL_SEC_VIOLATIONS_PATH}/${uuid}`,
|
|
3362
|
+
oauthClient: this.oauthClient,
|
|
3363
|
+
numRetries: this.numRetries
|
|
3364
|
+
});
|
|
3365
|
+
return res.data;
|
|
3366
|
+
}
|
|
3367
|
+
};
|
|
3368
|
+
|
|
3369
|
+
// src/model-security/security-groups-client.ts
|
|
3370
|
+
function buildListParams2(opts) {
|
|
3371
|
+
const params = {};
|
|
3372
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3373
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3374
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3375
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3376
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3377
|
+
return params;
|
|
3378
|
+
}
|
|
3379
|
+
var ModelSecurityGroupsClient = class {
|
|
3380
|
+
baseUrl;
|
|
3381
|
+
oauthClient;
|
|
3382
|
+
numRetries;
|
|
3383
|
+
constructor(opts) {
|
|
3384
|
+
this.baseUrl = opts.baseUrl;
|
|
3385
|
+
this.oauthClient = opts.oauthClient;
|
|
3386
|
+
this.numRetries = opts.numRetries;
|
|
3387
|
+
}
|
|
3388
|
+
/**
|
|
3389
|
+
* Create a new security group.
|
|
3390
|
+
* @param request - Security group creation request.
|
|
3391
|
+
* @returns The created security group.
|
|
3392
|
+
*/
|
|
3393
|
+
async create(request) {
|
|
3394
|
+
const res = await managementHttpRequest({
|
|
3395
|
+
method: "POST",
|
|
3396
|
+
baseUrl: this.baseUrl,
|
|
3397
|
+
path: MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
3398
|
+
body: request,
|
|
3399
|
+
oauthClient: this.oauthClient,
|
|
3400
|
+
numRetries: this.numRetries
|
|
3401
|
+
});
|
|
3402
|
+
return res.data;
|
|
3403
|
+
}
|
|
3404
|
+
/**
|
|
3405
|
+
* List security groups with optional filters.
|
|
3406
|
+
* @param opts - Pagination and filter options.
|
|
3407
|
+
* @returns Paginated list of security groups.
|
|
3408
|
+
*/
|
|
3409
|
+
async list(opts) {
|
|
3410
|
+
const res = await managementHttpRequest({
|
|
3411
|
+
method: "GET",
|
|
3412
|
+
baseUrl: this.baseUrl,
|
|
3413
|
+
path: MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
3414
|
+
params: buildListParams2(opts),
|
|
3415
|
+
oauthClient: this.oauthClient,
|
|
3416
|
+
numRetries: this.numRetries
|
|
3417
|
+
});
|
|
3418
|
+
return res.data;
|
|
3419
|
+
}
|
|
3420
|
+
/**
|
|
3421
|
+
* Get a single security group by UUID.
|
|
3422
|
+
* @param uuid - Security group UUID.
|
|
3423
|
+
* @returns The security group.
|
|
3424
|
+
*/
|
|
3425
|
+
async get(uuid) {
|
|
3426
|
+
if (!isValidUuid(uuid)) {
|
|
3427
|
+
throw new AISecSDKException(
|
|
3428
|
+
`Invalid security group uuid: ${uuid}`,
|
|
3429
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3430
|
+
);
|
|
3431
|
+
}
|
|
3432
|
+
const res = await managementHttpRequest({
|
|
3433
|
+
method: "GET",
|
|
3434
|
+
baseUrl: this.baseUrl,
|
|
3435
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
|
|
3436
|
+
oauthClient: this.oauthClient,
|
|
3437
|
+
numRetries: this.numRetries
|
|
3438
|
+
});
|
|
3439
|
+
return res.data;
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* Update an existing security group.
|
|
3443
|
+
* @param uuid - Security group UUID.
|
|
3444
|
+
* @param request - Updated security group fields.
|
|
3445
|
+
* @returns The updated security group.
|
|
3446
|
+
*/
|
|
3447
|
+
async update(uuid, request) {
|
|
3448
|
+
if (!isValidUuid(uuid)) {
|
|
3449
|
+
throw new AISecSDKException(
|
|
3450
|
+
`Invalid security group uuid: ${uuid}`,
|
|
3451
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3454
|
+
const res = await managementHttpRequest({
|
|
3455
|
+
method: "PUT",
|
|
3456
|
+
baseUrl: this.baseUrl,
|
|
3457
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
|
|
3458
|
+
body: request,
|
|
3459
|
+
oauthClient: this.oauthClient,
|
|
3460
|
+
numRetries: this.numRetries
|
|
3461
|
+
});
|
|
3462
|
+
return res.data;
|
|
3463
|
+
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Delete a security group.
|
|
3466
|
+
* @param uuid - Security group UUID.
|
|
3467
|
+
*/
|
|
3468
|
+
async delete(uuid) {
|
|
3469
|
+
if (!isValidUuid(uuid)) {
|
|
3470
|
+
throw new AISecSDKException(
|
|
3471
|
+
`Invalid security group uuid: ${uuid}`,
|
|
3472
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3473
|
+
);
|
|
3474
|
+
}
|
|
3475
|
+
await managementHttpRequest({
|
|
3476
|
+
method: "DELETE",
|
|
3477
|
+
baseUrl: this.baseUrl,
|
|
3478
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
|
|
3479
|
+
oauthClient: this.oauthClient,
|
|
3480
|
+
numRetries: this.numRetries
|
|
3481
|
+
});
|
|
3482
|
+
}
|
|
3483
|
+
/**
|
|
3484
|
+
* List rule instances for a security group.
|
|
3485
|
+
* @param securityGroupUuid - Security group UUID.
|
|
3486
|
+
* @param opts - Pagination options.
|
|
3487
|
+
* @returns Paginated list of rule instances.
|
|
3488
|
+
*/
|
|
3489
|
+
async listRuleInstances(securityGroupUuid, opts) {
|
|
3490
|
+
if (!isValidUuid(securityGroupUuid)) {
|
|
3491
|
+
throw new AISecSDKException(
|
|
3492
|
+
`Invalid security group uuid: ${securityGroupUuid}`,
|
|
3493
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3494
|
+
);
|
|
3495
|
+
}
|
|
3496
|
+
const res = await managementHttpRequest({
|
|
3497
|
+
method: "GET",
|
|
3498
|
+
baseUrl: this.baseUrl,
|
|
3499
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances`,
|
|
3500
|
+
params: buildListParams2(opts),
|
|
3501
|
+
oauthClient: this.oauthClient,
|
|
3502
|
+
numRetries: this.numRetries
|
|
3503
|
+
});
|
|
3504
|
+
return res.data;
|
|
3505
|
+
}
|
|
3506
|
+
/**
|
|
3507
|
+
* Get a single rule instance within a security group.
|
|
3508
|
+
* @param securityGroupUuid - Security group UUID.
|
|
3509
|
+
* @param ruleInstanceUuid - Rule instance UUID.
|
|
3510
|
+
* @returns The rule instance.
|
|
3511
|
+
*/
|
|
3512
|
+
async getRuleInstance(securityGroupUuid, ruleInstanceUuid) {
|
|
3513
|
+
if (!isValidUuid(securityGroupUuid)) {
|
|
3514
|
+
throw new AISecSDKException(
|
|
3515
|
+
`Invalid security group uuid: ${securityGroupUuid}`,
|
|
3516
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3517
|
+
);
|
|
3518
|
+
}
|
|
3519
|
+
if (!isValidUuid(ruleInstanceUuid)) {
|
|
3520
|
+
throw new AISecSDKException(
|
|
3521
|
+
`Invalid rule instance uuid: ${ruleInstanceUuid}`,
|
|
3522
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3523
|
+
);
|
|
3524
|
+
}
|
|
3525
|
+
const res = await managementHttpRequest({
|
|
3526
|
+
method: "GET",
|
|
3527
|
+
baseUrl: this.baseUrl,
|
|
3528
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances/${ruleInstanceUuid}`,
|
|
3529
|
+
oauthClient: this.oauthClient,
|
|
3530
|
+
numRetries: this.numRetries
|
|
3531
|
+
});
|
|
3532
|
+
return res.data;
|
|
3533
|
+
}
|
|
3534
|
+
/**
|
|
3535
|
+
* Update a rule instance within a security group.
|
|
3536
|
+
* @param securityGroupUuid - Security group UUID.
|
|
3537
|
+
* @param ruleInstanceUuid - Rule instance UUID.
|
|
3538
|
+
* @param request - Updated rule instance fields.
|
|
3539
|
+
* @returns The updated rule instance.
|
|
3540
|
+
*/
|
|
3541
|
+
async updateRuleInstance(securityGroupUuid, ruleInstanceUuid, request) {
|
|
3542
|
+
if (!isValidUuid(securityGroupUuid)) {
|
|
3543
|
+
throw new AISecSDKException(
|
|
3544
|
+
`Invalid security group uuid: ${securityGroupUuid}`,
|
|
3545
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3546
|
+
);
|
|
3547
|
+
}
|
|
3548
|
+
if (!isValidUuid(ruleInstanceUuid)) {
|
|
3549
|
+
throw new AISecSDKException(
|
|
3550
|
+
`Invalid rule instance uuid: ${ruleInstanceUuid}`,
|
|
3551
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3552
|
+
);
|
|
3553
|
+
}
|
|
3554
|
+
const res = await managementHttpRequest({
|
|
3555
|
+
method: "PUT",
|
|
3556
|
+
baseUrl: this.baseUrl,
|
|
3557
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances/${ruleInstanceUuid}`,
|
|
3558
|
+
body: request,
|
|
3559
|
+
oauthClient: this.oauthClient,
|
|
3560
|
+
numRetries: this.numRetries
|
|
3561
|
+
});
|
|
3562
|
+
return res.data;
|
|
3563
|
+
}
|
|
3564
|
+
};
|
|
3565
|
+
|
|
3566
|
+
// src/model-security/security-rules-client.ts
|
|
3567
|
+
function buildListParams3(opts) {
|
|
3568
|
+
const params = {};
|
|
3569
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3570
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3571
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3572
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3573
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3574
|
+
return params;
|
|
3575
|
+
}
|
|
3576
|
+
var ModelSecurityRulesClient = class {
|
|
3577
|
+
baseUrl;
|
|
3578
|
+
oauthClient;
|
|
3579
|
+
numRetries;
|
|
3580
|
+
constructor(opts) {
|
|
3581
|
+
this.baseUrl = opts.baseUrl;
|
|
3582
|
+
this.oauthClient = opts.oauthClient;
|
|
3583
|
+
this.numRetries = opts.numRetries;
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* List available security rules.
|
|
3587
|
+
* @param opts - Pagination options.
|
|
3588
|
+
* @returns Paginated list of security rules.
|
|
3589
|
+
*/
|
|
3590
|
+
async list(opts) {
|
|
3591
|
+
const res = await managementHttpRequest({
|
|
3592
|
+
method: "GET",
|
|
3593
|
+
baseUrl: this.baseUrl,
|
|
3594
|
+
path: MODEL_SEC_SECURITY_RULES_PATH,
|
|
3595
|
+
params: buildListParams3(opts),
|
|
3596
|
+
oauthClient: this.oauthClient,
|
|
3597
|
+
numRetries: this.numRetries
|
|
3598
|
+
});
|
|
3599
|
+
return res.data;
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* Get a single security rule by UUID.
|
|
3603
|
+
* @param uuid - Security rule UUID.
|
|
3604
|
+
* @returns The security rule.
|
|
3605
|
+
*/
|
|
3606
|
+
async get(uuid) {
|
|
3607
|
+
if (!isValidUuid(uuid)) {
|
|
3608
|
+
throw new AISecSDKException(
|
|
3609
|
+
`Invalid security rule uuid: ${uuid}`,
|
|
3610
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3611
|
+
);
|
|
3612
|
+
}
|
|
3613
|
+
const res = await managementHttpRequest({
|
|
3614
|
+
method: "GET",
|
|
3615
|
+
baseUrl: this.baseUrl,
|
|
3616
|
+
path: `${MODEL_SEC_SECURITY_RULES_PATH}/${uuid}`,
|
|
3617
|
+
oauthClient: this.oauthClient,
|
|
3618
|
+
numRetries: this.numRetries
|
|
3619
|
+
});
|
|
3620
|
+
return res.data;
|
|
3621
|
+
}
|
|
3622
|
+
};
|
|
3623
|
+
|
|
3624
|
+
// src/model-security/client.ts
|
|
3625
|
+
var ModelSecurityClient = class {
|
|
3626
|
+
/** Data plane scan operations. */
|
|
3627
|
+
scans;
|
|
3628
|
+
/** Management plane security group operations. */
|
|
3629
|
+
securityGroups;
|
|
3630
|
+
/** Management plane security rule operations (read-only). */
|
|
3631
|
+
securityRules;
|
|
3632
|
+
mgmtEndpoint;
|
|
3633
|
+
oauthClient;
|
|
3634
|
+
numRetries;
|
|
3635
|
+
constructor(opts = {}) {
|
|
3636
|
+
const clientId = opts.clientId ?? process.env[MODEL_SEC_CLIENT_ID] ?? process.env[MGMT_CLIENT_ID];
|
|
3637
|
+
const clientSecret = opts.clientSecret ?? process.env[MODEL_SEC_CLIENT_SECRET] ?? process.env[MGMT_CLIENT_SECRET];
|
|
3638
|
+
const tsgId = opts.tsgId ?? process.env[MODEL_SEC_TSG_ID] ?? process.env[MGMT_TSG_ID];
|
|
3639
|
+
const dataEndpoint = opts.dataEndpoint ?? process.env[MODEL_SEC_DATA_ENDPOINT] ?? DEFAULT_MODEL_SEC_DATA_ENDPOINT;
|
|
3640
|
+
const mgmtEndpoint = opts.mgmtEndpoint ?? process.env[MODEL_SEC_MGMT_ENDPOINT] ?? DEFAULT_MODEL_SEC_MGMT_ENDPOINT;
|
|
3641
|
+
const tokenEndpoint = opts.tokenEndpoint ?? process.env[MODEL_SEC_TOKEN_ENDPOINT] ?? process.env[MGMT_TOKEN_ENDPOINT];
|
|
3642
|
+
const numRetries = Math.min(
|
|
3643
|
+
Math.max(opts.numRetries ?? MAX_NUMBER_OF_RETRIES, 0),
|
|
3644
|
+
MAX_NUMBER_OF_RETRIES
|
|
3645
|
+
);
|
|
3646
|
+
if (!clientId) {
|
|
3647
|
+
throw new AISecSDKException(
|
|
3648
|
+
"clientId is required (option or PANW_MODEL_SEC_CLIENT_ID / PANW_MGMT_CLIENT_ID env var)",
|
|
3649
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
3650
|
+
);
|
|
3651
|
+
}
|
|
3652
|
+
if (!clientSecret) {
|
|
3653
|
+
throw new AISecSDKException(
|
|
3654
|
+
"clientSecret is required (option or PANW_MODEL_SEC_CLIENT_SECRET / PANW_MGMT_CLIENT_SECRET env var)",
|
|
3655
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
3656
|
+
);
|
|
3657
|
+
}
|
|
3658
|
+
if (!tsgId) {
|
|
3659
|
+
throw new AISecSDKException(
|
|
3660
|
+
"tsgId is required (option or PANW_MODEL_SEC_TSG_ID / PANW_MGMT_TSG_ID env var)",
|
|
3661
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
3662
|
+
);
|
|
3663
|
+
}
|
|
3664
|
+
this.oauthClient = new OAuthClient({
|
|
3665
|
+
clientId,
|
|
3666
|
+
clientSecret,
|
|
3667
|
+
tsgId,
|
|
3668
|
+
tokenEndpoint
|
|
3669
|
+
});
|
|
3670
|
+
this.mgmtEndpoint = mgmtEndpoint;
|
|
3671
|
+
this.numRetries = numRetries;
|
|
3672
|
+
this.scans = new ModelSecurityScansClient({
|
|
3673
|
+
baseUrl: dataEndpoint,
|
|
3674
|
+
oauthClient: this.oauthClient,
|
|
3675
|
+
numRetries
|
|
3676
|
+
});
|
|
3677
|
+
this.securityGroups = new ModelSecurityGroupsClient({
|
|
3678
|
+
baseUrl: mgmtEndpoint,
|
|
3679
|
+
oauthClient: this.oauthClient,
|
|
3680
|
+
numRetries
|
|
3681
|
+
});
|
|
3682
|
+
this.securityRules = new ModelSecurityRulesClient({
|
|
3683
|
+
baseUrl: mgmtEndpoint,
|
|
3684
|
+
oauthClient: this.oauthClient,
|
|
3685
|
+
numRetries
|
|
3686
|
+
});
|
|
3687
|
+
}
|
|
3688
|
+
/**
|
|
3689
|
+
* Get PyPI authentication credentials for Google Artifact Registry.
|
|
3690
|
+
* @returns PyPI auth response with URL and expiration.
|
|
3691
|
+
*/
|
|
3692
|
+
async getPyPIAuth() {
|
|
3693
|
+
const res = await managementHttpRequest({
|
|
3694
|
+
method: "GET",
|
|
3695
|
+
baseUrl: this.mgmtEndpoint,
|
|
3696
|
+
path: MODEL_SEC_PYPI_AUTH_PATH,
|
|
3697
|
+
oauthClient: this.oauthClient,
|
|
3698
|
+
numRetries: this.numRetries
|
|
3699
|
+
});
|
|
3700
|
+
return res.data;
|
|
3701
|
+
}
|
|
3702
|
+
};
|
|
3703
|
+
|
|
3704
|
+
// src/red-team/scans-client.ts
|
|
3705
|
+
function buildListParams4(opts) {
|
|
3706
|
+
const params = {};
|
|
3707
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3708
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3709
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3710
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3711
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3712
|
+
return params;
|
|
3713
|
+
}
|
|
3714
|
+
var RedTeamScansClient = class {
|
|
3715
|
+
baseUrl;
|
|
3716
|
+
oauthClient;
|
|
3717
|
+
numRetries;
|
|
3718
|
+
constructor(opts) {
|
|
3719
|
+
this.baseUrl = opts.baseUrl;
|
|
3720
|
+
this.oauthClient = opts.oauthClient;
|
|
3721
|
+
this.numRetries = opts.numRetries;
|
|
3722
|
+
}
|
|
3723
|
+
/** Create a new red team scan job. */
|
|
3724
|
+
async create(request) {
|
|
3725
|
+
const res = await managementHttpRequest({
|
|
3726
|
+
method: "POST",
|
|
3727
|
+
baseUrl: this.baseUrl,
|
|
3728
|
+
path: RED_TEAM_SCAN_PATH,
|
|
3729
|
+
body: request,
|
|
3730
|
+
oauthClient: this.oauthClient,
|
|
3731
|
+
numRetries: this.numRetries
|
|
3732
|
+
});
|
|
3733
|
+
return res.data;
|
|
3734
|
+
}
|
|
3735
|
+
/** List red team scan jobs with optional filters. */
|
|
3736
|
+
async list(opts) {
|
|
3737
|
+
const params = buildListParams4(opts);
|
|
3738
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
3739
|
+
if (opts?.job_type !== void 0) params.job_type = opts.job_type;
|
|
3740
|
+
if (opts?.target_id !== void 0) params.target_id = opts.target_id;
|
|
3741
|
+
const res = await managementHttpRequest({
|
|
3742
|
+
method: "GET",
|
|
3743
|
+
baseUrl: this.baseUrl,
|
|
3744
|
+
path: RED_TEAM_SCAN_PATH,
|
|
3745
|
+
params,
|
|
3746
|
+
oauthClient: this.oauthClient,
|
|
3747
|
+
numRetries: this.numRetries
|
|
3748
|
+
});
|
|
3749
|
+
return res.data;
|
|
3750
|
+
}
|
|
3751
|
+
/** Get a single scan job by ID. */
|
|
3752
|
+
async get(jobId) {
|
|
3753
|
+
if (!isValidUuid(jobId)) {
|
|
3754
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3755
|
+
}
|
|
3756
|
+
const res = await managementHttpRequest({
|
|
3757
|
+
method: "GET",
|
|
3758
|
+
baseUrl: this.baseUrl,
|
|
3759
|
+
path: `${RED_TEAM_SCAN_PATH}/${jobId}`,
|
|
3760
|
+
oauthClient: this.oauthClient,
|
|
3761
|
+
numRetries: this.numRetries
|
|
3762
|
+
});
|
|
3763
|
+
return res.data;
|
|
3764
|
+
}
|
|
3765
|
+
/** Abort a running scan job. */
|
|
3766
|
+
async abort(jobId) {
|
|
3767
|
+
if (!isValidUuid(jobId)) {
|
|
3768
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3769
|
+
}
|
|
3770
|
+
const res = await managementHttpRequest({
|
|
3771
|
+
method: "POST",
|
|
3772
|
+
baseUrl: this.baseUrl,
|
|
3773
|
+
path: `${RED_TEAM_SCAN_PATH}/${jobId}/abort`,
|
|
3774
|
+
oauthClient: this.oauthClient,
|
|
3775
|
+
numRetries: this.numRetries
|
|
3776
|
+
});
|
|
3777
|
+
return res.data;
|
|
3778
|
+
}
|
|
3779
|
+
/** Get all categories with subcategories. */
|
|
3780
|
+
async getCategories() {
|
|
3781
|
+
const res = await managementHttpRequest({
|
|
3782
|
+
method: "GET",
|
|
3783
|
+
baseUrl: this.baseUrl,
|
|
3784
|
+
path: RED_TEAM_CATEGORIES_PATH,
|
|
3785
|
+
oauthClient: this.oauthClient,
|
|
3786
|
+
numRetries: this.numRetries
|
|
3787
|
+
});
|
|
3788
|
+
return res.data;
|
|
3789
|
+
}
|
|
3790
|
+
};
|
|
3791
|
+
|
|
3792
|
+
// src/red-team/reports-client.ts
|
|
3793
|
+
function buildListParams5(opts) {
|
|
3794
|
+
const params = {};
|
|
3795
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3796
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3797
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3798
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3799
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3800
|
+
return params;
|
|
3801
|
+
}
|
|
3802
|
+
function validateJobId(jobId) {
|
|
3803
|
+
if (!isValidUuid(jobId)) {
|
|
3804
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
var RedTeamReportsClient = class {
|
|
3808
|
+
baseUrl;
|
|
3809
|
+
oauthClient;
|
|
3810
|
+
numRetries;
|
|
3811
|
+
constructor(opts) {
|
|
3812
|
+
this.baseUrl = opts.baseUrl;
|
|
3813
|
+
this.oauthClient = opts.oauthClient;
|
|
3814
|
+
this.numRetries = opts.numRetries;
|
|
3815
|
+
}
|
|
3816
|
+
// -----------------------------------------------------------------------
|
|
3817
|
+
// Static (attack library) report endpoints
|
|
3818
|
+
// -----------------------------------------------------------------------
|
|
3819
|
+
/** List attacks for a static scan. */
|
|
3820
|
+
async listAttacks(jobId, opts) {
|
|
3821
|
+
validateJobId(jobId);
|
|
3822
|
+
const params = buildListParams5(opts);
|
|
3823
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
3824
|
+
if (opts?.severity !== void 0) params.severity = opts.severity;
|
|
3825
|
+
if (opts?.category !== void 0) params.category = opts.category;
|
|
3826
|
+
if (opts?.sub_category !== void 0) params.sub_category = opts.sub_category;
|
|
3827
|
+
const res = await managementHttpRequest({
|
|
3828
|
+
method: "GET",
|
|
3829
|
+
baseUrl: this.baseUrl,
|
|
3830
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/list-attacks`,
|
|
3831
|
+
params,
|
|
3832
|
+
oauthClient: this.oauthClient,
|
|
3833
|
+
numRetries: this.numRetries
|
|
3834
|
+
});
|
|
3835
|
+
return res.data;
|
|
3836
|
+
}
|
|
3837
|
+
/** Get attack details for a static scan. */
|
|
3838
|
+
async getAttackDetail(jobId, attackId) {
|
|
3839
|
+
validateJobId(jobId);
|
|
3840
|
+
if (!isValidUuid(attackId)) {
|
|
3841
|
+
throw new AISecSDKException(
|
|
3842
|
+
`Invalid attack id: ${attackId}`,
|
|
3843
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3844
|
+
);
|
|
3845
|
+
}
|
|
3846
|
+
const res = await managementHttpRequest({
|
|
3847
|
+
method: "GET",
|
|
3848
|
+
baseUrl: this.baseUrl,
|
|
3849
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/attack/${attackId}`,
|
|
3850
|
+
oauthClient: this.oauthClient,
|
|
3851
|
+
numRetries: this.numRetries
|
|
3852
|
+
});
|
|
3853
|
+
return res.data;
|
|
3854
|
+
}
|
|
3855
|
+
/** Get multi-turn attack details for a static scan. */
|
|
3856
|
+
async getMultiTurnAttackDetail(jobId, attackId) {
|
|
3857
|
+
validateJobId(jobId);
|
|
3858
|
+
if (!isValidUuid(attackId)) {
|
|
3859
|
+
throw new AISecSDKException(
|
|
3860
|
+
`Invalid attack id: ${attackId}`,
|
|
3861
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3862
|
+
);
|
|
3863
|
+
}
|
|
3864
|
+
const res = await managementHttpRequest({
|
|
3865
|
+
method: "GET",
|
|
3866
|
+
baseUrl: this.baseUrl,
|
|
3867
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/attack-multi-turn/${attackId}`,
|
|
3868
|
+
oauthClient: this.oauthClient,
|
|
3869
|
+
numRetries: this.numRetries
|
|
3870
|
+
});
|
|
3871
|
+
return res.data;
|
|
3872
|
+
}
|
|
3873
|
+
/** Get the attack library report for a static scan. */
|
|
3874
|
+
async getStaticReport(jobId) {
|
|
3875
|
+
validateJobId(jobId);
|
|
3876
|
+
const res = await managementHttpRequest({
|
|
3877
|
+
method: "GET",
|
|
3878
|
+
baseUrl: this.baseUrl,
|
|
3879
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/report`,
|
|
3880
|
+
oauthClient: this.oauthClient,
|
|
3881
|
+
numRetries: this.numRetries
|
|
3882
|
+
});
|
|
3883
|
+
return res.data;
|
|
3884
|
+
}
|
|
3885
|
+
/** Get remediation recommendations for a static scan. */
|
|
3886
|
+
async getStaticRemediation(jobId) {
|
|
3887
|
+
validateJobId(jobId);
|
|
3888
|
+
const res = await managementHttpRequest({
|
|
3889
|
+
method: "GET",
|
|
3890
|
+
baseUrl: this.baseUrl,
|
|
3891
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/remediation`,
|
|
3892
|
+
oauthClient: this.oauthClient,
|
|
3893
|
+
numRetries: this.numRetries
|
|
3894
|
+
});
|
|
3895
|
+
return res.data;
|
|
3896
|
+
}
|
|
3897
|
+
/** Get runtime security profile config for a static scan. */
|
|
3898
|
+
async getStaticRuntimePolicy(jobId) {
|
|
3899
|
+
validateJobId(jobId);
|
|
3900
|
+
const res = await managementHttpRequest({
|
|
3901
|
+
method: "GET",
|
|
3902
|
+
baseUrl: this.baseUrl,
|
|
3903
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/runtime-policy-config`,
|
|
3904
|
+
oauthClient: this.oauthClient,
|
|
3905
|
+
numRetries: this.numRetries
|
|
3906
|
+
});
|
|
3907
|
+
return res.data;
|
|
3908
|
+
}
|
|
3909
|
+
// -----------------------------------------------------------------------
|
|
3910
|
+
// Dynamic (agent) report endpoints
|
|
3911
|
+
// -----------------------------------------------------------------------
|
|
3912
|
+
/** Get the agent scan report for a dynamic scan. */
|
|
3913
|
+
async getDynamicReport(jobId) {
|
|
3914
|
+
validateJobId(jobId);
|
|
3915
|
+
const res = await managementHttpRequest({
|
|
3916
|
+
method: "GET",
|
|
3917
|
+
baseUrl: this.baseUrl,
|
|
3918
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/report`,
|
|
3919
|
+
oauthClient: this.oauthClient,
|
|
3920
|
+
numRetries: this.numRetries
|
|
3921
|
+
});
|
|
3922
|
+
return res.data;
|
|
3923
|
+
}
|
|
3924
|
+
/** Get remediation recommendations for a dynamic scan. */
|
|
3925
|
+
async getDynamicRemediation(jobId) {
|
|
3926
|
+
validateJobId(jobId);
|
|
3927
|
+
const res = await managementHttpRequest({
|
|
3928
|
+
method: "GET",
|
|
3929
|
+
baseUrl: this.baseUrl,
|
|
3930
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/remediation`,
|
|
3931
|
+
oauthClient: this.oauthClient,
|
|
3932
|
+
numRetries: this.numRetries
|
|
3933
|
+
});
|
|
3934
|
+
return res.data;
|
|
3935
|
+
}
|
|
3936
|
+
/** Get runtime security profile config for a dynamic scan. */
|
|
3937
|
+
async getDynamicRuntimePolicy(jobId) {
|
|
3938
|
+
validateJobId(jobId);
|
|
3939
|
+
const res = await managementHttpRequest({
|
|
3940
|
+
method: "GET",
|
|
3941
|
+
baseUrl: this.baseUrl,
|
|
3942
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/runtime-policy-config`,
|
|
3943
|
+
oauthClient: this.oauthClient,
|
|
3944
|
+
numRetries: this.numRetries
|
|
3945
|
+
});
|
|
3946
|
+
return res.data;
|
|
3947
|
+
}
|
|
3948
|
+
/** List goals for a dynamic scan. */
|
|
3949
|
+
async listGoals(jobId, opts) {
|
|
3950
|
+
validateJobId(jobId);
|
|
3951
|
+
const params = buildListParams5(opts);
|
|
3952
|
+
if (opts?.goal_type !== void 0) params.goal_type = opts.goal_type;
|
|
3953
|
+
const res = await managementHttpRequest({
|
|
3954
|
+
method: "GET",
|
|
3955
|
+
baseUrl: this.baseUrl,
|
|
3956
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/list-goals`,
|
|
3957
|
+
params,
|
|
3958
|
+
oauthClient: this.oauthClient,
|
|
3959
|
+
numRetries: this.numRetries
|
|
3960
|
+
});
|
|
3961
|
+
return res.data;
|
|
3962
|
+
}
|
|
3963
|
+
/** List streams for a goal in a dynamic scan. */
|
|
3964
|
+
async listGoalStreams(jobId, goalId, opts) {
|
|
3965
|
+
validateJobId(jobId);
|
|
3966
|
+
if (!isValidUuid(goalId)) {
|
|
3967
|
+
throw new AISecSDKException(
|
|
3968
|
+
`Invalid goal id: ${goalId}`,
|
|
3969
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3970
|
+
);
|
|
3971
|
+
}
|
|
3972
|
+
const res = await managementHttpRequest({
|
|
3973
|
+
method: "GET",
|
|
3974
|
+
baseUrl: this.baseUrl,
|
|
3975
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/goal/${goalId}/list-streams`,
|
|
3976
|
+
params: buildListParams5(opts),
|
|
3977
|
+
oauthClient: this.oauthClient,
|
|
3978
|
+
numRetries: this.numRetries
|
|
3979
|
+
});
|
|
3980
|
+
return res.data;
|
|
3981
|
+
}
|
|
3982
|
+
// -----------------------------------------------------------------------
|
|
3983
|
+
// Common report endpoints
|
|
3984
|
+
// -----------------------------------------------------------------------
|
|
3985
|
+
/** Get stream details by stream ID. */
|
|
3986
|
+
async getStreamDetail(streamId) {
|
|
3987
|
+
if (!isValidUuid(streamId)) {
|
|
3988
|
+
throw new AISecSDKException(
|
|
3989
|
+
`Invalid stream id: ${streamId}`,
|
|
3990
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3991
|
+
);
|
|
3992
|
+
}
|
|
3993
|
+
const res = await managementHttpRequest({
|
|
3994
|
+
method: "GET",
|
|
3995
|
+
baseUrl: this.baseUrl,
|
|
3996
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/stream/${streamId}`,
|
|
3997
|
+
oauthClient: this.oauthClient,
|
|
3998
|
+
numRetries: this.numRetries
|
|
3999
|
+
});
|
|
4000
|
+
return res.data;
|
|
4001
|
+
}
|
|
4002
|
+
/** Download a report in the specified format. */
|
|
4003
|
+
async downloadReport(jobId, format) {
|
|
4004
|
+
validateJobId(jobId);
|
|
4005
|
+
const params = {};
|
|
4006
|
+
if (format !== void 0) params.file_format = format;
|
|
4007
|
+
const res = await managementHttpRequest({
|
|
4008
|
+
method: "GET",
|
|
4009
|
+
baseUrl: this.baseUrl,
|
|
4010
|
+
path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
|
|
4011
|
+
params,
|
|
4012
|
+
oauthClient: this.oauthClient,
|
|
4013
|
+
numRetries: this.numRetries
|
|
4014
|
+
});
|
|
4015
|
+
return res.data;
|
|
4016
|
+
}
|
|
4017
|
+
/** Generate a partial report for a running scan. */
|
|
4018
|
+
async generatePartialReport(jobId) {
|
|
4019
|
+
validateJobId(jobId);
|
|
4020
|
+
const res = await managementHttpRequest({
|
|
4021
|
+
method: "POST",
|
|
4022
|
+
baseUrl: this.baseUrl,
|
|
4023
|
+
path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
|
|
4024
|
+
oauthClient: this.oauthClient,
|
|
4025
|
+
numRetries: this.numRetries
|
|
4026
|
+
});
|
|
4027
|
+
return res.data;
|
|
4028
|
+
}
|
|
4029
|
+
};
|
|
4030
|
+
|
|
4031
|
+
// src/red-team/custom-attack-reports-client.ts
|
|
4032
|
+
function buildListParams6(opts) {
|
|
4033
|
+
const params = {};
|
|
4034
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4035
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4036
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4037
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4038
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
4039
|
+
return params;
|
|
4040
|
+
}
|
|
4041
|
+
function validateJobId2(jobId) {
|
|
4042
|
+
if (!isValidUuid(jobId)) {
|
|
4043
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
4044
|
+
}
|
|
4045
|
+
}
|
|
4046
|
+
var RedTeamCustomAttackReportsClient = class {
|
|
4047
|
+
baseUrl;
|
|
4048
|
+
oauthClient;
|
|
4049
|
+
numRetries;
|
|
4050
|
+
constructor(opts) {
|
|
4051
|
+
this.baseUrl = opts.baseUrl;
|
|
4052
|
+
this.oauthClient = opts.oauthClient;
|
|
4053
|
+
this.numRetries = opts.numRetries;
|
|
4054
|
+
}
|
|
4055
|
+
/** Get custom attack report for a scan. */
|
|
4056
|
+
async getReport(jobId) {
|
|
4057
|
+
validateJobId2(jobId);
|
|
4058
|
+
const res = await managementHttpRequest({
|
|
4059
|
+
method: "GET",
|
|
4060
|
+
baseUrl: this.baseUrl,
|
|
4061
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}`,
|
|
4062
|
+
oauthClient: this.oauthClient,
|
|
4063
|
+
numRetries: this.numRetries
|
|
4064
|
+
});
|
|
4065
|
+
return res.data;
|
|
4066
|
+
}
|
|
4067
|
+
/** Get prompt sets for a custom attack scan. */
|
|
4068
|
+
async getPromptSets(jobId) {
|
|
4069
|
+
validateJobId2(jobId);
|
|
4070
|
+
const res = await managementHttpRequest({
|
|
4071
|
+
method: "GET",
|
|
4072
|
+
baseUrl: this.baseUrl,
|
|
4073
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-sets`,
|
|
4074
|
+
oauthClient: this.oauthClient,
|
|
4075
|
+
numRetries: this.numRetries
|
|
4076
|
+
});
|
|
4077
|
+
return res.data;
|
|
4078
|
+
}
|
|
4079
|
+
/** Get prompts for a specific prompt set in a scan. */
|
|
4080
|
+
async getPromptsBySet(jobId, promptSetId, opts) {
|
|
4081
|
+
validateJobId2(jobId);
|
|
4082
|
+
if (!isValidUuid(promptSetId)) {
|
|
4083
|
+
throw new AISecSDKException(
|
|
4084
|
+
`Invalid prompt set id: ${promptSetId}`,
|
|
4085
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
4088
|
+
const res = await managementHttpRequest({
|
|
4089
|
+
method: "GET",
|
|
4090
|
+
baseUrl: this.baseUrl,
|
|
4091
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
4092
|
+
params: buildListParams6(opts),
|
|
4093
|
+
oauthClient: this.oauthClient,
|
|
4094
|
+
numRetries: this.numRetries
|
|
4095
|
+
});
|
|
4096
|
+
return res.data;
|
|
4097
|
+
}
|
|
4098
|
+
/** Get details for a specific prompt. */
|
|
4099
|
+
async getPromptDetail(jobId, promptId) {
|
|
4100
|
+
validateJobId2(jobId);
|
|
4101
|
+
if (!isValidUuid(promptId)) {
|
|
4102
|
+
throw new AISecSDKException(
|
|
4103
|
+
`Invalid prompt id: ${promptId}`,
|
|
4104
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4105
|
+
);
|
|
4106
|
+
}
|
|
4107
|
+
const res = await managementHttpRequest({
|
|
4108
|
+
method: "GET",
|
|
4109
|
+
baseUrl: this.baseUrl,
|
|
4110
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt/${promptId}`,
|
|
4111
|
+
oauthClient: this.oauthClient,
|
|
4112
|
+
numRetries: this.numRetries
|
|
4113
|
+
});
|
|
4114
|
+
return res.data;
|
|
4115
|
+
}
|
|
4116
|
+
/** List custom attacks for a scan. */
|
|
4117
|
+
async listCustomAttacks(jobId, opts) {
|
|
4118
|
+
validateJobId2(jobId);
|
|
4119
|
+
const res = await managementHttpRequest({
|
|
4120
|
+
method: "GET",
|
|
4121
|
+
baseUrl: this.baseUrl,
|
|
4122
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/list-custom-attacks`,
|
|
4123
|
+
params: buildListParams6(opts),
|
|
4124
|
+
oauthClient: this.oauthClient,
|
|
4125
|
+
numRetries: this.numRetries
|
|
4126
|
+
});
|
|
4127
|
+
return res.data;
|
|
4128
|
+
}
|
|
4129
|
+
/** Get attack outputs for a custom attack. */
|
|
4130
|
+
async getAttackOutputs(jobId, attackId) {
|
|
4131
|
+
validateJobId2(jobId);
|
|
4132
|
+
if (!isValidUuid(attackId)) {
|
|
4133
|
+
throw new AISecSDKException(
|
|
4134
|
+
`Invalid attack id: ${attackId}`,
|
|
4135
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4136
|
+
);
|
|
4137
|
+
}
|
|
4138
|
+
const res = await managementHttpRequest({
|
|
4139
|
+
method: "GET",
|
|
4140
|
+
baseUrl: this.baseUrl,
|
|
4141
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
|
|
4142
|
+
oauthClient: this.oauthClient,
|
|
4143
|
+
numRetries: this.numRetries
|
|
4144
|
+
});
|
|
4145
|
+
return res.data;
|
|
4146
|
+
}
|
|
4147
|
+
/** Get property statistics for a custom attack scan. */
|
|
4148
|
+
async getPropertyStats(jobId) {
|
|
4149
|
+
validateJobId2(jobId);
|
|
4150
|
+
const res = await managementHttpRequest({
|
|
4151
|
+
method: "GET",
|
|
4152
|
+
baseUrl: this.baseUrl,
|
|
4153
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
|
|
4154
|
+
oauthClient: this.oauthClient,
|
|
4155
|
+
numRetries: this.numRetries
|
|
4156
|
+
});
|
|
4157
|
+
return res.data;
|
|
4158
|
+
}
|
|
4159
|
+
};
|
|
4160
|
+
|
|
4161
|
+
// src/red-team/targets-client.ts
|
|
4162
|
+
function buildListParams7(opts) {
|
|
4163
|
+
const params = {};
|
|
4164
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4165
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4166
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4167
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4168
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
4169
|
+
return params;
|
|
4170
|
+
}
|
|
4171
|
+
var RedTeamTargetsClient = class {
|
|
4172
|
+
baseUrl;
|
|
4173
|
+
oauthClient;
|
|
4174
|
+
numRetries;
|
|
4175
|
+
constructor(opts) {
|
|
4176
|
+
this.baseUrl = opts.baseUrl;
|
|
4177
|
+
this.oauthClient = opts.oauthClient;
|
|
4178
|
+
this.numRetries = opts.numRetries;
|
|
4179
|
+
}
|
|
4180
|
+
/** Create a new target. */
|
|
4181
|
+
async create(request) {
|
|
4182
|
+
const res = await managementHttpRequest({
|
|
4183
|
+
method: "POST",
|
|
4184
|
+
baseUrl: this.baseUrl,
|
|
4185
|
+
path: RED_TEAM_TARGET_PATH,
|
|
4186
|
+
body: request,
|
|
4187
|
+
oauthClient: this.oauthClient,
|
|
4188
|
+
numRetries: this.numRetries
|
|
4189
|
+
});
|
|
4190
|
+
return res.data;
|
|
4191
|
+
}
|
|
4192
|
+
/** List targets with optional filters. */
|
|
4193
|
+
async list(opts) {
|
|
4194
|
+
const params = buildListParams7(opts);
|
|
4195
|
+
if (opts?.target_type !== void 0) params.target_type = opts.target_type;
|
|
4196
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
4197
|
+
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4198
|
+
const res = await managementHttpRequest({
|
|
4199
|
+
method: "GET",
|
|
4200
|
+
baseUrl: this.baseUrl,
|
|
4201
|
+
path: RED_TEAM_TARGET_PATH,
|
|
4202
|
+
params,
|
|
4203
|
+
oauthClient: this.oauthClient,
|
|
4204
|
+
numRetries: this.numRetries
|
|
4205
|
+
});
|
|
4206
|
+
return res.data;
|
|
4207
|
+
}
|
|
4208
|
+
/** Get a target by UUID. */
|
|
4209
|
+
async get(uuid) {
|
|
4210
|
+
if (!isValidUuid(uuid)) {
|
|
4211
|
+
throw new AISecSDKException(
|
|
4212
|
+
`Invalid target uuid: ${uuid}`,
|
|
4213
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4214
|
+
);
|
|
4215
|
+
}
|
|
4216
|
+
const res = await managementHttpRequest({
|
|
4217
|
+
method: "GET",
|
|
4218
|
+
baseUrl: this.baseUrl,
|
|
4219
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
|
|
4220
|
+
oauthClient: this.oauthClient,
|
|
4221
|
+
numRetries: this.numRetries
|
|
4222
|
+
});
|
|
4223
|
+
return res.data;
|
|
4224
|
+
}
|
|
4225
|
+
/** Update a target. */
|
|
4226
|
+
async update(uuid, request) {
|
|
4227
|
+
if (!isValidUuid(uuid)) {
|
|
4228
|
+
throw new AISecSDKException(
|
|
4229
|
+
`Invalid target uuid: ${uuid}`,
|
|
4230
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4231
|
+
);
|
|
4232
|
+
}
|
|
4233
|
+
const res = await managementHttpRequest({
|
|
4234
|
+
method: "PUT",
|
|
4235
|
+
baseUrl: this.baseUrl,
|
|
4236
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
|
|
4237
|
+
body: request,
|
|
4238
|
+
oauthClient: this.oauthClient,
|
|
4239
|
+
numRetries: this.numRetries
|
|
4240
|
+
});
|
|
4241
|
+
return res.data;
|
|
4242
|
+
}
|
|
4243
|
+
/** Delete a target. */
|
|
4244
|
+
async delete(uuid) {
|
|
4245
|
+
if (!isValidUuid(uuid)) {
|
|
4246
|
+
throw new AISecSDKException(
|
|
4247
|
+
`Invalid target uuid: ${uuid}`,
|
|
4248
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4249
|
+
);
|
|
4250
|
+
}
|
|
4251
|
+
const res = await managementHttpRequest({
|
|
4252
|
+
method: "DELETE",
|
|
4253
|
+
baseUrl: this.baseUrl,
|
|
4254
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
|
|
4255
|
+
oauthClient: this.oauthClient,
|
|
4256
|
+
numRetries: this.numRetries
|
|
4257
|
+
});
|
|
4258
|
+
return res.data;
|
|
4259
|
+
}
|
|
4260
|
+
/** Run profiling probes on a target. */
|
|
4261
|
+
async probe(request) {
|
|
4262
|
+
const res = await managementHttpRequest({
|
|
4263
|
+
method: "POST",
|
|
4264
|
+
baseUrl: this.baseUrl,
|
|
4265
|
+
path: `${RED_TEAM_TARGET_PATH}/probe`,
|
|
4266
|
+
body: request,
|
|
4267
|
+
oauthClient: this.oauthClient,
|
|
4268
|
+
numRetries: this.numRetries
|
|
4269
|
+
});
|
|
4270
|
+
return res.data;
|
|
4271
|
+
}
|
|
4272
|
+
/** Get profiling results for a target. */
|
|
4273
|
+
async getProfile(uuid) {
|
|
4274
|
+
if (!isValidUuid(uuid)) {
|
|
4275
|
+
throw new AISecSDKException(
|
|
4276
|
+
`Invalid target uuid: ${uuid}`,
|
|
4277
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4278
|
+
);
|
|
4279
|
+
}
|
|
4280
|
+
const res = await managementHttpRequest({
|
|
4281
|
+
method: "GET",
|
|
4282
|
+
baseUrl: this.baseUrl,
|
|
4283
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
|
|
4284
|
+
oauthClient: this.oauthClient,
|
|
4285
|
+
numRetries: this.numRetries
|
|
4286
|
+
});
|
|
4287
|
+
return res.data;
|
|
4288
|
+
}
|
|
4289
|
+
/** Update a target profile (background + additional context). */
|
|
4290
|
+
async updateProfile(uuid, request) {
|
|
4291
|
+
if (!isValidUuid(uuid)) {
|
|
4292
|
+
throw new AISecSDKException(
|
|
4293
|
+
`Invalid target uuid: ${uuid}`,
|
|
4294
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4295
|
+
);
|
|
4296
|
+
}
|
|
4297
|
+
const res = await managementHttpRequest({
|
|
4298
|
+
method: "PUT",
|
|
4299
|
+
baseUrl: this.baseUrl,
|
|
4300
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
|
|
4301
|
+
body: request,
|
|
4302
|
+
oauthClient: this.oauthClient,
|
|
4303
|
+
numRetries: this.numRetries
|
|
4304
|
+
});
|
|
4305
|
+
return res.data;
|
|
4306
|
+
}
|
|
4307
|
+
};
|
|
4308
|
+
|
|
4309
|
+
// src/red-team/custom-attacks-client.ts
|
|
4310
|
+
function buildListParams8(opts) {
|
|
4311
|
+
const params = {};
|
|
4312
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4313
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4314
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4315
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4316
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
4317
|
+
return params;
|
|
4318
|
+
}
|
|
4319
|
+
function validateUuid(uuid, label) {
|
|
4320
|
+
if (!isValidUuid(uuid)) {
|
|
4321
|
+
throw new AISecSDKException(`Invalid ${label}: ${uuid}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
var RedTeamCustomAttacksClient = class {
|
|
4325
|
+
baseUrl;
|
|
4326
|
+
oauthClient;
|
|
4327
|
+
numRetries;
|
|
4328
|
+
constructor(opts) {
|
|
4329
|
+
this.baseUrl = opts.baseUrl;
|
|
4330
|
+
this.oauthClient = opts.oauthClient;
|
|
4331
|
+
this.numRetries = opts.numRetries;
|
|
4332
|
+
}
|
|
4333
|
+
// -----------------------------------------------------------------------
|
|
4334
|
+
// Prompt Set operations
|
|
4335
|
+
// -----------------------------------------------------------------------
|
|
4336
|
+
/** Create a new custom prompt set. */
|
|
4337
|
+
async createPromptSet(request) {
|
|
4338
|
+
const res = await managementHttpRequest({
|
|
4339
|
+
method: "POST",
|
|
4340
|
+
baseUrl: this.baseUrl,
|
|
4341
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set`,
|
|
4342
|
+
body: request,
|
|
4343
|
+
oauthClient: this.oauthClient,
|
|
4344
|
+
numRetries: this.numRetries
|
|
4345
|
+
});
|
|
4346
|
+
return res.data;
|
|
4347
|
+
}
|
|
4348
|
+
/** List custom prompt sets. */
|
|
4349
|
+
async listPromptSets(opts) {
|
|
4350
|
+
const params = buildListParams8(opts);
|
|
4351
|
+
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4352
|
+
if (opts?.archive !== void 0) params.archive = String(opts.archive);
|
|
4353
|
+
const res = await managementHttpRequest({
|
|
4354
|
+
method: "GET",
|
|
4355
|
+
baseUrl: this.baseUrl,
|
|
4356
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/list-custom-prompt-sets`,
|
|
4357
|
+
params,
|
|
4358
|
+
oauthClient: this.oauthClient,
|
|
4359
|
+
numRetries: this.numRetries
|
|
4360
|
+
});
|
|
4361
|
+
return res.data;
|
|
4362
|
+
}
|
|
4363
|
+
/** Get a prompt set by UUID. */
|
|
4364
|
+
async getPromptSet(uuid) {
|
|
4365
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4366
|
+
const res = await managementHttpRequest({
|
|
4367
|
+
method: "GET",
|
|
4368
|
+
baseUrl: this.baseUrl,
|
|
4369
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
|
|
4370
|
+
oauthClient: this.oauthClient,
|
|
4371
|
+
numRetries: this.numRetries
|
|
4372
|
+
});
|
|
4373
|
+
return res.data;
|
|
4374
|
+
}
|
|
4375
|
+
/** Update a prompt set. */
|
|
4376
|
+
async updatePromptSet(uuid, request) {
|
|
4377
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4378
|
+
const res = await managementHttpRequest({
|
|
4379
|
+
method: "PUT",
|
|
4380
|
+
baseUrl: this.baseUrl,
|
|
4381
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
|
|
4382
|
+
body: request,
|
|
4383
|
+
oauthClient: this.oauthClient,
|
|
4384
|
+
numRetries: this.numRetries
|
|
4385
|
+
});
|
|
4386
|
+
return res.data;
|
|
4387
|
+
}
|
|
4388
|
+
/** Archive or unarchive a prompt set. */
|
|
4389
|
+
async archivePromptSet(uuid, request) {
|
|
4390
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4391
|
+
const res = await managementHttpRequest({
|
|
4392
|
+
method: "PUT",
|
|
4393
|
+
baseUrl: this.baseUrl,
|
|
4394
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/archive`,
|
|
4395
|
+
body: request,
|
|
4396
|
+
oauthClient: this.oauthClient,
|
|
4397
|
+
numRetries: this.numRetries
|
|
4398
|
+
});
|
|
4399
|
+
return res.data;
|
|
4400
|
+
}
|
|
4401
|
+
/** Resolve a prompt set reference for data plane consumption. */
|
|
4402
|
+
async getPromptSetReference(uuid) {
|
|
4403
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4404
|
+
const res = await managementHttpRequest({
|
|
4405
|
+
method: "GET",
|
|
4406
|
+
baseUrl: this.baseUrl,
|
|
4407
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/reference`,
|
|
4408
|
+
oauthClient: this.oauthClient,
|
|
4409
|
+
numRetries: this.numRetries
|
|
4410
|
+
});
|
|
4411
|
+
return res.data;
|
|
4412
|
+
}
|
|
4413
|
+
/** Get version information for a prompt set. */
|
|
4414
|
+
async getPromptSetVersionInfo(uuid) {
|
|
4415
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4416
|
+
const res = await managementHttpRequest({
|
|
4417
|
+
method: "GET",
|
|
4418
|
+
baseUrl: this.baseUrl,
|
|
4419
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/version-info`,
|
|
4420
|
+
oauthClient: this.oauthClient,
|
|
4421
|
+
numRetries: this.numRetries
|
|
4422
|
+
});
|
|
4423
|
+
return res.data;
|
|
4424
|
+
}
|
|
4425
|
+
/** List active prompt sets (for data plane). */
|
|
4426
|
+
async listActivePromptSets() {
|
|
4427
|
+
const res = await managementHttpRequest({
|
|
4428
|
+
method: "GET",
|
|
4429
|
+
baseUrl: this.baseUrl,
|
|
4430
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/active-custom-prompt-sets`,
|
|
4431
|
+
oauthClient: this.oauthClient,
|
|
4432
|
+
numRetries: this.numRetries
|
|
4433
|
+
});
|
|
4434
|
+
return res.data;
|
|
4435
|
+
}
|
|
4436
|
+
/** Download CSV template for a prompt set. */
|
|
4437
|
+
async downloadTemplate(uuid) {
|
|
4438
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4439
|
+
const res = await managementHttpRequest({
|
|
4440
|
+
method: "GET",
|
|
4441
|
+
baseUrl: this.baseUrl,
|
|
4442
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/download-template/${uuid}`,
|
|
4443
|
+
oauthClient: this.oauthClient,
|
|
4444
|
+
numRetries: this.numRetries
|
|
4445
|
+
});
|
|
4446
|
+
return res.data;
|
|
4447
|
+
}
|
|
4448
|
+
// -----------------------------------------------------------------------
|
|
4449
|
+
// Prompt operations
|
|
4450
|
+
// -----------------------------------------------------------------------
|
|
4451
|
+
/** Create a new custom prompt. */
|
|
4452
|
+
async createPrompt(request) {
|
|
4453
|
+
const res = await managementHttpRequest({
|
|
4454
|
+
method: "POST",
|
|
4455
|
+
baseUrl: this.baseUrl,
|
|
4456
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/custom-prompt`,
|
|
4457
|
+
body: request,
|
|
4458
|
+
oauthClient: this.oauthClient,
|
|
4459
|
+
numRetries: this.numRetries
|
|
4460
|
+
});
|
|
4461
|
+
return res.data;
|
|
4462
|
+
}
|
|
4463
|
+
/** List prompts in a prompt set. */
|
|
4464
|
+
async listPrompts(promptSetUuid, opts) {
|
|
4465
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4466
|
+
const params = buildListParams8(opts);
|
|
4467
|
+
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4468
|
+
const res = await managementHttpRequest({
|
|
4469
|
+
method: "GET",
|
|
4470
|
+
baseUrl: this.baseUrl,
|
|
4471
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/list-custom-prompts`,
|
|
4472
|
+
params,
|
|
4473
|
+
oauthClient: this.oauthClient,
|
|
4474
|
+
numRetries: this.numRetries
|
|
4475
|
+
});
|
|
4476
|
+
return res.data;
|
|
4477
|
+
}
|
|
4478
|
+
/** Get a prompt by UUID. */
|
|
4479
|
+
async getPrompt(promptSetUuid, promptUuid) {
|
|
4480
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4481
|
+
validateUuid(promptUuid, "prompt uuid");
|
|
4482
|
+
const res = await managementHttpRequest({
|
|
4483
|
+
method: "GET",
|
|
4484
|
+
baseUrl: this.baseUrl,
|
|
4485
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/custom-prompt/${promptUuid}`,
|
|
4486
|
+
oauthClient: this.oauthClient,
|
|
4487
|
+
numRetries: this.numRetries
|
|
4488
|
+
});
|
|
4489
|
+
return res.data;
|
|
4490
|
+
}
|
|
4491
|
+
/** Update a prompt. */
|
|
4492
|
+
async updatePrompt(promptSetUuid, promptUuid, request) {
|
|
4493
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4494
|
+
validateUuid(promptUuid, "prompt uuid");
|
|
4495
|
+
const res = await managementHttpRequest({
|
|
4496
|
+
method: "PUT",
|
|
4497
|
+
baseUrl: this.baseUrl,
|
|
4498
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/custom-prompt/${promptUuid}`,
|
|
4499
|
+
body: request,
|
|
4500
|
+
oauthClient: this.oauthClient,
|
|
4501
|
+
numRetries: this.numRetries
|
|
4502
|
+
});
|
|
4503
|
+
return res.data;
|
|
4504
|
+
}
|
|
4505
|
+
/** Delete a prompt. */
|
|
4506
|
+
async deletePrompt(promptSetUuid, promptUuid) {
|
|
4507
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4508
|
+
validateUuid(promptUuid, "prompt uuid");
|
|
4509
|
+
const res = await managementHttpRequest({
|
|
4510
|
+
method: "DELETE",
|
|
4511
|
+
baseUrl: this.baseUrl,
|
|
4512
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/custom-prompt/${promptUuid}`,
|
|
4513
|
+
oauthClient: this.oauthClient,
|
|
4514
|
+
numRetries: this.numRetries
|
|
4515
|
+
});
|
|
4516
|
+
return res.data;
|
|
4517
|
+
}
|
|
4518
|
+
// -----------------------------------------------------------------------
|
|
4519
|
+
// Property operations
|
|
4520
|
+
// -----------------------------------------------------------------------
|
|
4521
|
+
/** Get all property names. */
|
|
4522
|
+
async getPropertyNames() {
|
|
4523
|
+
const res = await managementHttpRequest({
|
|
4524
|
+
method: "GET",
|
|
4525
|
+
baseUrl: this.baseUrl,
|
|
4526
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-names`,
|
|
4527
|
+
oauthClient: this.oauthClient,
|
|
4528
|
+
numRetries: this.numRetries
|
|
4529
|
+
});
|
|
4530
|
+
return res.data;
|
|
4531
|
+
}
|
|
4532
|
+
/** Create a new property name. */
|
|
4533
|
+
async createPropertyName(request) {
|
|
4534
|
+
const res = await managementHttpRequest({
|
|
4535
|
+
method: "POST",
|
|
4536
|
+
baseUrl: this.baseUrl,
|
|
4537
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-names`,
|
|
4538
|
+
body: request,
|
|
4539
|
+
oauthClient: this.oauthClient,
|
|
4540
|
+
numRetries: this.numRetries
|
|
4541
|
+
});
|
|
4542
|
+
return res.data;
|
|
4543
|
+
}
|
|
4544
|
+
/** Get values for a property name. */
|
|
4545
|
+
async getPropertyValues(propertyName) {
|
|
4546
|
+
const res = await managementHttpRequest({
|
|
4547
|
+
method: "GET",
|
|
4548
|
+
baseUrl: this.baseUrl,
|
|
4549
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values/${encodeURIComponent(propertyName)}`,
|
|
4550
|
+
oauthClient: this.oauthClient,
|
|
4551
|
+
numRetries: this.numRetries
|
|
4552
|
+
});
|
|
4553
|
+
return res.data;
|
|
4554
|
+
}
|
|
4555
|
+
/** Get values for multiple property names. */
|
|
4556
|
+
async getPropertyValuesMultiple(propertyNames) {
|
|
4557
|
+
const url = new URL(`https://placeholder${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values`);
|
|
4558
|
+
for (const name of propertyNames) {
|
|
4559
|
+
url.searchParams.append("property_names", name);
|
|
4560
|
+
}
|
|
4561
|
+
const queryString = url.searchParams.toString();
|
|
4562
|
+
const pathWithQuery = `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values${queryString ? `?${queryString}` : ""}`;
|
|
4563
|
+
const res = await managementHttpRequest({
|
|
4564
|
+
method: "GET",
|
|
4565
|
+
baseUrl: this.baseUrl,
|
|
4566
|
+
path: pathWithQuery,
|
|
4567
|
+
oauthClient: this.oauthClient,
|
|
4568
|
+
numRetries: this.numRetries
|
|
4569
|
+
});
|
|
4570
|
+
return res.data;
|
|
4571
|
+
}
|
|
4572
|
+
/** Create a property value. */
|
|
4573
|
+
async createPropertyValue(request) {
|
|
4574
|
+
const res = await managementHttpRequest({
|
|
4575
|
+
method: "POST",
|
|
4576
|
+
baseUrl: this.baseUrl,
|
|
4577
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values`,
|
|
4578
|
+
body: request,
|
|
4579
|
+
oauthClient: this.oauthClient,
|
|
4580
|
+
numRetries: this.numRetries
|
|
4581
|
+
});
|
|
4582
|
+
return res.data;
|
|
4583
|
+
}
|
|
4584
|
+
};
|
|
4585
|
+
|
|
4586
|
+
// src/red-team/client.ts
|
|
4587
|
+
function buildListParams9(opts) {
|
|
4588
|
+
const params = {};
|
|
4589
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4590
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4591
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4592
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4593
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
4594
|
+
return params;
|
|
4595
|
+
}
|
|
4596
|
+
var RedTeamClient = class {
|
|
4597
|
+
/** Data plane scan operations. */
|
|
4598
|
+
scans;
|
|
4599
|
+
/** Data plane report operations. */
|
|
4600
|
+
reports;
|
|
4601
|
+
/** Data plane custom attack report operations. */
|
|
4602
|
+
customAttackReports;
|
|
4603
|
+
/** Management plane target operations. */
|
|
4604
|
+
targets;
|
|
4605
|
+
/** Management plane custom attack/prompt set operations. */
|
|
4606
|
+
customAttacks;
|
|
4607
|
+
dataEndpoint;
|
|
4608
|
+
mgmtEndpoint;
|
|
4609
|
+
oauthClient;
|
|
4610
|
+
numRetries;
|
|
4611
|
+
constructor(opts = {}) {
|
|
4612
|
+
const clientId = opts.clientId ?? process.env[RED_TEAM_CLIENT_ID] ?? process.env[MGMT_CLIENT_ID];
|
|
4613
|
+
const clientSecret = opts.clientSecret ?? process.env[RED_TEAM_CLIENT_SECRET] ?? process.env[MGMT_CLIENT_SECRET];
|
|
4614
|
+
const tsgId = opts.tsgId ?? process.env[RED_TEAM_TSG_ID] ?? process.env[MGMT_TSG_ID];
|
|
4615
|
+
const dataEndpoint = opts.dataEndpoint ?? process.env[RED_TEAM_DATA_ENDPOINT] ?? DEFAULT_RED_TEAM_DATA_ENDPOINT;
|
|
4616
|
+
const mgmtEndpoint = opts.mgmtEndpoint ?? process.env[RED_TEAM_MGMT_ENDPOINT] ?? DEFAULT_RED_TEAM_MGMT_ENDPOINT;
|
|
4617
|
+
const tokenEndpoint = opts.tokenEndpoint ?? process.env[RED_TEAM_TOKEN_ENDPOINT] ?? process.env[MGMT_TOKEN_ENDPOINT];
|
|
4618
|
+
const numRetries = Math.min(
|
|
4619
|
+
Math.max(opts.numRetries ?? MAX_NUMBER_OF_RETRIES, 0),
|
|
4620
|
+
MAX_NUMBER_OF_RETRIES
|
|
4621
|
+
);
|
|
4622
|
+
if (!clientId) {
|
|
4623
|
+
throw new AISecSDKException(
|
|
4624
|
+
"clientId is required (option or PANW_RED_TEAM_CLIENT_ID / PANW_MGMT_CLIENT_ID env var)",
|
|
4625
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
4626
|
+
);
|
|
4627
|
+
}
|
|
4628
|
+
if (!clientSecret) {
|
|
4629
|
+
throw new AISecSDKException(
|
|
4630
|
+
"clientSecret is required (option or PANW_RED_TEAM_CLIENT_SECRET / PANW_MGMT_CLIENT_SECRET env var)",
|
|
4631
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
4632
|
+
);
|
|
4633
|
+
}
|
|
4634
|
+
if (!tsgId) {
|
|
4635
|
+
throw new AISecSDKException(
|
|
4636
|
+
"tsgId is required (option or PANW_RED_TEAM_TSG_ID / PANW_MGMT_TSG_ID env var)",
|
|
4637
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
4638
|
+
);
|
|
4639
|
+
}
|
|
4640
|
+
this.oauthClient = new OAuthClient({ clientId, clientSecret, tsgId, tokenEndpoint });
|
|
4641
|
+
this.dataEndpoint = dataEndpoint;
|
|
4642
|
+
this.mgmtEndpoint = mgmtEndpoint;
|
|
4643
|
+
this.numRetries = numRetries;
|
|
4644
|
+
this.scans = new RedTeamScansClient({
|
|
4645
|
+
baseUrl: dataEndpoint,
|
|
4646
|
+
oauthClient: this.oauthClient,
|
|
4647
|
+
numRetries
|
|
4648
|
+
});
|
|
4649
|
+
this.reports = new RedTeamReportsClient({
|
|
4650
|
+
baseUrl: dataEndpoint,
|
|
4651
|
+
oauthClient: this.oauthClient,
|
|
4652
|
+
numRetries
|
|
4653
|
+
});
|
|
4654
|
+
this.customAttackReports = new RedTeamCustomAttackReportsClient({
|
|
4655
|
+
baseUrl: dataEndpoint,
|
|
4656
|
+
oauthClient: this.oauthClient,
|
|
4657
|
+
numRetries
|
|
4658
|
+
});
|
|
4659
|
+
this.targets = new RedTeamTargetsClient({
|
|
4660
|
+
baseUrl: mgmtEndpoint,
|
|
4661
|
+
oauthClient: this.oauthClient,
|
|
4662
|
+
numRetries
|
|
4663
|
+
});
|
|
4664
|
+
this.customAttacks = new RedTeamCustomAttacksClient({
|
|
4665
|
+
baseUrl: mgmtEndpoint,
|
|
4666
|
+
oauthClient: this.oauthClient,
|
|
4667
|
+
numRetries
|
|
4668
|
+
});
|
|
4669
|
+
}
|
|
4670
|
+
// -----------------------------------------------------------------------
|
|
4671
|
+
// Data plane convenience methods
|
|
4672
|
+
// -----------------------------------------------------------------------
|
|
4673
|
+
/** Get scan statistics and risk profile (data plane dashboard). */
|
|
4674
|
+
async getScanStatistics(params) {
|
|
4675
|
+
const p = {};
|
|
4676
|
+
if (params?.date_range !== void 0) p.date_range = params.date_range;
|
|
4677
|
+
if (params?.target_id !== void 0) p.target_id = params.target_id;
|
|
4678
|
+
const res = await managementHttpRequest({
|
|
4679
|
+
method: "GET",
|
|
4680
|
+
baseUrl: this.dataEndpoint,
|
|
4681
|
+
path: `${RED_TEAM_DASHBOARD_PATH}/scan-statistics`,
|
|
4682
|
+
params: p,
|
|
4683
|
+
oauthClient: this.oauthClient,
|
|
4684
|
+
numRetries: this.numRetries
|
|
4685
|
+
});
|
|
4686
|
+
return res.data;
|
|
4687
|
+
}
|
|
4688
|
+
/** Get score trend for a target (data plane dashboard). */
|
|
4689
|
+
async getScoreTrend(targetId) {
|
|
4690
|
+
if (!isValidUuid(targetId)) {
|
|
4691
|
+
throw new AISecSDKException(
|
|
4692
|
+
`Invalid target id: ${targetId}`,
|
|
4693
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4694
|
+
);
|
|
4695
|
+
}
|
|
4696
|
+
const res = await managementHttpRequest({
|
|
4697
|
+
method: "GET",
|
|
4698
|
+
baseUrl: this.dataEndpoint,
|
|
4699
|
+
path: `${RED_TEAM_DASHBOARD_PATH}/score-trend`,
|
|
4700
|
+
params: { target_id: targetId },
|
|
4701
|
+
oauthClient: this.oauthClient,
|
|
4702
|
+
numRetries: this.numRetries
|
|
4703
|
+
});
|
|
4704
|
+
return res.data;
|
|
4705
|
+
}
|
|
4706
|
+
/** Get quota summary. */
|
|
4707
|
+
async getQuota() {
|
|
4708
|
+
const res = await managementHttpRequest({
|
|
4709
|
+
method: "POST",
|
|
4710
|
+
baseUrl: this.dataEndpoint,
|
|
4711
|
+
path: RED_TEAM_QUOTA_PATH,
|
|
4712
|
+
oauthClient: this.oauthClient,
|
|
4713
|
+
numRetries: this.numRetries
|
|
4714
|
+
});
|
|
4715
|
+
return res.data;
|
|
4716
|
+
}
|
|
4717
|
+
/** List error logs for a scan job. */
|
|
4718
|
+
async getErrorLogs(jobId, opts) {
|
|
4719
|
+
if (!isValidUuid(jobId)) {
|
|
4720
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
4721
|
+
}
|
|
4722
|
+
const res = await managementHttpRequest({
|
|
4723
|
+
method: "GET",
|
|
4724
|
+
baseUrl: this.dataEndpoint,
|
|
4725
|
+
path: `${RED_TEAM_ERROR_LOG_PATH}/${jobId}`,
|
|
4726
|
+
params: buildListParams9(opts),
|
|
4727
|
+
oauthClient: this.oauthClient,
|
|
4728
|
+
numRetries: this.numRetries
|
|
4729
|
+
});
|
|
4730
|
+
return res.data;
|
|
4731
|
+
}
|
|
4732
|
+
/** Update sentiment for a scan report. */
|
|
4733
|
+
async updateSentiment(request) {
|
|
4734
|
+
const res = await managementHttpRequest({
|
|
4735
|
+
method: "POST",
|
|
4736
|
+
baseUrl: this.dataEndpoint,
|
|
4737
|
+
path: RED_TEAM_SENTIMENT_PATH,
|
|
4738
|
+
body: request,
|
|
4739
|
+
oauthClient: this.oauthClient,
|
|
4740
|
+
numRetries: this.numRetries
|
|
4741
|
+
});
|
|
4742
|
+
return res.data;
|
|
4743
|
+
}
|
|
4744
|
+
/** Get sentiment for a scan report. */
|
|
4745
|
+
async getSentiment(jobId) {
|
|
4746
|
+
if (!isValidUuid(jobId)) {
|
|
4747
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
4748
|
+
}
|
|
4749
|
+
const res = await managementHttpRequest({
|
|
4750
|
+
method: "GET",
|
|
4751
|
+
baseUrl: this.dataEndpoint,
|
|
4752
|
+
path: `${RED_TEAM_SENTIMENT_PATH}/${jobId}`,
|
|
4753
|
+
oauthClient: this.oauthClient,
|
|
4754
|
+
numRetries: this.numRetries
|
|
4755
|
+
});
|
|
4756
|
+
return res.data;
|
|
4757
|
+
}
|
|
4758
|
+
// -----------------------------------------------------------------------
|
|
4759
|
+
// Management plane convenience methods
|
|
4760
|
+
// -----------------------------------------------------------------------
|
|
4761
|
+
/** Get management dashboard overview. */
|
|
4762
|
+
async getDashboardOverview() {
|
|
4763
|
+
const res = await managementHttpRequest({
|
|
4764
|
+
method: "GET",
|
|
4765
|
+
baseUrl: this.mgmtEndpoint,
|
|
4766
|
+
path: RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
4767
|
+
oauthClient: this.oauthClient,
|
|
4768
|
+
numRetries: this.numRetries
|
|
4769
|
+
});
|
|
4770
|
+
return res.data;
|
|
4771
|
+
}
|
|
4772
|
+
};
|
|
1380
4773
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1381
4774
|
0 && (module.exports = {
|
|
1382
4775
|
AISecSDKException,
|
|
@@ -1387,32 +4780,112 @@ var ManagementClient = class {
|
|
|
1387
4780
|
Action,
|
|
1388
4781
|
AgentMetaSchema,
|
|
1389
4782
|
AiProfileSchema,
|
|
4783
|
+
ApiEndpointType,
|
|
1390
4784
|
AsyncScanObjectSchema,
|
|
1391
4785
|
AsyncScanResponseSchema,
|
|
4786
|
+
AttackDetailResponseSchema,
|
|
4787
|
+
AttackListItemSchema,
|
|
4788
|
+
AttackListResponseSchema,
|
|
4789
|
+
AttackMultiTurnDetailResponseSchema,
|
|
4790
|
+
AttackMultiTurnOutputSchema,
|
|
4791
|
+
AttackOutputSchema,
|
|
4792
|
+
AttackStatus,
|
|
4793
|
+
AttackType,
|
|
4794
|
+
AuthType,
|
|
1392
4795
|
BEARER,
|
|
4796
|
+
BaseResponseSchema,
|
|
4797
|
+
BrandSubCategory,
|
|
1393
4798
|
Category,
|
|
4799
|
+
CategoryModelSchema,
|
|
4800
|
+
CategoryReportSchema,
|
|
4801
|
+
ComplianceReportSchema,
|
|
4802
|
+
ComplianceSubCategory,
|
|
4803
|
+
ComplianceTechniqueSchema,
|
|
1394
4804
|
Content,
|
|
4805
|
+
CountByNameSchema,
|
|
4806
|
+
CountedQuotaEnum,
|
|
1395
4807
|
CreateCustomTopicRequestSchema,
|
|
1396
4808
|
CreateSecurityProfileRequestSchema,
|
|
4809
|
+
CustomAttackOutputSchema,
|
|
4810
|
+
CustomAttackReportResponseSchema,
|
|
4811
|
+
CustomAttacksListResponseSchema,
|
|
4812
|
+
CustomJobMetadataSchema,
|
|
4813
|
+
CustomPromptCreateRequestSchema,
|
|
4814
|
+
CustomPromptListItemSchema,
|
|
4815
|
+
CustomPromptListSchema,
|
|
4816
|
+
CustomPromptResponseSchema,
|
|
4817
|
+
CustomPromptSetArchiveRequestSchema,
|
|
4818
|
+
CustomPromptSetCreateRequestSchema,
|
|
4819
|
+
CustomPromptSetListActiveSchema,
|
|
4820
|
+
CustomPromptSetListItemSchema,
|
|
4821
|
+
CustomPromptSetListSchema,
|
|
4822
|
+
CustomPromptSetReferenceSchema,
|
|
4823
|
+
CustomPromptSetResponseSchema,
|
|
4824
|
+
CustomPromptSetUpdateRequestSchema,
|
|
4825
|
+
CustomPromptSetVersionInfoSchema,
|
|
4826
|
+
CustomPromptUpdateRequestSchema,
|
|
1397
4827
|
CustomTopicListResponseSchema,
|
|
1398
4828
|
CustomTopicSchema,
|
|
1399
4829
|
DEFAULT_ENDPOINT,
|
|
1400
4830
|
DEFAULT_MGMT_ENDPOINT,
|
|
4831
|
+
DEFAULT_MODEL_SEC_DATA_ENDPOINT,
|
|
4832
|
+
DEFAULT_MODEL_SEC_MGMT_ENDPOINT,
|
|
4833
|
+
DEFAULT_RED_TEAM_DATA_ENDPOINT,
|
|
4834
|
+
DEFAULT_RED_TEAM_MGMT_ENDPOINT,
|
|
1401
4835
|
DEFAULT_TOKEN_ENDPOINT,
|
|
1402
4836
|
DSDetailResultSchema,
|
|
1403
4837
|
DSResultMetadataSchema,
|
|
4838
|
+
DashboardOverviewResponseSchema,
|
|
4839
|
+
DateRangeFilter,
|
|
1404
4840
|
DeleteProfileConflictSchema,
|
|
1405
4841
|
DeleteProfileResponseSchema,
|
|
1406
4842
|
DeleteTopicConflictSchema,
|
|
1407
4843
|
DeleteTopicResponseSchema,
|
|
1408
4844
|
DetectionServiceResultSchema,
|
|
1409
4845
|
DlpReportSchema,
|
|
4846
|
+
DynamicJobMetadataSchema,
|
|
4847
|
+
DynamicJobReportSchema,
|
|
4848
|
+
DynamicJobReportStatsSchema,
|
|
4849
|
+
ErrorCodes,
|
|
4850
|
+
ErrorLogListResponseSchema,
|
|
4851
|
+
ErrorLogSchema,
|
|
1410
4852
|
ErrorResponseSchema,
|
|
4853
|
+
ErrorSource,
|
|
1411
4854
|
ErrorType,
|
|
4855
|
+
EvalOutcome,
|
|
4856
|
+
EvalSummarySchema,
|
|
4857
|
+
FileFormat,
|
|
4858
|
+
FileListSchema,
|
|
4859
|
+
FileResponseSchema,
|
|
4860
|
+
FileScanDataSchema,
|
|
4861
|
+
FileScanResult,
|
|
4862
|
+
FileType,
|
|
4863
|
+
GoalListResponseSchema,
|
|
4864
|
+
GoalSchema,
|
|
4865
|
+
GoalType,
|
|
4866
|
+
GoalTypeQueryParam,
|
|
4867
|
+
GuardrailAction,
|
|
1412
4868
|
HEADER_API_KEY,
|
|
1413
4869
|
HEADER_AUTH_TOKEN,
|
|
4870
|
+
HTTPValidationErrorSchema,
|
|
1414
4871
|
HTTP_FORCE_RETRY_STATUS_CODES,
|
|
1415
4872
|
IODetectedSchema,
|
|
4873
|
+
JobAbortResponseSchema,
|
|
4874
|
+
JobCreateRequestSchema,
|
|
4875
|
+
JobListResponseSchema,
|
|
4876
|
+
JobResponseSchema,
|
|
4877
|
+
JobStatus,
|
|
4878
|
+
JobStatusFilter,
|
|
4879
|
+
JobTimeRecordSchema,
|
|
4880
|
+
JobType,
|
|
4881
|
+
LabelKeyListSchema,
|
|
4882
|
+
LabelSchema,
|
|
4883
|
+
LabelValueListSchema,
|
|
4884
|
+
LabelsCreateRequestSchema,
|
|
4885
|
+
LabelsResponseSchema,
|
|
4886
|
+
ListModelSecurityGroupsResponseSchema,
|
|
4887
|
+
ListModelSecurityRuleInstancesResponseSchema,
|
|
4888
|
+
ListModelSecurityRulesResponseSchema,
|
|
1416
4889
|
MAX_AI_PROFILE_NAME_LENGTH,
|
|
1417
4890
|
MAX_API_KEY_LENGTH,
|
|
1418
4891
|
MAX_CONNECTION_POOL_SIZE,
|
|
@@ -1438,28 +4911,168 @@ var ManagementClient = class {
|
|
|
1438
4911
|
MGMT_TOPIC_FORCE_PATH,
|
|
1439
4912
|
MGMT_TOPIC_PATH,
|
|
1440
4913
|
MGMT_TSG_ID,
|
|
4914
|
+
MODEL_SEC_CLIENT_ID,
|
|
4915
|
+
MODEL_SEC_CLIENT_SECRET,
|
|
4916
|
+
MODEL_SEC_DATA_ENDPOINT,
|
|
4917
|
+
MODEL_SEC_EVALUATIONS_PATH,
|
|
4918
|
+
MODEL_SEC_MGMT_ENDPOINT,
|
|
4919
|
+
MODEL_SEC_PYPI_AUTH_PATH,
|
|
4920
|
+
MODEL_SEC_SCANS_PATH,
|
|
4921
|
+
MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
4922
|
+
MODEL_SEC_SECURITY_RULES_PATH,
|
|
4923
|
+
MODEL_SEC_TOKEN_ENDPOINT,
|
|
4924
|
+
MODEL_SEC_TSG_ID,
|
|
4925
|
+
MODEL_SEC_VIOLATIONS_PATH,
|
|
1441
4926
|
ManagementClient,
|
|
1442
4927
|
MaskedDataSchema,
|
|
1443
4928
|
MetadataSchema,
|
|
4929
|
+
ModelScanIssueSchema,
|
|
4930
|
+
ModelScanStatus,
|
|
4931
|
+
ModelSecurityClient,
|
|
4932
|
+
ModelSecurityGroupCreateRequestSchema,
|
|
4933
|
+
ModelSecurityGroupResponseSchema,
|
|
4934
|
+
ModelSecurityGroupState,
|
|
4935
|
+
ModelSecurityGroupUpdateRequestSchema,
|
|
4936
|
+
ModelSecurityGroupsClient,
|
|
4937
|
+
ModelSecurityPaginationSchema,
|
|
4938
|
+
ModelSecurityRuleInstanceResponseSchema,
|
|
4939
|
+
ModelSecurityRuleInstanceUpdateRequestSchema,
|
|
4940
|
+
ModelSecurityRuleResponseSchema,
|
|
4941
|
+
ModelSecurityRulesClient,
|
|
4942
|
+
ModelSecurityScansClient,
|
|
4943
|
+
OAuthClient,
|
|
1444
4944
|
PAYLOAD_HASH,
|
|
1445
4945
|
PolicySchema,
|
|
4946
|
+
PolicyType,
|
|
4947
|
+
PrerequisiteModelSchema,
|
|
1446
4948
|
ProfilesClient,
|
|
4949
|
+
ProfilingStatus,
|
|
4950
|
+
PromptDetailResponseSchema,
|
|
1447
4951
|
PromptDetectedSchema,
|
|
1448
4952
|
PromptDetectionDetailsSchema,
|
|
4953
|
+
PromptSetStatsSchema,
|
|
4954
|
+
PromptSetSummarySchema,
|
|
4955
|
+
PromptSetsReportResponseSchema,
|
|
4956
|
+
PropertyAssignmentSchema,
|
|
4957
|
+
PropertyDefinitionSchema,
|
|
4958
|
+
PropertyNameCreateRequestSchema,
|
|
4959
|
+
PropertyNamesListResponseSchema,
|
|
4960
|
+
PropertyStatisticSchema,
|
|
4961
|
+
PropertyValueCreateRequestSchema,
|
|
4962
|
+
PropertyValueStatisticSchema,
|
|
4963
|
+
PropertyValuesMultipleResponseSchema,
|
|
4964
|
+
PropertyValuesResponseSchema,
|
|
4965
|
+
PyPIAuthResponseSchema,
|
|
4966
|
+
QuotaDetailsSchema,
|
|
4967
|
+
QuotaSummarySchema,
|
|
4968
|
+
RED_TEAM_CATEGORIES_PATH,
|
|
4969
|
+
RED_TEAM_CLIENT_ID,
|
|
4970
|
+
RED_TEAM_CLIENT_SECRET,
|
|
4971
|
+
RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH,
|
|
4972
|
+
RED_TEAM_CUSTOM_ATTACK_PATH,
|
|
4973
|
+
RED_TEAM_DASHBOARD_PATH,
|
|
4974
|
+
RED_TEAM_DATA_ENDPOINT,
|
|
4975
|
+
RED_TEAM_ERROR_LOG_PATH,
|
|
4976
|
+
RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
4977
|
+
RED_TEAM_MGMT_ENDPOINT,
|
|
4978
|
+
RED_TEAM_QUOTA_PATH,
|
|
4979
|
+
RED_TEAM_REPORT_DYNAMIC_PATH,
|
|
4980
|
+
RED_TEAM_REPORT_PATH,
|
|
4981
|
+
RED_TEAM_REPORT_STATIC_PATH,
|
|
4982
|
+
RED_TEAM_SCAN_PATH,
|
|
4983
|
+
RED_TEAM_SENTIMENT_PATH,
|
|
4984
|
+
RED_TEAM_TARGET_PATH,
|
|
4985
|
+
RED_TEAM_TOKEN_ENDPOINT,
|
|
4986
|
+
RED_TEAM_TSG_ID,
|
|
4987
|
+
RedTeamCategory,
|
|
4988
|
+
RedTeamClient,
|
|
4989
|
+
RedTeamCustomAttackReportsClient,
|
|
4990
|
+
RedTeamCustomAttacksClient,
|
|
4991
|
+
RedTeamErrorType,
|
|
4992
|
+
RedTeamPaginationSchema,
|
|
4993
|
+
RedTeamReportsClient,
|
|
4994
|
+
RedTeamScansClient,
|
|
4995
|
+
RedTeamTargetsClient,
|
|
4996
|
+
RemediationDetailSchema,
|
|
4997
|
+
RemediationResponseSchema,
|
|
1449
4998
|
ResponseDetectedSchema,
|
|
1450
4999
|
ResponseDetectionDetailsSchema,
|
|
5000
|
+
ResponseMode,
|
|
5001
|
+
RiskLevelSchema,
|
|
5002
|
+
RiskRating,
|
|
5003
|
+
RuleConfigurationSchema,
|
|
5004
|
+
RuleEditableFieldDropdownSchema,
|
|
5005
|
+
RuleEditableFieldSchema,
|
|
5006
|
+
RuleEditableFieldType,
|
|
5007
|
+
RuleEvaluationListSchema,
|
|
5008
|
+
RuleEvaluationResponseSchema,
|
|
5009
|
+
RuleEvaluationResult,
|
|
5010
|
+
RuleFieldValueKey,
|
|
5011
|
+
RuleRemediationSchema,
|
|
5012
|
+
RuleState,
|
|
5013
|
+
RuleType,
|
|
5014
|
+
RuntimeSecurityPolicySchema,
|
|
5015
|
+
RuntimeSecurityProfileResponseSchema,
|
|
1451
5016
|
SCAN_REPORTS_PATH,
|
|
1452
5017
|
SCAN_RESULTS_PATH,
|
|
1453
5018
|
SDK_VERSION,
|
|
1454
5019
|
SYNC_SCAN_PATH,
|
|
5020
|
+
SafetySubCategory,
|
|
5021
|
+
ScanBaseResponseSchema,
|
|
5022
|
+
ScanCreateRequestSchema,
|
|
5023
|
+
ScanDetailsSchema,
|
|
1455
5024
|
ScanIdResultSchema,
|
|
5025
|
+
ScanListSchema,
|
|
5026
|
+
ScanOrigin,
|
|
1456
5027
|
ScanRequestContentsInnerSchema,
|
|
1457
5028
|
ScanRequestSchema,
|
|
1458
5029
|
ScanResponseSchema,
|
|
5030
|
+
ScanStatisticsResponseSchema,
|
|
1459
5031
|
ScanSummarySchema,
|
|
1460
5032
|
Scanner,
|
|
5033
|
+
ScoreTrendResponseSchema,
|
|
5034
|
+
ScoreTrendSeriesSchema,
|
|
1461
5035
|
SecurityProfileListResponseSchema,
|
|
1462
5036
|
SecurityProfileSchema,
|
|
5037
|
+
SecuritySubCategory,
|
|
5038
|
+
SentimentRequestSchema,
|
|
5039
|
+
SentimentResponseSchema,
|
|
5040
|
+
SeverityFilter,
|
|
5041
|
+
SeverityReportSchema,
|
|
5042
|
+
SeverityStatsSchema,
|
|
5043
|
+
SortByDateField,
|
|
5044
|
+
SortByFileField,
|
|
5045
|
+
SortDirection,
|
|
5046
|
+
SourceType,
|
|
5047
|
+
StaticJobMetadataSchema,
|
|
5048
|
+
StaticJobRemediationRecommendationSchema,
|
|
5049
|
+
StaticJobRemediationSchema,
|
|
5050
|
+
StaticJobReportSchema,
|
|
5051
|
+
StaticJobReportStatsSchema,
|
|
5052
|
+
StatusQueryParam,
|
|
5053
|
+
StreamDetailResponseSchema,
|
|
5054
|
+
StreamIterationDataSchema,
|
|
5055
|
+
StreamListResponseSchema,
|
|
5056
|
+
StreamType,
|
|
5057
|
+
SubCategoryModelSchema,
|
|
5058
|
+
SubCategoryStatsSchema,
|
|
5059
|
+
TargetAdditionalContextSchema,
|
|
5060
|
+
TargetBackgroundSchema,
|
|
5061
|
+
TargetConnectionType,
|
|
5062
|
+
TargetContextUpdateSchema,
|
|
5063
|
+
TargetCreateRequestSchema,
|
|
5064
|
+
TargetJobRequestSchema,
|
|
5065
|
+
TargetListItemSchema,
|
|
5066
|
+
TargetListSchema,
|
|
5067
|
+
TargetMetadataSchema,
|
|
5068
|
+
TargetProbeRequestSchema,
|
|
5069
|
+
TargetProfileResponseSchema,
|
|
5070
|
+
TargetReferenceSchema,
|
|
5071
|
+
TargetResponseSchema,
|
|
5072
|
+
TargetStatus,
|
|
5073
|
+
TargetType,
|
|
5074
|
+
TargetUpdateRequestSchema,
|
|
5075
|
+
ThreatCategory,
|
|
1463
5076
|
ThreatScanReportSchema,
|
|
1464
5077
|
ToolDetectedSchema,
|
|
1465
5078
|
ToolEventMetadataSchema,
|
|
@@ -1467,7 +5080,10 @@ var ManagementClient = class {
|
|
|
1467
5080
|
TopicsClient,
|
|
1468
5081
|
USER_AGENT,
|
|
1469
5082
|
UrlfEntrySchema,
|
|
5083
|
+
ValidationErrorSchema,
|
|
1470
5084
|
Verdict,
|
|
5085
|
+
ViolationListSchema,
|
|
5086
|
+
ViolationResponseSchema,
|
|
1471
5087
|
globalConfiguration,
|
|
1472
5088
|
init
|
|
1473
5089
|
});
|