trm-core 8.1.1 → 8.1.3

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/changelog.txt CHANGED
@@ -8,6 +8,15 @@ Legend
8
8
  + : added
9
9
  - : removed
10
10
 
11
+ 2025-11-15 v8.1.3
12
+ -------------------
13
+ * multiple dependencies detected for same object
14
+
15
+ 2025-11-07 v8.1.2
16
+ -------------------
17
+ - encode uri in registry endpoint
18
+ + placeholder for lockfile parsing
19
+
11
20
  2025-11-04 v8.1.1
12
21
  -------------------
13
22
  + moved lock file generation to core
@@ -58,10 +58,15 @@ const _addEntry = (tableName, sapEntries, dependencyIn, dependency) => {
58
58
  });
59
59
  index--;
60
60
  }
61
- sapEntries[index].dependencies.push({
62
- foundIn: dependencyIn,
63
- object: dependency
64
- });
61
+ if (sapEntries[index].dependencies.find(o => _.isEqual(o.object, dependency))) {
62
+ trm_commons_1.Logger.log(`Skipping, dependency with ${JSON.stringify(dependency)} already declared`, true);
63
+ }
64
+ else {
65
+ sapEntries[index].dependencies.push({
66
+ foundIn: dependencyIn,
67
+ object: dependency
68
+ });
69
+ }
65
70
  return sapEntries;
66
71
  };
67
72
  exports.parseSenvi = {
@@ -14,8 +14,9 @@ export interface LockfileContent {
14
14
  }
15
15
  export declare class Lockfile {
16
16
  lockfile: LockfileContent;
17
- constructor(lockfile: LockfileContent);
17
+ private constructor();
18
18
  static generate(root: TrmPackage, packages?: TrmPackage[]): Promise<Lockfile>;
19
+ static fromJson(json: any): Lockfile;
19
20
  toJson(): string;
20
21
  getLock(trmPackage: TrmPackage): Lock;
21
22
  static testReleaseByLock(lock: Lock): Promise<boolean>;
@@ -64,6 +64,12 @@ class Lockfile {
64
64
  return new Lockfile(lock);
65
65
  });
66
66
  }
67
+ static fromJson(json) {
68
+ if (json.lockfileVersion === 1) {
69
+ return new Lockfile(json);
70
+ }
71
+ throw new Error(`Unable to parse lockfile.`);
72
+ }
67
73
  toJson() {
68
74
  const KEYS_ORDER = [
69
75
  "lockfileVersion",
@@ -368,7 +368,7 @@ class RegistryV2 {
368
368
  if (!data) {
369
369
  var ttl;
370
370
  try {
371
- data = (yield this._axiosInstance.get(`/package/${encodeURIComponent(fullName)}`, {
371
+ data = (yield this._axiosInstance.get(`/package/${fullName}`, {
372
372
  params: {
373
373
  version: encodeURIComponent(version)
374
374
  }
@@ -417,7 +417,7 @@ class RegistryV2 {
417
417
  }
418
418
  validatePublish(fullName_1) {
419
419
  return __awaiter(this, arguments, void 0, function* (fullName, version = 'latest', isPrivate) {
420
- const status = (yield this._axiosInstance.get(`/publish/check/${encodeURIComponent(fullName)}`, {
420
+ const status = (yield this._axiosInstance.get(`/publish/check/${fullName}`, {
421
421
  params: {
422
422
  version: encodeURIComponent(version),
423
423
  private: isPrivate ? 'X' : 'N'
@@ -446,7 +446,7 @@ class RegistryV2 {
446
446
  if (!tags) {
447
447
  delete params.tags;
448
448
  }
449
- return (yield this._axiosInstance.post(`/publish/${encodeURIComponent(fullName)}`, formData, {
449
+ return (yield this._axiosInstance.post(`/publish/${fullName}`, formData, {
450
450
  params,
451
451
  headers: formData.getHeaders()
452
452
  })).data;
@@ -454,7 +454,7 @@ class RegistryV2 {
454
454
  }
455
455
  unpublish(fullName, version) {
456
456
  return __awaiter(this, void 0, void 0, function* () {
457
- yield this._axiosInstance.post(`/unpublish/${encodeURIComponent(fullName)}`, null, {
457
+ yield this._axiosInstance.post(`/unpublish/${fullName}`, null, {
458
458
  params: {
459
459
  version: encodeURIComponent(version)
460
460
  }
@@ -463,7 +463,7 @@ class RegistryV2 {
463
463
  }
464
464
  deprecate(fullName, version, deprecate) {
465
465
  return __awaiter(this, void 0, void 0, function* () {
466
- yield this._axiosInstance.post(`/deprecate/${encodeURIComponent(fullName)}`, {
466
+ yield this._axiosInstance.post(`/deprecate/${fullName}`, {
467
467
  deprecate_note: deprecate.deprecate_note
468
468
  }, {
469
469
  params: {
@@ -474,7 +474,7 @@ class RegistryV2 {
474
474
  }
475
475
  addDistTag(fullName, distTag) {
476
476
  return __awaiter(this, void 0, void 0, function* () {
477
- const status = (yield this._axiosInstance.put(`/package/tag/${encodeURIComponent(fullName)}`, distTag)).status;
477
+ const status = (yield this._axiosInstance.put(`/package/tag/${fullName}`, distTag)).status;
478
478
  if (status !== 204) {
479
479
  throw new Error(`Cannot add tag "${distTag.tag.trim().toUpperCase()}"`);
480
480
  }
@@ -482,7 +482,7 @@ class RegistryV2 {
482
482
  }
483
483
  rmDistTag(fullName, distTag) {
484
484
  return __awaiter(this, void 0, void 0, function* () {
485
- const status = (yield this._axiosInstance.delete(`/package/tag/${encodeURIComponent(fullName)}`, {
485
+ const status = (yield this._axiosInstance.delete(`/package/tag/${fullName}`, {
486
486
  data: distTag
487
487
  })).status;
488
488
  if (status !== 204) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-core",
3
- "version": "8.1.1",
3
+ "version": "8.1.3",
4
4
  "description": "TRM (Transport Request Manager) Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",