trm-core 8.1.1 → 8.1.2
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
|
@@ -14,8 +14,9 @@ export interface LockfileContent {
|
|
|
14
14
|
}
|
|
15
15
|
export declare class Lockfile {
|
|
16
16
|
lockfile: LockfileContent;
|
|
17
|
-
constructor(
|
|
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/${
|
|
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/${
|
|
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/${
|
|
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/${
|
|
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/${
|
|
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/${
|
|
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/${
|
|
485
|
+
const status = (yield this._axiosInstance.delete(`/package/tag/${fullName}`, {
|
|
486
486
|
data: distTag
|
|
487
487
|
})).status;
|
|
488
488
|
if (status !== 204) {
|