@cdot65/prisma-airs-sdk 0.11.0 → 0.12.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.js CHANGED
@@ -29,7 +29,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
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.11.0";
32
+ var SDK_VERSION = "0.12.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";
@@ -58,6 +58,7 @@ var MGMT_OAUTH_INVALIDATE_PATH = "/v1/mgmt/oauth/invalidateToken";
58
58
  var MGMT_OAUTH_TOKEN_PATH = "/v1/mgmt/oauth/client_credential/accesstoken";
59
59
  var MGMT_DASHBOARD_APPLICATION_PATH = "/v1/mgmt/dashboard/v2/apps/application";
60
60
  var MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH = "/v1/mgmt/dashboard/v2/apps/applicationviolationbreakdown";
61
+ var MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH = "/v1/mgmt/dashboard/v2/apps/applicationsoverview";
61
62
  var DEFAULT_DLP_ENDPOINT = "https://api.dlp.paloaltonetworks.com";
62
63
  var DLP_DATA_FILTERING_PROFILES_PATH = "/v2/api/data-filtering-profiles";
63
64
  var DLP_DATA_PATTERNS_PATH = "/v2/api/data-patterns";
@@ -1510,6 +1511,31 @@ var DashboardApplicationViolationBreakdownSchema = z21.object({
1510
1511
  detection_type_violation_breakdown: z21.array(DetectorViolationBreakdownEntrySchema).optional(),
1511
1512
  total_violating: z21.number().optional()
1512
1513
  }).passthrough();
1514
+ var DashboardApplicationSessionsBucketSchema = z21.object({
1515
+ bucket_number: z21.number().optional(),
1516
+ date: z21.string().nullable().optional(),
1517
+ total: z21.number().optional(),
1518
+ violated: z21.number().optional()
1519
+ }).passthrough();
1520
+ var DashboardApplicationsOverviewItemSchema = z21.object({
1521
+ id: z21.string().nullable().optional(),
1522
+ name: z21.string().nullable().optional(),
1523
+ cloud: z21.string().nullable().optional(),
1524
+ source: z21.string().nullable().optional(),
1525
+ created_at: z21.string().nullable().optional(),
1526
+ sessions: z21.array(DashboardApplicationSessionsBucketSchema).nullable().optional(),
1527
+ sessions_total: z21.number().nullable().optional(),
1528
+ sessions_violated: z21.number().nullable().optional()
1529
+ }).passthrough();
1530
+ var DashboardPaginationSchema = z21.object({
1531
+ limit: z21.number().optional(),
1532
+ skip: z21.number().optional(),
1533
+ total_items: z21.number().optional()
1534
+ }).passthrough();
1535
+ var DashboardApplicationsOverviewSchema = z21.object({
1536
+ items: z21.array(DashboardApplicationsOverviewItemSchema).optional(),
1537
+ pagination: DashboardPaginationSchema.optional()
1538
+ }).passthrough();
1513
1539
 
1514
1540
  // src/models/mgmt-deployment-profile.ts
1515
1541
  import { z as z22 } from "zod";
@@ -4855,6 +4881,53 @@ var DashboardClient = class {
4855
4881
  numRetries: this.numRetries
4856
4882
  });
4857
4883
  }
4884
+ /**
4885
+ * Enumerate all dashboard application buckets the tenant has data for.
4886
+ *
4887
+ * This is the canonical apps-list source for the dashboard. The customer-apps endpoint
4888
+ * (`mgmt.customerApps.list`) lists registered customer applications, but each registered
4889
+ * customer-app can have **multiple dashboard buckets** when its API key is used to send scan
4890
+ * requests carrying different `metadata.app_name` values - one bucket per distinct
4891
+ * scan-payload name. This endpoint returns every bucket, so it is what you want for
4892
+ * per-app token-consumption reporting and dashboard inventory.
4893
+ *
4894
+ * The `id` field on each item is the registered `customer_appId` UUID; the `name` field is
4895
+ * the scan-payload value. Pass that `(id, name)` pair to {@link application} or
4896
+ * {@link applicationViolationBreakdown} to retrieve drill-down data for a specific bucket.
4897
+ *
4898
+ * @param query - Time window and pagination.
4899
+ * @returns Paginated bucket list plus pagination metadata.
4900
+ * @example
4901
+ * ```ts
4902
+ * import { ManagementClient } from '@cdot65/prisma-airs-sdk';
4903
+ * const mgmt = new ManagementClient();
4904
+ *
4905
+ * const { items } = await mgmt.dashboard.applicationsOverview();
4906
+ * for (const item of items ?? []) {
4907
+ * const overview = await mgmt.dashboard.application({
4908
+ * appId: item.id ?? '',
4909
+ * appName: item.name ?? '',
4910
+ * });
4911
+ * console.log(item.name, overview.token_stats?.monthly_total_tokens);
4912
+ * }
4913
+ * ```
4914
+ */
4915
+ async applicationsOverview(query) {
4916
+ return request({
4917
+ method: "GET",
4918
+ baseUrl: this.baseUrl,
4919
+ path: MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
4920
+ params: {
4921
+ time_interval: String(query?.timeInterval ?? 30),
4922
+ time_unit: query?.timeUnit ?? "days",
4923
+ limit: String(query?.limit ?? 25),
4924
+ offset: String(query?.offset ?? 0)
4925
+ },
4926
+ responseSchema: DashboardApplicationsOverviewSchema,
4927
+ auth: this.auth,
4928
+ numRetries: this.numRetries
4929
+ });
4930
+ }
4858
4931
  };
4859
4932
 
4860
4933
  // src/management/dlp/data-filtering-profiles.ts
@@ -8722,9 +8795,13 @@ export {
8722
8795
  DSDetailResultSchema,
8723
8796
  DSResultMetadataSchema,
8724
8797
  DashboardApplicationSchema,
8798
+ DashboardApplicationSessionsBucketSchema,
8725
8799
  DashboardApplicationViolationBreakdownSchema,
8800
+ DashboardApplicationsOverviewItemSchema,
8801
+ DashboardApplicationsOverviewSchema,
8726
8802
  DashboardClient,
8727
8803
  DashboardOverviewResponseSchema,
8804
+ DashboardPaginationSchema,
8728
8805
  DashboardSessionStatsSchema,
8729
8806
  DataFilteringDetailsSchema,
8730
8807
  DataFilteringProfileRequestSchema,
@@ -8875,6 +8952,7 @@ export {
8875
8952
  MGMT_CLIENT_SECRET,
8876
8953
  MGMT_CUSTOMER_APPS_TSG_PATH,
8877
8954
  MGMT_CUSTOMER_APP_PATH,
8955
+ MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
8878
8956
  MGMT_DASHBOARD_APPLICATION_PATH,
8879
8957
  MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH,
8880
8958
  MGMT_DEPLOYMENT_PROFILES_PATH,