@cdot65/prisma-airs-sdk 0.6.11 → 0.7.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.6.11";
32
+ var SDK_VERSION = "0.7.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";
@@ -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",
@@ -1818,7 +1832,8 @@ var RedTeamCategory = {
1818
1832
  };
1819
1833
  var ResponseMode = {
1820
1834
  REST: "REST",
1821
- STREAMING: "STREAMING"
1835
+ STREAMING: "STREAMING",
1836
+ WEBSOCKET: "WEBSOCKET"
1822
1837
  };
1823
1838
  var RiskRating = {
1824
1839
  LOW: "LOW",
@@ -1871,7 +1886,8 @@ var TargetConnectionType = {
1871
1886
  HUGGING_FACE: "HUGGING_FACE",
1872
1887
  CUSTOM: "CUSTOM",
1873
1888
  REST: "REST",
1874
- STREAMING: "STREAMING"
1889
+ STREAMING: "STREAMING",
1890
+ WEBSOCKET: "WEBSOCKET"
1875
1891
  };
1876
1892
  var TargetStatus = {
1877
1893
  DRAFT: "DRAFT",
@@ -1935,6 +1951,24 @@ var MultiTurnStatelessConfigSchema = z25.object({
1935
1951
  type: z25.string().default("stateless"),
1936
1952
  assistant_role: z25.string().nullable().optional()
1937
1953
  }).passthrough();
1954
+ var HeadersAuthConfigSchema = z25.object({ auth_header: z25.record(z25.unknown()) }).passthrough();
1955
+ var BasicAuthAuthConfigSchema = z25.object({
1956
+ basic_auth_location: z25.string().default("HEADER"),
1957
+ basic_auth_header: z25.record(z25.unknown()).nullable().optional()
1958
+ }).passthrough();
1959
+ var OAuth2AuthConfigSchema = z25.object({
1960
+ oauth2_token_url: z25.string(),
1961
+ oauth2_expiry_minutes: z25.number().int().default(60),
1962
+ oauth2_headers: z25.record(z25.unknown()).optional(),
1963
+ oauth2_body_params: z25.record(z25.unknown()).optional(),
1964
+ oauth2_token_response_key: z25.string().default("access_token"),
1965
+ oauth2_inject_header: z25.record(z25.unknown())
1966
+ }).passthrough();
1967
+ var AuthConfigSchema = z25.union([
1968
+ HeadersAuthConfigSchema,
1969
+ BasicAuthAuthConfigSchema,
1970
+ OAuth2AuthConfigSchema
1971
+ ]);
1938
1972
  var OpenAIConnectionParamsSchema = z25.object({
1939
1973
  api_key: z25.string(),
1940
1974
  model_name: z25.string()
@@ -1972,7 +2006,11 @@ var StreamingConnectionParamsSchema = RestConnectionParamsSchema.extend({
1972
2006
  response_stop_key: z25.string(),
1973
2007
  response_stop_value: z25.string()
1974
2008
  }).passthrough();
2009
+ var WebSocketConnectionParamsSchema = RestConnectionParamsSchema.extend({
2010
+ ws_response_timeout: z25.number().default(110)
2011
+ }).passthrough();
1975
2012
  var ConnectionParamsSchema = z25.union([
2013
+ WebSocketConnectionParamsSchema,
1976
2014
  StreamingConnectionParamsSchema,
1977
2015
  RestConnectionParamsSchema
1978
2016
  ]);
@@ -2077,7 +2115,8 @@ var TargetReferenceSchema = z25.object({
2077
2115
  target_metadata: TargetMetadataSchema.optional(),
2078
2116
  target_background: TargetBackgroundSchema.nullable().optional(),
2079
2117
  profiling_status: z25.string().nullable().optional(),
2080
- additional_context: TargetAdditionalContextSchema.nullable().optional()
2118
+ additional_context: TargetAdditionalContextSchema.nullable().optional(),
2119
+ auth_type: z25.string().nullable().optional()
2081
2120
  }).passthrough();
2082
2121
  var JobResponseSchema = z25.object({
2083
2122
  uuid: z25.string(),
@@ -2534,7 +2573,9 @@ var TargetCreateRequestSchema = z25.object({
2534
2573
  target_background: z25.unknown().optional(),
2535
2574
  additional_context: z25.unknown().optional(),
2536
2575
  extra_info: z25.unknown().optional(),
2537
- network_broker_channel_uuid: z25.unknown().optional()
2576
+ network_broker_channel_uuid: z25.unknown().optional(),
2577
+ auth_type: z25.string().nullable().optional(),
2578
+ auth_config: z25.unknown().nullable().optional()
2538
2579
  }).passthrough();
2539
2580
  var TargetUpdateRequestSchema = z25.object({
2540
2581
  name: z25.string(),
@@ -2549,7 +2590,9 @@ var TargetUpdateRequestSchema = z25.object({
2549
2590
  target_background: z25.unknown().optional(),
2550
2591
  additional_context: z25.unknown().optional(),
2551
2592
  extra_info: z25.unknown().optional(),
2552
- network_broker_channel_uuid: z25.unknown().optional()
2593
+ network_broker_channel_uuid: z25.unknown().optional(),
2594
+ auth_type: z25.string().nullable().optional(),
2595
+ auth_config: z25.unknown().nullable().optional()
2553
2596
  }).passthrough();
2554
2597
  var TargetContextUpdateSchema = z25.object({
2555
2598
  target_background: z25.unknown().optional(),
@@ -2578,7 +2621,8 @@ var TargetResponseSchema = z25.object({
2578
2621
  target_metadata: z25.unknown().optional(),
2579
2622
  target_background: z25.unknown().optional(),
2580
2623
  profiling_status: z25.unknown().optional(),
2581
- additional_context: z25.unknown().optional()
2624
+ additional_context: z25.unknown().optional(),
2625
+ auth_type: z25.string().nullable().optional()
2582
2626
  }).passthrough();
2583
2627
  var TargetListItemSchema = z25.object({
2584
2628
  uuid: z25.string(),
@@ -2599,7 +2643,8 @@ var TargetListItemSchema = z25.object({
2599
2643
  version: z25.unknown().optional(),
2600
2644
  secret_version: z25.unknown().optional(),
2601
2645
  created_by_user_id: z25.unknown().optional(),
2602
- updated_by_user_id: z25.unknown().optional()
2646
+ updated_by_user_id: z25.unknown().optional(),
2647
+ auth_type: z25.string().nullable().optional()
2603
2648
  }).passthrough();
2604
2649
  var TargetListSchema = z25.object({ pagination: RedTeamPaginationSchema, data: z25.array(TargetListItemSchema).optional() }).passthrough();
2605
2650
  var TargetProbeRequestSchema = z25.object({
@@ -2617,7 +2662,20 @@ var TargetProbeRequestSchema = z25.object({
2617
2662
  additional_context: z25.unknown().optional(),
2618
2663
  extra_info: z25.unknown().optional(),
2619
2664
  network_broker_channel_uuid: z25.unknown().optional(),
2620
- probe_fields: z25.unknown().optional()
2665
+ probe_fields: z25.unknown().optional(),
2666
+ auth_type: z25.string().nullable().optional(),
2667
+ auth_config: z25.unknown().nullable().optional()
2668
+ }).passthrough();
2669
+ var TargetAuthValidationRequestSchema = z25.object({
2670
+ auth_type: z25.string(),
2671
+ auth_config: z25.unknown(),
2672
+ target_id: z25.string().nullable().optional(),
2673
+ network_broker_channel_uuid: z25.string().nullable().optional()
2674
+ }).passthrough();
2675
+ var TargetAuthValidationResponseSchema = z25.object({
2676
+ validated: z25.boolean(),
2677
+ token_preview: z25.string().nullable().optional(),
2678
+ expires_in: z25.number().int().nullable().optional()
2621
2679
  }).passthrough();
2622
2680
  var TargetProfileResponseSchema = z25.object({
2623
2681
  target_id: z25.string(),
@@ -2629,6 +2687,15 @@ var TargetProfileResponseSchema = z25.object({
2629
2687
  ai_generated_fields: z25.unknown().optional(),
2630
2688
  other_details: z25.unknown().optional()
2631
2689
  }).passthrough();
2690
+ var TargetTemplateCollectionSchema = z25.object({
2691
+ OPENAI: z25.record(z25.unknown()),
2692
+ HUGGING_FACE: z25.record(z25.unknown()),
2693
+ DATABRICKS: z25.record(z25.unknown()),
2694
+ BEDROCK: z25.record(z25.unknown()),
2695
+ REST: z25.record(z25.unknown()),
2696
+ STREAMING: z25.record(z25.unknown()),
2697
+ WEBSOCKET: z25.record(z25.unknown())
2698
+ }).passthrough();
2632
2699
  var BaseResponseSchema = z25.object({
2633
2700
  message: z25.string(),
2634
2701
  status: z25.number().int()
@@ -2686,7 +2753,6 @@ var CustomPromptSetListSchema = z25.object({
2686
2753
  pagination: RedTeamPaginationSchema,
2687
2754
  data: z25.array(CustomPromptSetListItemSchema).optional()
2688
2755
  }).passthrough();
2689
- var CustomPromptSetListActiveSchema = z25.object({ data: z25.array(CustomPromptSetListItemSchema).optional() }).passthrough();
2690
2756
  var CustomPromptSetReferenceSchema = z25.object({
2691
2757
  uuid: z25.string(),
2692
2758
  name: z25.string(),
@@ -2697,6 +2763,7 @@ var CustomPromptSetReferenceSchema = z25.object({
2697
2763
  updated_at: z25.string(),
2698
2764
  version: z25.unknown().optional()
2699
2765
  }).passthrough();
2766
+ var CustomPromptSetListActiveSchema = z25.object({ data: z25.array(CustomPromptSetReferenceSchema).optional() }).passthrough();
2700
2767
  var CustomPromptSetVersionInfoSchema = z25.object({
2701
2768
  uuid: z25.string(),
2702
2769
  status: z25.string(),
@@ -2756,7 +2823,7 @@ var PropertyDefinitionSchema = z25.object({
2756
2823
  property_name: z25.string(),
2757
2824
  created_at: z25.string()
2758
2825
  }).passthrough();
2759
- var PropertyNamesListResponseSchema = z25.object({ data: z25.array(PropertyDefinitionSchema).optional() }).passthrough();
2826
+ var PropertyNamesListResponseSchema = z25.object({ data: z25.array(z25.string()).optional() }).passthrough();
2760
2827
  var PropertyValuesResponseSchema = z25.object({
2761
2828
  name: z25.string(),
2762
2829
  values: z25.array(z25.string()).optional()
@@ -2766,6 +2833,117 @@ var DashboardOverviewResponseSchema = z25.object({
2766
2833
  total_targets: z25.number().int(),
2767
2834
  targets_by_type: z25.array(CountByNameSchema).optional()
2768
2835
  }).passthrough();
2836
+ var EulaAcceptRequestSchema = z25.object({
2837
+ eula_content: z25.string(),
2838
+ accepted_at: z25.string().nullable().optional()
2839
+ }).passthrough();
2840
+ var EulaContentResponseSchema = z25.object({
2841
+ content: z25.string()
2842
+ }).passthrough();
2843
+ var EulaResponseSchema = z25.object({
2844
+ uuid: z25.string().nullable().optional(),
2845
+ is_accepted: z25.boolean(),
2846
+ accepted_at: z25.string().nullable().optional(),
2847
+ accepted_by_user_id: z25.string().nullable().optional()
2848
+ }).passthrough();
2849
+ var DeviceInstanceSchema = z25.object({
2850
+ app_id: z25.string(),
2851
+ region: z25.string(),
2852
+ tenant_id: z25.string(),
2853
+ tsg_id: z25.string()
2854
+ }).passthrough();
2855
+ var DeviceLicenseSchema = z25.object({
2856
+ authorizationCode: z25.string().optional(),
2857
+ expirationDate: z25.string().optional(),
2858
+ licensePanDbIdentification: z25.string().optional(),
2859
+ partNumber: z25.string().optional(),
2860
+ serialNumber: z25.string().optional(),
2861
+ subtypeName: z25.string().optional(),
2862
+ registrationDate: z25.string().optional()
2863
+ }).passthrough();
2864
+ var DeviceSchema = z25.object({
2865
+ serial_number: z25.string(),
2866
+ model: z25.string().optional(),
2867
+ sku: z25.string().optional(),
2868
+ device_type: z25.string().optional(),
2869
+ device_name: z25.string().optional(),
2870
+ tsg_id: z25.string().optional(),
2871
+ support_account_id: z25.string().optional(),
2872
+ asset_type: z25.string().optional(),
2873
+ licenses: z25.array(DeviceLicenseSchema).optional()
2874
+ }).passthrough();
2875
+ var DeviceStatusSchema = z25.object({
2876
+ status: z25.string(),
2877
+ error: z25.string().optional(),
2878
+ serial_number: z25.string().optional()
2879
+ }).passthrough();
2880
+ var DeviceRequestSchema = z25.object({
2881
+ instance: DeviceInstanceSchema,
2882
+ created_by: z25.string().optional(),
2883
+ devices: z25.array(DeviceSchema).optional()
2884
+ }).passthrough();
2885
+ var DeviceResponseSchema = z25.object({
2886
+ devices: z25.array(DeviceStatusSchema).optional(),
2887
+ status: z25.string().optional()
2888
+ }).passthrough();
2889
+ var DeploymentProfileAttributeSchema = z25.object({
2890
+ quantity: z25.number().optional(),
2891
+ unit_of_measure: z25.string().optional()
2892
+ }).passthrough();
2893
+ var DeploymentProfileRequestSchema = z25.object({
2894
+ dAuthCode: z25.string().optional(),
2895
+ deploymentProfileId: z25.string().optional(),
2896
+ license_expiration: z25.string().optional(),
2897
+ profileName: z25.string().optional(),
2898
+ subType: z25.string().optional(),
2899
+ subscriptions: z25.string().optional(),
2900
+ type: z25.string().optional(),
2901
+ aveTextRecord: z25.number().default(0),
2902
+ attributes: z25.array(DeploymentProfileAttributeSchema).optional()
2903
+ }).passthrough();
2904
+ var InstanceExtraDetailsSchema = z25.object({
2905
+ deployment_profiles: z25.array(DeploymentProfileRequestSchema).optional(),
2906
+ airs_shared_by_tsg: z25.string().optional(),
2907
+ airs_unshared_dps: z25.string().optional()
2908
+ }).passthrough();
2909
+ var InstanceRequestSchema = z25.object({
2910
+ tsg_id: z25.string(),
2911
+ tenant_id: z25.string(),
2912
+ app_id: z25.string(),
2913
+ region: z25.string(),
2914
+ support_account_id: z25.string().optional(),
2915
+ support_account_name: z25.string().optional(),
2916
+ created_by: z25.string().optional(),
2917
+ internal: z25.boolean().optional(),
2918
+ tenant_instance_name: z25.string().optional(),
2919
+ extra: InstanceExtraDetailsSchema.optional(),
2920
+ iam_controlled: z25.boolean().optional(),
2921
+ platform_region: z25.string().optional(),
2922
+ csp_tenant_id: z25.string().optional(),
2923
+ tsg_instances: z25.unknown().optional()
2924
+ }).passthrough();
2925
+ var InstanceResponseSchema = z25.object({
2926
+ tsg_id: z25.string(),
2927
+ tenant_id: z25.string().optional(),
2928
+ app_id: z25.string().optional(),
2929
+ is_success: z25.boolean().optional()
2930
+ }).passthrough();
2931
+ var InstanceGetResponseSchema = z25.object({
2932
+ tsg_id: z25.string(),
2933
+ tenant_id: z25.string(),
2934
+ app_id: z25.string(),
2935
+ region: z25.string(),
2936
+ support_account_id: z25.string().optional(),
2937
+ support_account_name: z25.string().optional(),
2938
+ created_by: z25.string().optional(),
2939
+ internal: z25.boolean().optional(),
2940
+ tenant_instance_name: z25.string().optional(),
2941
+ deployment_profiles: z25.array(DeploymentProfileRequestSchema).optional()
2942
+ }).passthrough();
2943
+ var RegistryCredentialsSchema = z25.object({
2944
+ token: z25.string(),
2945
+ expiry: z25.string()
2946
+ }).passthrough();
2769
2947
 
2770
2948
  // src/models/oauth-token.ts
2771
2949
  import { z as z26 } from "zod";
@@ -5028,6 +5206,50 @@ var RedTeamTargetsClient = class {
5028
5206
  });
5029
5207
  return res.data;
5030
5208
  }
5209
+ /**
5210
+ * Validate target authentication credentials.
5211
+ * @param request - The auth validation request body.
5212
+ * @returns The auth validation response.
5213
+ */
5214
+ async validateAuth(request) {
5215
+ const res = await managementHttpRequest({
5216
+ method: "POST",
5217
+ baseUrl: this.baseUrl,
5218
+ path: RED_TEAM_TARGET_VALIDATE_AUTH_PATH,
5219
+ body: request,
5220
+ oauthClient: this.oauthClient,
5221
+ numRetries: this.numRetries
5222
+ });
5223
+ return res.data;
5224
+ }
5225
+ /**
5226
+ * Get target metadata (field definitions for target configuration).
5227
+ * @returns The target metadata object.
5228
+ */
5229
+ async getTargetMetadata() {
5230
+ const res = await managementHttpRequest({
5231
+ method: "GET",
5232
+ baseUrl: this.baseUrl,
5233
+ path: `${RED_TEAM_TEMPLATE_PATH}/target-metadata`,
5234
+ oauthClient: this.oauthClient,
5235
+ numRetries: this.numRetries
5236
+ });
5237
+ return res.data;
5238
+ }
5239
+ /**
5240
+ * Get target templates for all supported provider types.
5241
+ * @returns The collection of target templates keyed by provider.
5242
+ */
5243
+ async getTargetTemplates() {
5244
+ const res = await managementHttpRequest({
5245
+ method: "GET",
5246
+ baseUrl: this.baseUrl,
5247
+ path: `${RED_TEAM_TEMPLATE_PATH}/target-templates`,
5248
+ oauthClient: this.oauthClient,
5249
+ numRetries: this.numRetries
5250
+ });
5251
+ return res.data;
5252
+ }
5031
5253
  };
5032
5254
 
5033
5255
  // src/red-team/custom-attacks-client.ts
@@ -5155,14 +5377,18 @@ var RedTeamCustomAttacksClient = class {
5155
5377
  /**
5156
5378
  * Get version information for a prompt set.
5157
5379
  * @param uuid - The prompt set UUID.
5380
+ * @param opts - Optional query params (e.g. specific version ID).
5158
5381
  * @returns The prompt set version info.
5159
5382
  */
5160
- async getPromptSetVersionInfo(uuid) {
5383
+ async getPromptSetVersionInfo(uuid, opts) {
5161
5384
  validateUuid(uuid, "prompt set uuid");
5385
+ const params = {};
5386
+ if (opts?.version !== void 0) params.version = opts.version;
5162
5387
  const res = await managementHttpRequest({
5163
5388
  method: "GET",
5164
5389
  baseUrl: this.baseUrl,
5165
5390
  path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/version-info`,
5391
+ params: Object.keys(params).length > 0 ? params : void 0,
5166
5392
  oauthClient: this.oauthClient,
5167
5393
  numRetries: this.numRetries
5168
5394
  });
@@ -5258,6 +5484,7 @@ var RedTeamCustomAttacksClient = class {
5258
5484
  async listPrompts(promptSetUuid, opts) {
5259
5485
  validateUuid(promptSetUuid, "prompt set uuid");
5260
5486
  const params = buildRedTeamListParams(opts);
5487
+ if (opts?.status !== void 0) params.status = opts.status;
5261
5488
  if (opts?.active !== void 0) params.active = String(opts.active);
5262
5489
  const res = await managementHttpRequest({
5263
5490
  method: "GET",
@@ -5412,6 +5639,202 @@ var RedTeamCustomAttacksClient = class {
5412
5639
  }
5413
5640
  };
5414
5641
 
5642
+ // src/red-team/eula-client.ts
5643
+ var RedTeamEulaClient = class {
5644
+ baseUrl;
5645
+ oauthClient;
5646
+ numRetries;
5647
+ constructor(opts) {
5648
+ this.baseUrl = opts.baseUrl;
5649
+ this.oauthClient = opts.oauthClient;
5650
+ this.numRetries = opts.numRetries;
5651
+ }
5652
+ /**
5653
+ * Get the current EULA content.
5654
+ * @returns The EULA content response.
5655
+ */
5656
+ async getContent() {
5657
+ const res = await managementHttpRequest({
5658
+ method: "GET",
5659
+ baseUrl: this.baseUrl,
5660
+ path: `${RED_TEAM_EULA_PATH}/content`,
5661
+ oauthClient: this.oauthClient,
5662
+ numRetries: this.numRetries
5663
+ });
5664
+ return res.data;
5665
+ }
5666
+ /**
5667
+ * Get the current EULA acceptance status.
5668
+ * @returns The EULA status response.
5669
+ */
5670
+ async getStatus() {
5671
+ const res = await managementHttpRequest({
5672
+ method: "GET",
5673
+ baseUrl: this.baseUrl,
5674
+ path: `${RED_TEAM_EULA_PATH}/status`,
5675
+ oauthClient: this.oauthClient,
5676
+ numRetries: this.numRetries
5677
+ });
5678
+ return res.data;
5679
+ }
5680
+ /**
5681
+ * Accept the EULA.
5682
+ * @param request - The acceptance request body.
5683
+ * @returns The EULA response with acceptance status.
5684
+ */
5685
+ async accept(request) {
5686
+ const res = await managementHttpRequest({
5687
+ method: "POST",
5688
+ baseUrl: this.baseUrl,
5689
+ path: `${RED_TEAM_EULA_PATH}/accept`,
5690
+ body: request,
5691
+ oauthClient: this.oauthClient,
5692
+ numRetries: this.numRetries
5693
+ });
5694
+ return res.data;
5695
+ }
5696
+ };
5697
+
5698
+ // src/red-team/instances-client.ts
5699
+ var RedTeamInstancesClient = class {
5700
+ baseUrl;
5701
+ oauthClient;
5702
+ numRetries;
5703
+ constructor(opts) {
5704
+ this.baseUrl = opts.baseUrl;
5705
+ this.oauthClient = opts.oauthClient;
5706
+ this.numRetries = opts.numRetries;
5707
+ }
5708
+ /**
5709
+ * Create a new tenant instance.
5710
+ * @param request - The instance creation request.
5711
+ * @returns The instance response.
5712
+ */
5713
+ async createInstance(request) {
5714
+ const res = await managementHttpRequest({
5715
+ method: "POST",
5716
+ baseUrl: this.baseUrl,
5717
+ path: RED_TEAM_INSTANCES_PATH,
5718
+ body: request,
5719
+ oauthClient: this.oauthClient,
5720
+ numRetries: this.numRetries
5721
+ });
5722
+ return res.data;
5723
+ }
5724
+ /**
5725
+ * Get an existing tenant instance.
5726
+ * @param tenantId - The tenant ID.
5727
+ * @returns The instance details.
5728
+ */
5729
+ async getInstance(tenantId) {
5730
+ const res = await managementHttpRequest({
5731
+ method: "GET",
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
+ * Update an existing tenant instance.
5741
+ * @param tenantId - The tenant ID.
5742
+ * @param request - The instance update request.
5743
+ * @returns The instance response.
5744
+ */
5745
+ async updateInstance(tenantId, request) {
5746
+ const res = await managementHttpRequest({
5747
+ method: "PUT",
5748
+ baseUrl: this.baseUrl,
5749
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}`,
5750
+ body: request,
5751
+ oauthClient: this.oauthClient,
5752
+ numRetries: this.numRetries
5753
+ });
5754
+ return res.data;
5755
+ }
5756
+ /**
5757
+ * Delete a tenant instance.
5758
+ * @param tenantId - The tenant ID.
5759
+ * @returns The instance response.
5760
+ */
5761
+ async deleteInstance(tenantId) {
5762
+ const res = await managementHttpRequest({
5763
+ method: "DELETE",
5764
+ baseUrl: this.baseUrl,
5765
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}`,
5766
+ oauthClient: this.oauthClient,
5767
+ numRetries: this.numRetries
5768
+ });
5769
+ return res.data;
5770
+ }
5771
+ /**
5772
+ * Create devices for a tenant instance.
5773
+ * @param tenantId - The tenant ID.
5774
+ * @param request - The device creation request.
5775
+ * @returns The device response with statuses.
5776
+ */
5777
+ async createDevices(tenantId, request) {
5778
+ const res = await managementHttpRequest({
5779
+ method: "POST",
5780
+ baseUrl: this.baseUrl,
5781
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}/devices`,
5782
+ body: request,
5783
+ oauthClient: this.oauthClient,
5784
+ numRetries: this.numRetries
5785
+ });
5786
+ return res.data;
5787
+ }
5788
+ /**
5789
+ * Update devices for a tenant instance.
5790
+ * @param tenantId - The tenant ID.
5791
+ * @param request - The device update request.
5792
+ * @returns The device response with statuses.
5793
+ */
5794
+ async updateDevices(tenantId, request) {
5795
+ const res = await managementHttpRequest({
5796
+ method: "PATCH",
5797
+ baseUrl: this.baseUrl,
5798
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}/devices`,
5799
+ body: request,
5800
+ oauthClient: this.oauthClient,
5801
+ numRetries: this.numRetries
5802
+ });
5803
+ return res.data;
5804
+ }
5805
+ /**
5806
+ * Delete devices from a tenant instance.
5807
+ * @param tenantId - The tenant ID.
5808
+ * @param serialNumbers - Comma-separated serial numbers to delete.
5809
+ * @returns The device response with statuses.
5810
+ */
5811
+ async deleteDevices(tenantId, serialNumbers) {
5812
+ const res = await managementHttpRequest({
5813
+ method: "DELETE",
5814
+ baseUrl: this.baseUrl,
5815
+ path: `${RED_TEAM_INSTANCES_PATH}/${tenantId}/devices`,
5816
+ params: { serial_numbers: serialNumbers },
5817
+ oauthClient: this.oauthClient,
5818
+ numRetries: this.numRetries
5819
+ });
5820
+ return res.data;
5821
+ }
5822
+ /**
5823
+ * Get or create registry credentials.
5824
+ * @returns The registry credentials with token and expiry.
5825
+ */
5826
+ async getRegistryCredentials() {
5827
+ const res = await managementHttpRequest({
5828
+ method: "POST",
5829
+ baseUrl: this.baseUrl,
5830
+ path: RED_TEAM_REGISTRY_CREDENTIALS_PATH,
5831
+ oauthClient: this.oauthClient,
5832
+ numRetries: this.numRetries
5833
+ });
5834
+ return res.data;
5835
+ }
5836
+ };
5837
+
5415
5838
  // src/red-team/client.ts
5416
5839
  var RedTeamClient = class {
5417
5840
  /** Data plane scan operations. */
@@ -5424,6 +5847,10 @@ var RedTeamClient = class {
5424
5847
  targets;
5425
5848
  /** Management plane custom attack/prompt set operations. */
5426
5849
  customAttacks;
5850
+ /** Management plane EULA operations. */
5851
+ eula;
5852
+ /** Management plane instance/licensing operations. */
5853
+ instances;
5427
5854
  dataEndpoint;
5428
5855
  mgmtEndpoint;
5429
5856
  oauthClient;
@@ -5470,6 +5897,16 @@ var RedTeamClient = class {
5470
5897
  oauthClient,
5471
5898
  numRetries
5472
5899
  });
5900
+ this.eula = new RedTeamEulaClient({
5901
+ baseUrl: mgmtEndpoint,
5902
+ oauthClient,
5903
+ numRetries
5904
+ });
5905
+ this.instances = new RedTeamInstancesClient({
5906
+ baseUrl: mgmtEndpoint,
5907
+ oauthClient,
5908
+ numRetries
5909
+ });
5473
5910
  }
5474
5911
  // -----------------------------------------------------------------------
5475
5912
  // Data plane convenience methods
@@ -5633,9 +6070,12 @@ export {
5633
6070
  AttackOutputSchema,
5634
6071
  AttackStatus,
5635
6072
  AttackType,
6073
+ AuthConfigSchema,
5636
6074
  AuthType,
5637
6075
  BEARER,
5638
6076
  BaseResponseSchema,
6077
+ BasicAuthAuthConfigSchema,
6078
+ BasicAuthLocation,
5639
6079
  BedrockAccessConnectionParamsSchema,
5640
6080
  BrandSubCategory,
5641
6081
  Category,
@@ -5701,11 +6141,19 @@ export {
5701
6141
  DeleteProfileResponseSchema,
5702
6142
  DeleteTopicConflictSchema,
5703
6143
  DeleteTopicResponseSchema,
6144
+ DeploymentProfileAttributeSchema,
5704
6145
  DeploymentProfileEntrySchema,
6146
+ DeploymentProfileRequestSchema,
5705
6147
  DeploymentProfilesClient,
5706
6148
  DeploymentProfilesResponseSchema,
5707
6149
  DetectionServiceName,
5708
6150
  DetectionServiceResultSchema,
6151
+ DeviceInstanceSchema,
6152
+ DeviceLicenseSchema,
6153
+ DeviceRequestSchema,
6154
+ DeviceResponseSchema,
6155
+ DeviceSchema,
6156
+ DeviceStatusSchema,
5709
6157
  DlpDataProfilePolicySchema,
5710
6158
  DlpDataProfileSchema,
5711
6159
  DlpPatternDetectionSchema,
@@ -5723,6 +6171,9 @@ export {
5723
6171
  ErrorSource,
5724
6172
  ErrorStatus,
5725
6173
  ErrorType,
6174
+ EulaAcceptRequestSchema,
6175
+ EulaContentResponseSchema,
6176
+ EulaResponseSchema,
5726
6177
  EvalOutcome,
5727
6178
  EvalSummarySchema,
5728
6179
  FileFormat,
@@ -5740,8 +6191,13 @@ export {
5740
6191
  HEADER_AUTH_TOKEN,
5741
6192
  HTTPValidationErrorSchema,
5742
6193
  HTTP_FORCE_RETRY_STATUS_CODES,
6194
+ HeadersAuthConfigSchema,
5743
6195
  HuggingfaceConnectionParamsSchema,
5744
6196
  IODetectedSchema,
6197
+ InstanceExtraDetailsSchema,
6198
+ InstanceGetResponseSchema,
6199
+ InstanceRequestSchema,
6200
+ InstanceResponseSchema,
5745
6201
  JobAbortResponseSchema,
5746
6202
  JobCreateRequestSchema,
5747
6203
  JobListResponseSchema,
@@ -5829,6 +6285,7 @@ export {
5829
6285
  ModelSecurityScansClient,
5830
6286
  MultiTurnStatefulConfigSchema,
5831
6287
  MultiTurnStatelessConfigSchema,
6288
+ OAuth2AuthConfigSchema,
5832
6289
  OAuthClient,
5833
6290
  OAuthManagementClient,
5834
6291
  Oauth2TokenSchema,
@@ -5870,15 +6327,20 @@ export {
5870
6327
  RED_TEAM_DASHBOARD_PATH,
5871
6328
  RED_TEAM_DATA_ENDPOINT,
5872
6329
  RED_TEAM_ERROR_LOG_PATH,
6330
+ RED_TEAM_EULA_PATH,
6331
+ RED_TEAM_INSTANCES_PATH,
5873
6332
  RED_TEAM_MGMT_DASHBOARD_PATH,
5874
6333
  RED_TEAM_MGMT_ENDPOINT,
5875
6334
  RED_TEAM_QUOTA_PATH,
6335
+ RED_TEAM_REGISTRY_CREDENTIALS_PATH,
5876
6336
  RED_TEAM_REPORT_DYNAMIC_PATH,
5877
6337
  RED_TEAM_REPORT_PATH,
5878
6338
  RED_TEAM_REPORT_STATIC_PATH,
5879
6339
  RED_TEAM_SCAN_PATH,
5880
6340
  RED_TEAM_SENTIMENT_PATH,
5881
6341
  RED_TEAM_TARGET_PATH,
6342
+ RED_TEAM_TARGET_VALIDATE_AUTH_PATH,
6343
+ RED_TEAM_TEMPLATE_PATH,
5882
6344
  RED_TEAM_TOKEN_ENDPOINT,
5883
6345
  RED_TEAM_TSG_ID,
5884
6346
  RedTeamCategory,
@@ -5886,10 +6348,13 @@ export {
5886
6348
  RedTeamCustomAttackReportsClient,
5887
6349
  RedTeamCustomAttacksClient,
5888
6350
  RedTeamErrorType,
6351
+ RedTeamEulaClient,
6352
+ RedTeamInstancesClient,
5889
6353
  RedTeamPaginationSchema,
5890
6354
  RedTeamReportsClient,
5891
6355
  RedTeamScansClient,
5892
6356
  RedTeamTargetsClient,
6357
+ RegistryCredentialsSchema,
5893
6358
  RemediationDetailSchema,
5894
6359
  RemediationResponseSchema,
5895
6360
  ResponseDetectedSchema,
@@ -5959,6 +6424,9 @@ export {
5959
6424
  SubCategoryModelSchema,
5960
6425
  SubCategoryStatsSchema,
5961
6426
  TargetAdditionalContextSchema,
6427
+ TargetAuthType,
6428
+ TargetAuthValidationRequestSchema,
6429
+ TargetAuthValidationResponseSchema,
5962
6430
  TargetBackgroundSchema,
5963
6431
  TargetConnectionType,
5964
6432
  TargetContextUpdateSchema,
@@ -5972,6 +6440,7 @@ export {
5972
6440
  TargetReferenceSchema,
5973
6441
  TargetResponseSchema,
5974
6442
  TargetStatus,
6443
+ TargetTemplateCollectionSchema,
5975
6444
  TargetType,
5976
6445
  TargetUpdateRequestSchema,
5977
6446
  TcReportSchema,
@@ -5991,6 +6460,7 @@ export {
5991
6460
  Verdict,
5992
6461
  ViolationListSchema,
5993
6462
  ViolationResponseSchema,
6463
+ WebSocketConnectionParamsSchema,
5994
6464
  globalConfiguration,
5995
6465
  init
5996
6466
  };