@cdot65/prisma-airs-sdk 0.13.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -2
- package/dist/index.cjs +3005 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13301 -2834
- package/dist/index.d.ts +13301 -2834
- package/dist/index.js +2900 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
|
|
|
29
29
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
30
30
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
31
31
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
32
|
-
var SDK_VERSION = "0.
|
|
32
|
+
var SDK_VERSION = "0.17.0";
|
|
33
33
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
34
34
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
35
35
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -104,6 +104,8 @@ var RED_TEAM_LANGUAGES_PATH = "/v1/languages";
|
|
|
104
104
|
var RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH = "/v1/error-log/target-profile";
|
|
105
105
|
var RED_TEAM_TARGET_PATH = "/v1/target";
|
|
106
106
|
var RED_TEAM_TARGET_VALIDATE_AUTH_PATH = "/v1/target/validate-auth";
|
|
107
|
+
var RED_TEAM_ADAPTER_PATH = "/v1/adapters";
|
|
108
|
+
var RED_TEAM_ADAPTER_VALIDATE_PATH = "/v1/adapters/validate";
|
|
107
109
|
var RED_TEAM_TEMPLATE_PATH = "/v1/template";
|
|
108
110
|
var RED_TEAM_EULA_PATH = "/v1/eula";
|
|
109
111
|
var RED_TEAM_INSTANCES_PATH = "/v1/instances";
|
|
@@ -112,6 +114,55 @@ var RED_TEAM_CUSTOM_ATTACK_PATH = "/v1/custom-attack";
|
|
|
112
114
|
var RED_TEAM_MGMT_DASHBOARD_PATH = "/v1/dashboard/overview";
|
|
113
115
|
var RED_TEAM_CHANNELS_PATH = "/v1/channels";
|
|
114
116
|
var RED_TEAM_CHANNELS_STATS_PATH = "/v1/channels/stats";
|
|
117
|
+
var DEFAULT_AI_GW_DATA_ENDPOINT = "https://api.apps.paloaltonetworks.com/ai_gw/v2";
|
|
118
|
+
var DEFAULT_AI_GW_ADMIN_ENDPOINT = "https://api.apps.paloaltonetworks.com/ai_gw/admin/v2";
|
|
119
|
+
var AI_GW_DATA_ENDPOINT = "PANW_AI_GW_DATA_ENDPOINT";
|
|
120
|
+
var AI_GW_ADMIN_ENDPOINT = "PANW_AI_GW_ADMIN_ENDPOINT";
|
|
121
|
+
var TSG_ID_HEADER = "x-tsg-id";
|
|
122
|
+
var AI_GW_WORKSPACES_PATH = "/workspaces";
|
|
123
|
+
var AI_GW_CONFIGS_PATH = "/configs";
|
|
124
|
+
var AI_GW_GUARDRAILS_PATH = "/guardrails";
|
|
125
|
+
var AI_GW_PROVIDERS_PATH = "/providers";
|
|
126
|
+
var AI_GW_API_KEYS_SERVICE_PATH = "/api-keys/service";
|
|
127
|
+
var AI_GW_API_KEYS_USER_PATH = "/api-keys/user";
|
|
128
|
+
var AI_GW_LOGS_PATH = "/logs";
|
|
129
|
+
var AI_GW_CHARTS_PATH = "/logs/charts";
|
|
130
|
+
var AI_GW_GROUPS_PATH = "/logs/groups";
|
|
131
|
+
var AI_GW_INTEGRATIONS_PATH = "/integrations";
|
|
132
|
+
var AI_GW_MCP_INTEGRATIONS_PATH = "/mcp-integrations";
|
|
133
|
+
var AI_GW_DEPLOYMENTS_PATH = "/deployments";
|
|
134
|
+
var AI_GW_PLUGINS_PATH = "/plugins";
|
|
135
|
+
var AI_GW_ORGANISATIONS_SELF_PATH = "/organisations/self";
|
|
136
|
+
var AI_GW_AUDIT_LOGS_PATH = "/audit-logs";
|
|
137
|
+
function aiGwOrganisationsAuthSettingsPath(tsgId) {
|
|
138
|
+
return `/organisations/${tsgId}/auth-settings`;
|
|
139
|
+
}
|
|
140
|
+
var AI_GW_CHART_METRICS = [
|
|
141
|
+
"cost",
|
|
142
|
+
"requests",
|
|
143
|
+
"latency",
|
|
144
|
+
"tokens",
|
|
145
|
+
"errors",
|
|
146
|
+
"users",
|
|
147
|
+
"cache-summary",
|
|
148
|
+
"cache-hit-trend",
|
|
149
|
+
"user-trends",
|
|
150
|
+
"error-trends",
|
|
151
|
+
"rescued-retries",
|
|
152
|
+
"feedback-trend",
|
|
153
|
+
"feedback-weighted",
|
|
154
|
+
"feedback-score-distribution",
|
|
155
|
+
"feedback-models"
|
|
156
|
+
];
|
|
157
|
+
var AI_GW_GROUP_DIMENSIONS = ["ai_service", "model", "api_key", "provider"];
|
|
158
|
+
var AI_GW_GROUP_COLUMNS = [
|
|
159
|
+
"cost",
|
|
160
|
+
"avg_latency",
|
|
161
|
+
"avg_tokens",
|
|
162
|
+
"total_tokens",
|
|
163
|
+
"success_rate",
|
|
164
|
+
"last_seen"
|
|
165
|
+
];
|
|
115
166
|
|
|
116
167
|
// src/errors.ts
|
|
117
168
|
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
@@ -274,7 +325,10 @@ function classifyErrorType(status) {
|
|
|
274
325
|
function extractErrorMessage(body, status) {
|
|
275
326
|
try {
|
|
276
327
|
const parsed = JSON.parse(body);
|
|
277
|
-
|
|
328
|
+
const data = parsed.data;
|
|
329
|
+
const code = data?.errorCode ?? void 0;
|
|
330
|
+
const base = parsed.error_message ?? parsed.message ?? data?.message ?? parsed.error?.message ?? parsed.msg ?? `API error ${status}`;
|
|
331
|
+
return code ? `${base} (errorCode: ${code})` : base;
|
|
278
332
|
} catch {
|
|
279
333
|
return body ? `API error ${status}: ${body}` : `API error ${status}`;
|
|
280
334
|
}
|
|
@@ -3567,6 +3621,76 @@ var TenantLanguagesResponseSchema = z33.object({
|
|
|
3567
3621
|
supported_job_types: z33.array(z33.string()),
|
|
3568
3622
|
languages: z33.array(LanguageOptionSchema)
|
|
3569
3623
|
}).passthrough();
|
|
3624
|
+
var AdapterVarTypeSchema = z33.enum(["VAR", "SECRET"]);
|
|
3625
|
+
var AdapterVarSchema = z33.object({
|
|
3626
|
+
key: z33.string().max(255),
|
|
3627
|
+
value: z33.string().nullable().optional(),
|
|
3628
|
+
type: AdapterVarTypeSchema
|
|
3629
|
+
});
|
|
3630
|
+
var AdapterVarResponseSchema = AdapterVarSchema.extend({
|
|
3631
|
+
is_redacted: z33.boolean().optional()
|
|
3632
|
+
}).passthrough();
|
|
3633
|
+
var AdapterCreateRequestSchema = z33.object({
|
|
3634
|
+
name: z33.string().max(255),
|
|
3635
|
+
description: z33.string().nullable().optional(),
|
|
3636
|
+
script_b64: z33.string(),
|
|
3637
|
+
/** Optional while the adapter is a DRAFT; required to activate (`validate: true`). */
|
|
3638
|
+
network_broker_channel_uuid: z33.string().uuid().nullable().optional(),
|
|
3639
|
+
variables: z33.array(AdapterVarSchema).optional(),
|
|
3640
|
+
/** Sample prompt used to exercise the adapter end-to-end during validation. Not stored. */
|
|
3641
|
+
prompt: z33.string()
|
|
3642
|
+
}).strict();
|
|
3643
|
+
var AdapterUpdateRequestSchema = z33.object({
|
|
3644
|
+
name: z33.string().max(255),
|
|
3645
|
+
description: z33.string().nullable().optional(),
|
|
3646
|
+
script_b64: z33.string(),
|
|
3647
|
+
network_broker_channel_uuid: z33.string().uuid().nullable().optional(),
|
|
3648
|
+
variables: z33.array(AdapterVarSchema).optional(),
|
|
3649
|
+
prompt: z33.string()
|
|
3650
|
+
}).strict();
|
|
3651
|
+
var AdapterResponseSchema = z33.object({
|
|
3652
|
+
uuid: z33.string().uuid(),
|
|
3653
|
+
tsg_id: z33.string(),
|
|
3654
|
+
name: z33.string(),
|
|
3655
|
+
script_b64: z33.string(),
|
|
3656
|
+
status: z33.string(),
|
|
3657
|
+
description: z33.string().nullable().optional(),
|
|
3658
|
+
network_broker_channel_uuid: z33.string().uuid().nullable().optional(),
|
|
3659
|
+
variables: z33.array(AdapterVarResponseSchema).optional(),
|
|
3660
|
+
/** Number of targets currently referencing this adapter. */
|
|
3661
|
+
target_count: z33.number().int().optional(),
|
|
3662
|
+
created_at: z33.string().nullable().optional(),
|
|
3663
|
+
updated_at: z33.string().nullable().optional(),
|
|
3664
|
+
created_by_user_id: z33.string().uuid().nullable().optional(),
|
|
3665
|
+
updated_by_user_id: z33.string().uuid().nullable().optional()
|
|
3666
|
+
}).passthrough();
|
|
3667
|
+
var AdapterListItemSchema = z33.object({
|
|
3668
|
+
uuid: z33.string().uuid(),
|
|
3669
|
+
name: z33.string(),
|
|
3670
|
+
status: z33.string(),
|
|
3671
|
+
created_at: z33.string(),
|
|
3672
|
+
updated_at: z33.string(),
|
|
3673
|
+
created_by_user_id: z33.string().uuid().nullable().optional(),
|
|
3674
|
+
target_count: z33.number().int().nullable().optional()
|
|
3675
|
+
}).passthrough();
|
|
3676
|
+
var AdapterListSchema = z33.object({
|
|
3677
|
+
pagination: RedTeamPaginationSchema,
|
|
3678
|
+
data: z33.array(AdapterListItemSchema).optional()
|
|
3679
|
+
}).passthrough();
|
|
3680
|
+
var AdapterValidateRequestSchema = z33.object({
|
|
3681
|
+
script_b64: z33.string(),
|
|
3682
|
+
network_broker_channel_uuid: z33.string().uuid(),
|
|
3683
|
+
prompt: z33.string(),
|
|
3684
|
+
variables: z33.array(AdapterVarSchema).optional(),
|
|
3685
|
+
/** Omit when validating a brand-new adapter. */
|
|
3686
|
+
adapter_uuid: z33.string().uuid().nullable().optional()
|
|
3687
|
+
}).strict();
|
|
3688
|
+
var AdapterValidateResponseSchema = z33.object({
|
|
3689
|
+
validated: z33.boolean(),
|
|
3690
|
+
stdout: z33.string().nullable().optional(),
|
|
3691
|
+
stderr: z33.string().nullable().optional(),
|
|
3692
|
+
traceback: z33.string().nullable().optional()
|
|
3693
|
+
}).passthrough();
|
|
3570
3694
|
var TargetRequestBaseFields = {
|
|
3571
3695
|
name: z33.string(),
|
|
3572
3696
|
description: z33.string().nullable().optional(),
|
|
@@ -3580,7 +3704,11 @@ var TargetRequestBaseFields = {
|
|
|
3580
3704
|
target_background: TargetBackgroundSchema.nullable().optional(),
|
|
3581
3705
|
additional_context: TargetAdditionalContextSchema.nullable().optional(),
|
|
3582
3706
|
extra_info: z33.record(z33.unknown()).nullable().optional(),
|
|
3583
|
-
network_broker_channel_uuid: z33.string().nullable().optional()
|
|
3707
|
+
network_broker_channel_uuid: z33.string().nullable().optional(),
|
|
3708
|
+
/** UUID of the custom target adapter to use. Required when connection_type is CUSTOM_TARGET_ADAPTER. */
|
|
3709
|
+
adapter_uuid: z33.string().uuid().nullable().optional(),
|
|
3710
|
+
/** Per-target overrides for the adapter's variables. Array of AdapterVar objects. */
|
|
3711
|
+
adapter_variable_overrides: z33.array(AdapterVarSchema).nullable().optional()
|
|
3584
3712
|
};
|
|
3585
3713
|
var TargetCreateRequestSchema = z33.object(TargetRequestBaseFields).strict();
|
|
3586
3714
|
var TargetUpdateRequestSchema = z33.object(TargetRequestBaseFields).strict();
|
|
@@ -3963,6 +4091,505 @@ var ChannelStatsSchema = z34.object({
|
|
|
3963
4091
|
client_version: z34.string().nullable().optional()
|
|
3964
4092
|
}).passthrough();
|
|
3965
4093
|
|
|
4094
|
+
// src/models/ai-gateway.ts
|
|
4095
|
+
import { z as z35 } from "zod";
|
|
4096
|
+
var aiGatewayEnvelope = (data) => z35.object({ success: z35.boolean(), data }).passthrough();
|
|
4097
|
+
var aiGatewayList = (item) => z35.object({
|
|
4098
|
+
object: z35.string(),
|
|
4099
|
+
total: z35.number(),
|
|
4100
|
+
has_more: z35.boolean().optional(),
|
|
4101
|
+
data: z35.array(item)
|
|
4102
|
+
}).passthrough();
|
|
4103
|
+
var GatewayUsageLimitSchema = z35.object({
|
|
4104
|
+
credit_limit: z35.number().optional(),
|
|
4105
|
+
type: z35.string().optional(),
|
|
4106
|
+
alert_threshold: z35.number().optional(),
|
|
4107
|
+
periodic_reset: z35.string().nullable().optional(),
|
|
4108
|
+
periodic_reset_days: z35.number().nullable().optional(),
|
|
4109
|
+
next_usage_reset_at: z35.string().nullable().optional()
|
|
4110
|
+
}).passthrough();
|
|
4111
|
+
var GatewayRateLimitSchema = z35.object({
|
|
4112
|
+
type: z35.string().optional(),
|
|
4113
|
+
unit: z35.string().optional(),
|
|
4114
|
+
value: z35.number().optional()
|
|
4115
|
+
}).passthrough();
|
|
4116
|
+
var limitsField = (policy) => z35.union([z35.array(policy), z35.record(z35.unknown())]).nullable();
|
|
4117
|
+
var aiGatewayGroupList = (item) => z35.object({
|
|
4118
|
+
object: z35.string(),
|
|
4119
|
+
is_quota_exceeded: z35.boolean(),
|
|
4120
|
+
total: z35.number(),
|
|
4121
|
+
data: z35.array(item)
|
|
4122
|
+
}).passthrough();
|
|
4123
|
+
var quotaFlag = { isQuotaExceeded: z35.boolean() };
|
|
4124
|
+
var GatewayChartRecordSchema = z35.object({ x: z35.string(), y: z35.number(), avg: z35.number().optional() }).passthrough();
|
|
4125
|
+
var CostChartResponseSchema = aiGatewayEnvelope(
|
|
4126
|
+
z35.object({
|
|
4127
|
+
records: z35.array(GatewayChartRecordSchema),
|
|
4128
|
+
total: z35.number(),
|
|
4129
|
+
avg: z35.number(),
|
|
4130
|
+
...quotaFlag
|
|
4131
|
+
}).passthrough()
|
|
4132
|
+
);
|
|
4133
|
+
var CountChartResponseSchema = aiGatewayEnvelope(
|
|
4134
|
+
z35.object({
|
|
4135
|
+
records: z35.array(GatewayChartRecordSchema),
|
|
4136
|
+
total: z35.number().nullable(),
|
|
4137
|
+
...quotaFlag
|
|
4138
|
+
}).passthrough()
|
|
4139
|
+
);
|
|
4140
|
+
var LatencyChartResponseSchema = aiGatewayEnvelope(
|
|
4141
|
+
z35.object({
|
|
4142
|
+
records: z35.array(
|
|
4143
|
+
z35.object({
|
|
4144
|
+
x: z35.string(),
|
|
4145
|
+
y: z35.number(),
|
|
4146
|
+
p50: z35.number(),
|
|
4147
|
+
p90: z35.number(),
|
|
4148
|
+
p99: z35.number()
|
|
4149
|
+
}).passthrough()
|
|
4150
|
+
),
|
|
4151
|
+
total: z35.number(),
|
|
4152
|
+
p50: z35.number(),
|
|
4153
|
+
p90: z35.number(),
|
|
4154
|
+
p99: z35.number(),
|
|
4155
|
+
...quotaFlag
|
|
4156
|
+
}).passthrough()
|
|
4157
|
+
);
|
|
4158
|
+
var TokensChartResponseSchema = aiGatewayEnvelope(
|
|
4159
|
+
z35.object({
|
|
4160
|
+
records: z35.array(
|
|
4161
|
+
z35.object({
|
|
4162
|
+
x: z35.string(),
|
|
4163
|
+
y: z35.number(),
|
|
4164
|
+
total_request_units: z35.number(),
|
|
4165
|
+
total_response_units: z35.number(),
|
|
4166
|
+
avg: z35.number()
|
|
4167
|
+
}).passthrough()
|
|
4168
|
+
),
|
|
4169
|
+
total: z35.number(),
|
|
4170
|
+
avg: z35.number(),
|
|
4171
|
+
total_request_units: z35.number(),
|
|
4172
|
+
total_response_units: z35.number(),
|
|
4173
|
+
...quotaFlag
|
|
4174
|
+
}).passthrough()
|
|
4175
|
+
);
|
|
4176
|
+
var CacheSummaryResponseSchema = aiGatewayEnvelope(
|
|
4177
|
+
z35.object({
|
|
4178
|
+
summary: z35.object({
|
|
4179
|
+
cacheHits: z35.number(),
|
|
4180
|
+
avgCacheLatency: z35.number().nullable(),
|
|
4181
|
+
totalRequests: z35.number(),
|
|
4182
|
+
cacheSpeedup: z35.number()
|
|
4183
|
+
}).passthrough(),
|
|
4184
|
+
...quotaFlag
|
|
4185
|
+
}).passthrough()
|
|
4186
|
+
);
|
|
4187
|
+
var CacheHitTrendResponseSchema = aiGatewayEnvelope(
|
|
4188
|
+
z35.object({
|
|
4189
|
+
trend: z35.array(
|
|
4190
|
+
z35.object({
|
|
4191
|
+
x: z35.string(),
|
|
4192
|
+
simpleHits: z35.number(),
|
|
4193
|
+
semanticHits: z35.number(),
|
|
4194
|
+
hitRate: z35.number(),
|
|
4195
|
+
cumulativeSimpleHitSavings: z35.number(),
|
|
4196
|
+
cumulativeSemanticHitSavings: z35.number()
|
|
4197
|
+
}).passthrough()
|
|
4198
|
+
),
|
|
4199
|
+
total: z35.number(),
|
|
4200
|
+
summary: z35.object({ totalCacheHits: z35.number(), hitRate: z35.number() }).passthrough(),
|
|
4201
|
+
...quotaFlag
|
|
4202
|
+
}).passthrough()
|
|
4203
|
+
);
|
|
4204
|
+
var UserTrendsResponseSchema = aiGatewayEnvelope(
|
|
4205
|
+
z35.object({
|
|
4206
|
+
summary: z35.object({ total: z35.number(), unique: z35.number(), avg: z35.number() }).passthrough(),
|
|
4207
|
+
trend: z35.array(GatewayChartRecordSchema),
|
|
4208
|
+
...quotaFlag
|
|
4209
|
+
}).passthrough()
|
|
4210
|
+
);
|
|
4211
|
+
var ErrorTrendsResponseSchema = aiGatewayEnvelope(
|
|
4212
|
+
z35.object({
|
|
4213
|
+
summary: z35.object({ errorPercent: z35.number() }).passthrough(),
|
|
4214
|
+
trend: z35.array(GatewayChartRecordSchema),
|
|
4215
|
+
...quotaFlag
|
|
4216
|
+
}).passthrough()
|
|
4217
|
+
);
|
|
4218
|
+
var RescuedRetriesResponseSchema = aiGatewayEnvelope(
|
|
4219
|
+
z35.object({
|
|
4220
|
+
trend: z35.array(
|
|
4221
|
+
z35.object({
|
|
4222
|
+
x: z35.string(),
|
|
4223
|
+
// Element shape unobserved — sample tenants only ever produced an empty array.
|
|
4224
|
+
// Treated like the sibling trends[].retry/fallback below until a tenant with
|
|
4225
|
+
// actual gateway retries lets us confirm the real shape. See open questions in
|
|
4226
|
+
// PRD-ai-gateway-client.md.
|
|
4227
|
+
y: z35.array(z35.unknown())
|
|
4228
|
+
}).passthrough()
|
|
4229
|
+
),
|
|
4230
|
+
total: z35.number(),
|
|
4231
|
+
trends: z35.array(
|
|
4232
|
+
z35.object({ x: z35.string(), retry: z35.array(z35.unknown()), fallback: z35.array(z35.unknown()) }).passthrough()
|
|
4233
|
+
),
|
|
4234
|
+
retryTotal: z35.number(),
|
|
4235
|
+
fallbackTotal: z35.number(),
|
|
4236
|
+
...quotaFlag
|
|
4237
|
+
}).passthrough()
|
|
4238
|
+
);
|
|
4239
|
+
var FeedbackScoreDistributionResponseSchema = aiGatewayEnvelope(
|
|
4240
|
+
z35.object({
|
|
4241
|
+
records: z35.array(z35.object({ x: z35.number(), y: z35.number() }).passthrough()),
|
|
4242
|
+
total: z35.number().nullable(),
|
|
4243
|
+
...quotaFlag
|
|
4244
|
+
}).passthrough()
|
|
4245
|
+
);
|
|
4246
|
+
var FeedbackModelsResponseSchema = aiGatewayEnvelope(
|
|
4247
|
+
z35.object({
|
|
4248
|
+
records: z35.array(
|
|
4249
|
+
z35.object({
|
|
4250
|
+
x: z35.string(),
|
|
4251
|
+
y: z35.object({ avgWeightedFeedback: z35.number(), feedbackCount: z35.number() }).passthrough()
|
|
4252
|
+
}).passthrough()
|
|
4253
|
+
),
|
|
4254
|
+
...quotaFlag
|
|
4255
|
+
}).passthrough()
|
|
4256
|
+
);
|
|
4257
|
+
var GatewayGroupRowSchema = z35.object({
|
|
4258
|
+
requests: z35.number(),
|
|
4259
|
+
cost: z35.number().optional(),
|
|
4260
|
+
avg_latency: z35.number().optional(),
|
|
4261
|
+
avg_tokens: z35.number().optional(),
|
|
4262
|
+
total_tokens: z35.number().optional(),
|
|
4263
|
+
success_rate: z35.number().optional(),
|
|
4264
|
+
last_seen: z35.string().optional(),
|
|
4265
|
+
object: z35.string()
|
|
4266
|
+
}).passthrough();
|
|
4267
|
+
var GroupListResponseSchema = aiGatewayGroupList(GatewayGroupRowSchema);
|
|
4268
|
+
var UserGroupResponseSchema = aiGatewayEnvelope(
|
|
4269
|
+
z35.object({
|
|
4270
|
+
records: z35.array(
|
|
4271
|
+
z35.object({ _user: z35.string(), count: z35.number(), cost: z35.number() }).passthrough()
|
|
4272
|
+
),
|
|
4273
|
+
total: z35.number(),
|
|
4274
|
+
...quotaFlag
|
|
4275
|
+
}).passthrough()
|
|
4276
|
+
);
|
|
4277
|
+
var GatewayLogRecordSchema = z35.object({
|
|
4278
|
+
id: z35.string(),
|
|
4279
|
+
workspace_slug: z35.string(),
|
|
4280
|
+
ai_model: z35.string(),
|
|
4281
|
+
_user: z35.string(),
|
|
4282
|
+
total_units: z35.number(),
|
|
4283
|
+
/** Cents. */
|
|
4284
|
+
cost: z35.number(),
|
|
4285
|
+
trace_id: z35.string(),
|
|
4286
|
+
/** 0/1, not boolean. */
|
|
4287
|
+
is_proxy_call: z35.number(),
|
|
4288
|
+
created_at: z35.string(),
|
|
4289
|
+
/** 0/1, not boolean. */
|
|
4290
|
+
is_success: z35.number(),
|
|
4291
|
+
/** `HIT` | `MISS` | `DISABLED`. */
|
|
4292
|
+
cache_status: z35.string(),
|
|
4293
|
+
retry_success_count: z35.number(),
|
|
4294
|
+
mode: z35.string(),
|
|
4295
|
+
last_used_option_index: z35.number(),
|
|
4296
|
+
/** 200 success, 446 AIRS security block (cost 0), 400 validation. */
|
|
4297
|
+
response_status_code: z35.number(),
|
|
4298
|
+
request_url: z35.string(),
|
|
4299
|
+
request_method: z35.string(),
|
|
4300
|
+
ai_org: z35.string(),
|
|
4301
|
+
api_key_id: z35.string(),
|
|
4302
|
+
license_id: z35.string(),
|
|
4303
|
+
log_store_file_path_format: z35.string(),
|
|
4304
|
+
metadataKey: z35.array(z35.string()),
|
|
4305
|
+
metadataValue: z35.array(z35.string()),
|
|
4306
|
+
prompt_slug: z35.string(),
|
|
4307
|
+
feedback: z35.array(z35.unknown())
|
|
4308
|
+
}).passthrough();
|
|
4309
|
+
var GatewayLogsResponseSchema = aiGatewayEnvelope(
|
|
4310
|
+
z35.object({
|
|
4311
|
+
records: z35.array(GatewayLogRecordSchema),
|
|
4312
|
+
total: z35.number(),
|
|
4313
|
+
capturedTotal: z35.number(),
|
|
4314
|
+
...quotaFlag
|
|
4315
|
+
}).passthrough()
|
|
4316
|
+
);
|
|
4317
|
+
var GatewayWriteResponseSchema = z35.object({}).passthrough();
|
|
4318
|
+
var GatewayWorkspaceSchema = z35.object({
|
|
4319
|
+
id: z35.string(),
|
|
4320
|
+
slug: z35.string(),
|
|
4321
|
+
name: z35.string(),
|
|
4322
|
+
icon: z35.string().nullable(),
|
|
4323
|
+
// Nullable: a workspace created without one returns null, and upstream declares it
|
|
4324
|
+
// `nullable: true`. Observed on an archived workspace (#213).
|
|
4325
|
+
description: z35.string().nullable(),
|
|
4326
|
+
created_at: z35.string(),
|
|
4327
|
+
last_updated_at: z35.string(),
|
|
4328
|
+
is_default: z35.number(),
|
|
4329
|
+
status: z35.string(),
|
|
4330
|
+
scope_name: z35.string(),
|
|
4331
|
+
object: z35.string()
|
|
4332
|
+
}).passthrough();
|
|
4333
|
+
var GatewayWorkspaceDetailSchema = z35.object({
|
|
4334
|
+
id: z35.string(),
|
|
4335
|
+
name: z35.string(),
|
|
4336
|
+
/** Nullable — see `GatewayWorkspaceSchema.description`. */
|
|
4337
|
+
description: z35.string().nullable(),
|
|
4338
|
+
created_at: z35.string(),
|
|
4339
|
+
last_updated_at: z35.string(),
|
|
4340
|
+
is_default: z35.number(),
|
|
4341
|
+
slug: z35.string(),
|
|
4342
|
+
icon: z35.string().nullable(),
|
|
4343
|
+
defaults: z35.record(z35.unknown()).nullable(),
|
|
4344
|
+
usage_limits: limitsField(GatewayUsageLimitSchema),
|
|
4345
|
+
rate_limits: limitsField(GatewayRateLimitSchema),
|
|
4346
|
+
security_settings: z35.record(z35.boolean()).optional(),
|
|
4347
|
+
data_plane_security_settings: z35.record(z35.unknown()).optional(),
|
|
4348
|
+
settings: z35.record(z35.unknown()).optional(),
|
|
4349
|
+
/**
|
|
4350
|
+
* Lifecycle state. **Diverges from the list row**: `list()` reports `'active'` for a
|
|
4351
|
+
* workspace whose `get()` reports `null` (observed live 2026-08-01). Prefer the list value,
|
|
4352
|
+
* or treat a `null` here as "unknown", not as "inactive".
|
|
4353
|
+
*/
|
|
4354
|
+
status: z35.string().nullable().optional()
|
|
4355
|
+
}).passthrough();
|
|
4356
|
+
var GatewayWorkspaceCreateResponseSchema = z35.object({
|
|
4357
|
+
id: z35.string(),
|
|
4358
|
+
name: z35.string(),
|
|
4359
|
+
slug: z35.string(),
|
|
4360
|
+
description: z35.string().nullable(),
|
|
4361
|
+
created_at: z35.string(),
|
|
4362
|
+
last_updated_at: z35.string(),
|
|
4363
|
+
scope_name: z35.string(),
|
|
4364
|
+
object: z35.string(),
|
|
4365
|
+
defaults: z35.record(z35.unknown()).nullable().optional(),
|
|
4366
|
+
/** Seeded workspace members. Present on create only. */
|
|
4367
|
+
users: z35.array(z35.unknown()).optional()
|
|
4368
|
+
}).passthrough();
|
|
4369
|
+
var ListWorkspacesResponseSchema = aiGatewayList(GatewayWorkspaceSchema);
|
|
4370
|
+
var GatewayConfigSchema = z35.object({
|
|
4371
|
+
id: z35.string(),
|
|
4372
|
+
name: z35.string(),
|
|
4373
|
+
slug: z35.string(),
|
|
4374
|
+
/** Internal organisation UUID — NOT the TSG that write requests take. */
|
|
4375
|
+
organisation_id: z35.string(),
|
|
4376
|
+
is_default: z35.number(),
|
|
4377
|
+
status: z35.string(),
|
|
4378
|
+
owner_id: z35.string(),
|
|
4379
|
+
updated_by: z35.string(),
|
|
4380
|
+
created_at: z35.string(),
|
|
4381
|
+
last_updated_at: z35.string(),
|
|
4382
|
+
workspace_id: z35.string(),
|
|
4383
|
+
object: z35.string()
|
|
4384
|
+
}).passthrough();
|
|
4385
|
+
var ListConfigsResponseSchema = aiGatewayList(GatewayConfigSchema);
|
|
4386
|
+
var GatewayConfigDetailSchema = GatewayConfigSchema.extend({
|
|
4387
|
+
config: z35.string(),
|
|
4388
|
+
format: z35.string(),
|
|
4389
|
+
type: z35.string(),
|
|
4390
|
+
version_id: z35.string()
|
|
4391
|
+
}).passthrough();
|
|
4392
|
+
var GatewayConfigCreateResponseSchema = z35.object({
|
|
4393
|
+
id: z35.string(),
|
|
4394
|
+
version_id: z35.string(),
|
|
4395
|
+
slug: z35.string(),
|
|
4396
|
+
object: z35.string()
|
|
4397
|
+
}).passthrough();
|
|
4398
|
+
var GatewayGuardrailSchema = z35.object({
|
|
4399
|
+
id: z35.string(),
|
|
4400
|
+
name: z35.string(),
|
|
4401
|
+
slug: z35.string(),
|
|
4402
|
+
organisation_id: z35.string(),
|
|
4403
|
+
status: z35.string(),
|
|
4404
|
+
owner_id: z35.string(),
|
|
4405
|
+
updated_by: z35.string().nullable(),
|
|
4406
|
+
created_at: z35.string(),
|
|
4407
|
+
last_updated_at: z35.string(),
|
|
4408
|
+
workspace_id: z35.string(),
|
|
4409
|
+
object: z35.string()
|
|
4410
|
+
}).passthrough();
|
|
4411
|
+
var ListGuardrailsResponseSchema = aiGatewayList(GatewayGuardrailSchema);
|
|
4412
|
+
var guardrailFeedbackActionSchema = z35.object({
|
|
4413
|
+
feedback: z35.object({ value: z35.number(), weight: z35.number(), metadata: z35.string() }).passthrough()
|
|
4414
|
+
}).passthrough();
|
|
4415
|
+
var GatewayGuardrailDetailSchema = GatewayGuardrailSchema.extend({
|
|
4416
|
+
checks: z35.array(
|
|
4417
|
+
z35.object({
|
|
4418
|
+
/** e.g. `panw-prisma-airs.intercept`, the Prisma AIRS intercept check. */
|
|
4419
|
+
id: z35.string(),
|
|
4420
|
+
parameters: z35.record(z35.unknown()),
|
|
4421
|
+
is_enabled: z35.boolean()
|
|
4422
|
+
}).passthrough()
|
|
4423
|
+
),
|
|
4424
|
+
actions: z35.object({
|
|
4425
|
+
deny: z35.boolean(),
|
|
4426
|
+
async: z35.boolean(),
|
|
4427
|
+
sequential: z35.boolean(),
|
|
4428
|
+
/** Absent when the guardrail was created without a pass/fail feedback action. */
|
|
4429
|
+
on_success: guardrailFeedbackActionSchema.optional(),
|
|
4430
|
+
on_fail: guardrailFeedbackActionSchema.optional()
|
|
4431
|
+
}).passthrough(),
|
|
4432
|
+
version_id: z35.string()
|
|
4433
|
+
}).passthrough();
|
|
4434
|
+
var GatewayGuardrailCreateResponseSchema = z35.object({
|
|
4435
|
+
id: z35.string(),
|
|
4436
|
+
version_id: z35.string(),
|
|
4437
|
+
slug: z35.string(),
|
|
4438
|
+
object: z35.string()
|
|
4439
|
+
}).passthrough();
|
|
4440
|
+
var GatewayProviderSchema = z35.object({
|
|
4441
|
+
id: z35.string(),
|
|
4442
|
+
name: z35.string().optional(),
|
|
4443
|
+
slug: z35.string().optional(),
|
|
4444
|
+
object: z35.string().optional()
|
|
4445
|
+
}).passthrough();
|
|
4446
|
+
var ListProvidersResponseSchema = aiGatewayList(GatewayProviderSchema);
|
|
4447
|
+
var GatewayProviderCreateResponseSchema = z35.object({
|
|
4448
|
+
id: z35.string(),
|
|
4449
|
+
slug: z35.string(),
|
|
4450
|
+
object: z35.string()
|
|
4451
|
+
}).passthrough();
|
|
4452
|
+
var GatewayApiKeySchema = z35.object({
|
|
4453
|
+
id: z35.string(),
|
|
4454
|
+
name: z35.string().optional(),
|
|
4455
|
+
object: z35.string().optional()
|
|
4456
|
+
}).passthrough();
|
|
4457
|
+
var ListApiKeysResponseSchema = aiGatewayList(GatewayApiKeySchema);
|
|
4458
|
+
var GatewayIntegrationSchema = z35.object({
|
|
4459
|
+
id: z35.string(),
|
|
4460
|
+
organisation_id: z35.string().optional(),
|
|
4461
|
+
name: z35.string(),
|
|
4462
|
+
owner_id: z35.string(),
|
|
4463
|
+
status: z35.string(),
|
|
4464
|
+
created_at: z35.string(),
|
|
4465
|
+
last_updated_at: z35.string(),
|
|
4466
|
+
slug: z35.string(),
|
|
4467
|
+
tags: z35.unknown().nullable(),
|
|
4468
|
+
description: z35.string().nullable(),
|
|
4469
|
+
workspaces_count: z35.number().optional(),
|
|
4470
|
+
type: z35.string().optional(),
|
|
4471
|
+
workspace_id: z35.string().nullable(),
|
|
4472
|
+
ai_provider_id: z35.string(),
|
|
4473
|
+
object: z35.string()
|
|
4474
|
+
}).passthrough();
|
|
4475
|
+
var ListIntegrationsResponseSchema = aiGatewayList(GatewayIntegrationSchema);
|
|
4476
|
+
var GatewayIntegrationModelsResponseSchema = z35.object({
|
|
4477
|
+
models: z35.array(z35.object({ slug: z35.string(), enabled: z35.boolean() }).passthrough()),
|
|
4478
|
+
allow_all_models: z35.boolean(),
|
|
4479
|
+
object: z35.string()
|
|
4480
|
+
}).passthrough();
|
|
4481
|
+
var GatewayIntegrationWorkspaceSchema = z35.object({
|
|
4482
|
+
id: z35.string(),
|
|
4483
|
+
usage_limits: limitsField(GatewayUsageLimitSchema),
|
|
4484
|
+
rate_limits: limitsField(GatewayRateLimitSchema),
|
|
4485
|
+
enabled: z35.boolean(),
|
|
4486
|
+
status: z35.string(),
|
|
4487
|
+
created_at: z35.string(),
|
|
4488
|
+
last_updated_at: z35.string(),
|
|
4489
|
+
last_reset_at: z35.string().nullable()
|
|
4490
|
+
}).passthrough();
|
|
4491
|
+
var GatewayGlobalWorkspaceAccessSchema = z35.object({
|
|
4492
|
+
enabled: z35.boolean(),
|
|
4493
|
+
rate_limits: limitsField(GatewayRateLimitSchema),
|
|
4494
|
+
usage_limits: limitsField(GatewayUsageLimitSchema)
|
|
4495
|
+
}).passthrough();
|
|
4496
|
+
var GatewayIntegrationWorkspacesResponseSchema = z35.object({
|
|
4497
|
+
workspaces: z35.array(GatewayIntegrationWorkspaceSchema),
|
|
4498
|
+
global_workspace_access: GatewayGlobalWorkspaceAccessSchema,
|
|
4499
|
+
object: z35.string()
|
|
4500
|
+
}).passthrough();
|
|
4501
|
+
var McpIntegrationSchema = z35.object({
|
|
4502
|
+
id: z35.string(),
|
|
4503
|
+
organisation_id: z35.string(),
|
|
4504
|
+
name: z35.string(),
|
|
4505
|
+
owner_id: z35.string(),
|
|
4506
|
+
status: z35.string(),
|
|
4507
|
+
type: z35.string(),
|
|
4508
|
+
url: z35.string(),
|
|
4509
|
+
auth_type: z35.string(),
|
|
4510
|
+
transport: z35.string(),
|
|
4511
|
+
/**
|
|
4512
|
+
* JSON-encoded STRING on reads — the same request/response asymmetry as
|
|
4513
|
+
* `configs.config` (see {@link GatewayConfigDetailSchema}). The CREATE request
|
|
4514
|
+
* (`McpIntegrationCreateRequest.configurations`) sends an object; this is the read shape.
|
|
4515
|
+
*/
|
|
4516
|
+
configurations: z35.string(),
|
|
4517
|
+
created_at: z35.string(),
|
|
4518
|
+
last_updated_at: z35.string()
|
|
4519
|
+
}).passthrough();
|
|
4520
|
+
var ListMcpIntegrationsResponseSchema = aiGatewayList(McpIntegrationSchema);
|
|
4521
|
+
var GatewayDeploymentSchema = z35.object({
|
|
4522
|
+
id: z35.string(),
|
|
4523
|
+
name: z35.string(),
|
|
4524
|
+
slug: z35.string(),
|
|
4525
|
+
type: z35.string(),
|
|
4526
|
+
/** `active` | `archived`. DELETE archives rather than removes. */
|
|
4527
|
+
status: z35.string(),
|
|
4528
|
+
created_at: z35.string(),
|
|
4529
|
+
last_updated_at: z35.string(),
|
|
4530
|
+
last_synced_at: z35.string().nullable(),
|
|
4531
|
+
last_resynced_at: z35.string().nullable(),
|
|
4532
|
+
is_default: z35.number(),
|
|
4533
|
+
created_by: z35.string(),
|
|
4534
|
+
object: z35.string()
|
|
4535
|
+
}).passthrough();
|
|
4536
|
+
var GatewayDeploymentDetailSchema = GatewayDeploymentSchema.extend({
|
|
4537
|
+
credentials: z35.object({ username: z35.string(), password: z35.string() }).passthrough().optional(),
|
|
4538
|
+
deployment_config: z35.record(z35.unknown()).nullable(),
|
|
4539
|
+
auth_settings: z35.object({
|
|
4540
|
+
/** 0/1, not boolean — the create REQUEST sends a real boolean here. */
|
|
4541
|
+
disable_portkey_gateway: z35.number(),
|
|
4542
|
+
workspaces_allowed: z35.array(z35.string()),
|
|
4543
|
+
allow_all_workspaces: z35.number()
|
|
4544
|
+
}).passthrough().optional(),
|
|
4545
|
+
client_auth: z35.string().optional(),
|
|
4546
|
+
workspaces: z35.array(z35.object({ id: z35.string(), slug: z35.string() }).passthrough()).optional()
|
|
4547
|
+
}).passthrough();
|
|
4548
|
+
var GatewayDeploymentCreateResponseSchema = z35.object({
|
|
4549
|
+
id: z35.string(),
|
|
4550
|
+
client_auth: z35.string(),
|
|
4551
|
+
credentials: z35.object({ username: z35.string(), password: z35.string() }).passthrough(),
|
|
4552
|
+
/** Internal organisation UUID — NOT the TSG sent in the request. */
|
|
4553
|
+
organisation_id: z35.string(),
|
|
4554
|
+
object: z35.string()
|
|
4555
|
+
}).passthrough();
|
|
4556
|
+
var ListDeploymentsResponseSchema = aiGatewayList(GatewayDeploymentSchema);
|
|
4557
|
+
var GatewayPluginSchema = z35.object({
|
|
4558
|
+
id: z35.string(),
|
|
4559
|
+
integration_id: z35.string(),
|
|
4560
|
+
credentials: z35.record(z35.string()),
|
|
4561
|
+
owner_id: z35.string(),
|
|
4562
|
+
created_at: z35.string(),
|
|
4563
|
+
last_updated_at: z35.string(),
|
|
4564
|
+
status: z35.string(),
|
|
4565
|
+
integration_slug: z35.string(),
|
|
4566
|
+
plugin_provider_id: z35.string(),
|
|
4567
|
+
plugin_provider_slug: z35.string(),
|
|
4568
|
+
object: z35.string()
|
|
4569
|
+
}).passthrough();
|
|
4570
|
+
var ListPluginsResponseSchema = aiGatewayList(GatewayPluginSchema);
|
|
4571
|
+
var OrganisationSelfResponseSchema = z35.object({ success: z35.boolean(), data: z35.record(z35.unknown()) }).passthrough();
|
|
4572
|
+
var AuthSettingsResponseSchema = z35.object({ success: z35.boolean(), data: z35.record(z35.unknown()) }).passthrough();
|
|
4573
|
+
var GatewayAuditLogRecordSchema = z35.object({
|
|
4574
|
+
timestamp: z35.string(),
|
|
4575
|
+
method: z35.string(),
|
|
4576
|
+
uri: z35.string(),
|
|
4577
|
+
request_id: z35.string(),
|
|
4578
|
+
request_body: z35.string(),
|
|
4579
|
+
query_params: z35.string(),
|
|
4580
|
+
request_headers: z35.string(),
|
|
4581
|
+
user_id: z35.string(),
|
|
4582
|
+
user_type: z35.string(),
|
|
4583
|
+
organisation_id: z35.string(),
|
|
4584
|
+
workspace_id: z35.string(),
|
|
4585
|
+
response_status_code: z35.number(),
|
|
4586
|
+
resource_type: z35.string(),
|
|
4587
|
+
action: z35.string(),
|
|
4588
|
+
client_ip: z35.string(),
|
|
4589
|
+
country: z35.string()
|
|
4590
|
+
}).passthrough();
|
|
4591
|
+
var GatewayAuditLogsResponseSchema = z35.object({ records: z35.array(GatewayAuditLogRecordSchema) }).passthrough();
|
|
4592
|
+
|
|
3966
4593
|
// src/http/auth/oauth.ts
|
|
3967
4594
|
var OAuthAuth = class {
|
|
3968
4595
|
constructor(oauthClient) {
|
|
@@ -3985,12 +4612,12 @@ var OAuthAuth = class {
|
|
|
3985
4612
|
};
|
|
3986
4613
|
|
|
3987
4614
|
// src/models/oauth-token.ts
|
|
3988
|
-
import { z as
|
|
3989
|
-
var OAuthTokenResponseSchema =
|
|
3990
|
-
access_token:
|
|
3991
|
-
token_type:
|
|
3992
|
-
expires_in:
|
|
3993
|
-
scope:
|
|
4615
|
+
import { z as z36 } from "zod";
|
|
4616
|
+
var OAuthTokenResponseSchema = z36.object({
|
|
4617
|
+
access_token: z36.string(),
|
|
4618
|
+
token_type: z36.string().optional(),
|
|
4619
|
+
expires_in: z36.number(),
|
|
4620
|
+
scope: z36.string().optional()
|
|
3994
4621
|
}).passthrough();
|
|
3995
4622
|
|
|
3996
4623
|
// src/management/oauth-client.ts
|
|
@@ -4216,6 +4843,22 @@ function assertUuid(value, fieldName) {
|
|
|
4216
4843
|
);
|
|
4217
4844
|
}
|
|
4218
4845
|
}
|
|
4846
|
+
function assertWorkspaceRef(value, fieldName) {
|
|
4847
|
+
if (!isValidUuid(value) && !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) {
|
|
4848
|
+
throw new AISecSDKException(
|
|
4849
|
+
`Invalid ${fieldName}: ${value} (expected a workspace UUID or slug)`,
|
|
4850
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4851
|
+
);
|
|
4852
|
+
}
|
|
4853
|
+
}
|
|
4854
|
+
function assertNumericId(value, fieldName) {
|
|
4855
|
+
if (!/^\d+$/.test(value)) {
|
|
4856
|
+
throw new AISecSDKException(
|
|
4857
|
+
`Invalid ${fieldName}: ${value}`,
|
|
4858
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4859
|
+
);
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4219
4862
|
|
|
4220
4863
|
// src/management/profiles.ts
|
|
4221
4864
|
var ProfilesClient = class {
|
|
@@ -4975,7 +5618,7 @@ var ScanLogsClient = class {
|
|
|
4975
5618
|
};
|
|
4976
5619
|
|
|
4977
5620
|
// src/management/oauth-management.ts
|
|
4978
|
-
import { z as
|
|
5621
|
+
import { z as z37 } from "zod";
|
|
4979
5622
|
var OAuthManagementClient = class {
|
|
4980
5623
|
baseUrl;
|
|
4981
5624
|
auth;
|
|
@@ -5009,7 +5652,7 @@ var OAuthManagementClient = class {
|
|
|
5009
5652
|
path: MGMT_OAUTH_INVALIDATE_PATH,
|
|
5010
5653
|
params: { token },
|
|
5011
5654
|
body,
|
|
5012
|
-
responseSchema:
|
|
5655
|
+
responseSchema: z37.string(),
|
|
5013
5656
|
auth: this.auth,
|
|
5014
5657
|
numRetries: this.numRetries
|
|
5015
5658
|
});
|
|
@@ -6870,7 +7513,7 @@ var ModelSecurityClient = class {
|
|
|
6870
7513
|
};
|
|
6871
7514
|
|
|
6872
7515
|
// src/red-team/scans-client.ts
|
|
6873
|
-
import { z as
|
|
7516
|
+
import { z as z38 } from "zod";
|
|
6874
7517
|
var RedTeamScansClient = class {
|
|
6875
7518
|
baseUrl;
|
|
6876
7519
|
auth;
|
|
@@ -7007,7 +7650,7 @@ var RedTeamScansClient = class {
|
|
|
7007
7650
|
method: "GET",
|
|
7008
7651
|
baseUrl: this.baseUrl,
|
|
7009
7652
|
path: RED_TEAM_CATEGORIES_PATH,
|
|
7010
|
-
responseSchema:
|
|
7653
|
+
responseSchema: z38.array(CategoryModelSchema),
|
|
7011
7654
|
auth: this.auth,
|
|
7012
7655
|
numRetries: this.numRetries
|
|
7013
7656
|
});
|
|
@@ -7015,7 +7658,7 @@ var RedTeamScansClient = class {
|
|
|
7015
7658
|
};
|
|
7016
7659
|
|
|
7017
7660
|
// src/red-team/reports-client.ts
|
|
7018
|
-
import { z as
|
|
7661
|
+
import { z as z39 } from "zod";
|
|
7019
7662
|
var RedTeamReportsClient = class {
|
|
7020
7663
|
baseUrl;
|
|
7021
7664
|
auth;
|
|
@@ -7390,7 +8033,7 @@ var RedTeamReportsClient = class {
|
|
|
7390
8033
|
baseUrl: this.baseUrl,
|
|
7391
8034
|
path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
|
|
7392
8035
|
params: { file_format: format },
|
|
7393
|
-
responseSchema:
|
|
8036
|
+
responseSchema: z39.unknown(),
|
|
7394
8037
|
auth: this.auth,
|
|
7395
8038
|
numRetries: this.numRetries
|
|
7396
8039
|
});
|
|
@@ -7414,7 +8057,7 @@ var RedTeamReportsClient = class {
|
|
|
7414
8057
|
method: "POST",
|
|
7415
8058
|
baseUrl: this.baseUrl,
|
|
7416
8059
|
path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
|
|
7417
|
-
responseSchema:
|
|
8060
|
+
responseSchema: z39.unknown(),
|
|
7418
8061
|
auth: this.auth,
|
|
7419
8062
|
numRetries: this.numRetries
|
|
7420
8063
|
});
|
|
@@ -7422,7 +8065,7 @@ var RedTeamReportsClient = class {
|
|
|
7422
8065
|
};
|
|
7423
8066
|
|
|
7424
8067
|
// src/red-team/custom-attack-reports-client.ts
|
|
7425
|
-
import { z as
|
|
8068
|
+
import { z as z40 } from "zod";
|
|
7426
8069
|
var RedTeamCustomAttackReportsClient = class {
|
|
7427
8070
|
baseUrl;
|
|
7428
8071
|
auth;
|
|
@@ -7512,7 +8155,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7512
8155
|
baseUrl: this.baseUrl,
|
|
7513
8156
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
7514
8157
|
params,
|
|
7515
|
-
responseSchema:
|
|
8158
|
+
responseSchema: z40.array(PromptDetailResponseSchema),
|
|
7516
8159
|
auth: this.auth,
|
|
7517
8160
|
numRetries: this.numRetries
|
|
7518
8161
|
});
|
|
@@ -7606,7 +8249,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7606
8249
|
method: "GET",
|
|
7607
8250
|
baseUrl: this.baseUrl,
|
|
7608
8251
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
|
|
7609
|
-
responseSchema:
|
|
8252
|
+
responseSchema: z40.array(CustomAttackOutputSchema),
|
|
7610
8253
|
auth: this.auth,
|
|
7611
8254
|
numRetries: this.numRetries
|
|
7612
8255
|
});
|
|
@@ -7631,7 +8274,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7631
8274
|
method: "GET",
|
|
7632
8275
|
baseUrl: this.baseUrl,
|
|
7633
8276
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
|
|
7634
|
-
responseSchema:
|
|
8277
|
+
responseSchema: z40.array(PropertyStatisticSchema),
|
|
7635
8278
|
auth: this.auth,
|
|
7636
8279
|
numRetries: this.numRetries
|
|
7637
8280
|
});
|
|
@@ -7639,7 +8282,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
7639
8282
|
};
|
|
7640
8283
|
|
|
7641
8284
|
// src/red-team/targets-client.ts
|
|
7642
|
-
import { z as
|
|
8285
|
+
import { z as z41 } from "zod";
|
|
7643
8286
|
var RedTeamTargetsClient = class {
|
|
7644
8287
|
baseUrl;
|
|
7645
8288
|
auth;
|
|
@@ -7932,7 +8575,7 @@ var RedTeamTargetsClient = class {
|
|
|
7932
8575
|
method: "GET",
|
|
7933
8576
|
baseUrl: this.baseUrl,
|
|
7934
8577
|
path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
|
|
7935
|
-
responseSchema:
|
|
8578
|
+
responseSchema: z41.record(z41.unknown()),
|
|
7936
8579
|
auth: this.auth,
|
|
7937
8580
|
numRetries: this.numRetries
|
|
7938
8581
|
});
|
|
@@ -9030,6 +9673,176 @@ var RedTeamNetworkBrokerClient = class {
|
|
|
9030
9673
|
}
|
|
9031
9674
|
};
|
|
9032
9675
|
|
|
9676
|
+
// src/red-team/adapters-client.ts
|
|
9677
|
+
var RedTeamAdaptersClient = class {
|
|
9678
|
+
baseUrl;
|
|
9679
|
+
auth;
|
|
9680
|
+
numRetries;
|
|
9681
|
+
constructor(opts) {
|
|
9682
|
+
this.baseUrl = opts.baseUrl;
|
|
9683
|
+
this.auth = opts.auth;
|
|
9684
|
+
this.numRetries = opts.numRetries;
|
|
9685
|
+
}
|
|
9686
|
+
/**
|
|
9687
|
+
* Create a new custom target adapter.
|
|
9688
|
+
* @param body - Adapter creation request (name, base64 script, variables, validation prompt).
|
|
9689
|
+
* @param opts - Set validate: false to save as DRAFT without running the script.
|
|
9690
|
+
* @returns The created adapter.
|
|
9691
|
+
* @example
|
|
9692
|
+
* ```ts
|
|
9693
|
+
* const adapter = await rt.adapters.create({
|
|
9694
|
+
* name: 'my-adapter',
|
|
9695
|
+
* script_b64: Buffer.from(script).toString('base64'),
|
|
9696
|
+
* network_broker_channel_uuid: '550e8400-...',
|
|
9697
|
+
* variables: [{ key: 'endpoint', value: 'http://...', type: 'VAR' }],
|
|
9698
|
+
* prompt: 'Hello',
|
|
9699
|
+
* }, { validate: true });
|
|
9700
|
+
* ```
|
|
9701
|
+
*/
|
|
9702
|
+
async create(body, opts) {
|
|
9703
|
+
const validate = opts?.validate ?? true;
|
|
9704
|
+
return request({
|
|
9705
|
+
method: "POST",
|
|
9706
|
+
baseUrl: this.baseUrl,
|
|
9707
|
+
path: RED_TEAM_ADAPTER_PATH,
|
|
9708
|
+
params: { validate: String(validate) },
|
|
9709
|
+
body,
|
|
9710
|
+
responseSchema: AdapterResponseSchema,
|
|
9711
|
+
auth: this.auth,
|
|
9712
|
+
numRetries: this.numRetries
|
|
9713
|
+
});
|
|
9714
|
+
}
|
|
9715
|
+
/**
|
|
9716
|
+
* List adapters with optional pagination.
|
|
9717
|
+
* @param opts - Optional limit/skip/search.
|
|
9718
|
+
* @returns Paginated list of adapters.
|
|
9719
|
+
* @example
|
|
9720
|
+
* ```ts
|
|
9721
|
+
* const { data } = await rt.adapters.list({ limit: 20 });
|
|
9722
|
+
* // data => [{ uuid: '...', name: 'my-adapter', status: 'ACTIVE' }]
|
|
9723
|
+
* ```
|
|
9724
|
+
*/
|
|
9725
|
+
async list(opts) {
|
|
9726
|
+
return request({
|
|
9727
|
+
method: "GET",
|
|
9728
|
+
baseUrl: this.baseUrl,
|
|
9729
|
+
path: RED_TEAM_ADAPTER_PATH,
|
|
9730
|
+
params: serializeListing(opts),
|
|
9731
|
+
responseSchema: AdapterListSchema,
|
|
9732
|
+
auth: this.auth,
|
|
9733
|
+
numRetries: this.numRetries
|
|
9734
|
+
});
|
|
9735
|
+
}
|
|
9736
|
+
/**
|
|
9737
|
+
* Get a single adapter by UUID.
|
|
9738
|
+
* @param uuid - Adapter UUID.
|
|
9739
|
+
* @returns The adapter detail.
|
|
9740
|
+
* @example
|
|
9741
|
+
* ```ts
|
|
9742
|
+
* const adapter = await rt.adapters.get('550e8400-e29b-41d4-a716-446655440000');
|
|
9743
|
+
* // adapter.status => 'ACTIVE'
|
|
9744
|
+
* ```
|
|
9745
|
+
*/
|
|
9746
|
+
async get(uuid) {
|
|
9747
|
+
assertUuid(uuid, "adapter uuid");
|
|
9748
|
+
return request({
|
|
9749
|
+
method: "GET",
|
|
9750
|
+
baseUrl: this.baseUrl,
|
|
9751
|
+
path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
|
|
9752
|
+
responseSchema: AdapterResponseSchema,
|
|
9753
|
+
auth: this.auth,
|
|
9754
|
+
numRetries: this.numRetries
|
|
9755
|
+
});
|
|
9756
|
+
}
|
|
9757
|
+
/**
|
|
9758
|
+
* Update an adapter. **Full replacement (PUT), not a patch** — `name`, `script_b64`, and
|
|
9759
|
+
* `prompt` are required just as on create. For `variables`, the list defines the complete
|
|
9760
|
+
* desired key set: a provided value sets it, `null` keeps the stored value (unchanged
|
|
9761
|
+
* secrets), and omitting a key **deletes** that variable.
|
|
9762
|
+
* @param uuid - Adapter UUID.
|
|
9763
|
+
* @param body - The complete adapter definition.
|
|
9764
|
+
* @param opts - Set validate: false to save as DRAFT without re-running the script.
|
|
9765
|
+
* @returns The updated adapter.
|
|
9766
|
+
* @example
|
|
9767
|
+
* ```ts
|
|
9768
|
+
* const updated = await rt.adapters.update('550e8400-...', {
|
|
9769
|
+
* name: 'my-keycloak-agent',
|
|
9770
|
+
* script_b64: Buffer.from(newScript).toString('base64'),
|
|
9771
|
+
* prompt: 'What is the capital of France?',
|
|
9772
|
+
* variables: [
|
|
9773
|
+
* { key: 'endpoint', value: 'http://agent.svc:8080', type: 'VAR' },
|
|
9774
|
+
* { key: 'client_secret', value: null, type: 'SECRET' }, // null keeps stored secret
|
|
9775
|
+
* ],
|
|
9776
|
+
* });
|
|
9777
|
+
* ```
|
|
9778
|
+
*/
|
|
9779
|
+
async update(uuid, body, opts) {
|
|
9780
|
+
assertUuid(uuid, "adapter uuid");
|
|
9781
|
+
const validate = opts?.validate ?? true;
|
|
9782
|
+
return request({
|
|
9783
|
+
method: "PUT",
|
|
9784
|
+
baseUrl: this.baseUrl,
|
|
9785
|
+
path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
|
|
9786
|
+
params: { validate: String(validate) },
|
|
9787
|
+
body,
|
|
9788
|
+
responseSchema: AdapterResponseSchema,
|
|
9789
|
+
auth: this.auth,
|
|
9790
|
+
numRetries: this.numRetries
|
|
9791
|
+
});
|
|
9792
|
+
}
|
|
9793
|
+
/**
|
|
9794
|
+
* Delete an adapter.
|
|
9795
|
+
* @param uuid - Adapter UUID.
|
|
9796
|
+
* @example
|
|
9797
|
+
* ```ts
|
|
9798
|
+
* await rt.adapters.delete('550e8400-e29b-41d4-a716-446655440000');
|
|
9799
|
+
* ```
|
|
9800
|
+
*/
|
|
9801
|
+
async delete(uuid) {
|
|
9802
|
+
assertUuid(uuid, "adapter uuid");
|
|
9803
|
+
return request({
|
|
9804
|
+
method: "DELETE",
|
|
9805
|
+
baseUrl: this.baseUrl,
|
|
9806
|
+
path: `${RED_TEAM_ADAPTER_PATH}/${uuid}`,
|
|
9807
|
+
responseSchema: BaseResponseSchema.optional(),
|
|
9808
|
+
allowEmptyBody: true,
|
|
9809
|
+
auth: this.auth,
|
|
9810
|
+
numRetries: this.numRetries
|
|
9811
|
+
});
|
|
9812
|
+
}
|
|
9813
|
+
/**
|
|
9814
|
+
* Validate an adapter script without saving anything. Runs the script end-to-end through the
|
|
9815
|
+
* network broker channel using the sample prompt, and returns the execution outcome —
|
|
9816
|
+
* `validated` plus the script's `stdout` / `stderr` / `traceback` — not an adapter record.
|
|
9817
|
+
*
|
|
9818
|
+
* This endpoint has its own request shape: no `name`, `network_broker_channel_uuid` is
|
|
9819
|
+
* required, and `adapter_uuid` may reference an existing adapter so `null` variable values
|
|
9820
|
+
* are resolved from its stored secrets before the run.
|
|
9821
|
+
* @param body - Script, channel, prompt, and optionally variables / an existing adapter UUID.
|
|
9822
|
+
* @returns The validation outcome.
|
|
9823
|
+
* @example
|
|
9824
|
+
* ```ts
|
|
9825
|
+
* const result = await rt.adapters.validate({
|
|
9826
|
+
* script_b64: Buffer.from(script).toString('base64'),
|
|
9827
|
+
* network_broker_channel_uuid: '550e8400-...',
|
|
9828
|
+
* prompt: 'Hello',
|
|
9829
|
+
* });
|
|
9830
|
+
* if (!result.validated) console.error(result.stderr ?? result.traceback);
|
|
9831
|
+
* ```
|
|
9832
|
+
*/
|
|
9833
|
+
async validate(body) {
|
|
9834
|
+
return request({
|
|
9835
|
+
method: "POST",
|
|
9836
|
+
baseUrl: this.baseUrl,
|
|
9837
|
+
path: RED_TEAM_ADAPTER_VALIDATE_PATH,
|
|
9838
|
+
body,
|
|
9839
|
+
responseSchema: AdapterValidateResponseSchema,
|
|
9840
|
+
auth: this.auth,
|
|
9841
|
+
numRetries: this.numRetries
|
|
9842
|
+
});
|
|
9843
|
+
}
|
|
9844
|
+
};
|
|
9845
|
+
|
|
9033
9846
|
// src/red-team/client.ts
|
|
9034
9847
|
var RedTeamClient = class {
|
|
9035
9848
|
/** Data plane scan operations. */
|
|
@@ -9048,6 +9861,8 @@ var RedTeamClient = class {
|
|
|
9048
9861
|
instances;
|
|
9049
9862
|
/** Network broker channel operations (distinct network broker base URL). */
|
|
9050
9863
|
networkBroker;
|
|
9864
|
+
/** Management plane custom target adapter operations. */
|
|
9865
|
+
adapters;
|
|
9051
9866
|
dataEndpoint;
|
|
9052
9867
|
mgmtEndpoint;
|
|
9053
9868
|
auth;
|
|
@@ -9086,6 +9901,7 @@ var RedTeamClient = class {
|
|
|
9086
9901
|
});
|
|
9087
9902
|
this.eula = new RedTeamEulaClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
9088
9903
|
this.instances = new RedTeamInstancesClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
9904
|
+
this.adapters = new RedTeamAdaptersClient({ baseUrl: mgmtEndpoint, auth, numRetries });
|
|
9089
9905
|
this.networkBroker = new RedTeamNetworkBrokerClient({
|
|
9090
9906
|
baseUrl: networkBrokerEndpoint,
|
|
9091
9907
|
auth,
|
|
@@ -9355,14 +10171,2014 @@ var RedTeamClient = class {
|
|
|
9355
10171
|
});
|
|
9356
10172
|
}
|
|
9357
10173
|
};
|
|
10174
|
+
|
|
10175
|
+
// src/http/auth/tsg-header.ts
|
|
10176
|
+
var TsgHeaderAuth = class {
|
|
10177
|
+
constructor(inner, tsgId) {
|
|
10178
|
+
this.inner = inner;
|
|
10179
|
+
this.tsgId = tsgId;
|
|
10180
|
+
}
|
|
10181
|
+
async prepare(req) {
|
|
10182
|
+
const prepared = await this.inner.prepare(req);
|
|
10183
|
+
return {
|
|
10184
|
+
...prepared,
|
|
10185
|
+
headers: { ...prepared.headers, [TSG_ID_HEADER]: this.tsgId }
|
|
10186
|
+
};
|
|
10187
|
+
}
|
|
10188
|
+
async onUnauthorized(res) {
|
|
10189
|
+
return await this.inner.onUnauthorized?.(res) ?? false;
|
|
10190
|
+
}
|
|
10191
|
+
};
|
|
10192
|
+
|
|
10193
|
+
// src/ai-gateway/window.ts
|
|
10194
|
+
function toOffsetIso(d) {
|
|
10195
|
+
const pad = (n) => String(Math.floor(Math.abs(n))).padStart(2, "0");
|
|
10196
|
+
const offsetMin = -d.getTimezoneOffset();
|
|
10197
|
+
const sign = offsetMin >= 0 ? "+" : "-";
|
|
10198
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}${sign}${pad(offsetMin / 60)}:${pad(offsetMin % 60)}`;
|
|
10199
|
+
}
|
|
10200
|
+
function serializeWindow(tsgId, opts) {
|
|
10201
|
+
const end = opts.end ?? /* @__PURE__ */ new Date();
|
|
10202
|
+
const start = opts.start ?? new Date(end.getTime() - (opts.days ?? 7) * 864e5);
|
|
10203
|
+
return {
|
|
10204
|
+
organisationId: tsgId,
|
|
10205
|
+
workspaceSlug: opts.workspaceSlug,
|
|
10206
|
+
timeOfGenerationMin: toOffsetIso(start),
|
|
10207
|
+
timeOfGenerationMax: toOffsetIso(end)
|
|
10208
|
+
};
|
|
10209
|
+
}
|
|
10210
|
+
|
|
10211
|
+
// src/ai-gateway/telemetry-client.ts
|
|
10212
|
+
var AIGatewayTelemetryClient = class {
|
|
10213
|
+
baseUrl;
|
|
10214
|
+
auth;
|
|
10215
|
+
numRetries;
|
|
10216
|
+
tsgId;
|
|
10217
|
+
constructor(opts) {
|
|
10218
|
+
this.baseUrl = opts.baseUrl;
|
|
10219
|
+
this.auth = opts.auth;
|
|
10220
|
+
this.numRetries = opts.numRetries;
|
|
10221
|
+
this.tsgId = opts.tsgId;
|
|
10222
|
+
}
|
|
10223
|
+
/** @internal Shared GET for every `logs/charts/*` endpoint. */
|
|
10224
|
+
chart(metric, opts, schema) {
|
|
10225
|
+
return request({
|
|
10226
|
+
method: "GET",
|
|
10227
|
+
baseUrl: this.baseUrl,
|
|
10228
|
+
path: `${AI_GW_CHARTS_PATH}/${metric}`,
|
|
10229
|
+
params: serializeWindow(this.tsgId, opts),
|
|
10230
|
+
responseSchema: schema,
|
|
10231
|
+
auth: this.auth,
|
|
10232
|
+
numRetries: this.numRetries
|
|
10233
|
+
});
|
|
10234
|
+
}
|
|
10235
|
+
/**
|
|
10236
|
+
* Total and per-day spend. **Values are in cents.**
|
|
10237
|
+
* @param opts - Workspace slug and time window.
|
|
10238
|
+
* @returns Cost series plus the period total, in cents.
|
|
10239
|
+
* @example
|
|
10240
|
+
* ```ts
|
|
10241
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10242
|
+
* const gw = new AIGatewayClient();
|
|
10243
|
+
*
|
|
10244
|
+
* const cost = await gw.telemetry.cost({ workspaceSlug: 'ws-main-a-349e0e', days: 7 });
|
|
10245
|
+
* console.log(`$${(cost.data.total / 100).toFixed(2)}`); // => "$4110.83"
|
|
10246
|
+
* ```
|
|
10247
|
+
*/
|
|
10248
|
+
async cost(opts) {
|
|
10249
|
+
return this.chart("cost", opts, CostChartResponseSchema);
|
|
10250
|
+
}
|
|
10251
|
+
/**
|
|
10252
|
+
* Per-day request counts.
|
|
10253
|
+
* @param opts - Workspace slug and time window.
|
|
10254
|
+
* @returns Request-count series plus the period total.
|
|
10255
|
+
* @example
|
|
10256
|
+
* ```ts
|
|
10257
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10258
|
+
* const gw = new AIGatewayClient();
|
|
10259
|
+
*
|
|
10260
|
+
* const r = await gw.telemetry.requests({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10261
|
+
* // r.data.total => 25746
|
|
10262
|
+
* ```
|
|
10263
|
+
*/
|
|
10264
|
+
async requests(opts) {
|
|
10265
|
+
return this.chart("requests", opts, CountChartResponseSchema);
|
|
10266
|
+
}
|
|
10267
|
+
/**
|
|
10268
|
+
* Latency in milliseconds. Percentiles are returned per-bucket and for the period.
|
|
10269
|
+
* @param opts - Workspace slug and time window.
|
|
10270
|
+
* @returns Latency series with p50/p90/p99; `data.total` is the period mean, not a sum.
|
|
10271
|
+
* @example
|
|
10272
|
+
* ```ts
|
|
10273
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10274
|
+
* const gw = new AIGatewayClient();
|
|
10275
|
+
*
|
|
10276
|
+
* const l = await gw.telemetry.latency({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10277
|
+
* // l.data.p99 => 8329.14
|
|
10278
|
+
* ```
|
|
10279
|
+
*/
|
|
10280
|
+
async latency(opts) {
|
|
10281
|
+
return this.chart("latency", opts, LatencyChartResponseSchema);
|
|
10282
|
+
}
|
|
10283
|
+
/**
|
|
10284
|
+
* Token usage, split into request and response units.
|
|
10285
|
+
* @param opts - Workspace slug and time window.
|
|
10286
|
+
* @returns Token series plus request/response unit totals.
|
|
10287
|
+
* @example
|
|
10288
|
+
* ```ts
|
|
10289
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10290
|
+
* const gw = new AIGatewayClient();
|
|
10291
|
+
*
|
|
10292
|
+
* const t = await gw.telemetry.tokens({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10293
|
+
* // t.data.total_request_units => 4919015459
|
|
10294
|
+
* ```
|
|
10295
|
+
*/
|
|
10296
|
+
async tokens(opts) {
|
|
10297
|
+
return this.chart("tokens", opts, TokensChartResponseSchema);
|
|
10298
|
+
}
|
|
10299
|
+
/**
|
|
10300
|
+
* Per-day error counts.
|
|
10301
|
+
* @param opts - Workspace slug and time window.
|
|
10302
|
+
* @returns Error-count series plus the period total.
|
|
10303
|
+
* @example
|
|
10304
|
+
* ```ts
|
|
10305
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10306
|
+
* const gw = new AIGatewayClient();
|
|
10307
|
+
*
|
|
10308
|
+
* const e = await gw.telemetry.errors({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10309
|
+
* // e.data.total => 125
|
|
10310
|
+
* ```
|
|
10311
|
+
*/
|
|
10312
|
+
async errors(opts) {
|
|
10313
|
+
return this.chart("errors", opts, CountChartResponseSchema);
|
|
10314
|
+
}
|
|
10315
|
+
/**
|
|
10316
|
+
* Per-day distinct end-user counts.
|
|
10317
|
+
* @param opts - Workspace slug and time window.
|
|
10318
|
+
* @returns Unique-user series plus the period total.
|
|
10319
|
+
* @example
|
|
10320
|
+
* ```ts
|
|
10321
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10322
|
+
* const gw = new AIGatewayClient();
|
|
10323
|
+
*
|
|
10324
|
+
* const u = await gw.telemetry.users({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10325
|
+
* // u.data.total => 1
|
|
10326
|
+
* ```
|
|
10327
|
+
*/
|
|
10328
|
+
async users(opts) {
|
|
10329
|
+
return this.chart("users", opts, CountChartResponseSchema);
|
|
10330
|
+
}
|
|
10331
|
+
/**
|
|
10332
|
+
* Cache hit count, speedup, and average cached-response latency.
|
|
10333
|
+
* @param opts - Workspace slug and time window.
|
|
10334
|
+
* @returns Cache summary; `avgCacheLatency` is null when there were no hits.
|
|
10335
|
+
* @example
|
|
10336
|
+
* ```ts
|
|
10337
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10338
|
+
* const gw = new AIGatewayClient();
|
|
10339
|
+
*
|
|
10340
|
+
* const c = await gw.telemetry.cacheSummary({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10341
|
+
* // c.data.summary => { cacheHits: 0, avgCacheLatency: null, totalRequests: 25621, cacheSpeedup: 0 }
|
|
10342
|
+
* ```
|
|
10343
|
+
*/
|
|
10344
|
+
async cacheSummary(opts) {
|
|
10345
|
+
return this.chart("cache-summary", opts, CacheSummaryResponseSchema);
|
|
10346
|
+
}
|
|
10347
|
+
/**
|
|
10348
|
+
* Cache hit-rate trend and cumulative savings.
|
|
10349
|
+
* @param opts - Workspace slug and time window.
|
|
10350
|
+
* @returns Per-bucket hits and **cumulative** savings in cents — the last non-zero bucket is the period total.
|
|
10351
|
+
* @example
|
|
10352
|
+
* ```ts
|
|
10353
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10354
|
+
* const gw = new AIGatewayClient();
|
|
10355
|
+
*
|
|
10356
|
+
* const t = await gw.telemetry.cacheHitTrend({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10357
|
+
* const last = t.data.trend.at(-1);
|
|
10358
|
+
* const savedUsd = ((last?.cumulativeSimpleHitSavings ?? 0) + (last?.cumulativeSemanticHitSavings ?? 0)) / 100;
|
|
10359
|
+
* ```
|
|
10360
|
+
*/
|
|
10361
|
+
async cacheHitTrend(opts) {
|
|
10362
|
+
return this.chart("cache-hit-trend", opts, CacheHitTrendResponseSchema);
|
|
10363
|
+
}
|
|
10364
|
+
/**
|
|
10365
|
+
* Requests-per-user trend.
|
|
10366
|
+
* @param opts - Workspace slug and time window.
|
|
10367
|
+
* @returns Daily request counts plus `summary.avg` (requests per user).
|
|
10368
|
+
* @example
|
|
10369
|
+
* ```ts
|
|
10370
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10371
|
+
* const gw = new AIGatewayClient();
|
|
10372
|
+
*
|
|
10373
|
+
* const t = await gw.telemetry.userTrends({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10374
|
+
* // t.data.summary => { total: 25748, unique: 1, avg: 25748 }
|
|
10375
|
+
* ```
|
|
10376
|
+
*/
|
|
10377
|
+
async userTrends(opts) {
|
|
10378
|
+
return this.chart("user-trends", opts, UserTrendsResponseSchema);
|
|
10379
|
+
}
|
|
10380
|
+
/**
|
|
10381
|
+
* Error-rate trend as a percentage.
|
|
10382
|
+
* @param opts - Workspace slug and time window.
|
|
10383
|
+
* @returns Daily error percentages plus `summary.errorPercent` for the period.
|
|
10384
|
+
* @example
|
|
10385
|
+
* ```ts
|
|
10386
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10387
|
+
* const gw = new AIGatewayClient();
|
|
10388
|
+
*
|
|
10389
|
+
* const t = await gw.telemetry.errorTrends({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10390
|
+
* // t.data.summary.errorPercent => 0.485
|
|
10391
|
+
* ```
|
|
10392
|
+
*/
|
|
10393
|
+
async errorTrends(opts) {
|
|
10394
|
+
return this.chart("error-trends", opts, ErrorTrendsResponseSchema);
|
|
10395
|
+
}
|
|
10396
|
+
/**
|
|
10397
|
+
* Gateway auto-retry and fallback resilience. Sparse — only populated on upstream failures.
|
|
10398
|
+
* @param opts - Workspace slug and time window.
|
|
10399
|
+
* @returns Retry/fallback trends; note `trend[].y` is an **array**, not a scalar.
|
|
10400
|
+
* @example
|
|
10401
|
+
* ```ts
|
|
10402
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10403
|
+
* const gw = new AIGatewayClient();
|
|
10404
|
+
*
|
|
10405
|
+
* const r = await gw.telemetry.rescuedRetries({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10406
|
+
* // r.data.retryTotal => 0
|
|
10407
|
+
* ```
|
|
10408
|
+
*/
|
|
10409
|
+
async rescuedRetries(opts) {
|
|
10410
|
+
return this.chart("rescued-retries", opts, RescuedRetriesResponseSchema);
|
|
10411
|
+
}
|
|
10412
|
+
/**
|
|
10413
|
+
* Daily count of feedback submissions.
|
|
10414
|
+
* @param opts - Workspace slug and time window.
|
|
10415
|
+
* @returns Feedback-count series plus the period total.
|
|
10416
|
+
* @example
|
|
10417
|
+
* ```ts
|
|
10418
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10419
|
+
* const gw = new AIGatewayClient();
|
|
10420
|
+
*
|
|
10421
|
+
* const f = await gw.telemetry.feedbackTrend({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10422
|
+
* // f.data.total => 61
|
|
10423
|
+
* ```
|
|
10424
|
+
*/
|
|
10425
|
+
async feedbackTrend(opts) {
|
|
10426
|
+
return this.chart("feedback-trend", opts, CountChartResponseSchema);
|
|
10427
|
+
}
|
|
10428
|
+
/**
|
|
10429
|
+
* Weighted average feedback score, averaged over days.
|
|
10430
|
+
* @param opts - Workspace slug and time window.
|
|
10431
|
+
* @returns Weighted score series; `data.total` is null when there is no feedback.
|
|
10432
|
+
* @example
|
|
10433
|
+
* ```ts
|
|
10434
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10435
|
+
* const gw = new AIGatewayClient();
|
|
10436
|
+
*
|
|
10437
|
+
* const f = await gw.telemetry.feedbackWeighted({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10438
|
+
* // f.data.total => -2.58
|
|
10439
|
+
* ```
|
|
10440
|
+
*/
|
|
10441
|
+
async feedbackWeighted(opts) {
|
|
10442
|
+
return this.chart("feedback-weighted", opts, CountChartResponseSchema);
|
|
10443
|
+
}
|
|
10444
|
+
/**
|
|
10445
|
+
* Distribution of feedback scores. Feedback is binary: +5 (thumbs up) or -5 (thumbs down).
|
|
10446
|
+
* @param opts - Workspace slug and time window.
|
|
10447
|
+
* @returns Score histogram as `{x: score, y: count}` records.
|
|
10448
|
+
* @example
|
|
10449
|
+
* ```ts
|
|
10450
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10451
|
+
* const gw = new AIGatewayClient();
|
|
10452
|
+
*
|
|
10453
|
+
* const d = await gw.telemetry.feedbackScoreDistribution({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10454
|
+
* // d.data.records => [{ x: 5, y: 30 }, { x: -5, y: 33 }]
|
|
10455
|
+
* ```
|
|
10456
|
+
*/
|
|
10457
|
+
async feedbackScoreDistribution(opts) {
|
|
10458
|
+
return this.chart("feedback-score-distribution", opts, FeedbackScoreDistributionResponseSchema);
|
|
10459
|
+
}
|
|
10460
|
+
/**
|
|
10461
|
+
* Feedback broken down by AI model.
|
|
10462
|
+
* @param opts - Workspace slug and time window.
|
|
10463
|
+
* @returns Records where `x` is the model and `y` is an object, not a number.
|
|
10464
|
+
* @example
|
|
10465
|
+
* ```ts
|
|
10466
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10467
|
+
* const gw = new AIGatewayClient();
|
|
10468
|
+
*
|
|
10469
|
+
* const m = await gw.telemetry.feedbackModels({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10470
|
+
* // m.data.records[0] => { x: 'claude-sonnet-5', y: { avgWeightedFeedback: 4.2, feedbackCount: 12 } }
|
|
10471
|
+
* ```
|
|
10472
|
+
*/
|
|
10473
|
+
async feedbackModels(opts) {
|
|
10474
|
+
return this.chart("feedback-models", opts, FeedbackModelsResponseSchema);
|
|
10475
|
+
}
|
|
10476
|
+
/**
|
|
10477
|
+
* Aggregate requests by a dimension.
|
|
10478
|
+
* @param dimension - One of {@link AI_GW_GROUP_DIMENSIONS}. Underscore names only.
|
|
10479
|
+
* @param opts - Window plus optional extra columns.
|
|
10480
|
+
* @returns One row per distinct dimension value.
|
|
10481
|
+
* @example
|
|
10482
|
+
* ```ts
|
|
10483
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10484
|
+
* const gw = new AIGatewayClient();
|
|
10485
|
+
*
|
|
10486
|
+
* const byModel = await gw.telemetry.groupBy('model', {
|
|
10487
|
+
* workspaceSlug: 'ws-main-a-349e0e',
|
|
10488
|
+
* columns: ['cost', 'total_tokens'],
|
|
10489
|
+
* });
|
|
10490
|
+
* // byModel.data[0] => { model: 'claude-sonnet-5', requests: 10506, cost: 29704.16, ... }
|
|
10491
|
+
* ```
|
|
10492
|
+
*/
|
|
10493
|
+
async groupBy(dimension, opts) {
|
|
10494
|
+
const params = serializeWindow(this.tsgId, opts);
|
|
10495
|
+
if (opts.columns?.length) params.columns = opts.columns.join(",");
|
|
10496
|
+
return request({
|
|
10497
|
+
method: "GET",
|
|
10498
|
+
baseUrl: this.baseUrl,
|
|
10499
|
+
path: `${AI_GW_GROUPS_PATH}/${dimension}`,
|
|
10500
|
+
params,
|
|
10501
|
+
responseSchema: GroupListResponseSchema,
|
|
10502
|
+
auth: this.auth,
|
|
10503
|
+
numRetries: this.numRetries
|
|
10504
|
+
});
|
|
10505
|
+
}
|
|
10506
|
+
/**
|
|
10507
|
+
* Requests and cost per end user.
|
|
10508
|
+
* @param opts - Workspace slug and time window.
|
|
10509
|
+
* @returns One record per user; `_user: ''` means calls with no end-user id. Costs in cents.
|
|
10510
|
+
* @example
|
|
10511
|
+
* ```ts
|
|
10512
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10513
|
+
* const gw = new AIGatewayClient();
|
|
10514
|
+
*
|
|
10515
|
+
* const users = await gw.telemetry.byUser({ workspaceSlug: 'ws-main-a-349e0e' });
|
|
10516
|
+
* // users.data.records[0] => { _user: '', count: 25748, cost: 411060.85 }
|
|
10517
|
+
* ```
|
|
10518
|
+
*/
|
|
10519
|
+
async byUser(opts) {
|
|
10520
|
+
return request({
|
|
10521
|
+
method: "GET",
|
|
10522
|
+
baseUrl: this.baseUrl,
|
|
10523
|
+
path: `${AI_GW_GROUPS_PATH}/users`,
|
|
10524
|
+
params: serializeWindow(this.tsgId, opts),
|
|
10525
|
+
responseSchema: UserGroupResponseSchema,
|
|
10526
|
+
auth: this.auth,
|
|
10527
|
+
numRetries: this.numRetries
|
|
10528
|
+
});
|
|
10529
|
+
}
|
|
10530
|
+
/**
|
|
10531
|
+
* Requests grouped by HTTP status code.
|
|
10532
|
+
* @param opts - Window plus optional extra columns.
|
|
10533
|
+
* @returns One row per status. **446 = AIRS security block** (cost 0, never reached the LLM).
|
|
10534
|
+
* @example
|
|
10535
|
+
* ```ts
|
|
10536
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10537
|
+
* const gw = new AIGatewayClient();
|
|
10538
|
+
*
|
|
10539
|
+
* const codes = await gw.telemetry.byStatusCode({
|
|
10540
|
+
* workspaceSlug: 'ws-main-a-349e0e',
|
|
10541
|
+
* columns: ['cost', 'avg_latency'],
|
|
10542
|
+
* });
|
|
10543
|
+
* // codes.data => [{ status_code: 200, requests: 25623, ... }, { status_code: 446, ... }]
|
|
10544
|
+
* ```
|
|
10545
|
+
*/
|
|
10546
|
+
async byStatusCode(opts) {
|
|
10547
|
+
const params = serializeWindow(this.tsgId, opts);
|
|
10548
|
+
if (opts.columns?.length) params.columns = opts.columns.join(",");
|
|
10549
|
+
return request({
|
|
10550
|
+
method: "GET",
|
|
10551
|
+
baseUrl: this.baseUrl,
|
|
10552
|
+
path: `${AI_GW_GROUPS_PATH}/status_code`,
|
|
10553
|
+
params,
|
|
10554
|
+
responseSchema: GroupListResponseSchema,
|
|
10555
|
+
auth: this.auth,
|
|
10556
|
+
numRetries: this.numRetries
|
|
10557
|
+
});
|
|
10558
|
+
}
|
|
10559
|
+
/**
|
|
10560
|
+
* Raw per-request log rows — the deepest granularity this API offers.
|
|
10561
|
+
*
|
|
10562
|
+
* @remarks
|
|
10563
|
+
* Upstream pagination is broken: only `pageSize` works, and an unfiltered call always
|
|
10564
|
+
* returns the same most-recent batch (~50 rows) regardless of offset. To read beyond that,
|
|
10565
|
+
* filter by `statusCode`, which bypasses the cap and returns every match in the window.
|
|
10566
|
+
*
|
|
10567
|
+
* @param opts - Window plus `pageSize` / `traceId` / `statusCode` filters.
|
|
10568
|
+
* @returns Log records plus the full-period `total` (which you cannot page to).
|
|
10569
|
+
* @example
|
|
10570
|
+
* ```ts
|
|
10571
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10572
|
+
* const gw = new AIGatewayClient();
|
|
10573
|
+
*
|
|
10574
|
+
* // Every AIRS security block in the window, not just the most recent page.
|
|
10575
|
+
* const blocked = await gw.telemetry.logs({
|
|
10576
|
+
* workspaceSlug: 'ws-main-a-349e0e',
|
|
10577
|
+
* statusCode: 446,
|
|
10578
|
+
* });
|
|
10579
|
+
* // blocked.data.records[0] => { response_status_code: 446, cost: 0, is_success: 0, ... }
|
|
10580
|
+
* ```
|
|
10581
|
+
*/
|
|
10582
|
+
async logs(opts) {
|
|
10583
|
+
const params = serializeWindow(this.tsgId, opts);
|
|
10584
|
+
if (opts.pageSize !== void 0) params.pageSize = String(opts.pageSize);
|
|
10585
|
+
if (opts.traceId !== void 0) params.traceId = opts.traceId;
|
|
10586
|
+
if (opts.statusCode !== void 0) params.statusCode = String(opts.statusCode);
|
|
10587
|
+
return request({
|
|
10588
|
+
method: "GET",
|
|
10589
|
+
baseUrl: this.baseUrl,
|
|
10590
|
+
path: AI_GW_LOGS_PATH,
|
|
10591
|
+
params,
|
|
10592
|
+
responseSchema: GatewayLogsResponseSchema,
|
|
10593
|
+
auth: this.auth,
|
|
10594
|
+
numRetries: this.numRetries
|
|
10595
|
+
});
|
|
10596
|
+
}
|
|
10597
|
+
};
|
|
10598
|
+
|
|
10599
|
+
// src/ai-gateway/workspaces-client.ts
|
|
10600
|
+
var AIGatewayWorkspacesClient = class {
|
|
10601
|
+
baseUrl;
|
|
10602
|
+
adminBaseUrl;
|
|
10603
|
+
auth;
|
|
10604
|
+
numRetries;
|
|
10605
|
+
constructor(opts) {
|
|
10606
|
+
this.baseUrl = opts.baseUrl;
|
|
10607
|
+
this.adminBaseUrl = opts.adminBaseUrl;
|
|
10608
|
+
this.auth = opts.auth;
|
|
10609
|
+
this.numRetries = opts.numRetries;
|
|
10610
|
+
}
|
|
10611
|
+
urlFor(plane) {
|
|
10612
|
+
return plane === "admin" ? this.adminBaseUrl : this.baseUrl;
|
|
10613
|
+
}
|
|
10614
|
+
/**
|
|
10615
|
+
* List workspaces.
|
|
10616
|
+
*
|
|
10617
|
+
* Two defaults worth knowing, because each one hides rows:
|
|
10618
|
+
*
|
|
10619
|
+
* 1. **Active only.** Without `status`, archived workspaces are omitted. Pass
|
|
10620
|
+
* `{ status: 'archived' }` to see them — that is where {@link AIGatewayWorkspacesClient.delete}
|
|
10621
|
+
* leaves a workspace.
|
|
10622
|
+
* 2. **Your scope only.** The data plane returns just the workspaces your service account holds a
|
|
10623
|
+
* workspace-scope grant on. Pass `{ plane: 'admin' }` to enumerate the whole tenant.
|
|
10624
|
+
*
|
|
10625
|
+
* @param options - Optional status filter and plane selection.
|
|
10626
|
+
* @returns Workspaces, each with the `scope_name` that grants data-plane access to it.
|
|
10627
|
+
* @example
|
|
10628
|
+
* ```ts
|
|
10629
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10630
|
+
* const gw = new AIGatewayClient();
|
|
10631
|
+
*
|
|
10632
|
+
* const mine = await gw.workspaces.list();
|
|
10633
|
+
* // mine.data[0] => { slug: 'ws-main-a-349e0e', scope_name: 'main_airs_workspace_1852583913', ... }
|
|
10634
|
+
*
|
|
10635
|
+
* const everything = await gw.workspaces.list({ plane: 'admin' });
|
|
10636
|
+
* const archived = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
|
|
10637
|
+
* ```
|
|
10638
|
+
*/
|
|
10639
|
+
async list(options = {}) {
|
|
10640
|
+
return request({
|
|
10641
|
+
method: "GET",
|
|
10642
|
+
baseUrl: this.urlFor(options.plane),
|
|
10643
|
+
path: AI_GW_WORKSPACES_PATH,
|
|
10644
|
+
params: options.status ? { status: options.status } : void 0,
|
|
10645
|
+
responseSchema: ListWorkspacesResponseSchema,
|
|
10646
|
+
auth: this.auth,
|
|
10647
|
+
numRetries: this.numRetries
|
|
10648
|
+
});
|
|
10649
|
+
}
|
|
10650
|
+
/**
|
|
10651
|
+
* Fetch one workspace, including its security and rate-limit settings.
|
|
10652
|
+
*
|
|
10653
|
+
* @param workspaceRef - Workspace UUID **or** slug; the API accepts both.
|
|
10654
|
+
* @param options - Plane selection. A workspace outside your workspace scope answers `403 AB03`
|
|
10655
|
+
* on the data plane, not `404`; re-read it with `{ plane: 'admin' }`.
|
|
10656
|
+
*
|
|
10657
|
+
* **Archived workspaces are not retrievable here.** Once
|
|
10658
|
+
* {@link AIGatewayWorkspacesClient.delete} has archived a workspace, this returns `404 AB08`
|
|
10659
|
+
* for both its UUID and its slug, on either plane (verified live 2026-08-01) — even though the
|
|
10660
|
+
* row is still listed by `list({ status: 'archived' })`. Treat a 404 after a delete as expected,
|
|
10661
|
+
* and use the list filter to inspect archived workspaces.
|
|
10662
|
+
* @returns Workspace detail; list rows do not carry the settings blocks.
|
|
10663
|
+
* @example
|
|
10664
|
+
* ```ts
|
|
10665
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10666
|
+
* const gw = new AIGatewayClient();
|
|
10667
|
+
*
|
|
10668
|
+
* const ws = await gw.workspaces.get('16f7e90d-382a-4e78-b577-1b01eb5f8297');
|
|
10669
|
+
* // ws.security_settings?.membersViewLogs => true
|
|
10670
|
+
*
|
|
10671
|
+
* // Slugs work too, and the admin plane reaches workspaces you aren't scoped to:
|
|
10672
|
+
* const other = await gw.workspaces.get('ws-produc-985697', { plane: 'admin' });
|
|
10673
|
+
* ```
|
|
10674
|
+
*/
|
|
10675
|
+
async get(workspaceRef, options = {}) {
|
|
10676
|
+
assertWorkspaceRef(workspaceRef, "workspaceRef");
|
|
10677
|
+
return request({
|
|
10678
|
+
method: "GET",
|
|
10679
|
+
baseUrl: this.urlFor(options.plane),
|
|
10680
|
+
path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
|
|
10681
|
+
responseSchema: GatewayWorkspaceDetailSchema,
|
|
10682
|
+
auth: this.auth,
|
|
10683
|
+
numRetries: this.numRetries
|
|
10684
|
+
});
|
|
10685
|
+
}
|
|
10686
|
+
/**
|
|
10687
|
+
* Create a workspace. **Admin plane** — needs a tenant-root admin role.
|
|
10688
|
+
*
|
|
10689
|
+
* @param body - `name` and `scope_name` are both required; the API rejects a body missing either.
|
|
10690
|
+
* @returns The created workspace. Unlike `configs`/`guardrails`/`providers`/`deployments`,
|
|
10691
|
+
* which return short receipts, this returns most of the record — but not `status`,
|
|
10692
|
+
* `is_default`, `icon`, `usage_limits`, `rate_limits`, or the settings blocks. Call
|
|
10693
|
+
* {@link AIGatewayWorkspacesClient.get} when you need those.
|
|
10694
|
+
* @example
|
|
10695
|
+
* ```ts
|
|
10696
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10697
|
+
* const gw = new AIGatewayClient();
|
|
10698
|
+
*
|
|
10699
|
+
* const created = await gw.workspaces.create({
|
|
10700
|
+
* name: 'Production',
|
|
10701
|
+
* scope_name: 'ws_production_bx7qw0', // the SCM scope, not derived from name
|
|
10702
|
+
* description: 'All production applications',
|
|
10703
|
+
* defaults: { metadata: { env: 'production' } },
|
|
10704
|
+
* rate_limits: [{ type: 'requests', unit: 'rpm', value: 100 }],
|
|
10705
|
+
* });
|
|
10706
|
+
* ```
|
|
10707
|
+
*/
|
|
10708
|
+
async create(body) {
|
|
10709
|
+
if (!body.name) {
|
|
10710
|
+
throw new AISecSDKException("Missing name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
10711
|
+
}
|
|
10712
|
+
if (!body.scope_name) {
|
|
10713
|
+
throw new AISecSDKException("Missing scope_name", "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
10714
|
+
}
|
|
10715
|
+
return request({
|
|
10716
|
+
method: "POST",
|
|
10717
|
+
baseUrl: this.adminBaseUrl,
|
|
10718
|
+
path: AI_GW_WORKSPACES_PATH,
|
|
10719
|
+
body,
|
|
10720
|
+
responseSchema: GatewayWorkspaceCreateResponseSchema,
|
|
10721
|
+
auth: this.auth,
|
|
10722
|
+
numRetries: this.numRetries
|
|
10723
|
+
});
|
|
10724
|
+
}
|
|
10725
|
+
/**
|
|
10726
|
+
* Update a workspace. **Admin plane.** Partial patch — send only the fields that change.
|
|
10727
|
+
*
|
|
10728
|
+
* @param workspaceRef - Workspace UUID or slug.
|
|
10729
|
+
* @param body - At least one field. An empty patch is rejected locally, mirroring the API's own
|
|
10730
|
+
* "No update fields provided" rejection, so a typo'd caller fails without a round trip.
|
|
10731
|
+
* @returns An **empty object** — the API acknowledges the write without echoing the record
|
|
10732
|
+
* (verified live 2026-08-01). The change does persist; re-read with
|
|
10733
|
+
* {@link AIGatewayWorkspacesClient.get} to see it.
|
|
10734
|
+
* @example
|
|
10735
|
+
* ```ts
|
|
10736
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10737
|
+
* const gw = new AIGatewayClient();
|
|
10738
|
+
*
|
|
10739
|
+
* await gw.workspaces.update('ws-produc-985697', {
|
|
10740
|
+
* description: 'Production workloads, us-east',
|
|
10741
|
+
* });
|
|
10742
|
+
* ```
|
|
10743
|
+
*/
|
|
10744
|
+
async update(workspaceRef, body) {
|
|
10745
|
+
assertWorkspaceRef(workspaceRef, "workspaceRef");
|
|
10746
|
+
if (Object.keys(body).length === 0) {
|
|
10747
|
+
throw new AISecSDKException(
|
|
10748
|
+
"Empty update: provide at least one of name, description, icon, defaults, usage_limits, rate_limits",
|
|
10749
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
10750
|
+
);
|
|
10751
|
+
}
|
|
10752
|
+
return request({
|
|
10753
|
+
method: "PUT",
|
|
10754
|
+
baseUrl: this.adminBaseUrl,
|
|
10755
|
+
path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
|
|
10756
|
+
body,
|
|
10757
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
10758
|
+
auth: this.auth,
|
|
10759
|
+
numRetries: this.numRetries
|
|
10760
|
+
});
|
|
10761
|
+
}
|
|
10762
|
+
/**
|
|
10763
|
+
* Delete a workspace. **Admin plane.**
|
|
10764
|
+
*
|
|
10765
|
+
* This is a **soft delete**: the workspace is archived, not destroyed. It vanishes from a default
|
|
10766
|
+
* {@link AIGatewayWorkspacesClient.list} but stays visible via `list({ status: 'archived' })`.
|
|
10767
|
+
* Note that `list` is the *only* way to see it afterwards —
|
|
10768
|
+
* {@link AIGatewayWorkspacesClient.get} answers `404 AB08` for an archived workspace.
|
|
10769
|
+
* Same semantics as `deployments.delete()`, and the opposite of `configs`/`guardrails`/`providers`,
|
|
10770
|
+
* which hard delete. There is no hard delete for workspaces.
|
|
10771
|
+
*
|
|
10772
|
+
* Takes no query parameters — unlike `integrations.delete()` and `deployments.delete()`, which
|
|
10773
|
+
* both require `organisation_id`.
|
|
10774
|
+
*
|
|
10775
|
+
* @param workspaceRef - Workspace UUID or slug.
|
|
10776
|
+
* @example
|
|
10777
|
+
* ```ts
|
|
10778
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10779
|
+
* const gw = new AIGatewayClient();
|
|
10780
|
+
*
|
|
10781
|
+
* await gw.workspaces.delete('ws-produc-985697');
|
|
10782
|
+
*
|
|
10783
|
+
* // Still there, archived:
|
|
10784
|
+
* const gone = await gw.workspaces.list({ plane: 'admin', status: 'archived' });
|
|
10785
|
+
* ```
|
|
10786
|
+
*/
|
|
10787
|
+
async delete(workspaceRef) {
|
|
10788
|
+
assertWorkspaceRef(workspaceRef, "workspaceRef");
|
|
10789
|
+
return request({
|
|
10790
|
+
method: "DELETE",
|
|
10791
|
+
baseUrl: this.adminBaseUrl,
|
|
10792
|
+
path: `${AI_GW_WORKSPACES_PATH}/${workspaceRef}`,
|
|
10793
|
+
auth: this.auth,
|
|
10794
|
+
numRetries: this.numRetries
|
|
10795
|
+
});
|
|
10796
|
+
}
|
|
10797
|
+
};
|
|
10798
|
+
|
|
10799
|
+
// src/ai-gateway/configs-client.ts
|
|
10800
|
+
var AIGatewayConfigsClient = class {
|
|
10801
|
+
baseUrl;
|
|
10802
|
+
auth;
|
|
10803
|
+
numRetries;
|
|
10804
|
+
constructor(opts) {
|
|
10805
|
+
this.baseUrl = opts.baseUrl;
|
|
10806
|
+
this.auth = opts.auth;
|
|
10807
|
+
this.numRetries = opts.numRetries;
|
|
10808
|
+
}
|
|
10809
|
+
/**
|
|
10810
|
+
* List configs in a workspace.
|
|
10811
|
+
*
|
|
10812
|
+
* @remarks
|
|
10813
|
+
* List rows are a strict 12-field subset of the detail read — they do NOT carry `config`,
|
|
10814
|
+
* `format`, `type`, or `version_id`. Call {@link get} for those.
|
|
10815
|
+
*
|
|
10816
|
+
* @param opts - Must include the workspace UUID.
|
|
10817
|
+
* @returns Config list rows.
|
|
10818
|
+
* @example
|
|
10819
|
+
* ```ts
|
|
10820
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10821
|
+
* const gw = new AIGatewayClient();
|
|
10822
|
+
*
|
|
10823
|
+
* const cfgs = await gw.configs.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
10824
|
+
* // cfgs.data[0] => { name: 'claude-code', slug: 'pc-claude-e46fe6', status: 'active', ... }
|
|
10825
|
+
* ```
|
|
10826
|
+
*/
|
|
10827
|
+
async list(opts) {
|
|
10828
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
10829
|
+
return request({
|
|
10830
|
+
method: "GET",
|
|
10831
|
+
baseUrl: this.baseUrl,
|
|
10832
|
+
path: AI_GW_CONFIGS_PATH,
|
|
10833
|
+
params: { workspace_id: opts.workspaceId },
|
|
10834
|
+
responseSchema: ListConfigsResponseSchema,
|
|
10835
|
+
auth: this.auth,
|
|
10836
|
+
numRetries: this.numRetries
|
|
10837
|
+
});
|
|
10838
|
+
}
|
|
10839
|
+
/**
|
|
10840
|
+
* Fetch one config.
|
|
10841
|
+
* @param configId - Config UUID.
|
|
10842
|
+
* @returns The config detail — adds `config` (a JSON-encoded string, not an object),
|
|
10843
|
+
* `format`, `type`, and `version_id` on top of the list row.
|
|
10844
|
+
* @example
|
|
10845
|
+
* ```ts
|
|
10846
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10847
|
+
* const gw = new AIGatewayClient();
|
|
10848
|
+
*
|
|
10849
|
+
* const cfg = await gw.configs.get('764cf9cd-4ebf-449e-b669-08149b0fbbbc');
|
|
10850
|
+
* const routing = JSON.parse(cfg.config) as Record<string, unknown>;
|
|
10851
|
+
* // routing.provider => '@anthropic-prod'
|
|
10852
|
+
* ```
|
|
10853
|
+
*/
|
|
10854
|
+
async get(configId) {
|
|
10855
|
+
assertUuid(configId, "configId");
|
|
10856
|
+
return request({
|
|
10857
|
+
method: "GET",
|
|
10858
|
+
baseUrl: this.baseUrl,
|
|
10859
|
+
path: `${AI_GW_CONFIGS_PATH}/${configId}`,
|
|
10860
|
+
responseSchema: GatewayConfigDetailSchema,
|
|
10861
|
+
auth: this.auth,
|
|
10862
|
+
numRetries: this.numRetries
|
|
10863
|
+
});
|
|
10864
|
+
}
|
|
10865
|
+
/**
|
|
10866
|
+
* Create a config.
|
|
10867
|
+
*
|
|
10868
|
+
* @remarks
|
|
10869
|
+
* The response is a **creation receipt** — `{ id, version_id, slug, object }` — not a
|
|
10870
|
+
* {@link GatewayConfigDetail}. Call {@link get} for the full record. Verified live
|
|
10871
|
+
* 2026-07-28.
|
|
10872
|
+
*
|
|
10873
|
+
* @param body - Name, workspace UUID, and the routing config object.
|
|
10874
|
+
* @returns The creation receipt.
|
|
10875
|
+
* @example
|
|
10876
|
+
* ```ts
|
|
10877
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10878
|
+
* const gw = new AIGatewayClient();
|
|
10879
|
+
*
|
|
10880
|
+
* const receipt = await gw.configs.create({
|
|
10881
|
+
* name: 'vertex-airs',
|
|
10882
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
10883
|
+
* config: { retry: { attempts: 3 }, cache: { mode: 'simple' } },
|
|
10884
|
+
* });
|
|
10885
|
+
* // receipt => { id: '...', version_id: '...', slug: 'pc-sdk-ve-14620d', object: 'config' }
|
|
10886
|
+
* ```
|
|
10887
|
+
*/
|
|
10888
|
+
async create(body) {
|
|
10889
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
10890
|
+
return request({
|
|
10891
|
+
method: "POST",
|
|
10892
|
+
baseUrl: this.baseUrl,
|
|
10893
|
+
path: AI_GW_CONFIGS_PATH,
|
|
10894
|
+
body,
|
|
10895
|
+
responseSchema: GatewayConfigCreateResponseSchema,
|
|
10896
|
+
auth: this.auth,
|
|
10897
|
+
numRetries: this.numRetries
|
|
10898
|
+
});
|
|
10899
|
+
}
|
|
10900
|
+
/**
|
|
10901
|
+
* Update a config.
|
|
10902
|
+
* @param configId - Config UUID.
|
|
10903
|
+
* @param body - Replacement fields.
|
|
10904
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
10905
|
+
* @example
|
|
10906
|
+
* ```ts
|
|
10907
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10908
|
+
* const gw = new AIGatewayClient();
|
|
10909
|
+
*
|
|
10910
|
+
* await gw.configs.update('764cf9cd-4ebf-449e-b669-08149b0fbbbc', {
|
|
10911
|
+
* name: 'claude-code',
|
|
10912
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
10913
|
+
* config: { retry: { attempts: 5 } },
|
|
10914
|
+
* });
|
|
10915
|
+
* ```
|
|
10916
|
+
*/
|
|
10917
|
+
async update(configId, body) {
|
|
10918
|
+
assertUuid(configId, "configId");
|
|
10919
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
10920
|
+
return request({
|
|
10921
|
+
method: "PUT",
|
|
10922
|
+
baseUrl: this.baseUrl,
|
|
10923
|
+
path: `${AI_GW_CONFIGS_PATH}/${configId}`,
|
|
10924
|
+
body,
|
|
10925
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
10926
|
+
auth: this.auth,
|
|
10927
|
+
numRetries: this.numRetries
|
|
10928
|
+
});
|
|
10929
|
+
}
|
|
10930
|
+
/**
|
|
10931
|
+
* Delete a config.
|
|
10932
|
+
*
|
|
10933
|
+
* @remarks
|
|
10934
|
+
* This is a **hard delete** — unlike {@link AIGatewayDeploymentsClient.delete | deployments.delete}
|
|
10935
|
+
* (which archives), the config disappears from {@link list} entirely. Verified live
|
|
10936
|
+
* 2026-07-28. No `organisation_id` query param is required, unlike deployments/integrations.
|
|
10937
|
+
*
|
|
10938
|
+
* @param configId - Config UUID.
|
|
10939
|
+
* @returns Nothing.
|
|
10940
|
+
* @example
|
|
10941
|
+
* ```ts
|
|
10942
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10943
|
+
* const gw = new AIGatewayClient();
|
|
10944
|
+
*
|
|
10945
|
+
* await gw.configs.delete('764cf9cd-4ebf-449e-b669-08149b0fbbbc');
|
|
10946
|
+
* // the config no longer appears in gw.configs.list()
|
|
10947
|
+
* ```
|
|
10948
|
+
*/
|
|
10949
|
+
async delete(configId) {
|
|
10950
|
+
assertUuid(configId, "configId");
|
|
10951
|
+
await request({
|
|
10952
|
+
method: "DELETE",
|
|
10953
|
+
baseUrl: this.baseUrl,
|
|
10954
|
+
path: `${AI_GW_CONFIGS_PATH}/${configId}`,
|
|
10955
|
+
auth: this.auth,
|
|
10956
|
+
numRetries: this.numRetries
|
|
10957
|
+
});
|
|
10958
|
+
}
|
|
10959
|
+
};
|
|
10960
|
+
|
|
10961
|
+
// src/ai-gateway/guardrails-client.ts
|
|
10962
|
+
var AIGatewayGuardrailsClient = class {
|
|
10963
|
+
baseUrl;
|
|
10964
|
+
auth;
|
|
10965
|
+
numRetries;
|
|
10966
|
+
constructor(opts) {
|
|
10967
|
+
this.baseUrl = opts.baseUrl;
|
|
10968
|
+
this.auth = opts.auth;
|
|
10969
|
+
this.numRetries = opts.numRetries;
|
|
10970
|
+
}
|
|
10971
|
+
/**
|
|
10972
|
+
* List guardrails in a workspace.
|
|
10973
|
+
* @param opts - Must include the workspace UUID.
|
|
10974
|
+
* @returns Guardrails defined on that workspace.
|
|
10975
|
+
* @example
|
|
10976
|
+
* ```ts
|
|
10977
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
10978
|
+
* const gw = new AIGatewayClient();
|
|
10979
|
+
*
|
|
10980
|
+
* const g = await gw.guardrails.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
10981
|
+
* // g.data[0].id => 'pg-prisma-099a16'
|
|
10982
|
+
* ```
|
|
10983
|
+
*/
|
|
10984
|
+
async list(opts) {
|
|
10985
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
10986
|
+
return request({
|
|
10987
|
+
method: "GET",
|
|
10988
|
+
baseUrl: this.baseUrl,
|
|
10989
|
+
path: AI_GW_GUARDRAILS_PATH,
|
|
10990
|
+
params: { workspace_id: opts.workspaceId },
|
|
10991
|
+
responseSchema: ListGuardrailsResponseSchema,
|
|
10992
|
+
auth: this.auth,
|
|
10993
|
+
numRetries: this.numRetries
|
|
10994
|
+
});
|
|
10995
|
+
}
|
|
10996
|
+
/**
|
|
10997
|
+
* Fetch one guardrail.
|
|
10998
|
+
* @param guardrailId - Guardrail UUID.
|
|
10999
|
+
* @returns Guardrail detail — adds `checks`, `actions`, and `version_id` on top of the list
|
|
11000
|
+
* row.
|
|
11001
|
+
* @example
|
|
11002
|
+
* ```ts
|
|
11003
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11004
|
+
* const gw = new AIGatewayClient();
|
|
11005
|
+
*
|
|
11006
|
+
* const g = await gw.guardrails.get('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b');
|
|
11007
|
+
* // g.checks[0].id => 'panw-prisma-airs.intercept'
|
|
11008
|
+
* ```
|
|
11009
|
+
*/
|
|
11010
|
+
async get(guardrailId) {
|
|
11011
|
+
assertUuid(guardrailId, "guardrailId");
|
|
11012
|
+
return request({
|
|
11013
|
+
method: "GET",
|
|
11014
|
+
baseUrl: this.baseUrl,
|
|
11015
|
+
path: `${AI_GW_GUARDRAILS_PATH}/${guardrailId}`,
|
|
11016
|
+
responseSchema: GatewayGuardrailDetailSchema,
|
|
11017
|
+
auth: this.auth,
|
|
11018
|
+
numRetries: this.numRetries
|
|
11019
|
+
});
|
|
11020
|
+
}
|
|
11021
|
+
/**
|
|
11022
|
+
* Create a guardrail.
|
|
11023
|
+
*
|
|
11024
|
+
* @remarks
|
|
11025
|
+
* The response is a **creation receipt** — `{ id, version_id, slug, object }` — not a
|
|
11026
|
+
* {@link GatewayGuardrailDetail}. Call {@link get} for the full record. Verified live
|
|
11027
|
+
* 2026-07-28.
|
|
11028
|
+
*
|
|
11029
|
+
* @param body - Workspace UUID, name, checks, and pass/fail actions.
|
|
11030
|
+
* @returns The creation receipt.
|
|
11031
|
+
* @example
|
|
11032
|
+
* ```ts
|
|
11033
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11034
|
+
* const gw = new AIGatewayClient();
|
|
11035
|
+
*
|
|
11036
|
+
* const receipt = await gw.guardrails.create({
|
|
11037
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11038
|
+
* name: 'PrismaAIRS',
|
|
11039
|
+
* checks: [{ id: 'panw-prisma-airs.intercept', parameters: { profile_name: 'AI Gateway - Strict' }, is_enabled: true }],
|
|
11040
|
+
* actions: { deny: false, async: false, sequential: false },
|
|
11041
|
+
* });
|
|
11042
|
+
* // receipt => { id: '...', version_id: '...', slug: 'pg-sdk-ve-874b62', object: 'guardrail' }
|
|
11043
|
+
* ```
|
|
11044
|
+
*/
|
|
11045
|
+
async create(body) {
|
|
11046
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11047
|
+
return request({
|
|
11048
|
+
method: "POST",
|
|
11049
|
+
baseUrl: this.baseUrl,
|
|
11050
|
+
path: AI_GW_GUARDRAILS_PATH,
|
|
11051
|
+
body,
|
|
11052
|
+
responseSchema: GatewayGuardrailCreateResponseSchema,
|
|
11053
|
+
auth: this.auth,
|
|
11054
|
+
numRetries: this.numRetries
|
|
11055
|
+
});
|
|
11056
|
+
}
|
|
11057
|
+
/**
|
|
11058
|
+
* Delete a guardrail.
|
|
11059
|
+
*
|
|
11060
|
+
* @remarks
|
|
11061
|
+
* This is a **hard delete** — unlike {@link AIGatewayDeploymentsClient.delete | deployments.delete}
|
|
11062
|
+
* (which archives), the guardrail disappears from {@link list} entirely. Verified live
|
|
11063
|
+
* 2026-07-28. No `organisation_id` query param is required, unlike deployments/integrations.
|
|
11064
|
+
*
|
|
11065
|
+
* @param guardrailId - Guardrail UUID.
|
|
11066
|
+
* @returns Nothing.
|
|
11067
|
+
* @example
|
|
11068
|
+
* ```ts
|
|
11069
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11070
|
+
* const gw = new AIGatewayClient();
|
|
11071
|
+
*
|
|
11072
|
+
* await gw.guardrails.delete('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b');
|
|
11073
|
+
* // the guardrail no longer appears in gw.guardrails.list()
|
|
11074
|
+
* ```
|
|
11075
|
+
*/
|
|
11076
|
+
async delete(guardrailId) {
|
|
11077
|
+
assertUuid(guardrailId, "guardrailId");
|
|
11078
|
+
await request({
|
|
11079
|
+
method: "DELETE",
|
|
11080
|
+
baseUrl: this.baseUrl,
|
|
11081
|
+
path: `${AI_GW_GUARDRAILS_PATH}/${guardrailId}`,
|
|
11082
|
+
auth: this.auth,
|
|
11083
|
+
numRetries: this.numRetries
|
|
11084
|
+
});
|
|
11085
|
+
}
|
|
11086
|
+
};
|
|
11087
|
+
|
|
11088
|
+
// src/ai-gateway/providers-client.ts
|
|
11089
|
+
var AIGatewayProvidersClient = class {
|
|
11090
|
+
baseUrl;
|
|
11091
|
+
auth;
|
|
11092
|
+
numRetries;
|
|
11093
|
+
constructor(opts) {
|
|
11094
|
+
this.baseUrl = opts.baseUrl;
|
|
11095
|
+
this.auth = opts.auth;
|
|
11096
|
+
this.numRetries = opts.numRetries;
|
|
11097
|
+
}
|
|
11098
|
+
/**
|
|
11099
|
+
* List providers in a workspace.
|
|
11100
|
+
* @param opts - Must include the workspace UUID.
|
|
11101
|
+
* @returns Providers bound into that workspace.
|
|
11102
|
+
* @example
|
|
11103
|
+
* ```ts
|
|
11104
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11105
|
+
* const gw = new AIGatewayClient();
|
|
11106
|
+
*
|
|
11107
|
+
* const p = await gw.providers.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11108
|
+
* // p.data[0].slug => 'openai-calvin'
|
|
11109
|
+
* ```
|
|
11110
|
+
*/
|
|
11111
|
+
async list(opts) {
|
|
11112
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
11113
|
+
return request({
|
|
11114
|
+
method: "GET",
|
|
11115
|
+
baseUrl: this.baseUrl,
|
|
11116
|
+
path: AI_GW_PROVIDERS_PATH,
|
|
11117
|
+
params: { workspace_id: opts.workspaceId },
|
|
11118
|
+
responseSchema: ListProvidersResponseSchema,
|
|
11119
|
+
auth: this.auth,
|
|
11120
|
+
numRetries: this.numRetries
|
|
11121
|
+
});
|
|
11122
|
+
}
|
|
11123
|
+
/**
|
|
11124
|
+
* Create a provider.
|
|
11125
|
+
*
|
|
11126
|
+
* @remarks
|
|
11127
|
+
* The response is a **creation receipt** — `{ id, slug, object }` — not a {@link
|
|
11128
|
+
* GatewayProvider}. Note it has **no `version_id`**, unlike the sibling receipts for
|
|
11129
|
+
* {@link AIGatewayConfigsClient.create | configs.create} and {@link
|
|
11130
|
+
* AIGatewayGuardrailsClient.create | guardrails.create}. Verified live 2026-07-28.
|
|
11131
|
+
*
|
|
11132
|
+
* @param body - Workspace UUID, upstream provider id, integration id, name, and slug.
|
|
11133
|
+
* @returns The creation receipt.
|
|
11134
|
+
* @example
|
|
11135
|
+
* ```ts
|
|
11136
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11137
|
+
* const gw = new AIGatewayClient();
|
|
11138
|
+
*
|
|
11139
|
+
* const receipt = await gw.providers.create({
|
|
11140
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11141
|
+
* ai_provider_id: 'de7d7d50-31cd-11ee-b93b-0e06f1aa7f7c',
|
|
11142
|
+
* integration_id: 'f6692544-3265-49be-9711-bbdcebc079e4',
|
|
11143
|
+
* name: 'openai-calvin',
|
|
11144
|
+
* slug: 'openai-calvin',
|
|
11145
|
+
* });
|
|
11146
|
+
* // receipt => { id: '...', slug: 'sdk-verify-delete-me-provider', object: 'provider' }
|
|
11147
|
+
* ```
|
|
11148
|
+
*/
|
|
11149
|
+
async create(body) {
|
|
11150
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11151
|
+
assertUuid(body.ai_provider_id, "ai_provider_id");
|
|
11152
|
+
assertUuid(body.integration_id, "integration_id");
|
|
11153
|
+
return request({
|
|
11154
|
+
method: "POST",
|
|
11155
|
+
baseUrl: this.baseUrl,
|
|
11156
|
+
path: AI_GW_PROVIDERS_PATH,
|
|
11157
|
+
body,
|
|
11158
|
+
responseSchema: GatewayProviderCreateResponseSchema,
|
|
11159
|
+
auth: this.auth,
|
|
11160
|
+
numRetries: this.numRetries
|
|
11161
|
+
});
|
|
11162
|
+
}
|
|
11163
|
+
/**
|
|
11164
|
+
* Delete a provider.
|
|
11165
|
+
*
|
|
11166
|
+
* @remarks
|
|
11167
|
+
* This is a **hard delete** — unlike {@link AIGatewayDeploymentsClient.delete | deployments.delete}
|
|
11168
|
+
* (which archives), the provider disappears from {@link list} entirely. Verified live
|
|
11169
|
+
* 2026-07-28. No `organisation_id` query param is required, unlike deployments/integrations.
|
|
11170
|
+
*
|
|
11171
|
+
* @param providerId - Provider UUID.
|
|
11172
|
+
* @returns Nothing.
|
|
11173
|
+
* @example
|
|
11174
|
+
* ```ts
|
|
11175
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11176
|
+
* const gw = new AIGatewayClient();
|
|
11177
|
+
*
|
|
11178
|
+
* await gw.providers.delete('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
11179
|
+
* // the provider no longer appears in gw.providers.list()
|
|
11180
|
+
* ```
|
|
11181
|
+
*/
|
|
11182
|
+
async delete(providerId) {
|
|
11183
|
+
assertUuid(providerId, "providerId");
|
|
11184
|
+
await request({
|
|
11185
|
+
method: "DELETE",
|
|
11186
|
+
baseUrl: this.baseUrl,
|
|
11187
|
+
path: `${AI_GW_PROVIDERS_PATH}/${providerId}`,
|
|
11188
|
+
auth: this.auth,
|
|
11189
|
+
numRetries: this.numRetries
|
|
11190
|
+
});
|
|
11191
|
+
}
|
|
11192
|
+
};
|
|
11193
|
+
|
|
11194
|
+
// src/ai-gateway/api-keys-client.ts
|
|
11195
|
+
var AIGatewayApiKeysClient = class {
|
|
11196
|
+
baseUrl;
|
|
11197
|
+
auth;
|
|
11198
|
+
numRetries;
|
|
11199
|
+
constructor(opts) {
|
|
11200
|
+
this.baseUrl = opts.baseUrl;
|
|
11201
|
+
this.auth = opts.auth;
|
|
11202
|
+
this.numRetries = opts.numRetries;
|
|
11203
|
+
}
|
|
11204
|
+
/** @internal */
|
|
11205
|
+
listAt(path, opts) {
|
|
11206
|
+
assertUuid(opts.workspaceId, "workspaceId");
|
|
11207
|
+
return request({
|
|
11208
|
+
method: "GET",
|
|
11209
|
+
baseUrl: this.baseUrl,
|
|
11210
|
+
path,
|
|
11211
|
+
params: { workspace_id: opts.workspaceId },
|
|
11212
|
+
responseSchema: ListApiKeysResponseSchema,
|
|
11213
|
+
auth: this.auth,
|
|
11214
|
+
numRetries: this.numRetries
|
|
11215
|
+
});
|
|
11216
|
+
}
|
|
11217
|
+
/** @internal */
|
|
11218
|
+
writeAt(method, path, body) {
|
|
11219
|
+
assertUuid(body.workspace_id, "workspace_id");
|
|
11220
|
+
return request({
|
|
11221
|
+
method,
|
|
11222
|
+
baseUrl: this.baseUrl,
|
|
11223
|
+
path,
|
|
11224
|
+
body,
|
|
11225
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11226
|
+
auth: this.auth,
|
|
11227
|
+
numRetries: this.numRetries
|
|
11228
|
+
});
|
|
11229
|
+
}
|
|
11230
|
+
/**
|
|
11231
|
+
* List service API keys in a workspace.
|
|
11232
|
+
* @param opts - Must include the workspace UUID.
|
|
11233
|
+
* @returns Service keys; the secret itself is only ever returned at creation.
|
|
11234
|
+
* @example
|
|
11235
|
+
* ```ts
|
|
11236
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11237
|
+
* const gw = new AIGatewayClient();
|
|
11238
|
+
*
|
|
11239
|
+
* const keys = await gw.apiKeys.listService({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11240
|
+
* // keys.total => 1
|
|
11241
|
+
* ```
|
|
11242
|
+
*/
|
|
11243
|
+
async listService(opts) {
|
|
11244
|
+
return this.listAt(AI_GW_API_KEYS_SERVICE_PATH, opts);
|
|
11245
|
+
}
|
|
11246
|
+
/**
|
|
11247
|
+
* List user API keys in a workspace.
|
|
11248
|
+
* @param opts - Must include the workspace UUID.
|
|
11249
|
+
* @returns User-scoped keys.
|
|
11250
|
+
* @example
|
|
11251
|
+
* ```ts
|
|
11252
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11253
|
+
* const gw = new AIGatewayClient();
|
|
11254
|
+
*
|
|
11255
|
+
* const keys = await gw.apiKeys.listUser({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
|
|
11256
|
+
* // keys.total => 0
|
|
11257
|
+
* ```
|
|
11258
|
+
*/
|
|
11259
|
+
async listUser(opts) {
|
|
11260
|
+
return this.listAt(AI_GW_API_KEYS_USER_PATH, opts);
|
|
11261
|
+
}
|
|
11262
|
+
/**
|
|
11263
|
+
* Create a service API key.
|
|
11264
|
+
* @param body - Name, scopes, TSG, workspace UUID, and type.
|
|
11265
|
+
* @returns The raw create response — the only place the key secret appears. Capture it.
|
|
11266
|
+
* @example
|
|
11267
|
+
* ```ts
|
|
11268
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11269
|
+
* const gw = new AIGatewayClient();
|
|
11270
|
+
*
|
|
11271
|
+
* await gw.apiKeys.createService({
|
|
11272
|
+
* name: 'ci-runner',
|
|
11273
|
+
* scopes: ['completions.write', 'logs.write'],
|
|
11274
|
+
* organisation_id: '1852583913',
|
|
11275
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11276
|
+
* type: 'workspace',
|
|
11277
|
+
* });
|
|
11278
|
+
* ```
|
|
11279
|
+
*/
|
|
11280
|
+
async createService(body) {
|
|
11281
|
+
return this.writeAt("POST", AI_GW_API_KEYS_SERVICE_PATH, body);
|
|
11282
|
+
}
|
|
11283
|
+
/**
|
|
11284
|
+
* Create a user API key.
|
|
11285
|
+
* @param body - As {@link createService}, plus `user_id`.
|
|
11286
|
+
* @returns The raw create response — the only place the key secret appears. Capture it.
|
|
11287
|
+
* @example
|
|
11288
|
+
* ```ts
|
|
11289
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11290
|
+
* const gw = new AIGatewayClient();
|
|
11291
|
+
*
|
|
11292
|
+
* await gw.apiKeys.createUser({
|
|
11293
|
+
* name: 'calvin-laptop',
|
|
11294
|
+
* scopes: ['completions.write'],
|
|
11295
|
+
* organisation_id: '1852583913',
|
|
11296
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11297
|
+
* type: 'workspace',
|
|
11298
|
+
* user_id: 'fad91538-65a9-41f7-8b9c-6e4c0e8b9c5f',
|
|
11299
|
+
* });
|
|
11300
|
+
* ```
|
|
11301
|
+
*/
|
|
11302
|
+
async createUser(body) {
|
|
11303
|
+
return this.writeAt("POST", AI_GW_API_KEYS_USER_PATH, body);
|
|
11304
|
+
}
|
|
11305
|
+
/**
|
|
11306
|
+
* Update a service API key.
|
|
11307
|
+
* @param keyId - Key UUID.
|
|
11308
|
+
* @param body - Replacement fields.
|
|
11309
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11310
|
+
* @example
|
|
11311
|
+
* ```ts
|
|
11312
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11313
|
+
* const gw = new AIGatewayClient();
|
|
11314
|
+
*
|
|
11315
|
+
* await gw.apiKeys.updateService('11111111-1111-4111-8111-111111111111', {
|
|
11316
|
+
* name: 'ci-runner',
|
|
11317
|
+
* scopes: ['completions.write'],
|
|
11318
|
+
* organisation_id: '1852583913',
|
|
11319
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11320
|
+
* type: 'workspace',
|
|
11321
|
+
* });
|
|
11322
|
+
* ```
|
|
11323
|
+
*/
|
|
11324
|
+
async updateService(keyId, body) {
|
|
11325
|
+
assertUuid(keyId, "keyId");
|
|
11326
|
+
return this.writeAt("PUT", `${AI_GW_API_KEYS_SERVICE_PATH}/${keyId}`, body);
|
|
11327
|
+
}
|
|
11328
|
+
/**
|
|
11329
|
+
* Update a user API key.
|
|
11330
|
+
* @param keyId - Key UUID.
|
|
11331
|
+
* @param body - Replacement fields.
|
|
11332
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11333
|
+
* @example
|
|
11334
|
+
* ```ts
|
|
11335
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11336
|
+
* const gw = new AIGatewayClient();
|
|
11337
|
+
*
|
|
11338
|
+
* await gw.apiKeys.updateUser('11111111-1111-4111-8111-111111111111', {
|
|
11339
|
+
* name: 'calvin-laptop',
|
|
11340
|
+
* scopes: ['completions.write'],
|
|
11341
|
+
* organisation_id: '1852583913',
|
|
11342
|
+
* workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
|
|
11343
|
+
* type: 'workspace',
|
|
11344
|
+
* user_id: 'fad91538-65a9-41f7-8b9c-6e4c0e8b9c5f',
|
|
11345
|
+
* });
|
|
11346
|
+
* ```
|
|
11347
|
+
*/
|
|
11348
|
+
async updateUser(keyId, body) {
|
|
11349
|
+
assertUuid(keyId, "keyId");
|
|
11350
|
+
return this.writeAt("PUT", `${AI_GW_API_KEYS_USER_PATH}/${keyId}`, body);
|
|
11351
|
+
}
|
|
11352
|
+
};
|
|
11353
|
+
|
|
11354
|
+
// src/ai-gateway/integrations-client.ts
|
|
11355
|
+
var AIGatewayIntegrationsClient = class {
|
|
11356
|
+
baseUrl;
|
|
11357
|
+
auth;
|
|
11358
|
+
numRetries;
|
|
11359
|
+
constructor(opts) {
|
|
11360
|
+
this.baseUrl = opts.baseUrl;
|
|
11361
|
+
this.auth = opts.auth;
|
|
11362
|
+
this.numRetries = opts.numRetries;
|
|
11363
|
+
}
|
|
11364
|
+
/**
|
|
11365
|
+
* List organisation integrations.
|
|
11366
|
+
* @returns All provider integrations defined on the organisation.
|
|
11367
|
+
* @example
|
|
11368
|
+
* ```ts
|
|
11369
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11370
|
+
* const gw = new AIGatewayClient();
|
|
11371
|
+
*
|
|
11372
|
+
* const ints = await gw.integrations.list();
|
|
11373
|
+
* // ints.data[0] => { name: 'openai-calvin', slug: 'openai-calvin', ... }
|
|
11374
|
+
* ```
|
|
11375
|
+
*/
|
|
11376
|
+
async list() {
|
|
11377
|
+
return request({
|
|
11378
|
+
method: "GET",
|
|
11379
|
+
baseUrl: this.baseUrl,
|
|
11380
|
+
path: AI_GW_INTEGRATIONS_PATH,
|
|
11381
|
+
responseSchema: ListIntegrationsResponseSchema,
|
|
11382
|
+
auth: this.auth,
|
|
11383
|
+
numRetries: this.numRetries
|
|
11384
|
+
});
|
|
11385
|
+
}
|
|
11386
|
+
/**
|
|
11387
|
+
* Fetch one integration.
|
|
11388
|
+
* @param integrationId - Integration UUID.
|
|
11389
|
+
* @returns The integration record.
|
|
11390
|
+
* @example
|
|
11391
|
+
* ```ts
|
|
11392
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11393
|
+
* const gw = new AIGatewayClient();
|
|
11394
|
+
*
|
|
11395
|
+
* const i = await gw.integrations.get('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
11396
|
+
* // i.name => 'openai-calvin'
|
|
11397
|
+
* ```
|
|
11398
|
+
*/
|
|
11399
|
+
async get(integrationId) {
|
|
11400
|
+
assertUuid(integrationId, "integrationId");
|
|
11401
|
+
return request({
|
|
11402
|
+
method: "GET",
|
|
11403
|
+
baseUrl: this.baseUrl,
|
|
11404
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
|
|
11405
|
+
responseSchema: GatewayIntegrationSchema,
|
|
11406
|
+
auth: this.auth,
|
|
11407
|
+
numRetries: this.numRetries
|
|
11408
|
+
});
|
|
11409
|
+
}
|
|
11410
|
+
/**
|
|
11411
|
+
* Create an integration.
|
|
11412
|
+
*
|
|
11413
|
+
* @remarks
|
|
11414
|
+
* `body.key` (the provider API key) is a live secret. Setting `PANW_AI_SEC_DEBUG` will
|
|
11415
|
+
* print it, unredacted, to the SDK's own debug log.
|
|
11416
|
+
*
|
|
11417
|
+
* @param body - Provider id, name, slug, and provider-specific configuration.
|
|
11418
|
+
* @returns The raw create response. Shape unverified against a live tenant — see the PRD.
|
|
11419
|
+
* @example
|
|
11420
|
+
* ```ts
|
|
11421
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11422
|
+
* const gw = new AIGatewayClient();
|
|
11423
|
+
*
|
|
11424
|
+
* await gw.integrations.create({
|
|
11425
|
+
* organisation_id: '1852583913',
|
|
11426
|
+
* ai_provider_id: 'de7d7d50-31cd-11ee-b93b-0e06f1aa7f7c',
|
|
11427
|
+
* name: 'openai-prod',
|
|
11428
|
+
* slug: 'openai-prod',
|
|
11429
|
+
* key: process.env.OPENAI_API_KEY,
|
|
11430
|
+
* });
|
|
11431
|
+
* ```
|
|
11432
|
+
*/
|
|
11433
|
+
async create(body) {
|
|
11434
|
+
assertUuid(body.ai_provider_id, "ai_provider_id");
|
|
11435
|
+
return request({
|
|
11436
|
+
method: "POST",
|
|
11437
|
+
baseUrl: this.baseUrl,
|
|
11438
|
+
path: AI_GW_INTEGRATIONS_PATH,
|
|
11439
|
+
body,
|
|
11440
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11441
|
+
auth: this.auth,
|
|
11442
|
+
numRetries: this.numRetries
|
|
11443
|
+
});
|
|
11444
|
+
}
|
|
11445
|
+
/**
|
|
11446
|
+
* Update an integration.
|
|
11447
|
+
* @param integrationId - Integration UUID.
|
|
11448
|
+
* @param body - Replacement fields.
|
|
11449
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11450
|
+
* @example
|
|
11451
|
+
* ```ts
|
|
11452
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11453
|
+
* const gw = new AIGatewayClient();
|
|
11454
|
+
*
|
|
11455
|
+
* await gw.integrations.update('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
11456
|
+
* name: 'openai-prod',
|
|
11457
|
+
* description: 'Production OpenAI',
|
|
11458
|
+
* });
|
|
11459
|
+
* ```
|
|
11460
|
+
*/
|
|
11461
|
+
async update(integrationId, body) {
|
|
11462
|
+
assertUuid(integrationId, "integrationId");
|
|
11463
|
+
if (body.ai_provider_id !== void 0) assertUuid(body.ai_provider_id, "ai_provider_id");
|
|
11464
|
+
return request({
|
|
11465
|
+
method: "PUT",
|
|
11466
|
+
baseUrl: this.baseUrl,
|
|
11467
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
|
|
11468
|
+
body,
|
|
11469
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11470
|
+
auth: this.auth,
|
|
11471
|
+
numRetries: this.numRetries
|
|
11472
|
+
});
|
|
11473
|
+
}
|
|
11474
|
+
/**
|
|
11475
|
+
* Delete an integration.
|
|
11476
|
+
* @param integrationId - Integration UUID.
|
|
11477
|
+
* @param organisationId - The TSG as a numeric string; sent as a query param.
|
|
11478
|
+
* @returns Nothing — the API replies 200 with an empty body.
|
|
11479
|
+
* @example
|
|
11480
|
+
* ```ts
|
|
11481
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11482
|
+
* const gw = new AIGatewayClient();
|
|
11483
|
+
*
|
|
11484
|
+
* await gw.integrations.delete('f6692544-3265-49be-9711-bbdcebc079e4', '1852583913');
|
|
11485
|
+
* ```
|
|
11486
|
+
*/
|
|
11487
|
+
async delete(integrationId, organisationId) {
|
|
11488
|
+
assertUuid(integrationId, "integrationId");
|
|
11489
|
+
assertNumericId(organisationId, "organisationId");
|
|
11490
|
+
await request({
|
|
11491
|
+
method: "DELETE",
|
|
11492
|
+
baseUrl: this.baseUrl,
|
|
11493
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}`,
|
|
11494
|
+
params: { organisation_id: organisationId },
|
|
11495
|
+
auth: this.auth,
|
|
11496
|
+
numRetries: this.numRetries
|
|
11497
|
+
});
|
|
11498
|
+
}
|
|
11499
|
+
/**
|
|
11500
|
+
* Read which models this integration exposes.
|
|
11501
|
+
* @param integrationId - Integration UUID.
|
|
11502
|
+
* @returns Per-model enablement plus the `allow_all_models` flag.
|
|
11503
|
+
* @example
|
|
11504
|
+
* ```ts
|
|
11505
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11506
|
+
* const gw = new AIGatewayClient();
|
|
11507
|
+
*
|
|
11508
|
+
* const m = await gw.integrations.getModels('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
11509
|
+
* // m.models[0] => { slug: 'gpt-4', enabled: true }
|
|
11510
|
+
* ```
|
|
11511
|
+
*/
|
|
11512
|
+
async getModels(integrationId) {
|
|
11513
|
+
assertUuid(integrationId, "integrationId");
|
|
11514
|
+
return request({
|
|
11515
|
+
method: "GET",
|
|
11516
|
+
baseUrl: this.baseUrl,
|
|
11517
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/models`,
|
|
11518
|
+
responseSchema: GatewayIntegrationModelsResponseSchema,
|
|
11519
|
+
auth: this.auth,
|
|
11520
|
+
numRetries: this.numRetries
|
|
11521
|
+
});
|
|
11522
|
+
}
|
|
11523
|
+
/**
|
|
11524
|
+
* Replace which models this integration exposes.
|
|
11525
|
+
* @param integrationId - Integration UUID.
|
|
11526
|
+
* @param body - Full model list; this is a replace, not a merge.
|
|
11527
|
+
* @returns The raw response. Shape unverified against a live tenant — see the PRD.
|
|
11528
|
+
* @example
|
|
11529
|
+
* ```ts
|
|
11530
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11531
|
+
* const gw = new AIGatewayClient();
|
|
11532
|
+
*
|
|
11533
|
+
* await gw.integrations.setModels('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
11534
|
+
* models: [{ slug: 'gpt-4', enabled: true }, { slug: 'gpt-4-32k', enabled: false }],
|
|
11535
|
+
* });
|
|
11536
|
+
* ```
|
|
11537
|
+
*/
|
|
11538
|
+
async setModels(integrationId, body) {
|
|
11539
|
+
assertUuid(integrationId, "integrationId");
|
|
11540
|
+
return request({
|
|
11541
|
+
method: "PUT",
|
|
11542
|
+
baseUrl: this.baseUrl,
|
|
11543
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/models`,
|
|
11544
|
+
body,
|
|
11545
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11546
|
+
auth: this.auth,
|
|
11547
|
+
numRetries: this.numRetries
|
|
11548
|
+
});
|
|
11549
|
+
}
|
|
11550
|
+
/**
|
|
11551
|
+
* Read which workspaces may use this integration.
|
|
11552
|
+
*
|
|
11553
|
+
* @remarks
|
|
11554
|
+
* `global_workspace_access` is an **object** on this read, not a boolean, despite the
|
|
11555
|
+
* field name — `{ enabled, rate_limits, usage_limits }`. The corresponding write
|
|
11556
|
+
* ({@link setWorkspaces}) DOES send a plain boolean; the two are not symmetric.
|
|
11557
|
+
*
|
|
11558
|
+
* @param integrationId - Integration UUID.
|
|
11559
|
+
* @returns Bound workspaces plus the `global_workspace_access` object.
|
|
11560
|
+
* @example
|
|
11561
|
+
* ```ts
|
|
11562
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11563
|
+
* const gw = new AIGatewayClient();
|
|
11564
|
+
*
|
|
11565
|
+
* const w = await gw.integrations.getWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4');
|
|
11566
|
+
* // w.global_workspace_access => { enabled: false, rate_limits: null, usage_limits: null }
|
|
11567
|
+
* ```
|
|
11568
|
+
*/
|
|
11569
|
+
async getWorkspaces(integrationId) {
|
|
11570
|
+
assertUuid(integrationId, "integrationId");
|
|
11571
|
+
return request({
|
|
11572
|
+
method: "GET",
|
|
11573
|
+
baseUrl: this.baseUrl,
|
|
11574
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/workspaces`,
|
|
11575
|
+
responseSchema: GatewayIntegrationWorkspacesResponseSchema,
|
|
11576
|
+
auth: this.auth,
|
|
11577
|
+
numRetries: this.numRetries
|
|
11578
|
+
});
|
|
11579
|
+
}
|
|
11580
|
+
/**
|
|
11581
|
+
* Replace which workspaces may use this integration.
|
|
11582
|
+
* @param integrationId - Integration UUID.
|
|
11583
|
+
* @param body - Workspace bindings or a global-access flag.
|
|
11584
|
+
* @returns The raw response. Shape unverified against a live tenant — see the PRD.
|
|
11585
|
+
* @example
|
|
11586
|
+
* ```ts
|
|
11587
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11588
|
+
* const gw = new AIGatewayClient();
|
|
11589
|
+
*
|
|
11590
|
+
* await gw.integrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
11591
|
+
* global_workspace_access: true,
|
|
11592
|
+
* });
|
|
11593
|
+
* ```
|
|
11594
|
+
*/
|
|
11595
|
+
async setWorkspaces(integrationId, body) {
|
|
11596
|
+
assertUuid(integrationId, "integrationId");
|
|
11597
|
+
return request({
|
|
11598
|
+
method: "PUT",
|
|
11599
|
+
baseUrl: this.baseUrl,
|
|
11600
|
+
path: `${AI_GW_INTEGRATIONS_PATH}/${integrationId}/workspaces`,
|
|
11601
|
+
body,
|
|
11602
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11603
|
+
auth: this.auth,
|
|
11604
|
+
numRetries: this.numRetries
|
|
11605
|
+
});
|
|
11606
|
+
}
|
|
11607
|
+
};
|
|
11608
|
+
|
|
11609
|
+
// src/ai-gateway/mcp-integrations-client.ts
|
|
11610
|
+
var AIGatewayMcpIntegrationsClient = class {
|
|
11611
|
+
baseUrl;
|
|
11612
|
+
auth;
|
|
11613
|
+
numRetries;
|
|
11614
|
+
constructor(opts) {
|
|
11615
|
+
this.baseUrl = opts.baseUrl;
|
|
11616
|
+
this.auth = opts.auth;
|
|
11617
|
+
this.numRetries = opts.numRetries;
|
|
11618
|
+
}
|
|
11619
|
+
/**
|
|
11620
|
+
* List organisation MCP integrations.
|
|
11621
|
+
* @returns All MCP server integrations defined on the organisation.
|
|
11622
|
+
* @example
|
|
11623
|
+
* ```ts
|
|
11624
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11625
|
+
* const gw = new AIGatewayClient();
|
|
11626
|
+
*
|
|
11627
|
+
* const mcp = await gw.mcpIntegrations.list();
|
|
11628
|
+
* // mcp.data[0] => { name: 'Context 7', url: 'https://mcp.context7.com/mcp', transport: 'http', ... }
|
|
11629
|
+
* ```
|
|
11630
|
+
*/
|
|
11631
|
+
async list() {
|
|
11632
|
+
return request({
|
|
11633
|
+
method: "GET",
|
|
11634
|
+
baseUrl: this.baseUrl,
|
|
11635
|
+
path: AI_GW_MCP_INTEGRATIONS_PATH,
|
|
11636
|
+
responseSchema: ListMcpIntegrationsResponseSchema,
|
|
11637
|
+
auth: this.auth,
|
|
11638
|
+
numRetries: this.numRetries
|
|
11639
|
+
});
|
|
11640
|
+
}
|
|
11641
|
+
/**
|
|
11642
|
+
* Register an MCP server.
|
|
11643
|
+
* @param body - Name, server URL, auth type, transport, and provider-specific configuration.
|
|
11644
|
+
* @returns The raw create response. Shape unverified against a live tenant — see the PRD.
|
|
11645
|
+
* @example
|
|
11646
|
+
* ```ts
|
|
11647
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11648
|
+
* const gw = new AIGatewayClient();
|
|
11649
|
+
*
|
|
11650
|
+
* await gw.mcpIntegrations.create({
|
|
11651
|
+
* name: 'Context 7',
|
|
11652
|
+
* organisation_id: '1852583913',
|
|
11653
|
+
* slug: 'context-7',
|
|
11654
|
+
* url: 'https://mcp.context7.com/mcp',
|
|
11655
|
+
* auth_type: 'none',
|
|
11656
|
+
* transport: 'http',
|
|
11657
|
+
* });
|
|
11658
|
+
* ```
|
|
11659
|
+
*/
|
|
11660
|
+
async create(body) {
|
|
11661
|
+
return request({
|
|
11662
|
+
method: "POST",
|
|
11663
|
+
baseUrl: this.baseUrl,
|
|
11664
|
+
path: AI_GW_MCP_INTEGRATIONS_PATH,
|
|
11665
|
+
body,
|
|
11666
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11667
|
+
auth: this.auth,
|
|
11668
|
+
numRetries: this.numRetries
|
|
11669
|
+
});
|
|
11670
|
+
}
|
|
11671
|
+
/**
|
|
11672
|
+
* Replace which workspaces may use this MCP integration.
|
|
11673
|
+
* @param mcpIntegrationId - MCP integration UUID.
|
|
11674
|
+
* @param body - Workspace bindings or a global-access flag; this is a replace, not a merge.
|
|
11675
|
+
* @returns The raw response. Shape unverified against a live tenant — see the PRD.
|
|
11676
|
+
* @example
|
|
11677
|
+
* ```ts
|
|
11678
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11679
|
+
* const gw = new AIGatewayClient();
|
|
11680
|
+
*
|
|
11681
|
+
* await gw.mcpIntegrations.setWorkspaces('f6692544-3265-49be-9711-bbdcebc079e4', {
|
|
11682
|
+
* global_workspace_access: true,
|
|
11683
|
+
* });
|
|
11684
|
+
* ```
|
|
11685
|
+
*/
|
|
11686
|
+
async setWorkspaces(mcpIntegrationId, body) {
|
|
11687
|
+
assertUuid(mcpIntegrationId, "mcpIntegrationId");
|
|
11688
|
+
return request({
|
|
11689
|
+
method: "PUT",
|
|
11690
|
+
baseUrl: this.baseUrl,
|
|
11691
|
+
path: `${AI_GW_MCP_INTEGRATIONS_PATH}/${mcpIntegrationId}/workspaces`,
|
|
11692
|
+
body,
|
|
11693
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11694
|
+
auth: this.auth,
|
|
11695
|
+
numRetries: this.numRetries
|
|
11696
|
+
});
|
|
11697
|
+
}
|
|
11698
|
+
};
|
|
11699
|
+
|
|
11700
|
+
// src/ai-gateway/deployments-client.ts
|
|
11701
|
+
var AIGatewayDeploymentsClient = class {
|
|
11702
|
+
baseUrl;
|
|
11703
|
+
auth;
|
|
11704
|
+
numRetries;
|
|
11705
|
+
constructor(opts) {
|
|
11706
|
+
this.baseUrl = opts.baseUrl;
|
|
11707
|
+
this.auth = opts.auth;
|
|
11708
|
+
this.numRetries = opts.numRetries;
|
|
11709
|
+
}
|
|
11710
|
+
/**
|
|
11711
|
+
* List deployments.
|
|
11712
|
+
*
|
|
11713
|
+
* @remarks
|
|
11714
|
+
* Archived deployments are included — `delete()` is a soft-delete. Filter on
|
|
11715
|
+
* `status === 'active'` if you only want live ones.
|
|
11716
|
+
*
|
|
11717
|
+
* @returns All deployments, active and archived.
|
|
11718
|
+
* @example
|
|
11719
|
+
* ```ts
|
|
11720
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11721
|
+
* const gw = new AIGatewayClient();
|
|
11722
|
+
*
|
|
11723
|
+
* const all = await gw.deployments.list();
|
|
11724
|
+
* const live = all.data.filter((d) => d.status === 'active');
|
|
11725
|
+
* // live[0] => { name: 'talos', slug: 'dp-talos-f3b74e', status: 'active', ... }
|
|
11726
|
+
* ```
|
|
11727
|
+
*/
|
|
11728
|
+
async list() {
|
|
11729
|
+
return request({
|
|
11730
|
+
method: "GET",
|
|
11731
|
+
baseUrl: this.baseUrl,
|
|
11732
|
+
path: AI_GW_DEPLOYMENTS_PATH,
|
|
11733
|
+
responseSchema: ListDeploymentsResponseSchema,
|
|
11734
|
+
auth: this.auth,
|
|
11735
|
+
numRetries: this.numRetries
|
|
11736
|
+
});
|
|
11737
|
+
}
|
|
11738
|
+
/**
|
|
11739
|
+
* Fetch one deployment.
|
|
11740
|
+
* @param deploymentId - Deployment UUID.
|
|
11741
|
+
* @returns Deployment detail, including bound workspaces and masked credentials.
|
|
11742
|
+
* @example
|
|
11743
|
+
* ```ts
|
|
11744
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11745
|
+
* const gw = new AIGatewayClient();
|
|
11746
|
+
*
|
|
11747
|
+
* const d = await gw.deployments.get('32e8314e-7e68-4384-aacb-a476f6c3f91d');
|
|
11748
|
+
* // d.auth_settings?.allow_all_workspaces => 1 (a number, not a boolean)
|
|
11749
|
+
* ```
|
|
11750
|
+
*/
|
|
11751
|
+
async get(deploymentId) {
|
|
11752
|
+
assertUuid(deploymentId, "deploymentId");
|
|
11753
|
+
return request({
|
|
11754
|
+
method: "GET",
|
|
11755
|
+
baseUrl: this.baseUrl,
|
|
11756
|
+
path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}`,
|
|
11757
|
+
responseSchema: GatewayDeploymentDetailSchema,
|
|
11758
|
+
auth: this.auth,
|
|
11759
|
+
numRetries: this.numRetries
|
|
11760
|
+
});
|
|
11761
|
+
}
|
|
11762
|
+
/**
|
|
11763
|
+
* Create a deployment.
|
|
11764
|
+
*
|
|
11765
|
+
* @remarks
|
|
11766
|
+
* The response is a **creation receipt**, not a deployment record — it has 5 fields and
|
|
11767
|
+
* carries no `name`, `slug`, or `status`. Call {@link get} for the full record.
|
|
11768
|
+
*
|
|
11769
|
+
* This is the **only** time `credentials.password` and `client_auth` are readable; the
|
|
11770
|
+
* detail read masks them. Capture them here or they are unrecoverable. Never log them.
|
|
11771
|
+
* Note that setting `PANW_AI_SEC_DEBUG` will print the raw request/response, including
|
|
11772
|
+
* `credentials.password`, to the SDK's own debug log regardless of this warning.
|
|
11773
|
+
*
|
|
11774
|
+
* @param body - Name, type, TSG, and auth settings.
|
|
11775
|
+
* @returns The creation receipt including the deployment's gateway credentials.
|
|
11776
|
+
* @example
|
|
11777
|
+
* ```ts
|
|
11778
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11779
|
+
* const gw = new AIGatewayClient();
|
|
11780
|
+
*
|
|
11781
|
+
* const receipt = await gw.deployments.create({
|
|
11782
|
+
* name: 'prod-us',
|
|
11783
|
+
* type: 'production',
|
|
11784
|
+
* organisation_id: '1852583913',
|
|
11785
|
+
* auth_settings: { allow_all_workspaces: true },
|
|
11786
|
+
* });
|
|
11787
|
+
* // receipt => { id: '2141...', client_auth: 'client-auth-...', credentials: { username, password }, ... }
|
|
11788
|
+
* const full = await gw.deployments.get(receipt.id);
|
|
11789
|
+
* ```
|
|
11790
|
+
*/
|
|
11791
|
+
async create(body) {
|
|
11792
|
+
return request({
|
|
11793
|
+
method: "POST",
|
|
11794
|
+
baseUrl: this.baseUrl,
|
|
11795
|
+
path: AI_GW_DEPLOYMENTS_PATH,
|
|
11796
|
+
body,
|
|
11797
|
+
responseSchema: GatewayDeploymentCreateResponseSchema,
|
|
11798
|
+
auth: this.auth,
|
|
11799
|
+
numRetries: this.numRetries
|
|
11800
|
+
});
|
|
11801
|
+
}
|
|
11802
|
+
/**
|
|
11803
|
+
* Archive a deployment.
|
|
11804
|
+
*
|
|
11805
|
+
* @remarks
|
|
11806
|
+
* This is a **soft delete** — the one exception to the gateway's usual delete semantics.
|
|
11807
|
+
* The API returns 200 with an empty body and the record persists with `status:
|
|
11808
|
+
* 'archived'`, still visible in {@link list}. There is no observed hard-delete for
|
|
11809
|
+
* deployments specifically. Contrast with {@link AIGatewayConfigsClient.delete |
|
|
11810
|
+
* configs.delete}, {@link AIGatewayGuardrailsClient.delete | guardrails.delete}, and
|
|
11811
|
+
* {@link AIGatewayProvidersClient.delete | providers.delete}, all of which hard-delete —
|
|
11812
|
+
* do not assume archive-on-delete is a gateway-wide convention.
|
|
11813
|
+
*
|
|
11814
|
+
* @param deploymentId - Deployment UUID.
|
|
11815
|
+
* @param organisationId - The TSG as a numeric string; sent as a query param.
|
|
11816
|
+
* @returns Nothing.
|
|
11817
|
+
* @example
|
|
11818
|
+
* ```ts
|
|
11819
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11820
|
+
* const gw = new AIGatewayClient();
|
|
11821
|
+
*
|
|
11822
|
+
* await gw.deployments.delete('21414819-485e-4ba3-b3d3-3e1815580e43', '1852583913');
|
|
11823
|
+
* // the record remains in list() with status 'archived'
|
|
11824
|
+
* ```
|
|
11825
|
+
*/
|
|
11826
|
+
async delete(deploymentId, organisationId) {
|
|
11827
|
+
assertUuid(deploymentId, "deploymentId");
|
|
11828
|
+
assertNumericId(organisationId, "organisationId");
|
|
11829
|
+
await request({
|
|
11830
|
+
method: "DELETE",
|
|
11831
|
+
baseUrl: this.baseUrl,
|
|
11832
|
+
path: `${AI_GW_DEPLOYMENTS_PATH}/${deploymentId}`,
|
|
11833
|
+
params: { organisation_id: organisationId },
|
|
11834
|
+
auth: this.auth,
|
|
11835
|
+
numRetries: this.numRetries
|
|
11836
|
+
});
|
|
11837
|
+
}
|
|
11838
|
+
};
|
|
11839
|
+
|
|
11840
|
+
// src/ai-gateway/plugins-client.ts
|
|
11841
|
+
var AIGatewayPluginsClient = class {
|
|
11842
|
+
baseUrl;
|
|
11843
|
+
auth;
|
|
11844
|
+
numRetries;
|
|
11845
|
+
constructor(opts) {
|
|
11846
|
+
this.baseUrl = opts.baseUrl;
|
|
11847
|
+
this.auth = opts.auth;
|
|
11848
|
+
this.numRetries = opts.numRetries;
|
|
11849
|
+
}
|
|
11850
|
+
/**
|
|
11851
|
+
* List organisation plugin bindings.
|
|
11852
|
+
* @returns All plugins bound to the organisation, with masked credentials.
|
|
11853
|
+
* @example
|
|
11854
|
+
* ```ts
|
|
11855
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11856
|
+
* const gw = new AIGatewayClient();
|
|
11857
|
+
*
|
|
11858
|
+
* const p = await gw.plugins.list();
|
|
11859
|
+
* // p.data[0] => { integration_slug: 'panw-prisma-airs', credentials: { AIRS_API_KEY: 'sn*****Gul' }, ... }
|
|
11860
|
+
* ```
|
|
11861
|
+
*/
|
|
11862
|
+
async list() {
|
|
11863
|
+
return request({
|
|
11864
|
+
method: "GET",
|
|
11865
|
+
baseUrl: this.baseUrl,
|
|
11866
|
+
path: AI_GW_PLUGINS_PATH,
|
|
11867
|
+
responseSchema: ListPluginsResponseSchema,
|
|
11868
|
+
auth: this.auth,
|
|
11869
|
+
numRetries: this.numRetries
|
|
11870
|
+
});
|
|
11871
|
+
}
|
|
11872
|
+
/**
|
|
11873
|
+
* Bind a plugin to the organisation.
|
|
11874
|
+
*
|
|
11875
|
+
* @remarks
|
|
11876
|
+
* `body.credentials` (e.g. `AIRS_API_KEY`) is a live secret. Setting `PANW_AI_SEC_DEBUG`
|
|
11877
|
+
* will print it, unredacted, to the SDK's own debug log.
|
|
11878
|
+
*
|
|
11879
|
+
* @param body - Integration id and provider-specific credentials.
|
|
11880
|
+
* @returns The raw create response. Shape unverified against a live tenant — see the PRD.
|
|
11881
|
+
* @example
|
|
11882
|
+
* ```ts
|
|
11883
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11884
|
+
* const gw = new AIGatewayClient();
|
|
11885
|
+
*
|
|
11886
|
+
* await gw.plugins.create({
|
|
11887
|
+
* organisation_id: '1852583913',
|
|
11888
|
+
* integration_id: '232e45c4-809a-11f1-af60-2ca2a760eb7b',
|
|
11889
|
+
* credentials: { AIRS_API_KEY: process.env.PANW_AI_SEC_API_KEY ?? '' },
|
|
11890
|
+
* });
|
|
11891
|
+
* ```
|
|
11892
|
+
*/
|
|
11893
|
+
async create(body) {
|
|
11894
|
+
assertUuid(body.integration_id, "integration_id");
|
|
11895
|
+
return request({
|
|
11896
|
+
method: "POST",
|
|
11897
|
+
baseUrl: this.baseUrl,
|
|
11898
|
+
path: AI_GW_PLUGINS_PATH,
|
|
11899
|
+
body,
|
|
11900
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11901
|
+
auth: this.auth,
|
|
11902
|
+
numRetries: this.numRetries
|
|
11903
|
+
});
|
|
11904
|
+
}
|
|
11905
|
+
};
|
|
11906
|
+
|
|
11907
|
+
// src/ai-gateway/organisations-client.ts
|
|
11908
|
+
var AIGatewayOrganisationsClient = class {
|
|
11909
|
+
baseUrl;
|
|
11910
|
+
auth;
|
|
11911
|
+
numRetries;
|
|
11912
|
+
constructor(opts) {
|
|
11913
|
+
this.baseUrl = opts.baseUrl;
|
|
11914
|
+
this.auth = opts.auth;
|
|
11915
|
+
this.numRetries = opts.numRetries;
|
|
11916
|
+
}
|
|
11917
|
+
/**
|
|
11918
|
+
* Fetch the calling organisation's settings.
|
|
11919
|
+
* @returns The organisation record.
|
|
11920
|
+
* @example
|
|
11921
|
+
* ```ts
|
|
11922
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11923
|
+
* const gw = new AIGatewayClient();
|
|
11924
|
+
*
|
|
11925
|
+
* const org = await gw.organisations.getSelf();
|
|
11926
|
+
* // org.data.name => 'Acme Corp'
|
|
11927
|
+
* ```
|
|
11928
|
+
*/
|
|
11929
|
+
async getSelf() {
|
|
11930
|
+
return request({
|
|
11931
|
+
method: "GET",
|
|
11932
|
+
baseUrl: this.baseUrl,
|
|
11933
|
+
path: AI_GW_ORGANISATIONS_SELF_PATH,
|
|
11934
|
+
responseSchema: OrganisationSelfResponseSchema,
|
|
11935
|
+
auth: this.auth,
|
|
11936
|
+
numRetries: this.numRetries
|
|
11937
|
+
});
|
|
11938
|
+
}
|
|
11939
|
+
/**
|
|
11940
|
+
* Update the calling organisation's settings.
|
|
11941
|
+
* @param body - Replacement fields.
|
|
11942
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11943
|
+
* @example
|
|
11944
|
+
* ```ts
|
|
11945
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11946
|
+
* const gw = new AIGatewayClient();
|
|
11947
|
+
*
|
|
11948
|
+
* await gw.organisations.updateSelf({ name: 'Acme Corp' });
|
|
11949
|
+
* ```
|
|
11950
|
+
*/
|
|
11951
|
+
async updateSelf(body) {
|
|
11952
|
+
return request({
|
|
11953
|
+
method: "PUT",
|
|
11954
|
+
baseUrl: this.baseUrl,
|
|
11955
|
+
path: AI_GW_ORGANISATIONS_SELF_PATH,
|
|
11956
|
+
body,
|
|
11957
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
11958
|
+
auth: this.auth,
|
|
11959
|
+
numRetries: this.numRetries
|
|
11960
|
+
});
|
|
11961
|
+
}
|
|
11962
|
+
/**
|
|
11963
|
+
* Fetch an organisation's auth settings.
|
|
11964
|
+
*
|
|
11965
|
+
* @remarks
|
|
11966
|
+
* The response includes a `scim_token` — a live secret. Never log the returned object.
|
|
11967
|
+
* Note that setting `PANW_AI_SEC_DEBUG` will print it (unredacted) to the SDK's own debug
|
|
11968
|
+
* log regardless of this warning, since debug logging only sanitizes header values.
|
|
11969
|
+
*
|
|
11970
|
+
* @param tsgId - The TSG as a numeric string, not a UUID.
|
|
11971
|
+
* @returns Auth settings, including domains and the SCIM token.
|
|
11972
|
+
* @example
|
|
11973
|
+
* ```ts
|
|
11974
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
11975
|
+
* const gw = new AIGatewayClient();
|
|
11976
|
+
*
|
|
11977
|
+
* const auth = await gw.organisations.getAuthSettings('1852583913');
|
|
11978
|
+
* // Object.keys(auth.data) => ['auth_settings', 'domains', 'scim_token', ...]
|
|
11979
|
+
* ```
|
|
11980
|
+
*/
|
|
11981
|
+
async getAuthSettings(tsgId) {
|
|
11982
|
+
assertNumericId(tsgId, "tsgId");
|
|
11983
|
+
return request({
|
|
11984
|
+
method: "GET",
|
|
11985
|
+
baseUrl: this.baseUrl,
|
|
11986
|
+
path: aiGwOrganisationsAuthSettingsPath(tsgId),
|
|
11987
|
+
responseSchema: AuthSettingsResponseSchema,
|
|
11988
|
+
auth: this.auth,
|
|
11989
|
+
numRetries: this.numRetries
|
|
11990
|
+
});
|
|
11991
|
+
}
|
|
11992
|
+
/**
|
|
11993
|
+
* Update an organisation's auth settings.
|
|
11994
|
+
* @param tsgId - The TSG as a numeric string, not a UUID.
|
|
11995
|
+
* @param body - Replacement fields.
|
|
11996
|
+
* @returns The raw update response. Shape unverified against a live tenant — see the PRD.
|
|
11997
|
+
* @example
|
|
11998
|
+
* ```ts
|
|
11999
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12000
|
+
* const gw = new AIGatewayClient();
|
|
12001
|
+
*
|
|
12002
|
+
* await gw.organisations.updateAuthSettings('1852583913', {
|
|
12003
|
+
* domains: ['acme.com'],
|
|
12004
|
+
* });
|
|
12005
|
+
* ```
|
|
12006
|
+
*/
|
|
12007
|
+
async updateAuthSettings(tsgId, body) {
|
|
12008
|
+
assertNumericId(tsgId, "tsgId");
|
|
12009
|
+
return request({
|
|
12010
|
+
method: "PUT",
|
|
12011
|
+
baseUrl: this.baseUrl,
|
|
12012
|
+
path: aiGwOrganisationsAuthSettingsPath(tsgId),
|
|
12013
|
+
body,
|
|
12014
|
+
responseSchema: GatewayWriteResponseSchema,
|
|
12015
|
+
auth: this.auth,
|
|
12016
|
+
numRetries: this.numRetries
|
|
12017
|
+
});
|
|
12018
|
+
}
|
|
12019
|
+
};
|
|
12020
|
+
|
|
12021
|
+
// src/ai-gateway/audit-logs-client.ts
|
|
12022
|
+
var AIGatewayAuditLogsClient = class {
|
|
12023
|
+
baseUrl;
|
|
12024
|
+
auth;
|
|
12025
|
+
numRetries;
|
|
12026
|
+
constructor(opts) {
|
|
12027
|
+
this.baseUrl = opts.baseUrl;
|
|
12028
|
+
this.auth = opts.auth;
|
|
12029
|
+
this.numRetries = opts.numRetries;
|
|
12030
|
+
}
|
|
12031
|
+
/**
|
|
12032
|
+
* Read organisation audit logs.
|
|
12033
|
+
*
|
|
12034
|
+
* @remarks
|
|
12035
|
+
* **Handle the result as sensitive.** The API returns each entry's `request_body`
|
|
12036
|
+
* **unredacted**, so records for credential-bearing calls (integrations, plugins) can
|
|
12037
|
+
* contain live secrets — private keys, provider API keys — in plaintext. The sibling
|
|
12038
|
+
* `request_headers` field is masked, but `request_body` is not. The SDK returns the
|
|
12039
|
+
* response faithfully rather than altering it; never log these records wholesale, and
|
|
12040
|
+
* never forward them to a third-party sink. Note that setting `PANW_AI_SEC_DEBUG` will
|
|
12041
|
+
* print the raw response — including these unredacted secrets — to the SDK's own debug
|
|
12042
|
+
* log regardless of this warning.
|
|
12043
|
+
*
|
|
12044
|
+
* @param opts - Inclusive start and end of the window.
|
|
12045
|
+
* @returns Audit records, newest first.
|
|
12046
|
+
* @example
|
|
12047
|
+
* ```ts
|
|
12048
|
+
* import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
12049
|
+
* const gw = new AIGatewayClient();
|
|
12050
|
+
*
|
|
12051
|
+
* const logs = await gw.auditLogs.list({
|
|
12052
|
+
* start: new Date('2026-07-20T00:00:00Z'),
|
|
12053
|
+
* end: new Date(),
|
|
12054
|
+
* });
|
|
12055
|
+
* // Safe projection — never log the whole record.
|
|
12056
|
+
* const summary = logs.records.map((r) => `${r.timestamp} ${r.method} ${r.uri}`);
|
|
12057
|
+
* ```
|
|
12058
|
+
*/
|
|
12059
|
+
async list(opts) {
|
|
12060
|
+
return request({
|
|
12061
|
+
method: "GET",
|
|
12062
|
+
baseUrl: this.baseUrl,
|
|
12063
|
+
path: AI_GW_AUDIT_LOGS_PATH,
|
|
12064
|
+
params: {
|
|
12065
|
+
start_time: opts.start.toISOString(),
|
|
12066
|
+
end_time: opts.end.toISOString()
|
|
12067
|
+
},
|
|
12068
|
+
responseSchema: GatewayAuditLogsResponseSchema,
|
|
12069
|
+
auth: this.auth,
|
|
12070
|
+
numRetries: this.numRetries
|
|
12071
|
+
});
|
|
12072
|
+
}
|
|
12073
|
+
};
|
|
12074
|
+
|
|
12075
|
+
// src/ai-gateway/client.ts
|
|
12076
|
+
var AIGatewayClient = class {
|
|
12077
|
+
/** Runtime telemetry: charts, group-bys, and raw request logs. */
|
|
12078
|
+
telemetry;
|
|
12079
|
+
/** Workspace reads (data plane). */
|
|
12080
|
+
workspaces;
|
|
12081
|
+
/** Gateway routing configs. */
|
|
12082
|
+
configs;
|
|
12083
|
+
/** Workspace guardrails. */
|
|
12084
|
+
guardrails;
|
|
12085
|
+
/** Workspace-scoped provider bindings. */
|
|
12086
|
+
providers;
|
|
12087
|
+
/** Service and user API keys. */
|
|
12088
|
+
apiKeys;
|
|
12089
|
+
/** Organisation-level provider integrations (admin plane). */
|
|
12090
|
+
integrations;
|
|
12091
|
+
/** MCP server integrations (admin plane). */
|
|
12092
|
+
mcpIntegrations;
|
|
12093
|
+
/** Gateway deployments (admin plane). */
|
|
12094
|
+
deployments;
|
|
12095
|
+
/** Plugin bindings such as the Prisma AIRS scanner (admin plane). */
|
|
12096
|
+
plugins;
|
|
12097
|
+
/** Organisation and auth settings (admin plane). */
|
|
12098
|
+
organisations;
|
|
12099
|
+
/** Organisation audit logs (admin plane). */
|
|
12100
|
+
auditLogs;
|
|
12101
|
+
constructor(opts = {}) {
|
|
12102
|
+
const dataEndpoint = opts.dataEndpoint ?? process.env[AI_GW_DATA_ENDPOINT] ?? DEFAULT_AI_GW_DATA_ENDPOINT;
|
|
12103
|
+
const adminEndpoint = opts.adminEndpoint ?? process.env[AI_GW_ADMIN_ENDPOINT] ?? DEFAULT_AI_GW_ADMIN_ENDPOINT;
|
|
12104
|
+
const { oauthClient, numRetries, tsgId } = resolveOAuthConfig({
|
|
12105
|
+
clientId: opts.clientId,
|
|
12106
|
+
clientSecret: opts.clientSecret,
|
|
12107
|
+
tsgId: opts.tsgId,
|
|
12108
|
+
baseUrl: dataEndpoint,
|
|
12109
|
+
numRetries: opts.numRetries,
|
|
12110
|
+
tokenEndpoint: opts.tokenEndpoint,
|
|
12111
|
+
primaryEnvPrefix: "PANW_AI_GW",
|
|
12112
|
+
fallbackEnvPrefix: "PANW_MGMT"
|
|
12113
|
+
});
|
|
12114
|
+
const auth = new TsgHeaderAuth(new OAuthAuth(oauthClient), tsgId);
|
|
12115
|
+
const dataOpts = { baseUrl: dataEndpoint, auth, numRetries };
|
|
12116
|
+
const adminOpts = { baseUrl: adminEndpoint, auth, numRetries };
|
|
12117
|
+
this.telemetry = new AIGatewayTelemetryClient({ ...dataOpts, tsgId });
|
|
12118
|
+
this.workspaces = new AIGatewayWorkspacesClient({ ...dataOpts, adminBaseUrl: adminEndpoint });
|
|
12119
|
+
this.configs = new AIGatewayConfigsClient(dataOpts);
|
|
12120
|
+
this.guardrails = new AIGatewayGuardrailsClient(dataOpts);
|
|
12121
|
+
this.providers = new AIGatewayProvidersClient(dataOpts);
|
|
12122
|
+
this.apiKeys = new AIGatewayApiKeysClient(dataOpts);
|
|
12123
|
+
this.integrations = new AIGatewayIntegrationsClient(adminOpts);
|
|
12124
|
+
this.mcpIntegrations = new AIGatewayMcpIntegrationsClient(adminOpts);
|
|
12125
|
+
this.deployments = new AIGatewayDeploymentsClient(adminOpts);
|
|
12126
|
+
this.plugins = new AIGatewayPluginsClient(adminOpts);
|
|
12127
|
+
this.organisations = new AIGatewayOrganisationsClient(adminOpts);
|
|
12128
|
+
this.auditLogs = new AIGatewayAuditLogsClient(adminOpts);
|
|
12129
|
+
}
|
|
12130
|
+
};
|
|
9358
12131
|
export {
|
|
12132
|
+
AIGatewayApiKeysClient,
|
|
12133
|
+
AIGatewayAuditLogsClient,
|
|
12134
|
+
AIGatewayClient,
|
|
12135
|
+
AIGatewayConfigsClient,
|
|
12136
|
+
AIGatewayDeploymentsClient,
|
|
12137
|
+
AIGatewayGuardrailsClient,
|
|
12138
|
+
AIGatewayIntegrationsClient,
|
|
12139
|
+
AIGatewayMcpIntegrationsClient,
|
|
12140
|
+
AIGatewayOrganisationsClient,
|
|
12141
|
+
AIGatewayPluginsClient,
|
|
12142
|
+
AIGatewayProvidersClient,
|
|
12143
|
+
AIGatewayTelemetryClient,
|
|
12144
|
+
AIGatewayWorkspacesClient,
|
|
9359
12145
|
AIRS_ENDPOINTS,
|
|
9360
12146
|
AISecSDKException,
|
|
12147
|
+
AI_GW_ADMIN_ENDPOINT,
|
|
12148
|
+
AI_GW_API_KEYS_SERVICE_PATH,
|
|
12149
|
+
AI_GW_API_KEYS_USER_PATH,
|
|
12150
|
+
AI_GW_AUDIT_LOGS_PATH,
|
|
12151
|
+
AI_GW_CHARTS_PATH,
|
|
12152
|
+
AI_GW_CHART_METRICS,
|
|
12153
|
+
AI_GW_CONFIGS_PATH,
|
|
12154
|
+
AI_GW_DATA_ENDPOINT,
|
|
12155
|
+
AI_GW_DEPLOYMENTS_PATH,
|
|
12156
|
+
AI_GW_GROUPS_PATH,
|
|
12157
|
+
AI_GW_GROUP_COLUMNS,
|
|
12158
|
+
AI_GW_GROUP_DIMENSIONS,
|
|
12159
|
+
AI_GW_GUARDRAILS_PATH,
|
|
12160
|
+
AI_GW_INTEGRATIONS_PATH,
|
|
12161
|
+
AI_GW_LOGS_PATH,
|
|
12162
|
+
AI_GW_MCP_INTEGRATIONS_PATH,
|
|
12163
|
+
AI_GW_ORGANISATIONS_SELF_PATH,
|
|
12164
|
+
AI_GW_PLUGINS_PATH,
|
|
12165
|
+
AI_GW_PROVIDERS_PATH,
|
|
12166
|
+
AI_GW_WORKSPACES_PATH,
|
|
9361
12167
|
AI_SEC_API_ENDPOINT,
|
|
9362
12168
|
AI_SEC_API_KEY,
|
|
9363
12169
|
AI_SEC_API_TOKEN,
|
|
9364
12170
|
ASYNC_SCAN_PATH,
|
|
9365
12171
|
Action,
|
|
12172
|
+
AdapterCreateRequestSchema,
|
|
12173
|
+
AdapterListItemSchema,
|
|
12174
|
+
AdapterListSchema,
|
|
12175
|
+
AdapterResponseSchema,
|
|
12176
|
+
AdapterUpdateRequestSchema,
|
|
12177
|
+
AdapterValidateRequestSchema,
|
|
12178
|
+
AdapterValidateResponseSchema,
|
|
12179
|
+
AdapterVarResponseSchema,
|
|
12180
|
+
AdapterVarSchema,
|
|
12181
|
+
AdapterVarTypeSchema,
|
|
9366
12182
|
AdvancedDataProfileRequestSchema,
|
|
9367
12183
|
AgentEntrySchema,
|
|
9368
12184
|
AgentMetaSchema,
|
|
@@ -9391,6 +12207,7 @@ export {
|
|
|
9391
12207
|
AttackType,
|
|
9392
12208
|
AuditResponseSchema,
|
|
9393
12209
|
AuthConfigSchema,
|
|
12210
|
+
AuthSettingsResponseSchema,
|
|
9394
12211
|
AuthType,
|
|
9395
12212
|
BEARER,
|
|
9396
12213
|
BaseResponseSchema,
|
|
@@ -9398,6 +12215,8 @@ export {
|
|
|
9398
12215
|
BasicAuthLocation,
|
|
9399
12216
|
BedrockAccessConnectionParamsSchema,
|
|
9400
12217
|
BrandSubCategory,
|
|
12218
|
+
CacheHitTrendResponseSchema,
|
|
12219
|
+
CacheSummaryResponseSchema,
|
|
9401
12220
|
Category,
|
|
9402
12221
|
CategoryModelSchema,
|
|
9403
12222
|
CategoryReportSchema,
|
|
@@ -9419,7 +12238,9 @@ export {
|
|
|
9419
12238
|
Content,
|
|
9420
12239
|
ContentErrorSchema,
|
|
9421
12240
|
ContentErrorType,
|
|
12241
|
+
CostChartResponseSchema,
|
|
9422
12242
|
CountByNameSchema,
|
|
12243
|
+
CountChartResponseSchema,
|
|
9423
12244
|
CountedQuotaEnum,
|
|
9424
12245
|
CreateChannelRequestSchema,
|
|
9425
12246
|
CreateCustomTopicRequestSchema,
|
|
@@ -9449,6 +12270,8 @@ export {
|
|
|
9449
12270
|
CustomerAppSchema,
|
|
9450
12271
|
CustomerAppWithKeysSchema,
|
|
9451
12272
|
CustomerAppsClient,
|
|
12273
|
+
DEFAULT_AI_GW_ADMIN_ENDPOINT,
|
|
12274
|
+
DEFAULT_AI_GW_DATA_ENDPOINT,
|
|
9452
12275
|
DEFAULT_DLP_ENDPOINT,
|
|
9453
12276
|
DEFAULT_ENDPOINT,
|
|
9454
12277
|
DEFAULT_MGMT_ENDPOINT,
|
|
@@ -9553,6 +12376,7 @@ export {
|
|
|
9553
12376
|
ErrorResponseSchema,
|
|
9554
12377
|
ErrorSource,
|
|
9555
12378
|
ErrorStatus,
|
|
12379
|
+
ErrorTrendsResponseSchema,
|
|
9556
12380
|
ErrorType,
|
|
9557
12381
|
EulaAcceptRequestSchema,
|
|
9558
12382
|
EulaContentResponseSchema,
|
|
@@ -9563,16 +12387,49 @@ export {
|
|
|
9563
12387
|
ExclusionsSchema,
|
|
9564
12388
|
ExpressionOperatorTypeSchema,
|
|
9565
12389
|
ExpressionTreeNodeSchema,
|
|
12390
|
+
FeedbackModelsResponseSchema,
|
|
12391
|
+
FeedbackScoreDistributionResponseSchema,
|
|
9566
12392
|
FileFormat,
|
|
9567
12393
|
FileListSchema,
|
|
9568
12394
|
FileResponseSchema,
|
|
9569
12395
|
FileScanDataSchema,
|
|
9570
12396
|
FileScanResult,
|
|
9571
12397
|
FileType,
|
|
12398
|
+
GatewayApiKeySchema,
|
|
12399
|
+
GatewayAuditLogRecordSchema,
|
|
12400
|
+
GatewayAuditLogsResponseSchema,
|
|
12401
|
+
GatewayChartRecordSchema,
|
|
12402
|
+
GatewayConfigCreateResponseSchema,
|
|
12403
|
+
GatewayConfigDetailSchema,
|
|
12404
|
+
GatewayConfigSchema,
|
|
12405
|
+
GatewayDeploymentCreateResponseSchema,
|
|
12406
|
+
GatewayDeploymentDetailSchema,
|
|
12407
|
+
GatewayDeploymentSchema,
|
|
12408
|
+
GatewayGlobalWorkspaceAccessSchema,
|
|
12409
|
+
GatewayGroupRowSchema,
|
|
12410
|
+
GatewayGuardrailCreateResponseSchema,
|
|
12411
|
+
GatewayGuardrailDetailSchema,
|
|
12412
|
+
GatewayGuardrailSchema,
|
|
12413
|
+
GatewayIntegrationModelsResponseSchema,
|
|
12414
|
+
GatewayIntegrationSchema,
|
|
12415
|
+
GatewayIntegrationWorkspaceSchema,
|
|
12416
|
+
GatewayIntegrationWorkspacesResponseSchema,
|
|
12417
|
+
GatewayLogRecordSchema,
|
|
12418
|
+
GatewayLogsResponseSchema,
|
|
12419
|
+
GatewayPluginSchema,
|
|
12420
|
+
GatewayProviderCreateResponseSchema,
|
|
12421
|
+
GatewayProviderSchema,
|
|
12422
|
+
GatewayRateLimitSchema,
|
|
12423
|
+
GatewayUsageLimitSchema,
|
|
12424
|
+
GatewayWorkspaceCreateResponseSchema,
|
|
12425
|
+
GatewayWorkspaceDetailSchema,
|
|
12426
|
+
GatewayWorkspaceSchema,
|
|
12427
|
+
GatewayWriteResponseSchema,
|
|
9572
12428
|
GoalListResponseSchema,
|
|
9573
12429
|
GoalSchema,
|
|
9574
12430
|
GoalType,
|
|
9575
12431
|
GoalTypeQueryParam,
|
|
12432
|
+
GroupListResponseSchema,
|
|
9576
12433
|
GuardrailAction,
|
|
9577
12434
|
HEADER_API_KEY,
|
|
9578
12435
|
HEADER_AUTH_TOKEN,
|
|
@@ -9599,9 +12456,19 @@ export {
|
|
|
9599
12456
|
LabelsCreateRequestSchema,
|
|
9600
12457
|
LabelsResponseSchema,
|
|
9601
12458
|
LanguageOptionSchema,
|
|
12459
|
+
LatencyChartResponseSchema,
|
|
12460
|
+
ListApiKeysResponseSchema,
|
|
12461
|
+
ListConfigsResponseSchema,
|
|
12462
|
+
ListDeploymentsResponseSchema,
|
|
12463
|
+
ListGuardrailsResponseSchema,
|
|
12464
|
+
ListIntegrationsResponseSchema,
|
|
12465
|
+
ListMcpIntegrationsResponseSchema,
|
|
9602
12466
|
ListModelSecurityGroupsResponseSchema,
|
|
9603
12467
|
ListModelSecurityRuleInstancesResponseSchema,
|
|
9604
12468
|
ListModelSecurityRulesResponseSchema,
|
|
12469
|
+
ListPluginsResponseSchema,
|
|
12470
|
+
ListProvidersResponseSchema,
|
|
12471
|
+
ListWorkspacesResponseSchema,
|
|
9605
12472
|
MAX_AI_PROFILE_NAME_LENGTH,
|
|
9606
12473
|
MAX_API_KEY_LENGTH,
|
|
9607
12474
|
MAX_CONNECTION_POOL_SIZE,
|
|
@@ -9659,6 +12526,7 @@ export {
|
|
|
9659
12526
|
MaskedDataSchema,
|
|
9660
12527
|
McEntrySchema,
|
|
9661
12528
|
McReportSchema,
|
|
12529
|
+
McpIntegrationSchema,
|
|
9662
12530
|
MetadataCriterionSchema,
|
|
9663
12531
|
MetadataSchema,
|
|
9664
12532
|
ModelConfigurationSchema,
|
|
@@ -9692,6 +12560,7 @@ export {
|
|
|
9692
12560
|
Oauth2TokenSchema,
|
|
9693
12561
|
OffsetSchema,
|
|
9694
12562
|
OpenAIConnectionParamsSchema,
|
|
12563
|
+
OrganisationSelfResponseSchema,
|
|
9695
12564
|
PAYLOAD_HASH,
|
|
9696
12565
|
PageDataFilteringProfileResponseSchema,
|
|
9697
12566
|
PageDataPatternResponseSchema,
|
|
@@ -9725,6 +12594,8 @@ export {
|
|
|
9725
12594
|
PyPIAuthResponseSchema,
|
|
9726
12595
|
QuotaDetailsSchema,
|
|
9727
12596
|
QuotaSummarySchema,
|
|
12597
|
+
RED_TEAM_ADAPTER_PATH,
|
|
12598
|
+
RED_TEAM_ADAPTER_VALIDATE_PATH,
|
|
9728
12599
|
RED_TEAM_CATEGORIES_PATH,
|
|
9729
12600
|
RED_TEAM_CHANNELS_PATH,
|
|
9730
12601
|
RED_TEAM_CHANNELS_STATS_PATH,
|
|
@@ -9754,6 +12625,7 @@ export {
|
|
|
9754
12625
|
RED_TEAM_TEMPLATE_PATH,
|
|
9755
12626
|
RED_TEAM_TOKEN_ENDPOINT,
|
|
9756
12627
|
RED_TEAM_TSG_ID,
|
|
12628
|
+
RedTeamAdaptersClient,
|
|
9757
12629
|
RedTeamCategory,
|
|
9758
12630
|
RedTeamClient,
|
|
9759
12631
|
RedTeamCustomAttackReportsClient,
|
|
@@ -9769,6 +12641,7 @@ export {
|
|
|
9769
12641
|
RegistryCredentialsSchema,
|
|
9770
12642
|
RemediationDetailSchema,
|
|
9771
12643
|
RemediationResponseSchema,
|
|
12644
|
+
RescuedRetriesResponseSchema,
|
|
9772
12645
|
ResourceModelExtensionSchema,
|
|
9773
12646
|
ResponseDetectedSchema,
|
|
9774
12647
|
ResponseDetectionDetailsSchema,
|
|
@@ -9843,6 +12716,7 @@ export {
|
|
|
9843
12716
|
StreamingConnectionParamsSchema,
|
|
9844
12717
|
SubCategoryModelSchema,
|
|
9845
12718
|
SubCategoryStatsSchema,
|
|
12719
|
+
TSG_ID_HEADER,
|
|
9846
12720
|
TargetAdditionalContextSchema,
|
|
9847
12721
|
TargetAuthType,
|
|
9848
12722
|
TargetAuthValidationRequestSchema,
|
|
@@ -9869,6 +12743,7 @@ export {
|
|
|
9869
12743
|
ThreatCategory,
|
|
9870
12744
|
ThreatScanReportSchema,
|
|
9871
12745
|
TokenStatsSchema,
|
|
12746
|
+
TokensChartResponseSchema,
|
|
9872
12747
|
ToolDetectedSchema,
|
|
9873
12748
|
ToolDetectionDetailsSchema,
|
|
9874
12749
|
ToolDetectionEntrySchema,
|
|
@@ -9883,6 +12758,8 @@ export {
|
|
|
9883
12758
|
UpdateChannelRequestSchema,
|
|
9884
12759
|
UrlCategorySchema,
|
|
9885
12760
|
UrlfEntrySchema,
|
|
12761
|
+
UserGroupResponseSchema,
|
|
12762
|
+
UserTrendsResponseSchema,
|
|
9886
12763
|
ValidationErrorSchema,
|
|
9887
12764
|
Verdict,
|
|
9888
12765
|
ViolationListSchema,
|
|
@@ -9891,6 +12768,7 @@ export {
|
|
|
9891
12768
|
ViolationSeverityCountsSchema,
|
|
9892
12769
|
WebSocketConnectionParamsSchema,
|
|
9893
12770
|
WeightedRegexSchema,
|
|
12771
|
+
aiGwOrganisationsAuthSettingsPath,
|
|
9894
12772
|
globalConfiguration,
|
|
9895
12773
|
init,
|
|
9896
12774
|
jsonNullable,
|