@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.cjs +84 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +475 -8
- package/dist/index.d.ts +475 -8
- package/dist/index.js +79 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -121,9 +121,13 @@ __export(index_exports, {
|
|
|
121
121
|
DSDetailResultSchema: () => DSDetailResultSchema,
|
|
122
122
|
DSResultMetadataSchema: () => DSResultMetadataSchema,
|
|
123
123
|
DashboardApplicationSchema: () => DashboardApplicationSchema,
|
|
124
|
+
DashboardApplicationSessionsBucketSchema: () => DashboardApplicationSessionsBucketSchema,
|
|
124
125
|
DashboardApplicationViolationBreakdownSchema: () => DashboardApplicationViolationBreakdownSchema,
|
|
126
|
+
DashboardApplicationsOverviewItemSchema: () => DashboardApplicationsOverviewItemSchema,
|
|
127
|
+
DashboardApplicationsOverviewSchema: () => DashboardApplicationsOverviewSchema,
|
|
125
128
|
DashboardClient: () => DashboardClient,
|
|
126
129
|
DashboardOverviewResponseSchema: () => DashboardOverviewResponseSchema,
|
|
130
|
+
DashboardPaginationSchema: () => DashboardPaginationSchema,
|
|
127
131
|
DashboardSessionStatsSchema: () => DashboardSessionStatsSchema,
|
|
128
132
|
DataFilteringDetailsSchema: () => DataFilteringDetailsSchema,
|
|
129
133
|
DataFilteringProfileRequestSchema: () => DataFilteringProfileRequestSchema,
|
|
@@ -274,6 +278,7 @@ __export(index_exports, {
|
|
|
274
278
|
MGMT_CLIENT_SECRET: () => MGMT_CLIENT_SECRET,
|
|
275
279
|
MGMT_CUSTOMER_APPS_TSG_PATH: () => MGMT_CUSTOMER_APPS_TSG_PATH,
|
|
276
280
|
MGMT_CUSTOMER_APP_PATH: () => MGMT_CUSTOMER_APP_PATH,
|
|
281
|
+
MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH: () => MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
|
|
277
282
|
MGMT_DASHBOARD_APPLICATION_PATH: () => MGMT_DASHBOARD_APPLICATION_PATH,
|
|
278
283
|
MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH: () => MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH,
|
|
279
284
|
MGMT_DEPLOYMENT_PROFILES_PATH: () => MGMT_DEPLOYMENT_PROFILES_PATH,
|
|
@@ -563,7 +568,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
563
568
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
564
569
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
565
570
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
566
|
-
var SDK_VERSION = "0.
|
|
571
|
+
var SDK_VERSION = "0.12.0";
|
|
567
572
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
568
573
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
569
574
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -592,6 +597,7 @@ var MGMT_OAUTH_INVALIDATE_PATH = "/v1/mgmt/oauth/invalidateToken";
|
|
|
592
597
|
var MGMT_OAUTH_TOKEN_PATH = "/v1/mgmt/oauth/client_credential/accesstoken";
|
|
593
598
|
var MGMT_DASHBOARD_APPLICATION_PATH = "/v1/mgmt/dashboard/v2/apps/application";
|
|
594
599
|
var MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH = "/v1/mgmt/dashboard/v2/apps/applicationviolationbreakdown";
|
|
600
|
+
var MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH = "/v1/mgmt/dashboard/v2/apps/applicationsoverview";
|
|
595
601
|
var DEFAULT_DLP_ENDPOINT = "https://api.dlp.paloaltonetworks.com";
|
|
596
602
|
var DLP_DATA_FILTERING_PROFILES_PATH = "/v2/api/data-filtering-profiles";
|
|
597
603
|
var DLP_DATA_PATTERNS_PATH = "/v2/api/data-patterns";
|
|
@@ -2044,6 +2050,31 @@ var DashboardApplicationViolationBreakdownSchema = import_zod21.z.object({
|
|
|
2044
2050
|
detection_type_violation_breakdown: import_zod21.z.array(DetectorViolationBreakdownEntrySchema).optional(),
|
|
2045
2051
|
total_violating: import_zod21.z.number().optional()
|
|
2046
2052
|
}).passthrough();
|
|
2053
|
+
var DashboardApplicationSessionsBucketSchema = import_zod21.z.object({
|
|
2054
|
+
bucket_number: import_zod21.z.number().optional(),
|
|
2055
|
+
date: import_zod21.z.string().nullable().optional(),
|
|
2056
|
+
total: import_zod21.z.number().optional(),
|
|
2057
|
+
violated: import_zod21.z.number().optional()
|
|
2058
|
+
}).passthrough();
|
|
2059
|
+
var DashboardApplicationsOverviewItemSchema = import_zod21.z.object({
|
|
2060
|
+
id: import_zod21.z.string().nullable().optional(),
|
|
2061
|
+
name: import_zod21.z.string().nullable().optional(),
|
|
2062
|
+
cloud: import_zod21.z.string().nullable().optional(),
|
|
2063
|
+
source: import_zod21.z.string().nullable().optional(),
|
|
2064
|
+
created_at: import_zod21.z.string().nullable().optional(),
|
|
2065
|
+
sessions: import_zod21.z.array(DashboardApplicationSessionsBucketSchema).nullable().optional(),
|
|
2066
|
+
sessions_total: import_zod21.z.number().nullable().optional(),
|
|
2067
|
+
sessions_violated: import_zod21.z.number().nullable().optional()
|
|
2068
|
+
}).passthrough();
|
|
2069
|
+
var DashboardPaginationSchema = import_zod21.z.object({
|
|
2070
|
+
limit: import_zod21.z.number().optional(),
|
|
2071
|
+
skip: import_zod21.z.number().optional(),
|
|
2072
|
+
total_items: import_zod21.z.number().optional()
|
|
2073
|
+
}).passthrough();
|
|
2074
|
+
var DashboardApplicationsOverviewSchema = import_zod21.z.object({
|
|
2075
|
+
items: import_zod21.z.array(DashboardApplicationsOverviewItemSchema).optional(),
|
|
2076
|
+
pagination: DashboardPaginationSchema.optional()
|
|
2077
|
+
}).passthrough();
|
|
2047
2078
|
|
|
2048
2079
|
// src/models/mgmt-deployment-profile.ts
|
|
2049
2080
|
var import_zod22 = require("zod");
|
|
@@ -5389,6 +5420,53 @@ var DashboardClient = class {
|
|
|
5389
5420
|
numRetries: this.numRetries
|
|
5390
5421
|
});
|
|
5391
5422
|
}
|
|
5423
|
+
/**
|
|
5424
|
+
* Enumerate all dashboard application buckets the tenant has data for.
|
|
5425
|
+
*
|
|
5426
|
+
* This is the canonical apps-list source for the dashboard. The customer-apps endpoint
|
|
5427
|
+
* (`mgmt.customerApps.list`) lists registered customer applications, but each registered
|
|
5428
|
+
* customer-app can have **multiple dashboard buckets** when its API key is used to send scan
|
|
5429
|
+
* requests carrying different `metadata.app_name` values - one bucket per distinct
|
|
5430
|
+
* scan-payload name. This endpoint returns every bucket, so it is what you want for
|
|
5431
|
+
* per-app token-consumption reporting and dashboard inventory.
|
|
5432
|
+
*
|
|
5433
|
+
* The `id` field on each item is the registered `customer_appId` UUID; the `name` field is
|
|
5434
|
+
* the scan-payload value. Pass that `(id, name)` pair to {@link application} or
|
|
5435
|
+
* {@link applicationViolationBreakdown} to retrieve drill-down data for a specific bucket.
|
|
5436
|
+
*
|
|
5437
|
+
* @param query - Time window and pagination.
|
|
5438
|
+
* @returns Paginated bucket list plus pagination metadata.
|
|
5439
|
+
* @example
|
|
5440
|
+
* ```ts
|
|
5441
|
+
* import { ManagementClient } from '@cdot65/prisma-airs-sdk';
|
|
5442
|
+
* const mgmt = new ManagementClient();
|
|
5443
|
+
*
|
|
5444
|
+
* const { items } = await mgmt.dashboard.applicationsOverview();
|
|
5445
|
+
* for (const item of items ?? []) {
|
|
5446
|
+
* const overview = await mgmt.dashboard.application({
|
|
5447
|
+
* appId: item.id ?? '',
|
|
5448
|
+
* appName: item.name ?? '',
|
|
5449
|
+
* });
|
|
5450
|
+
* console.log(item.name, overview.token_stats?.monthly_total_tokens);
|
|
5451
|
+
* }
|
|
5452
|
+
* ```
|
|
5453
|
+
*/
|
|
5454
|
+
async applicationsOverview(query) {
|
|
5455
|
+
return request({
|
|
5456
|
+
method: "GET",
|
|
5457
|
+
baseUrl: this.baseUrl,
|
|
5458
|
+
path: MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
|
|
5459
|
+
params: {
|
|
5460
|
+
time_interval: String(query?.timeInterval ?? 30),
|
|
5461
|
+
time_unit: query?.timeUnit ?? "days",
|
|
5462
|
+
limit: String(query?.limit ?? 25),
|
|
5463
|
+
offset: String(query?.offset ?? 0)
|
|
5464
|
+
},
|
|
5465
|
+
responseSchema: DashboardApplicationsOverviewSchema,
|
|
5466
|
+
auth: this.auth,
|
|
5467
|
+
numRetries: this.numRetries
|
|
5468
|
+
});
|
|
5469
|
+
}
|
|
5392
5470
|
};
|
|
5393
5471
|
|
|
5394
5472
|
// src/management/dlp/data-filtering-profiles.ts
|
|
@@ -9257,9 +9335,13 @@ var RedTeamClient = class {
|
|
|
9257
9335
|
DSDetailResultSchema,
|
|
9258
9336
|
DSResultMetadataSchema,
|
|
9259
9337
|
DashboardApplicationSchema,
|
|
9338
|
+
DashboardApplicationSessionsBucketSchema,
|
|
9260
9339
|
DashboardApplicationViolationBreakdownSchema,
|
|
9340
|
+
DashboardApplicationsOverviewItemSchema,
|
|
9341
|
+
DashboardApplicationsOverviewSchema,
|
|
9261
9342
|
DashboardClient,
|
|
9262
9343
|
DashboardOverviewResponseSchema,
|
|
9344
|
+
DashboardPaginationSchema,
|
|
9263
9345
|
DashboardSessionStatsSchema,
|
|
9264
9346
|
DataFilteringDetailsSchema,
|
|
9265
9347
|
DataFilteringProfileRequestSchema,
|
|
@@ -9410,6 +9492,7 @@ var RedTeamClient = class {
|
|
|
9410
9492
|
MGMT_CLIENT_SECRET,
|
|
9411
9493
|
MGMT_CUSTOMER_APPS_TSG_PATH,
|
|
9412
9494
|
MGMT_CUSTOMER_APP_PATH,
|
|
9495
|
+
MGMT_DASHBOARD_APPLICATIONS_OVERVIEW_PATH,
|
|
9413
9496
|
MGMT_DASHBOARD_APPLICATION_PATH,
|
|
9414
9497
|
MGMT_DASHBOARD_APPLICATION_VIOLATION_BREAKDOWN_PATH,
|
|
9415
9498
|
MGMT_DEPLOYMENT_PROFILES_PATH,
|