@uipath/project-packager 1.202.0 → 1.203.0-preview.160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -31,18 +31,25 @@ var de_default = {
31
31
  info: {
32
32
  alreadyProvided: "Governance policy file already provided, skipping download.",
33
33
  saved: "Governance policy saved to {path}",
34
- downloading: "Downloading governance policy from {url}",
35
- noPolicyFound: "No governance policy found for this configuration.",
36
- responseNotJson: "Policy response is not JSON, treating as no policy.",
34
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
35
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
36
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
37
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
38
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
37
39
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
38
40
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
39
41
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
40
42
  },
41
43
  errors: {
42
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
43
- failedToGetPolicy: "Failed to download governance policy: {content}",
44
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
45
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
44
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
45
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
46
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
47
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
48
+ failedToSave: "Failed to save governance policy: {error}",
49
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
50
+ },
51
+ instructions: {
52
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
46
53
  }
47
54
  },
48
55
  signing: {
@@ -116,18 +123,25 @@ var en = {
116
123
  info: {
117
124
  alreadyProvided: "Governance policy file already provided, skipping download.",
118
125
  saved: "Governance policy saved to {path}",
119
- downloading: "Downloading governance policy from {url}",
120
- noPolicyFound: "No governance policy found for this configuration.",
121
- responseNotJson: "Policy response is not JSON, treating as no policy.",
126
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
127
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
128
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
129
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
130
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
122
131
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
123
132
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
124
133
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
125
134
  },
126
135
  errors: {
127
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
128
- failedToGetPolicy: "Failed to download governance policy: {content}",
129
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
130
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
136
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
137
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
138
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
139
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
140
+ failedToSave: "Failed to save governance policy: {error}",
141
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
142
+ },
143
+ instructions: {
144
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
131
145
  }
132
146
  },
133
147
  signing: {
@@ -200,18 +214,25 @@ var es_default = {
200
214
  info: {
201
215
  alreadyProvided: "Governance policy file already provided, skipping download.",
202
216
  saved: "Governance policy saved to {path}",
203
- downloading: "Downloading governance policy from {url}",
204
- noPolicyFound: "No governance policy found for this configuration.",
205
- responseNotJson: "Policy response is not JSON, treating as no policy.",
217
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
218
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
219
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
220
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
221
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
206
222
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
207
223
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
208
224
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
209
225
  },
210
226
  errors: {
211
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
212
- failedToGetPolicy: "Failed to download governance policy: {content}",
213
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
214
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
227
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
228
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
229
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
230
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
231
+ failedToSave: "Failed to save governance policy: {error}",
232
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
233
+ },
234
+ instructions: {
235
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
215
236
  }
216
237
  },
217
238
  signing: {
@@ -284,18 +305,25 @@ var es_MX_default = {
284
305
  info: {
285
306
  alreadyProvided: "Governance policy file already provided, skipping download.",
286
307
  saved: "Governance policy saved to {path}",
287
- downloading: "Downloading governance policy from {url}",
288
- noPolicyFound: "No governance policy found for this configuration.",
289
- responseNotJson: "Policy response is not JSON, treating as no policy.",
308
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
309
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
310
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
311
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
312
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
290
313
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
291
314
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
292
315
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
293
316
  },
294
317
  errors: {
295
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
296
- failedToGetPolicy: "Failed to download governance policy: {content}",
297
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
298
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
318
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
319
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
320
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
321
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
322
+ failedToSave: "Failed to save governance policy: {error}",
323
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
324
+ },
325
+ instructions: {
326
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
299
327
  }
300
328
  },
301
329
  signing: {
@@ -368,18 +396,25 @@ var fr_default = {
368
396
  info: {
369
397
  alreadyProvided: "Governance policy file already provided, skipping download.",
370
398
  saved: "Governance policy saved to {path}",
371
- downloading: "Downloading governance policy from {url}",
372
- noPolicyFound: "No governance policy found for this configuration.",
373
- responseNotJson: "Policy response is not JSON, treating as no policy.",
399
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
400
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
401
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
402
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
403
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
374
404
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
375
405
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
376
406
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
377
407
  },
378
408
  errors: {
379
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
380
- failedToGetPolicy: "Failed to download governance policy: {content}",
381
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
382
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
409
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
410
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
411
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
412
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
413
+ failedToSave: "Failed to save governance policy: {error}",
414
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
415
+ },
416
+ instructions: {
417
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
383
418
  }
384
419
  },
385
420
  signing: {
@@ -452,18 +487,25 @@ var ja_default = {
452
487
  info: {
453
488
  alreadyProvided: "Governance policy file already provided, skipping download.",
454
489
  saved: "Governance policy saved to {path}",
455
- downloading: "Downloading governance policy from {url}",
456
- noPolicyFound: "No governance policy found for this configuration.",
457
- responseNotJson: "Policy response is not JSON, treating as no policy.",
490
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
491
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
492
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
493
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
494
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
458
495
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
459
496
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
460
497
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
461
498
  },
462
499
  errors: {
463
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
464
- failedToGetPolicy: "Failed to download governance policy: {content}",
465
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
466
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
500
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
501
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
502
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
503
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
504
+ failedToSave: "Failed to save governance policy: {error}",
505
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
506
+ },
507
+ instructions: {
508
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
467
509
  }
468
510
  },
469
511
  signing: {
@@ -536,18 +578,25 @@ var ko_default = {
536
578
  info: {
537
579
  alreadyProvided: "Governance policy file already provided, skipping download.",
538
580
  saved: "Governance policy saved to {path}",
539
- downloading: "Downloading governance policy from {url}",
540
- noPolicyFound: "No governance policy found for this configuration.",
541
- responseNotJson: "Policy response is not JSON, treating as no policy.",
581
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
582
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
583
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
584
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
585
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
542
586
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
543
587
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
544
588
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
545
589
  },
546
590
  errors: {
547
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
548
- failedToGetPolicy: "Failed to download governance policy: {content}",
549
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
550
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
591
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
592
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
593
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
594
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
595
+ failedToSave: "Failed to save governance policy: {error}",
596
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
597
+ },
598
+ instructions: {
599
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
551
600
  }
552
601
  },
553
602
  signing: {
@@ -620,18 +669,25 @@ var pt_default = {
620
669
  info: {
621
670
  alreadyProvided: "Governance policy file already provided, skipping download.",
622
671
  saved: "Governance policy saved to {path}",
623
- downloading: "Downloading governance policy from {url}",
624
- noPolicyFound: "No governance policy found for this configuration.",
625
- responseNotJson: "Policy response is not JSON, treating as no policy.",
672
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
673
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
674
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
675
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
676
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
626
677
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
627
678
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
628
679
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
629
680
  },
630
681
  errors: {
631
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
632
- failedToGetPolicy: "Failed to download governance policy: {content}",
633
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
634
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
682
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
683
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
684
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
685
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
686
+ failedToSave: "Failed to save governance policy: {error}",
687
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
688
+ },
689
+ instructions: {
690
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
635
691
  }
636
692
  },
637
693
  signing: {
@@ -704,18 +760,25 @@ var pt_BR_default = {
704
760
  info: {
705
761
  alreadyProvided: "Governance policy file already provided, skipping download.",
706
762
  saved: "Governance policy saved to {path}",
707
- downloading: "Downloading governance policy from {url}",
708
- noPolicyFound: "No governance policy found for this configuration.",
709
- responseNotJson: "Policy response is not JSON, treating as no policy.",
763
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
764
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
765
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
766
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
767
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
710
768
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
711
769
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
712
770
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
713
771
  },
714
772
  errors: {
715
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
716
- failedToGetPolicy: "Failed to download governance policy: {content}",
717
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
718
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
773
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
774
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
775
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
776
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
777
+ failedToSave: "Failed to save governance policy: {error}",
778
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
779
+ },
780
+ instructions: {
781
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
719
782
  }
720
783
  },
721
784
  signing: {
@@ -788,18 +851,25 @@ var ro_default = {
788
851
  info: {
789
852
  alreadyProvided: "Governance policy file already provided, skipping download.",
790
853
  saved: "Governance policy saved to {path}",
791
- downloading: "Downloading governance policy from {url}",
792
- noPolicyFound: "No governance policy found for this configuration.",
793
- responseNotJson: "Policy response is not JSON, treating as no policy.",
854
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
855
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
856
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
857
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
858
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
794
859
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
795
860
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
796
861
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
797
862
  },
798
863
  errors: {
799
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
800
- failedToGetPolicy: "Failed to download governance policy: {content}",
801
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
802
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
864
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
865
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
866
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
867
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
868
+ failedToSave: "Failed to save governance policy: {error}",
869
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
870
+ },
871
+ instructions: {
872
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
803
873
  }
804
874
  },
805
875
  signing: {
@@ -872,18 +942,25 @@ var ru_default = {
872
942
  info: {
873
943
  alreadyProvided: "Governance policy file already provided, skipping download.",
874
944
  saved: "Governance policy saved to {path}",
875
- downloading: "Downloading governance policy from {url}",
876
- noPolicyFound: "No governance policy found for this configuration.",
877
- responseNotJson: "Policy response is not JSON, treating as no policy.",
945
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
946
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
947
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
948
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
949
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
878
950
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
879
951
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
880
952
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
881
953
  },
882
954
  errors: {
883
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
884
- failedToGetPolicy: "Failed to download governance policy: {content}",
885
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
886
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
955
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
956
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
957
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
958
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
959
+ failedToSave: "Failed to save governance policy: {error}",
960
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
961
+ },
962
+ instructions: {
963
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
887
964
  }
888
965
  },
889
966
  signing: {
@@ -956,18 +1033,25 @@ var tr_default = {
956
1033
  info: {
957
1034
  alreadyProvided: "Governance policy file already provided, skipping download.",
958
1035
  saved: "Governance policy saved to {path}",
959
- downloading: "Downloading governance policy from {url}",
960
- noPolicyFound: "No governance policy found for this configuration.",
961
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1036
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1037
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1038
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1039
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1040
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
962
1041
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
963
1042
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
964
1043
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
965
1044
  },
966
1045
  errors: {
967
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
968
- failedToGetPolicy: "Failed to download governance policy: {content}",
969
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
970
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1046
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1047
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1048
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1049
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1050
+ failedToSave: "Failed to save governance policy: {error}",
1051
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1052
+ },
1053
+ instructions: {
1054
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
971
1055
  }
972
1056
  },
973
1057
  signing: {
@@ -1040,18 +1124,25 @@ var zh_CN_default = {
1040
1124
  info: {
1041
1125
  alreadyProvided: "Governance policy file already provided, skipping download.",
1042
1126
  saved: "Governance policy saved to {path}",
1043
- downloading: "Downloading governance policy from {url}",
1044
- noPolicyFound: "No governance policy found for this configuration.",
1045
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1127
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1128
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1129
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1130
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1131
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1046
1132
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1047
1133
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1048
1134
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1049
1135
  },
1050
1136
  errors: {
1051
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1052
- failedToGetPolicy: "Failed to download governance policy: {content}",
1053
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1054
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1137
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1138
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1139
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1140
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1141
+ failedToSave: "Failed to save governance policy: {error}",
1142
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1143
+ },
1144
+ instructions: {
1145
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1055
1146
  }
1056
1147
  },
1057
1148
  signing: {
@@ -1124,18 +1215,25 @@ var zh_TW_default = {
1124
1215
  info: {
1125
1216
  alreadyProvided: "Governance policy file already provided, skipping download.",
1126
1217
  saved: "Governance policy saved to {path}",
1127
- downloading: "Downloading governance policy from {url}",
1128
- noPolicyFound: "No governance policy found for this configuration.",
1129
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1218
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1219
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1220
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1221
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1222
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1130
1223
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1131
1224
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1132
1225
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1133
1226
  },
1134
1227
  errors: {
1135
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1136
- failedToGetPolicy: "Failed to download governance policy: {content}",
1137
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1138
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1228
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1229
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1230
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1231
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1232
+ failedToSave: "Failed to save governance policy: {error}",
1233
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1234
+ },
1235
+ instructions: {
1236
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1139
1237
  }
1140
1238
  },
1141
1239
  signing: {
@@ -1208,18 +1306,25 @@ var zu_default = {
1208
1306
  info: {
1209
1307
  alreadyProvided: "Governance policy file already provided, skipping download.",
1210
1308
  saved: "Governance policy saved to {path}",
1211
- downloading: "Downloading governance policy from {url}",
1212
- noPolicyFound: "No governance policy found for this configuration.",
1213
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1309
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1310
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1311
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1312
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1313
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1214
1314
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1215
1315
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1216
1316
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1217
1317
  },
1218
1318
  errors: {
1219
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1220
- failedToGetPolicy: "Failed to download governance policy: {content}",
1221
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1222
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1319
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1320
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1321
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1322
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1323
+ failedToSave: "Failed to save governance policy: {error}",
1324
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1325
+ },
1326
+ instructions: {
1327
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1223
1328
  }
1224
1329
  },
1225
1330
  signing: {
@@ -9212,7 +9317,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
9212
9317
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
9213
9318
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
9214
9319
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
9215
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
9320
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
9216
9321
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
9217
9322
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
9218
9323
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -9259,7 +9364,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
9259
9364
  `(?<![A-Za-z0-9])"(?:[^\\
9260
9365
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
9261
9366
  ].join("|"), "g");
9262
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
9367
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
9263
9368
  var COLLAPSED_BODY = "{…}";
9264
9369
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
9265
9370
  var MAX_BODY_NESTING = 8;
@@ -9274,10 +9379,13 @@ function collapseJsonBodies(text) {
9274
9379
  }
9275
9380
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
9276
9381
  }
9277
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
9382
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
9278
9383
  function peelTrailingPunctuation(match) {
9279
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
9280
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
9384
+ let end = match.length;
9385
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
9386
+ end -= 1;
9387
+ }
9388
+ return [match.slice(0, end), match.slice(end)];
9281
9389
  }
9282
9390
  function redactUrl(raw) {
9283
9391
  try {
@@ -9485,6 +9593,12 @@ var TLS_ERROR_CODES = new Set([
9485
9593
  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.";
9486
9594
  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.";
9487
9595
  var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
9596
+ function carriedInstructions(error) {
9597
+ if (!error || typeof error !== "object")
9598
+ return;
9599
+ const e = error;
9600
+ return typeof e.instructions === "string" ? e.instructions : undefined;
9601
+ }
9488
9602
  function setExitCode(code) {
9489
9603
  process.exitCode = code;
9490
9604
  }
@@ -9966,7 +10080,8 @@ function readRegistryValue(keyPath, valueName) {
9966
10080
  }
9967
10081
  const [error, output] = catchError(() => execFileSync2("reg", ["query", keyPath, "/v", valueName], {
9968
10082
  encoding: "utf-8",
9969
- stdio: ["pipe", "pipe", "pipe"]
10083
+ stdio: ["pipe", "pipe", "pipe"],
10084
+ windowsHide: true
9970
10085
  }));
9971
10086
  if (error) {
9972
10087
  return "";
@@ -10643,28 +10758,32 @@ function isPlainRecord(value) {
10643
10758
  const prototype = Object.getPrototypeOf(value);
10644
10759
  return prototype === Object.prototype || prototype === null;
10645
10760
  }
10646
- function extractPagedRows(value) {
10761
+ function splitPagedEnvelope(value) {
10647
10762
  if (Array.isArray(value) || !isPlainRecord(value))
10648
10763
  return null;
10649
- const entries = Object.values(value);
10764
+ const entries = Object.entries(value);
10650
10765
  if (entries.length === 0)
10651
10766
  return null;
10652
- let rows = null;
10653
- let hasScalarSibling = false;
10654
- for (const entry of entries) {
10767
+ let found = null;
10768
+ const meta = Object.create(null);
10769
+ for (const [key, entry] of entries) {
10655
10770
  if (Array.isArray(entry)) {
10656
- if (rows !== null)
10771
+ if (found !== null)
10657
10772
  return null;
10658
- rows = entry;
10773
+ found = { key, rows: entry };
10659
10774
  } else if (entry !== null && typeof entry === "object") {
10660
10775
  return null;
10661
10776
  } else {
10662
- hasScalarSibling = true;
10777
+ meta[key] = entry;
10663
10778
  }
10664
10779
  }
10665
- if (rows === null || !hasScalarSibling)
10780
+ if (found === null || Object.keys(meta).length === 0)
10666
10781
  return null;
10667
- return rows;
10782
+ return { ...found, meta };
10783
+ }
10784
+ function extractPagedRows(value) {
10785
+ const paged = splitPagedEnvelope(value);
10786
+ return paged === null ? null : paged.rows;
10668
10787
  }
10669
10788
  function toLowerCamelCaseKey(key) {
10670
10789
  if (!key)
@@ -10768,6 +10887,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
10768
10887
  }
10769
10888
  break;
10770
10889
  }
10890
+ case "markdown":
10891
+ logFn(renderMarkdown(data));
10892
+ break;
10771
10893
  default: {
10772
10894
  const hasData = "Data" in data && data.Data != null;
10773
10895
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
@@ -10792,6 +10914,10 @@ function logOutput(data, format = "json", tableRowStyle) {
10792
10914
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
10793
10915
  `), needsAsciiSafeJson(sink), styleFn);
10794
10916
  }
10917
+ var PLUMBING_KEYS = new Set(["code", "log"]);
10918
+ function isPlumbingKey(key) {
10919
+ return PLUMBING_KEYS.has(key.toLowerCase());
10920
+ }
10795
10921
  function cellToString(val) {
10796
10922
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
10797
10923
  }
@@ -10807,7 +10933,7 @@ function wrapText(text, width) {
10807
10933
  function printTable(data, logFn, externalLogValue, tableRowStyle) {
10808
10934
  if (data.length === 0)
10809
10935
  return;
10810
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
10936
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
10811
10937
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
10812
10938
  const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
10813
10939
  logFn(header);
@@ -10829,7 +10955,7 @@ function isNonEmptyPlainObject(value) {
10829
10955
  }
10830
10956
  var NESTED_INDENT = " ";
10831
10957
  function printVerticalTable(data, logFn = console.log, externalLogValue) {
10832
- const keys = Object.keys(data).filter((key) => !["code", "log"].includes(key.toLowerCase()));
10958
+ const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
10833
10959
  if (keys.length === 0)
10834
10960
  return;
10835
10961
  const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
@@ -10860,7 +10986,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
10860
10986
  function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
10861
10987
  if (data.length === 0)
10862
10988
  return;
10863
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
10989
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
10864
10990
  if (keys.length === 0)
10865
10991
  return;
10866
10992
  if (!process.stdout.isTTY) {
@@ -10934,6 +11060,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
10934
11060
  logFn(`Log: ${externalLogValue}`);
10935
11061
  }
10936
11062
  }
11063
+ var MARKDOWN_MAX_CELL = 200;
11064
+ var MARKDOWN_MAX_DEPTH = 3;
11065
+ function markdownHeading(depth) {
11066
+ return "#".repeat(Math.min(3 + depth, 6));
11067
+ }
11068
+ var BACKTICK_RUN = /`+/g;
11069
+ function fencedBlock(text) {
11070
+ const first = text.trimStart()[0];
11071
+ const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
11072
+ const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
11073
+ const fence = "`".repeat(Math.max(3, longestRun + 1));
11074
+ return `${fence}${language}
11075
+ ${text}
11076
+ ${fence}`;
11077
+ }
11078
+ function collapseNewlineRuns(text) {
11079
+ return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
11080
+ `) ? " " : part).join("");
11081
+ }
11082
+ function markdownCell(value) {
11083
+ const text = value instanceof Date ? value.toISOString() : cellToString(value);
11084
+ return collapseNewlineRuns(text).replace(/\|/g, "\\|");
11085
+ }
11086
+ function markdownLabel(key) {
11087
+ return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
11088
+ }
11089
+ function withoutPlumbing(record) {
11090
+ const kept = Object.create(null);
11091
+ for (const [key, value] of Object.entries(record)) {
11092
+ if (!isPlumbingKey(key))
11093
+ kept[key] = value;
11094
+ }
11095
+ return kept;
11096
+ }
11097
+ function rowsWithoutPlumbing(rows) {
11098
+ return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
11099
+ }
11100
+ function markdownTable(rows) {
11101
+ const columns = [];
11102
+ const seen = new Set;
11103
+ for (const row of rows) {
11104
+ for (const key of Object.keys(row)) {
11105
+ if (!seen.has(key)) {
11106
+ seen.add(key);
11107
+ columns.push(key);
11108
+ }
11109
+ }
11110
+ }
11111
+ if (columns.length === 0)
11112
+ return null;
11113
+ const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
11114
+ if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
11115
+ return null;
11116
+ }
11117
+ return [
11118
+ `| ${columns.map(markdownLabel).join(" | ")} |`,
11119
+ `| ${columns.map(() => "---").join(" | ")} |`,
11120
+ ...cells.map((row) => `| ${row.join(" | ")} |`)
11121
+ ].join(`
11122
+ `);
11123
+ }
11124
+ function extractMessageSequence(rows) {
11125
+ const messages = [];
11126
+ for (const row of rows) {
11127
+ const message = extractSingleMessage(row);
11128
+ if (message === null)
11129
+ return null;
11130
+ messages.push(message);
11131
+ }
11132
+ return messages.join(`
11133
+
11134
+ `);
11135
+ }
11136
+ function markdownRows(rows, depth) {
11137
+ if (rows.length === 0)
11138
+ return "(none)";
11139
+ if (!isPlainObjectArray(rows)) {
11140
+ return rows.map((item) => `- ${markdownCell(item)}`).join(`
11141
+ `);
11142
+ }
11143
+ const prose = extractMessageSequence(rows);
11144
+ if (prose !== null)
11145
+ return prose;
11146
+ const table = markdownTable(rows);
11147
+ if (table !== null)
11148
+ return table;
11149
+ if (depth >= MARKDOWN_MAX_DEPTH) {
11150
+ return fencedBlock(JSON.stringify(rows, null, 2));
11151
+ }
11152
+ return rows.map((row, index) => [
11153
+ `${markdownHeading(depth)} ${index + 1}`,
11154
+ markdownObject(row, depth + 1)
11155
+ ].join(`
11156
+
11157
+ `)).join(`
11158
+
11159
+ `);
11160
+ }
11161
+ function markdownObject(obj, depth) {
11162
+ const scalars = [];
11163
+ const blocks = [];
11164
+ for (const [key, value] of Object.entries(obj)) {
11165
+ if (value === undefined)
11166
+ continue;
11167
+ const label = markdownLabel(key);
11168
+ if (Array.isArray(value)) {
11169
+ blocks.push(`${markdownHeading(depth)} ${label}
11170
+
11171
+ ${markdownRows(value, depth + 1)}`);
11172
+ } else if (isNonEmptyPlainObject(value)) {
11173
+ const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
11174
+ if (nested !== "") {
11175
+ blocks.push(`${markdownHeading(depth)} ${label}
11176
+
11177
+ ${nested}`);
11178
+ }
11179
+ } else if (typeof value === "string" && value.includes(`
11180
+ `)) {
11181
+ blocks.push(`**${label}:**
11182
+
11183
+ ${fencedBlock(value)}`);
11184
+ } else {
11185
+ scalars.push(`**${label}:** ${markdownCell(value)}`);
11186
+ }
11187
+ }
11188
+ const sections = scalars.length > 0 ? [scalars.join(`
11189
+ `)] : [];
11190
+ sections.push(...blocks);
11191
+ return sections.join(`
11192
+
11193
+ `);
11194
+ }
11195
+ function extractSingleMessage(payload) {
11196
+ if (!isPlainRecord(payload))
11197
+ return null;
11198
+ const keys = Object.keys(payload);
11199
+ if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
11200
+ return null;
11201
+ const value = payload[keys[0]];
11202
+ return typeof value === "string" ? value : null;
11203
+ }
11204
+ function markdownPayload(payload) {
11205
+ const message = extractSingleMessage(payload);
11206
+ if (message !== null)
11207
+ return message;
11208
+ if (Array.isArray(payload)) {
11209
+ return markdownRows(rowsWithoutPlumbing(payload), 0);
11210
+ }
11211
+ const visible = withoutPlumbing(payload);
11212
+ const paged = splitPagedEnvelope(visible);
11213
+ if (paged !== null) {
11214
+ const meta = markdownObject(paged.meta, 0);
11215
+ const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
11216
+
11217
+ ${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
11218
+ return meta === "" ? rows : `${meta}
11219
+
11220
+ ${rows}`;
11221
+ }
11222
+ return markdownObject(visible, 0);
11223
+ }
11224
+ function isPaginationWorthShowing(value) {
11225
+ if (typeof value !== "object" || value === null)
11226
+ return false;
11227
+ const page = value;
11228
+ return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
11229
+ }
11230
+ function markdownEnvelopeNotes(data) {
11231
+ const envelope = data;
11232
+ const notes = [];
11233
+ const warning = envelope.Warning;
11234
+ if (typeof warning === "string" && warning !== "") {
11235
+ notes.push(`> **Warning:** ${warning}`);
11236
+ }
11237
+ const instructions = envelope.Instructions;
11238
+ if (typeof instructions === "string" && instructions !== "") {
11239
+ notes.push(`> ${instructions}`);
11240
+ }
11241
+ const pagination = envelope.Pagination;
11242
+ if (isPaginationWorthShowing(pagination)) {
11243
+ const body = markdownObject(pagination, 1);
11244
+ if (body !== "") {
11245
+ notes.push(`${markdownHeading(0)} Pagination
11246
+
11247
+ ${body}`);
11248
+ }
11249
+ }
11250
+ const log = envelope.Log;
11251
+ if (typeof log === "string" && log !== "") {
11252
+ notes.push(`**Log:** ${log}`);
11253
+ }
11254
+ return notes;
11255
+ }
11256
+ function renderMarkdown(data) {
11257
+ if (data.Result !== RESULTS.Success) {
11258
+ const failure = data;
11259
+ const sections = [`**Failed:** ${failure.Message}`];
11260
+ if (failure.Data != null) {
11261
+ sections.push(markdownPayload(failure.Data));
11262
+ }
11263
+ if (failure.Instructions) {
11264
+ sections.push(`> ${failure.Instructions}`);
11265
+ }
11266
+ return sections.filter((section) => section !== "").join(`
11267
+
11268
+ `);
11269
+ }
11270
+ if (!("Data" in data) || data.Data == null) {
11271
+ return markdownObject(withoutPlumbing(data), 0);
11272
+ }
11273
+ return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
11274
+
11275
+ `);
11276
+ }
10937
11277
  function toYaml(data) {
10938
11278
  const codec = getYamlCodec();
10939
11279
  if (!codec) {
@@ -12173,214 +12513,1913 @@ var TelemetryNames;
12173
12513
  TelemetryNames2["ProjectPackagerProjectLoaded"] = "ProjectPackager.ProjectLoaded";
12174
12514
  })(TelemetryNames ||= {});
12175
12515
 
12176
- // src/services/governance-policy-service.ts
12177
- import {
12178
- Path,
12179
- translate as translate3
12180
- } from "@uipath/solutionpackager-tool-core";
12181
- var LICENSE_TYPES = {
12182
- NoLicense: "NoLicense",
12183
- Development: "Development",
12184
- Attended: "Attended",
12185
- Unattended: "Unattended",
12186
- StudioX: "StudioX",
12187
- StudioPro: "StudioPro",
12188
- AutomationKit: "AutomationKit"
12189
- };
12190
- var DEFAULT_PROFILE_KEY = "StudioWeb";
12191
- var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
12192
- var GOVERNANCE_SUBFOLDER = "governance";
12193
- var GOVERNANCE_FILE_NAME = "governance-policy.json";
12194
- var errorMessage = (error) => error instanceof Error ? error.message : String(error);
12195
- var t = (key, params) => translate3.t(`solutionpackager.governance.${key}`, params);
12516
+ // ../../gov/aops-policy-sdk/dist/policy-resolver.js
12517
+ var BASE_PATH = "http://localhost".replace(/\/+$/, "");
12196
12518
 
12197
- class GovernancePolicyService {
12198
- fileSystem;
12199
- temporaryStorage;
12200
- fetchFn;
12201
- logger = new ToolLogger("GovernancePolicyService", "ResolvePolicy");
12202
- constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
12203
- this.fileSystem = fileSystem;
12204
- this.temporaryStorage = temporaryStorage;
12205
- this.fetchFn = fetchFn;
12519
+ class Configuration {
12520
+ configuration;
12521
+ constructor(configuration = {}) {
12522
+ this.configuration = configuration;
12206
12523
  }
12207
- async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken) {
12208
- if (validateOptions.governanceFileType !== "AutomationOps" /* AutomationOps */) {
12209
- return;
12524
+ set config(configuration) {
12525
+ this.configuration = configuration;
12526
+ }
12527
+ get basePath() {
12528
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
12529
+ }
12530
+ get fetchApi() {
12531
+ return this.configuration.fetchApi;
12532
+ }
12533
+ get middleware() {
12534
+ return this.configuration.middleware || [];
12535
+ }
12536
+ get queryParamsStringify() {
12537
+ return this.configuration.queryParamsStringify || querystring;
12538
+ }
12539
+ get username() {
12540
+ return this.configuration.username;
12541
+ }
12542
+ get password() {
12543
+ return this.configuration.password;
12544
+ }
12545
+ get apiKey() {
12546
+ const apiKey = this.configuration.apiKey;
12547
+ if (apiKey) {
12548
+ return typeof apiKey === "function" ? apiKey : () => apiKey;
12210
12549
  }
12211
- if (validateOptions.governanceFilePath) {
12212
- this.logger.info(t("info.alreadyProvided"));
12213
- return;
12550
+ return;
12551
+ }
12552
+ get accessToken() {
12553
+ const accessToken = this.configuration.accessToken;
12554
+ if (accessToken) {
12555
+ return typeof accessToken === "function" ? accessToken : async () => accessToken;
12214
12556
  }
12215
- let cloudUrl = connectionInfo?.cloudUrl;
12216
- const organizationId = connectionInfo?.organizationId;
12217
- const tenantId = connectionInfo?.tenantId;
12218
- const accessToken = connectionInfo?.accessToken;
12219
- if (!cloudUrl || !organizationId || !tenantId || !accessToken) {
12220
- this.logger.warn(t("errors.connectionIncomplete"));
12221
- validateOptions.governanceFileType = "Default" /* Default */;
12222
- return;
12557
+ return;
12558
+ }
12559
+ get headers() {
12560
+ return this.configuration.headers;
12561
+ }
12562
+ get credentials() {
12563
+ return this.configuration.credentials;
12564
+ }
12565
+ }
12566
+ var DefaultConfig = new Configuration;
12567
+
12568
+ class BaseAPI {
12569
+ configuration;
12570
+ static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i");
12571
+ middleware;
12572
+ constructor(configuration = DefaultConfig) {
12573
+ this.configuration = configuration;
12574
+ this.middleware = configuration.middleware;
12575
+ }
12576
+ withMiddleware(...middlewares) {
12577
+ const next = this.clone();
12578
+ next.middleware = next.middleware.concat(...middlewares);
12579
+ return next;
12580
+ }
12581
+ withPreMiddleware(...preMiddlewares) {
12582
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
12583
+ return this.withMiddleware(...middlewares);
12584
+ }
12585
+ withPostMiddleware(...postMiddlewares) {
12586
+ const middlewares = postMiddlewares.map((post) => ({ post }));
12587
+ return this.withMiddleware(...middlewares);
12588
+ }
12589
+ isJsonMime(mime) {
12590
+ if (!mime) {
12591
+ return false;
12223
12592
  }
12224
- const profileKey = validateOptions.profileKey ?? DEFAULT_PROFILE_KEY;
12225
- let cloudOrigin;
12226
- try {
12227
- cloudOrigin = new URL(cloudUrl).origin;
12228
- cloudUrl = cloudUrl.replace(/\/+$/, "");
12229
- } catch {
12230
- this.logger.warn(t("errors.connectionIncomplete"));
12231
- validateOptions.governanceFileType = "Default" /* Default */;
12232
- return;
12593
+ return BaseAPI.jsonRegex.test(mime);
12594
+ }
12595
+ async request(context, initOverrides) {
12596
+ const { url, init } = await this.createFetchParams(context, initOverrides);
12597
+ const response = await this.fetchApi(url, init);
12598
+ if (response && (response.status >= 200 && response.status < 300)) {
12599
+ return response;
12233
12600
  }
12234
- const licenseType = await this.resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken);
12235
- const policy = await this.downloadPolicyAsync(cloudOrigin, organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken);
12236
- if (!policy) {
12237
- validateOptions.governanceFileType = "Default" /* Default */;
12238
- return;
12601
+ throw new ResponseError(response, "Response returned an error code");
12602
+ }
12603
+ async createFetchParams(context, initOverrides) {
12604
+ let url = this.configuration.basePath + context.path;
12605
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
12606
+ url += "?" + this.configuration.queryParamsStringify(context.query);
12239
12607
  }
12240
- try {
12241
- const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
12242
- const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
12243
- await this.fileSystem.writeFile(filePath, policy);
12244
- this.logger.info(t("info.saved", { path: filePath }));
12245
- validateOptions.governanceFilePath = filePath;
12246
- } catch (error) {
12247
- this.logger.warn(t("errors.failedToSave", {
12248
- error: errorMessage(error)
12249
- }));
12250
- validateOptions.governanceFileType = "Default" /* Default */;
12608
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
12609
+ Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {});
12610
+ const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
12611
+ const initParams = {
12612
+ method: context.method,
12613
+ headers,
12614
+ body: context.body,
12615
+ credentials: this.configuration.credentials
12616
+ };
12617
+ const overriddenInit = {
12618
+ ...initParams,
12619
+ ...await initOverrideFn({
12620
+ init: initParams,
12621
+ context
12622
+ })
12623
+ };
12624
+ let body;
12625
+ if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
12626
+ body = overriddenInit.body;
12627
+ } else if (this.isJsonMime(headers["Content-Type"])) {
12628
+ body = JSON.stringify(overriddenInit.body);
12629
+ } else {
12630
+ body = overriddenInit.body;
12251
12631
  }
12632
+ const init = {
12633
+ ...overriddenInit,
12634
+ body
12635
+ };
12636
+ return { url, init };
12252
12637
  }
12253
- async downloadPolicyAsync(cloudOrigin, organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken) {
12254
- const policyUrl = `${cloudOrigin}/${organizationId}/roboticsops_` + `/api/Policy/license/${licenseType}/product/${profileKey}/tenant/${tenantId}`;
12255
- this.logger.info(t("info.downloading", { url: policyUrl }));
12256
- try {
12257
- const response = await this.fetchFn(policyUrl, {
12258
- headers: {
12259
- Authorization: `Bearer ${accessToken}`,
12260
- AccountId: organizationId
12261
- },
12262
- signal: cancellationToken
12263
- });
12264
- if (response.status === 204 || response.status === 404) {
12265
- this.logger.info(t("info.noPolicyFound"));
12266
- return null;
12267
- }
12268
- if (!response.ok) {
12269
- const body = await response.text();
12270
- this.logger.warn(t("errors.failedToGetPolicy", { content: body }));
12271
- return null;
12272
- }
12273
- const content = await response.text();
12274
- if (!content?.trimStart().startsWith("{")) {
12275
- this.logger.info(t("info.responseNotJson"));
12276
- return null;
12638
+ fetchApi = async (url, init) => {
12639
+ let fetchParams = { url, init };
12640
+ for (const middleware of this.middleware) {
12641
+ if (middleware.pre) {
12642
+ fetchParams = await middleware.pre({
12643
+ fetch: this.fetchApi,
12644
+ ...fetchParams
12645
+ }) || fetchParams;
12277
12646
  }
12278
- return content;
12279
- } catch (error) {
12280
- this.logger.warn(t("errors.failedToDownload", {
12281
- error: errorMessage(error)
12282
- }));
12283
- return null;
12284
12647
  }
12285
- }
12286
- async resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken) {
12287
- const isStudioWeb = profileKey === DEFAULT_PROFILE_KEY;
12288
- const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
12648
+ let response = undefined;
12289
12649
  try {
12290
- const response = await this.fetchFn(`${cloudUrl}${ACQUIRE_LICENSE_PATH}`, {
12291
- method: "POST",
12292
- headers: { Authorization: `Bearer ${accessToken}` },
12293
- signal: cancellationToken
12294
- });
12295
- if (!response.ok) {
12296
- this.logger.info(t("info.licenseStatus", {
12297
- status: response.status,
12298
- fallback
12299
- }));
12300
- return fallback;
12301
- }
12302
- const { isLicensed, robotType } = await response.json();
12303
- this.logger.info(t("info.licenseResponse", {
12304
- isLicensed: String(isLicensed),
12305
- robotType: String(robotType)
12306
- }));
12307
- if (!isLicensed || !robotType) {
12308
- return fallback;
12650
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
12651
+ } catch (e) {
12652
+ for (const middleware of this.middleware) {
12653
+ if (middleware.onError) {
12654
+ response = await middleware.onError({
12655
+ fetch: this.fetchApi,
12656
+ url: fetchParams.url,
12657
+ init: fetchParams.init,
12658
+ error: e,
12659
+ response: response ? response.clone() : undefined
12660
+ }) || response;
12661
+ }
12662
+ }
12663
+ if (response === undefined) {
12664
+ if (e instanceof Error) {
12665
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
12666
+ } else {
12667
+ throw e;
12668
+ }
12309
12669
  }
12310
- if (isStudioWeb) {
12311
- return robotType === LICENSE_TYPES.AutomationKit ? LICENSE_TYPES.AutomationKit : LICENSE_TYPES.NoLicense;
12670
+ }
12671
+ for (const middleware of this.middleware) {
12672
+ if (middleware.post) {
12673
+ response = await middleware.post({
12674
+ fetch: this.fetchApi,
12675
+ url: fetchParams.url,
12676
+ init: fetchParams.init,
12677
+ response: response.clone()
12678
+ }) || response;
12312
12679
  }
12313
- return robotType;
12314
- } catch (error) {
12315
- this.logger.info(t("info.licenseFailed", {
12316
- error: errorMessage(error),
12317
- fallback
12318
- }));
12319
- return fallback;
12320
12680
  }
12681
+ return response;
12682
+ };
12683
+ clone() {
12684
+ const constructor = this.constructor;
12685
+ const next = new constructor(this.configuration);
12686
+ next.middleware = this.middleware.slice();
12687
+ return next;
12321
12688
  }
12322
12689
  }
12690
+ function isBlob(value) {
12691
+ return typeof Blob !== "undefined" && value instanceof Blob;
12692
+ }
12693
+ function isFormData(value) {
12694
+ return typeof FormData !== "undefined" && value instanceof FormData;
12695
+ }
12323
12696
 
12324
- // src/services/nupkg-resolver.ts
12325
- async function resolveProducedNupkgsAsync(fileSystem, packagePath) {
12326
- if (packagePath.toLowerCase().endsWith(".nupkg")) {
12327
- return [packagePath];
12328
- }
12329
- const stat2 = await fileSystem.stat(packagePath);
12330
- if (!stat2?.isDirectory()) {
12331
- return [];
12332
- }
12333
- const candidateDirs = [packagePath, fileSystem.path.dirname(packagePath)];
12334
- for (const dir of candidateDirs) {
12335
- const entries = await fileSystem.readdir(dir);
12336
- const nupkgs = entries.filter((entry) => entry.toLowerCase().endsWith(".nupkg")).map((entry) => fileSystem.path.join(dir, entry));
12337
- if (nupkgs.length > 0) {
12338
- return nupkgs;
12339
- }
12697
+ class ResponseError extends Error {
12698
+ response;
12699
+ name = "ResponseError";
12700
+ constructor(response, msg) {
12701
+ super(msg);
12702
+ this.response = response;
12340
12703
  }
12341
- return [];
12342
12704
  }
12343
12705
 
12344
- // src/services/pack-service.ts
12345
- class PackService {
12346
- disallowedCharsRegex = /[^\p{L}\p{N}_.-]/gu;
12347
- spacesDotRegex = /[\s.]+/g;
12348
- dotDashRegex = /\.{0,10}[-:]\.{0,10}/g;
12349
- MaxPackageIdLength = 100;
12350
- sanitizePackageId(packageId) {
12351
- packageId = packageId.trim();
12352
- packageId = packageId.replace(this.spacesDotRegex, ".");
12353
- packageId = packageId.replace(this.dotDashRegex, "-");
12354
- packageId = packageId.replace(this.disallowedCharsRegex, "_");
12355
- if (packageId.length > this.MaxPackageIdLength) {
12356
- throw new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
12357
- }
12358
- return packageId;
12706
+ class FetchError extends Error {
12707
+ cause;
12708
+ name = "FetchError";
12709
+ constructor(cause, msg) {
12710
+ super(msg);
12711
+ this.cause = cause;
12359
12712
  }
12360
12713
  }
12361
12714
 
12362
- // src/services/package-signer.ts
12363
- import { ToolErrorCodes as ToolErrorCodes2, ToolResult as ToolResult2 } from "@uipath/solutionpackager-tool-core";
12364
- async function signNupkgsAsync(signService, nupkgPaths, signingInfo) {
12365
- if (!signingInfo?.certificatePath) {
12366
- return ToolResult2.success();
12715
+ class RequiredError extends Error {
12716
+ field;
12717
+ name = "RequiredError";
12718
+ constructor(field, msg) {
12719
+ super(msg);
12720
+ this.field = field;
12367
12721
  }
12368
- if (!signService) {
12369
- return ToolResult2.error(ToolErrorCodes2.InternalError, "Package signing is required but signing service is not available. Package signing requires dotnet CLI to be installed in Node.js environment.");
12722
+ }
12723
+ function querystring(params, prefix = "") {
12724
+ return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
12725
+ }
12726
+ function querystringSingleKey(key, value, keyPrefix = "") {
12727
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
12728
+ if (value instanceof Array) {
12729
+ const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
12730
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
12370
12731
  }
12371
- const certificatePath = signingInfo.certificatePath;
12372
- const toSign = [...new Set(nupkgPaths)];
12373
- if (toSign.length === 0) {
12374
- return ToolResult2.success();
12732
+ if (value instanceof Set) {
12733
+ const valueAsArray = Array.from(value);
12734
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
12375
12735
  }
12376
- if (signService.signPackagesAsync) {
12377
- return signService.signPackagesAsync(toSign, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
12736
+ if (value instanceof Date) {
12737
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
12378
12738
  }
12379
- for (const packagePath of toSign) {
12380
- const signResult = await signService.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
12381
- if (!signResult.isSuccess) {
12382
- return signResult;
12383
- }
12739
+ if (value instanceof Object) {
12740
+ return querystring(value, fullKey);
12741
+ }
12742
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
12743
+ }
12744
+ function canConsumeForm(consumes) {
12745
+ for (const consume of consumes) {
12746
+ if (consume.contentType === "multipart/form-data") {
12747
+ return true;
12748
+ }
12749
+ }
12750
+ return false;
12751
+ }
12752
+
12753
+ class JSONApiResponse {
12754
+ raw;
12755
+ transformer;
12756
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
12757
+ this.raw = raw;
12758
+ this.transformer = transformer;
12759
+ }
12760
+ async value() {
12761
+ return this.transformer(await this.raw.json());
12762
+ }
12763
+ }
12764
+
12765
+ class VoidApiResponse {
12766
+ raw;
12767
+ constructor(raw) {
12768
+ this.raw = raw;
12769
+ }
12770
+ async value() {
12771
+ return;
12772
+ }
12773
+ }
12774
+ class TextApiResponse {
12775
+ raw;
12776
+ constructor(raw) {
12777
+ this.raw = raw;
12778
+ }
12779
+ async value() {
12780
+ return await this.raw.text();
12781
+ }
12782
+ }
12783
+ function ProductDtoFromJSON(json2) {
12784
+ return ProductDtoFromJSONTyped(json2, false);
12785
+ }
12786
+ function ProductDtoFromJSONTyped(json2, ignoreDiscriminator) {
12787
+ if (json2 == null) {
12788
+ return json2;
12789
+ }
12790
+ return {
12791
+ name: json2["name"] == null ? undefined : json2["name"],
12792
+ label: json2["label"] == null ? undefined : json2["label"],
12793
+ isRestricted: json2["isRestricted"] == null ? undefined : json2["isRestricted"],
12794
+ isCloud: json2["isCloud"] == null ? undefined : json2["isCloud"],
12795
+ isRemote: json2["isRemote"] == null ? undefined : json2["isRemote"]
12796
+ };
12797
+ }
12798
+ function ProductDtoToJSON(json2) {
12799
+ return ProductDtoToJSONTyped(json2, false);
12800
+ }
12801
+ function ProductDtoToJSONTyped(value, ignoreDiscriminator = false) {
12802
+ if (value == null) {
12803
+ return value;
12804
+ }
12805
+ return {
12806
+ name: value["name"],
12807
+ label: value["label"],
12808
+ isRestricted: value["isRestricted"],
12809
+ isCloud: value["isCloud"],
12810
+ isRemote: value["isRemote"]
12811
+ };
12812
+ }
12813
+ function GlobalPolicyDtoFromJSON(json2) {
12814
+ return GlobalPolicyDtoFromJSONTyped(json2, false);
12815
+ }
12816
+ function GlobalPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
12817
+ if (json2 == null) {
12818
+ return json2;
12819
+ }
12820
+ return {
12821
+ licenseType: json2["licenseType"] == null ? undefined : json2["licenseType"],
12822
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
12823
+ policyNumber: json2["policyNumber"] == null ? undefined : json2["policyNumber"],
12824
+ product: json2["product"] == null ? undefined : ProductDtoFromJSON(json2["product"]),
12825
+ data: json2["data"] == null ? undefined : json2["data"]
12826
+ };
12827
+ }
12828
+ function GlobalPolicyDtoToJSON(json2) {
12829
+ return GlobalPolicyDtoToJSONTyped(json2, false);
12830
+ }
12831
+ function GlobalPolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
12832
+ if (value == null) {
12833
+ return value;
12834
+ }
12835
+ return {
12836
+ licenseType: value["licenseType"],
12837
+ identifier: value["identifier"],
12838
+ policyNumber: value["policyNumber"],
12839
+ product: ProductDtoToJSON(value["product"]),
12840
+ data: value["data"]
12841
+ };
12842
+ }
12843
+ function CreateGlobalPolicyWithFormDataRequestToJSON(json2) {
12844
+ return CreateGlobalPolicyWithFormDataRequestToJSONTyped(json2, false);
12845
+ }
12846
+ function CreateGlobalPolicyWithFormDataRequestToJSONTyped(value, ignoreDiscriminator = false) {
12847
+ if (value == null) {
12848
+ return value;
12849
+ }
12850
+ return {
12851
+ globalPolicy: GlobalPolicyDtoToJSON(value["globalPolicy"])
12852
+ };
12853
+ }
12854
+ function CreatePolicyRequestToJSON(json2) {
12855
+ return CreatePolicyRequestToJSONTyped(json2, false);
12856
+ }
12857
+ function CreatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
12858
+ if (value == null) {
12859
+ return value;
12860
+ }
12861
+ return {
12862
+ name: value["name"],
12863
+ description: value["description"],
12864
+ priority: value["priority"],
12865
+ availability: value["availability"],
12866
+ productName: value["productName"],
12867
+ data: value["data"]
12868
+ };
12869
+ }
12870
+ function FormDataDtoFromJSON(json2) {
12871
+ return FormDataDtoFromJSONTyped(json2, false);
12872
+ }
12873
+ function FormDataDtoFromJSONTyped(json2, ignoreDiscriminator) {
12874
+ if (json2 == null) {
12875
+ return json2;
12876
+ }
12877
+ return {
12878
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
12879
+ data: json2["data"] == null ? undefined : json2["data"]
12880
+ };
12881
+ }
12882
+ function FormDataDtoToJSON(json2) {
12883
+ return FormDataDtoToJSONTyped(json2, false);
12884
+ }
12885
+ function FormDataDtoToJSONTyped(value, ignoreDiscriminator = false) {
12886
+ if (value == null) {
12887
+ return value;
12888
+ }
12889
+ return {
12890
+ policyIdentifier: value["policyIdentifier"],
12891
+ data: value["data"]
12892
+ };
12893
+ }
12894
+ function PolicyDtoFromJSON(json2) {
12895
+ return PolicyDtoFromJSONTyped(json2, false);
12896
+ }
12897
+ function PolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
12898
+ if (json2 == null) {
12899
+ return json2;
12900
+ }
12901
+ return {
12902
+ name: json2["name"] == null ? undefined : json2["name"],
12903
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
12904
+ description: json2["description"] == null ? undefined : json2["description"],
12905
+ priority: json2["priority"] == null ? undefined : json2["priority"],
12906
+ availability: json2["availability"] == null ? undefined : json2["availability"],
12907
+ product: json2["product"] == null ? undefined : ProductDtoFromJSON(json2["product"]),
12908
+ data: json2["data"] == null ? undefined : FormDataDtoFromJSON(json2["data"])
12909
+ };
12910
+ }
12911
+ function PolicyDtoToJSON(json2) {
12912
+ return PolicyDtoToJSONTyped(json2, false);
12913
+ }
12914
+ function PolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
12915
+ if (value == null) {
12916
+ return value;
12917
+ }
12918
+ return {
12919
+ name: value["name"],
12920
+ identifier: value["identifier"],
12921
+ description: value["description"],
12922
+ priority: value["priority"],
12923
+ availability: value["availability"],
12924
+ product: ProductDtoToJSON(value["product"]),
12925
+ data: FormDataDtoToJSON(value["data"])
12926
+ };
12927
+ }
12928
+ function CreatePolicyWithFormDataRequestToJSON(json2) {
12929
+ return CreatePolicyWithFormDataRequestToJSONTyped(json2, false);
12930
+ }
12931
+ function CreatePolicyWithFormDataRequestToJSONTyped(value, ignoreDiscriminator = false) {
12932
+ if (value == null) {
12933
+ return value;
12934
+ }
12935
+ return {
12936
+ policy: PolicyDtoToJSON(value["policy"]),
12937
+ policyFormData: FormDataDtoToJSON(value["policyFormData"])
12938
+ };
12939
+ }
12940
+ function DeployedPolicyDtoToJSON(json2) {
12941
+ return DeployedPolicyDtoToJSONTyped(json2, false);
12942
+ }
12943
+ function DeployedPolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
12944
+ if (value == null) {
12945
+ return value;
12946
+ }
12947
+ return {
12948
+ licenseType: value["licenseType"],
12949
+ productName: value["productName"],
12950
+ tenantIdentifier: value["tenantIdentifier"],
12951
+ userIdentifier: value["userIdentifier"]
12952
+ };
12953
+ }
12954
+ function DeployedPolicyWithoutUserDtoToJSON(json2) {
12955
+ return DeployedPolicyWithoutUserDtoToJSONTyped(json2, false);
12956
+ }
12957
+ function DeployedPolicyWithoutUserDtoToJSONTyped(value, ignoreDiscriminator = false) {
12958
+ if (value == null) {
12959
+ return value;
12960
+ }
12961
+ return {
12962
+ licenseType: value["licenseType"],
12963
+ productName: value["productName"],
12964
+ tenantIdentifier: value["tenantIdentifier"]
12965
+ };
12966
+ }
12967
+ function DeploymentLevelFromJSON(json2) {
12968
+ return DeploymentLevelFromJSONTyped(json2, false);
12969
+ }
12970
+ function DeploymentLevelFromJSONTyped(json2, ignoreDiscriminator) {
12971
+ return json2;
12972
+ }
12973
+ function TenantPolicyDtoFromJSON(json2) {
12974
+ return TenantPolicyDtoFromJSONTyped(json2, false);
12975
+ }
12976
+ function TenantPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
12977
+ if (json2 == null) {
12978
+ return json2;
12979
+ }
12980
+ return {
12981
+ tenantIdentifier: json2["tenantIdentifier"] == null ? undefined : json2["tenantIdentifier"],
12982
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
12983
+ productIdentifier: json2["productIdentifier"] == null ? undefined : json2["productIdentifier"],
12984
+ licenseTypeIdentifier: json2["licenseTypeIdentifier"] == null ? undefined : json2["licenseTypeIdentifier"],
12985
+ tenantName: json2["tenantName"] == null ? undefined : json2["tenantName"]
12986
+ };
12987
+ }
12988
+ function GroupPolicyDtoFromJSON(json2) {
12989
+ return GroupPolicyDtoFromJSONTyped(json2, false);
12990
+ }
12991
+ function GroupPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
12992
+ if (json2 == null) {
12993
+ return json2;
12994
+ }
12995
+ return {
12996
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
12997
+ productIdentifier: json2["productIdentifier"] == null ? undefined : json2["productIdentifier"],
12998
+ groupId: json2["groupId"] == null ? undefined : json2["groupId"],
12999
+ groupName: json2["groupName"] == null ? undefined : json2["groupName"]
13000
+ };
13001
+ }
13002
+ function UserPolicyDtoFromJSON(json2) {
13003
+ return UserPolicyDtoFromJSONTyped(json2, false);
13004
+ }
13005
+ function UserPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13006
+ if (json2 == null) {
13007
+ return json2;
13008
+ }
13009
+ return {
13010
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
13011
+ productIdentifier: json2["productIdentifier"] == null ? undefined : json2["productIdentifier"],
13012
+ userId: json2["userId"] == null ? undefined : json2["userId"],
13013
+ userName: json2["userName"] == null ? undefined : json2["userName"]
13014
+ };
13015
+ }
13016
+ function FederatedPolicyDtoFromJSON(json2) {
13017
+ return FederatedPolicyDtoFromJSONTyped(json2, false);
13018
+ }
13019
+ function FederatedPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13020
+ if (json2 == null) {
13021
+ return json2;
13022
+ }
13023
+ return {
13024
+ name: json2["name"] == null ? undefined : json2["name"],
13025
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13026
+ product: json2["product"] == null ? undefined : ProductDtoFromJSON(json2["product"]),
13027
+ description: json2["description"] == null ? undefined : json2["description"],
13028
+ priority: json2["priority"] == null ? undefined : json2["priority"],
13029
+ availability: json2["availability"] == null ? undefined : json2["availability"],
13030
+ tenantPolicies: json2["tenantPolicies"] == null ? undefined : json2["tenantPolicies"].map(TenantPolicyDtoFromJSON),
13031
+ userPolicies: json2["userPolicies"] == null ? undefined : json2["userPolicies"].map(UserPolicyDtoFromJSON),
13032
+ groupPolicies: json2["groupPolicies"] == null ? undefined : json2["groupPolicies"].map(GroupPolicyDtoFromJSON)
13033
+ };
13034
+ }
13035
+ function FederatedPolicyDtoPagedResultFromJSON(json2) {
13036
+ return FederatedPolicyDtoPagedResultFromJSONTyped(json2, false);
13037
+ }
13038
+ function FederatedPolicyDtoPagedResultFromJSONTyped(json2, ignoreDiscriminator) {
13039
+ if (json2 == null) {
13040
+ return json2;
13041
+ }
13042
+ return {
13043
+ totalCount: json2["totalCount"] == null ? undefined : json2["totalCount"],
13044
+ result: json2["result"] == null ? undefined : json2["result"].map(FederatedPolicyDtoFromJSON)
13045
+ };
13046
+ }
13047
+ function ImportPolicyRequestFromJSON(json2) {
13048
+ return ImportPolicyRequestFromJSONTyped(json2, false);
13049
+ }
13050
+ function ImportPolicyRequestFromJSONTyped(json2, ignoreDiscriminator) {
13051
+ if (json2 == null) {
13052
+ return json2;
13053
+ }
13054
+ return {
13055
+ productName: json2["product-name"] == null ? undefined : json2["product-name"],
13056
+ policyName: json2["policy-name"] == null ? undefined : json2["policy-name"],
13057
+ version: json2["version"] == null ? undefined : json2["version"],
13058
+ data: json2["data"] == null ? undefined : json2["data"]
13059
+ };
13060
+ }
13061
+ function PolicyDtoPagedResultFromJSON(json2) {
13062
+ return PolicyDtoPagedResultFromJSONTyped(json2, false);
13063
+ }
13064
+ function PolicyDtoPagedResultFromJSONTyped(json2, ignoreDiscriminator) {
13065
+ if (json2 == null) {
13066
+ return json2;
13067
+ }
13068
+ return {
13069
+ totalCount: json2["totalCount"] == null ? undefined : json2["totalCount"],
13070
+ result: json2["result"] == null ? undefined : json2["result"].map(PolicyDtoFromJSON)
13071
+ };
13072
+ }
13073
+ function PolicyExportResponseFromJSON(json2) {
13074
+ return PolicyExportResponseFromJSONTyped(json2, false);
13075
+ }
13076
+ function PolicyExportResponseFromJSONTyped(json2, ignoreDiscriminator) {
13077
+ if (json2 == null) {
13078
+ return json2;
13079
+ }
13080
+ return {
13081
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13082
+ name: json2["name"] == null ? undefined : json2["name"],
13083
+ availability: json2["availability"] == null ? undefined : json2["availability"],
13084
+ data: json2["data"] == null ? undefined : json2["data"],
13085
+ priority: json2["priority"] == null ? undefined : json2["priority"],
13086
+ deploymentLevel: json2["deploymentLevel"] == null ? undefined : DeploymentLevelFromJSON(json2["deploymentLevel"])
13087
+ };
13088
+ }
13089
+ function PolicyInfoDtoFromJSON(json2) {
13090
+ return PolicyInfoDtoFromJSONTyped(json2, false);
13091
+ }
13092
+ function PolicyInfoDtoFromJSONTyped(json2, ignoreDiscriminator) {
13093
+ if (json2 == null) {
13094
+ return json2;
13095
+ }
13096
+ return {
13097
+ name: json2["name"] == null ? undefined : json2["name"],
13098
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13099
+ product: json2["product"] == null ? undefined : json2["product"]
13100
+ };
13101
+ }
13102
+ function PolicyUsageDataFromJSON(json2) {
13103
+ return PolicyUsageDataFromJSONTyped(json2, false);
13104
+ }
13105
+ function PolicyUsageDataFromJSONTyped(json2, ignoreDiscriminator) {
13106
+ if (json2 == null) {
13107
+ return json2;
13108
+ }
13109
+ return {
13110
+ tenants: json2["tenants"] == null ? undefined : json2["tenants"],
13111
+ users: json2["users"] == null ? undefined : json2["users"],
13112
+ groups: json2["groups"] == null ? undefined : json2["groups"]
13113
+ };
13114
+ }
13115
+ function UpdatePolicyRequestToJSON(json2) {
13116
+ return UpdatePolicyRequestToJSONTyped(json2, false);
13117
+ }
13118
+ function UpdatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
13119
+ if (value == null) {
13120
+ return value;
13121
+ }
13122
+ return {
13123
+ name: value["name"],
13124
+ identifier: value["identifier"],
13125
+ description: value["description"],
13126
+ priority: value["priority"],
13127
+ availability: value["availability"],
13128
+ productName: value["productName"],
13129
+ data: value["data"]
13130
+ };
13131
+ }
13132
+
13133
+ class PolicyApi extends BaseAPI {
13134
+ async policyCreateDefaultPolicyForAllProductsRaw(initOverrides) {
13135
+ const queryParameters = {};
13136
+ const headerParameters = {};
13137
+ if (this.configuration && this.configuration.apiKey) {
13138
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13139
+ }
13140
+ let urlPath = `/api/Policy/default`;
13141
+ const response = await this.request({
13142
+ path: urlPath,
13143
+ method: "POST",
13144
+ headers: headerParameters,
13145
+ query: queryParameters
13146
+ }, initOverrides);
13147
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13148
+ }
13149
+ async policyCreateDefaultPolicyForAllProducts(initOverrides) {
13150
+ const response = await this.policyCreateDefaultPolicyForAllProductsRaw(initOverrides);
13151
+ return await response.value();
13152
+ }
13153
+ async policyCreateFormDataRaw(requestParameters, initOverrides) {
13154
+ if (requestParameters["policyIdentifier"] == null) {
13155
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyCreateFormData().');
13156
+ }
13157
+ const queryParameters = {};
13158
+ const headerParameters = {};
13159
+ headerParameters["Content-Type"] = "application/json";
13160
+ if (this.configuration && this.configuration.apiKey) {
13161
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13162
+ }
13163
+ let urlPath = `/api/Policy/form-data/{policyIdentifier}`;
13164
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13165
+ const response = await this.request({
13166
+ path: urlPath,
13167
+ method: "PUT",
13168
+ headers: headerParameters,
13169
+ query: queryParameters,
13170
+ body: requestParameters["body"]
13171
+ }, initOverrides);
13172
+ if (this.isJsonMime(response.headers.get("content-type"))) {
13173
+ return new JSONApiResponse(response);
13174
+ } else {
13175
+ return new TextApiResponse(response);
13176
+ }
13177
+ }
13178
+ async policyCreateFormData(requestParameters, initOverrides) {
13179
+ const response = await this.policyCreateFormDataRaw(requestParameters, initOverrides);
13180
+ return await response.value();
13181
+ }
13182
+ async policyCreateGlobalPolicyRaw(requestParameters, initOverrides) {
13183
+ const queryParameters = {};
13184
+ const headerParameters = {};
13185
+ headerParameters["Content-Type"] = "application/json";
13186
+ if (this.configuration && this.configuration.apiKey) {
13187
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13188
+ }
13189
+ let urlPath = `/api/Policy/global`;
13190
+ const response = await this.request({
13191
+ path: urlPath,
13192
+ method: "POST",
13193
+ headers: headerParameters,
13194
+ query: queryParameters,
13195
+ body: CreateGlobalPolicyWithFormDataRequestToJSON(requestParameters["createGlobalPolicyWithFormDataRequest"])
13196
+ }, initOverrides);
13197
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
13198
+ }
13199
+ async policyCreateGlobalPolicy(requestParameters = {}, initOverrides) {
13200
+ const response = await this.policyCreateGlobalPolicyRaw(requestParameters, initOverrides);
13201
+ return await response.value();
13202
+ }
13203
+ async policyCreatePolicyRaw(requestParameters, initOverrides) {
13204
+ const queryParameters = {};
13205
+ if (requestParameters["telemetryFlowId"] != null) {
13206
+ queryParameters["telemetryFlowId"] = requestParameters["telemetryFlowId"];
13207
+ }
13208
+ const headerParameters = {};
13209
+ headerParameters["Content-Type"] = "application/json";
13210
+ if (this.configuration && this.configuration.apiKey) {
13211
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13212
+ }
13213
+ let urlPath = `/api/Policy`;
13214
+ const response = await this.request({
13215
+ path: urlPath,
13216
+ method: "POST",
13217
+ headers: headerParameters,
13218
+ query: queryParameters,
13219
+ body: CreatePolicyWithFormDataRequestToJSON(requestParameters["createPolicyWithFormDataRequest"])
13220
+ }, initOverrides);
13221
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13222
+ }
13223
+ async policyCreatePolicy(requestParameters = {}, initOverrides) {
13224
+ const response = await this.policyCreatePolicyRaw(requestParameters, initOverrides);
13225
+ return await response.value();
13226
+ }
13227
+ async policyCreatePolicyV2Raw(requestParameters, initOverrides) {
13228
+ const queryParameters = {};
13229
+ if (requestParameters["telemetryFlowId"] != null) {
13230
+ queryParameters["telemetryFlowId"] = requestParameters["telemetryFlowId"];
13231
+ }
13232
+ const headerParameters = {};
13233
+ headerParameters["Content-Type"] = "application/json";
13234
+ if (this.configuration && this.configuration.apiKey) {
13235
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13236
+ }
13237
+ let urlPath = `/api/Policy/v2/create`;
13238
+ const response = await this.request({
13239
+ path: urlPath,
13240
+ method: "POST",
13241
+ headers: headerParameters,
13242
+ query: queryParameters,
13243
+ body: CreatePolicyRequestToJSON(requestParameters["createPolicyRequest"])
13244
+ }, initOverrides);
13245
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13246
+ }
13247
+ async policyCreatePolicyV2(requestParameters = {}, initOverrides) {
13248
+ const response = await this.policyCreatePolicyV2Raw(requestParameters, initOverrides);
13249
+ return await response.value();
13250
+ }
13251
+ async policyDeletePolicyRaw(requestParameters, initOverrides) {
13252
+ if (requestParameters["policyIdentifier"] == null) {
13253
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyDeletePolicy().');
13254
+ }
13255
+ const queryParameters = {};
13256
+ const headerParameters = {};
13257
+ if (this.configuration && this.configuration.apiKey) {
13258
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13259
+ }
13260
+ let urlPath = `/api/Policy/{policyIdentifier}`;
13261
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13262
+ const response = await this.request({
13263
+ path: urlPath,
13264
+ method: "DELETE",
13265
+ headers: headerParameters,
13266
+ query: queryParameters
13267
+ }, initOverrides);
13268
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13269
+ }
13270
+ async policyDeletePolicy(requestParameters, initOverrides) {
13271
+ const response = await this.policyDeletePolicyRaw(requestParameters, initOverrides);
13272
+ return await response.value();
13273
+ }
13274
+ async policyDeletePolicyByProductNameAndPolicyNameRaw(requestParameters, initOverrides) {
13275
+ if (requestParameters["productName"] == null) {
13276
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyDeletePolicyByProductNameAndPolicyName().');
13277
+ }
13278
+ if (requestParameters["policyName"] == null) {
13279
+ throw new RequiredError("policyName", 'Required parameter "policyName" was null or undefined when calling policyDeletePolicyByProductNameAndPolicyName().');
13280
+ }
13281
+ const queryParameters = {};
13282
+ const headerParameters = {};
13283
+ if (this.configuration && this.configuration.apiKey) {
13284
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13285
+ }
13286
+ let urlPath = `/api/Policy/product/{productName}/policy/{policyName}`;
13287
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
13288
+ urlPath = urlPath.replace(`{${"policyName"}}`, encodeURIComponent(String(requestParameters["policyName"])));
13289
+ const response = await this.request({
13290
+ path: urlPath,
13291
+ method: "DELETE",
13292
+ headers: headerParameters,
13293
+ query: queryParameters
13294
+ }, initOverrides);
13295
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13296
+ }
13297
+ async policyDeletePolicyByProductNameAndPolicyName(requestParameters, initOverrides) {
13298
+ const response = await this.policyDeletePolicyByProductNameAndPolicyNameRaw(requestParameters, initOverrides);
13299
+ return await response.value();
13300
+ }
13301
+ async policyDownloadPolicyByIdentifierRaw(requestParameters, initOverrides) {
13302
+ if (requestParameters["policyIdentifier"] == null) {
13303
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyDownloadPolicyByIdentifier().');
13304
+ }
13305
+ const queryParameters = {};
13306
+ const headerParameters = {};
13307
+ if (this.configuration && this.configuration.apiKey) {
13308
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13309
+ }
13310
+ let urlPath = `/api/Policy/{policyIdentifier}/download`;
13311
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13312
+ const response = await this.request({
13313
+ path: urlPath,
13314
+ method: "GET",
13315
+ headers: headerParameters,
13316
+ query: queryParameters
13317
+ }, initOverrides);
13318
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
13319
+ }
13320
+ async policyDownloadPolicyByIdentifier(requestParameters, initOverrides) {
13321
+ const response = await this.policyDownloadPolicyByIdentifierRaw(requestParameters, initOverrides);
13322
+ return await response.value();
13323
+ }
13324
+ async policyGetAllPoliciesRaw(initOverrides) {
13325
+ const queryParameters = {};
13326
+ const headerParameters = {};
13327
+ if (this.configuration && this.configuration.apiKey) {
13328
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13329
+ }
13330
+ let urlPath = `/api/Policy`;
13331
+ const response = await this.request({
13332
+ path: urlPath,
13333
+ method: "GET",
13334
+ headers: headerParameters,
13335
+ query: queryParameters
13336
+ }, initOverrides);
13337
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyDtoFromJSON));
13338
+ }
13339
+ async policyGetAllPolicies(initOverrides) {
13340
+ const response = await this.policyGetAllPoliciesRaw(initOverrides);
13341
+ return await response.value();
13342
+ }
13343
+ async policyGetAllPoliciesByProductIdRaw(requestParameters, initOverrides) {
13344
+ if (requestParameters["productIdentifier"] == null) {
13345
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetAllPoliciesByProductId().');
13346
+ }
13347
+ const queryParameters = {};
13348
+ const headerParameters = {};
13349
+ if (this.configuration && this.configuration.apiKey) {
13350
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13351
+ }
13352
+ let urlPath = `/api/Policy/{productIdentifier}`;
13353
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
13354
+ const response = await this.request({
13355
+ path: urlPath,
13356
+ method: "GET",
13357
+ headers: headerParameters,
13358
+ query: queryParameters
13359
+ }, initOverrides);
13360
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyDtoFromJSON));
13361
+ }
13362
+ async policyGetAllPoliciesByProductId(requestParameters, initOverrides) {
13363
+ const response = await this.policyGetAllPoliciesByProductIdRaw(requestParameters, initOverrides);
13364
+ return await response.value();
13365
+ }
13366
+ async policyGetAllPoliciesByQueryOptionsRaw(requestParameters, initOverrides) {
13367
+ const queryParameters = {};
13368
+ if (requestParameters["productLabel"] != null) {
13369
+ queryParameters["productLabel"] = requestParameters["productLabel"];
13370
+ }
13371
+ if (requestParameters["productName"] != null) {
13372
+ queryParameters["productName"] = requestParameters["productName"];
13373
+ }
13374
+ if (requestParameters["productNames"] != null) {
13375
+ queryParameters["productNames"] = requestParameters["productNames"];
13376
+ }
13377
+ if (requestParameters["sortBy"] != null) {
13378
+ queryParameters["sortBy"] = requestParameters["sortBy"];
13379
+ }
13380
+ if (requestParameters["sortOrder"] != null) {
13381
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
13382
+ }
13383
+ if (requestParameters["pageIndex"] != null) {
13384
+ queryParameters["pageIndex"] = requestParameters["pageIndex"];
13385
+ }
13386
+ if (requestParameters["pageSize"] != null) {
13387
+ queryParameters["pageSize"] = requestParameters["pageSize"];
13388
+ }
13389
+ if (requestParameters["searchTerm"] != null) {
13390
+ queryParameters["searchTerm"] = requestParameters["searchTerm"];
13391
+ }
13392
+ const headerParameters = {};
13393
+ if (this.configuration && this.configuration.apiKey) {
13394
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13395
+ }
13396
+ let urlPath = `/api/Policy/paged`;
13397
+ const response = await this.request({
13398
+ path: urlPath,
13399
+ method: "GET",
13400
+ headers: headerParameters,
13401
+ query: queryParameters
13402
+ }, initOverrides);
13403
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoPagedResultFromJSON(jsonValue));
13404
+ }
13405
+ async policyGetAllPoliciesByQueryOptions(requestParameters = {}, initOverrides) {
13406
+ const response = await this.policyGetAllPoliciesByQueryOptionsRaw(requestParameters, initOverrides);
13407
+ return await response.value();
13408
+ }
13409
+ async policyGetAllRulesForProductRaw(requestParameters, initOverrides) {
13410
+ if (requestParameters["licenseType"] == null) {
13411
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetAllRulesForProduct().');
13412
+ }
13413
+ if (requestParameters["productName"] == null) {
13414
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyGetAllRulesForProduct().');
13415
+ }
13416
+ if (requestParameters["tenantIdentifier"] == null) {
13417
+ throw new RequiredError("tenantIdentifier", 'Required parameter "tenantIdentifier" was null or undefined when calling policyGetAllRulesForProduct().');
13418
+ }
13419
+ const queryParameters = {};
13420
+ const headerParameters = {};
13421
+ if (this.configuration && this.configuration.apiKey) {
13422
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13423
+ }
13424
+ let urlPath = `/api/Policy/all/license/{licenseType}/product/{productName}/tenant/{tenantIdentifier}`;
13425
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
13426
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
13427
+ urlPath = urlPath.replace(`{${"tenantIdentifier"}}`, encodeURIComponent(String(requestParameters["tenantIdentifier"])));
13428
+ const response = await this.request({
13429
+ path: urlPath,
13430
+ method: "GET",
13431
+ headers: headerParameters,
13432
+ query: queryParameters
13433
+ }, initOverrides);
13434
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyExportResponseFromJSON));
13435
+ }
13436
+ async policyGetAllRulesForProduct(requestParameters, initOverrides) {
13437
+ const response = await this.policyGetAllRulesForProductRaw(requestParameters, initOverrides);
13438
+ return await response.value();
13439
+ }
13440
+ async policyGetDeployedPolicyRaw(requestParameters, initOverrides) {
13441
+ const queryParameters = {};
13442
+ const headerParameters = {};
13443
+ headerParameters["Content-Type"] = "application/json";
13444
+ if (requestParameters["xUiPathClientVersion"] != null) {
13445
+ headerParameters["x-UiPath-ClientVersion"] = String(requestParameters["xUiPathClientVersion"]);
13446
+ }
13447
+ if (this.configuration && this.configuration.apiKey) {
13448
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13449
+ }
13450
+ let urlPath = `/api/Policy/deployed-policy`;
13451
+ const response = await this.request({
13452
+ path: urlPath,
13453
+ method: "POST",
13454
+ headers: headerParameters,
13455
+ query: queryParameters,
13456
+ body: DeployedPolicyDtoToJSON(requestParameters["deployedPolicyDto"])
13457
+ }, initOverrides);
13458
+ return new VoidApiResponse(response);
13459
+ }
13460
+ async policyGetDeployedPolicy(requestParameters = {}, initOverrides) {
13461
+ await this.policyGetDeployedPolicyRaw(requestParameters, initOverrides);
13462
+ }
13463
+ async policyGetDeployedTenantPoliciesRaw(requestParameters, initOverrides) {
13464
+ const queryParameters = {};
13465
+ const headerParameters = {};
13466
+ headerParameters["Content-Type"] = "application/json";
13467
+ if (requestParameters["xUiPathClientVersion"] != null) {
13468
+ headerParameters["x-UiPath-ClientVersion"] = String(requestParameters["xUiPathClientVersion"]);
13469
+ }
13470
+ if (this.configuration && this.configuration.apiKey) {
13471
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13472
+ }
13473
+ let urlPath = `/api/Policy/deployed-policy/tenant`;
13474
+ const response = await this.request({
13475
+ path: urlPath,
13476
+ method: "POST",
13477
+ headers: headerParameters,
13478
+ query: queryParameters,
13479
+ body: DeployedPolicyWithoutUserDtoToJSON(requestParameters["deployedPolicyWithoutUserDto"])
13480
+ }, initOverrides);
13481
+ return new VoidApiResponse(response);
13482
+ }
13483
+ async policyGetDeployedTenantPolicies(requestParameters = {}, initOverrides) {
13484
+ await this.policyGetDeployedTenantPoliciesRaw(requestParameters, initOverrides);
13485
+ }
13486
+ async policyGetFederatedPoliciesByQueryOptionsRaw(requestParameters, initOverrides) {
13487
+ const queryParameters = {};
13488
+ if (requestParameters["productLabel"] != null) {
13489
+ queryParameters["productLabel"] = requestParameters["productLabel"];
13490
+ }
13491
+ if (requestParameters["productName"] != null) {
13492
+ queryParameters["productName"] = requestParameters["productName"];
13493
+ }
13494
+ if (requestParameters["productNames"] != null) {
13495
+ queryParameters["productNames"] = requestParameters["productNames"];
13496
+ }
13497
+ if (requestParameters["sortBy"] != null) {
13498
+ queryParameters["sortBy"] = requestParameters["sortBy"];
13499
+ }
13500
+ if (requestParameters["sortOrder"] != null) {
13501
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
13502
+ }
13503
+ if (requestParameters["pageIndex"] != null) {
13504
+ queryParameters["pageIndex"] = requestParameters["pageIndex"];
13505
+ }
13506
+ if (requestParameters["pageSize"] != null) {
13507
+ queryParameters["pageSize"] = requestParameters["pageSize"];
13508
+ }
13509
+ if (requestParameters["searchTerm"] != null) {
13510
+ queryParameters["searchTerm"] = requestParameters["searchTerm"];
13511
+ }
13512
+ const headerParameters = {};
13513
+ if (this.configuration && this.configuration.apiKey) {
13514
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13515
+ }
13516
+ let urlPath = `/api/Policy/federated/paged`;
13517
+ const response = await this.request({
13518
+ path: urlPath,
13519
+ method: "GET",
13520
+ headers: headerParameters,
13521
+ query: queryParameters
13522
+ }, initOverrides);
13523
+ return new JSONApiResponse(response, (jsonValue) => FederatedPolicyDtoPagedResultFromJSON(jsonValue));
13524
+ }
13525
+ async policyGetFederatedPoliciesByQueryOptions(requestParameters = {}, initOverrides) {
13526
+ const response = await this.policyGetFederatedPoliciesByQueryOptionsRaw(requestParameters, initOverrides);
13527
+ return await response.value();
13528
+ }
13529
+ async policyGetFormDataByPolicyIdRaw(requestParameters, initOverrides) {
13530
+ if (requestParameters["policyIdentifier"] == null) {
13531
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetFormDataByPolicyId().');
13532
+ }
13533
+ const queryParameters = {};
13534
+ const headerParameters = {};
13535
+ if (this.configuration && this.configuration.apiKey) {
13536
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13537
+ }
13538
+ let urlPath = `/api/Policy/form-data/{policyIdentifier}`;
13539
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13540
+ const response = await this.request({
13541
+ path: urlPath,
13542
+ method: "GET",
13543
+ headers: headerParameters,
13544
+ query: queryParameters
13545
+ }, initOverrides);
13546
+ if (this.isJsonMime(response.headers.get("content-type"))) {
13547
+ return new JSONApiResponse(response);
13548
+ } else {
13549
+ return new TextApiResponse(response);
13550
+ }
13551
+ }
13552
+ async policyGetFormDataByPolicyId(requestParameters, initOverrides) {
13553
+ const response = await this.policyGetFormDataByPolicyIdRaw(requestParameters, initOverrides);
13554
+ return await response.value();
13555
+ }
13556
+ async policyGetGlobalPolicyByLicenseTypeAndProductNameRaw(requestParameters, initOverrides) {
13557
+ if (requestParameters["licenseType"] == null) {
13558
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetGlobalPolicyByLicenseTypeAndProductName().');
13559
+ }
13560
+ if (requestParameters["productIdentifier"] == null) {
13561
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetGlobalPolicyByLicenseTypeAndProductName().');
13562
+ }
13563
+ const queryParameters = {};
13564
+ const headerParameters = {};
13565
+ if (this.configuration && this.configuration.apiKey) {
13566
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13567
+ }
13568
+ let urlPath = `/api/Policy/global/license/{licenseType}/product/{productIdentifier}`;
13569
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
13570
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
13571
+ const response = await this.request({
13572
+ path: urlPath,
13573
+ method: "GET",
13574
+ headers: headerParameters,
13575
+ query: queryParameters
13576
+ }, initOverrides);
13577
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
13578
+ }
13579
+ async policyGetGlobalPolicyByLicenseTypeAndProductName(requestParameters, initOverrides) {
13580
+ const response = await this.policyGetGlobalPolicyByLicenseTypeAndProductNameRaw(requestParameters, initOverrides);
13581
+ return await response.value();
13582
+ }
13583
+ async policyGetGroupPoliciesForAllProductsRaw(requestParameters, initOverrides) {
13584
+ if (requestParameters["identifier"] == null) {
13585
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetGroupPoliciesForAllProducts().');
13586
+ }
13587
+ const queryParameters = {};
13588
+ const headerParameters = {};
13589
+ if (this.configuration && this.configuration.apiKey) {
13590
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13591
+ }
13592
+ let urlPath = `/api/Policy/group/{identifier}`;
13593
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
13594
+ const response = await this.request({
13595
+ path: urlPath,
13596
+ method: "GET",
13597
+ headers: headerParameters,
13598
+ query: queryParameters
13599
+ }, initOverrides);
13600
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(GroupPolicyDtoFromJSON));
13601
+ }
13602
+ async policyGetGroupPoliciesForAllProducts(requestParameters, initOverrides) {
13603
+ const response = await this.policyGetGroupPoliciesForAllProductsRaw(requestParameters, initOverrides);
13604
+ return await response.value();
13605
+ }
13606
+ async policyGetPoliciesByProductIdentifiersRaw(requestParameters, initOverrides) {
13607
+ const queryParameters = {};
13608
+ if (requestParameters["ids"] != null) {
13609
+ queryParameters["ids"] = requestParameters["ids"];
13610
+ }
13611
+ const headerParameters = {};
13612
+ if (this.configuration && this.configuration.apiKey) {
13613
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13614
+ }
13615
+ let urlPath = `/api/Policy/filter/products`;
13616
+ const response = await this.request({
13617
+ path: urlPath,
13618
+ method: "GET",
13619
+ headers: headerParameters,
13620
+ query: queryParameters
13621
+ }, initOverrides);
13622
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyInfoDtoFromJSON));
13623
+ }
13624
+ async policyGetPoliciesByProductIdentifiers(requestParameters = {}, initOverrides) {
13625
+ const response = await this.policyGetPoliciesByProductIdentifiersRaw(requestParameters, initOverrides);
13626
+ return await response.value();
13627
+ }
13628
+ async policyGetPolicyByIdRaw(requestParameters, initOverrides) {
13629
+ if (requestParameters["policyIdentifier"] == null) {
13630
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyById().');
13631
+ }
13632
+ const queryParameters = {};
13633
+ const headerParameters = {};
13634
+ if (this.configuration && this.configuration.apiKey) {
13635
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13636
+ }
13637
+ let urlPath = `/api/Policy/id/{policyIdentifier}`;
13638
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13639
+ const response = await this.request({
13640
+ path: urlPath,
13641
+ method: "GET",
13642
+ headers: headerParameters,
13643
+ query: queryParameters
13644
+ }, initOverrides);
13645
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13646
+ }
13647
+ async policyGetPolicyById(requestParameters, initOverrides) {
13648
+ const response = await this.policyGetPolicyByIdRaw(requestParameters, initOverrides);
13649
+ return await response.value();
13650
+ }
13651
+ async policyGetPolicyByNameAndProductIdentifierRaw(requestParameters, initOverrides) {
13652
+ if (requestParameters["policyName"] == null) {
13653
+ throw new RequiredError("policyName", 'Required parameter "policyName" was null or undefined when calling policyGetPolicyByNameAndProductIdentifier().');
13654
+ }
13655
+ if (requestParameters["productIdentifier"] == null) {
13656
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetPolicyByNameAndProductIdentifier().');
13657
+ }
13658
+ const queryParameters = {};
13659
+ const headerParameters = {};
13660
+ if (this.configuration && this.configuration.apiKey) {
13661
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13662
+ }
13663
+ let urlPath = `/api/Policy/{policyName}/product/{productIdentifier}`;
13664
+ urlPath = urlPath.replace(`{${"policyName"}}`, encodeURIComponent(String(requestParameters["policyName"])));
13665
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
13666
+ const response = await this.request({
13667
+ path: urlPath,
13668
+ method: "GET",
13669
+ headers: headerParameters,
13670
+ query: queryParameters
13671
+ }, initOverrides);
13672
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
13673
+ }
13674
+ async policyGetPolicyByNameAndProductIdentifier(requestParameters, initOverrides) {
13675
+ const response = await this.policyGetPolicyByNameAndProductIdentifierRaw(requestParameters, initOverrides);
13676
+ return await response.value();
13677
+ }
13678
+ async policyGetPolicyDataByIdentifierRaw(requestParameters, initOverrides) {
13679
+ if (requestParameters["policyIdentifier"] == null) {
13680
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyDataByIdentifier().');
13681
+ }
13682
+ const queryParameters = {};
13683
+ const headerParameters = {};
13684
+ if (this.configuration && this.configuration.apiKey) {
13685
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13686
+ }
13687
+ let urlPath = `/api/Policy/data/{policyIdentifier}`;
13688
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13689
+ const response = await this.request({
13690
+ path: urlPath,
13691
+ method: "GET",
13692
+ headers: headerParameters,
13693
+ query: queryParameters
13694
+ }, initOverrides);
13695
+ return new JSONApiResponse(response, (jsonValue) => ImportPolicyRequestFromJSON(jsonValue));
13696
+ }
13697
+ async policyGetPolicyDataByIdentifier(requestParameters, initOverrides) {
13698
+ const response = await this.policyGetPolicyDataByIdentifierRaw(requestParameters, initOverrides);
13699
+ return await response.value();
13700
+ }
13701
+ async policyGetPolicyUsageDataRaw(requestParameters, initOverrides) {
13702
+ if (requestParameters["policyIdentifier"] == null) {
13703
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyUsageData().');
13704
+ }
13705
+ const queryParameters = {};
13706
+ const headerParameters = {};
13707
+ if (this.configuration && this.configuration.apiKey) {
13708
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13709
+ }
13710
+ let urlPath = `/api/Policy/usage/{policyIdentifier}`;
13711
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
13712
+ const response = await this.request({
13713
+ path: urlPath,
13714
+ method: "GET",
13715
+ headers: headerParameters,
13716
+ query: queryParameters
13717
+ }, initOverrides);
13718
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
13719
+ }
13720
+ async policyGetPolicyUsageData(requestParameters, initOverrides) {
13721
+ const response = await this.policyGetPolicyUsageDataRaw(requestParameters, initOverrides);
13722
+ return await response.value();
13723
+ }
13724
+ async policyGetRulesForProductRaw(requestParameters, initOverrides) {
13725
+ if (requestParameters["licenseType"] == null) {
13726
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetRulesForProduct().');
13727
+ }
13728
+ if (requestParameters["productName"] == null) {
13729
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyGetRulesForProduct().');
13730
+ }
13731
+ if (requestParameters["tenantIdentifier"] == null) {
13732
+ throw new RequiredError("tenantIdentifier", 'Required parameter "tenantIdentifier" was null or undefined when calling policyGetRulesForProduct().');
13733
+ }
13734
+ const queryParameters = {};
13735
+ const headerParameters = {};
13736
+ if (this.configuration && this.configuration.apiKey) {
13737
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13738
+ }
13739
+ let urlPath = `/api/Policy/license/{licenseType}/product/{productName}/tenant/{tenantIdentifier}`;
13740
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
13741
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
13742
+ urlPath = urlPath.replace(`{${"tenantIdentifier"}}`, encodeURIComponent(String(requestParameters["tenantIdentifier"])));
13743
+ const response = await this.request({
13744
+ path: urlPath,
13745
+ method: "GET",
13746
+ headers: headerParameters,
13747
+ query: queryParameters
13748
+ }, initOverrides);
13749
+ return new VoidApiResponse(response);
13750
+ }
13751
+ async policyGetRulesForProduct(requestParameters, initOverrides) {
13752
+ await this.policyGetRulesForProductRaw(requestParameters, initOverrides);
13753
+ }
13754
+ async policyGetUserInheritanceGroupPoliciesForAllProductsRaw(requestParameters, initOverrides) {
13755
+ if (requestParameters["identifier"] == null) {
13756
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserInheritanceGroupPoliciesForAllProducts().');
13757
+ }
13758
+ const queryParameters = {};
13759
+ const headerParameters = {};
13760
+ if (this.configuration && this.configuration.apiKey) {
13761
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13762
+ }
13763
+ let urlPath = `/api/Policy/user/group/{identifier}`;
13764
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
13765
+ const response = await this.request({
13766
+ path: urlPath,
13767
+ method: "GET",
13768
+ headers: headerParameters,
13769
+ query: queryParameters
13770
+ }, initOverrides);
13771
+ return new VoidApiResponse(response);
13772
+ }
13773
+ async policyGetUserInheritanceGroupPoliciesForAllProducts(requestParameters, initOverrides) {
13774
+ await this.policyGetUserInheritanceGroupPoliciesForAllProductsRaw(requestParameters, initOverrides);
13775
+ }
13776
+ async policyGetUserPoliciesForAllProductsRaw(requestParameters, initOverrides) {
13777
+ if (requestParameters["identifier"] == null) {
13778
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserPoliciesForAllProducts().');
13779
+ }
13780
+ const queryParameters = {};
13781
+ const headerParameters = {};
13782
+ if (this.configuration && this.configuration.apiKey) {
13783
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13784
+ }
13785
+ let urlPath = `/api/Policy/user/{identifier}`;
13786
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
13787
+ const response = await this.request({
13788
+ path: urlPath,
13789
+ method: "GET",
13790
+ headers: headerParameters,
13791
+ query: queryParameters
13792
+ }, initOverrides);
13793
+ return new VoidApiResponse(response);
13794
+ }
13795
+ async policyGetUserPoliciesForAllProducts(requestParameters, initOverrides) {
13796
+ await this.policyGetUserPoliciesForAllProductsRaw(requestParameters, initOverrides);
13797
+ }
13798
+ async policyGetUserPoliciesForAllProductsAndAllGroupsRaw(requestParameters, initOverrides) {
13799
+ if (requestParameters["identifier"] == null) {
13800
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserPoliciesForAllProductsAndAllGroups().');
13801
+ }
13802
+ const queryParameters = {};
13803
+ const headerParameters = {};
13804
+ if (this.configuration && this.configuration.apiKey) {
13805
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13806
+ }
13807
+ let urlPath = `/api/Policy/user/{identifier}/all`;
13808
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
13809
+ const response = await this.request({
13810
+ path: urlPath,
13811
+ method: "GET",
13812
+ headers: headerParameters,
13813
+ query: queryParameters
13814
+ }, initOverrides);
13815
+ return new VoidApiResponse(response);
13816
+ }
13817
+ async policyGetUserPoliciesForAllProductsAndAllGroups(requestParameters, initOverrides) {
13818
+ await this.policyGetUserPoliciesForAllProductsAndAllGroupsRaw(requestParameters, initOverrides);
13819
+ }
13820
+ async policyUpdateGlobalPolicyRaw(requestParameters, initOverrides) {
13821
+ const queryParameters = {};
13822
+ const headerParameters = {};
13823
+ headerParameters["Content-Type"] = "application/json";
13824
+ if (this.configuration && this.configuration.apiKey) {
13825
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13826
+ }
13827
+ let urlPath = `/api/Policy/global`;
13828
+ const response = await this.request({
13829
+ path: urlPath,
13830
+ method: "PUT",
13831
+ headers: headerParameters,
13832
+ query: queryParameters,
13833
+ body: CreateGlobalPolicyWithFormDataRequestToJSON(requestParameters["createGlobalPolicyWithFormDataRequest"])
13834
+ }, initOverrides);
13835
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
13836
+ }
13837
+ async policyUpdateGlobalPolicy(requestParameters = {}, initOverrides) {
13838
+ const response = await this.policyUpdateGlobalPolicyRaw(requestParameters, initOverrides);
13839
+ return await response.value();
13840
+ }
13841
+ async policyUpdatePolicyRaw(requestParameters, initOverrides) {
13842
+ const queryParameters = {};
13843
+ const headerParameters = {};
13844
+ headerParameters["Content-Type"] = "application/json";
13845
+ if (this.configuration && this.configuration.apiKey) {
13846
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13847
+ }
13848
+ let urlPath = `/api/Policy`;
13849
+ const response = await this.request({
13850
+ path: urlPath,
13851
+ method: "PUT",
13852
+ headers: headerParameters,
13853
+ query: queryParameters,
13854
+ body: CreatePolicyWithFormDataRequestToJSON(requestParameters["createPolicyWithFormDataRequest"])
13855
+ }, initOverrides);
13856
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13857
+ }
13858
+ async policyUpdatePolicy(requestParameters = {}, initOverrides) {
13859
+ const response = await this.policyUpdatePolicyRaw(requestParameters, initOverrides);
13860
+ return await response.value();
13861
+ }
13862
+ async policyUpdatePolicyV2Raw(requestParameters, initOverrides) {
13863
+ const queryParameters = {};
13864
+ const headerParameters = {};
13865
+ headerParameters["Content-Type"] = "application/json";
13866
+ if (this.configuration && this.configuration.apiKey) {
13867
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13868
+ }
13869
+ let urlPath = `/api/Policy/v2/update`;
13870
+ const response = await this.request({
13871
+ path: urlPath,
13872
+ method: "PUT",
13873
+ headers: headerParameters,
13874
+ query: queryParameters,
13875
+ body: UpdatePolicyRequestToJSON(requestParameters["updatePolicyRequest"])
13876
+ }, initOverrides);
13877
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13878
+ }
13879
+ async policyUpdatePolicyV2(requestParameters = {}, initOverrides) {
13880
+ const response = await this.policyUpdatePolicyV2Raw(requestParameters, initOverrides);
13881
+ return await response.value();
13882
+ }
13883
+ async policyUploadCheckPolicyRaw(requestParameters, initOverrides) {
13884
+ const queryParameters = {};
13885
+ const headerParameters = {};
13886
+ if (this.configuration && this.configuration.apiKey) {
13887
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13888
+ }
13889
+ const consumes = [
13890
+ { contentType: "multipart/form-data" }
13891
+ ];
13892
+ const canConsumeForm2 = canConsumeForm(consumes);
13893
+ let formParams;
13894
+ let useForm = false;
13895
+ useForm = canConsumeForm2;
13896
+ if (useForm) {
13897
+ formParams = new FormData;
13898
+ } else {
13899
+ formParams = new URLSearchParams;
13900
+ }
13901
+ if (requestParameters["file"] != null) {
13902
+ formParams.append("file", requestParameters["file"]);
13903
+ }
13904
+ let urlPath = `/api/Policy/upload/check`;
13905
+ const response = await this.request({
13906
+ path: urlPath,
13907
+ method: "POST",
13908
+ headers: headerParameters,
13909
+ query: queryParameters,
13910
+ body: formParams
13911
+ }, initOverrides);
13912
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
13913
+ }
13914
+ async policyUploadCheckPolicy(requestParameters = {}, initOverrides) {
13915
+ const response = await this.policyUploadCheckPolicyRaw(requestParameters, initOverrides);
13916
+ return await response.value();
13917
+ }
13918
+ }
13919
+ var DEFAULT_TIMEOUT_MS = 1e4;
13920
+ var CLIENT_VERSION_HEADER = "ClientVersion";
13921
+ var JSON_MIME = /^application\/(json|[^;\s]+\+json)\s*(;.*)?$/i;
13922
+ async function resolvePolicyAsync(options) {
13923
+ const subject = options.subject;
13924
+ requireValue("subject", subject);
13925
+ requireText("subject.organizationId", subject.organizationId);
13926
+ requireText("subject.tenantId", subject.tenantId);
13927
+ requireText("subject.product", subject.product);
13928
+ requireText("subject.licenseType", subject.licenseType);
13929
+ requireText("baseUrl", options.baseUrl);
13930
+ requireText("clientVersion", options.clientVersion);
13931
+ const fetchApi = options.fetch ?? globalThis.fetch;
13932
+ if (typeof fetchApi !== "function") {
13933
+ throw new RequiredError("fetch", "No fetch implementation available. Pass options.fetch.");
13934
+ }
13935
+ const now = options.now ?? (() => new Date);
13936
+ const basePath = `${options.baseUrl.replace(/\/+$/, "")}/${encodeURIComponent(subject.organizationId)}/roboticsops_`;
13937
+ let requestUrl = basePath;
13938
+ const api = new PolicyApi(new Configuration({
13939
+ basePath,
13940
+ fetchApi,
13941
+ apiKey: async () => `Bearer ${await readToken(options.accessToken)}`,
13942
+ headers: {
13943
+ AccountId: subject.organizationId,
13944
+ [CLIENT_VERSION_HEADER]: options.clientVersion
13945
+ },
13946
+ middleware: [
13947
+ {
13948
+ pre: async (context) => {
13949
+ requestUrl = context.url;
13950
+ }
13951
+ }
13952
+ ]
13953
+ }));
13954
+ if (options.signal?.aborted) {
13955
+ return unknown(subject, buildAudit(requestUrl, now), "cancelled", "The request was cancelled before it was sent.");
13956
+ }
13957
+ const controller = new AbortController;
13958
+ let timedOut = false;
13959
+ const timer = setTimeout(() => {
13960
+ timedOut = true;
13961
+ controller.abort();
13962
+ }, options.timeoutMs ?? DEFAULT_TIMEOUT_MS);
13963
+ const relayAbort = () => controller.abort();
13964
+ options.signal?.addEventListener("abort", relayAbort, { once: true });
13965
+ let seenResponse;
13966
+ try {
13967
+ const response = await api.policyGetRulesForProductRaw({
13968
+ licenseType: subject.licenseType,
13969
+ productName: subject.product,
13970
+ tenantIdentifier: subject.tenantId
13971
+ }, { signal: controller.signal });
13972
+ seenResponse = response.raw;
13973
+ return await classifySuccess(response.raw, subject, requestUrl, now);
13974
+ } catch (error) {
13975
+ return classifyFailure(error, subject, requestUrl, now, timedOut, options.signal, seenResponse);
13976
+ } finally {
13977
+ clearTimeout(timer);
13978
+ options.signal?.removeEventListener("abort", relayAbort);
13979
+ }
13980
+ }
13981
+ async function classifySuccess(response, subject, url, now) {
13982
+ const audit = buildAudit(url, now, response);
13983
+ if (response.status === 204) {
13984
+ return { outcome: "ungoverned", subject, audit };
13985
+ }
13986
+ if (response.status !== 200) {
13987
+ return unknown(subject, audit, "serverError", `The policy service answered ${response.status}; only 200 carries a policy and only 204 means none is published.`);
13988
+ }
13989
+ const contentType = response.headers.get("content-type");
13990
+ if (!JSON_MIME.test(contentType ?? "")) {
13991
+ return unknown(subject, audit, "notJson", `Expected a JSON policy document, got content-type ${contentType ?? "(none)"}.`);
13992
+ }
13993
+ const body = await response.text();
13994
+ if (!isJsonObject(body)) {
13995
+ return unknown(subject, audit, "notJson", body.trim() === "" ? "The response body was empty." : "The response body is not a JSON object.");
13996
+ }
13997
+ return { outcome: "governed", subject, audit, document: body };
13998
+ }
13999
+ function classifyFailure(error, subject, url, now, timedOut, signal, seenResponse) {
14000
+ if (error instanceof ResponseError) {
14001
+ return unknown(subject, buildAudit(url, now, error.response), reasonForStatus(error.response.status), `The policy service answered ${error.response.status}.`);
14002
+ }
14003
+ const audit = buildAudit(url, now, seenResponse);
14004
+ if (timedOut) {
14005
+ return unknown(subject, audit, "timedOut", "The policy service did not answer within the timeout.");
14006
+ }
14007
+ if (signal?.aborted || isAbortError(error)) {
14008
+ return unknown(subject, audit, "cancelled", "The request was cancelled.");
14009
+ }
14010
+ return unknown(subject, audit, "transport", `The request to the policy service failed: ${describe(unwrap(error))}`);
14011
+ }
14012
+ function unwrap(error) {
14013
+ return error instanceof FetchError ? error.cause : error;
14014
+ }
14015
+ function reasonForStatus(status) {
14016
+ if (status === 401 || status === 403) {
14017
+ return "unauthorized";
14018
+ }
14019
+ if (status === 404) {
14020
+ return "notFound";
14021
+ }
14022
+ return "serverError";
14023
+ }
14024
+ function buildAudit(url, now, response) {
14025
+ const audit = { url, resolvedAt: now().toISOString() };
14026
+ if (response) {
14027
+ audit.httpStatus = response.status;
14028
+ const retryAfter = parseRetryAfter(response.headers.get("retry-after"), now);
14029
+ if (retryAfter !== undefined) {
14030
+ audit.retryAfterSeconds = retryAfter;
14031
+ }
14032
+ }
14033
+ return audit;
14034
+ }
14035
+ function parseRetryAfter(header, now) {
14036
+ if (header === null || header.trim() === "") {
14037
+ return;
14038
+ }
14039
+ const seconds = Number(header.trim());
14040
+ if (Number.isInteger(seconds) && seconds >= 0) {
14041
+ return seconds;
14042
+ }
14043
+ const at = Date.parse(header);
14044
+ if (Number.isNaN(at)) {
14045
+ return;
14046
+ }
14047
+ return Math.max(0, Math.round((at - now().getTime()) / 1000));
14048
+ }
14049
+ function isJsonObject(body) {
14050
+ if (body.trim() === "") {
14051
+ return false;
14052
+ }
14053
+ let parsed;
14054
+ try {
14055
+ parsed = JSON.parse(body);
14056
+ } catch {
14057
+ return false;
14058
+ }
14059
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed);
14060
+ }
14061
+ function unknown(subject, audit, reason, detail) {
14062
+ return { outcome: "unknown", subject, audit, reason, detail };
14063
+ }
14064
+ async function readToken(accessToken) {
14065
+ return typeof accessToken === "function" ? await accessToken() : accessToken;
14066
+ }
14067
+ function isAbortError(error) {
14068
+ const candidate = error instanceof Error && "cause" in error && error.cause instanceof Error ? error.cause : error;
14069
+ return candidate instanceof Error && candidate.name === "AbortError";
14070
+ }
14071
+ function describe(error) {
14072
+ return error instanceof Error ? error.message : String(error);
14073
+ }
14074
+ function requireValue(field, value) {
14075
+ if (value === undefined || value === null) {
14076
+ throw new RequiredError(field, `Required option "${field}" is missing.`);
14077
+ }
14078
+ }
14079
+ function requireText(field, value) {
14080
+ requireValue(field, value);
14081
+ if (typeof value !== "string" || value.trim() === "") {
14082
+ throw new RequiredError(field, `Required option "${field}" must be a non-empty string.`);
14083
+ }
14084
+ }
14085
+
14086
+ // src/services/governance-policy-service.ts
14087
+ import {
14088
+ Path,
14089
+ translate as translate3
14090
+ } from "@uipath/solutionpackager-tool-core";
14091
+ // package.json
14092
+ var package_default = {
14093
+ name: "@uipath/project-packager",
14094
+ author: "UiPath",
14095
+ license: "SEE LICENSE IN LICENSE.txt",
14096
+ version: "1.203.0-preview.160",
14097
+ description: "UiPath Project Packager - core library for packing individual UiPath projects",
14098
+ type: "module",
14099
+ main: "./dist/index.js",
14100
+ exports: {
14101
+ ".": {
14102
+ types: "./dist/src/index.d.ts",
14103
+ default: "./dist/index.js"
14104
+ },
14105
+ "./node": {
14106
+ types: "./dist/src/node.d.ts",
14107
+ default: "./dist/node.js"
14108
+ },
14109
+ "./browser": {
14110
+ types: "./dist/src/browser.d.ts",
14111
+ default: "./dist/browser.js"
14112
+ }
14113
+ },
14114
+ types: "./dist/src/index.d.ts",
14115
+ repository: {
14116
+ type: "git",
14117
+ url: "https://github.com/UiPath/cli.git",
14118
+ directory: "packages/packager/project-packager"
14119
+ },
14120
+ publishConfig: {
14121
+ registry: "https://npm.pkg.github.com/"
14122
+ },
14123
+ files: [
14124
+ "dist"
14125
+ ],
14126
+ scripts: {
14127
+ build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/browser.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/node.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && tsc --emitDeclarationOnly --outDir dist",
14128
+ clean: "rimraf dist",
14129
+ test: "vitest run",
14130
+ e2e: "vitest run --config vitest.e2e.config.ts",
14131
+ "test:coverage": "vitest run --coverage",
14132
+ prepack: "bun run build",
14133
+ "publish:dry": "bun publish --dry-run",
14134
+ "publish:gh": "bun publish",
14135
+ "version:patch": "bun version patch --no-git-tag-version",
14136
+ "version:minor": "bun version minor --no-git-tag-version",
14137
+ "version:major": "bun version major --no-git-tag-version",
14138
+ lint: "biome check ."
14139
+ },
14140
+ dependencies: {
14141
+ "@uipath/aops-policy-sdk": "workspace:*",
14142
+ "@uipath/filesystem": "workspace:*",
14143
+ "@uipath/solutionpackager-tool-core": "workspace:*",
14144
+ "@uipath/common": "workspace:*"
14145
+ },
14146
+ peerDependencies: {
14147
+ fflate: "^0.8.2"
14148
+ },
14149
+ devDependencies: {
14150
+ "@types/node": "^25.5.2",
14151
+ "@uipath/resource-builder-tool": "2025.11.0-alpha4535-3530",
14152
+ "@uipath/tool-agent": "^2.0.0",
14153
+ "@uipath/packager-tool-apiworkflow": "workspace:*",
14154
+ "@uipath/packager-tool-connector": "workspace:*",
14155
+ "@uipath/packager-tool-flow": "workspace:*",
14156
+ "@uipath/packager-tool-functions": "workspace:*",
14157
+ "@uipath/packager-tool-webapp": "workspace:*",
14158
+ "@uipath/packager-tool-workflowcompiler": "workspace:*",
14159
+ "@vitest/coverage-v8": "^4.1.11",
14160
+ jsdom: "^30.0.1",
14161
+ typescript: "^7.0.2",
14162
+ "vite-tsconfig-paths": "^6.1.1",
14163
+ vitest: "^4.1.11"
14164
+ }
14165
+ };
14166
+
14167
+ // src/services/governance-policy-service.ts
14168
+ class GovernancePolicyError extends Error {
14169
+ instructions;
14170
+ name = "GovernancePolicyError";
14171
+ constructor(message, instructions) {
14172
+ super(message);
14173
+ this.instructions = instructions;
14174
+ }
14175
+ }
14176
+ var LICENSE_TYPES = {
14177
+ NoLicense: "NoLicense",
14178
+ Development: "Development",
14179
+ Attended: "Attended",
14180
+ Unattended: "Unattended",
14181
+ StudioX: "StudioX",
14182
+ StudioPro: "StudioPro",
14183
+ AutomationKit: "AutomationKit"
14184
+ };
14185
+ var STUDIOWEB_PRODUCT = "StudioWeb";
14186
+ var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
14187
+ var GOVERNANCE_SUBFOLDER = "governance";
14188
+ var GOVERNANCE_FILE_NAME = "governance-policy.json";
14189
+ var errorMessage = (error) => error instanceof Error ? error.message : String(error);
14190
+ var t = (key, params) => translate3.t(`solutionpackager.governance.${key}`, params);
14191
+
14192
+ class GovernancePolicyService {
14193
+ fileSystem;
14194
+ temporaryStorage;
14195
+ fetchFn;
14196
+ logger = new ToolLogger("GovernancePolicyService", "ResolvePolicy");
14197
+ constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
14198
+ this.fileSystem = fileSystem;
14199
+ this.temporaryStorage = temporaryStorage;
14200
+ this.fetchFn = fetchFn;
14201
+ }
14202
+ async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken, usage = "pack") {
14203
+ if (validateOptions.governanceFileType === "Default" /* Default */) {
14204
+ return;
14205
+ }
14206
+ const suppliedFilePath = validateOptions.governanceFilePath;
14207
+ if (suppliedFilePath && validateOptions.governanceFileType === "AutomationOps" /* AutomationOps */) {
14208
+ this.logger.info(t("info.alreadyProvided"));
14209
+ return;
14210
+ }
14211
+ if (suppliedFilePath && usage === "analyze") {
14212
+ this.logger.info(t("info.alreadyProvided"));
14213
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14214
+ return;
14215
+ }
14216
+ const origin = this.resolveCloudOrigin(connectionInfo?.cloudUrl);
14217
+ const product = validateOptions.profileKey;
14218
+ if (!origin || !product || !connectionInfo?.organizationId || !connectionInfo.tenantId || !connectionInfo.accessToken) {
14219
+ if (suppliedFilePath) {
14220
+ this.logger.info(t("info.noTenantToAsk", { path: suppliedFilePath }));
14221
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14222
+ return;
14223
+ }
14224
+ this.warnAndUseShippedRules(validateOptions, t("errors.connectionIncomplete"));
14225
+ return;
14226
+ }
14227
+ const licenseType = await this.resolveLicenseTypeAsync(product, connectionInfo.cloudUrl?.replace(/\/+$/, "") ?? "", connectionInfo.accessToken, cancellationToken);
14228
+ const subject = {
14229
+ organizationId: connectionInfo.organizationId,
14230
+ tenantId: connectionInfo.tenantId,
14231
+ product,
14232
+ licenseType
14233
+ };
14234
+ this.logger.info(t("info.resolving", { product, licenseType }));
14235
+ const resolution = await resolvePolicyAsync({
14236
+ subject,
14237
+ baseUrl: origin,
14238
+ accessToken: connectionInfo.accessToken,
14239
+ clientVersion: package_default.version,
14240
+ fetch: this.fetchFn,
14241
+ signal: cancellationToken
14242
+ });
14243
+ await this.applyResolutionAsync(resolution, validateOptions, suppliedFilePath);
14244
+ }
14245
+ async applyResolutionAsync(resolution, validateOptions, suppliedFilePath) {
14246
+ switch (resolution.outcome) {
14247
+ case "governed":
14248
+ if (suppliedFilePath) {
14249
+ throw new GovernancePolicyError(t("errors.tenantPolicyWins", {
14250
+ product: resolution.subject.product,
14251
+ path: suppliedFilePath
14252
+ }), t("instructions.tenantPolicyWins"));
14253
+ }
14254
+ await this.savePolicyAsync(validateOptions, resolution.document);
14255
+ return;
14256
+ case "ungoverned":
14257
+ if (suppliedFilePath) {
14258
+ this.logger.info(t("info.suppliedFileHonoured", {
14259
+ path: suppliedFilePath
14260
+ }));
14261
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14262
+ return;
14263
+ }
14264
+ this.logger.info(t("info.ungoverned"));
14265
+ validateOptions.governanceFileType = "Default" /* Default */;
14266
+ return;
14267
+ case "unknown": {
14268
+ this.logger.warn(this.describeUnknown(resolution));
14269
+ if (suppliedFilePath) {
14270
+ this.logger.info(t("info.suppliedFileUnchecked", {
14271
+ path: suppliedFilePath
14272
+ }));
14273
+ validateOptions.governanceFileType = "Studio" /* Studio */;
14274
+ return;
14275
+ }
14276
+ validateOptions.governanceFileType = "Default" /* Default */;
14277
+ return;
14278
+ }
14279
+ }
14280
+ }
14281
+ async savePolicyAsync(validateOptions, document) {
14282
+ try {
14283
+ const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
14284
+ const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
14285
+ await this.fileSystem.writeFile(filePath, document);
14286
+ this.logger.info(t("info.saved", { path: filePath }));
14287
+ validateOptions.governanceFilePath = filePath;
14288
+ validateOptions.governanceFileType = "AutomationOps" /* AutomationOps */;
14289
+ } catch (error) {
14290
+ this.warnAndUseShippedRules(validateOptions, t("errors.failedToSave", { error: errorMessage(error) }));
14291
+ }
14292
+ }
14293
+ warnAndUseShippedRules(validateOptions, reason) {
14294
+ this.logger.warn(t("errors.fallingBackToDefault", { reason }));
14295
+ validateOptions.governanceFileType = "Default" /* Default */;
14296
+ }
14297
+ describeUnknown(resolution) {
14298
+ const reason = t("errors.unknownOutcome", {
14299
+ reason: resolution.reason,
14300
+ detail: resolution.detail,
14301
+ url: resolution.audit.url
14302
+ });
14303
+ const retryAfter = resolution.audit.retryAfterSeconds;
14304
+ return retryAfter === undefined ? reason : `${reason} ${t("errors.retryAfter", { seconds: retryAfter })}`;
14305
+ }
14306
+ resolveCloudOrigin(cloudUrl) {
14307
+ if (!cloudUrl) {
14308
+ return null;
14309
+ }
14310
+ try {
14311
+ return new URL(cloudUrl).origin;
14312
+ } catch {
14313
+ return null;
14314
+ }
14315
+ }
14316
+ async resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken) {
14317
+ const isStudioWeb = profileKey === STUDIOWEB_PRODUCT;
14318
+ const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
14319
+ try {
14320
+ const response = await this.fetchFn(`${cloudUrl}${ACQUIRE_LICENSE_PATH}`, {
14321
+ method: "POST",
14322
+ headers: { Authorization: `Bearer ${accessToken}` },
14323
+ signal: cancellationToken
14324
+ });
14325
+ if (!response.ok) {
14326
+ this.logger.info(t("info.licenseStatus", {
14327
+ status: response.status,
14328
+ fallback
14329
+ }));
14330
+ return fallback;
14331
+ }
14332
+ const { isLicensed, robotType } = await response.json();
14333
+ this.logger.info(t("info.licenseResponse", {
14334
+ isLicensed: String(isLicensed),
14335
+ robotType: String(robotType)
14336
+ }));
14337
+ if (!isLicensed || !robotType) {
14338
+ return fallback;
14339
+ }
14340
+ if (isStudioWeb) {
14341
+ return robotType === LICENSE_TYPES.AutomationKit ? LICENSE_TYPES.AutomationKit : LICENSE_TYPES.NoLicense;
14342
+ }
14343
+ return robotType;
14344
+ } catch (error) {
14345
+ this.logger.info(t("info.licenseFailed", {
14346
+ error: errorMessage(error),
14347
+ fallback
14348
+ }));
14349
+ return fallback;
14350
+ }
14351
+ }
14352
+ }
14353
+
14354
+ // src/services/nupkg-resolver.ts
14355
+ async function resolveProducedNupkgsAsync(fileSystem, packagePath) {
14356
+ if (packagePath.toLowerCase().endsWith(".nupkg")) {
14357
+ return [packagePath];
14358
+ }
14359
+ const stat2 = await fileSystem.stat(packagePath);
14360
+ if (!stat2?.isDirectory()) {
14361
+ return [];
14362
+ }
14363
+ const candidateDirs = [packagePath, fileSystem.path.dirname(packagePath)];
14364
+ for (const dir of candidateDirs) {
14365
+ const entries = await fileSystem.readdir(dir);
14366
+ const nupkgs = entries.filter((entry) => entry.toLowerCase().endsWith(".nupkg")).map((entry) => fileSystem.path.join(dir, entry));
14367
+ if (nupkgs.length > 0) {
14368
+ return nupkgs;
14369
+ }
14370
+ }
14371
+ return [];
14372
+ }
14373
+
14374
+ // src/services/pack-service.ts
14375
+ var PACKAGE_ID_TOO_LONG = "PACKAGE_ID_TOO_LONG";
14376
+ function isPackageIdTooLongError(error) {
14377
+ return error instanceof Error && error.code === PACKAGE_ID_TOO_LONG;
14378
+ }
14379
+
14380
+ class PackService {
14381
+ disallowedCharsRegex = /[^\p{L}\p{N}_.-]/gu;
14382
+ spacesDotRegex = /[\s.]+/g;
14383
+ dotDashRegex = /\.{0,10}[-:]\.{0,10}/g;
14384
+ MaxPackageIdLength = 100;
14385
+ sanitizePackageId(packageId) {
14386
+ packageId = packageId.trim();
14387
+ packageId = packageId.replace(this.spacesDotRegex, ".");
14388
+ packageId = packageId.replace(this.dotDashRegex, "-");
14389
+ packageId = packageId.replace(this.disallowedCharsRegex, "_");
14390
+ if (packageId.length > this.MaxPackageIdLength) {
14391
+ const error = new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
14392
+ error.code = PACKAGE_ID_TOO_LONG;
14393
+ error.packageId = packageId;
14394
+ error.maxLength = this.MaxPackageIdLength;
14395
+ throw error;
14396
+ }
14397
+ return packageId;
14398
+ }
14399
+ }
14400
+
14401
+ // src/services/package-signer.ts
14402
+ import { ToolErrorCodes as ToolErrorCodes2, ToolResult as ToolResult2 } from "@uipath/solutionpackager-tool-core";
14403
+ async function signNupkgsAsync(signService, nupkgPaths, signingInfo) {
14404
+ if (!signingInfo?.certificatePath) {
14405
+ return ToolResult2.success();
14406
+ }
14407
+ if (!signService) {
14408
+ return ToolResult2.error(ToolErrorCodes2.InternalError, "Package signing is required but signing service is not available. Package signing requires dotnet CLI to be installed in Node.js environment.");
14409
+ }
14410
+ const certificatePath = signingInfo.certificatePath;
14411
+ const toSign = [...new Set(nupkgPaths)];
14412
+ if (toSign.length === 0) {
14413
+ return ToolResult2.success();
14414
+ }
14415
+ if (signService.signPackagesAsync) {
14416
+ return signService.signPackagesAsync(toSign, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
14417
+ }
14418
+ for (const packagePath of toSign) {
14419
+ const signResult = await signService.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
14420
+ if (!signResult.isSuccess) {
14421
+ return signResult;
14422
+ }
12384
14423
  }
12385
14424
  return ToolResult2.success();
12386
14425
  }
@@ -12797,7 +14836,7 @@ class ProjectPackager {
12797
14836
  }, cancellationToken);
12798
14837
  }
12799
14838
  async validateProjectAsync(options, cancellationToken) {
12800
- await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
14839
+ await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken, "analyze");
12801
14840
  const validationResult = await this.validateOptionsValidator.validateAsync(options, cancellationToken);
12802
14841
  if (!validationResult.isSuccess) {
12803
14842
  return validationResult;
@@ -12821,7 +14860,10 @@ class ProjectPackager {
12821
14860
  }, cancellationToken);
12822
14861
  }
12823
14862
  async buildProjectAsync(options, cancellationToken) {
12824
- await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
14863
+ const [governanceError] = await catchError(this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken));
14864
+ if (governanceError) {
14865
+ return ToolResult5.error(ToolErrorCodes5.InternalError, `Project build failed: ${governanceError.message}`, carriedInstructions(governanceError));
14866
+ }
12825
14867
  const validationResult = await this.buildOptionsValidator.validateAsync(options, cancellationToken);
12826
14868
  if (!validationResult.isSuccess) {
12827
14869
  return validationResult;
@@ -12888,7 +14930,7 @@ class ProjectPackager {
12888
14930
  } catch (error) {
12889
14931
  const errorMessage2 = error instanceof Error ? error.message : String(error);
12890
14932
  this.logger.error(`Processing error: ${errorMessage2}`);
12891
- return ToolResult5.error(ToolErrorCodes5.InternalError, `Project pack failed: ${errorMessage2}`);
14933
+ return ToolResult5.error(ToolErrorCodes5.InternalError, `Project pack failed: ${errorMessage2}`, carriedInstructions(error));
12892
14934
  } finally {
12893
14935
  await this.temporaryStorage.cleanup();
12894
14936
  }
@@ -13284,81 +15326,6 @@ function addSdkUserAgentHeader(headers, userAgent) {
13284
15326
 
13285
15327
  // src/publish/services/orchestrator-feeds-service.ts
13286
15328
  import { translate as translate9 } from "@uipath/solutionpackager-tool-core";
13287
- // package.json
13288
- var package_default = {
13289
- name: "@uipath/project-packager",
13290
- license: "SEE LICENSE IN LICENSE.txt",
13291
- version: "1.202.0",
13292
- description: "UiPath Project Packager - core library for packing individual UiPath projects",
13293
- type: "module",
13294
- main: "./dist/index.js",
13295
- exports: {
13296
- ".": {
13297
- types: "./dist/src/index.d.ts",
13298
- default: "./dist/index.js"
13299
- },
13300
- "./node": {
13301
- types: "./dist/src/node.d.ts",
13302
- default: "./dist/node.js"
13303
- },
13304
- "./browser": {
13305
- types: "./dist/src/browser.d.ts",
13306
- default: "./dist/browser.js"
13307
- }
13308
- },
13309
- types: "./dist/src/index.d.ts",
13310
- repository: {
13311
- type: "git",
13312
- url: "https://github.com/UiPath/cli.git",
13313
- directory: "packages/packager/project-packager"
13314
- },
13315
- publishConfig: {
13316
- registry: "https://npm.pkg.github.com/"
13317
- },
13318
- files: [
13319
- "dist"
13320
- ],
13321
- scripts: {
13322
- build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/browser.ts --outdir dist --format esm --target browser --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && bun build ./src/node.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core --external '@uipath/filesystem/*' --external @uipath/filesystem --sourcemap=linked && tsc --emitDeclarationOnly --outDir dist",
13323
- clean: "rimraf dist",
13324
- test: "vitest run",
13325
- e2e: "vitest run --config vitest.e2e.config.ts",
13326
- "test:coverage": "vitest run --coverage",
13327
- prepack: "bun run build",
13328
- "publish:dry": "bun publish --dry-run",
13329
- "publish:gh": "bun publish",
13330
- "version:patch": "bun version patch --no-git-tag-version",
13331
- "version:minor": "bun version minor --no-git-tag-version",
13332
- "version:major": "bun version major --no-git-tag-version",
13333
- lint: "biome check ."
13334
- },
13335
- dependencies: {
13336
- "@uipath/filesystem": "workspace:*",
13337
- "@uipath/solutionpackager-tool-core": "workspace:*",
13338
- "@uipath/common": "workspace:*"
13339
- },
13340
- peerDependencies: {
13341
- fflate: "^0.8.2"
13342
- },
13343
- devDependencies: {
13344
- "@types/node": "^25.5.2",
13345
- "@uipath/resource-builder-tool": "2025.11.0-alpha4535-3530",
13346
- "@uipath/tool-agent": "^2.0.0",
13347
- "@uipath/packager-tool-apiworkflow": "workspace:*",
13348
- "@uipath/packager-tool-connector": "workspace:*",
13349
- "@uipath/packager-tool-flow": "workspace:*",
13350
- "@uipath/packager-tool-functions": "workspace:*",
13351
- "@uipath/packager-tool-webapp": "workspace:*",
13352
- "@uipath/packager-tool-workflowcompiler": "workspace:*",
13353
- "@vitest/coverage-v8": "^4.1.11",
13354
- jsdom: "^30.0.1",
13355
- typescript: "^7.0.2",
13356
- "vite-tsconfig-paths": "^6.1.1",
13357
- vitest: "^4.1.11"
13358
- }
13359
- };
13360
-
13361
- // src/publish/services/orchestrator-feeds-service.ts
13362
15329
  var HEADER_TENANT_ID = "X-UIPATH-TenantId";
13363
15330
  var FEEDS_PATH = "/api/PackageFeeds/GetFeeds";
13364
15331
  var FOLDERS_PATH = "/api/FoldersNavigation/GetAllFoldersForCurrentUser";
@@ -13717,6 +15684,7 @@ export {
13717
15684
  GovernancePolicyService,
13718
15685
  NodeContextStorage,
13719
15686
  NodePackageSignService,
15687
+ PACKAGE_ID_TOO_LONG,
13720
15688
  PackService,
13721
15689
  PackagerParameters,
13722
15690
  PackagerParametersValidator,
@@ -13740,9 +15708,10 @@ export {
13740
15708
  ToolsFactory,
13741
15709
  createNodeProjectPackager,
13742
15710
  createNodeProjectPublisher,
15711
+ isPackageIdTooLongError,
13743
15712
  resolveProducedNupkgsAsync,
13744
15713
  setGlobalLogHandler,
13745
15714
  signNupkgsAsync
13746
15715
  };
13747
15716
 
13748
- //# debugId=7B708008211F991564756E2164756E21
15717
+ //# debugId=AE11F7A556FA37B764756E2164756E21