@cdot65/prisma-airs-sdk 0.23.0 → 0.24.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 +2 -0
- package/dist/index.cjs +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -7
- package/dist/index.d.ts +92 -7
- package/dist/index.js +27 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,8 @@ Experimental runtime methods also model image/audio/moderation/rerank/OCR, legac
|
|
|
101
101
|
|
|
102
102
|
Secret-reference CRUD is verified using owned, unbound synthetic references; external secret resolution is not certified. See the [captured lifecycle output](docs-site/docs/guides/examples.mdx#secret-reference-management-lifecycle). Portkey compatibility remains partial; retired upstream endpoints and tenant-unverified families stay visible in the [complete operation ledger](docs-site/docs/developer/gateway-coverage.md).
|
|
103
103
|
|
|
104
|
+
Request, cost, token and latency charts accept verified trace/metadata filters, status-code/API-key/provider-model lists and inclusive total-token/cost bounds. List members match with OR; distinct filters combine with AND. Cost bounds are in cents. Empty latency aggregates remain `null`, not measured zero. Unknown filters are rejected before authentication; the SCM query names differ from upstream Portkey. See the [typed telemetry contract](docs-site/docs/guides/ai-gateway-api.mdx#charts).
|
|
105
|
+
|
|
104
106
|
All AI Gateway write bodies have exported Zod schemas and inferred TypeScript types. Validation
|
|
105
107
|
happens before OAuth and network access; documented nonempty-update requirements are enforced. The package also
|
|
106
108
|
exports typed routing/provider configuration, deterministic known-value catalogs,
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AIGatewayApiKeysClient: () => AIGatewayApiKeysClient,
|
|
24
24
|
AIGatewayAuditLogsClient: () => AIGatewayAuditLogsClient,
|
|
25
|
+
AIGatewayChartFiltersSchema: () => AIGatewayChartFiltersSchema,
|
|
25
26
|
AIGatewayClient: () => AIGatewayClient,
|
|
26
27
|
AIGatewayConfigsClient: () => AIGatewayConfigsClient,
|
|
27
28
|
AIGatewayDeploymentsClient: () => AIGatewayDeploymentsClient,
|
|
@@ -1357,7 +1358,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
|
|
|
1357
1358
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
1358
1359
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
1359
1360
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
1360
|
-
var SDK_VERSION = "0.
|
|
1361
|
+
var SDK_VERSION = "0.24.0";
|
|
1361
1362
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
1362
1363
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
1363
1364
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -17957,14 +17958,32 @@ var logsOptionsSchema = telemetryWindowSchema.extend({
|
|
|
17957
17958
|
traceId: nonBlankString.optional(),
|
|
17958
17959
|
statusCode: import_zod54.z.number().int().nonnegative().safe().optional()
|
|
17959
17960
|
}).strict();
|
|
17960
|
-
var
|
|
17961
|
+
var chartFilterFields = {
|
|
17961
17962
|
traceId: nonBlankString.optional(),
|
|
17962
|
-
metadata: GatewayJsonObjectSchema.pipe(import_zod54.z.record(import_zod54.z.string())).optional()
|
|
17963
|
-
|
|
17963
|
+
metadata: GatewayJsonObjectSchema.pipe(import_zod54.z.record(import_zod54.z.string())).optional(),
|
|
17964
|
+
statusCodes: import_zod54.z.array(import_zod54.z.number().int().nonnegative().safe()).nonempty().optional(),
|
|
17965
|
+
apiKeyIds: import_zod54.z.array(import_zod54.z.string().uuid()).nonempty().optional(),
|
|
17966
|
+
aiOrgModels: import_zod54.z.array(import_zod54.z.string().regex(/^[^,\s]+__[^,\s]+$/)).nonempty().optional(),
|
|
17967
|
+
totalUnitsMin: import_zod54.z.number().int().nonnegative().safe().optional(),
|
|
17968
|
+
totalUnitsMax: import_zod54.z.number().int().nonnegative().safe().optional(),
|
|
17969
|
+
costMin: import_zod54.z.number().finite().nonnegative().optional(),
|
|
17970
|
+
costMax: import_zod54.z.number().finite().nonnegative().optional()
|
|
17971
|
+
};
|
|
17972
|
+
function validChartBounds(opts) {
|
|
17973
|
+
return (opts.totalUnitsMin === void 0 || opts.totalUnitsMax === void 0 || opts.totalUnitsMin <= opts.totalUnitsMax) && (opts.costMin === void 0 || opts.costMax === void 0 || opts.costMin <= opts.costMax);
|
|
17974
|
+
}
|
|
17975
|
+
var AIGatewayChartFiltersSchema = import_zod54.z.object(chartFilterFields).strict().refine(validChartBounds);
|
|
17976
|
+
var filteredChartOptionsSchema = telemetryWindowSchema.extend(chartFilterFields).strict().refine(validChartBounds);
|
|
17964
17977
|
function serializeChartOptions(tsgId, opts) {
|
|
17965
17978
|
const params = serializeWindow(tsgId, opts, filteredChartOptionsSchema);
|
|
17966
17979
|
if (opts.traceId !== void 0) params.traceId = opts.traceId;
|
|
17967
17980
|
if (opts.metadata !== void 0) params.metadata = JSON.stringify(opts.metadata);
|
|
17981
|
+
if (opts.statusCodes !== void 0) params.statusCode = opts.statusCodes.join(",");
|
|
17982
|
+
if (opts.apiKeyIds !== void 0) params.apiKeyIds = opts.apiKeyIds.join(",");
|
|
17983
|
+
if (opts.aiOrgModels !== void 0) params.aiOrgModel = opts.aiOrgModels.join(",");
|
|
17984
|
+
for (const key of ["totalUnitsMin", "totalUnitsMax", "costMin", "costMax"]) {
|
|
17985
|
+
if (opts[key] !== void 0) params[key] = String(opts[key]);
|
|
17986
|
+
}
|
|
17968
17987
|
return params;
|
|
17969
17988
|
}
|
|
17970
17989
|
var AIGatewayTelemetryClient = class {
|
|
@@ -17992,7 +18011,7 @@ var AIGatewayTelemetryClient = class {
|
|
|
17992
18011
|
}
|
|
17993
18012
|
/**
|
|
17994
18013
|
* Total and per-day spend. **Values are in cents.**
|
|
17995
|
-
* @param opts - Workspace slug, time window and
|
|
18014
|
+
* @param opts - Workspace slug, time window and verified trace, metadata, list and range filters.
|
|
17996
18015
|
* @returns Cost series plus the period total, in cents.
|
|
17997
18016
|
* @example
|
|
17998
18017
|
* ```ts
|
|
@@ -18013,7 +18032,7 @@ var AIGatewayTelemetryClient = class {
|
|
|
18013
18032
|
}
|
|
18014
18033
|
/**
|
|
18015
18034
|
* Per-day request counts.
|
|
18016
|
-
* @param opts - Workspace slug, time window and
|
|
18035
|
+
* @param opts - Workspace slug, time window and verified trace, metadata, list and range filters.
|
|
18017
18036
|
* @returns Request-count series plus the filtered period total.
|
|
18018
18037
|
* @example
|
|
18019
18038
|
* ```ts
|
|
@@ -18034,7 +18053,7 @@ var AIGatewayTelemetryClient = class {
|
|
|
18034
18053
|
}
|
|
18035
18054
|
/**
|
|
18036
18055
|
* Latency in milliseconds. Percentiles are returned per-bucket and for the period.
|
|
18037
|
-
* @param opts - Workspace slug, time window and
|
|
18056
|
+
* @param opts - Workspace slug, time window and verified trace, metadata, list and range filters.
|
|
18038
18057
|
* @returns Latency series with p50/p90/p99; `data.total` is the period mean, not a sum.
|
|
18039
18058
|
* The period mean and percentiles are null when the cohort has no matching requests.
|
|
18040
18059
|
* @example
|
|
@@ -18056,7 +18075,7 @@ var AIGatewayTelemetryClient = class {
|
|
|
18056
18075
|
}
|
|
18057
18076
|
/**
|
|
18058
18077
|
* Token usage, split into request and response units.
|
|
18059
|
-
* @param opts - Workspace slug, time window and
|
|
18078
|
+
* @param opts - Workspace slug, time window and verified trace, metadata, list and range filters.
|
|
18060
18079
|
* @returns Token series plus request/response unit totals.
|
|
18061
18080
|
* @example
|
|
18062
18081
|
* ```ts
|
|
@@ -22627,6 +22646,7 @@ function setDottedValue(input, path, value2) {
|
|
|
22627
22646
|
0 && (module.exports = {
|
|
22628
22647
|
AIGatewayApiKeysClient,
|
|
22629
22648
|
AIGatewayAuditLogsClient,
|
|
22649
|
+
AIGatewayChartFiltersSchema,
|
|
22630
22650
|
AIGatewayClient,
|
|
22631
22651
|
AIGatewayConfigsClient,
|
|
22632
22652
|
AIGatewayDeploymentsClient,
|