@uipath/api-workflow-tool 1.202.1 → 1.203.0-preview.180

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.
@@ -13,7 +13,7 @@ import {
13
13
  ZipService,
14
14
  toolsFactoryRepository,
15
15
  translate
16
- } from "./packager-tool-4vt21dnn.js";
16
+ } from "./packager-tool-6se0wnbx.js";
17
17
  import"./packager-tool-1de529jm.js";
18
18
  // ../packager/project-packager/src/i18n/locales/de.json
19
19
  var de_default = {
@@ -46,18 +46,25 @@ var de_default = {
46
46
  info: {
47
47
  alreadyProvided: "Governance policy file already provided, skipping download.",
48
48
  saved: "Governance policy saved to {path}",
49
- downloading: "Downloading governance policy from {url}",
50
- noPolicyFound: "No governance policy found for this configuration.",
51
- responseNotJson: "Policy response is not JSON, treating as no policy.",
49
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
50
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
51
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
52
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
53
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
52
54
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
53
55
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
54
56
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
55
57
  },
56
58
  errors: {
57
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
58
- failedToGetPolicy: "Failed to download governance policy: {content}",
59
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
60
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
59
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
60
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
61
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
62
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
63
+ failedToSave: "Failed to save governance policy: {error}",
64
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
65
+ },
66
+ instructions: {
67
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
61
68
  }
62
69
  },
63
70
  signing: {
@@ -131,18 +138,25 @@ var en = {
131
138
  info: {
132
139
  alreadyProvided: "Governance policy file already provided, skipping download.",
133
140
  saved: "Governance policy saved to {path}",
134
- downloading: "Downloading governance policy from {url}",
135
- noPolicyFound: "No governance policy found for this configuration.",
136
- responseNotJson: "Policy response is not JSON, treating as no policy.",
141
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
142
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
143
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
144
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
145
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
137
146
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
138
147
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
139
148
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
140
149
  },
141
150
  errors: {
142
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
143
- failedToGetPolicy: "Failed to download governance policy: {content}",
144
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
145
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
151
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
152
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
153
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
154
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
155
+ failedToSave: "Failed to save governance policy: {error}",
156
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
157
+ },
158
+ instructions: {
159
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
146
160
  }
147
161
  },
148
162
  signing: {
@@ -215,18 +229,25 @@ var es_default = {
215
229
  info: {
216
230
  alreadyProvided: "Governance policy file already provided, skipping download.",
217
231
  saved: "Governance policy saved to {path}",
218
- downloading: "Downloading governance policy from {url}",
219
- noPolicyFound: "No governance policy found for this configuration.",
220
- responseNotJson: "Policy response is not JSON, treating as no policy.",
232
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
233
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
234
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
235
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
236
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
221
237
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
222
238
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
223
239
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
224
240
  },
225
241
  errors: {
226
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
227
- failedToGetPolicy: "Failed to download governance policy: {content}",
228
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
229
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
242
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
243
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
244
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
245
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
246
+ failedToSave: "Failed to save governance policy: {error}",
247
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
248
+ },
249
+ instructions: {
250
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
230
251
  }
231
252
  },
232
253
  signing: {
@@ -299,18 +320,25 @@ var es_MX_default = {
299
320
  info: {
300
321
  alreadyProvided: "Governance policy file already provided, skipping download.",
301
322
  saved: "Governance policy saved to {path}",
302
- downloading: "Downloading governance policy from {url}",
303
- noPolicyFound: "No governance policy found for this configuration.",
304
- responseNotJson: "Policy response is not JSON, treating as no policy.",
323
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
324
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
325
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
326
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
327
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
305
328
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
306
329
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
307
330
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
308
331
  },
309
332
  errors: {
310
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
311
- failedToGetPolicy: "Failed to download governance policy: {content}",
312
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
313
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
333
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
334
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
335
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
336
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
337
+ failedToSave: "Failed to save governance policy: {error}",
338
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
339
+ },
340
+ instructions: {
341
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
314
342
  }
315
343
  },
316
344
  signing: {
@@ -383,18 +411,25 @@ var fr_default = {
383
411
  info: {
384
412
  alreadyProvided: "Governance policy file already provided, skipping download.",
385
413
  saved: "Governance policy saved to {path}",
386
- downloading: "Downloading governance policy from {url}",
387
- noPolicyFound: "No governance policy found for this configuration.",
388
- responseNotJson: "Policy response is not JSON, treating as no policy.",
414
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
415
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
416
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
417
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
418
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
389
419
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
390
420
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
391
421
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
392
422
  },
393
423
  errors: {
394
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
395
- failedToGetPolicy: "Failed to download governance policy: {content}",
396
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
397
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
424
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
425
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
426
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
427
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
428
+ failedToSave: "Failed to save governance policy: {error}",
429
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
430
+ },
431
+ instructions: {
432
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
398
433
  }
399
434
  },
400
435
  signing: {
@@ -467,18 +502,25 @@ var ja_default = {
467
502
  info: {
468
503
  alreadyProvided: "Governance policy file already provided, skipping download.",
469
504
  saved: "Governance policy saved to {path}",
470
- downloading: "Downloading governance policy from {url}",
471
- noPolicyFound: "No governance policy found for this configuration.",
472
- responseNotJson: "Policy response is not JSON, treating as no policy.",
505
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
506
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
507
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
508
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
509
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
473
510
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
474
511
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
475
512
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
476
513
  },
477
514
  errors: {
478
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
479
- failedToGetPolicy: "Failed to download governance policy: {content}",
480
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
481
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
515
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
516
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
517
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
518
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
519
+ failedToSave: "Failed to save governance policy: {error}",
520
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
521
+ },
522
+ instructions: {
523
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
482
524
  }
483
525
  },
484
526
  signing: {
@@ -551,18 +593,25 @@ var ko_default = {
551
593
  info: {
552
594
  alreadyProvided: "Governance policy file already provided, skipping download.",
553
595
  saved: "Governance policy saved to {path}",
554
- downloading: "Downloading governance policy from {url}",
555
- noPolicyFound: "No governance policy found for this configuration.",
556
- responseNotJson: "Policy response is not JSON, treating as no policy.",
596
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
597
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
598
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
599
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
600
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
557
601
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
558
602
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
559
603
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
560
604
  },
561
605
  errors: {
562
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
563
- failedToGetPolicy: "Failed to download governance policy: {content}",
564
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
565
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
606
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
607
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
608
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
609
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
610
+ failedToSave: "Failed to save governance policy: {error}",
611
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
612
+ },
613
+ instructions: {
614
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
566
615
  }
567
616
  },
568
617
  signing: {
@@ -635,18 +684,25 @@ var pt_default = {
635
684
  info: {
636
685
  alreadyProvided: "Governance policy file already provided, skipping download.",
637
686
  saved: "Governance policy saved to {path}",
638
- downloading: "Downloading governance policy from {url}",
639
- noPolicyFound: "No governance policy found for this configuration.",
640
- responseNotJson: "Policy response is not JSON, treating as no policy.",
687
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
688
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
689
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
690
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
691
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
641
692
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
642
693
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
643
694
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
644
695
  },
645
696
  errors: {
646
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
647
- failedToGetPolicy: "Failed to download governance policy: {content}",
648
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
649
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
697
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
698
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
699
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
700
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
701
+ failedToSave: "Failed to save governance policy: {error}",
702
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
703
+ },
704
+ instructions: {
705
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
650
706
  }
651
707
  },
652
708
  signing: {
@@ -719,18 +775,25 @@ var pt_BR_default = {
719
775
  info: {
720
776
  alreadyProvided: "Governance policy file already provided, skipping download.",
721
777
  saved: "Governance policy saved to {path}",
722
- downloading: "Downloading governance policy from {url}",
723
- noPolicyFound: "No governance policy found for this configuration.",
724
- responseNotJson: "Policy response is not JSON, treating as no policy.",
778
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
779
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
780
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
781
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
782
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
725
783
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
726
784
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
727
785
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
728
786
  },
729
787
  errors: {
730
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
731
- failedToGetPolicy: "Failed to download governance policy: {content}",
732
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
733
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
788
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
789
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
790
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
791
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
792
+ failedToSave: "Failed to save governance policy: {error}",
793
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
794
+ },
795
+ instructions: {
796
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
734
797
  }
735
798
  },
736
799
  signing: {
@@ -803,18 +866,25 @@ var ro_default = {
803
866
  info: {
804
867
  alreadyProvided: "Governance policy file already provided, skipping download.",
805
868
  saved: "Governance policy saved to {path}",
806
- downloading: "Downloading governance policy from {url}",
807
- noPolicyFound: "No governance policy found for this configuration.",
808
- responseNotJson: "Policy response is not JSON, treating as no policy.",
869
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
870
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
871
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
872
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
873
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
809
874
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
810
875
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
811
876
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
812
877
  },
813
878
  errors: {
814
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
815
- failedToGetPolicy: "Failed to download governance policy: {content}",
816
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
817
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
879
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
880
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
881
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
882
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
883
+ failedToSave: "Failed to save governance policy: {error}",
884
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
885
+ },
886
+ instructions: {
887
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
818
888
  }
819
889
  },
820
890
  signing: {
@@ -887,18 +957,25 @@ var ru_default = {
887
957
  info: {
888
958
  alreadyProvided: "Governance policy file already provided, skipping download.",
889
959
  saved: "Governance policy saved to {path}",
890
- downloading: "Downloading governance policy from {url}",
891
- noPolicyFound: "No governance policy found for this configuration.",
892
- responseNotJson: "Policy response is not JSON, treating as no policy.",
960
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
961
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
962
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
963
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
964
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
893
965
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
894
966
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
895
967
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
896
968
  },
897
969
  errors: {
898
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
899
- failedToGetPolicy: "Failed to download governance policy: {content}",
900
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
901
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
970
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
971
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
972
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
973
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
974
+ failedToSave: "Failed to save governance policy: {error}",
975
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
976
+ },
977
+ instructions: {
978
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
902
979
  }
903
980
  },
904
981
  signing: {
@@ -971,18 +1048,25 @@ var tr_default = {
971
1048
  info: {
972
1049
  alreadyProvided: "Governance policy file already provided, skipping download.",
973
1050
  saved: "Governance policy saved to {path}",
974
- downloading: "Downloading governance policy from {url}",
975
- noPolicyFound: "No governance policy found for this configuration.",
976
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1051
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1052
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1053
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1054
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1055
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
977
1056
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
978
1057
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
979
1058
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
980
1059
  },
981
1060
  errors: {
982
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
983
- failedToGetPolicy: "Failed to download governance policy: {content}",
984
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
985
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1061
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1062
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1063
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1064
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1065
+ failedToSave: "Failed to save governance policy: {error}",
1066
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1067
+ },
1068
+ instructions: {
1069
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
986
1070
  }
987
1071
  },
988
1072
  signing: {
@@ -1055,18 +1139,25 @@ var zh_CN_default = {
1055
1139
  info: {
1056
1140
  alreadyProvided: "Governance policy file already provided, skipping download.",
1057
1141
  saved: "Governance policy saved to {path}",
1058
- downloading: "Downloading governance policy from {url}",
1059
- noPolicyFound: "No governance policy found for this configuration.",
1060
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1142
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1143
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1144
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1145
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1146
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1061
1147
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1062
1148
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1063
1149
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1064
1150
  },
1065
1151
  errors: {
1066
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1067
- failedToGetPolicy: "Failed to download governance policy: {content}",
1068
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1069
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1152
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1153
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1154
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1155
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1156
+ failedToSave: "Failed to save governance policy: {error}",
1157
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1158
+ },
1159
+ instructions: {
1160
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1070
1161
  }
1071
1162
  },
1072
1163
  signing: {
@@ -1139,18 +1230,25 @@ var zh_TW_default = {
1139
1230
  info: {
1140
1231
  alreadyProvided: "Governance policy file already provided, skipping download.",
1141
1232
  saved: "Governance policy saved to {path}",
1142
- downloading: "Downloading governance policy from {url}",
1143
- noPolicyFound: "No governance policy found for this configuration.",
1144
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1233
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1234
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1235
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1236
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1237
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1145
1238
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1146
1239
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1147
1240
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1148
1241
  },
1149
1242
  errors: {
1150
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1151
- failedToGetPolicy: "Failed to download governance policy: {content}",
1152
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1153
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1243
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1244
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1245
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1246
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1247
+ failedToSave: "Failed to save governance policy: {error}",
1248
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1249
+ },
1250
+ instructions: {
1251
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1154
1252
  }
1155
1253
  },
1156
1254
  signing: {
@@ -1223,18 +1321,25 @@ var zu_default = {
1223
1321
  info: {
1224
1322
  alreadyProvided: "Governance policy file already provided, skipping download.",
1225
1323
  saved: "Governance policy saved to {path}",
1226
- downloading: "Downloading governance policy from {url}",
1227
- noPolicyFound: "No governance policy found for this configuration.",
1228
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1324
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1325
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1326
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1327
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1328
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1229
1329
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1230
1330
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1231
1331
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1232
1332
  },
1233
1333
  errors: {
1234
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1235
- failedToGetPolicy: "Failed to download governance policy: {content}",
1236
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1237
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1334
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1335
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1336
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1337
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1338
+ failedToSave: "Failed to save governance policy: {error}",
1339
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1340
+ },
1341
+ instructions: {
1342
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1238
1343
  }
1239
1344
  },
1240
1345
  signing: {
@@ -1294,6 +1399,1575 @@ I18nManager.registerTranslations("zh-CN", zh_CN_default);
1294
1399
  I18nManager.registerTranslations("zh-TW", zh_TW_default);
1295
1400
  I18nManager.registerTranslations("zu", zu_default);
1296
1401
 
1402
+ // ../gov/aops-policy-sdk/dist/policy-resolver.js
1403
+ var BASE_PATH = "http://localhost".replace(/\/+$/, "");
1404
+
1405
+ class Configuration {
1406
+ configuration;
1407
+ constructor(configuration = {}) {
1408
+ this.configuration = configuration;
1409
+ }
1410
+ set config(configuration) {
1411
+ this.configuration = configuration;
1412
+ }
1413
+ get basePath() {
1414
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
1415
+ }
1416
+ get fetchApi() {
1417
+ return this.configuration.fetchApi;
1418
+ }
1419
+ get middleware() {
1420
+ return this.configuration.middleware || [];
1421
+ }
1422
+ get queryParamsStringify() {
1423
+ return this.configuration.queryParamsStringify || querystring;
1424
+ }
1425
+ get username() {
1426
+ return this.configuration.username;
1427
+ }
1428
+ get password() {
1429
+ return this.configuration.password;
1430
+ }
1431
+ get apiKey() {
1432
+ const apiKey = this.configuration.apiKey;
1433
+ if (apiKey) {
1434
+ return typeof apiKey === "function" ? apiKey : () => apiKey;
1435
+ }
1436
+ return;
1437
+ }
1438
+ get accessToken() {
1439
+ const accessToken = this.configuration.accessToken;
1440
+ if (accessToken) {
1441
+ return typeof accessToken === "function" ? accessToken : async () => accessToken;
1442
+ }
1443
+ return;
1444
+ }
1445
+ get headers() {
1446
+ return this.configuration.headers;
1447
+ }
1448
+ get credentials() {
1449
+ return this.configuration.credentials;
1450
+ }
1451
+ }
1452
+ var DefaultConfig = new Configuration;
1453
+
1454
+ class BaseAPI {
1455
+ configuration;
1456
+ static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i");
1457
+ middleware;
1458
+ constructor(configuration = DefaultConfig) {
1459
+ this.configuration = configuration;
1460
+ this.middleware = configuration.middleware;
1461
+ }
1462
+ withMiddleware(...middlewares) {
1463
+ const next = this.clone();
1464
+ next.middleware = next.middleware.concat(...middlewares);
1465
+ return next;
1466
+ }
1467
+ withPreMiddleware(...preMiddlewares) {
1468
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
1469
+ return this.withMiddleware(...middlewares);
1470
+ }
1471
+ withPostMiddleware(...postMiddlewares) {
1472
+ const middlewares = postMiddlewares.map((post) => ({ post }));
1473
+ return this.withMiddleware(...middlewares);
1474
+ }
1475
+ isJsonMime(mime) {
1476
+ if (!mime) {
1477
+ return false;
1478
+ }
1479
+ return BaseAPI.jsonRegex.test(mime);
1480
+ }
1481
+ async request(context, initOverrides) {
1482
+ const { url, init } = await this.createFetchParams(context, initOverrides);
1483
+ const response = await this.fetchApi(url, init);
1484
+ if (response && (response.status >= 200 && response.status < 300)) {
1485
+ return response;
1486
+ }
1487
+ throw new ResponseError(response, "Response returned an error code");
1488
+ }
1489
+ async createFetchParams(context, initOverrides) {
1490
+ let url = this.configuration.basePath + context.path;
1491
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
1492
+ url += "?" + this.configuration.queryParamsStringify(context.query);
1493
+ }
1494
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
1495
+ Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {});
1496
+ const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
1497
+ const initParams = {
1498
+ method: context.method,
1499
+ headers,
1500
+ body: context.body,
1501
+ credentials: this.configuration.credentials
1502
+ };
1503
+ const overriddenInit = {
1504
+ ...initParams,
1505
+ ...await initOverrideFn({
1506
+ init: initParams,
1507
+ context
1508
+ })
1509
+ };
1510
+ let body;
1511
+ if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
1512
+ body = overriddenInit.body;
1513
+ } else if (this.isJsonMime(headers["Content-Type"])) {
1514
+ body = JSON.stringify(overriddenInit.body);
1515
+ } else {
1516
+ body = overriddenInit.body;
1517
+ }
1518
+ const init = {
1519
+ ...overriddenInit,
1520
+ body
1521
+ };
1522
+ return { url, init };
1523
+ }
1524
+ fetchApi = async (url, init) => {
1525
+ let fetchParams = { url, init };
1526
+ for (const middleware of this.middleware) {
1527
+ if (middleware.pre) {
1528
+ fetchParams = await middleware.pre({
1529
+ fetch: this.fetchApi,
1530
+ ...fetchParams
1531
+ }) || fetchParams;
1532
+ }
1533
+ }
1534
+ let response = undefined;
1535
+ try {
1536
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
1537
+ } catch (e) {
1538
+ for (const middleware of this.middleware) {
1539
+ if (middleware.onError) {
1540
+ response = await middleware.onError({
1541
+ fetch: this.fetchApi,
1542
+ url: fetchParams.url,
1543
+ init: fetchParams.init,
1544
+ error: e,
1545
+ response: response ? response.clone() : undefined
1546
+ }) || response;
1547
+ }
1548
+ }
1549
+ if (response === undefined) {
1550
+ if (e instanceof Error) {
1551
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
1552
+ } else {
1553
+ throw e;
1554
+ }
1555
+ }
1556
+ }
1557
+ for (const middleware of this.middleware) {
1558
+ if (middleware.post) {
1559
+ response = await middleware.post({
1560
+ fetch: this.fetchApi,
1561
+ url: fetchParams.url,
1562
+ init: fetchParams.init,
1563
+ response: response.clone()
1564
+ }) || response;
1565
+ }
1566
+ }
1567
+ return response;
1568
+ };
1569
+ clone() {
1570
+ const constructor = this.constructor;
1571
+ const next = new constructor(this.configuration);
1572
+ next.middleware = this.middleware.slice();
1573
+ return next;
1574
+ }
1575
+ }
1576
+ function isBlob(value) {
1577
+ return typeof Blob !== "undefined" && value instanceof Blob;
1578
+ }
1579
+ function isFormData(value) {
1580
+ return typeof FormData !== "undefined" && value instanceof FormData;
1581
+ }
1582
+
1583
+ class ResponseError extends Error {
1584
+ response;
1585
+ name = "ResponseError";
1586
+ constructor(response, msg) {
1587
+ super(msg);
1588
+ this.response = response;
1589
+ }
1590
+ }
1591
+
1592
+ class FetchError extends Error {
1593
+ cause;
1594
+ name = "FetchError";
1595
+ constructor(cause, msg) {
1596
+ super(msg);
1597
+ this.cause = cause;
1598
+ }
1599
+ }
1600
+
1601
+ class RequiredError extends Error {
1602
+ field;
1603
+ name = "RequiredError";
1604
+ constructor(field, msg) {
1605
+ super(msg);
1606
+ this.field = field;
1607
+ }
1608
+ }
1609
+ function querystring(params, prefix = "") {
1610
+ return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
1611
+ }
1612
+ function querystringSingleKey(key, value, keyPrefix = "") {
1613
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
1614
+ if (value instanceof Array) {
1615
+ const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
1616
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
1617
+ }
1618
+ if (value instanceof Set) {
1619
+ const valueAsArray = Array.from(value);
1620
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
1621
+ }
1622
+ if (value instanceof Date) {
1623
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
1624
+ }
1625
+ if (value instanceof Object) {
1626
+ return querystring(value, fullKey);
1627
+ }
1628
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
1629
+ }
1630
+ function canConsumeForm(consumes) {
1631
+ for (const consume of consumes) {
1632
+ if (consume.contentType === "multipart/form-data") {
1633
+ return true;
1634
+ }
1635
+ }
1636
+ return false;
1637
+ }
1638
+
1639
+ class JSONApiResponse {
1640
+ raw;
1641
+ transformer;
1642
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
1643
+ this.raw = raw;
1644
+ this.transformer = transformer;
1645
+ }
1646
+ async value() {
1647
+ return this.transformer(await this.raw.json());
1648
+ }
1649
+ }
1650
+
1651
+ class VoidApiResponse {
1652
+ raw;
1653
+ constructor(raw) {
1654
+ this.raw = raw;
1655
+ }
1656
+ async value() {
1657
+ return;
1658
+ }
1659
+ }
1660
+ class TextApiResponse {
1661
+ raw;
1662
+ constructor(raw) {
1663
+ this.raw = raw;
1664
+ }
1665
+ async value() {
1666
+ return await this.raw.text();
1667
+ }
1668
+ }
1669
+ function ProductDtoFromJSON(json) {
1670
+ return ProductDtoFromJSONTyped(json, false);
1671
+ }
1672
+ function ProductDtoFromJSONTyped(json, ignoreDiscriminator) {
1673
+ if (json == null) {
1674
+ return json;
1675
+ }
1676
+ return {
1677
+ name: json["name"] == null ? undefined : json["name"],
1678
+ label: json["label"] == null ? undefined : json["label"],
1679
+ isRestricted: json["isRestricted"] == null ? undefined : json["isRestricted"],
1680
+ isCloud: json["isCloud"] == null ? undefined : json["isCloud"],
1681
+ isRemote: json["isRemote"] == null ? undefined : json["isRemote"]
1682
+ };
1683
+ }
1684
+ function ProductDtoToJSON(json) {
1685
+ return ProductDtoToJSONTyped(json, false);
1686
+ }
1687
+ function ProductDtoToJSONTyped(value, ignoreDiscriminator = false) {
1688
+ if (value == null) {
1689
+ return value;
1690
+ }
1691
+ return {
1692
+ name: value["name"],
1693
+ label: value["label"],
1694
+ isRestricted: value["isRestricted"],
1695
+ isCloud: value["isCloud"],
1696
+ isRemote: value["isRemote"]
1697
+ };
1698
+ }
1699
+ function GlobalPolicyDtoFromJSON(json) {
1700
+ return GlobalPolicyDtoFromJSONTyped(json, false);
1701
+ }
1702
+ function GlobalPolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
1703
+ if (json == null) {
1704
+ return json;
1705
+ }
1706
+ return {
1707
+ licenseType: json["licenseType"] == null ? undefined : json["licenseType"],
1708
+ identifier: json["identifier"] == null ? undefined : json["identifier"],
1709
+ policyNumber: json["policyNumber"] == null ? undefined : json["policyNumber"],
1710
+ product: json["product"] == null ? undefined : ProductDtoFromJSON(json["product"]),
1711
+ data: json["data"] == null ? undefined : json["data"]
1712
+ };
1713
+ }
1714
+ function GlobalPolicyDtoToJSON(json) {
1715
+ return GlobalPolicyDtoToJSONTyped(json, false);
1716
+ }
1717
+ function GlobalPolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
1718
+ if (value == null) {
1719
+ return value;
1720
+ }
1721
+ return {
1722
+ licenseType: value["licenseType"],
1723
+ identifier: value["identifier"],
1724
+ policyNumber: value["policyNumber"],
1725
+ product: ProductDtoToJSON(value["product"]),
1726
+ data: value["data"]
1727
+ };
1728
+ }
1729
+ function CreateGlobalPolicyWithFormDataRequestToJSON(json) {
1730
+ return CreateGlobalPolicyWithFormDataRequestToJSONTyped(json, false);
1731
+ }
1732
+ function CreateGlobalPolicyWithFormDataRequestToJSONTyped(value, ignoreDiscriminator = false) {
1733
+ if (value == null) {
1734
+ return value;
1735
+ }
1736
+ return {
1737
+ globalPolicy: GlobalPolicyDtoToJSON(value["globalPolicy"])
1738
+ };
1739
+ }
1740
+ function CreatePolicyRequestToJSON(json) {
1741
+ return CreatePolicyRequestToJSONTyped(json, false);
1742
+ }
1743
+ function CreatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
1744
+ if (value == null) {
1745
+ return value;
1746
+ }
1747
+ return {
1748
+ name: value["name"],
1749
+ description: value["description"],
1750
+ priority: value["priority"],
1751
+ availability: value["availability"],
1752
+ productName: value["productName"],
1753
+ data: value["data"]
1754
+ };
1755
+ }
1756
+ function FormDataDtoFromJSON(json) {
1757
+ return FormDataDtoFromJSONTyped(json, false);
1758
+ }
1759
+ function FormDataDtoFromJSONTyped(json, ignoreDiscriminator) {
1760
+ if (json == null) {
1761
+ return json;
1762
+ }
1763
+ return {
1764
+ policyIdentifier: json["policyIdentifier"] == null ? undefined : json["policyIdentifier"],
1765
+ data: json["data"] == null ? undefined : json["data"]
1766
+ };
1767
+ }
1768
+ function FormDataDtoToJSON(json) {
1769
+ return FormDataDtoToJSONTyped(json, false);
1770
+ }
1771
+ function FormDataDtoToJSONTyped(value, ignoreDiscriminator = false) {
1772
+ if (value == null) {
1773
+ return value;
1774
+ }
1775
+ return {
1776
+ policyIdentifier: value["policyIdentifier"],
1777
+ data: value["data"]
1778
+ };
1779
+ }
1780
+ function PolicyDtoFromJSON(json) {
1781
+ return PolicyDtoFromJSONTyped(json, false);
1782
+ }
1783
+ function PolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
1784
+ if (json == null) {
1785
+ return json;
1786
+ }
1787
+ return {
1788
+ name: json["name"] == null ? undefined : json["name"],
1789
+ identifier: json["identifier"] == null ? undefined : json["identifier"],
1790
+ description: json["description"] == null ? undefined : json["description"],
1791
+ priority: json["priority"] == null ? undefined : json["priority"],
1792
+ availability: json["availability"] == null ? undefined : json["availability"],
1793
+ product: json["product"] == null ? undefined : ProductDtoFromJSON(json["product"]),
1794
+ data: json["data"] == null ? undefined : FormDataDtoFromJSON(json["data"])
1795
+ };
1796
+ }
1797
+ function PolicyDtoToJSON(json) {
1798
+ return PolicyDtoToJSONTyped(json, false);
1799
+ }
1800
+ function PolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
1801
+ if (value == null) {
1802
+ return value;
1803
+ }
1804
+ return {
1805
+ name: value["name"],
1806
+ identifier: value["identifier"],
1807
+ description: value["description"],
1808
+ priority: value["priority"],
1809
+ availability: value["availability"],
1810
+ product: ProductDtoToJSON(value["product"]),
1811
+ data: FormDataDtoToJSON(value["data"])
1812
+ };
1813
+ }
1814
+ function CreatePolicyWithFormDataRequestToJSON(json) {
1815
+ return CreatePolicyWithFormDataRequestToJSONTyped(json, false);
1816
+ }
1817
+ function CreatePolicyWithFormDataRequestToJSONTyped(value, ignoreDiscriminator = false) {
1818
+ if (value == null) {
1819
+ return value;
1820
+ }
1821
+ return {
1822
+ policy: PolicyDtoToJSON(value["policy"]),
1823
+ policyFormData: FormDataDtoToJSON(value["policyFormData"])
1824
+ };
1825
+ }
1826
+ function DeployedPolicyDtoToJSON(json) {
1827
+ return DeployedPolicyDtoToJSONTyped(json, false);
1828
+ }
1829
+ function DeployedPolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
1830
+ if (value == null) {
1831
+ return value;
1832
+ }
1833
+ return {
1834
+ licenseType: value["licenseType"],
1835
+ productName: value["productName"],
1836
+ tenantIdentifier: value["tenantIdentifier"],
1837
+ userIdentifier: value["userIdentifier"]
1838
+ };
1839
+ }
1840
+ function DeployedPolicyWithoutUserDtoToJSON(json) {
1841
+ return DeployedPolicyWithoutUserDtoToJSONTyped(json, false);
1842
+ }
1843
+ function DeployedPolicyWithoutUserDtoToJSONTyped(value, ignoreDiscriminator = false) {
1844
+ if (value == null) {
1845
+ return value;
1846
+ }
1847
+ return {
1848
+ licenseType: value["licenseType"],
1849
+ productName: value["productName"],
1850
+ tenantIdentifier: value["tenantIdentifier"]
1851
+ };
1852
+ }
1853
+ function DeploymentLevelFromJSON(json) {
1854
+ return DeploymentLevelFromJSONTyped(json, false);
1855
+ }
1856
+ function DeploymentLevelFromJSONTyped(json, ignoreDiscriminator) {
1857
+ return json;
1858
+ }
1859
+ function TenantPolicyDtoFromJSON(json) {
1860
+ return TenantPolicyDtoFromJSONTyped(json, false);
1861
+ }
1862
+ function TenantPolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
1863
+ if (json == null) {
1864
+ return json;
1865
+ }
1866
+ return {
1867
+ tenantIdentifier: json["tenantIdentifier"] == null ? undefined : json["tenantIdentifier"],
1868
+ policyIdentifier: json["policyIdentifier"] == null ? undefined : json["policyIdentifier"],
1869
+ productIdentifier: json["productIdentifier"] == null ? undefined : json["productIdentifier"],
1870
+ licenseTypeIdentifier: json["licenseTypeIdentifier"] == null ? undefined : json["licenseTypeIdentifier"],
1871
+ tenantName: json["tenantName"] == null ? undefined : json["tenantName"]
1872
+ };
1873
+ }
1874
+ function GroupPolicyDtoFromJSON(json) {
1875
+ return GroupPolicyDtoFromJSONTyped(json, false);
1876
+ }
1877
+ function GroupPolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
1878
+ if (json == null) {
1879
+ return json;
1880
+ }
1881
+ return {
1882
+ policyIdentifier: json["policyIdentifier"] == null ? undefined : json["policyIdentifier"],
1883
+ productIdentifier: json["productIdentifier"] == null ? undefined : json["productIdentifier"],
1884
+ groupId: json["groupId"] == null ? undefined : json["groupId"],
1885
+ groupName: json["groupName"] == null ? undefined : json["groupName"]
1886
+ };
1887
+ }
1888
+ function UserPolicyDtoFromJSON(json) {
1889
+ return UserPolicyDtoFromJSONTyped(json, false);
1890
+ }
1891
+ function UserPolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
1892
+ if (json == null) {
1893
+ return json;
1894
+ }
1895
+ return {
1896
+ policyIdentifier: json["policyIdentifier"] == null ? undefined : json["policyIdentifier"],
1897
+ productIdentifier: json["productIdentifier"] == null ? undefined : json["productIdentifier"],
1898
+ userId: json["userId"] == null ? undefined : json["userId"],
1899
+ userName: json["userName"] == null ? undefined : json["userName"]
1900
+ };
1901
+ }
1902
+ function FederatedPolicyDtoFromJSON(json) {
1903
+ return FederatedPolicyDtoFromJSONTyped(json, false);
1904
+ }
1905
+ function FederatedPolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
1906
+ if (json == null) {
1907
+ return json;
1908
+ }
1909
+ return {
1910
+ name: json["name"] == null ? undefined : json["name"],
1911
+ identifier: json["identifier"] == null ? undefined : json["identifier"],
1912
+ product: json["product"] == null ? undefined : ProductDtoFromJSON(json["product"]),
1913
+ description: json["description"] == null ? undefined : json["description"],
1914
+ priority: json["priority"] == null ? undefined : json["priority"],
1915
+ availability: json["availability"] == null ? undefined : json["availability"],
1916
+ tenantPolicies: json["tenantPolicies"] == null ? undefined : json["tenantPolicies"].map(TenantPolicyDtoFromJSON),
1917
+ userPolicies: json["userPolicies"] == null ? undefined : json["userPolicies"].map(UserPolicyDtoFromJSON),
1918
+ groupPolicies: json["groupPolicies"] == null ? undefined : json["groupPolicies"].map(GroupPolicyDtoFromJSON)
1919
+ };
1920
+ }
1921
+ function FederatedPolicyDtoPagedResultFromJSON(json) {
1922
+ return FederatedPolicyDtoPagedResultFromJSONTyped(json, false);
1923
+ }
1924
+ function FederatedPolicyDtoPagedResultFromJSONTyped(json, ignoreDiscriminator) {
1925
+ if (json == null) {
1926
+ return json;
1927
+ }
1928
+ return {
1929
+ totalCount: json["totalCount"] == null ? undefined : json["totalCount"],
1930
+ result: json["result"] == null ? undefined : json["result"].map(FederatedPolicyDtoFromJSON)
1931
+ };
1932
+ }
1933
+ function ImportPolicyRequestFromJSON(json) {
1934
+ return ImportPolicyRequestFromJSONTyped(json, false);
1935
+ }
1936
+ function ImportPolicyRequestFromJSONTyped(json, ignoreDiscriminator) {
1937
+ if (json == null) {
1938
+ return json;
1939
+ }
1940
+ return {
1941
+ productName: json["product-name"] == null ? undefined : json["product-name"],
1942
+ policyName: json["policy-name"] == null ? undefined : json["policy-name"],
1943
+ version: json["version"] == null ? undefined : json["version"],
1944
+ data: json["data"] == null ? undefined : json["data"]
1945
+ };
1946
+ }
1947
+ function PolicyDtoPagedResultFromJSON(json) {
1948
+ return PolicyDtoPagedResultFromJSONTyped(json, false);
1949
+ }
1950
+ function PolicyDtoPagedResultFromJSONTyped(json, ignoreDiscriminator) {
1951
+ if (json == null) {
1952
+ return json;
1953
+ }
1954
+ return {
1955
+ totalCount: json["totalCount"] == null ? undefined : json["totalCount"],
1956
+ result: json["result"] == null ? undefined : json["result"].map(PolicyDtoFromJSON)
1957
+ };
1958
+ }
1959
+ function PolicyExportResponseFromJSON(json) {
1960
+ return PolicyExportResponseFromJSONTyped(json, false);
1961
+ }
1962
+ function PolicyExportResponseFromJSONTyped(json, ignoreDiscriminator) {
1963
+ if (json == null) {
1964
+ return json;
1965
+ }
1966
+ return {
1967
+ identifier: json["identifier"] == null ? undefined : json["identifier"],
1968
+ name: json["name"] == null ? undefined : json["name"],
1969
+ availability: json["availability"] == null ? undefined : json["availability"],
1970
+ data: json["data"] == null ? undefined : json["data"],
1971
+ priority: json["priority"] == null ? undefined : json["priority"],
1972
+ deploymentLevel: json["deploymentLevel"] == null ? undefined : DeploymentLevelFromJSON(json["deploymentLevel"])
1973
+ };
1974
+ }
1975
+ function PolicyInfoDtoFromJSON(json) {
1976
+ return PolicyInfoDtoFromJSONTyped(json, false);
1977
+ }
1978
+ function PolicyInfoDtoFromJSONTyped(json, ignoreDiscriminator) {
1979
+ if (json == null) {
1980
+ return json;
1981
+ }
1982
+ return {
1983
+ name: json["name"] == null ? undefined : json["name"],
1984
+ identifier: json["identifier"] == null ? undefined : json["identifier"],
1985
+ product: json["product"] == null ? undefined : json["product"]
1986
+ };
1987
+ }
1988
+ function PolicyUsageDataFromJSON(json) {
1989
+ return PolicyUsageDataFromJSONTyped(json, false);
1990
+ }
1991
+ function PolicyUsageDataFromJSONTyped(json, ignoreDiscriminator) {
1992
+ if (json == null) {
1993
+ return json;
1994
+ }
1995
+ return {
1996
+ tenants: json["tenants"] == null ? undefined : json["tenants"],
1997
+ users: json["users"] == null ? undefined : json["users"],
1998
+ groups: json["groups"] == null ? undefined : json["groups"]
1999
+ };
2000
+ }
2001
+ function UpdatePolicyRequestToJSON(json) {
2002
+ return UpdatePolicyRequestToJSONTyped(json, false);
2003
+ }
2004
+ function UpdatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
2005
+ if (value == null) {
2006
+ return value;
2007
+ }
2008
+ return {
2009
+ name: value["name"],
2010
+ identifier: value["identifier"],
2011
+ description: value["description"],
2012
+ priority: value["priority"],
2013
+ availability: value["availability"],
2014
+ productName: value["productName"],
2015
+ data: value["data"]
2016
+ };
2017
+ }
2018
+
2019
+ class PolicyApi extends BaseAPI {
2020
+ async policyCreateDefaultPolicyForAllProductsRaw(initOverrides) {
2021
+ const queryParameters = {};
2022
+ const headerParameters = {};
2023
+ if (this.configuration && this.configuration.apiKey) {
2024
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2025
+ }
2026
+ let urlPath = `/api/Policy/default`;
2027
+ const response = await this.request({
2028
+ path: urlPath,
2029
+ method: "POST",
2030
+ headers: headerParameters,
2031
+ query: queryParameters
2032
+ }, initOverrides);
2033
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2034
+ }
2035
+ async policyCreateDefaultPolicyForAllProducts(initOverrides) {
2036
+ const response = await this.policyCreateDefaultPolicyForAllProductsRaw(initOverrides);
2037
+ return await response.value();
2038
+ }
2039
+ async policyCreateFormDataRaw(requestParameters, initOverrides) {
2040
+ if (requestParameters["policyIdentifier"] == null) {
2041
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyCreateFormData().');
2042
+ }
2043
+ const queryParameters = {};
2044
+ const headerParameters = {};
2045
+ headerParameters["Content-Type"] = "application/json";
2046
+ if (this.configuration && this.configuration.apiKey) {
2047
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2048
+ }
2049
+ let urlPath = `/api/Policy/form-data/{policyIdentifier}`;
2050
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2051
+ const response = await this.request({
2052
+ path: urlPath,
2053
+ method: "PUT",
2054
+ headers: headerParameters,
2055
+ query: queryParameters,
2056
+ body: requestParameters["body"]
2057
+ }, initOverrides);
2058
+ if (this.isJsonMime(response.headers.get("content-type"))) {
2059
+ return new JSONApiResponse(response);
2060
+ } else {
2061
+ return new TextApiResponse(response);
2062
+ }
2063
+ }
2064
+ async policyCreateFormData(requestParameters, initOverrides) {
2065
+ const response = await this.policyCreateFormDataRaw(requestParameters, initOverrides);
2066
+ return await response.value();
2067
+ }
2068
+ async policyCreateGlobalPolicyRaw(requestParameters, initOverrides) {
2069
+ const queryParameters = {};
2070
+ const headerParameters = {};
2071
+ headerParameters["Content-Type"] = "application/json";
2072
+ if (this.configuration && this.configuration.apiKey) {
2073
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2074
+ }
2075
+ let urlPath = `/api/Policy/global`;
2076
+ const response = await this.request({
2077
+ path: urlPath,
2078
+ method: "POST",
2079
+ headers: headerParameters,
2080
+ query: queryParameters,
2081
+ body: CreateGlobalPolicyWithFormDataRequestToJSON(requestParameters["createGlobalPolicyWithFormDataRequest"])
2082
+ }, initOverrides);
2083
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
2084
+ }
2085
+ async policyCreateGlobalPolicy(requestParameters = {}, initOverrides) {
2086
+ const response = await this.policyCreateGlobalPolicyRaw(requestParameters, initOverrides);
2087
+ return await response.value();
2088
+ }
2089
+ async policyCreatePolicyRaw(requestParameters, initOverrides) {
2090
+ const queryParameters = {};
2091
+ if (requestParameters["telemetryFlowId"] != null) {
2092
+ queryParameters["telemetryFlowId"] = requestParameters["telemetryFlowId"];
2093
+ }
2094
+ const headerParameters = {};
2095
+ headerParameters["Content-Type"] = "application/json";
2096
+ if (this.configuration && this.configuration.apiKey) {
2097
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2098
+ }
2099
+ let urlPath = `/api/Policy`;
2100
+ const response = await this.request({
2101
+ path: urlPath,
2102
+ method: "POST",
2103
+ headers: headerParameters,
2104
+ query: queryParameters,
2105
+ body: CreatePolicyWithFormDataRequestToJSON(requestParameters["createPolicyWithFormDataRequest"])
2106
+ }, initOverrides);
2107
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2108
+ }
2109
+ async policyCreatePolicy(requestParameters = {}, initOverrides) {
2110
+ const response = await this.policyCreatePolicyRaw(requestParameters, initOverrides);
2111
+ return await response.value();
2112
+ }
2113
+ async policyCreatePolicyV2Raw(requestParameters, initOverrides) {
2114
+ const queryParameters = {};
2115
+ if (requestParameters["telemetryFlowId"] != null) {
2116
+ queryParameters["telemetryFlowId"] = requestParameters["telemetryFlowId"];
2117
+ }
2118
+ const headerParameters = {};
2119
+ headerParameters["Content-Type"] = "application/json";
2120
+ if (this.configuration && this.configuration.apiKey) {
2121
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2122
+ }
2123
+ let urlPath = `/api/Policy/v2/create`;
2124
+ const response = await this.request({
2125
+ path: urlPath,
2126
+ method: "POST",
2127
+ headers: headerParameters,
2128
+ query: queryParameters,
2129
+ body: CreatePolicyRequestToJSON(requestParameters["createPolicyRequest"])
2130
+ }, initOverrides);
2131
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2132
+ }
2133
+ async policyCreatePolicyV2(requestParameters = {}, initOverrides) {
2134
+ const response = await this.policyCreatePolicyV2Raw(requestParameters, initOverrides);
2135
+ return await response.value();
2136
+ }
2137
+ async policyDeletePolicyRaw(requestParameters, initOverrides) {
2138
+ if (requestParameters["policyIdentifier"] == null) {
2139
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyDeletePolicy().');
2140
+ }
2141
+ const queryParameters = {};
2142
+ const headerParameters = {};
2143
+ if (this.configuration && this.configuration.apiKey) {
2144
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2145
+ }
2146
+ let urlPath = `/api/Policy/{policyIdentifier}`;
2147
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2148
+ const response = await this.request({
2149
+ path: urlPath,
2150
+ method: "DELETE",
2151
+ headers: headerParameters,
2152
+ query: queryParameters
2153
+ }, initOverrides);
2154
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2155
+ }
2156
+ async policyDeletePolicy(requestParameters, initOverrides) {
2157
+ const response = await this.policyDeletePolicyRaw(requestParameters, initOverrides);
2158
+ return await response.value();
2159
+ }
2160
+ async policyDeletePolicyByProductNameAndPolicyNameRaw(requestParameters, initOverrides) {
2161
+ if (requestParameters["productName"] == null) {
2162
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyDeletePolicyByProductNameAndPolicyName().');
2163
+ }
2164
+ if (requestParameters["policyName"] == null) {
2165
+ throw new RequiredError("policyName", 'Required parameter "policyName" was null or undefined when calling policyDeletePolicyByProductNameAndPolicyName().');
2166
+ }
2167
+ const queryParameters = {};
2168
+ const headerParameters = {};
2169
+ if (this.configuration && this.configuration.apiKey) {
2170
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2171
+ }
2172
+ let urlPath = `/api/Policy/product/{productName}/policy/{policyName}`;
2173
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
2174
+ urlPath = urlPath.replace(`{${"policyName"}}`, encodeURIComponent(String(requestParameters["policyName"])));
2175
+ const response = await this.request({
2176
+ path: urlPath,
2177
+ method: "DELETE",
2178
+ headers: headerParameters,
2179
+ query: queryParameters
2180
+ }, initOverrides);
2181
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2182
+ }
2183
+ async policyDeletePolicyByProductNameAndPolicyName(requestParameters, initOverrides) {
2184
+ const response = await this.policyDeletePolicyByProductNameAndPolicyNameRaw(requestParameters, initOverrides);
2185
+ return await response.value();
2186
+ }
2187
+ async policyDownloadPolicyByIdentifierRaw(requestParameters, initOverrides) {
2188
+ if (requestParameters["policyIdentifier"] == null) {
2189
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyDownloadPolicyByIdentifier().');
2190
+ }
2191
+ const queryParameters = {};
2192
+ const headerParameters = {};
2193
+ if (this.configuration && this.configuration.apiKey) {
2194
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2195
+ }
2196
+ let urlPath = `/api/Policy/{policyIdentifier}/download`;
2197
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2198
+ const response = await this.request({
2199
+ path: urlPath,
2200
+ method: "GET",
2201
+ headers: headerParameters,
2202
+ query: queryParameters
2203
+ }, initOverrides);
2204
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
2205
+ }
2206
+ async policyDownloadPolicyByIdentifier(requestParameters, initOverrides) {
2207
+ const response = await this.policyDownloadPolicyByIdentifierRaw(requestParameters, initOverrides);
2208
+ return await response.value();
2209
+ }
2210
+ async policyGetAllPoliciesRaw(initOverrides) {
2211
+ const queryParameters = {};
2212
+ const headerParameters = {};
2213
+ if (this.configuration && this.configuration.apiKey) {
2214
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2215
+ }
2216
+ let urlPath = `/api/Policy`;
2217
+ const response = await this.request({
2218
+ path: urlPath,
2219
+ method: "GET",
2220
+ headers: headerParameters,
2221
+ query: queryParameters
2222
+ }, initOverrides);
2223
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyDtoFromJSON));
2224
+ }
2225
+ async policyGetAllPolicies(initOverrides) {
2226
+ const response = await this.policyGetAllPoliciesRaw(initOverrides);
2227
+ return await response.value();
2228
+ }
2229
+ async policyGetAllPoliciesByProductIdRaw(requestParameters, initOverrides) {
2230
+ if (requestParameters["productIdentifier"] == null) {
2231
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetAllPoliciesByProductId().');
2232
+ }
2233
+ const queryParameters = {};
2234
+ const headerParameters = {};
2235
+ if (this.configuration && this.configuration.apiKey) {
2236
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2237
+ }
2238
+ let urlPath = `/api/Policy/{productIdentifier}`;
2239
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
2240
+ const response = await this.request({
2241
+ path: urlPath,
2242
+ method: "GET",
2243
+ headers: headerParameters,
2244
+ query: queryParameters
2245
+ }, initOverrides);
2246
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyDtoFromJSON));
2247
+ }
2248
+ async policyGetAllPoliciesByProductId(requestParameters, initOverrides) {
2249
+ const response = await this.policyGetAllPoliciesByProductIdRaw(requestParameters, initOverrides);
2250
+ return await response.value();
2251
+ }
2252
+ async policyGetAllPoliciesByQueryOptionsRaw(requestParameters, initOverrides) {
2253
+ const queryParameters = {};
2254
+ if (requestParameters["productLabel"] != null) {
2255
+ queryParameters["productLabel"] = requestParameters["productLabel"];
2256
+ }
2257
+ if (requestParameters["productName"] != null) {
2258
+ queryParameters["productName"] = requestParameters["productName"];
2259
+ }
2260
+ if (requestParameters["productNames"] != null) {
2261
+ queryParameters["productNames"] = requestParameters["productNames"];
2262
+ }
2263
+ if (requestParameters["sortBy"] != null) {
2264
+ queryParameters["sortBy"] = requestParameters["sortBy"];
2265
+ }
2266
+ if (requestParameters["sortOrder"] != null) {
2267
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
2268
+ }
2269
+ if (requestParameters["pageIndex"] != null) {
2270
+ queryParameters["pageIndex"] = requestParameters["pageIndex"];
2271
+ }
2272
+ if (requestParameters["pageSize"] != null) {
2273
+ queryParameters["pageSize"] = requestParameters["pageSize"];
2274
+ }
2275
+ if (requestParameters["searchTerm"] != null) {
2276
+ queryParameters["searchTerm"] = requestParameters["searchTerm"];
2277
+ }
2278
+ const headerParameters = {};
2279
+ if (this.configuration && this.configuration.apiKey) {
2280
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2281
+ }
2282
+ let urlPath = `/api/Policy/paged`;
2283
+ const response = await this.request({
2284
+ path: urlPath,
2285
+ method: "GET",
2286
+ headers: headerParameters,
2287
+ query: queryParameters
2288
+ }, initOverrides);
2289
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoPagedResultFromJSON(jsonValue));
2290
+ }
2291
+ async policyGetAllPoliciesByQueryOptions(requestParameters = {}, initOverrides) {
2292
+ const response = await this.policyGetAllPoliciesByQueryOptionsRaw(requestParameters, initOverrides);
2293
+ return await response.value();
2294
+ }
2295
+ async policyGetAllRulesForProductRaw(requestParameters, initOverrides) {
2296
+ if (requestParameters["licenseType"] == null) {
2297
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetAllRulesForProduct().');
2298
+ }
2299
+ if (requestParameters["productName"] == null) {
2300
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyGetAllRulesForProduct().');
2301
+ }
2302
+ if (requestParameters["tenantIdentifier"] == null) {
2303
+ throw new RequiredError("tenantIdentifier", 'Required parameter "tenantIdentifier" was null or undefined when calling policyGetAllRulesForProduct().');
2304
+ }
2305
+ const queryParameters = {};
2306
+ const headerParameters = {};
2307
+ if (this.configuration && this.configuration.apiKey) {
2308
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2309
+ }
2310
+ let urlPath = `/api/Policy/all/license/{licenseType}/product/{productName}/tenant/{tenantIdentifier}`;
2311
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
2312
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
2313
+ urlPath = urlPath.replace(`{${"tenantIdentifier"}}`, encodeURIComponent(String(requestParameters["tenantIdentifier"])));
2314
+ const response = await this.request({
2315
+ path: urlPath,
2316
+ method: "GET",
2317
+ headers: headerParameters,
2318
+ query: queryParameters
2319
+ }, initOverrides);
2320
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyExportResponseFromJSON));
2321
+ }
2322
+ async policyGetAllRulesForProduct(requestParameters, initOverrides) {
2323
+ const response = await this.policyGetAllRulesForProductRaw(requestParameters, initOverrides);
2324
+ return await response.value();
2325
+ }
2326
+ async policyGetDeployedPolicyRaw(requestParameters, initOverrides) {
2327
+ const queryParameters = {};
2328
+ const headerParameters = {};
2329
+ headerParameters["Content-Type"] = "application/json";
2330
+ if (requestParameters["xUiPathClientVersion"] != null) {
2331
+ headerParameters["x-UiPath-ClientVersion"] = String(requestParameters["xUiPathClientVersion"]);
2332
+ }
2333
+ if (this.configuration && this.configuration.apiKey) {
2334
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2335
+ }
2336
+ let urlPath = `/api/Policy/deployed-policy`;
2337
+ const response = await this.request({
2338
+ path: urlPath,
2339
+ method: "POST",
2340
+ headers: headerParameters,
2341
+ query: queryParameters,
2342
+ body: DeployedPolicyDtoToJSON(requestParameters["deployedPolicyDto"])
2343
+ }, initOverrides);
2344
+ return new VoidApiResponse(response);
2345
+ }
2346
+ async policyGetDeployedPolicy(requestParameters = {}, initOverrides) {
2347
+ await this.policyGetDeployedPolicyRaw(requestParameters, initOverrides);
2348
+ }
2349
+ async policyGetDeployedTenantPoliciesRaw(requestParameters, initOverrides) {
2350
+ const queryParameters = {};
2351
+ const headerParameters = {};
2352
+ headerParameters["Content-Type"] = "application/json";
2353
+ if (requestParameters["xUiPathClientVersion"] != null) {
2354
+ headerParameters["x-UiPath-ClientVersion"] = String(requestParameters["xUiPathClientVersion"]);
2355
+ }
2356
+ if (this.configuration && this.configuration.apiKey) {
2357
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2358
+ }
2359
+ let urlPath = `/api/Policy/deployed-policy/tenant`;
2360
+ const response = await this.request({
2361
+ path: urlPath,
2362
+ method: "POST",
2363
+ headers: headerParameters,
2364
+ query: queryParameters,
2365
+ body: DeployedPolicyWithoutUserDtoToJSON(requestParameters["deployedPolicyWithoutUserDto"])
2366
+ }, initOverrides);
2367
+ return new VoidApiResponse(response);
2368
+ }
2369
+ async policyGetDeployedTenantPolicies(requestParameters = {}, initOverrides) {
2370
+ await this.policyGetDeployedTenantPoliciesRaw(requestParameters, initOverrides);
2371
+ }
2372
+ async policyGetFederatedPoliciesByQueryOptionsRaw(requestParameters, initOverrides) {
2373
+ const queryParameters = {};
2374
+ if (requestParameters["productLabel"] != null) {
2375
+ queryParameters["productLabel"] = requestParameters["productLabel"];
2376
+ }
2377
+ if (requestParameters["productName"] != null) {
2378
+ queryParameters["productName"] = requestParameters["productName"];
2379
+ }
2380
+ if (requestParameters["productNames"] != null) {
2381
+ queryParameters["productNames"] = requestParameters["productNames"];
2382
+ }
2383
+ if (requestParameters["sortBy"] != null) {
2384
+ queryParameters["sortBy"] = requestParameters["sortBy"];
2385
+ }
2386
+ if (requestParameters["sortOrder"] != null) {
2387
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
2388
+ }
2389
+ if (requestParameters["pageIndex"] != null) {
2390
+ queryParameters["pageIndex"] = requestParameters["pageIndex"];
2391
+ }
2392
+ if (requestParameters["pageSize"] != null) {
2393
+ queryParameters["pageSize"] = requestParameters["pageSize"];
2394
+ }
2395
+ if (requestParameters["searchTerm"] != null) {
2396
+ queryParameters["searchTerm"] = requestParameters["searchTerm"];
2397
+ }
2398
+ const headerParameters = {};
2399
+ if (this.configuration && this.configuration.apiKey) {
2400
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2401
+ }
2402
+ let urlPath = `/api/Policy/federated/paged`;
2403
+ const response = await this.request({
2404
+ path: urlPath,
2405
+ method: "GET",
2406
+ headers: headerParameters,
2407
+ query: queryParameters
2408
+ }, initOverrides);
2409
+ return new JSONApiResponse(response, (jsonValue) => FederatedPolicyDtoPagedResultFromJSON(jsonValue));
2410
+ }
2411
+ async policyGetFederatedPoliciesByQueryOptions(requestParameters = {}, initOverrides) {
2412
+ const response = await this.policyGetFederatedPoliciesByQueryOptionsRaw(requestParameters, initOverrides);
2413
+ return await response.value();
2414
+ }
2415
+ async policyGetFormDataByPolicyIdRaw(requestParameters, initOverrides) {
2416
+ if (requestParameters["policyIdentifier"] == null) {
2417
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetFormDataByPolicyId().');
2418
+ }
2419
+ const queryParameters = {};
2420
+ const headerParameters = {};
2421
+ if (this.configuration && this.configuration.apiKey) {
2422
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2423
+ }
2424
+ let urlPath = `/api/Policy/form-data/{policyIdentifier}`;
2425
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2426
+ const response = await this.request({
2427
+ path: urlPath,
2428
+ method: "GET",
2429
+ headers: headerParameters,
2430
+ query: queryParameters
2431
+ }, initOverrides);
2432
+ if (this.isJsonMime(response.headers.get("content-type"))) {
2433
+ return new JSONApiResponse(response);
2434
+ } else {
2435
+ return new TextApiResponse(response);
2436
+ }
2437
+ }
2438
+ async policyGetFormDataByPolicyId(requestParameters, initOverrides) {
2439
+ const response = await this.policyGetFormDataByPolicyIdRaw(requestParameters, initOverrides);
2440
+ return await response.value();
2441
+ }
2442
+ async policyGetGlobalPolicyByLicenseTypeAndProductNameRaw(requestParameters, initOverrides) {
2443
+ if (requestParameters["licenseType"] == null) {
2444
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetGlobalPolicyByLicenseTypeAndProductName().');
2445
+ }
2446
+ if (requestParameters["productIdentifier"] == null) {
2447
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetGlobalPolicyByLicenseTypeAndProductName().');
2448
+ }
2449
+ const queryParameters = {};
2450
+ const headerParameters = {};
2451
+ if (this.configuration && this.configuration.apiKey) {
2452
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2453
+ }
2454
+ let urlPath = `/api/Policy/global/license/{licenseType}/product/{productIdentifier}`;
2455
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
2456
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
2457
+ const response = await this.request({
2458
+ path: urlPath,
2459
+ method: "GET",
2460
+ headers: headerParameters,
2461
+ query: queryParameters
2462
+ }, initOverrides);
2463
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
2464
+ }
2465
+ async policyGetGlobalPolicyByLicenseTypeAndProductName(requestParameters, initOverrides) {
2466
+ const response = await this.policyGetGlobalPolicyByLicenseTypeAndProductNameRaw(requestParameters, initOverrides);
2467
+ return await response.value();
2468
+ }
2469
+ async policyGetGroupPoliciesForAllProductsRaw(requestParameters, initOverrides) {
2470
+ if (requestParameters["identifier"] == null) {
2471
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetGroupPoliciesForAllProducts().');
2472
+ }
2473
+ const queryParameters = {};
2474
+ const headerParameters = {};
2475
+ if (this.configuration && this.configuration.apiKey) {
2476
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2477
+ }
2478
+ let urlPath = `/api/Policy/group/{identifier}`;
2479
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
2480
+ const response = await this.request({
2481
+ path: urlPath,
2482
+ method: "GET",
2483
+ headers: headerParameters,
2484
+ query: queryParameters
2485
+ }, initOverrides);
2486
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(GroupPolicyDtoFromJSON));
2487
+ }
2488
+ async policyGetGroupPoliciesForAllProducts(requestParameters, initOverrides) {
2489
+ const response = await this.policyGetGroupPoliciesForAllProductsRaw(requestParameters, initOverrides);
2490
+ return await response.value();
2491
+ }
2492
+ async policyGetPoliciesByProductIdentifiersRaw(requestParameters, initOverrides) {
2493
+ const queryParameters = {};
2494
+ if (requestParameters["ids"] != null) {
2495
+ queryParameters["ids"] = requestParameters["ids"];
2496
+ }
2497
+ const headerParameters = {};
2498
+ if (this.configuration && this.configuration.apiKey) {
2499
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2500
+ }
2501
+ let urlPath = `/api/Policy/filter/products`;
2502
+ const response = await this.request({
2503
+ path: urlPath,
2504
+ method: "GET",
2505
+ headers: headerParameters,
2506
+ query: queryParameters
2507
+ }, initOverrides);
2508
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyInfoDtoFromJSON));
2509
+ }
2510
+ async policyGetPoliciesByProductIdentifiers(requestParameters = {}, initOverrides) {
2511
+ const response = await this.policyGetPoliciesByProductIdentifiersRaw(requestParameters, initOverrides);
2512
+ return await response.value();
2513
+ }
2514
+ async policyGetPolicyByIdRaw(requestParameters, initOverrides) {
2515
+ if (requestParameters["policyIdentifier"] == null) {
2516
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyById().');
2517
+ }
2518
+ const queryParameters = {};
2519
+ const headerParameters = {};
2520
+ if (this.configuration && this.configuration.apiKey) {
2521
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2522
+ }
2523
+ let urlPath = `/api/Policy/id/{policyIdentifier}`;
2524
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2525
+ const response = await this.request({
2526
+ path: urlPath,
2527
+ method: "GET",
2528
+ headers: headerParameters,
2529
+ query: queryParameters
2530
+ }, initOverrides);
2531
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2532
+ }
2533
+ async policyGetPolicyById(requestParameters, initOverrides) {
2534
+ const response = await this.policyGetPolicyByIdRaw(requestParameters, initOverrides);
2535
+ return await response.value();
2536
+ }
2537
+ async policyGetPolicyByNameAndProductIdentifierRaw(requestParameters, initOverrides) {
2538
+ if (requestParameters["policyName"] == null) {
2539
+ throw new RequiredError("policyName", 'Required parameter "policyName" was null or undefined when calling policyGetPolicyByNameAndProductIdentifier().');
2540
+ }
2541
+ if (requestParameters["productIdentifier"] == null) {
2542
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetPolicyByNameAndProductIdentifier().');
2543
+ }
2544
+ const queryParameters = {};
2545
+ const headerParameters = {};
2546
+ if (this.configuration && this.configuration.apiKey) {
2547
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2548
+ }
2549
+ let urlPath = `/api/Policy/{policyName}/product/{productIdentifier}`;
2550
+ urlPath = urlPath.replace(`{${"policyName"}}`, encodeURIComponent(String(requestParameters["policyName"])));
2551
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
2552
+ const response = await this.request({
2553
+ path: urlPath,
2554
+ method: "GET",
2555
+ headers: headerParameters,
2556
+ query: queryParameters
2557
+ }, initOverrides);
2558
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
2559
+ }
2560
+ async policyGetPolicyByNameAndProductIdentifier(requestParameters, initOverrides) {
2561
+ const response = await this.policyGetPolicyByNameAndProductIdentifierRaw(requestParameters, initOverrides);
2562
+ return await response.value();
2563
+ }
2564
+ async policyGetPolicyDataByIdentifierRaw(requestParameters, initOverrides) {
2565
+ if (requestParameters["policyIdentifier"] == null) {
2566
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyDataByIdentifier().');
2567
+ }
2568
+ const queryParameters = {};
2569
+ const headerParameters = {};
2570
+ if (this.configuration && this.configuration.apiKey) {
2571
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2572
+ }
2573
+ let urlPath = `/api/Policy/data/{policyIdentifier}`;
2574
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2575
+ const response = await this.request({
2576
+ path: urlPath,
2577
+ method: "GET",
2578
+ headers: headerParameters,
2579
+ query: queryParameters
2580
+ }, initOverrides);
2581
+ return new JSONApiResponse(response, (jsonValue) => ImportPolicyRequestFromJSON(jsonValue));
2582
+ }
2583
+ async policyGetPolicyDataByIdentifier(requestParameters, initOverrides) {
2584
+ const response = await this.policyGetPolicyDataByIdentifierRaw(requestParameters, initOverrides);
2585
+ return await response.value();
2586
+ }
2587
+ async policyGetPolicyUsageDataRaw(requestParameters, initOverrides) {
2588
+ if (requestParameters["policyIdentifier"] == null) {
2589
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyUsageData().');
2590
+ }
2591
+ const queryParameters = {};
2592
+ const headerParameters = {};
2593
+ if (this.configuration && this.configuration.apiKey) {
2594
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2595
+ }
2596
+ let urlPath = `/api/Policy/usage/{policyIdentifier}`;
2597
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
2598
+ const response = await this.request({
2599
+ path: urlPath,
2600
+ method: "GET",
2601
+ headers: headerParameters,
2602
+ query: queryParameters
2603
+ }, initOverrides);
2604
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
2605
+ }
2606
+ async policyGetPolicyUsageData(requestParameters, initOverrides) {
2607
+ const response = await this.policyGetPolicyUsageDataRaw(requestParameters, initOverrides);
2608
+ return await response.value();
2609
+ }
2610
+ async policyGetRulesForProductRaw(requestParameters, initOverrides) {
2611
+ if (requestParameters["licenseType"] == null) {
2612
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetRulesForProduct().');
2613
+ }
2614
+ if (requestParameters["productName"] == null) {
2615
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyGetRulesForProduct().');
2616
+ }
2617
+ if (requestParameters["tenantIdentifier"] == null) {
2618
+ throw new RequiredError("tenantIdentifier", 'Required parameter "tenantIdentifier" was null or undefined when calling policyGetRulesForProduct().');
2619
+ }
2620
+ const queryParameters = {};
2621
+ const headerParameters = {};
2622
+ if (this.configuration && this.configuration.apiKey) {
2623
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2624
+ }
2625
+ let urlPath = `/api/Policy/license/{licenseType}/product/{productName}/tenant/{tenantIdentifier}`;
2626
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
2627
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
2628
+ urlPath = urlPath.replace(`{${"tenantIdentifier"}}`, encodeURIComponent(String(requestParameters["tenantIdentifier"])));
2629
+ const response = await this.request({
2630
+ path: urlPath,
2631
+ method: "GET",
2632
+ headers: headerParameters,
2633
+ query: queryParameters
2634
+ }, initOverrides);
2635
+ return new VoidApiResponse(response);
2636
+ }
2637
+ async policyGetRulesForProduct(requestParameters, initOverrides) {
2638
+ await this.policyGetRulesForProductRaw(requestParameters, initOverrides);
2639
+ }
2640
+ async policyGetUserInheritanceGroupPoliciesForAllProductsRaw(requestParameters, initOverrides) {
2641
+ if (requestParameters["identifier"] == null) {
2642
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserInheritanceGroupPoliciesForAllProducts().');
2643
+ }
2644
+ const queryParameters = {};
2645
+ const headerParameters = {};
2646
+ if (this.configuration && this.configuration.apiKey) {
2647
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2648
+ }
2649
+ let urlPath = `/api/Policy/user/group/{identifier}`;
2650
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
2651
+ const response = await this.request({
2652
+ path: urlPath,
2653
+ method: "GET",
2654
+ headers: headerParameters,
2655
+ query: queryParameters
2656
+ }, initOverrides);
2657
+ return new VoidApiResponse(response);
2658
+ }
2659
+ async policyGetUserInheritanceGroupPoliciesForAllProducts(requestParameters, initOverrides) {
2660
+ await this.policyGetUserInheritanceGroupPoliciesForAllProductsRaw(requestParameters, initOverrides);
2661
+ }
2662
+ async policyGetUserPoliciesForAllProductsRaw(requestParameters, initOverrides) {
2663
+ if (requestParameters["identifier"] == null) {
2664
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserPoliciesForAllProducts().');
2665
+ }
2666
+ const queryParameters = {};
2667
+ const headerParameters = {};
2668
+ if (this.configuration && this.configuration.apiKey) {
2669
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2670
+ }
2671
+ let urlPath = `/api/Policy/user/{identifier}`;
2672
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
2673
+ const response = await this.request({
2674
+ path: urlPath,
2675
+ method: "GET",
2676
+ headers: headerParameters,
2677
+ query: queryParameters
2678
+ }, initOverrides);
2679
+ return new VoidApiResponse(response);
2680
+ }
2681
+ async policyGetUserPoliciesForAllProducts(requestParameters, initOverrides) {
2682
+ await this.policyGetUserPoliciesForAllProductsRaw(requestParameters, initOverrides);
2683
+ }
2684
+ async policyGetUserPoliciesForAllProductsAndAllGroupsRaw(requestParameters, initOverrides) {
2685
+ if (requestParameters["identifier"] == null) {
2686
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserPoliciesForAllProductsAndAllGroups().');
2687
+ }
2688
+ const queryParameters = {};
2689
+ const headerParameters = {};
2690
+ if (this.configuration && this.configuration.apiKey) {
2691
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2692
+ }
2693
+ let urlPath = `/api/Policy/user/{identifier}/all`;
2694
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
2695
+ const response = await this.request({
2696
+ path: urlPath,
2697
+ method: "GET",
2698
+ headers: headerParameters,
2699
+ query: queryParameters
2700
+ }, initOverrides);
2701
+ return new VoidApiResponse(response);
2702
+ }
2703
+ async policyGetUserPoliciesForAllProductsAndAllGroups(requestParameters, initOverrides) {
2704
+ await this.policyGetUserPoliciesForAllProductsAndAllGroupsRaw(requestParameters, initOverrides);
2705
+ }
2706
+ async policyUpdateGlobalPolicyRaw(requestParameters, initOverrides) {
2707
+ const queryParameters = {};
2708
+ const headerParameters = {};
2709
+ headerParameters["Content-Type"] = "application/json";
2710
+ if (this.configuration && this.configuration.apiKey) {
2711
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2712
+ }
2713
+ let urlPath = `/api/Policy/global`;
2714
+ const response = await this.request({
2715
+ path: urlPath,
2716
+ method: "PUT",
2717
+ headers: headerParameters,
2718
+ query: queryParameters,
2719
+ body: CreateGlobalPolicyWithFormDataRequestToJSON(requestParameters["createGlobalPolicyWithFormDataRequest"])
2720
+ }, initOverrides);
2721
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
2722
+ }
2723
+ async policyUpdateGlobalPolicy(requestParameters = {}, initOverrides) {
2724
+ const response = await this.policyUpdateGlobalPolicyRaw(requestParameters, initOverrides);
2725
+ return await response.value();
2726
+ }
2727
+ async policyUpdatePolicyRaw(requestParameters, initOverrides) {
2728
+ const queryParameters = {};
2729
+ const headerParameters = {};
2730
+ headerParameters["Content-Type"] = "application/json";
2731
+ if (this.configuration && this.configuration.apiKey) {
2732
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2733
+ }
2734
+ let urlPath = `/api/Policy`;
2735
+ const response = await this.request({
2736
+ path: urlPath,
2737
+ method: "PUT",
2738
+ headers: headerParameters,
2739
+ query: queryParameters,
2740
+ body: CreatePolicyWithFormDataRequestToJSON(requestParameters["createPolicyWithFormDataRequest"])
2741
+ }, initOverrides);
2742
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2743
+ }
2744
+ async policyUpdatePolicy(requestParameters = {}, initOverrides) {
2745
+ const response = await this.policyUpdatePolicyRaw(requestParameters, initOverrides);
2746
+ return await response.value();
2747
+ }
2748
+ async policyUpdatePolicyV2Raw(requestParameters, initOverrides) {
2749
+ const queryParameters = {};
2750
+ const headerParameters = {};
2751
+ headerParameters["Content-Type"] = "application/json";
2752
+ if (this.configuration && this.configuration.apiKey) {
2753
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2754
+ }
2755
+ let urlPath = `/api/Policy/v2/update`;
2756
+ const response = await this.request({
2757
+ path: urlPath,
2758
+ method: "PUT",
2759
+ headers: headerParameters,
2760
+ query: queryParameters,
2761
+ body: UpdatePolicyRequestToJSON(requestParameters["updatePolicyRequest"])
2762
+ }, initOverrides);
2763
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2764
+ }
2765
+ async policyUpdatePolicyV2(requestParameters = {}, initOverrides) {
2766
+ const response = await this.policyUpdatePolicyV2Raw(requestParameters, initOverrides);
2767
+ return await response.value();
2768
+ }
2769
+ async policyUploadCheckPolicyRaw(requestParameters, initOverrides) {
2770
+ const queryParameters = {};
2771
+ const headerParameters = {};
2772
+ if (this.configuration && this.configuration.apiKey) {
2773
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
2774
+ }
2775
+ const consumes = [
2776
+ { contentType: "multipart/form-data" }
2777
+ ];
2778
+ const canConsumeForm2 = canConsumeForm(consumes);
2779
+ let formParams;
2780
+ let useForm = false;
2781
+ useForm = canConsumeForm2;
2782
+ if (useForm) {
2783
+ formParams = new FormData;
2784
+ } else {
2785
+ formParams = new URLSearchParams;
2786
+ }
2787
+ if (requestParameters["file"] != null) {
2788
+ formParams.append("file", requestParameters["file"]);
2789
+ }
2790
+ let urlPath = `/api/Policy/upload/check`;
2791
+ const response = await this.request({
2792
+ path: urlPath,
2793
+ method: "POST",
2794
+ headers: headerParameters,
2795
+ query: queryParameters,
2796
+ body: formParams
2797
+ }, initOverrides);
2798
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
2799
+ }
2800
+ async policyUploadCheckPolicy(requestParameters = {}, initOverrides) {
2801
+ const response = await this.policyUploadCheckPolicyRaw(requestParameters, initOverrides);
2802
+ return await response.value();
2803
+ }
2804
+ }
2805
+ var DEFAULT_TIMEOUT_MS = 1e4;
2806
+ var CLIENT_VERSION_HEADER = "ClientVersion";
2807
+ var JSON_MIME = /^application\/(json|[^;\s]+\+json)\s*(;.*)?$/i;
2808
+ async function resolvePolicyAsync(options) {
2809
+ const subject = options.subject;
2810
+ requireValue("subject", subject);
2811
+ requireText("subject.organizationId", subject.organizationId);
2812
+ requireText("subject.tenantId", subject.tenantId);
2813
+ requireText("subject.product", subject.product);
2814
+ requireText("subject.licenseType", subject.licenseType);
2815
+ requireText("baseUrl", options.baseUrl);
2816
+ requireText("clientVersion", options.clientVersion);
2817
+ const fetchApi = options.fetch ?? globalThis.fetch;
2818
+ if (typeof fetchApi !== "function") {
2819
+ throw new RequiredError("fetch", "No fetch implementation available. Pass options.fetch.");
2820
+ }
2821
+ const now = options.now ?? (() => new Date);
2822
+ const basePath = `${options.baseUrl.replace(/\/+$/, "")}/${encodeURIComponent(subject.organizationId)}/roboticsops_`;
2823
+ let requestUrl = basePath;
2824
+ const api = new PolicyApi(new Configuration({
2825
+ basePath,
2826
+ fetchApi,
2827
+ apiKey: async () => `Bearer ${await readToken(options.accessToken)}`,
2828
+ headers: {
2829
+ AccountId: subject.organizationId,
2830
+ [CLIENT_VERSION_HEADER]: options.clientVersion
2831
+ },
2832
+ middleware: [
2833
+ {
2834
+ pre: async (context) => {
2835
+ requestUrl = context.url;
2836
+ }
2837
+ }
2838
+ ]
2839
+ }));
2840
+ if (options.signal?.aborted) {
2841
+ return unknown(subject, buildAudit(requestUrl, now), "cancelled", "The request was cancelled before it was sent.");
2842
+ }
2843
+ const controller = new AbortController;
2844
+ let timedOut = false;
2845
+ const timer = setTimeout(() => {
2846
+ timedOut = true;
2847
+ controller.abort();
2848
+ }, options.timeoutMs ?? DEFAULT_TIMEOUT_MS);
2849
+ const relayAbort = () => controller.abort();
2850
+ options.signal?.addEventListener("abort", relayAbort, { once: true });
2851
+ let seenResponse;
2852
+ try {
2853
+ const response = await api.policyGetRulesForProductRaw({
2854
+ licenseType: subject.licenseType,
2855
+ productName: subject.product,
2856
+ tenantIdentifier: subject.tenantId
2857
+ }, { signal: controller.signal });
2858
+ seenResponse = response.raw;
2859
+ return await classifySuccess(response.raw, subject, requestUrl, now);
2860
+ } catch (error) {
2861
+ return classifyFailure(error, subject, requestUrl, now, timedOut, options.signal, seenResponse);
2862
+ } finally {
2863
+ clearTimeout(timer);
2864
+ options.signal?.removeEventListener("abort", relayAbort);
2865
+ }
2866
+ }
2867
+ async function classifySuccess(response, subject, url, now) {
2868
+ const audit = buildAudit(url, now, response);
2869
+ if (response.status === 204) {
2870
+ return { outcome: "ungoverned", subject, audit };
2871
+ }
2872
+ if (response.status !== 200) {
2873
+ return unknown(subject, audit, "serverError", `The policy service answered ${response.status}; only 200 carries a policy and only 204 means none is published.`);
2874
+ }
2875
+ const contentType = response.headers.get("content-type");
2876
+ if (!JSON_MIME.test(contentType ?? "")) {
2877
+ return unknown(subject, audit, "notJson", `Expected a JSON policy document, got content-type ${contentType ?? "(none)"}.`);
2878
+ }
2879
+ const body = await response.text();
2880
+ if (!isJsonObject(body)) {
2881
+ return unknown(subject, audit, "notJson", body.trim() === "" ? "The response body was empty." : "The response body is not a JSON object.");
2882
+ }
2883
+ return { outcome: "governed", subject, audit, document: body };
2884
+ }
2885
+ function classifyFailure(error, subject, url, now, timedOut, signal, seenResponse) {
2886
+ if (error instanceof ResponseError) {
2887
+ return unknown(subject, buildAudit(url, now, error.response), reasonForStatus(error.response.status), `The policy service answered ${error.response.status}.`);
2888
+ }
2889
+ const audit = buildAudit(url, now, seenResponse);
2890
+ if (timedOut) {
2891
+ return unknown(subject, audit, "timedOut", "The policy service did not answer within the timeout.");
2892
+ }
2893
+ if (signal?.aborted || isAbortError(error)) {
2894
+ return unknown(subject, audit, "cancelled", "The request was cancelled.");
2895
+ }
2896
+ return unknown(subject, audit, "transport", `The request to the policy service failed: ${describe(unwrap(error))}`);
2897
+ }
2898
+ function unwrap(error) {
2899
+ return error instanceof FetchError ? error.cause : error;
2900
+ }
2901
+ function reasonForStatus(status) {
2902
+ if (status === 401 || status === 403) {
2903
+ return "unauthorized";
2904
+ }
2905
+ if (status === 404) {
2906
+ return "notFound";
2907
+ }
2908
+ return "serverError";
2909
+ }
2910
+ function buildAudit(url, now, response) {
2911
+ const audit = { url, resolvedAt: now().toISOString() };
2912
+ if (response) {
2913
+ audit.httpStatus = response.status;
2914
+ const retryAfter = parseRetryAfter(response.headers.get("retry-after"), now);
2915
+ if (retryAfter !== undefined) {
2916
+ audit.retryAfterSeconds = retryAfter;
2917
+ }
2918
+ }
2919
+ return audit;
2920
+ }
2921
+ function parseRetryAfter(header, now) {
2922
+ if (header === null || header.trim() === "") {
2923
+ return;
2924
+ }
2925
+ const seconds = Number(header.trim());
2926
+ if (Number.isInteger(seconds) && seconds >= 0) {
2927
+ return seconds;
2928
+ }
2929
+ const at = Date.parse(header);
2930
+ if (Number.isNaN(at)) {
2931
+ return;
2932
+ }
2933
+ return Math.max(0, Math.round((at - now().getTime()) / 1000));
2934
+ }
2935
+ function isJsonObject(body) {
2936
+ if (body.trim() === "") {
2937
+ return false;
2938
+ }
2939
+ let parsed;
2940
+ try {
2941
+ parsed = JSON.parse(body);
2942
+ } catch {
2943
+ return false;
2944
+ }
2945
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed);
2946
+ }
2947
+ function unknown(subject, audit, reason, detail) {
2948
+ return { outcome: "unknown", subject, audit, reason, detail };
2949
+ }
2950
+ async function readToken(accessToken) {
2951
+ return typeof accessToken === "function" ? await accessToken() : accessToken;
2952
+ }
2953
+ function isAbortError(error) {
2954
+ const candidate = error instanceof Error && "cause" in error && error.cause instanceof Error ? error.cause : error;
2955
+ return candidate instanceof Error && candidate.name === "AbortError";
2956
+ }
2957
+ function describe(error) {
2958
+ return error instanceof Error ? error.message : String(error);
2959
+ }
2960
+ function requireValue(field, value) {
2961
+ if (value === undefined || value === null) {
2962
+ throw new RequiredError(field, `Required option "${field}" is missing.`);
2963
+ }
2964
+ }
2965
+ function requireText(field, value) {
2966
+ requireValue(field, value);
2967
+ if (typeof value !== "string" || value.trim() === "") {
2968
+ throw new RequiredError(field, `Required option "${field}" must be a non-empty string.`);
2969
+ }
2970
+ }
1297
2971
  // ../common/dist/index.js
1298
2972
  import { createRequire } from "node:module";
1299
2973
  import fs from "node:fs";
@@ -7997,7 +9671,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
7997
9671
  });
7998
9672
  this.runningCommand = proc;
7999
9673
  }
8000
- _dispatchSubcommand(commandName, operands, unknown) {
9674
+ _dispatchSubcommand(commandName, operands, unknown2) {
8001
9675
  const subCommand = this._findCommand(commandName);
8002
9676
  if (!subCommand)
8003
9677
  this.help({ error: true });
@@ -8006,9 +9680,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
8006
9680
  promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, "preSubcommand");
8007
9681
  promiseChain = this._chainOrCall(promiseChain, () => {
8008
9682
  if (subCommand._executableHandler) {
8009
- this._executeSubCommand(subCommand, operands.concat(unknown));
9683
+ this._executeSubCommand(subCommand, operands.concat(unknown2));
8010
9684
  } else {
8011
- return subCommand._parseCommand(operands, unknown);
9685
+ return subCommand._parseCommand(operands, unknown2);
8012
9686
  }
8013
9687
  });
8014
9688
  return promiseChain;
@@ -8105,22 +9779,22 @@ Expecting one of '${allowedValues.join("', '")}'`);
8105
9779
  }
8106
9780
  return result;
8107
9781
  }
8108
- _parseCommand(operands, unknown) {
8109
- const parsed = this.parseOptions(unknown);
9782
+ _parseCommand(operands, unknown2) {
9783
+ const parsed = this.parseOptions(unknown2);
8110
9784
  this._parseOptionsEnv();
8111
9785
  this._parseOptionsImplied();
8112
9786
  operands = operands.concat(parsed.operands);
8113
- unknown = parsed.unknown;
8114
- this.args = operands.concat(unknown);
9787
+ unknown2 = parsed.unknown;
9788
+ this.args = operands.concat(unknown2);
8115
9789
  if (operands && this._findCommand(operands[0])) {
8116
- return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
9790
+ return this._dispatchSubcommand(operands[0], operands.slice(1), unknown2);
8117
9791
  }
8118
9792
  if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) {
8119
9793
  return this._dispatchHelpCommand(operands[1]);
8120
9794
  }
8121
9795
  if (this._defaultCommandName) {
8122
- this._outputHelpIfRequested(unknown);
8123
- return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
9796
+ this._outputHelpIfRequested(unknown2);
9797
+ return this._dispatchSubcommand(this._defaultCommandName, operands, unknown2);
8124
9798
  }
8125
9799
  if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
8126
9800
  this.help({ error: true });
@@ -8142,7 +9816,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
8142
9816
  promiseChain = this._chainOrCall(promiseChain, () => this._actionHandler(this.processedArgs));
8143
9817
  if (this.parent) {
8144
9818
  promiseChain = this._chainOrCall(promiseChain, () => {
8145
- this.parent.emit(commandEvent, operands, unknown);
9819
+ this.parent.emit(commandEvent, operands, unknown2);
8146
9820
  });
8147
9821
  }
8148
9822
  promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
@@ -8151,13 +9825,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
8151
9825
  if (this.parent?.listenerCount(commandEvent)) {
8152
9826
  checkForUnknownOptions();
8153
9827
  this._processArguments();
8154
- this.parent.emit(commandEvent, operands, unknown);
9828
+ this.parent.emit(commandEvent, operands, unknown2);
8155
9829
  } else if (operands.length) {
8156
9830
  if (this._findCommand("*")) {
8157
- return this._dispatchSubcommand("*", operands, unknown);
9831
+ return this._dispatchSubcommand("*", operands, unknown2);
8158
9832
  }
8159
9833
  if (this.listenerCount("command:*")) {
8160
- this.emit("command:*", operands, unknown);
9834
+ this.emit("command:*", operands, unknown2);
8161
9835
  } else if (this.commands.length) {
8162
9836
  this.unknownCommand();
8163
9837
  } else {
@@ -8212,7 +9886,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
8212
9886
  }
8213
9887
  parseOptions(args) {
8214
9888
  const operands = [];
8215
- const unknown = [];
9889
+ const unknown2 = [];
8216
9890
  let dest = operands;
8217
9891
  function maybeOption(arg) {
8218
9892
  return arg.length > 1 && arg[0] === "-";
@@ -8229,7 +9903,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
8229
9903
  const arg = activeGroup ?? args[i++];
8230
9904
  activeGroup = null;
8231
9905
  if (arg === "--") {
8232
- if (dest === unknown)
9906
+ if (dest === unknown2)
8233
9907
  dest.push(arg);
8234
9908
  dest.push(...args.slice(i));
8235
9909
  break;
@@ -8281,18 +9955,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
8281
9955
  }
8282
9956
  }
8283
9957
  if (dest === operands && maybeOption(arg) && !(this.commands.length === 0 && negativeNumberArg(arg))) {
8284
- dest = unknown;
9958
+ dest = unknown2;
8285
9959
  }
8286
- if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
9960
+ if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown2.length === 0) {
8287
9961
  if (this._findCommand(arg)) {
8288
9962
  operands.push(arg);
8289
- unknown.push(...args.slice(i));
9963
+ unknown2.push(...args.slice(i));
8290
9964
  break;
8291
9965
  } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
8292
9966
  operands.push(arg, ...args.slice(i));
8293
9967
  break;
8294
9968
  } else if (this._defaultCommandName) {
8295
- unknown.push(arg, ...args.slice(i));
9969
+ unknown2.push(arg, ...args.slice(i));
8296
9970
  break;
8297
9971
  }
8298
9972
  }
@@ -8302,7 +9976,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
8302
9976
  }
8303
9977
  dest.push(arg);
8304
9978
  }
8305
- return { operands, unknown };
9979
+ return { operands, unknown: unknown2 };
8306
9980
  }
8307
9981
  opts() {
8308
9982
  if (this._storeOptionsAsProperties) {
@@ -9227,7 +10901,7 @@ var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{1
9227
10901
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
9228
10902
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
9229
10903
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
9230
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
10904
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
9231
10905
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
9232
10906
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
9233
10907
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -9274,7 +10948,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
9274
10948
  `(?<![A-Za-z0-9])"(?:[^\\
9275
10949
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
9276
10950
  ].join("|"), "g");
9277
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
10951
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
9278
10952
  var COLLAPSED_BODY = "{…}";
9279
10953
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
9280
10954
  var MAX_BODY_NESTING = 8;
@@ -9289,10 +10963,13 @@ function collapseJsonBodies(text) {
9289
10963
  }
9290
10964
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
9291
10965
  }
9292
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
10966
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
9293
10967
  function peelTrailingPunctuation(match) {
9294
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
9295
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
10968
+ let end = match.length;
10969
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
10970
+ end -= 1;
10971
+ }
10972
+ return [match.slice(0, end), match.slice(end)];
9296
10973
  }
9297
10974
  function redactUrl(raw) {
9298
10975
  try {
@@ -9500,6 +11177,12 @@ var TLS_ERROR_CODES = new Set([
9500
11177
  var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
9501
11178
  var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
9502
11179
  var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
11180
+ function carriedInstructions(error) {
11181
+ if (!error || typeof error !== "object")
11182
+ return;
11183
+ const e = error;
11184
+ return typeof e.instructions === "string" ? e.instructions : undefined;
11185
+ }
9503
11186
  function setExitCode(code) {
9504
11187
  process.exitCode = code;
9505
11188
  }
@@ -9981,7 +11664,8 @@ function readRegistryValue(keyPath, valueName) {
9981
11664
  }
9982
11665
  const [error, output] = catchError(() => execFileSync2("reg", ["query", keyPath, "/v", valueName], {
9983
11666
  encoding: "utf-8",
9984
- stdio: ["pipe", "pipe", "pipe"]
11667
+ stdio: ["pipe", "pipe", "pipe"],
11668
+ windowsHide: true
9985
11669
  }));
9986
11670
  if (error) {
9987
11671
  return "";
@@ -10634,28 +12318,32 @@ function isPlainRecord(value) {
10634
12318
  const prototype = Object.getPrototypeOf(value);
10635
12319
  return prototype === Object.prototype || prototype === null;
10636
12320
  }
10637
- function extractPagedRows(value) {
12321
+ function splitPagedEnvelope(value) {
10638
12322
  if (Array.isArray(value) || !isPlainRecord(value))
10639
12323
  return null;
10640
- const entries = Object.values(value);
12324
+ const entries = Object.entries(value);
10641
12325
  if (entries.length === 0)
10642
12326
  return null;
10643
- let rows = null;
10644
- let hasScalarSibling = false;
10645
- for (const entry of entries) {
12327
+ let found = null;
12328
+ const meta = Object.create(null);
12329
+ for (const [key, entry] of entries) {
10646
12330
  if (Array.isArray(entry)) {
10647
- if (rows !== null)
12331
+ if (found !== null)
10648
12332
  return null;
10649
- rows = entry;
12333
+ found = { key, rows: entry };
10650
12334
  } else if (entry !== null && typeof entry === "object") {
10651
12335
  return null;
10652
12336
  } else {
10653
- hasScalarSibling = true;
12337
+ meta[key] = entry;
10654
12338
  }
10655
12339
  }
10656
- if (rows === null || !hasScalarSibling)
12340
+ if (found === null || Object.keys(meta).length === 0)
10657
12341
  return null;
10658
- return rows;
12342
+ return { ...found, meta };
12343
+ }
12344
+ function extractPagedRows(value) {
12345
+ const paged = splitPagedEnvelope(value);
12346
+ return paged === null ? null : paged.rows;
10659
12347
  }
10660
12348
  function toLowerCamelCaseKey(key) {
10661
12349
  if (!key)
@@ -10759,6 +12447,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
10759
12447
  }
10760
12448
  break;
10761
12449
  }
12450
+ case "markdown":
12451
+ logFn(renderMarkdown(data));
12452
+ break;
10762
12453
  default: {
10763
12454
  const hasData = "Data" in data && data.Data != null;
10764
12455
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
@@ -10783,6 +12474,10 @@ function logOutput(data, format = "json", tableRowStyle) {
10783
12474
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
10784
12475
  `), needsAsciiSafeJson(sink), styleFn);
10785
12476
  }
12477
+ var PLUMBING_KEYS = new Set(["code", "log"]);
12478
+ function isPlumbingKey(key) {
12479
+ return PLUMBING_KEYS.has(key.toLowerCase());
12480
+ }
10786
12481
  function cellToString(val) {
10787
12482
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
10788
12483
  }
@@ -10798,7 +12493,7 @@ function wrapText(text, width) {
10798
12493
  function printTable(data, logFn, externalLogValue, tableRowStyle) {
10799
12494
  if (data.length === 0)
10800
12495
  return;
10801
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
12496
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
10802
12497
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
10803
12498
  const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
10804
12499
  logFn(header);
@@ -10820,7 +12515,7 @@ function isNonEmptyPlainObject(value) {
10820
12515
  }
10821
12516
  var NESTED_INDENT = " ";
10822
12517
  function printVerticalTable(data, logFn = console.log, externalLogValue) {
10823
- const keys = Object.keys(data).filter((key) => !["code", "log"].includes(key.toLowerCase()));
12518
+ const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
10824
12519
  if (keys.length === 0)
10825
12520
  return;
10826
12521
  const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
@@ -10851,7 +12546,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
10851
12546
  function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
10852
12547
  if (data.length === 0)
10853
12548
  return;
10854
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
12549
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
10855
12550
  if (keys.length === 0)
10856
12551
  return;
10857
12552
  if (!process.stdout.isTTY) {
@@ -10925,6 +12620,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
10925
12620
  logFn(`Log: ${externalLogValue}`);
10926
12621
  }
10927
12622
  }
12623
+ var MARKDOWN_MAX_CELL = 200;
12624
+ var MARKDOWN_MAX_DEPTH = 3;
12625
+ function markdownHeading(depth) {
12626
+ return "#".repeat(Math.min(3 + depth, 6));
12627
+ }
12628
+ var BACKTICK_RUN = /`+/g;
12629
+ function fencedBlock(text) {
12630
+ const first = text.trimStart()[0];
12631
+ const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
12632
+ const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
12633
+ const fence = "`".repeat(Math.max(3, longestRun + 1));
12634
+ return `${fence}${language}
12635
+ ${text}
12636
+ ${fence}`;
12637
+ }
12638
+ function collapseNewlineRuns(text) {
12639
+ return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
12640
+ `) ? " " : part).join("");
12641
+ }
12642
+ function markdownCell(value) {
12643
+ const text = value instanceof Date ? value.toISOString() : cellToString(value);
12644
+ return collapseNewlineRuns(text).replace(/\|/g, "\\|");
12645
+ }
12646
+ function markdownLabel(key) {
12647
+ return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
12648
+ }
12649
+ function withoutPlumbing(record) {
12650
+ const kept = Object.create(null);
12651
+ for (const [key, value] of Object.entries(record)) {
12652
+ if (!isPlumbingKey(key))
12653
+ kept[key] = value;
12654
+ }
12655
+ return kept;
12656
+ }
12657
+ function rowsWithoutPlumbing(rows) {
12658
+ return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
12659
+ }
12660
+ function markdownTable(rows) {
12661
+ const columns = [];
12662
+ const seen = new Set;
12663
+ for (const row of rows) {
12664
+ for (const key of Object.keys(row)) {
12665
+ if (!seen.has(key)) {
12666
+ seen.add(key);
12667
+ columns.push(key);
12668
+ }
12669
+ }
12670
+ }
12671
+ if (columns.length === 0)
12672
+ return null;
12673
+ const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
12674
+ if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
12675
+ return null;
12676
+ }
12677
+ return [
12678
+ `| ${columns.map(markdownLabel).join(" | ")} |`,
12679
+ `| ${columns.map(() => "---").join(" | ")} |`,
12680
+ ...cells.map((row) => `| ${row.join(" | ")} |`)
12681
+ ].join(`
12682
+ `);
12683
+ }
12684
+ function extractMessageSequence(rows) {
12685
+ const messages = [];
12686
+ for (const row of rows) {
12687
+ const message = extractSingleMessage(row);
12688
+ if (message === null)
12689
+ return null;
12690
+ messages.push(message);
12691
+ }
12692
+ return messages.join(`
12693
+
12694
+ `);
12695
+ }
12696
+ function markdownRows(rows, depth) {
12697
+ if (rows.length === 0)
12698
+ return "(none)";
12699
+ if (!isPlainObjectArray(rows)) {
12700
+ return rows.map((item) => `- ${markdownCell(item)}`).join(`
12701
+ `);
12702
+ }
12703
+ const prose = extractMessageSequence(rows);
12704
+ if (prose !== null)
12705
+ return prose;
12706
+ const table = markdownTable(rows);
12707
+ if (table !== null)
12708
+ return table;
12709
+ if (depth >= MARKDOWN_MAX_DEPTH) {
12710
+ return fencedBlock(JSON.stringify(rows, null, 2));
12711
+ }
12712
+ return rows.map((row, index) => [
12713
+ `${markdownHeading(depth)} ${index + 1}`,
12714
+ markdownObject(row, depth + 1)
12715
+ ].join(`
12716
+
12717
+ `)).join(`
12718
+
12719
+ `);
12720
+ }
12721
+ function markdownObject(obj, depth) {
12722
+ const scalars = [];
12723
+ const blocks = [];
12724
+ for (const [key, value] of Object.entries(obj)) {
12725
+ if (value === undefined)
12726
+ continue;
12727
+ const label = markdownLabel(key);
12728
+ if (Array.isArray(value)) {
12729
+ blocks.push(`${markdownHeading(depth)} ${label}
12730
+
12731
+ ${markdownRows(value, depth + 1)}`);
12732
+ } else if (isNonEmptyPlainObject(value)) {
12733
+ const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
12734
+ if (nested !== "") {
12735
+ blocks.push(`${markdownHeading(depth)} ${label}
12736
+
12737
+ ${nested}`);
12738
+ }
12739
+ } else if (typeof value === "string" && value.includes(`
12740
+ `)) {
12741
+ blocks.push(`**${label}:**
12742
+
12743
+ ${fencedBlock(value)}`);
12744
+ } else {
12745
+ scalars.push(`**${label}:** ${markdownCell(value)}`);
12746
+ }
12747
+ }
12748
+ const sections = scalars.length > 0 ? [scalars.join(`
12749
+ `)] : [];
12750
+ sections.push(...blocks);
12751
+ return sections.join(`
12752
+
12753
+ `);
12754
+ }
12755
+ function extractSingleMessage(payload) {
12756
+ if (!isPlainRecord(payload))
12757
+ return null;
12758
+ const keys = Object.keys(payload);
12759
+ if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
12760
+ return null;
12761
+ const value = payload[keys[0]];
12762
+ return typeof value === "string" ? value : null;
12763
+ }
12764
+ function markdownPayload(payload) {
12765
+ const message = extractSingleMessage(payload);
12766
+ if (message !== null)
12767
+ return message;
12768
+ if (Array.isArray(payload)) {
12769
+ return markdownRows(rowsWithoutPlumbing(payload), 0);
12770
+ }
12771
+ const visible = withoutPlumbing(payload);
12772
+ const paged = splitPagedEnvelope(visible);
12773
+ if (paged !== null) {
12774
+ const meta = markdownObject(paged.meta, 0);
12775
+ const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
12776
+
12777
+ ${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
12778
+ return meta === "" ? rows : `${meta}
12779
+
12780
+ ${rows}`;
12781
+ }
12782
+ return markdownObject(visible, 0);
12783
+ }
12784
+ function isPaginationWorthShowing(value) {
12785
+ if (typeof value !== "object" || value === null)
12786
+ return false;
12787
+ const page = value;
12788
+ return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
12789
+ }
12790
+ function markdownEnvelopeNotes(data) {
12791
+ const envelope = data;
12792
+ const notes = [];
12793
+ const warning = envelope.Warning;
12794
+ if (typeof warning === "string" && warning !== "") {
12795
+ notes.push(`> **Warning:** ${warning}`);
12796
+ }
12797
+ const instructions = envelope.Instructions;
12798
+ if (typeof instructions === "string" && instructions !== "") {
12799
+ notes.push(`> ${instructions}`);
12800
+ }
12801
+ const pagination = envelope.Pagination;
12802
+ if (isPaginationWorthShowing(pagination)) {
12803
+ const body = markdownObject(pagination, 1);
12804
+ if (body !== "") {
12805
+ notes.push(`${markdownHeading(0)} Pagination
12806
+
12807
+ ${body}`);
12808
+ }
12809
+ }
12810
+ const log = envelope.Log;
12811
+ if (typeof log === "string" && log !== "") {
12812
+ notes.push(`**Log:** ${log}`);
12813
+ }
12814
+ return notes;
12815
+ }
12816
+ function renderMarkdown(data) {
12817
+ if (data.Result !== RESULTS.Success) {
12818
+ const failure = data;
12819
+ const sections = [`**Failed:** ${failure.Message}`];
12820
+ if (failure.Data != null) {
12821
+ sections.push(markdownPayload(failure.Data));
12822
+ }
12823
+ if (failure.Instructions) {
12824
+ sections.push(`> ${failure.Instructions}`);
12825
+ }
12826
+ return sections.filter((section) => section !== "").join(`
12827
+
12828
+ `);
12829
+ }
12830
+ if (!("Data" in data) || data.Data == null) {
12831
+ return markdownObject(withoutPlumbing(data), 0);
12832
+ }
12833
+ return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
12834
+
12835
+ `);
12836
+ }
10928
12837
  function toYaml(data) {
10929
12838
  const codec = getYamlCodec();
10930
12839
  if (!codec) {
@@ -12246,8 +14155,9 @@ function addSdkUserAgentHeader(headers, userAgent) {
12246
14155
  // ../packager/project-packager/package.json
12247
14156
  var package_default = {
12248
14157
  name: "@uipath/project-packager",
14158
+ author: "UiPath",
12249
14159
  license: "SEE LICENSE IN LICENSE.txt",
12250
- version: "1.202.1",
14160
+ version: "1.203.0-preview.180",
12251
14161
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
12252
14162
  type: "module",
12253
14163
  main: "./dist/index.js",
@@ -12292,6 +14202,7 @@ var package_default = {
12292
14202
  lint: "biome check ."
12293
14203
  },
12294
14204
  dependencies: {
14205
+ "@uipath/aops-policy-sdk": "workspace:*",
12295
14206
  "@uipath/filesystem": "workspace:*",
12296
14207
  "@uipath/solutionpackager-tool-core": "workspace:*",
12297
14208
  "@uipath/common": "workspace:*"
@@ -12301,7 +14212,7 @@ var package_default = {
12301
14212
  },
12302
14213
  devDependencies: {
12303
14214
  "@types/node": "^25.5.2",
12304
- "@uipath/resource-builder-tool": "1.0.0-s202-16635",
14215
+ "@uipath/resource-builder-tool": "2025.11.0-alpha4535-3530",
12305
14216
  "@uipath/tool-agent": "^2.0.0",
12306
14217
  "@uipath/packager-tool-apiworkflow": "workspace:*",
12307
14218
  "@uipath/packager-tool-connector": "workspace:*",
@@ -12650,6 +14561,14 @@ class ProjectPublisher {
12650
14561
  }
12651
14562
  }
12652
14563
  // ../packager/project-packager/src/services/governance-policy-service.ts
14564
+ class GovernancePolicyError extends Error {
14565
+ instructions;
14566
+ name = "GovernancePolicyError";
14567
+ constructor(message, instructions) {
14568
+ super(message);
14569
+ this.instructions = instructions;
14570
+ }
14571
+ }
12653
14572
  var LICENSE_TYPES = {
12654
14573
  NoLicense: "NoLicense",
12655
14574
  Development: "Development",
@@ -12659,7 +14578,7 @@ var LICENSE_TYPES = {
12659
14578
  StudioPro: "StudioPro",
12660
14579
  AutomationKit: "AutomationKit"
12661
14580
  };
12662
- var DEFAULT_PROFILE_KEY = "StudioWeb";
14581
+ var STUDIOWEB_PRODUCT = "StudioWeb";
12663
14582
  var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
12664
14583
  var GOVERNANCE_SUBFOLDER = "governance";
12665
14584
  var GOVERNANCE_FILE_NAME = "governance-policy.json";
@@ -12676,87 +14595,122 @@ class GovernancePolicyService {
12676
14595
  this.temporaryStorage = temporaryStorage;
12677
14596
  this.fetchFn = fetchFn;
12678
14597
  }
12679
- async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken) {
12680
- if (validateOptions.governanceFileType !== "AutomationOps" /* AutomationOps */) {
14598
+ async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken, usage = "pack") {
14599
+ if (validateOptions.governanceFileType === "Default" /* Default */) {
12681
14600
  return;
12682
14601
  }
12683
- if (validateOptions.governanceFilePath) {
14602
+ const suppliedFilePath = validateOptions.governanceFilePath;
14603
+ if (suppliedFilePath && validateOptions.governanceFileType === "AutomationOps" /* AutomationOps */) {
12684
14604
  this.logger.info(t("info.alreadyProvided"));
12685
14605
  return;
12686
14606
  }
12687
- let cloudUrl = connectionInfo?.cloudUrl;
12688
- const organizationId = connectionInfo?.organizationId;
12689
- const tenantId = connectionInfo?.tenantId;
12690
- const accessToken = connectionInfo?.accessToken;
12691
- if (!cloudUrl || !organizationId || !tenantId || !accessToken) {
12692
- this.logger.warn(t("errors.connectionIncomplete"));
12693
- validateOptions.governanceFileType = "Default" /* Default */;
14607
+ if (suppliedFilePath && usage === "analyze") {
14608
+ this.logger.info(t("info.alreadyProvided"));
14609
+ validateOptions.governanceFileType = "Studio" /* Studio */;
12694
14610
  return;
12695
14611
  }
12696
- const profileKey = validateOptions.profileKey ?? DEFAULT_PROFILE_KEY;
12697
- let cloudOrigin;
12698
- try {
12699
- cloudOrigin = new URL(cloudUrl).origin;
12700
- cloudUrl = cloudUrl.replace(/\/+$/, "");
12701
- } catch {
12702
- this.logger.warn(t("errors.connectionIncomplete"));
12703
- validateOptions.governanceFileType = "Default" /* Default */;
14612
+ const origin = this.resolveCloudOrigin(connectionInfo?.cloudUrl);
14613
+ const product = validateOptions.profileKey;
14614
+ if (!origin || !product || !connectionInfo?.organizationId || !connectionInfo.tenantId || !connectionInfo.accessToken) {
14615
+ if (suppliedFilePath) {
14616
+ this.logger.info(t("info.noTenantToAsk", { path: suppliedFilePath }));
14617
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14618
+ return;
14619
+ }
14620
+ this.warnAndUseShippedRules(validateOptions, t("errors.connectionIncomplete"));
12704
14621
  return;
12705
14622
  }
12706
- const licenseType = await this.resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken);
12707
- const policy = await this.downloadPolicyAsync(cloudOrigin, organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken);
12708
- if (!policy) {
12709
- validateOptions.governanceFileType = "Default" /* Default */;
12710
- return;
14623
+ const licenseType = await this.resolveLicenseTypeAsync(product, connectionInfo.cloudUrl?.replace(/\/+$/, "") ?? "", connectionInfo.accessToken, cancellationToken);
14624
+ const subject = {
14625
+ organizationId: connectionInfo.organizationId,
14626
+ tenantId: connectionInfo.tenantId,
14627
+ product,
14628
+ licenseType
14629
+ };
14630
+ this.logger.info(t("info.resolving", { product, licenseType }));
14631
+ const resolution = await resolvePolicyAsync({
14632
+ subject,
14633
+ baseUrl: origin,
14634
+ accessToken: connectionInfo.accessToken,
14635
+ clientVersion: package_default.version,
14636
+ fetch: this.fetchFn,
14637
+ signal: cancellationToken
14638
+ });
14639
+ await this.applyResolutionAsync(resolution, validateOptions, suppliedFilePath);
14640
+ }
14641
+ async applyResolutionAsync(resolution, validateOptions, suppliedFilePath) {
14642
+ switch (resolution.outcome) {
14643
+ case "governed":
14644
+ if (suppliedFilePath) {
14645
+ throw new GovernancePolicyError(t("errors.tenantPolicyWins", {
14646
+ product: resolution.subject.product,
14647
+ path: suppliedFilePath
14648
+ }), t("instructions.tenantPolicyWins"));
14649
+ }
14650
+ await this.savePolicyAsync(validateOptions, resolution.document);
14651
+ return;
14652
+ case "ungoverned":
14653
+ if (suppliedFilePath) {
14654
+ this.logger.info(t("info.suppliedFileHonoured", {
14655
+ path: suppliedFilePath
14656
+ }));
14657
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14658
+ return;
14659
+ }
14660
+ this.logger.info(t("info.ungoverned"));
14661
+ validateOptions.governanceFileType = "Default" /* Default */;
14662
+ return;
14663
+ case "unknown": {
14664
+ this.logger.warn(this.describeUnknown(resolution));
14665
+ if (suppliedFilePath) {
14666
+ this.logger.info(t("info.suppliedFileUnchecked", {
14667
+ path: suppliedFilePath
14668
+ }));
14669
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14670
+ return;
14671
+ }
14672
+ validateOptions.governanceFileType = "Default" /* Default */;
14673
+ return;
14674
+ }
12711
14675
  }
14676
+ }
14677
+ async savePolicyAsync(validateOptions, document) {
12712
14678
  try {
12713
14679
  const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
12714
14680
  const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
12715
- await this.fileSystem.writeFile(filePath, policy);
14681
+ await this.fileSystem.writeFile(filePath, document);
12716
14682
  this.logger.info(t("info.saved", { path: filePath }));
12717
14683
  validateOptions.governanceFilePath = filePath;
14684
+ validateOptions.governanceFileType = "AutomationOps" /* AutomationOps */;
12718
14685
  } catch (error) {
12719
- this.logger.warn(t("errors.failedToSave", {
12720
- error: errorMessage(error)
12721
- }));
12722
- validateOptions.governanceFileType = "Default" /* Default */;
14686
+ this.warnAndUseShippedRules(validateOptions, t("errors.failedToSave", { error: errorMessage(error) }));
12723
14687
  }
12724
14688
  }
12725
- async downloadPolicyAsync(cloudOrigin, organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken) {
12726
- const policyUrl = `${cloudOrigin}/${organizationId}/roboticsops_` + `/api/Policy/license/${licenseType}/product/${profileKey}/tenant/${tenantId}`;
12727
- this.logger.info(t("info.downloading", { url: policyUrl }));
14689
+ warnAndUseShippedRules(validateOptions, reason) {
14690
+ this.logger.warn(t("errors.fallingBackToDefault", { reason }));
14691
+ validateOptions.governanceFileType = "Default" /* Default */;
14692
+ }
14693
+ describeUnknown(resolution) {
14694
+ const reason = t("errors.unknownOutcome", {
14695
+ reason: resolution.reason,
14696
+ detail: resolution.detail,
14697
+ url: resolution.audit.url
14698
+ });
14699
+ const retryAfter = resolution.audit.retryAfterSeconds;
14700
+ return retryAfter === undefined ? reason : `${reason} ${t("errors.retryAfter", { seconds: retryAfter })}`;
14701
+ }
14702
+ resolveCloudOrigin(cloudUrl) {
14703
+ if (!cloudUrl) {
14704
+ return null;
14705
+ }
12728
14706
  try {
12729
- const response = await this.fetchFn(policyUrl, {
12730
- headers: {
12731
- Authorization: `Bearer ${accessToken}`,
12732
- AccountId: organizationId
12733
- },
12734
- signal: cancellationToken
12735
- });
12736
- if (response.status === 204 || response.status === 404) {
12737
- this.logger.info(t("info.noPolicyFound"));
12738
- return null;
12739
- }
12740
- if (!response.ok) {
12741
- const body = await response.text();
12742
- this.logger.warn(t("errors.failedToGetPolicy", { content: body }));
12743
- return null;
12744
- }
12745
- const content = await response.text();
12746
- if (!content?.trimStart().startsWith("{")) {
12747
- this.logger.info(t("info.responseNotJson"));
12748
- return null;
12749
- }
12750
- return content;
12751
- } catch (error) {
12752
- this.logger.warn(t("errors.failedToDownload", {
12753
- error: errorMessage(error)
12754
- }));
14707
+ return new URL(cloudUrl).origin;
14708
+ } catch {
12755
14709
  return null;
12756
14710
  }
12757
14711
  }
12758
14712
  async resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken) {
12759
- const isStudioWeb = profileKey === DEFAULT_PROFILE_KEY;
14713
+ const isStudioWeb = profileKey === STUDIOWEB_PRODUCT;
12760
14714
  const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
12761
14715
  try {
12762
14716
  const response = await this.fetchFn(`${cloudUrl}${ACQUIRE_LICENSE_PATH}`, {
@@ -12812,6 +14766,11 @@ async function resolveProducedNupkgsAsync(fileSystem, packagePath) {
12812
14766
  return [];
12813
14767
  }
12814
14768
  // ../packager/project-packager/src/services/pack-service.ts
14769
+ var PACKAGE_ID_TOO_LONG = "PACKAGE_ID_TOO_LONG";
14770
+ function isPackageIdTooLongError(error) {
14771
+ return error instanceof Error && error.code === PACKAGE_ID_TOO_LONG;
14772
+ }
14773
+
12815
14774
  class PackService {
12816
14775
  disallowedCharsRegex = /[^\p{L}\p{N}_.-]/gu;
12817
14776
  spacesDotRegex = /[\s.]+/g;
@@ -12823,7 +14782,11 @@ class PackService {
12823
14782
  packageId = packageId.replace(this.dotDashRegex, "-");
12824
14783
  packageId = packageId.replace(this.disallowedCharsRegex, "_");
12825
14784
  if (packageId.length > this.MaxPackageIdLength) {
12826
- throw new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
14785
+ const error = new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
14786
+ error.code = PACKAGE_ID_TOO_LONG;
14787
+ error.packageId = packageId;
14788
+ error.maxLength = this.MaxPackageIdLength;
14789
+ throw error;
12827
14790
  }
12828
14791
  return packageId;
12829
14792
  }
@@ -13261,7 +15224,7 @@ class ProjectPackager {
13261
15224
  }, cancellationToken);
13262
15225
  }
13263
15226
  async validateProjectAsync(options, cancellationToken) {
13264
- await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
15227
+ await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken, "analyze");
13265
15228
  const validationResult = await this.validateOptionsValidator.validateAsync(options, cancellationToken);
13266
15229
  if (!validationResult.isSuccess) {
13267
15230
  return validationResult;
@@ -13285,7 +15248,10 @@ class ProjectPackager {
13285
15248
  }, cancellationToken);
13286
15249
  }
13287
15250
  async buildProjectAsync(options, cancellationToken) {
13288
- await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
15251
+ const [governanceError] = await catchError(this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken));
15252
+ if (governanceError) {
15253
+ return ToolResult.error(ToolErrorCodes.InternalError, `Project build failed: ${governanceError.message}`, carriedInstructions(governanceError));
15254
+ }
13289
15255
  const validationResult = await this.buildOptionsValidator.validateAsync(options, cancellationToken);
13290
15256
  if (!validationResult.isSuccess) {
13291
15257
  return validationResult;
@@ -13352,7 +15318,7 @@ class ProjectPackager {
13352
15318
  } catch (error) {
13353
15319
  const errorMessage2 = error instanceof Error ? error.message : String(error);
13354
15320
  this.logger.error(`Processing error: ${errorMessage2}`);
13355
- return ToolResult.error(ToolErrorCodes.InternalError, `Project pack failed: ${errorMessage2}`);
15321
+ return ToolResult.error(ToolErrorCodes.InternalError, `Project pack failed: ${errorMessage2}`, carriedInstructions(error));
13356
15322
  } finally {
13357
15323
  await this.temporaryStorage.cleanup();
13358
15324
  }
@@ -13474,7 +15440,9 @@ class ProjectPackager {
13474
15440
  export {
13475
15441
  BrowserContextStorage,
13476
15442
  ConsoleTelemetryProvider,
15443
+ GovernancePolicyError,
13477
15444
  GovernancePolicyService,
15445
+ PACKAGE_ID_TOO_LONG,
13478
15446
  PackService,
13479
15447
  PackagerParameters,
13480
15448
  PackagerParametersValidator,
@@ -13496,9 +15464,11 @@ export {
13496
15464
  TelemetryService,
13497
15465
  ToolLogger,
13498
15466
  ToolsFactory,
15467
+ isPackageIdTooLongError,
15468
+ resolvePolicyAsync,
13499
15469
  resolveProducedNupkgsAsync,
13500
15470
  setGlobalLogHandler,
13501
15471
  signNupkgsAsync
13502
15472
  };
13503
15473
 
13504
- //# debugId=7498588072CFDE2564756E2164756E21
15474
+ //# debugId=7659ED9467592B1864756E2164756E21