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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ import {
13
13
  ZipService,
14
14
  toolsFactoryRepository,
15
15
  translate
16
- } from "./packager-tool-4vt21dnn.js";
16
+ } from "./packager-tool-6se0wnbx.js";
17
17
  import"./packager-tool-1de529jm.js";
18
18
 
19
19
  // ../packager/project-packager/dist/node.js
@@ -982,18 +982,25 @@ var de_default = {
982
982
  info: {
983
983
  alreadyProvided: "Governance policy file already provided, skipping download.",
984
984
  saved: "Governance policy saved to {path}",
985
- downloading: "Downloading governance policy from {url}",
986
- noPolicyFound: "No governance policy found for this configuration.",
987
- responseNotJson: "Policy response is not JSON, treating as no policy.",
985
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
986
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
987
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
988
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
989
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
988
990
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
989
991
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
990
992
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
991
993
  },
992
994
  errors: {
993
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
994
- failedToGetPolicy: "Failed to download governance policy: {content}",
995
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
996
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
995
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
996
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
997
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
998
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
999
+ failedToSave: "Failed to save governance policy: {error}",
1000
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1001
+ },
1002
+ instructions: {
1003
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
997
1004
  }
998
1005
  },
999
1006
  signing: {
@@ -1065,18 +1072,25 @@ var en = {
1065
1072
  info: {
1066
1073
  alreadyProvided: "Governance policy file already provided, skipping download.",
1067
1074
  saved: "Governance policy saved to {path}",
1068
- downloading: "Downloading governance policy from {url}",
1069
- noPolicyFound: "No governance policy found for this configuration.",
1070
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1075
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1076
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1077
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1078
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1079
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1071
1080
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1072
1081
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1073
1082
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1074
1083
  },
1075
1084
  errors: {
1076
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1077
- failedToGetPolicy: "Failed to download governance policy: {content}",
1078
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1079
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1085
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1086
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1087
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1088
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1089
+ failedToSave: "Failed to save governance policy: {error}",
1090
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1091
+ },
1092
+ instructions: {
1093
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1080
1094
  }
1081
1095
  },
1082
1096
  signing: {
@@ -1148,18 +1162,25 @@ var es_default = {
1148
1162
  info: {
1149
1163
  alreadyProvided: "Governance policy file already provided, skipping download.",
1150
1164
  saved: "Governance policy saved to {path}",
1151
- downloading: "Downloading governance policy from {url}",
1152
- noPolicyFound: "No governance policy found for this configuration.",
1153
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1165
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1166
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1167
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1168
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1169
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1154
1170
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1155
1171
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1156
1172
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1157
1173
  },
1158
1174
  errors: {
1159
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1160
- failedToGetPolicy: "Failed to download governance policy: {content}",
1161
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1162
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1175
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1176
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1177
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1178
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1179
+ failedToSave: "Failed to save governance policy: {error}",
1180
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1181
+ },
1182
+ instructions: {
1183
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1163
1184
  }
1164
1185
  },
1165
1186
  signing: {
@@ -1231,18 +1252,25 @@ var es_MX_default = {
1231
1252
  info: {
1232
1253
  alreadyProvided: "Governance policy file already provided, skipping download.",
1233
1254
  saved: "Governance policy saved to {path}",
1234
- downloading: "Downloading governance policy from {url}",
1235
- noPolicyFound: "No governance policy found for this configuration.",
1236
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1255
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1256
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1257
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1258
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1259
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1237
1260
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1238
1261
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1239
1262
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1240
1263
  },
1241
1264
  errors: {
1242
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1243
- failedToGetPolicy: "Failed to download governance policy: {content}",
1244
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1245
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1265
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1266
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1267
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1268
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1269
+ failedToSave: "Failed to save governance policy: {error}",
1270
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1271
+ },
1272
+ instructions: {
1273
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1246
1274
  }
1247
1275
  },
1248
1276
  signing: {
@@ -1314,18 +1342,25 @@ var fr_default = {
1314
1342
  info: {
1315
1343
  alreadyProvided: "Governance policy file already provided, skipping download.",
1316
1344
  saved: "Governance policy saved to {path}",
1317
- downloading: "Downloading governance policy from {url}",
1318
- noPolicyFound: "No governance policy found for this configuration.",
1319
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1345
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1346
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1347
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1348
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1349
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1320
1350
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1321
1351
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1322
1352
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1323
1353
  },
1324
1354
  errors: {
1325
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1326
- failedToGetPolicy: "Failed to download governance policy: {content}",
1327
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1328
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1355
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1356
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1357
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1358
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1359
+ failedToSave: "Failed to save governance policy: {error}",
1360
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1361
+ },
1362
+ instructions: {
1363
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1329
1364
  }
1330
1365
  },
1331
1366
  signing: {
@@ -1397,18 +1432,25 @@ var ja_default = {
1397
1432
  info: {
1398
1433
  alreadyProvided: "Governance policy file already provided, skipping download.",
1399
1434
  saved: "Governance policy saved to {path}",
1400
- downloading: "Downloading governance policy from {url}",
1401
- noPolicyFound: "No governance policy found for this configuration.",
1402
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1435
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1436
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1437
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1438
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1439
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1403
1440
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1404
1441
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1405
1442
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1406
1443
  },
1407
1444
  errors: {
1408
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1409
- failedToGetPolicy: "Failed to download governance policy: {content}",
1410
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1411
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1445
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1446
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1447
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1448
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1449
+ failedToSave: "Failed to save governance policy: {error}",
1450
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1451
+ },
1452
+ instructions: {
1453
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1412
1454
  }
1413
1455
  },
1414
1456
  signing: {
@@ -1480,18 +1522,25 @@ var ko_default = {
1480
1522
  info: {
1481
1523
  alreadyProvided: "Governance policy file already provided, skipping download.",
1482
1524
  saved: "Governance policy saved to {path}",
1483
- downloading: "Downloading governance policy from {url}",
1484
- noPolicyFound: "No governance policy found for this configuration.",
1485
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1525
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1526
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1527
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1528
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1529
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1486
1530
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1487
1531
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1488
1532
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1489
1533
  },
1490
1534
  errors: {
1491
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1492
- failedToGetPolicy: "Failed to download governance policy: {content}",
1493
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1494
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1535
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1536
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1537
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1538
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1539
+ failedToSave: "Failed to save governance policy: {error}",
1540
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1541
+ },
1542
+ instructions: {
1543
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1495
1544
  }
1496
1545
  },
1497
1546
  signing: {
@@ -1563,18 +1612,25 @@ var pt_default = {
1563
1612
  info: {
1564
1613
  alreadyProvided: "Governance policy file already provided, skipping download.",
1565
1614
  saved: "Governance policy saved to {path}",
1566
- downloading: "Downloading governance policy from {url}",
1567
- noPolicyFound: "No governance policy found for this configuration.",
1568
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1615
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1616
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1617
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1618
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1619
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1569
1620
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1570
1621
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1571
1622
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1572
1623
  },
1573
1624
  errors: {
1574
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1575
- failedToGetPolicy: "Failed to download governance policy: {content}",
1576
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1577
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1625
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1626
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1627
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1628
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1629
+ failedToSave: "Failed to save governance policy: {error}",
1630
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1631
+ },
1632
+ instructions: {
1633
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1578
1634
  }
1579
1635
  },
1580
1636
  signing: {
@@ -1646,18 +1702,25 @@ var pt_BR_default = {
1646
1702
  info: {
1647
1703
  alreadyProvided: "Governance policy file already provided, skipping download.",
1648
1704
  saved: "Governance policy saved to {path}",
1649
- downloading: "Downloading governance policy from {url}",
1650
- noPolicyFound: "No governance policy found for this configuration.",
1651
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1705
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1706
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1707
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1708
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1709
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1652
1710
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1653
1711
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1654
1712
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1655
1713
  },
1656
1714
  errors: {
1657
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1658
- failedToGetPolicy: "Failed to download governance policy: {content}",
1659
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1660
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1715
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1716
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1717
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1718
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1719
+ failedToSave: "Failed to save governance policy: {error}",
1720
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1721
+ },
1722
+ instructions: {
1723
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1661
1724
  }
1662
1725
  },
1663
1726
  signing: {
@@ -1729,18 +1792,25 @@ var ro_default = {
1729
1792
  info: {
1730
1793
  alreadyProvided: "Governance policy file already provided, skipping download.",
1731
1794
  saved: "Governance policy saved to {path}",
1732
- downloading: "Downloading governance policy from {url}",
1733
- noPolicyFound: "No governance policy found for this configuration.",
1734
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1795
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1796
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1797
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1798
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1799
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1735
1800
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1736
1801
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1737
1802
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1738
1803
  },
1739
1804
  errors: {
1740
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1741
- failedToGetPolicy: "Failed to download governance policy: {content}",
1742
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1743
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1805
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1806
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1807
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1808
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1809
+ failedToSave: "Failed to save governance policy: {error}",
1810
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1811
+ },
1812
+ instructions: {
1813
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1744
1814
  }
1745
1815
  },
1746
1816
  signing: {
@@ -1812,18 +1882,25 @@ var ru_default = {
1812
1882
  info: {
1813
1883
  alreadyProvided: "Governance policy file already provided, skipping download.",
1814
1884
  saved: "Governance policy saved to {path}",
1815
- downloading: "Downloading governance policy from {url}",
1816
- noPolicyFound: "No governance policy found for this configuration.",
1817
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1885
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1886
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1887
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1888
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1889
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1818
1890
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1819
1891
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1820
1892
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1821
1893
  },
1822
1894
  errors: {
1823
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1824
- failedToGetPolicy: "Failed to download governance policy: {content}",
1825
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1826
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1895
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1896
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1897
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1898
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1899
+ failedToSave: "Failed to save governance policy: {error}",
1900
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1901
+ },
1902
+ instructions: {
1903
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1827
1904
  }
1828
1905
  },
1829
1906
  signing: {
@@ -1895,18 +1972,25 @@ var tr_default = {
1895
1972
  info: {
1896
1973
  alreadyProvided: "Governance policy file already provided, skipping download.",
1897
1974
  saved: "Governance policy saved to {path}",
1898
- downloading: "Downloading governance policy from {url}",
1899
- noPolicyFound: "No governance policy found for this configuration.",
1900
- responseNotJson: "Policy response is not JSON, treating as no policy.",
1975
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
1976
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
1977
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
1978
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
1979
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1901
1980
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1902
1981
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1903
1982
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1904
1983
  },
1905
1984
  errors: {
1906
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1907
- failedToGetPolicy: "Failed to download governance policy: {content}",
1908
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1909
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
1985
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
1986
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
1987
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
1988
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
1989
+ failedToSave: "Failed to save governance policy: {error}",
1990
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
1991
+ },
1992
+ instructions: {
1993
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1910
1994
  }
1911
1995
  },
1912
1996
  signing: {
@@ -1978,18 +2062,25 @@ var zh_CN_default = {
1978
2062
  info: {
1979
2063
  alreadyProvided: "Governance policy file already provided, skipping download.",
1980
2064
  saved: "Governance policy saved to {path}",
1981
- downloading: "Downloading governance policy from {url}",
1982
- noPolicyFound: "No governance policy found for this configuration.",
1983
- responseNotJson: "Policy response is not JSON, treating as no policy.",
2065
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
2066
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
2067
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
2068
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
2069
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
1984
2070
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
1985
2071
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
1986
2072
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
1987
2073
  },
1988
2074
  errors: {
1989
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
1990
- failedToGetPolicy: "Failed to download governance policy: {content}",
1991
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
1992
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
2075
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
2076
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
2077
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
2078
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
2079
+ failedToSave: "Failed to save governance policy: {error}",
2080
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
2081
+ },
2082
+ instructions: {
2083
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
1993
2084
  }
1994
2085
  },
1995
2086
  signing: {
@@ -2061,18 +2152,25 @@ var zh_TW_default = {
2061
2152
  info: {
2062
2153
  alreadyProvided: "Governance policy file already provided, skipping download.",
2063
2154
  saved: "Governance policy saved to {path}",
2064
- downloading: "Downloading governance policy from {url}",
2065
- noPolicyFound: "No governance policy found for this configuration.",
2066
- responseNotJson: "Policy response is not JSON, treating as no policy.",
2155
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
2156
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
2157
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
2158
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
2159
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
2067
2160
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
2068
2161
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
2069
2162
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
2070
2163
  },
2071
2164
  errors: {
2072
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
2073
- failedToGetPolicy: "Failed to download governance policy: {content}",
2074
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
2075
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
2165
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
2166
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
2167
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
2168
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
2169
+ failedToSave: "Failed to save governance policy: {error}",
2170
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
2171
+ },
2172
+ instructions: {
2173
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
2076
2174
  }
2077
2175
  },
2078
2176
  signing: {
@@ -2144,18 +2242,25 @@ var zu_default = {
2144
2242
  info: {
2145
2243
  alreadyProvided: "Governance policy file already provided, skipping download.",
2146
2244
  saved: "Governance policy saved to {path}",
2147
- downloading: "Downloading governance policy from {url}",
2148
- noPolicyFound: "No governance policy found for this configuration.",
2149
- responseNotJson: "Policy response is not JSON, treating as no policy.",
2245
+ resolving: "Asking AutomationOps for the {product} policy, license type {licenseType}.",
2246
+ ungoverned: "AutomationOps publishes no policy for this tenant. Analyzing with the rules shipped with the WorkflowCompiler.",
2247
+ suppliedFileHonoured: "AutomationOps publishes no policy for this tenant, so the supplied governance file is used: {path}",
2248
+ suppliedFileUnchecked: "Using the supplied governance file, but the tenant's own policy could not be checked: {path}",
2249
+ noTenantToAsk: "No signed-in tenant to ask about governance. Using the supplied governance file: {path}",
2150
2250
  licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
2151
2251
  licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
2152
2252
  licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
2153
2253
  },
2154
2254
  errors: {
2155
- connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
2156
- failedToGetPolicy: "Failed to download governance policy: {content}",
2157
- failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
2158
- failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
2255
+ connectionIncomplete: "Connection info is incomplete, so the tenant could not be asked about governance.",
2256
+ unknownOutcome: "Could not tell whether this tenant is governed ({reason}): {detail} Asked {url}.",
2257
+ retryAfter: "The policy service asked for {seconds} seconds before another try.",
2258
+ tenantPolicyWins: "The AutomationOps policy published for {product} applies to this tenant, so the governance file at {path} cannot replace it.",
2259
+ failedToSave: "Failed to save governance policy: {error}",
2260
+ fallingBackToDefault: "{reason} Analyzing with the rules shipped with the WorkflowCompiler."
2261
+ },
2262
+ instructions: {
2263
+ tenantPolicyWins: "Drop --governance-file-path so the tenant's policy is used, or ask an administrator to change the policy published in AutomationOps."
2159
2264
  }
2160
2265
  },
2161
2266
  signing: {
@@ -10107,7 +10212,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
10107
10212
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
10108
10213
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
10109
10214
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
10110
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
10215
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
10111
10216
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
10112
10217
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
10113
10218
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -10154,7 +10259,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
10154
10259
  `(?<![A-Za-z0-9])"(?:[^\\
10155
10260
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
10156
10261
  ].join("|"), "g");
10157
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
10262
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
10158
10263
  var COLLAPSED_BODY = "{…}";
10159
10264
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
10160
10265
  var MAX_BODY_NESTING = 8;
@@ -10169,10 +10274,13 @@ function collapseJsonBodies(text) {
10169
10274
  }
10170
10275
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
10171
10276
  }
10172
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
10277
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
10173
10278
  function peelTrailingPunctuation(match) {
10174
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
10175
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
10279
+ let end = match.length;
10280
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
10281
+ end -= 1;
10282
+ }
10283
+ return [match.slice(0, end), match.slice(end)];
10176
10284
  }
10177
10285
  function redactUrl(raw) {
10178
10286
  try {
@@ -10380,6 +10488,12 @@ var TLS_ERROR_CODES = new Set([
10380
10488
  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.";
10381
10489
  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.";
10382
10490
  var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
10491
+ function carriedInstructions(error) {
10492
+ if (!error || typeof error !== "object")
10493
+ return;
10494
+ const e = error;
10495
+ return typeof e.instructions === "string" ? e.instructions : undefined;
10496
+ }
10383
10497
  function setExitCode(code) {
10384
10498
  process.exitCode = code;
10385
10499
  }
@@ -10861,7 +10975,8 @@ function readRegistryValue(keyPath, valueName) {
10861
10975
  }
10862
10976
  const [error, output] = catchError(() => execFileSync22("reg", ["query", keyPath, "/v", valueName], {
10863
10977
  encoding: "utf-8",
10864
- stdio: ["pipe", "pipe", "pipe"]
10978
+ stdio: ["pipe", "pipe", "pipe"],
10979
+ windowsHide: true
10865
10980
  }));
10866
10981
  if (error) {
10867
10982
  return "";
@@ -11538,28 +11653,32 @@ function isPlainRecord(value) {
11538
11653
  const prototype = Object.getPrototypeOf(value);
11539
11654
  return prototype === Object.prototype || prototype === null;
11540
11655
  }
11541
- function extractPagedRows(value) {
11656
+ function splitPagedEnvelope(value) {
11542
11657
  if (Array.isArray(value) || !isPlainRecord(value))
11543
11658
  return null;
11544
- const entries = Object.values(value);
11659
+ const entries = Object.entries(value);
11545
11660
  if (entries.length === 0)
11546
11661
  return null;
11547
- let rows = null;
11548
- let hasScalarSibling = false;
11549
- for (const entry of entries) {
11662
+ let found = null;
11663
+ const meta = Object.create(null);
11664
+ for (const [key, entry] of entries) {
11550
11665
  if (Array.isArray(entry)) {
11551
- if (rows !== null)
11666
+ if (found !== null)
11552
11667
  return null;
11553
- rows = entry;
11668
+ found = { key, rows: entry };
11554
11669
  } else if (entry !== null && typeof entry === "object") {
11555
11670
  return null;
11556
11671
  } else {
11557
- hasScalarSibling = true;
11672
+ meta[key] = entry;
11558
11673
  }
11559
11674
  }
11560
- if (rows === null || !hasScalarSibling)
11675
+ if (found === null || Object.keys(meta).length === 0)
11561
11676
  return null;
11562
- return rows;
11677
+ return { ...found, meta };
11678
+ }
11679
+ function extractPagedRows(value) {
11680
+ const paged = splitPagedEnvelope(value);
11681
+ return paged === null ? null : paged.rows;
11563
11682
  }
11564
11683
  function toLowerCamelCaseKey(key) {
11565
11684
  if (!key)
@@ -11663,6 +11782,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
11663
11782
  }
11664
11783
  break;
11665
11784
  }
11785
+ case "markdown":
11786
+ logFn(renderMarkdown(data));
11787
+ break;
11666
11788
  default: {
11667
11789
  const hasData = "Data" in data && data.Data != null;
11668
11790
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
@@ -11687,6 +11809,10 @@ function logOutput(data, format = "json", tableRowStyle) {
11687
11809
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
11688
11810
  `), needsAsciiSafeJson(sink), styleFn);
11689
11811
  }
11812
+ var PLUMBING_KEYS = new Set(["code", "log"]);
11813
+ function isPlumbingKey(key) {
11814
+ return PLUMBING_KEYS.has(key.toLowerCase());
11815
+ }
11690
11816
  function cellToString(val) {
11691
11817
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
11692
11818
  }
@@ -11702,7 +11828,7 @@ function wrapText(text, width) {
11702
11828
  function printTable(data, logFn, externalLogValue, tableRowStyle) {
11703
11829
  if (data.length === 0)
11704
11830
  return;
11705
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
11831
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
11706
11832
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
11707
11833
  const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
11708
11834
  logFn(header);
@@ -11724,7 +11850,7 @@ function isNonEmptyPlainObject(value) {
11724
11850
  }
11725
11851
  var NESTED_INDENT = " ";
11726
11852
  function printVerticalTable(data, logFn = console.log, externalLogValue) {
11727
- const keys = Object.keys(data).filter((key) => !["code", "log"].includes(key.toLowerCase()));
11853
+ const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
11728
11854
  if (keys.length === 0)
11729
11855
  return;
11730
11856
  const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
@@ -11755,7 +11881,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
11755
11881
  function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
11756
11882
  if (data.length === 0)
11757
11883
  return;
11758
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
11884
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
11759
11885
  if (keys.length === 0)
11760
11886
  return;
11761
11887
  if (!process.stdout.isTTY) {
@@ -11829,6 +11955,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
11829
11955
  logFn(`Log: ${externalLogValue}`);
11830
11956
  }
11831
11957
  }
11958
+ var MARKDOWN_MAX_CELL = 200;
11959
+ var MARKDOWN_MAX_DEPTH = 3;
11960
+ function markdownHeading(depth) {
11961
+ return "#".repeat(Math.min(3 + depth, 6));
11962
+ }
11963
+ var BACKTICK_RUN = /`+/g;
11964
+ function fencedBlock(text) {
11965
+ const first = text.trimStart()[0];
11966
+ const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
11967
+ const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
11968
+ const fence = "`".repeat(Math.max(3, longestRun + 1));
11969
+ return `${fence}${language}
11970
+ ${text}
11971
+ ${fence}`;
11972
+ }
11973
+ function collapseNewlineRuns(text) {
11974
+ return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
11975
+ `) ? " " : part).join("");
11976
+ }
11977
+ function markdownCell(value) {
11978
+ const text = value instanceof Date ? value.toISOString() : cellToString(value);
11979
+ return collapseNewlineRuns(text).replace(/\|/g, "\\|");
11980
+ }
11981
+ function markdownLabel(key) {
11982
+ return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
11983
+ }
11984
+ function withoutPlumbing(record) {
11985
+ const kept = Object.create(null);
11986
+ for (const [key, value] of Object.entries(record)) {
11987
+ if (!isPlumbingKey(key))
11988
+ kept[key] = value;
11989
+ }
11990
+ return kept;
11991
+ }
11992
+ function rowsWithoutPlumbing(rows) {
11993
+ return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
11994
+ }
11995
+ function markdownTable(rows) {
11996
+ const columns = [];
11997
+ const seen = new Set;
11998
+ for (const row of rows) {
11999
+ for (const key of Object.keys(row)) {
12000
+ if (!seen.has(key)) {
12001
+ seen.add(key);
12002
+ columns.push(key);
12003
+ }
12004
+ }
12005
+ }
12006
+ if (columns.length === 0)
12007
+ return null;
12008
+ const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
12009
+ if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
12010
+ return null;
12011
+ }
12012
+ return [
12013
+ `| ${columns.map(markdownLabel).join(" | ")} |`,
12014
+ `| ${columns.map(() => "---").join(" | ")} |`,
12015
+ ...cells.map((row) => `| ${row.join(" | ")} |`)
12016
+ ].join(`
12017
+ `);
12018
+ }
12019
+ function extractMessageSequence(rows) {
12020
+ const messages = [];
12021
+ for (const row of rows) {
12022
+ const message = extractSingleMessage(row);
12023
+ if (message === null)
12024
+ return null;
12025
+ messages.push(message);
12026
+ }
12027
+ return messages.join(`
12028
+
12029
+ `);
12030
+ }
12031
+ function markdownRows(rows, depth) {
12032
+ if (rows.length === 0)
12033
+ return "(none)";
12034
+ if (!isPlainObjectArray(rows)) {
12035
+ return rows.map((item) => `- ${markdownCell(item)}`).join(`
12036
+ `);
12037
+ }
12038
+ const prose = extractMessageSequence(rows);
12039
+ if (prose !== null)
12040
+ return prose;
12041
+ const table = markdownTable(rows);
12042
+ if (table !== null)
12043
+ return table;
12044
+ if (depth >= MARKDOWN_MAX_DEPTH) {
12045
+ return fencedBlock(JSON.stringify(rows, null, 2));
12046
+ }
12047
+ return rows.map((row, index) => [
12048
+ `${markdownHeading(depth)} ${index + 1}`,
12049
+ markdownObject(row, depth + 1)
12050
+ ].join(`
12051
+
12052
+ `)).join(`
12053
+
12054
+ `);
12055
+ }
12056
+ function markdownObject(obj, depth) {
12057
+ const scalars = [];
12058
+ const blocks = [];
12059
+ for (const [key, value] of Object.entries(obj)) {
12060
+ if (value === undefined)
12061
+ continue;
12062
+ const label = markdownLabel(key);
12063
+ if (Array.isArray(value)) {
12064
+ blocks.push(`${markdownHeading(depth)} ${label}
12065
+
12066
+ ${markdownRows(value, depth + 1)}`);
12067
+ } else if (isNonEmptyPlainObject(value)) {
12068
+ const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
12069
+ if (nested !== "") {
12070
+ blocks.push(`${markdownHeading(depth)} ${label}
12071
+
12072
+ ${nested}`);
12073
+ }
12074
+ } else if (typeof value === "string" && value.includes(`
12075
+ `)) {
12076
+ blocks.push(`**${label}:**
12077
+
12078
+ ${fencedBlock(value)}`);
12079
+ } else {
12080
+ scalars.push(`**${label}:** ${markdownCell(value)}`);
12081
+ }
12082
+ }
12083
+ const sections = scalars.length > 0 ? [scalars.join(`
12084
+ `)] : [];
12085
+ sections.push(...blocks);
12086
+ return sections.join(`
12087
+
12088
+ `);
12089
+ }
12090
+ function extractSingleMessage(payload) {
12091
+ if (!isPlainRecord(payload))
12092
+ return null;
12093
+ const keys = Object.keys(payload);
12094
+ if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
12095
+ return null;
12096
+ const value = payload[keys[0]];
12097
+ return typeof value === "string" ? value : null;
12098
+ }
12099
+ function markdownPayload(payload) {
12100
+ const message = extractSingleMessage(payload);
12101
+ if (message !== null)
12102
+ return message;
12103
+ if (Array.isArray(payload)) {
12104
+ return markdownRows(rowsWithoutPlumbing(payload), 0);
12105
+ }
12106
+ const visible = withoutPlumbing(payload);
12107
+ const paged = splitPagedEnvelope(visible);
12108
+ if (paged !== null) {
12109
+ const meta = markdownObject(paged.meta, 0);
12110
+ const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
12111
+
12112
+ ${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
12113
+ return meta === "" ? rows : `${meta}
12114
+
12115
+ ${rows}`;
12116
+ }
12117
+ return markdownObject(visible, 0);
12118
+ }
12119
+ function isPaginationWorthShowing(value) {
12120
+ if (typeof value !== "object" || value === null)
12121
+ return false;
12122
+ const page = value;
12123
+ return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
12124
+ }
12125
+ function markdownEnvelopeNotes(data) {
12126
+ const envelope = data;
12127
+ const notes = [];
12128
+ const warning = envelope.Warning;
12129
+ if (typeof warning === "string" && warning !== "") {
12130
+ notes.push(`> **Warning:** ${warning}`);
12131
+ }
12132
+ const instructions = envelope.Instructions;
12133
+ if (typeof instructions === "string" && instructions !== "") {
12134
+ notes.push(`> ${instructions}`);
12135
+ }
12136
+ const pagination = envelope.Pagination;
12137
+ if (isPaginationWorthShowing(pagination)) {
12138
+ const body = markdownObject(pagination, 1);
12139
+ if (body !== "") {
12140
+ notes.push(`${markdownHeading(0)} Pagination
12141
+
12142
+ ${body}`);
12143
+ }
12144
+ }
12145
+ const log = envelope.Log;
12146
+ if (typeof log === "string" && log !== "") {
12147
+ notes.push(`**Log:** ${log}`);
12148
+ }
12149
+ return notes;
12150
+ }
12151
+ function renderMarkdown(data) {
12152
+ if (data.Result !== RESULTS.Success) {
12153
+ const failure = data;
12154
+ const sections = [`**Failed:** ${failure.Message}`];
12155
+ if (failure.Data != null) {
12156
+ sections.push(markdownPayload(failure.Data));
12157
+ }
12158
+ if (failure.Instructions) {
12159
+ sections.push(`> ${failure.Instructions}`);
12160
+ }
12161
+ return sections.filter((section) => section !== "").join(`
12162
+
12163
+ `);
12164
+ }
12165
+ if (!("Data" in data) || data.Data == null) {
12166
+ return markdownObject(withoutPlumbing(data), 0);
12167
+ }
12168
+ return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
12169
+
12170
+ `);
12171
+ }
11832
12172
  function toYaml(data) {
11833
12173
  const codec = getYamlCodec();
11834
12174
  if (!codec) {
@@ -13027,212 +13367,1907 @@ var TelemetryNames;
13027
13367
  TelemetryNames2["ProjectPackagerCleanup"] = "ProjectPackager.Cleanup";
13028
13368
  TelemetryNames2["ProjectPackagerProjectLoaded"] = "ProjectPackager.ProjectLoaded";
13029
13369
  })(TelemetryNames ||= {});
13030
- var LICENSE_TYPES = {
13031
- NoLicense: "NoLicense",
13032
- Development: "Development",
13033
- Attended: "Attended",
13034
- Unattended: "Unattended",
13035
- StudioX: "StudioX",
13036
- StudioPro: "StudioPro",
13037
- AutomationKit: "AutomationKit"
13038
- };
13039
- var DEFAULT_PROFILE_KEY = "StudioWeb";
13040
- var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
13041
- var GOVERNANCE_SUBFOLDER = "governance";
13042
- var GOVERNANCE_FILE_NAME = "governance-policy.json";
13043
- var errorMessage = (error) => error instanceof Error ? error.message : String(error);
13044
- var t = (key, params) => translate.t(`solutionpackager.governance.${key}`, params);
13370
+ var BASE_PATH = "http://localhost".replace(/\/+$/, "");
13045
13371
 
13046
- class GovernancePolicyService {
13047
- fileSystem;
13048
- temporaryStorage;
13049
- fetchFn;
13050
- logger = new ToolLogger("GovernancePolicyService", "ResolvePolicy");
13051
- constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
13052
- this.fileSystem = fileSystem;
13053
- this.temporaryStorage = temporaryStorage;
13054
- this.fetchFn = fetchFn;
13372
+ class Configuration {
13373
+ configuration;
13374
+ constructor(configuration = {}) {
13375
+ this.configuration = configuration;
13055
13376
  }
13056
- async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken) {
13057
- if (validateOptions.governanceFileType !== "AutomationOps") {
13058
- return;
13377
+ set config(configuration) {
13378
+ this.configuration = configuration;
13379
+ }
13380
+ get basePath() {
13381
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
13382
+ }
13383
+ get fetchApi() {
13384
+ return this.configuration.fetchApi;
13385
+ }
13386
+ get middleware() {
13387
+ return this.configuration.middleware || [];
13388
+ }
13389
+ get queryParamsStringify() {
13390
+ return this.configuration.queryParamsStringify || querystring;
13391
+ }
13392
+ get username() {
13393
+ return this.configuration.username;
13394
+ }
13395
+ get password() {
13396
+ return this.configuration.password;
13397
+ }
13398
+ get apiKey() {
13399
+ const apiKey = this.configuration.apiKey;
13400
+ if (apiKey) {
13401
+ return typeof apiKey === "function" ? apiKey : () => apiKey;
13059
13402
  }
13060
- if (validateOptions.governanceFilePath) {
13061
- this.logger.info(t("info.alreadyProvided"));
13062
- return;
13403
+ return;
13404
+ }
13405
+ get accessToken() {
13406
+ const accessToken = this.configuration.accessToken;
13407
+ if (accessToken) {
13408
+ return typeof accessToken === "function" ? accessToken : async () => accessToken;
13063
13409
  }
13064
- let cloudUrl = connectionInfo?.cloudUrl;
13065
- const organizationId = connectionInfo?.organizationId;
13066
- const tenantId = connectionInfo?.tenantId;
13067
- const accessToken = connectionInfo?.accessToken;
13068
- if (!cloudUrl || !organizationId || !tenantId || !accessToken) {
13069
- this.logger.warn(t("errors.connectionIncomplete"));
13070
- validateOptions.governanceFileType = "Default";
13071
- return;
13410
+ return;
13411
+ }
13412
+ get headers() {
13413
+ return this.configuration.headers;
13414
+ }
13415
+ get credentials() {
13416
+ return this.configuration.credentials;
13417
+ }
13418
+ }
13419
+ var DefaultConfig = new Configuration;
13420
+
13421
+ class BaseAPI {
13422
+ configuration;
13423
+ static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i");
13424
+ middleware;
13425
+ constructor(configuration = DefaultConfig) {
13426
+ this.configuration = configuration;
13427
+ this.middleware = configuration.middleware;
13428
+ }
13429
+ withMiddleware(...middlewares) {
13430
+ const next = this.clone();
13431
+ next.middleware = next.middleware.concat(...middlewares);
13432
+ return next;
13433
+ }
13434
+ withPreMiddleware(...preMiddlewares) {
13435
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
13436
+ return this.withMiddleware(...middlewares);
13437
+ }
13438
+ withPostMiddleware(...postMiddlewares) {
13439
+ const middlewares = postMiddlewares.map((post) => ({ post }));
13440
+ return this.withMiddleware(...middlewares);
13441
+ }
13442
+ isJsonMime(mime) {
13443
+ if (!mime) {
13444
+ return false;
13072
13445
  }
13073
- const profileKey = validateOptions.profileKey ?? DEFAULT_PROFILE_KEY;
13074
- let cloudOrigin;
13075
- try {
13076
- cloudOrigin = new URL(cloudUrl).origin;
13077
- cloudUrl = cloudUrl.replace(/\/+$/, "");
13078
- } catch {
13079
- this.logger.warn(t("errors.connectionIncomplete"));
13080
- validateOptions.governanceFileType = "Default";
13081
- return;
13446
+ return BaseAPI.jsonRegex.test(mime);
13447
+ }
13448
+ async request(context, initOverrides) {
13449
+ const { url, init } = await this.createFetchParams(context, initOverrides);
13450
+ const response = await this.fetchApi(url, init);
13451
+ if (response && (response.status >= 200 && response.status < 300)) {
13452
+ return response;
13082
13453
  }
13083
- const licenseType = await this.resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken);
13084
- const policy = await this.downloadPolicyAsync(cloudOrigin, organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken);
13085
- if (!policy) {
13086
- validateOptions.governanceFileType = "Default";
13087
- return;
13454
+ throw new ResponseError(response, "Response returned an error code");
13455
+ }
13456
+ async createFetchParams(context, initOverrides) {
13457
+ let url = this.configuration.basePath + context.path;
13458
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
13459
+ url += "?" + this.configuration.queryParamsStringify(context.query);
13088
13460
  }
13089
- try {
13090
- const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
13091
- const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
13092
- await this.fileSystem.writeFile(filePath, policy);
13093
- this.logger.info(t("info.saved", { path: filePath }));
13094
- validateOptions.governanceFilePath = filePath;
13095
- } catch (error) {
13096
- this.logger.warn(t("errors.failedToSave", {
13097
- error: errorMessage(error)
13098
- }));
13099
- validateOptions.governanceFileType = "Default";
13461
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
13462
+ Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {});
13463
+ const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
13464
+ const initParams = {
13465
+ method: context.method,
13466
+ headers,
13467
+ body: context.body,
13468
+ credentials: this.configuration.credentials
13469
+ };
13470
+ const overriddenInit = {
13471
+ ...initParams,
13472
+ ...await initOverrideFn({
13473
+ init: initParams,
13474
+ context
13475
+ })
13476
+ };
13477
+ let body;
13478
+ if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
13479
+ body = overriddenInit.body;
13480
+ } else if (this.isJsonMime(headers["Content-Type"])) {
13481
+ body = JSON.stringify(overriddenInit.body);
13482
+ } else {
13483
+ body = overriddenInit.body;
13100
13484
  }
13485
+ const init = {
13486
+ ...overriddenInit,
13487
+ body
13488
+ };
13489
+ return { url, init };
13101
13490
  }
13102
- async downloadPolicyAsync(cloudOrigin, organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken) {
13103
- const policyUrl = `${cloudOrigin}/${organizationId}/roboticsops_` + `/api/Policy/license/${licenseType}/product/${profileKey}/tenant/${tenantId}`;
13104
- this.logger.info(t("info.downloading", { url: policyUrl }));
13105
- try {
13106
- const response = await this.fetchFn(policyUrl, {
13107
- headers: {
13108
- Authorization: `Bearer ${accessToken}`,
13109
- AccountId: organizationId
13110
- },
13111
- signal: cancellationToken
13112
- });
13113
- if (response.status === 204 || response.status === 404) {
13114
- this.logger.info(t("info.noPolicyFound"));
13115
- return null;
13116
- }
13117
- if (!response.ok) {
13118
- const body = await response.text();
13119
- this.logger.warn(t("errors.failedToGetPolicy", { content: body }));
13120
- return null;
13491
+ fetchApi = async (url, init) => {
13492
+ let fetchParams = { url, init };
13493
+ for (const middleware of this.middleware) {
13494
+ if (middleware.pre) {
13495
+ fetchParams = await middleware.pre({
13496
+ fetch: this.fetchApi,
13497
+ ...fetchParams
13498
+ }) || fetchParams;
13121
13499
  }
13122
- const content = await response.text();
13123
- if (!content?.trimStart().startsWith("{")) {
13124
- this.logger.info(t("info.responseNotJson"));
13125
- return null;
13126
- }
13127
- return content;
13128
- } catch (error) {
13129
- this.logger.warn(t("errors.failedToDownload", {
13130
- error: errorMessage(error)
13131
- }));
13132
- return null;
13133
13500
  }
13134
- }
13135
- async resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken) {
13136
- const isStudioWeb = profileKey === DEFAULT_PROFILE_KEY;
13137
- const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
13501
+ let response = undefined;
13138
13502
  try {
13139
- const response = await this.fetchFn(`${cloudUrl}${ACQUIRE_LICENSE_PATH}`, {
13140
- method: "POST",
13141
- headers: { Authorization: `Bearer ${accessToken}` },
13142
- signal: cancellationToken
13143
- });
13144
- if (!response.ok) {
13145
- this.logger.info(t("info.licenseStatus", {
13146
- status: response.status,
13147
- fallback
13148
- }));
13149
- return fallback;
13503
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
13504
+ } catch (e) {
13505
+ for (const middleware of this.middleware) {
13506
+ if (middleware.onError) {
13507
+ response = await middleware.onError({
13508
+ fetch: this.fetchApi,
13509
+ url: fetchParams.url,
13510
+ init: fetchParams.init,
13511
+ error: e,
13512
+ response: response ? response.clone() : undefined
13513
+ }) || response;
13514
+ }
13150
13515
  }
13151
- const { isLicensed, robotType } = await response.json();
13152
- this.logger.info(t("info.licenseResponse", {
13153
- isLicensed: String(isLicensed),
13154
- robotType: String(robotType)
13155
- }));
13156
- if (!isLicensed || !robotType) {
13157
- return fallback;
13516
+ if (response === undefined) {
13517
+ if (e instanceof Error) {
13518
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
13519
+ } else {
13520
+ throw e;
13521
+ }
13158
13522
  }
13159
- if (isStudioWeb) {
13160
- return robotType === LICENSE_TYPES.AutomationKit ? LICENSE_TYPES.AutomationKit : LICENSE_TYPES.NoLicense;
13523
+ }
13524
+ for (const middleware of this.middleware) {
13525
+ if (middleware.post) {
13526
+ response = await middleware.post({
13527
+ fetch: this.fetchApi,
13528
+ url: fetchParams.url,
13529
+ init: fetchParams.init,
13530
+ response: response.clone()
13531
+ }) || response;
13161
13532
  }
13162
- return robotType;
13163
- } catch (error) {
13164
- this.logger.info(t("info.licenseFailed", {
13165
- error: errorMessage(error),
13166
- fallback
13167
- }));
13168
- return fallback;
13169
13533
  }
13534
+ return response;
13535
+ };
13536
+ clone() {
13537
+ const constructor = this.constructor;
13538
+ const next = new constructor(this.configuration);
13539
+ next.middleware = this.middleware.slice();
13540
+ return next;
13170
13541
  }
13171
13542
  }
13172
- async function resolveProducedNupkgsAsync(fileSystem, packagePath) {
13173
- if (packagePath.toLowerCase().endsWith(".nupkg")) {
13174
- return [packagePath];
13175
- }
13176
- const stat22 = await fileSystem.stat(packagePath);
13177
- if (!stat22?.isDirectory()) {
13178
- return [];
13543
+ function isBlob(value) {
13544
+ return typeof Blob !== "undefined" && value instanceof Blob;
13545
+ }
13546
+ function isFormData(value) {
13547
+ return typeof FormData !== "undefined" && value instanceof FormData;
13548
+ }
13549
+
13550
+ class ResponseError extends Error {
13551
+ response;
13552
+ name = "ResponseError";
13553
+ constructor(response, msg) {
13554
+ super(msg);
13555
+ this.response = response;
13179
13556
  }
13180
- const candidateDirs = [packagePath, fileSystem.path.dirname(packagePath)];
13181
- for (const dir of candidateDirs) {
13182
- const entries = await fileSystem.readdir(dir);
13183
- const nupkgs = entries.filter((entry) => entry.toLowerCase().endsWith(".nupkg")).map((entry) => fileSystem.path.join(dir, entry));
13184
- if (nupkgs.length > 0) {
13185
- return nupkgs;
13186
- }
13557
+ }
13558
+
13559
+ class FetchError extends Error {
13560
+ cause;
13561
+ name = "FetchError";
13562
+ constructor(cause, msg) {
13563
+ super(msg);
13564
+ this.cause = cause;
13187
13565
  }
13188
- return [];
13189
13566
  }
13190
13567
 
13191
- class PackService {
13192
- disallowedCharsRegex = /[^\p{L}\p{N}_.-]/gu;
13193
- spacesDotRegex = /[\s.]+/g;
13194
- dotDashRegex = /\.{0,10}[-:]\.{0,10}/g;
13195
- MaxPackageIdLength = 100;
13196
- sanitizePackageId(packageId) {
13197
- packageId = packageId.trim();
13198
- packageId = packageId.replace(this.spacesDotRegex, ".");
13199
- packageId = packageId.replace(this.dotDashRegex, "-");
13200
- packageId = packageId.replace(this.disallowedCharsRegex, "_");
13201
- if (packageId.length > this.MaxPackageIdLength) {
13202
- throw new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
13203
- }
13204
- return packageId;
13568
+ class RequiredError extends Error {
13569
+ field;
13570
+ name = "RequiredError";
13571
+ constructor(field, msg) {
13572
+ super(msg);
13573
+ this.field = field;
13205
13574
  }
13206
13575
  }
13207
- async function signNupkgsAsync(signService, nupkgPaths, signingInfo) {
13208
- if (!signingInfo?.certificatePath) {
13209
- return ToolResult.success();
13576
+ function querystring(params, prefix = "") {
13577
+ return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
13578
+ }
13579
+ function querystringSingleKey(key, value, keyPrefix = "") {
13580
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
13581
+ if (value instanceof Array) {
13582
+ const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
13583
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
13210
13584
  }
13211
- if (!signService) {
13212
- return ToolResult.error(ToolErrorCodes.InternalError, "Package signing is required but signing service is not available. Package signing requires dotnet CLI to be installed in Node.js environment.");
13585
+ if (value instanceof Set) {
13586
+ const valueAsArray = Array.from(value);
13587
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
13213
13588
  }
13214
- const certificatePath = signingInfo.certificatePath;
13215
- const toSign = [...new Set(nupkgPaths)];
13216
- if (toSign.length === 0) {
13217
- return ToolResult.success();
13589
+ if (value instanceof Date) {
13590
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
13218
13591
  }
13219
- if (signService.signPackagesAsync) {
13220
- return signService.signPackagesAsync(toSign, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
13592
+ if (value instanceof Object) {
13593
+ return querystring(value, fullKey);
13221
13594
  }
13222
- for (const packagePath of toSign) {
13223
- const signResult = await signService.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
13224
- if (!signResult.isSuccess) {
13225
- return signResult;
13595
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
13596
+ }
13597
+ function canConsumeForm(consumes) {
13598
+ for (const consume of consumes) {
13599
+ if (consume.contentType === "multipart/form-data") {
13600
+ return true;
13226
13601
  }
13227
13602
  }
13228
- return ToolResult.success();
13603
+ return false;
13229
13604
  }
13230
13605
 
13231
- class PackagerParametersValidator {
13232
- logger;
13233
- fileSystem;
13234
- constructor(logger2, fileSystem) {
13235
- this.logger = logger2;
13606
+ class JSONApiResponse {
13607
+ raw;
13608
+ transformer;
13609
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
13610
+ this.raw = raw;
13611
+ this.transformer = transformer;
13612
+ }
13613
+ async value() {
13614
+ return this.transformer(await this.raw.json());
13615
+ }
13616
+ }
13617
+
13618
+ class VoidApiResponse {
13619
+ raw;
13620
+ constructor(raw) {
13621
+ this.raw = raw;
13622
+ }
13623
+ async value() {
13624
+ return;
13625
+ }
13626
+ }
13627
+
13628
+ class TextApiResponse {
13629
+ raw;
13630
+ constructor(raw) {
13631
+ this.raw = raw;
13632
+ }
13633
+ async value() {
13634
+ return await this.raw.text();
13635
+ }
13636
+ }
13637
+ function ProductDtoFromJSON(json2) {
13638
+ return ProductDtoFromJSONTyped(json2, false);
13639
+ }
13640
+ function ProductDtoFromJSONTyped(json2, ignoreDiscriminator) {
13641
+ if (json2 == null) {
13642
+ return json2;
13643
+ }
13644
+ return {
13645
+ name: json2["name"] == null ? undefined : json2["name"],
13646
+ label: json2["label"] == null ? undefined : json2["label"],
13647
+ isRestricted: json2["isRestricted"] == null ? undefined : json2["isRestricted"],
13648
+ isCloud: json2["isCloud"] == null ? undefined : json2["isCloud"],
13649
+ isRemote: json2["isRemote"] == null ? undefined : json2["isRemote"]
13650
+ };
13651
+ }
13652
+ function ProductDtoToJSON(json2) {
13653
+ return ProductDtoToJSONTyped(json2, false);
13654
+ }
13655
+ function ProductDtoToJSONTyped(value, ignoreDiscriminator = false) {
13656
+ if (value == null) {
13657
+ return value;
13658
+ }
13659
+ return {
13660
+ name: value["name"],
13661
+ label: value["label"],
13662
+ isRestricted: value["isRestricted"],
13663
+ isCloud: value["isCloud"],
13664
+ isRemote: value["isRemote"]
13665
+ };
13666
+ }
13667
+ function GlobalPolicyDtoFromJSON(json2) {
13668
+ return GlobalPolicyDtoFromJSONTyped(json2, false);
13669
+ }
13670
+ function GlobalPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13671
+ if (json2 == null) {
13672
+ return json2;
13673
+ }
13674
+ return {
13675
+ licenseType: json2["licenseType"] == null ? undefined : json2["licenseType"],
13676
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13677
+ policyNumber: json2["policyNumber"] == null ? undefined : json2["policyNumber"],
13678
+ product: json2["product"] == null ? undefined : ProductDtoFromJSON(json2["product"]),
13679
+ data: json2["data"] == null ? undefined : json2["data"]
13680
+ };
13681
+ }
13682
+ function GlobalPolicyDtoToJSON(json2) {
13683
+ return GlobalPolicyDtoToJSONTyped(json2, false);
13684
+ }
13685
+ function GlobalPolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
13686
+ if (value == null) {
13687
+ return value;
13688
+ }
13689
+ return {
13690
+ licenseType: value["licenseType"],
13691
+ identifier: value["identifier"],
13692
+ policyNumber: value["policyNumber"],
13693
+ product: ProductDtoToJSON(value["product"]),
13694
+ data: value["data"]
13695
+ };
13696
+ }
13697
+ function CreateGlobalPolicyWithFormDataRequestToJSON(json2) {
13698
+ return CreateGlobalPolicyWithFormDataRequestToJSONTyped(json2, false);
13699
+ }
13700
+ function CreateGlobalPolicyWithFormDataRequestToJSONTyped(value, ignoreDiscriminator = false) {
13701
+ if (value == null) {
13702
+ return value;
13703
+ }
13704
+ return {
13705
+ globalPolicy: GlobalPolicyDtoToJSON(value["globalPolicy"])
13706
+ };
13707
+ }
13708
+ function CreatePolicyRequestToJSON(json2) {
13709
+ return CreatePolicyRequestToJSONTyped(json2, false);
13710
+ }
13711
+ function CreatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
13712
+ if (value == null) {
13713
+ return value;
13714
+ }
13715
+ return {
13716
+ name: value["name"],
13717
+ description: value["description"],
13718
+ priority: value["priority"],
13719
+ availability: value["availability"],
13720
+ productName: value["productName"],
13721
+ data: value["data"]
13722
+ };
13723
+ }
13724
+ function FormDataDtoFromJSON(json2) {
13725
+ return FormDataDtoFromJSONTyped(json2, false);
13726
+ }
13727
+ function FormDataDtoFromJSONTyped(json2, ignoreDiscriminator) {
13728
+ if (json2 == null) {
13729
+ return json2;
13730
+ }
13731
+ return {
13732
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
13733
+ data: json2["data"] == null ? undefined : json2["data"]
13734
+ };
13735
+ }
13736
+ function FormDataDtoToJSON(json2) {
13737
+ return FormDataDtoToJSONTyped(json2, false);
13738
+ }
13739
+ function FormDataDtoToJSONTyped(value, ignoreDiscriminator = false) {
13740
+ if (value == null) {
13741
+ return value;
13742
+ }
13743
+ return {
13744
+ policyIdentifier: value["policyIdentifier"],
13745
+ data: value["data"]
13746
+ };
13747
+ }
13748
+ function PolicyDtoFromJSON(json2) {
13749
+ return PolicyDtoFromJSONTyped(json2, false);
13750
+ }
13751
+ function PolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13752
+ if (json2 == null) {
13753
+ return json2;
13754
+ }
13755
+ return {
13756
+ name: json2["name"] == null ? undefined : json2["name"],
13757
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13758
+ description: json2["description"] == null ? undefined : json2["description"],
13759
+ priority: json2["priority"] == null ? undefined : json2["priority"],
13760
+ availability: json2["availability"] == null ? undefined : json2["availability"],
13761
+ product: json2["product"] == null ? undefined : ProductDtoFromJSON(json2["product"]),
13762
+ data: json2["data"] == null ? undefined : FormDataDtoFromJSON(json2["data"])
13763
+ };
13764
+ }
13765
+ function PolicyDtoToJSON(json2) {
13766
+ return PolicyDtoToJSONTyped(json2, false);
13767
+ }
13768
+ function PolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
13769
+ if (value == null) {
13770
+ return value;
13771
+ }
13772
+ return {
13773
+ name: value["name"],
13774
+ identifier: value["identifier"],
13775
+ description: value["description"],
13776
+ priority: value["priority"],
13777
+ availability: value["availability"],
13778
+ product: ProductDtoToJSON(value["product"]),
13779
+ data: FormDataDtoToJSON(value["data"])
13780
+ };
13781
+ }
13782
+ function CreatePolicyWithFormDataRequestToJSON(json2) {
13783
+ return CreatePolicyWithFormDataRequestToJSONTyped(json2, false);
13784
+ }
13785
+ function CreatePolicyWithFormDataRequestToJSONTyped(value, ignoreDiscriminator = false) {
13786
+ if (value == null) {
13787
+ return value;
13788
+ }
13789
+ return {
13790
+ policy: PolicyDtoToJSON(value["policy"]),
13791
+ policyFormData: FormDataDtoToJSON(value["policyFormData"])
13792
+ };
13793
+ }
13794
+ function DeployedPolicyDtoToJSON(json2) {
13795
+ return DeployedPolicyDtoToJSONTyped(json2, false);
13796
+ }
13797
+ function DeployedPolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
13798
+ if (value == null) {
13799
+ return value;
13800
+ }
13801
+ return {
13802
+ licenseType: value["licenseType"],
13803
+ productName: value["productName"],
13804
+ tenantIdentifier: value["tenantIdentifier"],
13805
+ userIdentifier: value["userIdentifier"]
13806
+ };
13807
+ }
13808
+ function DeployedPolicyWithoutUserDtoToJSON(json2) {
13809
+ return DeployedPolicyWithoutUserDtoToJSONTyped(json2, false);
13810
+ }
13811
+ function DeployedPolicyWithoutUserDtoToJSONTyped(value, ignoreDiscriminator = false) {
13812
+ if (value == null) {
13813
+ return value;
13814
+ }
13815
+ return {
13816
+ licenseType: value["licenseType"],
13817
+ productName: value["productName"],
13818
+ tenantIdentifier: value["tenantIdentifier"]
13819
+ };
13820
+ }
13821
+ function DeploymentLevelFromJSON(json2) {
13822
+ return DeploymentLevelFromJSONTyped(json2, false);
13823
+ }
13824
+ function DeploymentLevelFromJSONTyped(json2, ignoreDiscriminator) {
13825
+ return json2;
13826
+ }
13827
+ function TenantPolicyDtoFromJSON(json2) {
13828
+ return TenantPolicyDtoFromJSONTyped(json2, false);
13829
+ }
13830
+ function TenantPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13831
+ if (json2 == null) {
13832
+ return json2;
13833
+ }
13834
+ return {
13835
+ tenantIdentifier: json2["tenantIdentifier"] == null ? undefined : json2["tenantIdentifier"],
13836
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
13837
+ productIdentifier: json2["productIdentifier"] == null ? undefined : json2["productIdentifier"],
13838
+ licenseTypeIdentifier: json2["licenseTypeIdentifier"] == null ? undefined : json2["licenseTypeIdentifier"],
13839
+ tenantName: json2["tenantName"] == null ? undefined : json2["tenantName"]
13840
+ };
13841
+ }
13842
+ function GroupPolicyDtoFromJSON(json2) {
13843
+ return GroupPolicyDtoFromJSONTyped(json2, false);
13844
+ }
13845
+ function GroupPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13846
+ if (json2 == null) {
13847
+ return json2;
13848
+ }
13849
+ return {
13850
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
13851
+ productIdentifier: json2["productIdentifier"] == null ? undefined : json2["productIdentifier"],
13852
+ groupId: json2["groupId"] == null ? undefined : json2["groupId"],
13853
+ groupName: json2["groupName"] == null ? undefined : json2["groupName"]
13854
+ };
13855
+ }
13856
+ function UserPolicyDtoFromJSON(json2) {
13857
+ return UserPolicyDtoFromJSONTyped(json2, false);
13858
+ }
13859
+ function UserPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13860
+ if (json2 == null) {
13861
+ return json2;
13862
+ }
13863
+ return {
13864
+ policyIdentifier: json2["policyIdentifier"] == null ? undefined : json2["policyIdentifier"],
13865
+ productIdentifier: json2["productIdentifier"] == null ? undefined : json2["productIdentifier"],
13866
+ userId: json2["userId"] == null ? undefined : json2["userId"],
13867
+ userName: json2["userName"] == null ? undefined : json2["userName"]
13868
+ };
13869
+ }
13870
+ function FederatedPolicyDtoFromJSON(json2) {
13871
+ return FederatedPolicyDtoFromJSONTyped(json2, false);
13872
+ }
13873
+ function FederatedPolicyDtoFromJSONTyped(json2, ignoreDiscriminator) {
13874
+ if (json2 == null) {
13875
+ return json2;
13876
+ }
13877
+ return {
13878
+ name: json2["name"] == null ? undefined : json2["name"],
13879
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13880
+ product: json2["product"] == null ? undefined : ProductDtoFromJSON(json2["product"]),
13881
+ description: json2["description"] == null ? undefined : json2["description"],
13882
+ priority: json2["priority"] == null ? undefined : json2["priority"],
13883
+ availability: json2["availability"] == null ? undefined : json2["availability"],
13884
+ tenantPolicies: json2["tenantPolicies"] == null ? undefined : json2["tenantPolicies"].map(TenantPolicyDtoFromJSON),
13885
+ userPolicies: json2["userPolicies"] == null ? undefined : json2["userPolicies"].map(UserPolicyDtoFromJSON),
13886
+ groupPolicies: json2["groupPolicies"] == null ? undefined : json2["groupPolicies"].map(GroupPolicyDtoFromJSON)
13887
+ };
13888
+ }
13889
+ function FederatedPolicyDtoPagedResultFromJSON(json2) {
13890
+ return FederatedPolicyDtoPagedResultFromJSONTyped(json2, false);
13891
+ }
13892
+ function FederatedPolicyDtoPagedResultFromJSONTyped(json2, ignoreDiscriminator) {
13893
+ if (json2 == null) {
13894
+ return json2;
13895
+ }
13896
+ return {
13897
+ totalCount: json2["totalCount"] == null ? undefined : json2["totalCount"],
13898
+ result: json2["result"] == null ? undefined : json2["result"].map(FederatedPolicyDtoFromJSON)
13899
+ };
13900
+ }
13901
+ function ImportPolicyRequestFromJSON(json2) {
13902
+ return ImportPolicyRequestFromJSONTyped(json2, false);
13903
+ }
13904
+ function ImportPolicyRequestFromJSONTyped(json2, ignoreDiscriminator) {
13905
+ if (json2 == null) {
13906
+ return json2;
13907
+ }
13908
+ return {
13909
+ productName: json2["product-name"] == null ? undefined : json2["product-name"],
13910
+ policyName: json2["policy-name"] == null ? undefined : json2["policy-name"],
13911
+ version: json2["version"] == null ? undefined : json2["version"],
13912
+ data: json2["data"] == null ? undefined : json2["data"]
13913
+ };
13914
+ }
13915
+ function PolicyDtoPagedResultFromJSON(json2) {
13916
+ return PolicyDtoPagedResultFromJSONTyped(json2, false);
13917
+ }
13918
+ function PolicyDtoPagedResultFromJSONTyped(json2, ignoreDiscriminator) {
13919
+ if (json2 == null) {
13920
+ return json2;
13921
+ }
13922
+ return {
13923
+ totalCount: json2["totalCount"] == null ? undefined : json2["totalCount"],
13924
+ result: json2["result"] == null ? undefined : json2["result"].map(PolicyDtoFromJSON)
13925
+ };
13926
+ }
13927
+ function PolicyExportResponseFromJSON(json2) {
13928
+ return PolicyExportResponseFromJSONTyped(json2, false);
13929
+ }
13930
+ function PolicyExportResponseFromJSONTyped(json2, ignoreDiscriminator) {
13931
+ if (json2 == null) {
13932
+ return json2;
13933
+ }
13934
+ return {
13935
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13936
+ name: json2["name"] == null ? undefined : json2["name"],
13937
+ availability: json2["availability"] == null ? undefined : json2["availability"],
13938
+ data: json2["data"] == null ? undefined : json2["data"],
13939
+ priority: json2["priority"] == null ? undefined : json2["priority"],
13940
+ deploymentLevel: json2["deploymentLevel"] == null ? undefined : DeploymentLevelFromJSON(json2["deploymentLevel"])
13941
+ };
13942
+ }
13943
+ function PolicyInfoDtoFromJSON(json2) {
13944
+ return PolicyInfoDtoFromJSONTyped(json2, false);
13945
+ }
13946
+ function PolicyInfoDtoFromJSONTyped(json2, ignoreDiscriminator) {
13947
+ if (json2 == null) {
13948
+ return json2;
13949
+ }
13950
+ return {
13951
+ name: json2["name"] == null ? undefined : json2["name"],
13952
+ identifier: json2["identifier"] == null ? undefined : json2["identifier"],
13953
+ product: json2["product"] == null ? undefined : json2["product"]
13954
+ };
13955
+ }
13956
+ function PolicyUsageDataFromJSON(json2) {
13957
+ return PolicyUsageDataFromJSONTyped(json2, false);
13958
+ }
13959
+ function PolicyUsageDataFromJSONTyped(json2, ignoreDiscriminator) {
13960
+ if (json2 == null) {
13961
+ return json2;
13962
+ }
13963
+ return {
13964
+ tenants: json2["tenants"] == null ? undefined : json2["tenants"],
13965
+ users: json2["users"] == null ? undefined : json2["users"],
13966
+ groups: json2["groups"] == null ? undefined : json2["groups"]
13967
+ };
13968
+ }
13969
+ function UpdatePolicyRequestToJSON(json2) {
13970
+ return UpdatePolicyRequestToJSONTyped(json2, false);
13971
+ }
13972
+ function UpdatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
13973
+ if (value == null) {
13974
+ return value;
13975
+ }
13976
+ return {
13977
+ name: value["name"],
13978
+ identifier: value["identifier"],
13979
+ description: value["description"],
13980
+ priority: value["priority"],
13981
+ availability: value["availability"],
13982
+ productName: value["productName"],
13983
+ data: value["data"]
13984
+ };
13985
+ }
13986
+
13987
+ class PolicyApi extends BaseAPI {
13988
+ async policyCreateDefaultPolicyForAllProductsRaw(initOverrides) {
13989
+ const queryParameters = {};
13990
+ const headerParameters = {};
13991
+ if (this.configuration && this.configuration.apiKey) {
13992
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
13993
+ }
13994
+ let urlPath = `/api/Policy/default`;
13995
+ const response = await this.request({
13996
+ path: urlPath,
13997
+ method: "POST",
13998
+ headers: headerParameters,
13999
+ query: queryParameters
14000
+ }, initOverrides);
14001
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14002
+ }
14003
+ async policyCreateDefaultPolicyForAllProducts(initOverrides) {
14004
+ const response = await this.policyCreateDefaultPolicyForAllProductsRaw(initOverrides);
14005
+ return await response.value();
14006
+ }
14007
+ async policyCreateFormDataRaw(requestParameters, initOverrides) {
14008
+ if (requestParameters["policyIdentifier"] == null) {
14009
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyCreateFormData().');
14010
+ }
14011
+ const queryParameters = {};
14012
+ const headerParameters = {};
14013
+ headerParameters["Content-Type"] = "application/json";
14014
+ if (this.configuration && this.configuration.apiKey) {
14015
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14016
+ }
14017
+ let urlPath = `/api/Policy/form-data/{policyIdentifier}`;
14018
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14019
+ const response = await this.request({
14020
+ path: urlPath,
14021
+ method: "PUT",
14022
+ headers: headerParameters,
14023
+ query: queryParameters,
14024
+ body: requestParameters["body"]
14025
+ }, initOverrides);
14026
+ if (this.isJsonMime(response.headers.get("content-type"))) {
14027
+ return new JSONApiResponse(response);
14028
+ } else {
14029
+ return new TextApiResponse(response);
14030
+ }
14031
+ }
14032
+ async policyCreateFormData(requestParameters, initOverrides) {
14033
+ const response = await this.policyCreateFormDataRaw(requestParameters, initOverrides);
14034
+ return await response.value();
14035
+ }
14036
+ async policyCreateGlobalPolicyRaw(requestParameters, initOverrides) {
14037
+ const queryParameters = {};
14038
+ const headerParameters = {};
14039
+ headerParameters["Content-Type"] = "application/json";
14040
+ if (this.configuration && this.configuration.apiKey) {
14041
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14042
+ }
14043
+ let urlPath = `/api/Policy/global`;
14044
+ const response = await this.request({
14045
+ path: urlPath,
14046
+ method: "POST",
14047
+ headers: headerParameters,
14048
+ query: queryParameters,
14049
+ body: CreateGlobalPolicyWithFormDataRequestToJSON(requestParameters["createGlobalPolicyWithFormDataRequest"])
14050
+ }, initOverrides);
14051
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
14052
+ }
14053
+ async policyCreateGlobalPolicy(requestParameters = {}, initOverrides) {
14054
+ const response = await this.policyCreateGlobalPolicyRaw(requestParameters, initOverrides);
14055
+ return await response.value();
14056
+ }
14057
+ async policyCreatePolicyRaw(requestParameters, initOverrides) {
14058
+ const queryParameters = {};
14059
+ if (requestParameters["telemetryFlowId"] != null) {
14060
+ queryParameters["telemetryFlowId"] = requestParameters["telemetryFlowId"];
14061
+ }
14062
+ const headerParameters = {};
14063
+ headerParameters["Content-Type"] = "application/json";
14064
+ if (this.configuration && this.configuration.apiKey) {
14065
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14066
+ }
14067
+ let urlPath = `/api/Policy`;
14068
+ const response = await this.request({
14069
+ path: urlPath,
14070
+ method: "POST",
14071
+ headers: headerParameters,
14072
+ query: queryParameters,
14073
+ body: CreatePolicyWithFormDataRequestToJSON(requestParameters["createPolicyWithFormDataRequest"])
14074
+ }, initOverrides);
14075
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14076
+ }
14077
+ async policyCreatePolicy(requestParameters = {}, initOverrides) {
14078
+ const response = await this.policyCreatePolicyRaw(requestParameters, initOverrides);
14079
+ return await response.value();
14080
+ }
14081
+ async policyCreatePolicyV2Raw(requestParameters, initOverrides) {
14082
+ const queryParameters = {};
14083
+ if (requestParameters["telemetryFlowId"] != null) {
14084
+ queryParameters["telemetryFlowId"] = requestParameters["telemetryFlowId"];
14085
+ }
14086
+ const headerParameters = {};
14087
+ headerParameters["Content-Type"] = "application/json";
14088
+ if (this.configuration && this.configuration.apiKey) {
14089
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14090
+ }
14091
+ let urlPath = `/api/Policy/v2/create`;
14092
+ const response = await this.request({
14093
+ path: urlPath,
14094
+ method: "POST",
14095
+ headers: headerParameters,
14096
+ query: queryParameters,
14097
+ body: CreatePolicyRequestToJSON(requestParameters["createPolicyRequest"])
14098
+ }, initOverrides);
14099
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14100
+ }
14101
+ async policyCreatePolicyV2(requestParameters = {}, initOverrides) {
14102
+ const response = await this.policyCreatePolicyV2Raw(requestParameters, initOverrides);
14103
+ return await response.value();
14104
+ }
14105
+ async policyDeletePolicyRaw(requestParameters, initOverrides) {
14106
+ if (requestParameters["policyIdentifier"] == null) {
14107
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyDeletePolicy().');
14108
+ }
14109
+ const queryParameters = {};
14110
+ const headerParameters = {};
14111
+ if (this.configuration && this.configuration.apiKey) {
14112
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14113
+ }
14114
+ let urlPath = `/api/Policy/{policyIdentifier}`;
14115
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14116
+ const response = await this.request({
14117
+ path: urlPath,
14118
+ method: "DELETE",
14119
+ headers: headerParameters,
14120
+ query: queryParameters
14121
+ }, initOverrides);
14122
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14123
+ }
14124
+ async policyDeletePolicy(requestParameters, initOverrides) {
14125
+ const response = await this.policyDeletePolicyRaw(requestParameters, initOverrides);
14126
+ return await response.value();
14127
+ }
14128
+ async policyDeletePolicyByProductNameAndPolicyNameRaw(requestParameters, initOverrides) {
14129
+ if (requestParameters["productName"] == null) {
14130
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyDeletePolicyByProductNameAndPolicyName().');
14131
+ }
14132
+ if (requestParameters["policyName"] == null) {
14133
+ throw new RequiredError("policyName", 'Required parameter "policyName" was null or undefined when calling policyDeletePolicyByProductNameAndPolicyName().');
14134
+ }
14135
+ const queryParameters = {};
14136
+ const headerParameters = {};
14137
+ if (this.configuration && this.configuration.apiKey) {
14138
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14139
+ }
14140
+ let urlPath = `/api/Policy/product/{productName}/policy/{policyName}`;
14141
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
14142
+ urlPath = urlPath.replace(`{${"policyName"}}`, encodeURIComponent(String(requestParameters["policyName"])));
14143
+ const response = await this.request({
14144
+ path: urlPath,
14145
+ method: "DELETE",
14146
+ headers: headerParameters,
14147
+ query: queryParameters
14148
+ }, initOverrides);
14149
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14150
+ }
14151
+ async policyDeletePolicyByProductNameAndPolicyName(requestParameters, initOverrides) {
14152
+ const response = await this.policyDeletePolicyByProductNameAndPolicyNameRaw(requestParameters, initOverrides);
14153
+ return await response.value();
14154
+ }
14155
+ async policyDownloadPolicyByIdentifierRaw(requestParameters, initOverrides) {
14156
+ if (requestParameters["policyIdentifier"] == null) {
14157
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyDownloadPolicyByIdentifier().');
14158
+ }
14159
+ const queryParameters = {};
14160
+ const headerParameters = {};
14161
+ if (this.configuration && this.configuration.apiKey) {
14162
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14163
+ }
14164
+ let urlPath = `/api/Policy/{policyIdentifier}/download`;
14165
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14166
+ const response = await this.request({
14167
+ path: urlPath,
14168
+ method: "GET",
14169
+ headers: headerParameters,
14170
+ query: queryParameters
14171
+ }, initOverrides);
14172
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
14173
+ }
14174
+ async policyDownloadPolicyByIdentifier(requestParameters, initOverrides) {
14175
+ const response = await this.policyDownloadPolicyByIdentifierRaw(requestParameters, initOverrides);
14176
+ return await response.value();
14177
+ }
14178
+ async policyGetAllPoliciesRaw(initOverrides) {
14179
+ const queryParameters = {};
14180
+ const headerParameters = {};
14181
+ if (this.configuration && this.configuration.apiKey) {
14182
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14183
+ }
14184
+ let urlPath = `/api/Policy`;
14185
+ const response = await this.request({
14186
+ path: urlPath,
14187
+ method: "GET",
14188
+ headers: headerParameters,
14189
+ query: queryParameters
14190
+ }, initOverrides);
14191
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyDtoFromJSON));
14192
+ }
14193
+ async policyGetAllPolicies(initOverrides) {
14194
+ const response = await this.policyGetAllPoliciesRaw(initOverrides);
14195
+ return await response.value();
14196
+ }
14197
+ async policyGetAllPoliciesByProductIdRaw(requestParameters, initOverrides) {
14198
+ if (requestParameters["productIdentifier"] == null) {
14199
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetAllPoliciesByProductId().');
14200
+ }
14201
+ const queryParameters = {};
14202
+ const headerParameters = {};
14203
+ if (this.configuration && this.configuration.apiKey) {
14204
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14205
+ }
14206
+ let urlPath = `/api/Policy/{productIdentifier}`;
14207
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
14208
+ const response = await this.request({
14209
+ path: urlPath,
14210
+ method: "GET",
14211
+ headers: headerParameters,
14212
+ query: queryParameters
14213
+ }, initOverrides);
14214
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyDtoFromJSON));
14215
+ }
14216
+ async policyGetAllPoliciesByProductId(requestParameters, initOverrides) {
14217
+ const response = await this.policyGetAllPoliciesByProductIdRaw(requestParameters, initOverrides);
14218
+ return await response.value();
14219
+ }
14220
+ async policyGetAllPoliciesByQueryOptionsRaw(requestParameters, initOverrides) {
14221
+ const queryParameters = {};
14222
+ if (requestParameters["productLabel"] != null) {
14223
+ queryParameters["productLabel"] = requestParameters["productLabel"];
14224
+ }
14225
+ if (requestParameters["productName"] != null) {
14226
+ queryParameters["productName"] = requestParameters["productName"];
14227
+ }
14228
+ if (requestParameters["productNames"] != null) {
14229
+ queryParameters["productNames"] = requestParameters["productNames"];
14230
+ }
14231
+ if (requestParameters["sortBy"] != null) {
14232
+ queryParameters["sortBy"] = requestParameters["sortBy"];
14233
+ }
14234
+ if (requestParameters["sortOrder"] != null) {
14235
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
14236
+ }
14237
+ if (requestParameters["pageIndex"] != null) {
14238
+ queryParameters["pageIndex"] = requestParameters["pageIndex"];
14239
+ }
14240
+ if (requestParameters["pageSize"] != null) {
14241
+ queryParameters["pageSize"] = requestParameters["pageSize"];
14242
+ }
14243
+ if (requestParameters["searchTerm"] != null) {
14244
+ queryParameters["searchTerm"] = requestParameters["searchTerm"];
14245
+ }
14246
+ const headerParameters = {};
14247
+ if (this.configuration && this.configuration.apiKey) {
14248
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14249
+ }
14250
+ let urlPath = `/api/Policy/paged`;
14251
+ const response = await this.request({
14252
+ path: urlPath,
14253
+ method: "GET",
14254
+ headers: headerParameters,
14255
+ query: queryParameters
14256
+ }, initOverrides);
14257
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoPagedResultFromJSON(jsonValue));
14258
+ }
14259
+ async policyGetAllPoliciesByQueryOptions(requestParameters = {}, initOverrides) {
14260
+ const response = await this.policyGetAllPoliciesByQueryOptionsRaw(requestParameters, initOverrides);
14261
+ return await response.value();
14262
+ }
14263
+ async policyGetAllRulesForProductRaw(requestParameters, initOverrides) {
14264
+ if (requestParameters["licenseType"] == null) {
14265
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetAllRulesForProduct().');
14266
+ }
14267
+ if (requestParameters["productName"] == null) {
14268
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyGetAllRulesForProduct().');
14269
+ }
14270
+ if (requestParameters["tenantIdentifier"] == null) {
14271
+ throw new RequiredError("tenantIdentifier", 'Required parameter "tenantIdentifier" was null or undefined when calling policyGetAllRulesForProduct().');
14272
+ }
14273
+ const queryParameters = {};
14274
+ const headerParameters = {};
14275
+ if (this.configuration && this.configuration.apiKey) {
14276
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14277
+ }
14278
+ let urlPath = `/api/Policy/all/license/{licenseType}/product/{productName}/tenant/{tenantIdentifier}`;
14279
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
14280
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
14281
+ urlPath = urlPath.replace(`{${"tenantIdentifier"}}`, encodeURIComponent(String(requestParameters["tenantIdentifier"])));
14282
+ const response = await this.request({
14283
+ path: urlPath,
14284
+ method: "GET",
14285
+ headers: headerParameters,
14286
+ query: queryParameters
14287
+ }, initOverrides);
14288
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyExportResponseFromJSON));
14289
+ }
14290
+ async policyGetAllRulesForProduct(requestParameters, initOverrides) {
14291
+ const response = await this.policyGetAllRulesForProductRaw(requestParameters, initOverrides);
14292
+ return await response.value();
14293
+ }
14294
+ async policyGetDeployedPolicyRaw(requestParameters, initOverrides) {
14295
+ const queryParameters = {};
14296
+ const headerParameters = {};
14297
+ headerParameters["Content-Type"] = "application/json";
14298
+ if (requestParameters["xUiPathClientVersion"] != null) {
14299
+ headerParameters["x-UiPath-ClientVersion"] = String(requestParameters["xUiPathClientVersion"]);
14300
+ }
14301
+ if (this.configuration && this.configuration.apiKey) {
14302
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14303
+ }
14304
+ let urlPath = `/api/Policy/deployed-policy`;
14305
+ const response = await this.request({
14306
+ path: urlPath,
14307
+ method: "POST",
14308
+ headers: headerParameters,
14309
+ query: queryParameters,
14310
+ body: DeployedPolicyDtoToJSON(requestParameters["deployedPolicyDto"])
14311
+ }, initOverrides);
14312
+ return new VoidApiResponse(response);
14313
+ }
14314
+ async policyGetDeployedPolicy(requestParameters = {}, initOverrides) {
14315
+ await this.policyGetDeployedPolicyRaw(requestParameters, initOverrides);
14316
+ }
14317
+ async policyGetDeployedTenantPoliciesRaw(requestParameters, initOverrides) {
14318
+ const queryParameters = {};
14319
+ const headerParameters = {};
14320
+ headerParameters["Content-Type"] = "application/json";
14321
+ if (requestParameters["xUiPathClientVersion"] != null) {
14322
+ headerParameters["x-UiPath-ClientVersion"] = String(requestParameters["xUiPathClientVersion"]);
14323
+ }
14324
+ if (this.configuration && this.configuration.apiKey) {
14325
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14326
+ }
14327
+ let urlPath = `/api/Policy/deployed-policy/tenant`;
14328
+ const response = await this.request({
14329
+ path: urlPath,
14330
+ method: "POST",
14331
+ headers: headerParameters,
14332
+ query: queryParameters,
14333
+ body: DeployedPolicyWithoutUserDtoToJSON(requestParameters["deployedPolicyWithoutUserDto"])
14334
+ }, initOverrides);
14335
+ return new VoidApiResponse(response);
14336
+ }
14337
+ async policyGetDeployedTenantPolicies(requestParameters = {}, initOverrides) {
14338
+ await this.policyGetDeployedTenantPoliciesRaw(requestParameters, initOverrides);
14339
+ }
14340
+ async policyGetFederatedPoliciesByQueryOptionsRaw(requestParameters, initOverrides) {
14341
+ const queryParameters = {};
14342
+ if (requestParameters["productLabel"] != null) {
14343
+ queryParameters["productLabel"] = requestParameters["productLabel"];
14344
+ }
14345
+ if (requestParameters["productName"] != null) {
14346
+ queryParameters["productName"] = requestParameters["productName"];
14347
+ }
14348
+ if (requestParameters["productNames"] != null) {
14349
+ queryParameters["productNames"] = requestParameters["productNames"];
14350
+ }
14351
+ if (requestParameters["sortBy"] != null) {
14352
+ queryParameters["sortBy"] = requestParameters["sortBy"];
14353
+ }
14354
+ if (requestParameters["sortOrder"] != null) {
14355
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
14356
+ }
14357
+ if (requestParameters["pageIndex"] != null) {
14358
+ queryParameters["pageIndex"] = requestParameters["pageIndex"];
14359
+ }
14360
+ if (requestParameters["pageSize"] != null) {
14361
+ queryParameters["pageSize"] = requestParameters["pageSize"];
14362
+ }
14363
+ if (requestParameters["searchTerm"] != null) {
14364
+ queryParameters["searchTerm"] = requestParameters["searchTerm"];
14365
+ }
14366
+ const headerParameters = {};
14367
+ if (this.configuration && this.configuration.apiKey) {
14368
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14369
+ }
14370
+ let urlPath = `/api/Policy/federated/paged`;
14371
+ const response = await this.request({
14372
+ path: urlPath,
14373
+ method: "GET",
14374
+ headers: headerParameters,
14375
+ query: queryParameters
14376
+ }, initOverrides);
14377
+ return new JSONApiResponse(response, (jsonValue) => FederatedPolicyDtoPagedResultFromJSON(jsonValue));
14378
+ }
14379
+ async policyGetFederatedPoliciesByQueryOptions(requestParameters = {}, initOverrides) {
14380
+ const response = await this.policyGetFederatedPoliciesByQueryOptionsRaw(requestParameters, initOverrides);
14381
+ return await response.value();
14382
+ }
14383
+ async policyGetFormDataByPolicyIdRaw(requestParameters, initOverrides) {
14384
+ if (requestParameters["policyIdentifier"] == null) {
14385
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetFormDataByPolicyId().');
14386
+ }
14387
+ const queryParameters = {};
14388
+ const headerParameters = {};
14389
+ if (this.configuration && this.configuration.apiKey) {
14390
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14391
+ }
14392
+ let urlPath = `/api/Policy/form-data/{policyIdentifier}`;
14393
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14394
+ const response = await this.request({
14395
+ path: urlPath,
14396
+ method: "GET",
14397
+ headers: headerParameters,
14398
+ query: queryParameters
14399
+ }, initOverrides);
14400
+ if (this.isJsonMime(response.headers.get("content-type"))) {
14401
+ return new JSONApiResponse(response);
14402
+ } else {
14403
+ return new TextApiResponse(response);
14404
+ }
14405
+ }
14406
+ async policyGetFormDataByPolicyId(requestParameters, initOverrides) {
14407
+ const response = await this.policyGetFormDataByPolicyIdRaw(requestParameters, initOverrides);
14408
+ return await response.value();
14409
+ }
14410
+ async policyGetGlobalPolicyByLicenseTypeAndProductNameRaw(requestParameters, initOverrides) {
14411
+ if (requestParameters["licenseType"] == null) {
14412
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetGlobalPolicyByLicenseTypeAndProductName().');
14413
+ }
14414
+ if (requestParameters["productIdentifier"] == null) {
14415
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetGlobalPolicyByLicenseTypeAndProductName().');
14416
+ }
14417
+ const queryParameters = {};
14418
+ const headerParameters = {};
14419
+ if (this.configuration && this.configuration.apiKey) {
14420
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14421
+ }
14422
+ let urlPath = `/api/Policy/global/license/{licenseType}/product/{productIdentifier}`;
14423
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
14424
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
14425
+ const response = await this.request({
14426
+ path: urlPath,
14427
+ method: "GET",
14428
+ headers: headerParameters,
14429
+ query: queryParameters
14430
+ }, initOverrides);
14431
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
14432
+ }
14433
+ async policyGetGlobalPolicyByLicenseTypeAndProductName(requestParameters, initOverrides) {
14434
+ const response = await this.policyGetGlobalPolicyByLicenseTypeAndProductNameRaw(requestParameters, initOverrides);
14435
+ return await response.value();
14436
+ }
14437
+ async policyGetGroupPoliciesForAllProductsRaw(requestParameters, initOverrides) {
14438
+ if (requestParameters["identifier"] == null) {
14439
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetGroupPoliciesForAllProducts().');
14440
+ }
14441
+ const queryParameters = {};
14442
+ const headerParameters = {};
14443
+ if (this.configuration && this.configuration.apiKey) {
14444
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14445
+ }
14446
+ let urlPath = `/api/Policy/group/{identifier}`;
14447
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
14448
+ const response = await this.request({
14449
+ path: urlPath,
14450
+ method: "GET",
14451
+ headers: headerParameters,
14452
+ query: queryParameters
14453
+ }, initOverrides);
14454
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(GroupPolicyDtoFromJSON));
14455
+ }
14456
+ async policyGetGroupPoliciesForAllProducts(requestParameters, initOverrides) {
14457
+ const response = await this.policyGetGroupPoliciesForAllProductsRaw(requestParameters, initOverrides);
14458
+ return await response.value();
14459
+ }
14460
+ async policyGetPoliciesByProductIdentifiersRaw(requestParameters, initOverrides) {
14461
+ const queryParameters = {};
14462
+ if (requestParameters["ids"] != null) {
14463
+ queryParameters["ids"] = requestParameters["ids"];
14464
+ }
14465
+ const headerParameters = {};
14466
+ if (this.configuration && this.configuration.apiKey) {
14467
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14468
+ }
14469
+ let urlPath = `/api/Policy/filter/products`;
14470
+ const response = await this.request({
14471
+ path: urlPath,
14472
+ method: "GET",
14473
+ headers: headerParameters,
14474
+ query: queryParameters
14475
+ }, initOverrides);
14476
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PolicyInfoDtoFromJSON));
14477
+ }
14478
+ async policyGetPoliciesByProductIdentifiers(requestParameters = {}, initOverrides) {
14479
+ const response = await this.policyGetPoliciesByProductIdentifiersRaw(requestParameters, initOverrides);
14480
+ return await response.value();
14481
+ }
14482
+ async policyGetPolicyByIdRaw(requestParameters, initOverrides) {
14483
+ if (requestParameters["policyIdentifier"] == null) {
14484
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyById().');
14485
+ }
14486
+ const queryParameters = {};
14487
+ const headerParameters = {};
14488
+ if (this.configuration && this.configuration.apiKey) {
14489
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14490
+ }
14491
+ let urlPath = `/api/Policy/id/{policyIdentifier}`;
14492
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14493
+ const response = await this.request({
14494
+ path: urlPath,
14495
+ method: "GET",
14496
+ headers: headerParameters,
14497
+ query: queryParameters
14498
+ }, initOverrides);
14499
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14500
+ }
14501
+ async policyGetPolicyById(requestParameters, initOverrides) {
14502
+ const response = await this.policyGetPolicyByIdRaw(requestParameters, initOverrides);
14503
+ return await response.value();
14504
+ }
14505
+ async policyGetPolicyByNameAndProductIdentifierRaw(requestParameters, initOverrides) {
14506
+ if (requestParameters["policyName"] == null) {
14507
+ throw new RequiredError("policyName", 'Required parameter "policyName" was null or undefined when calling policyGetPolicyByNameAndProductIdentifier().');
14508
+ }
14509
+ if (requestParameters["productIdentifier"] == null) {
14510
+ throw new RequiredError("productIdentifier", 'Required parameter "productIdentifier" was null or undefined when calling policyGetPolicyByNameAndProductIdentifier().');
14511
+ }
14512
+ const queryParameters = {};
14513
+ const headerParameters = {};
14514
+ if (this.configuration && this.configuration.apiKey) {
14515
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14516
+ }
14517
+ let urlPath = `/api/Policy/{policyName}/product/{productIdentifier}`;
14518
+ urlPath = urlPath.replace(`{${"policyName"}}`, encodeURIComponent(String(requestParameters["policyName"])));
14519
+ urlPath = urlPath.replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters["productIdentifier"])));
14520
+ const response = await this.request({
14521
+ path: urlPath,
14522
+ method: "GET",
14523
+ headers: headerParameters,
14524
+ query: queryParameters
14525
+ }, initOverrides);
14526
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
14527
+ }
14528
+ async policyGetPolicyByNameAndProductIdentifier(requestParameters, initOverrides) {
14529
+ const response = await this.policyGetPolicyByNameAndProductIdentifierRaw(requestParameters, initOverrides);
14530
+ return await response.value();
14531
+ }
14532
+ async policyGetPolicyDataByIdentifierRaw(requestParameters, initOverrides) {
14533
+ if (requestParameters["policyIdentifier"] == null) {
14534
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyDataByIdentifier().');
14535
+ }
14536
+ const queryParameters = {};
14537
+ const headerParameters = {};
14538
+ if (this.configuration && this.configuration.apiKey) {
14539
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14540
+ }
14541
+ let urlPath = `/api/Policy/data/{policyIdentifier}`;
14542
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14543
+ const response = await this.request({
14544
+ path: urlPath,
14545
+ method: "GET",
14546
+ headers: headerParameters,
14547
+ query: queryParameters
14548
+ }, initOverrides);
14549
+ return new JSONApiResponse(response, (jsonValue) => ImportPolicyRequestFromJSON(jsonValue));
14550
+ }
14551
+ async policyGetPolicyDataByIdentifier(requestParameters, initOverrides) {
14552
+ const response = await this.policyGetPolicyDataByIdentifierRaw(requestParameters, initOverrides);
14553
+ return await response.value();
14554
+ }
14555
+ async policyGetPolicyUsageDataRaw(requestParameters, initOverrides) {
14556
+ if (requestParameters["policyIdentifier"] == null) {
14557
+ throw new RequiredError("policyIdentifier", 'Required parameter "policyIdentifier" was null or undefined when calling policyGetPolicyUsageData().');
14558
+ }
14559
+ const queryParameters = {};
14560
+ const headerParameters = {};
14561
+ if (this.configuration && this.configuration.apiKey) {
14562
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14563
+ }
14564
+ let urlPath = `/api/Policy/usage/{policyIdentifier}`;
14565
+ urlPath = urlPath.replace(`{${"policyIdentifier"}}`, encodeURIComponent(String(requestParameters["policyIdentifier"])));
14566
+ const response = await this.request({
14567
+ path: urlPath,
14568
+ method: "GET",
14569
+ headers: headerParameters,
14570
+ query: queryParameters
14571
+ }, initOverrides);
14572
+ return new JSONApiResponse(response, (jsonValue) => PolicyUsageDataFromJSON(jsonValue));
14573
+ }
14574
+ async policyGetPolicyUsageData(requestParameters, initOverrides) {
14575
+ const response = await this.policyGetPolicyUsageDataRaw(requestParameters, initOverrides);
14576
+ return await response.value();
14577
+ }
14578
+ async policyGetRulesForProductRaw(requestParameters, initOverrides) {
14579
+ if (requestParameters["licenseType"] == null) {
14580
+ throw new RequiredError("licenseType", 'Required parameter "licenseType" was null or undefined when calling policyGetRulesForProduct().');
14581
+ }
14582
+ if (requestParameters["productName"] == null) {
14583
+ throw new RequiredError("productName", 'Required parameter "productName" was null or undefined when calling policyGetRulesForProduct().');
14584
+ }
14585
+ if (requestParameters["tenantIdentifier"] == null) {
14586
+ throw new RequiredError("tenantIdentifier", 'Required parameter "tenantIdentifier" was null or undefined when calling policyGetRulesForProduct().');
14587
+ }
14588
+ const queryParameters = {};
14589
+ const headerParameters = {};
14590
+ if (this.configuration && this.configuration.apiKey) {
14591
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14592
+ }
14593
+ let urlPath = `/api/Policy/license/{licenseType}/product/{productName}/tenant/{tenantIdentifier}`;
14594
+ urlPath = urlPath.replace(`{${"licenseType"}}`, encodeURIComponent(String(requestParameters["licenseType"])));
14595
+ urlPath = urlPath.replace(`{${"productName"}}`, encodeURIComponent(String(requestParameters["productName"])));
14596
+ urlPath = urlPath.replace(`{${"tenantIdentifier"}}`, encodeURIComponent(String(requestParameters["tenantIdentifier"])));
14597
+ const response = await this.request({
14598
+ path: urlPath,
14599
+ method: "GET",
14600
+ headers: headerParameters,
14601
+ query: queryParameters
14602
+ }, initOverrides);
14603
+ return new VoidApiResponse(response);
14604
+ }
14605
+ async policyGetRulesForProduct(requestParameters, initOverrides) {
14606
+ await this.policyGetRulesForProductRaw(requestParameters, initOverrides);
14607
+ }
14608
+ async policyGetUserInheritanceGroupPoliciesForAllProductsRaw(requestParameters, initOverrides) {
14609
+ if (requestParameters["identifier"] == null) {
14610
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserInheritanceGroupPoliciesForAllProducts().');
14611
+ }
14612
+ const queryParameters = {};
14613
+ const headerParameters = {};
14614
+ if (this.configuration && this.configuration.apiKey) {
14615
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14616
+ }
14617
+ let urlPath = `/api/Policy/user/group/{identifier}`;
14618
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
14619
+ const response = await this.request({
14620
+ path: urlPath,
14621
+ method: "GET",
14622
+ headers: headerParameters,
14623
+ query: queryParameters
14624
+ }, initOverrides);
14625
+ return new VoidApiResponse(response);
14626
+ }
14627
+ async policyGetUserInheritanceGroupPoliciesForAllProducts(requestParameters, initOverrides) {
14628
+ await this.policyGetUserInheritanceGroupPoliciesForAllProductsRaw(requestParameters, initOverrides);
14629
+ }
14630
+ async policyGetUserPoliciesForAllProductsRaw(requestParameters, initOverrides) {
14631
+ if (requestParameters["identifier"] == null) {
14632
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserPoliciesForAllProducts().');
14633
+ }
14634
+ const queryParameters = {};
14635
+ const headerParameters = {};
14636
+ if (this.configuration && this.configuration.apiKey) {
14637
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14638
+ }
14639
+ let urlPath = `/api/Policy/user/{identifier}`;
14640
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
14641
+ const response = await this.request({
14642
+ path: urlPath,
14643
+ method: "GET",
14644
+ headers: headerParameters,
14645
+ query: queryParameters
14646
+ }, initOverrides);
14647
+ return new VoidApiResponse(response);
14648
+ }
14649
+ async policyGetUserPoliciesForAllProducts(requestParameters, initOverrides) {
14650
+ await this.policyGetUserPoliciesForAllProductsRaw(requestParameters, initOverrides);
14651
+ }
14652
+ async policyGetUserPoliciesForAllProductsAndAllGroupsRaw(requestParameters, initOverrides) {
14653
+ if (requestParameters["identifier"] == null) {
14654
+ throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling policyGetUserPoliciesForAllProductsAndAllGroups().');
14655
+ }
14656
+ const queryParameters = {};
14657
+ const headerParameters = {};
14658
+ if (this.configuration && this.configuration.apiKey) {
14659
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14660
+ }
14661
+ let urlPath = `/api/Policy/user/{identifier}/all`;
14662
+ urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
14663
+ const response = await this.request({
14664
+ path: urlPath,
14665
+ method: "GET",
14666
+ headers: headerParameters,
14667
+ query: queryParameters
14668
+ }, initOverrides);
14669
+ return new VoidApiResponse(response);
14670
+ }
14671
+ async policyGetUserPoliciesForAllProductsAndAllGroups(requestParameters, initOverrides) {
14672
+ await this.policyGetUserPoliciesForAllProductsAndAllGroupsRaw(requestParameters, initOverrides);
14673
+ }
14674
+ async policyUpdateGlobalPolicyRaw(requestParameters, initOverrides) {
14675
+ const queryParameters = {};
14676
+ const headerParameters = {};
14677
+ headerParameters["Content-Type"] = "application/json";
14678
+ if (this.configuration && this.configuration.apiKey) {
14679
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14680
+ }
14681
+ let urlPath = `/api/Policy/global`;
14682
+ const response = await this.request({
14683
+ path: urlPath,
14684
+ method: "PUT",
14685
+ headers: headerParameters,
14686
+ query: queryParameters,
14687
+ body: CreateGlobalPolicyWithFormDataRequestToJSON(requestParameters["createGlobalPolicyWithFormDataRequest"])
14688
+ }, initOverrides);
14689
+ return new JSONApiResponse(response, (jsonValue) => GlobalPolicyDtoFromJSON(jsonValue));
14690
+ }
14691
+ async policyUpdateGlobalPolicy(requestParameters = {}, initOverrides) {
14692
+ const response = await this.policyUpdateGlobalPolicyRaw(requestParameters, initOverrides);
14693
+ return await response.value();
14694
+ }
14695
+ async policyUpdatePolicyRaw(requestParameters, initOverrides) {
14696
+ const queryParameters = {};
14697
+ const headerParameters = {};
14698
+ headerParameters["Content-Type"] = "application/json";
14699
+ if (this.configuration && this.configuration.apiKey) {
14700
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14701
+ }
14702
+ let urlPath = `/api/Policy`;
14703
+ const response = await this.request({
14704
+ path: urlPath,
14705
+ method: "PUT",
14706
+ headers: headerParameters,
14707
+ query: queryParameters,
14708
+ body: CreatePolicyWithFormDataRequestToJSON(requestParameters["createPolicyWithFormDataRequest"])
14709
+ }, initOverrides);
14710
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14711
+ }
14712
+ async policyUpdatePolicy(requestParameters = {}, initOverrides) {
14713
+ const response = await this.policyUpdatePolicyRaw(requestParameters, initOverrides);
14714
+ return await response.value();
14715
+ }
14716
+ async policyUpdatePolicyV2Raw(requestParameters, initOverrides) {
14717
+ const queryParameters = {};
14718
+ const headerParameters = {};
14719
+ headerParameters["Content-Type"] = "application/json";
14720
+ if (this.configuration && this.configuration.apiKey) {
14721
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14722
+ }
14723
+ let urlPath = `/api/Policy/v2/update`;
14724
+ const response = await this.request({
14725
+ path: urlPath,
14726
+ method: "PUT",
14727
+ headers: headerParameters,
14728
+ query: queryParameters,
14729
+ body: UpdatePolicyRequestToJSON(requestParameters["updatePolicyRequest"])
14730
+ }, initOverrides);
14731
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14732
+ }
14733
+ async policyUpdatePolicyV2(requestParameters = {}, initOverrides) {
14734
+ const response = await this.policyUpdatePolicyV2Raw(requestParameters, initOverrides);
14735
+ return await response.value();
14736
+ }
14737
+ async policyUploadCheckPolicyRaw(requestParameters, initOverrides) {
14738
+ const queryParameters = {};
14739
+ const headerParameters = {};
14740
+ if (this.configuration && this.configuration.apiKey) {
14741
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization");
14742
+ }
14743
+ const consumes = [
14744
+ { contentType: "multipart/form-data" }
14745
+ ];
14746
+ const canConsumeForm2 = canConsumeForm(consumes);
14747
+ let formParams;
14748
+ let useForm = false;
14749
+ useForm = canConsumeForm2;
14750
+ if (useForm) {
14751
+ formParams = new FormData;
14752
+ } else {
14753
+ formParams = new URLSearchParams;
14754
+ }
14755
+ if (requestParameters["file"] != null) {
14756
+ formParams.append("file", requestParameters["file"]);
14757
+ }
14758
+ let urlPath = `/api/Policy/upload/check`;
14759
+ const response = await this.request({
14760
+ path: urlPath,
14761
+ method: "POST",
14762
+ headers: headerParameters,
14763
+ query: queryParameters,
14764
+ body: formParams
14765
+ }, initOverrides);
14766
+ return new JSONApiResponse(response, (jsonValue) => PolicyDtoFromJSON(jsonValue));
14767
+ }
14768
+ async policyUploadCheckPolicy(requestParameters = {}, initOverrides) {
14769
+ const response = await this.policyUploadCheckPolicyRaw(requestParameters, initOverrides);
14770
+ return await response.value();
14771
+ }
14772
+ }
14773
+ var DEFAULT_TIMEOUT_MS = 1e4;
14774
+ var CLIENT_VERSION_HEADER = "ClientVersion";
14775
+ var JSON_MIME = /^application\/(json|[^;\s]+\+json)\s*(;.*)?$/i;
14776
+ async function resolvePolicyAsync(options) {
14777
+ const subject = options.subject;
14778
+ requireValue("subject", subject);
14779
+ requireText("subject.organizationId", subject.organizationId);
14780
+ requireText("subject.tenantId", subject.tenantId);
14781
+ requireText("subject.product", subject.product);
14782
+ requireText("subject.licenseType", subject.licenseType);
14783
+ requireText("baseUrl", options.baseUrl);
14784
+ requireText("clientVersion", options.clientVersion);
14785
+ const fetchApi = options.fetch ?? globalThis.fetch;
14786
+ if (typeof fetchApi !== "function") {
14787
+ throw new RequiredError("fetch", "No fetch implementation available. Pass options.fetch.");
14788
+ }
14789
+ const now = options.now ?? (() => new Date);
14790
+ const basePath = `${options.baseUrl.replace(/\/+$/, "")}/${encodeURIComponent(subject.organizationId)}/roboticsops_`;
14791
+ let requestUrl = basePath;
14792
+ const api = new PolicyApi(new Configuration({
14793
+ basePath,
14794
+ fetchApi,
14795
+ apiKey: async () => `Bearer ${await readToken(options.accessToken)}`,
14796
+ headers: {
14797
+ AccountId: subject.organizationId,
14798
+ [CLIENT_VERSION_HEADER]: options.clientVersion
14799
+ },
14800
+ middleware: [
14801
+ {
14802
+ pre: async (context) => {
14803
+ requestUrl = context.url;
14804
+ }
14805
+ }
14806
+ ]
14807
+ }));
14808
+ if (options.signal?.aborted) {
14809
+ return unknown(subject, buildAudit(requestUrl, now), "cancelled", "The request was cancelled before it was sent.");
14810
+ }
14811
+ const controller = new AbortController;
14812
+ let timedOut = false;
14813
+ const timer = setTimeout(() => {
14814
+ timedOut = true;
14815
+ controller.abort();
14816
+ }, options.timeoutMs ?? DEFAULT_TIMEOUT_MS);
14817
+ const relayAbort = () => controller.abort();
14818
+ options.signal?.addEventListener("abort", relayAbort, { once: true });
14819
+ let seenResponse;
14820
+ try {
14821
+ const response = await api.policyGetRulesForProductRaw({
14822
+ licenseType: subject.licenseType,
14823
+ productName: subject.product,
14824
+ tenantIdentifier: subject.tenantId
14825
+ }, { signal: controller.signal });
14826
+ seenResponse = response.raw;
14827
+ return await classifySuccess(response.raw, subject, requestUrl, now);
14828
+ } catch (error) {
14829
+ return classifyFailure(error, subject, requestUrl, now, timedOut, options.signal, seenResponse);
14830
+ } finally {
14831
+ clearTimeout(timer);
14832
+ options.signal?.removeEventListener("abort", relayAbort);
14833
+ }
14834
+ }
14835
+ async function classifySuccess(response, subject, url, now) {
14836
+ const audit = buildAudit(url, now, response);
14837
+ if (response.status === 204) {
14838
+ return { outcome: "ungoverned", subject, audit };
14839
+ }
14840
+ if (response.status !== 200) {
14841
+ return unknown(subject, audit, "serverError", `The policy service answered ${response.status}; only 200 carries a policy and only 204 means none is published.`);
14842
+ }
14843
+ const contentType = response.headers.get("content-type");
14844
+ if (!JSON_MIME.test(contentType ?? "")) {
14845
+ return unknown(subject, audit, "notJson", `Expected a JSON policy document, got content-type ${contentType ?? "(none)"}.`);
14846
+ }
14847
+ const body = await response.text();
14848
+ if (!isJsonObject(body)) {
14849
+ return unknown(subject, audit, "notJson", body.trim() === "" ? "The response body was empty." : "The response body is not a JSON object.");
14850
+ }
14851
+ return { outcome: "governed", subject, audit, document: body };
14852
+ }
14853
+ function classifyFailure(error, subject, url, now, timedOut, signal, seenResponse) {
14854
+ if (error instanceof ResponseError) {
14855
+ return unknown(subject, buildAudit(url, now, error.response), reasonForStatus(error.response.status), `The policy service answered ${error.response.status}.`);
14856
+ }
14857
+ const audit = buildAudit(url, now, seenResponse);
14858
+ if (timedOut) {
14859
+ return unknown(subject, audit, "timedOut", "The policy service did not answer within the timeout.");
14860
+ }
14861
+ if (signal?.aborted || isAbortError(error)) {
14862
+ return unknown(subject, audit, "cancelled", "The request was cancelled.");
14863
+ }
14864
+ return unknown(subject, audit, "transport", `The request to the policy service failed: ${describe(unwrap(error))}`);
14865
+ }
14866
+ function unwrap(error) {
14867
+ return error instanceof FetchError ? error.cause : error;
14868
+ }
14869
+ function reasonForStatus(status) {
14870
+ if (status === 401 || status === 403) {
14871
+ return "unauthorized";
14872
+ }
14873
+ if (status === 404) {
14874
+ return "notFound";
14875
+ }
14876
+ return "serverError";
14877
+ }
14878
+ function buildAudit(url, now, response) {
14879
+ const audit = { url, resolvedAt: now().toISOString() };
14880
+ if (response) {
14881
+ audit.httpStatus = response.status;
14882
+ const retryAfter = parseRetryAfter(response.headers.get("retry-after"), now);
14883
+ if (retryAfter !== undefined) {
14884
+ audit.retryAfterSeconds = retryAfter;
14885
+ }
14886
+ }
14887
+ return audit;
14888
+ }
14889
+ function parseRetryAfter(header, now) {
14890
+ if (header === null || header.trim() === "") {
14891
+ return;
14892
+ }
14893
+ const seconds = Number(header.trim());
14894
+ if (Number.isInteger(seconds) && seconds >= 0) {
14895
+ return seconds;
14896
+ }
14897
+ const at = Date.parse(header);
14898
+ if (Number.isNaN(at)) {
14899
+ return;
14900
+ }
14901
+ return Math.max(0, Math.round((at - now().getTime()) / 1000));
14902
+ }
14903
+ function isJsonObject(body) {
14904
+ if (body.trim() === "") {
14905
+ return false;
14906
+ }
14907
+ let parsed;
14908
+ try {
14909
+ parsed = JSON.parse(body);
14910
+ } catch {
14911
+ return false;
14912
+ }
14913
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed);
14914
+ }
14915
+ function unknown(subject, audit, reason, detail) {
14916
+ return { outcome: "unknown", subject, audit, reason, detail };
14917
+ }
14918
+ async function readToken(accessToken) {
14919
+ return typeof accessToken === "function" ? await accessToken() : accessToken;
14920
+ }
14921
+ function isAbortError(error) {
14922
+ const candidate = error instanceof Error && "cause" in error && error.cause instanceof Error ? error.cause : error;
14923
+ return candidate instanceof Error && candidate.name === "AbortError";
14924
+ }
14925
+ function describe(error) {
14926
+ return error instanceof Error ? error.message : String(error);
14927
+ }
14928
+ function requireValue(field, value) {
14929
+ if (value === undefined || value === null) {
14930
+ throw new RequiredError(field, `Required option "${field}" is missing.`);
14931
+ }
14932
+ }
14933
+ function requireText(field, value) {
14934
+ requireValue(field, value);
14935
+ if (typeof value !== "string" || value.trim() === "") {
14936
+ throw new RequiredError(field, `Required option "${field}" must be a non-empty string.`);
14937
+ }
14938
+ }
14939
+ var package_default = {
14940
+ name: "@uipath/project-packager",
14941
+ author: "UiPath",
14942
+ license: "SEE LICENSE IN LICENSE.txt",
14943
+ version: "1.203.0-preview.180",
14944
+ description: "UiPath Project Packager - core library for packing individual UiPath projects",
14945
+ type: "module",
14946
+ main: "./dist/index.js",
14947
+ exports: {
14948
+ ".": {
14949
+ types: "./dist/src/index.d.ts",
14950
+ default: "./dist/index.js"
14951
+ },
14952
+ "./node": {
14953
+ types: "./dist/src/node.d.ts",
14954
+ default: "./dist/node.js"
14955
+ },
14956
+ "./browser": {
14957
+ types: "./dist/src/browser.d.ts",
14958
+ default: "./dist/browser.js"
14959
+ }
14960
+ },
14961
+ types: "./dist/src/index.d.ts",
14962
+ repository: {
14963
+ type: "git",
14964
+ url: "https://github.com/UiPath/cli.git",
14965
+ directory: "packages/packager/project-packager"
14966
+ },
14967
+ publishConfig: {
14968
+ registry: "https://npm.pkg.github.com/"
14969
+ },
14970
+ files: [
14971
+ "dist"
14972
+ ],
14973
+ scripts: {
14974
+ 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",
14975
+ clean: "rimraf dist",
14976
+ test: "vitest run",
14977
+ e2e: "vitest run --config vitest.e2e.config.ts",
14978
+ "test:coverage": "vitest run --coverage",
14979
+ prepack: "bun run build",
14980
+ "publish:dry": "bun publish --dry-run",
14981
+ "publish:gh": "bun publish",
14982
+ "version:patch": "bun version patch --no-git-tag-version",
14983
+ "version:minor": "bun version minor --no-git-tag-version",
14984
+ "version:major": "bun version major --no-git-tag-version",
14985
+ lint: "biome check ."
14986
+ },
14987
+ dependencies: {
14988
+ "@uipath/aops-policy-sdk": "workspace:*",
14989
+ "@uipath/filesystem": "workspace:*",
14990
+ "@uipath/solutionpackager-tool-core": "workspace:*",
14991
+ "@uipath/common": "workspace:*"
14992
+ },
14993
+ peerDependencies: {
14994
+ fflate: "^0.8.2"
14995
+ },
14996
+ devDependencies: {
14997
+ "@types/node": "^25.5.2",
14998
+ "@uipath/resource-builder-tool": "2025.11.0-alpha4535-3530",
14999
+ "@uipath/tool-agent": "^2.0.0",
15000
+ "@uipath/packager-tool-apiworkflow": "workspace:*",
15001
+ "@uipath/packager-tool-connector": "workspace:*",
15002
+ "@uipath/packager-tool-flow": "workspace:*",
15003
+ "@uipath/packager-tool-functions": "workspace:*",
15004
+ "@uipath/packager-tool-webapp": "workspace:*",
15005
+ "@uipath/packager-tool-workflowcompiler": "workspace:*",
15006
+ "@vitest/coverage-v8": "^4.1.11",
15007
+ jsdom: "^30.0.1",
15008
+ typescript: "^7.0.2",
15009
+ "vite-tsconfig-paths": "^6.1.1",
15010
+ vitest: "^4.1.11"
15011
+ }
15012
+ };
15013
+
15014
+ class GovernancePolicyError extends Error {
15015
+ instructions;
15016
+ name = "GovernancePolicyError";
15017
+ constructor(message, instructions) {
15018
+ super(message);
15019
+ this.instructions = instructions;
15020
+ }
15021
+ }
15022
+ var LICENSE_TYPES = {
15023
+ NoLicense: "NoLicense",
15024
+ Development: "Development",
15025
+ Attended: "Attended",
15026
+ Unattended: "Unattended",
15027
+ StudioX: "StudioX",
15028
+ StudioPro: "StudioPro",
15029
+ AutomationKit: "AutomationKit"
15030
+ };
15031
+ var STUDIOWEB_PRODUCT = "StudioWeb";
15032
+ var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
15033
+ var GOVERNANCE_SUBFOLDER = "governance";
15034
+ var GOVERNANCE_FILE_NAME = "governance-policy.json";
15035
+ var errorMessage = (error) => error instanceof Error ? error.message : String(error);
15036
+ var t = (key, params) => translate.t(`solutionpackager.governance.${key}`, params);
15037
+
15038
+ class GovernancePolicyService {
15039
+ fileSystem;
15040
+ temporaryStorage;
15041
+ fetchFn;
15042
+ logger = new ToolLogger("GovernancePolicyService", "ResolvePolicy");
15043
+ constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
15044
+ this.fileSystem = fileSystem;
15045
+ this.temporaryStorage = temporaryStorage;
15046
+ this.fetchFn = fetchFn;
15047
+ }
15048
+ async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken, usage = "pack") {
15049
+ if (validateOptions.governanceFileType === "Default") {
15050
+ return;
15051
+ }
15052
+ const suppliedFilePath = validateOptions.governanceFilePath;
15053
+ if (suppliedFilePath && validateOptions.governanceFileType === "AutomationOps") {
15054
+ this.logger.info(t("info.alreadyProvided"));
15055
+ return;
15056
+ }
15057
+ if (suppliedFilePath && usage === "analyze") {
15058
+ this.logger.info(t("info.alreadyProvided"));
15059
+ validateOptions.governanceFileType = "Studio";
15060
+ return;
15061
+ }
15062
+ const origin = this.resolveCloudOrigin(connectionInfo?.cloudUrl);
15063
+ const product = validateOptions.profileKey;
15064
+ if (!origin || !product || !connectionInfo?.organizationId || !connectionInfo.tenantId || !connectionInfo.accessToken) {
15065
+ if (suppliedFilePath) {
15066
+ this.logger.info(t("info.noTenantToAsk", { path: suppliedFilePath }));
15067
+ validateOptions.governanceFileType = "Studio";
15068
+ return;
15069
+ }
15070
+ this.warnAndUseShippedRules(validateOptions, t("errors.connectionIncomplete"));
15071
+ return;
15072
+ }
15073
+ const licenseType = await this.resolveLicenseTypeAsync(product, connectionInfo.cloudUrl?.replace(/\/+$/, "") ?? "", connectionInfo.accessToken, cancellationToken);
15074
+ const subject = {
15075
+ organizationId: connectionInfo.organizationId,
15076
+ tenantId: connectionInfo.tenantId,
15077
+ product,
15078
+ licenseType
15079
+ };
15080
+ this.logger.info(t("info.resolving", { product, licenseType }));
15081
+ const resolution = await resolvePolicyAsync({
15082
+ subject,
15083
+ baseUrl: origin,
15084
+ accessToken: connectionInfo.accessToken,
15085
+ clientVersion: package_default.version,
15086
+ fetch: this.fetchFn,
15087
+ signal: cancellationToken
15088
+ });
15089
+ await this.applyResolutionAsync(resolution, validateOptions, suppliedFilePath);
15090
+ }
15091
+ async applyResolutionAsync(resolution, validateOptions, suppliedFilePath) {
15092
+ switch (resolution.outcome) {
15093
+ case "governed":
15094
+ if (suppliedFilePath) {
15095
+ throw new GovernancePolicyError(t("errors.tenantPolicyWins", {
15096
+ product: resolution.subject.product,
15097
+ path: suppliedFilePath
15098
+ }), t("instructions.tenantPolicyWins"));
15099
+ }
15100
+ await this.savePolicyAsync(validateOptions, resolution.document);
15101
+ return;
15102
+ case "ungoverned":
15103
+ if (suppliedFilePath) {
15104
+ this.logger.info(t("info.suppliedFileHonoured", {
15105
+ path: suppliedFilePath
15106
+ }));
15107
+ validateOptions.governanceFileType = "Studio";
15108
+ return;
15109
+ }
15110
+ this.logger.info(t("info.ungoverned"));
15111
+ validateOptions.governanceFileType = "Default";
15112
+ return;
15113
+ case "unknown": {
15114
+ this.logger.warn(this.describeUnknown(resolution));
15115
+ if (suppliedFilePath) {
15116
+ this.logger.info(t("info.suppliedFileUnchecked", {
15117
+ path: suppliedFilePath
15118
+ }));
15119
+ validateOptions.governanceFileType = "Studio";
15120
+ return;
15121
+ }
15122
+ validateOptions.governanceFileType = "Default";
15123
+ return;
15124
+ }
15125
+ }
15126
+ }
15127
+ async savePolicyAsync(validateOptions, document) {
15128
+ try {
15129
+ const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
15130
+ const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
15131
+ await this.fileSystem.writeFile(filePath, document);
15132
+ this.logger.info(t("info.saved", { path: filePath }));
15133
+ validateOptions.governanceFilePath = filePath;
15134
+ validateOptions.governanceFileType = "AutomationOps";
15135
+ } catch (error) {
15136
+ this.warnAndUseShippedRules(validateOptions, t("errors.failedToSave", { error: errorMessage(error) }));
15137
+ }
15138
+ }
15139
+ warnAndUseShippedRules(validateOptions, reason) {
15140
+ this.logger.warn(t("errors.fallingBackToDefault", { reason }));
15141
+ validateOptions.governanceFileType = "Default";
15142
+ }
15143
+ describeUnknown(resolution) {
15144
+ const reason = t("errors.unknownOutcome", {
15145
+ reason: resolution.reason,
15146
+ detail: resolution.detail,
15147
+ url: resolution.audit.url
15148
+ });
15149
+ const retryAfter = resolution.audit.retryAfterSeconds;
15150
+ return retryAfter === undefined ? reason : `${reason} ${t("errors.retryAfter", { seconds: retryAfter })}`;
15151
+ }
15152
+ resolveCloudOrigin(cloudUrl) {
15153
+ if (!cloudUrl) {
15154
+ return null;
15155
+ }
15156
+ try {
15157
+ return new URL(cloudUrl).origin;
15158
+ } catch {
15159
+ return null;
15160
+ }
15161
+ }
15162
+ async resolveLicenseTypeAsync(profileKey, cloudUrl, accessToken, cancellationToken) {
15163
+ const isStudioWeb = profileKey === STUDIOWEB_PRODUCT;
15164
+ const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
15165
+ try {
15166
+ const response = await this.fetchFn(`${cloudUrl}${ACQUIRE_LICENSE_PATH}`, {
15167
+ method: "POST",
15168
+ headers: { Authorization: `Bearer ${accessToken}` },
15169
+ signal: cancellationToken
15170
+ });
15171
+ if (!response.ok) {
15172
+ this.logger.info(t("info.licenseStatus", {
15173
+ status: response.status,
15174
+ fallback
15175
+ }));
15176
+ return fallback;
15177
+ }
15178
+ const { isLicensed, robotType } = await response.json();
15179
+ this.logger.info(t("info.licenseResponse", {
15180
+ isLicensed: String(isLicensed),
15181
+ robotType: String(robotType)
15182
+ }));
15183
+ if (!isLicensed || !robotType) {
15184
+ return fallback;
15185
+ }
15186
+ if (isStudioWeb) {
15187
+ return robotType === LICENSE_TYPES.AutomationKit ? LICENSE_TYPES.AutomationKit : LICENSE_TYPES.NoLicense;
15188
+ }
15189
+ return robotType;
15190
+ } catch (error) {
15191
+ this.logger.info(t("info.licenseFailed", {
15192
+ error: errorMessage(error),
15193
+ fallback
15194
+ }));
15195
+ return fallback;
15196
+ }
15197
+ }
15198
+ }
15199
+ async function resolveProducedNupkgsAsync(fileSystem, packagePath) {
15200
+ if (packagePath.toLowerCase().endsWith(".nupkg")) {
15201
+ return [packagePath];
15202
+ }
15203
+ const stat22 = await fileSystem.stat(packagePath);
15204
+ if (!stat22?.isDirectory()) {
15205
+ return [];
15206
+ }
15207
+ const candidateDirs = [packagePath, fileSystem.path.dirname(packagePath)];
15208
+ for (const dir of candidateDirs) {
15209
+ const entries = await fileSystem.readdir(dir);
15210
+ const nupkgs = entries.filter((entry) => entry.toLowerCase().endsWith(".nupkg")).map((entry) => fileSystem.path.join(dir, entry));
15211
+ if (nupkgs.length > 0) {
15212
+ return nupkgs;
15213
+ }
15214
+ }
15215
+ return [];
15216
+ }
15217
+ var PACKAGE_ID_TOO_LONG = "PACKAGE_ID_TOO_LONG";
15218
+ function isPackageIdTooLongError(error) {
15219
+ return error instanceof Error && error.code === PACKAGE_ID_TOO_LONG;
15220
+ }
15221
+
15222
+ class PackService {
15223
+ disallowedCharsRegex = /[^\p{L}\p{N}_.-]/gu;
15224
+ spacesDotRegex = /[\s.]+/g;
15225
+ dotDashRegex = /\.{0,10}[-:]\.{0,10}/g;
15226
+ MaxPackageIdLength = 100;
15227
+ sanitizePackageId(packageId) {
15228
+ packageId = packageId.trim();
15229
+ packageId = packageId.replace(this.spacesDotRegex, ".");
15230
+ packageId = packageId.replace(this.dotDashRegex, "-");
15231
+ packageId = packageId.replace(this.disallowedCharsRegex, "_");
15232
+ if (packageId.length > this.MaxPackageIdLength) {
15233
+ const error = new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
15234
+ error.code = PACKAGE_ID_TOO_LONG;
15235
+ error.packageId = packageId;
15236
+ error.maxLength = this.MaxPackageIdLength;
15237
+ throw error;
15238
+ }
15239
+ return packageId;
15240
+ }
15241
+ }
15242
+ async function signNupkgsAsync(signService, nupkgPaths, signingInfo) {
15243
+ if (!signingInfo?.certificatePath) {
15244
+ return ToolResult.success();
15245
+ }
15246
+ if (!signService) {
15247
+ return ToolResult.error(ToolErrorCodes.InternalError, "Package signing is required but signing service is not available. Package signing requires dotnet CLI to be installed in Node.js environment.");
15248
+ }
15249
+ const certificatePath = signingInfo.certificatePath;
15250
+ const toSign = [...new Set(nupkgPaths)];
15251
+ if (toSign.length === 0) {
15252
+ return ToolResult.success();
15253
+ }
15254
+ if (signService.signPackagesAsync) {
15255
+ return signService.signPackagesAsync(toSign, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
15256
+ }
15257
+ for (const packagePath of toSign) {
15258
+ const signResult = await signService.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer);
15259
+ if (!signResult.isSuccess) {
15260
+ return signResult;
15261
+ }
15262
+ }
15263
+ return ToolResult.success();
15264
+ }
15265
+
15266
+ class PackagerParametersValidator {
15267
+ logger;
15268
+ fileSystem;
15269
+ constructor(logger2, fileSystem) {
15270
+ this.logger = logger2;
13236
15271
  this.fileSystem = fileSystem;
13237
15272
  }
13238
15273
  async validateAsync(_options, _cancellationToken) {
@@ -13615,7 +15650,7 @@ class ProjectPackager {
13615
15650
  }, cancellationToken);
13616
15651
  }
13617
15652
  async validateProjectAsync(options, cancellationToken) {
13618
- await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
15653
+ await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken, "analyze");
13619
15654
  const validationResult = await this.validateOptionsValidator.validateAsync(options, cancellationToken);
13620
15655
  if (!validationResult.isSuccess) {
13621
15656
  return validationResult;
@@ -13639,7 +15674,10 @@ class ProjectPackager {
13639
15674
  }, cancellationToken);
13640
15675
  }
13641
15676
  async buildProjectAsync(options, cancellationToken) {
13642
- await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
15677
+ const [governanceError] = await catchError(this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken));
15678
+ if (governanceError) {
15679
+ return ToolResult.error(ToolErrorCodes.InternalError, `Project build failed: ${governanceError.message}`, carriedInstructions(governanceError));
15680
+ }
13643
15681
  const validationResult = await this.buildOptionsValidator.validateAsync(options, cancellationToken);
13644
15682
  if (!validationResult.isSuccess) {
13645
15683
  return validationResult;
@@ -13706,7 +15744,7 @@ class ProjectPackager {
13706
15744
  } catch (error) {
13707
15745
  const errorMessage2 = error instanceof Error ? error.message : String(error);
13708
15746
  this.logger.error(`Processing error: ${errorMessage2}`);
13709
- return ToolResult.error(ToolErrorCodes.InternalError, `Project pack failed: ${errorMessage2}`);
15747
+ return ToolResult.error(ToolErrorCodes.InternalError, `Project pack failed: ${errorMessage2}`, carriedInstructions(error));
13710
15748
  } finally {
13711
15749
  await this.temporaryStorage.cleanup();
13712
15750
  }
@@ -14067,78 +16105,6 @@ function addSdkUserAgentHeader(headers, userAgent) {
14067
16105
  result[headerName ?? USER_AGENT_HEADER] = appendUserAgentToken(headerName ? result[headerName] : undefined, getEffectiveUserAgent(userAgent));
14068
16106
  return result;
14069
16107
  }
14070
- var package_default = {
14071
- name: "@uipath/project-packager",
14072
- license: "SEE LICENSE IN LICENSE.txt",
14073
- version: "1.202.1",
14074
- description: "UiPath Project Packager - core library for packing individual UiPath projects",
14075
- type: "module",
14076
- main: "./dist/index.js",
14077
- exports: {
14078
- ".": {
14079
- types: "./dist/src/index.d.ts",
14080
- default: "./dist/index.js"
14081
- },
14082
- "./node": {
14083
- types: "./dist/src/node.d.ts",
14084
- default: "./dist/node.js"
14085
- },
14086
- "./browser": {
14087
- types: "./dist/src/browser.d.ts",
14088
- default: "./dist/browser.js"
14089
- }
14090
- },
14091
- types: "./dist/src/index.d.ts",
14092
- repository: {
14093
- type: "git",
14094
- url: "https://github.com/UiPath/cli.git",
14095
- directory: "packages/packager/project-packager"
14096
- },
14097
- publishConfig: {
14098
- registry: "https://npm.pkg.github.com/"
14099
- },
14100
- files: [
14101
- "dist"
14102
- ],
14103
- scripts: {
14104
- 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",
14105
- clean: "rimraf dist",
14106
- test: "vitest run",
14107
- e2e: "vitest run --config vitest.e2e.config.ts",
14108
- "test:coverage": "vitest run --coverage",
14109
- prepack: "bun run build",
14110
- "publish:dry": "bun publish --dry-run",
14111
- "publish:gh": "bun publish",
14112
- "version:patch": "bun version patch --no-git-tag-version",
14113
- "version:minor": "bun version minor --no-git-tag-version",
14114
- "version:major": "bun version major --no-git-tag-version",
14115
- lint: "biome check ."
14116
- },
14117
- dependencies: {
14118
- "@uipath/filesystem": "workspace:*",
14119
- "@uipath/solutionpackager-tool-core": "workspace:*",
14120
- "@uipath/common": "workspace:*"
14121
- },
14122
- peerDependencies: {
14123
- fflate: "^0.8.2"
14124
- },
14125
- devDependencies: {
14126
- "@types/node": "^25.5.2",
14127
- "@uipath/resource-builder-tool": "1.0.0-s202-16635",
14128
- "@uipath/tool-agent": "^2.0.0",
14129
- "@uipath/packager-tool-apiworkflow": "workspace:*",
14130
- "@uipath/packager-tool-connector": "workspace:*",
14131
- "@uipath/packager-tool-flow": "workspace:*",
14132
- "@uipath/packager-tool-functions": "workspace:*",
14133
- "@uipath/packager-tool-webapp": "workspace:*",
14134
- "@uipath/packager-tool-workflowcompiler": "workspace:*",
14135
- "@vitest/coverage-v8": "^4.1.11",
14136
- jsdom: "^30.0.1",
14137
- typescript: "^7.0.2",
14138
- "vite-tsconfig-paths": "^6.1.1",
14139
- vitest: "^4.1.11"
14140
- }
14141
- };
14142
16108
  var HEADER_TENANT_ID = "X-UIPATH-TenantId";
14143
16109
  var FEEDS_PATH = "/api/PackageFeeds/GetFeeds";
14144
16110
  var FOLDERS_PATH = "/api/FoldersNavigation/GetAllFoldersForCurrentUser";
@@ -14493,6 +16459,7 @@ export {
14493
16459
  GovernancePolicyService,
14494
16460
  NodeContextStorage,
14495
16461
  NodePackageSignService,
16462
+ PACKAGE_ID_TOO_LONG,
14496
16463
  PackService,
14497
16464
  PackagerParameters,
14498
16465
  PackagerParametersValidator,
@@ -14516,9 +16483,10 @@ export {
14516
16483
  ToolsFactory,
14517
16484
  createNodeProjectPackager,
14518
16485
  createNodeProjectPublisher,
16486
+ isPackageIdTooLongError,
14519
16487
  resolveProducedNupkgsAsync,
14520
16488
  setGlobalLogHandler,
14521
16489
  signNupkgsAsync
14522
16490
  };
14523
16491
 
14524
- //# debugId=25DC9ADDD364D4FC64756E2164756E21
16492
+ //# debugId=86641EF0D2C2D95864756E2164756E21