@uipath/project-packager 1.206.0-preview.303 → 1.207.0-preview.305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -63,7 +63,7 @@ __export(exports_buffer, {
63
63
  File: () => File,
64
64
  INSPECT_MAX_BYTES: () => INSPECT_MAX_BYTES,
65
65
  atob: () => atob,
66
- btoa: () => btoa,
66
+ btoa: () => btoa2,
67
67
  constants: () => constants,
68
68
  default: () => buffer_default,
69
69
  isAscii: () => isAscii,
@@ -740,7 +740,7 @@ function notimpl(name) {
740
740
  throw Error(name + " is not implemented for node:buffer browser polyfill");
741
741
  };
742
742
  }
743
- var lookup, revLookup, code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i, len, customInspectSymbol, INSPECT_MAX_BYTES = 50, kMaxLength = 2147483647, kStringMaxLength = 536870888, btoa, atob, File, Blob2, constants, ERR_BUFFER_OUT_OF_BOUNDS, ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, MAX_ARGUMENTS_LENGTH = 4096, INVALID_BASE64_RE, hexSliceLookupTable, resolveObjectURL, isUtf8, isAscii = (str) => {
743
+ var lookup, revLookup, code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i, len, customInspectSymbol, INSPECT_MAX_BYTES = 50, kMaxLength = 2147483647, kStringMaxLength = 536870888, btoa2, atob, File, Blob2, constants, ERR_BUFFER_OUT_OF_BOUNDS, ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, MAX_ARGUMENTS_LENGTH = 4096, INVALID_BASE64_RE, hexSliceLookupTable, resolveObjectURL, isUtf8, isAscii = (str) => {
744
744
  for (let char of str)
745
745
  if (char.charCodeAt(0) > 127)
746
746
  return false;
@@ -754,7 +754,7 @@ var init_buffer = __esm(() => {
754
754
  revLookup[45] = 62;
755
755
  revLookup[95] = 63;
756
756
  customInspectSymbol = typeof Symbol === "function" && typeof Symbol.for === "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
757
- btoa = globalThis.btoa;
757
+ btoa2 = globalThis.btoa;
758
758
  atob = globalThis.atob;
759
759
  File = globalThis.File;
760
760
  Blob2 = globalThis.Blob;
@@ -18153,7 +18153,8 @@ var de_default = {
18153
18153
  pathRequired: "Project directory path is required",
18154
18154
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18155
18155
  readFailed: "Failed to read project file: {path}",
18156
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18156
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18157
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18157
18158
  }
18158
18159
  },
18159
18160
  validator: {
@@ -18244,7 +18245,8 @@ var en = {
18244
18245
  pathRequired: "Project directory path is required",
18245
18246
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18246
18247
  readFailed: "Failed to read project file: {path}",
18247
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18248
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18249
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18248
18250
  }
18249
18251
  },
18250
18252
  validator: {
@@ -18335,7 +18337,8 @@ var es_default = {
18335
18337
  pathRequired: "Project directory path is required",
18336
18338
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18337
18339
  readFailed: "Failed to read project file: {path}",
18338
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18340
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18341
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18339
18342
  }
18340
18343
  },
18341
18344
  validator: {
@@ -18425,7 +18428,8 @@ var es_MX_default = {
18425
18428
  pathRequired: "Project directory path is required",
18426
18429
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18427
18430
  readFailed: "Failed to read project file: {path}",
18428
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18431
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18432
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18429
18433
  }
18430
18434
  },
18431
18435
  validator: {
@@ -18515,7 +18519,8 @@ var fr_default = {
18515
18519
  pathRequired: "Project directory path is required",
18516
18520
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18517
18521
  readFailed: "Failed to read project file: {path}",
18518
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18522
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18523
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18519
18524
  }
18520
18525
  },
18521
18526
  validator: {
@@ -18605,7 +18610,8 @@ var ja_default = {
18605
18610
  pathRequired: "Project directory path is required",
18606
18611
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18607
18612
  readFailed: "Failed to read project file: {path}",
18608
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18613
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18614
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18609
18615
  }
18610
18616
  },
18611
18617
  validator: {
@@ -18695,7 +18701,8 @@ var ko_default = {
18695
18701
  pathRequired: "Project directory path is required",
18696
18702
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18697
18703
  readFailed: "Failed to read project file: {path}",
18698
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18704
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18705
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18699
18706
  }
18700
18707
  },
18701
18708
  validator: {
@@ -18785,7 +18792,8 @@ var pt_default = {
18785
18792
  pathRequired: "Project directory path is required",
18786
18793
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18787
18794
  readFailed: "Failed to read project file: {path}",
18788
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18795
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18796
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18789
18797
  }
18790
18798
  },
18791
18799
  validator: {
@@ -18875,7 +18883,8 @@ var pt_BR_default = {
18875
18883
  pathRequired: "Project directory path is required",
18876
18884
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18877
18885
  readFailed: "Failed to read project file: {path}",
18878
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18886
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18887
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18879
18888
  }
18880
18889
  },
18881
18890
  validator: {
@@ -18965,7 +18974,8 @@ var ro_default = {
18965
18974
  pathRequired: "Project directory path is required",
18966
18975
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
18967
18976
  readFailed: "Failed to read project file: {path}",
18968
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
18977
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
18978
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
18969
18979
  }
18970
18980
  },
18971
18981
  validator: {
@@ -19055,7 +19065,8 @@ var ru_default = {
19055
19065
  pathRequired: "Project directory path is required",
19056
19066
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
19057
19067
  readFailed: "Failed to read project file: {path}",
19058
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
19068
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
19069
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
19059
19070
  }
19060
19071
  },
19061
19072
  validator: {
@@ -19145,7 +19156,8 @@ var tr_default = {
19145
19156
  pathRequired: "Project directory path is required",
19146
19157
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
19147
19158
  readFailed: "Failed to read project file: {path}",
19148
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
19159
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
19160
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
19149
19161
  }
19150
19162
  },
19151
19163
  validator: {
@@ -19235,7 +19247,8 @@ var zh_CN_default = {
19235
19247
  pathRequired: "Project directory path is required",
19236
19248
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
19237
19249
  readFailed: "Failed to read project file: {path}",
19238
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
19250
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
19251
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
19239
19252
  }
19240
19253
  },
19241
19254
  validator: {
@@ -19325,7 +19338,8 @@ var zh_TW_default = {
19325
19338
  pathRequired: "Project directory path is required",
19326
19339
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
19327
19340
  readFailed: "Failed to read project file: {path}",
19328
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
19341
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
19342
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
19329
19343
  }
19330
19344
  },
19331
19345
  validator: {
@@ -19415,7 +19429,8 @@ var zu_default = {
19415
19429
  pathRequired: "Project directory path is required",
19416
19430
  noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
19417
19431
  readFailed: "Failed to read project file: {path}",
19418
- invalidProject: "Invalid project file: {path}. Missing ProjectType field."
19432
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field.",
19433
+ invalidJson: "Project file {path} is not a JSON object. {reason}"
19419
19434
  }
19420
19435
  },
19421
19436
  validator: {
@@ -19580,13 +19595,15 @@ var ProjectDimensions = {
19580
19595
  SolutionKey: "SolutionKey",
19581
19596
  SolutionProjectKey: "SolutionProjectKey",
19582
19597
  SolutionIdentityStatus: "SolutionIdentityStatus",
19583
- PreviousSolutionKey: "PreviousSolutionKey"
19598
+ PreviousSolutionKey: "PreviousSolutionKey",
19599
+ PreviousProjectKey: "PreviousProjectKey"
19584
19600
  };
19585
19601
  var GUID_KEY_DIMENSIONS = new Set([
19586
19602
  ProjectDimensions.ProjectKey,
19587
19603
  ProjectDimensions.SolutionKey,
19588
19604
  ProjectDimensions.SolutionProjectKey,
19589
- ProjectDimensions.PreviousSolutionKey
19605
+ ProjectDimensions.PreviousSolutionKey,
19606
+ ProjectDimensions.PreviousProjectKey
19590
19607
  ]);
19591
19608
  var ShipDimensions = {
19592
19609
  ShipKind: "ShipKind",
@@ -20021,9 +20038,7 @@ async function withinProjectIdentityBudget(work, onTimeout) {
20021
20038
  }
20022
20039
  }
20023
20040
 
20024
- // ../../common/src/telemetry/pseudonymize.ts
20025
- var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
20026
- var PSEUDONYM_HEX_LENGTH = 32;
20041
+ // ../../common/src/sha256.ts
20027
20042
  var SHA256_K = new Uint32Array([
20028
20043
  1116352408,
20029
20044
  1899447441,
@@ -20103,7 +20118,7 @@ var SHA256_INITIAL_STATE = new Uint32Array([
20103
20118
  function rotr(value, bits) {
20104
20119
  return (value >>> bits | value << 32 - bits) >>> 0;
20105
20120
  }
20106
- function sha256Hex(input) {
20121
+ function sha256Words(input) {
20107
20122
  const bytes = new TextEncoder().encode(input);
20108
20123
  const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
20109
20124
  const buffer = new Uint8Array(paddedLength);
@@ -20159,12 +20174,19 @@ function sha256Hex(input) {
20159
20174
  state[6] = state[6] + g >>> 0;
20160
20175
  state[7] = state[7] + h >>> 0;
20161
20176
  }
20177
+ return state;
20178
+ }
20179
+ function sha256Hex(input) {
20162
20180
  let hex = "";
20163
- for (const word of state) {
20181
+ for (const word of sha256Words(input)) {
20164
20182
  hex += word.toString(16).padStart(8, "0");
20165
20183
  }
20166
20184
  return hex;
20167
20185
  }
20186
+
20187
+ // ../../common/src/telemetry/pseudonymize.ts
20188
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
20189
+ var PSEUDONYM_HEX_LENGTH = 32;
20168
20190
  function resolveSha256Hex() {
20169
20191
  try {
20170
20192
  const nodeCrypto = (init_crypto(), __toCommonJS(exports_crypto));
@@ -20950,10 +20972,12 @@ function settlePromiseLike(thenable) {
20950
20972
  // ../../common/src/error-codes.ts
20951
20973
  var CLI_ERROR_CODES = [
20952
20974
  "invalid_argument",
20975
+ "confirmation_required",
20953
20976
  "authentication_required",
20954
20977
  "permission_denied",
20955
20978
  "local_permission_denied",
20956
20979
  "not_found",
20980
+ "not_enabled",
20957
20981
  "rate_limited",
20958
20982
  "network_error",
20959
20983
  "timeout",
@@ -22653,7 +22677,7 @@ var package_default = {
22653
22677
  name: "@uipath/project-packager",
22654
22678
  author: "UiPath",
22655
22679
  license: "SEE LICENSE IN LICENSE.txt",
22656
- version: "1.206.0-preview.303",
22680
+ version: "1.207.0-preview.305",
22657
22681
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
22658
22682
  type: "module",
22659
22683
  main: "./dist/index.js",
@@ -23154,28 +23178,54 @@ class ProjectLoader {
23154
23178
  path: projectFilePath
23155
23179
  }));
23156
23180
  }
23157
- const json = typeof fileContent === "string" ? fileContent : new TextDecoder("utf-8").decode(fileContent);
23158
- const projectData = JSON.parse(json);
23181
+ const projectData = this.parseProjectFile(fileContent, projectFilePath);
23159
23182
  const projectJson = useProjectJson ? projectData : undefined;
23160
- const outputType = projectJson?.designOptions?.outputType;
23161
- const projectType = outputType ?? (projectData?.ProjectType || projectData?.type);
23162
- if (!projectData || !projectType) {
23183
+ const designOptions = projectJson?.designOptions;
23184
+ const outputType = designOptions && typeof designOptions === "object" ? text(designOptions.outputType) : undefined;
23185
+ const projectType = outputType ?? (text(projectData?.ProjectType) || text(projectData?.type));
23186
+ if (!projectType) {
23163
23187
  throw new Error(translate4.t("solutionpackager.projectLoader.errors.invalidProject", {
23164
23188
  path: projectFilePath
23165
23189
  }));
23166
23190
  }
23167
- const declaredName = projectJson?.name?.trim() || projectData.Name;
23168
- const declaredDescription = projectJson?.description?.trim() || projectData.Description?.trim() || undefined;
23169
- const declaredAuthor = projectJson?.author?.trim() || projectData.Author?.trim() || undefined;
23191
+ const declaredName = text(projectJson?.name) || text(projectData.Name);
23192
+ const declaredDescription = text(projectJson?.description) || text(projectData.Description) || undefined;
23193
+ const declaredAuthor = text(projectJson?.author) || text(projectData.Author) || undefined;
23194
+ const declaredVersion = useProjectJson ? text(projectData.projectVersion) : await this.readProjectJsonVersion(projectPath);
23170
23195
  return {
23171
23196
  type: projectType,
23172
23197
  name: declaredName || Path2.basename(projectPath),
23173
23198
  projectPath,
23174
23199
  projectFilePath,
23175
23200
  description: declaredDescription,
23176
- author: declaredAuthor
23201
+ author: declaredAuthor,
23202
+ version: declaredVersion || undefined
23177
23203
  };
23178
23204
  }
23205
+ parseProjectFile(fileContent, projectFilePath) {
23206
+ const json = typeof fileContent === "string" ? fileContent : new TextDecoder("utf-8").decode(fileContent);
23207
+ const [reason, parsed] = parseJson(json);
23208
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
23209
+ throw new Error(translate4.t("solutionpackager.projectLoader.errors.invalidJson", {
23210
+ path: projectFilePath,
23211
+ reason: reason ?? ""
23212
+ }).trim());
23213
+ }
23214
+ return parsed;
23215
+ }
23216
+ async readProjectJsonVersion(projectPath) {
23217
+ const projectJsonPath = Path2.join(projectPath, ProjectLoader.ProjectJsonFileName);
23218
+ if (!await this.fileSystem.exists(projectJsonPath))
23219
+ return;
23220
+ const fileContent = await this.fileSystem.readFile(projectJsonPath);
23221
+ if (!fileContent)
23222
+ return;
23223
+ try {
23224
+ return text(this.parseProjectFile(fileContent, projectJsonPath).projectVersion);
23225
+ } catch {
23226
+ return;
23227
+ }
23228
+ }
23179
23229
  loadFromWebAppManifest(projectPath, webAppManifestPath) {
23180
23230
  const folderName = Path2.basename(projectPath);
23181
23231
  return {
@@ -23186,6 +23236,19 @@ class ProjectLoader {
23186
23236
  };
23187
23237
  }
23188
23238
  }
23239
+ function parseJson(json) {
23240
+ try {
23241
+ return [undefined, JSON.parse(json)];
23242
+ } catch (error) {
23243
+ return [
23244
+ error instanceof Error ? error.message : String(error),
23245
+ undefined
23246
+ ];
23247
+ }
23248
+ }
23249
+ function text(value) {
23250
+ return typeof value === "string" ? value.trim() : undefined;
23251
+ }
23189
23252
 
23190
23253
  // src/services/project-pack-options-builder.ts
23191
23254
  class ProjectPackOptionsBuilder {
@@ -23226,7 +23289,8 @@ class ProjectPackOptionsBuilder {
23226
23289
  package: packageInfo,
23227
23290
  skipDependencyOptimization: parameters.packOptions?.skipDependencyOptimization ?? false,
23228
23291
  includeSources: parameters.packOptions?.includeSources ?? false,
23229
- splitPackages: parameters.packOptions?.splitPackages ?? false
23292
+ splitPackages: parameters.packOptions?.splitPackages ?? false,
23293
+ skipBuild: parameters.packOptions?.skipBuild ?? false
23230
23294
  };
23231
23295
  }
23232
23296
  }
@@ -23666,4 +23730,4 @@ export {
23666
23730
  createBrowserProjectPackager
23667
23731
  };
23668
23732
 
23669
- //# debugId=B7AD85D6D064EEC764756E2164756E21
23733
+ //# debugId=E1089CF31C97130E64756E2164756E21