@cdot65/prisma-airs-sdk 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1357,7 +1357,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 20;
1357
1357
  var MAX_CONNECTION_POOL_SIZE = 100;
1358
1358
  var MAX_NUMBER_OF_RETRIES = 5;
1359
1359
  var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
1360
- var SDK_VERSION = "0.22.0";
1360
+ var SDK_VERSION = "0.23.0";
1361
1361
  var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
1362
1362
  var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
1363
1363
  var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
@@ -6343,10 +6343,10 @@ var LatencyChartResponseSchema = aiGatewayEnvelope(
6343
6343
  p99: import_zod42.z.number()
6344
6344
  }).passthrough()
6345
6345
  ),
6346
- total: import_zod42.z.number(),
6347
- p50: import_zod42.z.number(),
6348
- p90: import_zod42.z.number(),
6349
- p99: import_zod42.z.number(),
6346
+ total: import_zod42.z.number().nullable(),
6347
+ p50: import_zod42.z.number().nullable(),
6348
+ p90: import_zod42.z.number().nullable(),
6349
+ p99: import_zod42.z.number().nullable(),
6350
6350
  ...quotaFlag
6351
6351
  }).passthrough()
6352
6352
  );
@@ -17957,10 +17957,16 @@ var logsOptionsSchema = telemetryWindowSchema.extend({
17957
17957
  traceId: nonBlankString.optional(),
17958
17958
  statusCode: import_zod54.z.number().int().nonnegative().safe().optional()
17959
17959
  }).strict();
17960
- var requestChartOptionsSchema = telemetryWindowSchema.extend({
17960
+ var filteredChartOptionsSchema = telemetryWindowSchema.extend({
17961
17961
  traceId: nonBlankString.optional(),
17962
17962
  metadata: GatewayJsonObjectSchema.pipe(import_zod54.z.record(import_zod54.z.string())).optional()
17963
17963
  }).strict();
17964
+ function serializeChartOptions(tsgId, opts) {
17965
+ const params = serializeWindow(tsgId, opts, filteredChartOptionsSchema);
17966
+ if (opts.traceId !== void 0) params.traceId = opts.traceId;
17967
+ if (opts.metadata !== void 0) params.metadata = JSON.stringify(opts.metadata);
17968
+ return params;
17969
+ }
17964
17970
  var AIGatewayTelemetryClient = class {
17965
17971
  baseUrl;
17966
17972
  auth;
@@ -17986,7 +17992,7 @@ var AIGatewayTelemetryClient = class {
17986
17992
  }
17987
17993
  /**
17988
17994
  * Total and per-day spend. **Values are in cents.**
17989
- * @param opts - Workspace slug and time window.
17995
+ * @param opts - Workspace slug, time window and optional verified trace/metadata filters.
17990
17996
  * @returns Cost series plus the period total, in cents.
17991
17997
  * @example
17992
17998
  * ```ts
@@ -17998,7 +18004,12 @@ var AIGatewayTelemetryClient = class {
17998
18004
  * ```
17999
18005
  */
18000
18006
  async cost(opts) {
18001
- return this.chart("cost", opts, CostChartResponseSchema);
18007
+ return this.chart(
18008
+ "cost",
18009
+ opts,
18010
+ CostChartResponseSchema,
18011
+ serializeChartOptions(this.tsgId, opts)
18012
+ );
18002
18013
  }
18003
18014
  /**
18004
18015
  * Per-day request counts.
@@ -18014,15 +18025,18 @@ var AIGatewayTelemetryClient = class {
18014
18025
  * ```
18015
18026
  */
18016
18027
  async requests(opts) {
18017
- const params = serializeWindow(this.tsgId, opts, requestChartOptionsSchema);
18018
- if (opts.traceId !== void 0) params.traceId = opts.traceId;
18019
- if (opts.metadata !== void 0) params.metadata = JSON.stringify(opts.metadata);
18020
- return this.chart("requests", opts, CountChartResponseSchema, params);
18028
+ return this.chart(
18029
+ "requests",
18030
+ opts,
18031
+ CountChartResponseSchema,
18032
+ serializeChartOptions(this.tsgId, opts)
18033
+ );
18021
18034
  }
18022
18035
  /**
18023
18036
  * Latency in milliseconds. Percentiles are returned per-bucket and for the period.
18024
- * @param opts - Workspace slug and time window.
18037
+ * @param opts - Workspace slug, time window and optional verified trace/metadata filters.
18025
18038
  * @returns Latency series with p50/p90/p99; `data.total` is the period mean, not a sum.
18039
+ * The period mean and percentiles are null when the cohort has no matching requests.
18026
18040
  * @example
18027
18041
  * ```ts
18028
18042
  * import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
@@ -18033,11 +18047,16 @@ var AIGatewayTelemetryClient = class {
18033
18047
  * ```
18034
18048
  */
18035
18049
  async latency(opts) {
18036
- return this.chart("latency", opts, LatencyChartResponseSchema);
18050
+ return this.chart(
18051
+ "latency",
18052
+ opts,
18053
+ LatencyChartResponseSchema,
18054
+ serializeChartOptions(this.tsgId, opts)
18055
+ );
18037
18056
  }
18038
18057
  /**
18039
18058
  * Token usage, split into request and response units.
18040
- * @param opts - Workspace slug and time window.
18059
+ * @param opts - Workspace slug, time window and optional verified trace/metadata filters.
18041
18060
  * @returns Token series plus request/response unit totals.
18042
18061
  * @example
18043
18062
  * ```ts
@@ -18049,7 +18068,12 @@ var AIGatewayTelemetryClient = class {
18049
18068
  * ```
18050
18069
  */
18051
18070
  async tokens(opts) {
18052
- return this.chart("tokens", opts, TokensChartResponseSchema);
18071
+ return this.chart(
18072
+ "tokens",
18073
+ opts,
18074
+ TokensChartResponseSchema,
18075
+ serializeChartOptions(this.tsgId, opts)
18076
+ );
18053
18077
  }
18054
18078
  /**
18055
18079
  * Per-day error counts.