@cdot65/prisma-airs-sdk 0.6.11 → 0.7.1

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.6.11";
32
+ var SDK_VERSION = "0.7.1";
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";
@@ -89,6 +89,11 @@ var RED_TEAM_QUOTA_PATH = "/v1/metering/quota";
89
89
  var RED_TEAM_ERROR_LOG_PATH = "/v1/error-log/job";
90
90
  var RED_TEAM_SENTIMENT_PATH = "/v1/sentiment";
91
91
  var RED_TEAM_TARGET_PATH = "/v1/target";
92
+ var RED_TEAM_TARGET_VALIDATE_AUTH_PATH = "/v1/target/validate-auth";
93
+ var RED_TEAM_TEMPLATE_PATH = "/v1/template";
94
+ var RED_TEAM_EULA_PATH = "/v1/eula";
95
+ var RED_TEAM_INSTANCES_PATH = "/v1/instances";
96
+ var RED_TEAM_REGISTRY_CREDENTIALS_PATH = "/v1/registry-credentials";
92
97
  var RED_TEAM_CUSTOM_ATTACK_PATH = "/v1/custom-attack";
93
98
  var RED_TEAM_MGMT_DASHBOARD_PATH = "/v1/dashboard/overview";
94
99
 
@@ -1716,6 +1721,15 @@ var AuthType = {
1716
1721
  OAUTH: "OAUTH",
1717
1722
  ACCESS_TOKEN: "ACCESS_TOKEN"
1718
1723
  };
1724
+ var TargetAuthType = {
1725
+ HEADERS: "HEADERS",
1726
+ BASIC_AUTH: "BASIC_AUTH",
1727
+ OAUTH2: "OAUTH2"
1728
+ };
1729
+ var BasicAuthLocation = {
1730
+ HEADER: "HEADER",
1731
+ PAYLOAD: "PAYLOAD"
1732
+ };
1719
1733
  var BrandSubCategory = {
1720
1734
  COMPETITOR_ENDORSEMENTS: "COMPETITOR_ENDORSEMENTS",
1721
1735
  BRAND_TARNISHING_SELF_CRITICISM: "BRAND_TARNISHING_SELF_CRITICISM",
@@ -1871,7 +1885,8 @@ var TargetConnectionType = {
1871
1885
  HUGGING_FACE: "HUGGING_FACE",
1872
1886
  CUSTOM: "CUSTOM",
1873
1887
  REST: "REST",
1874
- STREAMING: "STREAMING"
1888
+ STREAMING: "STREAMING",
1889
+ WEBSOCKET: "WEBSOCKET"
1875
1890
  };
1876
1891
  var TargetStatus = {
1877
1892
  DRAFT: "DRAFT",
@@ -1935,6 +1950,24 @@ var MultiTurnStatelessConfigSchema = z25.object({
1935
1950
  type: z25.string().default("stateless"),
1936
1951
  assistant_role: z25.string().nullable().optional()
1937
1952
  }).passthrough();
1953
+ var HeadersAuthConfigSchema = z25.object({ auth_header: z25.record(z25.unknown()) }).passthrough();
1954
+ var BasicAuthAuthConfigSchema = z25.object({
1955
+ basic_auth_location: z25.string().default("HEADER"),
1956
+ basic_auth_header: z25.record(z25.unknown()).nullable().optional()
1957
+ }).passthrough();
1958
+ var OAuth2AuthConfigSchema = z25.object({
1959
+ oauth2_token_url: z25.string(),
1960
+ oauth2_expiry_minutes: z25.number().int().default(60),
1961
+ oauth2_headers: z25.record(z25.unknown()).optional(),
1962
+ oauth2_body_params: z25.record(z25.unknown()).optional(),
1963
+ oauth2_token_response_key: z25.string().default("access_token"),
1964
+ oauth2_inject_header: z25.record(z25.unknown())
1965
+ }).passthrough();
1966
+ var AuthConfigSchema = z25.union([
1967
+ HeadersAuthConfigSchema,
1968
+ BasicAuthAuthConfigSchema,
1969
+ OAuth2AuthConfigSchema
1970
+ ]);
1938
1971
  var OpenAIConnectionParamsSchema = z25.object({
1939
1972
  api_key: z25.string(),
1940
1973
  model_name: z25.string()
@@ -1972,7 +2005,11 @@ var StreamingConnectionParamsSchema = RestConnectionParamsSchema.extend({
1972
2005
  response_stop_key: z25.string(),
1973
2006
  response_stop_value: z25.string()
1974
2007
  }).passthrough();
2008
+ var WebSocketConnectionParamsSchema = RestConnectionParamsSchema.extend({
2009
+ ws_response_timeout: z25.number().default(110)
2010
+ }).passthrough();
1975
2011
  var ConnectionParamsSchema = z25.union([
2012
+ WebSocketConnectionParamsSchema,
1976
2013
  StreamingConnectionParamsSchema,
1977
2014
  RestConnectionParamsSchema
1978
2015
  ]);
@@ -2077,7 +2114,8 @@ var TargetReferenceSchema = z25.object({
2077
2114
  target_metadata: TargetMetadataSchema.optional(),
2078
2115
  target_background: TargetBackgroundSchema.nullable().optional(),
2079
2116
  profiling_status: z25.string().nullable().optional(),
2080
- additional_context: TargetAdditionalContextSchema.nullable().optional()
2117
+ additional_context: TargetAdditionalContextSchema.nullable().optional(),
2118
+ auth_type: z25.string().nullable().optional()
2081
2119
  }).passthrough();
2082
2120
  var JobResponseSchema = z25.object({
2083
2121
  uuid: z25.string(),
@@ -2521,39 +2559,26 @@ var ErrorLogSchema = z25.object({
2521
2559
  version: z25.number().int().optional()
2522
2560
  }).passthrough();
2523
2561
  var ErrorLogListResponseSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(ErrorLogSchema) }).passthrough();
2524
- var TargetCreateRequestSchema = z25.object({
2562
+ var TargetRequestBaseFields = {
2525
2563
  name: z25.string(),
2526
- description: z25.unknown().optional(),
2527
- target_type: z25.unknown().optional(),
2528
- connection_type: z25.unknown().optional(),
2529
- api_endpoint_type: z25.unknown().optional(),
2530
- response_mode: z25.unknown().optional(),
2531
- connection_params: z25.unknown().optional(),
2532
- session_supported: z25.boolean().optional(),
2533
- target_metadata: z25.unknown().optional(),
2534
- target_background: z25.unknown().optional(),
2535
- additional_context: z25.unknown().optional(),
2536
- extra_info: z25.unknown().optional(),
2537
- network_broker_channel_uuid: z25.unknown().optional()
2538
- }).passthrough();
2539
- var TargetUpdateRequestSchema = z25.object({
2540
- name: z25.string(),
2541
- description: z25.unknown().optional(),
2542
- target_type: z25.unknown().optional(),
2543
- connection_type: z25.unknown().optional(),
2544
- api_endpoint_type: z25.unknown().optional(),
2545
- response_mode: z25.unknown().optional(),
2546
- connection_params: z25.unknown().optional(),
2564
+ description: z25.string().nullable().optional(),
2565
+ target_type: z25.string().nullable().optional(),
2566
+ connection_type: z25.string().nullable().optional(),
2567
+ api_endpoint_type: z25.string().nullable().optional(),
2568
+ response_mode: z25.string().nullable().optional(),
2569
+ connection_params: z25.union([RestConnectionParamsSchema, StreamingConnectionParamsSchema]).nullable().optional(),
2547
2570
  session_supported: z25.boolean().optional(),
2548
- target_metadata: z25.unknown().optional(),
2549
- target_background: z25.unknown().optional(),
2550
- additional_context: z25.unknown().optional(),
2551
- extra_info: z25.unknown().optional(),
2552
- network_broker_channel_uuid: z25.unknown().optional()
2553
- }).passthrough();
2571
+ target_metadata: TargetMetadataSchema.optional(),
2572
+ target_background: TargetBackgroundSchema.nullable().optional(),
2573
+ additional_context: TargetAdditionalContextSchema.nullable().optional(),
2574
+ extra_info: z25.record(z25.unknown()).nullable().optional(),
2575
+ network_broker_channel_uuid: z25.string().nullable().optional()
2576
+ };
2577
+ var TargetCreateRequestSchema = z25.object(TargetRequestBaseFields).strict();
2578
+ var TargetUpdateRequestSchema = z25.object(TargetRequestBaseFields).strict();
2554
2579
  var TargetContextUpdateSchema = z25.object({
2555
- target_background: z25.unknown().optional(),
2556
- additional_context: z25.unknown().optional()
2580
+ target_background: TargetBackgroundSchema.nullable().optional(),
2581
+ additional_context: TargetAdditionalContextSchema.nullable().optional()
2557
2582
  }).passthrough();
2558
2583
  var TargetResponseSchema = z25.object({
2559
2584
  uuid: z25.string(),
@@ -2578,7 +2603,8 @@ var TargetResponseSchema = z25.object({
2578
2603
  target_metadata: z25.unknown().optional(),
2579
2604
  target_background: z25.unknown().optional(),
2580
2605
  profiling_status: z25.unknown().optional(),
2581
- additional_context: z25.unknown().optional()
2606
+ additional_context: z25.unknown().optional(),
2607
+ auth_type: z25.string().nullable().optional()
2582
2608
  }).passthrough();
2583
2609
  var TargetListItemSchema = z25.object({
2584
2610
  uuid: z25.string(),
@@ -2599,25 +2625,25 @@ var TargetListItemSchema = z25.object({
2599
2625
  version: z25.unknown().optional(),
2600
2626
  secret_version: z25.unknown().optional(),
2601
2627
  created_by_user_id: z25.unknown().optional(),
2602
- updated_by_user_id: z25.unknown().optional()
2628
+ updated_by_user_id: z25.unknown().optional(),
2629
+ auth_type: z25.string().nullable().optional()
2603
2630
  }).passthrough();
2604
2631
  var TargetListSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(TargetListItemSchema).optional() }).passthrough();
2605
2632
  var TargetProbeRequestSchema = z25.object({
2606
- name: z25.string(),
2607
- uuid: z25.unknown().optional(),
2608
- description: z25.unknown().optional(),
2609
- target_type: z25.unknown().optional(),
2610
- connection_type: z25.unknown().optional(),
2611
- api_endpoint_type: z25.unknown().optional(),
2612
- response_mode: z25.unknown().optional(),
2613
- connection_params: z25.unknown().optional(),
2614
- session_supported: z25.boolean().optional(),
2615
- target_metadata: z25.unknown().optional(),
2616
- target_background: z25.unknown().optional(),
2617
- additional_context: z25.unknown().optional(),
2618
- extra_info: z25.unknown().optional(),
2619
- network_broker_channel_uuid: z25.unknown().optional(),
2620
- probe_fields: z25.unknown().optional()
2633
+ ...TargetRequestBaseFields,
2634
+ uuid: z25.string().nullable().optional(),
2635
+ probe_fields: z25.array(z25.string()).nullable().optional()
2636
+ }).strict();
2637
+ var TargetAuthValidationRequestSchema = z25.object({
2638
+ auth_type: z25.string(),
2639
+ auth_config: z25.unknown(),
2640
+ target_id: z25.string().nullable().optional(),
2641
+ network_broker_channel_uuid: z25.string().nullable().optional()
2642
+ }).passthrough();
2643
+ var TargetAuthValidationResponseSchema = z25.object({
2644
+ validated: z25.boolean(),
2645
+ token_preview: z25.string().nullable().optional(),
2646
+ expires_in: z25.number().int().nullable().optional()
2621
2647
  }).passthrough();
2622
2648
  var TargetProfileResponseSchema = z25.object({
2623
2649
  target_id: z25.string(),
@@ -2629,6 +2655,15 @@ var TargetProfileResponseSchema = z25.object({
2629
2655
  ai_generated_fields: z25.unknown().optional(),
2630
2656
  other_details: z25.unknown().optional()
2631
2657
  }).passthrough();
2658
+ var TargetTemplateCollectionSchema = z25.object({
2659
+ OPENAI: z25.record(z25.unknown()),
2660
+ HUGGING_FACE: z25.record(z25.unknown()),
2661
+ DATABRICKS: z25.record(z25.unknown()),
2662
+ BEDROCK: z25.record(z25.unknown()),
2663
+ REST: z25.record(z25.unknown()),
2664
+ STREAMING: z25.record(z25.unknown()),
2665
+ WEBSOCKET: z25.record(z25.unknown())
2666
+ }).passthrough();
2632
2667
  var BaseResponseSchema = z25.object({
2633
2668
  message: z25.string(),
2634
2669
  status: z25.number().int()
@@ -2686,7 +2721,6 @@ var CustomPromptSetListSchema = z25.object({
2686
2721
  pagination: RedTeamPaginationSchema,
2687
2722
  data: z25.array(CustomPromptSetListItemSchema).optional()
2688
2723
  }).passthrough();
2689
- var CustomPromptSetListActiveSchema = z25.object({ data: z25.array(CustomPromptSetListItemSchema).optional() }).passthrough();
2690
2724
  var CustomPromptSetReferenceSchema = z25.object({
2691
2725
  uuid: z25.string(),
2692
2726
  name: z25.string(),
@@ -2697,6 +2731,7 @@ var CustomPromptSetReferenceSchema = z25.object({
2697
2731
  updated_at: z25.string(),
2698
2732
  version: z25.unknown().optional()
2699
2733
  }).passthrough();
2734
+ var CustomPromptSetListActiveSchema = z25.object({ data: z25.array(CustomPromptSetReferenceSchema).optional() }).passthrough();
2700
2735
  var CustomPromptSetVersionInfoSchema = z25.object({
2701
2736
  uuid: z25.string(),
2702
2737
  status: z25.string(),
@@ -2756,7 +2791,7 @@ var PropertyDefinitionSchema = z25.object({
2756
2791
  property_name: z25.string(),
2757
2792
  created_at: z25.string()
2758
2793
  }).passthrough();
2759
- var PropertyNamesListResponseSchema = z25.object({ data: z25.array(PropertyDefinitionSchema).optional() }).passthrough();
2794
+ var PropertyNamesListResponseSchema = z25.object({ data: z25.array(z25.string()).optional() }).passthrough();
2760
2795
  var PropertyValuesResponseSchema = z25.object({
2761
2796
  name: z25.string(),
2762
2797
  values: z25.array(z25.string()).optional()
@@ -2766,6 +2801,117 @@ var DashboardOverviewResponseSchema = z25.object({
2766
2801
  total_targets: z25.number().int(),
2767
2802
  targets_by_type: z25.array(CountByNameSchema).optional()
2768
2803
  }).passthrough();
2804
+ var EulaAcceptRequestSchema = z25.object({
2805
+ eula_content: z25.string(),
2806
+ accepted_at: z25.string().nullable().optional()
2807
+ }).passthrough();
2808
+ var EulaContentResponseSchema = z25.object({
2809
+ content: z25.string()
2810
+ }).passthrough();
2811
+ var EulaResponseSchema = z25.object({
2812
+ uuid: z25.string().nullable().optional(),
2813
+ is_accepted: z25.boolean(),
2814
+ accepted_at: z25.string().nullable().optional(),
2815
+ accepted_by_user_id: z25.string().nullable().optional()
2816
+ }).passthrough();
2817
+ var DeviceInstanceSchema = z25.object({
2818
+ app_id: z25.string(),
2819
+ region: z25.string(),
2820
+ tenant_id: z25.string(),
2821
+ tsg_id: z25.string()
2822
+ }).passthrough();
2823
+ var DeviceLicenseSchema = z25.object({
2824
+ authorizationCode: z25.string().optional(),
2825
+ expirationDate: z25.string().optional(),
2826
+ licensePanDbIdentification: z25.string().optional(),
2827
+ partNumber: z25.string().optional(),
2828
+ serialNumber: z25.string().optional(),
2829
+ subtypeName: z25.string().optional(),
2830
+ registrationDate: z25.string().optional()
2831
+ }).passthrough();
2832
+ var DeviceSchema = z25.object({
2833
+ serial_number: z25.string(),
2834
+ model: z25.string().optional(),
2835
+ sku: z25.string().optional(),
2836
+ device_type: z25.string().optional(),
2837
+ device_name: z25.string().optional(),
2838
+ tsg_id: z25.string().optional(),
2839
+ support_account_id: z25.string().optional(),
2840
+ asset_type: z25.string().optional(),
2841
+ licenses: z25.array(DeviceLicenseSchema).optional()
2842
+ }).passthrough();
2843
+ var DeviceStatusSchema = z25.object({
2844
+ status: z25.string(),
2845
+ error: z25.string().optional(),
2846
+ serial_number: z25.string().optional()
2847
+ }).passthrough();
2848
+ var DeviceRequestSchema = z25.object({
2849
+ instance: DeviceInstanceSchema,
2850
+ created_by: z25.string().optional(),
2851
+ devices: z25.array(DeviceSchema).optional()
2852
+ }).passthrough();
2853
+ var DeviceResponseSchema = z25.object({
2854
+ devices: z25.array(DeviceStatusSchema).optional(),
2855
+ status: z25.string().optional()
2856
+ }).passthrough();
2857
+ var DeploymentProfileAttributeSchema = z25.object({
2858
+ quantity: z25.number().optional(),
2859
+ unit_of_measure: z25.string().optional()
2860
+ }).passthrough();
2861
+ var DeploymentProfileRequestSchema = z25.object({
2862
+ dAuthCode: z25.string().optional(),
2863
+ deploymentProfileId: z25.string().optional(),
2864
+ license_expiration: z25.string().optional(),
2865
+ profileName: z25.string().optional(),
2866
+ subType: z25.string().optional(),
2867
+ subscriptions: z25.string().optional(),
2868
+ type: z25.string().optional(),
2869
+ aveTextRecord: z25.number().default(0),
2870
+ attributes: z25.array(DeploymentProfileAttributeSchema).optional()
2871
+ }).passthrough();
2872
+ var InstanceExtraDetailsSchema = z25.object({
2873
+ deployment_profiles: z25.array(DeploymentProfileRequestSchema).optional(),
2874
+ airs_shared_by_tsg: z25.string().optional(),
2875
+ airs_unshared_dps: z25.string().optional()
2876
+ }).passthrough();
2877
+ var InstanceRequestSchema = z25.object({
2878
+ tsg_id: z25.string(),
2879
+ tenant_id: z25.string(),
2880
+ app_id: z25.string(),
2881
+ region: z25.string(),
2882
+ support_account_id: z25.string().optional(),
2883
+ support_account_name: z25.string().optional(),
2884
+ created_by: z25.string().optional(),
2885
+ internal: z25.boolean().optional(),
2886
+ tenant_instance_name: z25.string().optional(),
2887
+ extra: InstanceExtraDetailsSchema.optional(),
2888
+ iam_controlled: z25.boolean().optional(),
2889
+ platform_region: z25.string().optional(),
2890
+ csp_tenant_id: z25.string().optional(),
2891
+ tsg_instances: z25.unknown().optional()
2892
+ }).passthrough();
2893
+ var InstanceResponseSchema = z25.object({
2894
+ tsg_id: z25.string(),
2895
+ tenant_id: z25.string().optional(),
2896
+ app_id: z25.string().optional(),
2897
+ is_success: z25.boolean().optional()
2898
+ }).passthrough();
2899
+ var InstanceGetResponseSchema = z25.object({
2900
+ tsg_id: z25.string(),
2901
+ tenant_id: z25.string(),
2902
+ app_id: z25.string(),
2903
+ region: z25.string(),
2904
+ support_account_id: z25.string().optional(),
2905
+ support_account_name: z25.string().optional(),
2906
+ created_by: z25.string().optional(),
2907
+ internal: z25.boolean().optional(),
2908
+ tenant_instance_name: z25.string().optional(),
2909
+ deployment_profiles: z25.array(DeploymentProfileRequestSchema).optional()
2910
+ }).passthrough();
2911
+ var RegistryCredentialsSchema = z25.object({
2912
+ token: z25.string(),
2913
+ expiry: z25.string()
2914
+ }).passthrough();
2769
2915
 
2770
2916
  // src/models/oauth-token.ts
2771
2917
  import { z as z26 } from "zod";
@@ -5028,6 +5174,50 @@ var RedTeamTargetsClient = class {
5028
5174
  });
5029
5175
  return res.data;
5030
5176
  }
5177
+ /**
5178
+ * Validate target authentication credentials.
5179
+ * @param request - The auth validation request body.
5180
+ * @returns The auth validation response.
5181
+ */
5182
+ async validateAuth(request) {
5183
+ const res = await managementHttpRequest({
5184
+ method: "POST",
5185
+ baseUrl: this.baseUrl,
5186
+ path: RED_TEAM_TARGET_VALIDATE_AUTH_PATH,
5187
+ body: request,
5188
+ oauthClient: this.oauthClient,
5189
+ numRetries: this.numRetries
5190
+ });
5191
+ return res.data;
5192
+ }
5193
+ /**
5194
+ * Get target metadata (field definitions for target configuration).
5195
+ * @returns The target metadata object.
5196
+ */
5197
+ async getTargetMetadata() {
5198
+ const res = await managementHttpRequest({
5199
+ method: "GET",
5200
+ baseUrl: this.baseUrl,
5201
+ path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
5202
+ oauthClient: this.oauthClient,
5203
+ numRetries: this.numRetries
5204
+ });
5205
+ return res.data;
5206
+ }
5207
+ /**
5208
+ * Get target templates for all supported provider types.
5209
+ * @returns The collection of target templates keyed by provider.
5210
+ */
5211
+ async getTargetTemplates() {
5212
+ const res = await managementHttpRequest({
5213
+ method: "GET",
5214
+ baseUrl: this.baseUrl,
5215
+ path: `${RED_TEAM_TEMPLATE_PATH}/target-templates`,
5216
+ oauthClient: this.oauthClient,
5217
+ numRetries: this.numRetries
5218
+ });
5219
+ return res.data;
5220
+ }
5031
5221
  };
5032
5222
 
5033
5223
  // src/red-team/custom-attacks-client.ts
@@ -5155,14 +5345,18 @@ var RedTeamCustomAttacksClient = class {
5155
5345
  /**
5156
5346
  * Get version information for a prompt set.
5157
5347
  * @param uuid - The prompt set UUID.
5348
+ * @param opts - Optional query params (e.g. specific version ID).
5158
5349
  * @returns The prompt set version info.
5159
5350
  */
5160
- async getPromptSetVersionInfo(uuid) {
5351
+ async getPromptSetVersionInfo(uuid, opts) {
5161
5352
  validateUuid(uuid, "prompt set uuid");
5353
+ const params = {};
5354
+ if (opts?.version !== void 0) params.version = opts.version;
5162
5355
  const res = await managementHttpRequest({
5163
5356
  method: "GET",
5164
5357
  baseUrl: this.baseUrl,
5165
5358
  path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/version-info`,
5359
+ params: Object.keys(params).length > 0 ? params : void 0,
5166
5360
  oauthClient: this.oauthClient,
5167
5361
  numRetries: this.numRetries
5168
5362
  });
@@ -5258,6 +5452,7 @@ var RedTeamCustomAttacksClient = class {
5258
5452
  async listPrompts(promptSetUuid, opts) {
5259
5453
  validateUuid(promptSetUuid, "prompt set uuid");
5260
5454
  const params = buildRedTeamListParams(opts);
5455
+ if (opts?.status !== void 0) params.status = opts.status;
5261
5456
  if (opts?.active !== void 0) params.active = String(opts.active);
5262
5457
  const res = await managementHttpRequest({
5263
5458
  method: "GET",
@@ -5412,6 +5607,202 @@ var RedTeamCustomAttacksClient = class {
5412
5607
  }
5413
5608
  };
5414
5609
 
5610
+ // src/red-team/eula-client.ts
5611
+ var RedTeamEulaClient = class {
5612
+ baseUrl;
5613
+ oauthClient;
5614
+ numRetries;
5615
+ constructor(opts) {
5616
+ this.baseUrl = opts.baseUrl;
5617
+ this.oauthClient = opts.oauthClient;
5618
+ this.numRetries = opts.numRetries;
5619
+ }
5620
+ /**
5621
+ * Get the current EULA content.
5622
+ * @returns The EULA content response.
5623
+ */
5624
+ async getContent() {
5625
+ const res = await managementHttpRequest({
5626
+ method: "GET",
5627
+ baseUrl: this.baseUrl,
5628
+ path: `${RED_TEAM_EULA_PATH}/content`,
5629
+ oauthClient: this.oauthClient,
5630
+ numRetries: this.numRetries
5631
+ });
5632
+ return res.data;
5633
+ }
5634
+ /**
5635
+ * Get the current EULA acceptance status.
5636
+ * @returns The EULA status response.
5637
+ */
5638
+ async getStatus() {
5639
+ const res = await managementHttpRequest({
5640
+ method: "GET",
5641
+ baseUrl: this.baseUrl,
5642
+ path: `${RED_TEAM_EULA_PATH}/status`,
5643
+ oauthClient: this.oauthClient,
5644
+ numRetries: this.numRetries
5645
+ });
5646
+ return res.data;
5647
+ }
5648
+ /**
5649
+ * Accept the EULA.
5650
+ * @param request - The acceptance request body.
5651
+ * @returns The EULA response with acceptance status.
5652
+ */
5653
+ async accept(request) {
5654
+ const res = await managementHttpRequest({
5655
+ method: "POST",
5656
+ baseUrl: this.baseUrl,
5657
+ path: `${RED_TEAM_EULA_PATH}/accept`,
5658
+ body: request,
5659
+ oauthClient: this.oauthClient,
5660
+ numRetries: this.numRetries
5661
+ });
5662
+ return res.data;
5663
+ }
5664
+ };
5665
+
5666
+ // src/red-team/instances-client.ts
5667
+ var RedTeamInstancesClient = class {
5668
+ baseUrl;
5669
+ oauthClient;
5670
+ numRetries;
5671
+ constructor(opts) {
5672
+ this.baseUrl = opts.baseUrl;
5673
+ this.oauthClient = opts.oauthClient;
5674
+ this.numRetries = opts.numRetries;
5675
+ }
5676
+ /**
5677
+ * Create a new tenant instance.
5678
+ * @param request - The instance creation request.
5679
+ * @returns The instance response.
5680
+ */
5681
+ async createInstance(request) {
5682
+ const res = await managementHttpRequest({
5683
+ method: "POST",
5684
+ baseUrl: this.baseUrl,
5685
+ path: RED_TEAM_INSTANCES_PATH,
5686
+ body: request,
5687
+ oauthClient: this.oauthClient,
5688
+ numRetries: this.numRetries
5689
+ });
5690
+ return res.data;
5691
+ }
5692
+ /**
5693
+ * Get an existing tenant instance.
5694
+ * @param tenantId - The tenant ID.
5695
+ * @returns The instance details.
5696
+ */
5697
+ async getInstance(tenantId) {
5698
+ const res = await managementHttpRequest({
5699
+ method: "GET",
5700
+ baseUrl: this.baseUrl,
5701
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}`,
5702
+ oauthClient: this.oauthClient,
5703
+ numRetries: this.numRetries
5704
+ });
5705
+ return res.data;
5706
+ }
5707
+ /**
5708
+ * Update an existing tenant instance.
5709
+ * @param tenantId - The tenant ID.
5710
+ * @param request - The instance update request.
5711
+ * @returns The instance response.
5712
+ */
5713
+ async updateInstance(tenantId, request) {
5714
+ const res = await managementHttpRequest({
5715
+ method: "PUT",
5716
+ baseUrl: this.baseUrl,
5717
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}`,
5718
+ body: request,
5719
+ oauthClient: this.oauthClient,
5720
+ numRetries: this.numRetries
5721
+ });
5722
+ return res.data;
5723
+ }
5724
+ /**
5725
+ * Delete a tenant instance.
5726
+ * @param tenantId - The tenant ID.
5727
+ * @returns The instance response.
5728
+ */
5729
+ async deleteInstance(tenantId) {
5730
+ const res = await managementHttpRequest({
5731
+ method: "DELETE",
5732
+ baseUrl: this.baseUrl,
5733
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}`,
5734
+ oauthClient: this.oauthClient,
5735
+ numRetries: this.numRetries
5736
+ });
5737
+ return res.data;
5738
+ }
5739
+ /**
5740
+ * Create devices for a tenant instance.
5741
+ * @param tenantId - The tenant ID.
5742
+ * @param request - The device creation request.
5743
+ * @returns The device response with statuses.
5744
+ */
5745
+ async createDevices(tenantId, request) {
5746
+ const res = await managementHttpRequest({
5747
+ method: "POST",
5748
+ baseUrl: this.baseUrl,
5749
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}/devices`,
5750
+ body: request,
5751
+ oauthClient: this.oauthClient,
5752
+ numRetries: this.numRetries
5753
+ });
5754
+ return res.data;
5755
+ }
5756
+ /**
5757
+ * Update devices for a tenant instance.
5758
+ * @param tenantId - The tenant ID.
5759
+ * @param request - The device update request.
5760
+ * @returns The device response with statuses.
5761
+ */
5762
+ async updateDevices(tenantId, request) {
5763
+ const res = await managementHttpRequest({
5764
+ method: "PATCH",
5765
+ baseUrl: this.baseUrl,
5766
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}/devices`,
5767
+ body: request,
5768
+ oauthClient: this.oauthClient,
5769
+ numRetries: this.numRetries
5770
+ });
5771
+ return res.data;
5772
+ }
5773
+ /**
5774
+ * Delete devices from a tenant instance.
5775
+ * @param tenantId - The tenant ID.
5776
+ * @param serialNumbers - Comma-separated serial numbers to delete.
5777
+ * @returns The device response with statuses.
5778
+ */
5779
+ async deleteDevices(tenantId, serialNumbers) {
5780
+ const res = await managementHttpRequest({
5781
+ method: "DELETE",
5782
+ baseUrl: this.baseUrl,
5783
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}/devices`,
5784
+ params: { serial_numbers: serialNumbers },
5785
+ oauthClient: this.oauthClient,
5786
+ numRetries: this.numRetries
5787
+ });
5788
+ return res.data;
5789
+ }
5790
+ /**
5791
+ * Get or create registry credentials.
5792
+ * @returns The registry credentials with token and expiry.
5793
+ */
5794
+ async getRegistryCredentials() {
5795
+ const res = await managementHttpRequest({
5796
+ method: "POST",
5797
+ baseUrl: this.baseUrl,
5798
+ path: RED_TEAM_REGISTRY_CREDENTIALS_PATH,
5799
+ oauthClient: this.oauthClient,
5800
+ numRetries: this.numRetries
5801
+ });
5802
+ return res.data;
5803
+ }
5804
+ };
5805
+
5415
5806
  // src/red-team/client.ts
5416
5807
  var RedTeamClient = class {
5417
5808
  /** Data plane scan operations. */
@@ -5424,6 +5815,10 @@ var RedTeamClient = class {
5424
5815
  targets;
5425
5816
  /** Management plane custom attack/prompt set operations. */
5426
5817
  customAttacks;
5818
+ /** Management plane EULA operations. */
5819
+ eula;
5820
+ /** Management plane instance/licensing operations. */
5821
+ instances;
5427
5822
  dataEndpoint;
5428
5823
  mgmtEndpoint;
5429
5824
  oauthClient;
@@ -5470,6 +5865,16 @@ var RedTeamClient = class {
5470
5865
  oauthClient,
5471
5866
  numRetries
5472
5867
  });
5868
+ this.eula = new RedTeamEulaClient({
5869
+ baseUrl: mgmtEndpoint,
5870
+ oauthClient,
5871
+ numRetries
5872
+ });
5873
+ this.instances = new RedTeamInstancesClient({
5874
+ baseUrl: mgmtEndpoint,
5875
+ oauthClient,
5876
+ numRetries
5877
+ });
5473
5878
  }
5474
5879
  // -----------------------------------------------------------------------
5475
5880
  // Data plane convenience methods
@@ -5633,9 +6038,12 @@ export {
5633
6038
  AttackOutputSchema,
5634
6039
  AttackStatus,
5635
6040
  AttackType,
6041
+ AuthConfigSchema,
5636
6042
  AuthType,
5637
6043
  BEARER,
5638
6044
  BaseResponseSchema,
6045
+ BasicAuthAuthConfigSchema,
6046
+ BasicAuthLocation,
5639
6047
  BedrockAccessConnectionParamsSchema,
5640
6048
  BrandSubCategory,
5641
6049
  Category,
@@ -5701,11 +6109,19 @@ export {
5701
6109
  DeleteProfileResponseSchema,
5702
6110
  DeleteTopicConflictSchema,
5703
6111
  DeleteTopicResponseSchema,
6112
+ DeploymentProfileAttributeSchema,
5704
6113
  DeploymentProfileEntrySchema,
6114
+ DeploymentProfileRequestSchema,
5705
6115
  DeploymentProfilesClient,
5706
6116
  DeploymentProfilesResponseSchema,
5707
6117
  DetectionServiceName,
5708
6118
  DetectionServiceResultSchema,
6119
+ DeviceInstanceSchema,
6120
+ DeviceLicenseSchema,
6121
+ DeviceRequestSchema,
6122
+ DeviceResponseSchema,
6123
+ DeviceSchema,
6124
+ DeviceStatusSchema,
5709
6125
  DlpDataProfilePolicySchema,
5710
6126
  DlpDataProfileSchema,
5711
6127
  DlpPatternDetectionSchema,
@@ -5723,6 +6139,9 @@ export {
5723
6139
  ErrorSource,
5724
6140
  ErrorStatus,
5725
6141
  ErrorType,
6142
+ EulaAcceptRequestSchema,
6143
+ EulaContentResponseSchema,
6144
+ EulaResponseSchema,
5726
6145
  EvalOutcome,
5727
6146
  EvalSummarySchema,
5728
6147
  FileFormat,
@@ -5740,8 +6159,13 @@ export {
5740
6159
  HEADER_AUTH_TOKEN,
5741
6160
  HTTPValidationErrorSchema,
5742
6161
  HTTP_FORCE_RETRY_STATUS_CODES,
6162
+ HeadersAuthConfigSchema,
5743
6163
  HuggingfaceConnectionParamsSchema,
5744
6164
  IODetectedSchema,
6165
+ InstanceExtraDetailsSchema,
6166
+ InstanceGetResponseSchema,
6167
+ InstanceRequestSchema,
6168
+ InstanceResponseSchema,
5745
6169
  JobAbortResponseSchema,
5746
6170
  JobCreateRequestSchema,
5747
6171
  JobListResponseSchema,
@@ -5829,6 +6253,7 @@ export {
5829
6253
  ModelSecurityScansClient,
5830
6254
  MultiTurnStatefulConfigSchema,
5831
6255
  MultiTurnStatelessConfigSchema,
6256
+ OAuth2AuthConfigSchema,
5832
6257
  OAuthClient,
5833
6258
  OAuthManagementClient,
5834
6259
  Oauth2TokenSchema,
@@ -5870,15 +6295,20 @@ export {
5870
6295
  RED_TEAM_DASHBOARD_PATH,
5871
6296
  RED_TEAM_DATA_ENDPOINT,
5872
6297
  RED_TEAM_ERROR_LOG_PATH,
6298
+ RED_TEAM_EULA_PATH,
6299
+ RED_TEAM_INSTANCES_PATH,
5873
6300
  RED_TEAM_MGMT_DASHBOARD_PATH,
5874
6301
  RED_TEAM_MGMT_ENDPOINT,
5875
6302
  RED_TEAM_QUOTA_PATH,
6303
+ RED_TEAM_REGISTRY_CREDENTIALS_PATH,
5876
6304
  RED_TEAM_REPORT_DYNAMIC_PATH,
5877
6305
  RED_TEAM_REPORT_PATH,
5878
6306
  RED_TEAM_REPORT_STATIC_PATH,
5879
6307
  RED_TEAM_SCAN_PATH,
5880
6308
  RED_TEAM_SENTIMENT_PATH,
5881
6309
  RED_TEAM_TARGET_PATH,
6310
+ RED_TEAM_TARGET_VALIDATE_AUTH_PATH,
6311
+ RED_TEAM_TEMPLATE_PATH,
5882
6312
  RED_TEAM_TOKEN_ENDPOINT,
5883
6313
  RED_TEAM_TSG_ID,
5884
6314
  RedTeamCategory,
@@ -5886,10 +6316,13 @@ export {
5886
6316
  RedTeamCustomAttackReportsClient,
5887
6317
  RedTeamCustomAttacksClient,
5888
6318
  RedTeamErrorType,
6319
+ RedTeamEulaClient,
6320
+ RedTeamInstancesClient,
5889
6321
  RedTeamPaginationSchema,
5890
6322
  RedTeamReportsClient,
5891
6323
  RedTeamScansClient,
5892
6324
  RedTeamTargetsClient,
6325
+ RegistryCredentialsSchema,
5893
6326
  RemediationDetailSchema,
5894
6327
  RemediationResponseSchema,
5895
6328
  ResponseDetectedSchema,
@@ -5959,6 +6392,9 @@ export {
5959
6392
  SubCategoryModelSchema,
5960
6393
  SubCategoryStatsSchema,
5961
6394
  TargetAdditionalContextSchema,
6395
+ TargetAuthType,
6396
+ TargetAuthValidationRequestSchema,
6397
+ TargetAuthValidationResponseSchema,
5962
6398
  TargetBackgroundSchema,
5963
6399
  TargetConnectionType,
5964
6400
  TargetContextUpdateSchema,
@@ -5972,6 +6408,7 @@ export {
5972
6408
  TargetReferenceSchema,
5973
6409
  TargetResponseSchema,
5974
6410
  TargetStatus,
6411
+ TargetTemplateCollectionSchema,
5975
6412
  TargetType,
5976
6413
  TargetUpdateRequestSchema,
5977
6414
  TcReportSchema,
@@ -5991,6 +6428,7 @@ export {
5991
6428
  Verdict,
5992
6429
  ViolationListSchema,
5993
6430
  ViolationResponseSchema,
6431
+ WebSocketConnectionParamsSchema,
5994
6432
  globalConfiguration,
5995
6433
  init
5996
6434
  };