@pnpm/registry-access.commands 1100.3.3 → 1100.3.4
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/lib/deprecation/common.js +1 -1
- package/lib/distTag.js +5 -5
- package/lib/owner.js +5 -5
- package/lib/star/common.d.ts +1 -1
- package/lib/star/common.js +3 -3
- package/lib/unpublish.js +1 -1
- package/package.json +20 -20
|
@@ -15,7 +15,7 @@ export function cliOptionsTypes() {
|
|
|
15
15
|
export async function updateDeprecation(opts, { deprecated, packageName, versionRange }) {
|
|
16
16
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
17
17
|
const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
|
|
18
|
-
const authHeader = getAuthHeader(registryUrl);
|
|
18
|
+
const authHeader = getAuthHeader(registryUrl, { pkgName: packageName });
|
|
19
19
|
const packageUrl = new URL(npa(packageName).escapedName, registryUrl).href;
|
|
20
20
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
21
21
|
const getResponse = await fetchFromRegistry(packageUrl, {
|
package/lib/distTag.js
CHANGED
|
@@ -83,7 +83,7 @@ async function distTagLs(opts, params) {
|
|
|
83
83
|
}
|
|
84
84
|
const packageName = params[0];
|
|
85
85
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
86
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
86
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
87
87
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
88
88
|
const distTags = await fetchDistTags(packageName, registryUrl, fetchFromRegistry, authHeader);
|
|
89
89
|
const lines = [];
|
|
@@ -105,7 +105,7 @@ async function distTagAdd(opts, params) {
|
|
|
105
105
|
}
|
|
106
106
|
const tag = params[1] ?? 'latest';
|
|
107
107
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
108
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
108
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
109
109
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
110
110
|
const cliOtp = opts.cliOptions?.otp;
|
|
111
111
|
const authType = cliOtp ? 'legacy' : 'web';
|
|
@@ -135,7 +135,7 @@ async function distTagRm(opts, params) {
|
|
|
135
135
|
throw new PnpmError('DIST_TAG_RM_LATEST', 'Removing the "latest" dist-tag is not allowed');
|
|
136
136
|
}
|
|
137
137
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
138
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
138
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
139
139
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
140
140
|
const cliOtp = opts.cliOptions?.otp;
|
|
141
141
|
// First check the tag exists
|
|
@@ -199,9 +199,9 @@ function parseAuthError(body, action) {
|
|
|
199
199
|
}
|
|
200
200
|
return new PnpmError('UNAUTHORIZED', `You must be logged in to ${action} packages. ${body}`);
|
|
201
201
|
}
|
|
202
|
-
function getAuthHeaderForRegistry(configByUri, registryUrl) {
|
|
202
|
+
function getAuthHeaderForRegistry(configByUri, registryUrl, packageName) {
|
|
203
203
|
const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {});
|
|
204
|
-
return getAuthHeader(registryUrl);
|
|
204
|
+
return getAuthHeader(registryUrl, { pkgName: packageName });
|
|
205
205
|
}
|
|
206
206
|
function getDistTagUrl(packageName, registryUrl, tag) {
|
|
207
207
|
const encodedName = npa(packageName).escapedName;
|
package/lib/owner.js
CHANGED
|
@@ -75,7 +75,7 @@ async function ownerLs(opts, params) {
|
|
|
75
75
|
}
|
|
76
76
|
const { name: packageName, escapedName } = parsePackageSpec(params[0]);
|
|
77
77
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
78
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
78
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
79
79
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
80
80
|
const owners = await fetchOwners(packageName, escapedName, registryUrl, fetchFromRegistry, authHeader);
|
|
81
81
|
const lines = [];
|
|
@@ -91,7 +91,7 @@ async function ownerAdd(opts, params) {
|
|
|
91
91
|
const { name: packageName, escapedName } = parsePackageSpec(params[0]);
|
|
92
92
|
const owner = params[1];
|
|
93
93
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
94
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
94
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
95
95
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
96
96
|
const otp = opts.cliOptions?.otp;
|
|
97
97
|
const ownerUrl = getOwnerUrl(escapedName, registryUrl);
|
|
@@ -116,7 +116,7 @@ async function ownerRm(opts, params) {
|
|
|
116
116
|
const { name: packageName, escapedName } = parsePackageSpec(params[0]);
|
|
117
117
|
const owner = params[1];
|
|
118
118
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
119
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
119
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
120
120
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
121
121
|
const otp = opts.cliOptions?.otp;
|
|
122
122
|
const ownerUrl = getOwnerUrl(escapedName, registryUrl, owner);
|
|
@@ -132,9 +132,9 @@ async function ownerRm(opts, params) {
|
|
|
132
132
|
}
|
|
133
133
|
return `-${owner}: ${packageName}`;
|
|
134
134
|
}
|
|
135
|
-
function getAuthHeaderForRegistry(configByUri, registryUrl) {
|
|
135
|
+
function getAuthHeaderForRegistry(configByUri, registryUrl, packageName) {
|
|
136
136
|
const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {});
|
|
137
|
-
return getAuthHeader(registryUrl);
|
|
137
|
+
return getAuthHeader(registryUrl, { pkgName: packageName });
|
|
138
138
|
}
|
|
139
139
|
function getOwnerUrl(escapedName, registryUrl, owner) {
|
|
140
140
|
const base = new URL(`-/package/${escapedName}/owners`, registryUrl).href;
|
package/lib/star/common.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ interface StarActionArgs {
|
|
|
11
11
|
star: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare function performStarAction(opts: StarOptions, { packageName, star }: StarActionArgs): Promise<void>;
|
|
14
|
-
export declare function getAuthHeaderForRegistry(configByUri: Record<string, RegistryConfig> | undefined, registryUrl: string): string | undefined;
|
|
14
|
+
export declare function getAuthHeaderForRegistry(configByUri: Record<string, RegistryConfig> | undefined, registryUrl: string, packageName?: string): string | undefined;
|
|
15
15
|
export {};
|
package/lib/star/common.js
CHANGED
|
@@ -15,7 +15,7 @@ export function rcOptionsTypes() {
|
|
|
15
15
|
export async function performStarAction(opts, { packageName, star }) {
|
|
16
16
|
const { escapedName } = parsePackageSpec(packageName);
|
|
17
17
|
const registryUrl = normalizeRegistryUrl(pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName));
|
|
18
|
-
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
|
|
18
|
+
const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName);
|
|
19
19
|
const action = star ? 'star' : 'unstar';
|
|
20
20
|
if (!authHeader) {
|
|
21
21
|
throw new PnpmError('STAR_UNAUTHORIZED', `You must be logged in to ${action} packages`);
|
|
@@ -86,8 +86,8 @@ async function performLegacyStarAction(args) {
|
|
|
86
86
|
throw new PnpmError('REGISTRY_ERROR', `Failed to ${action} package (legacy): ${updateResponse.status} ${updateResponse.statusText}. ${errorBody}`);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
export function getAuthHeaderForRegistry(configByUri, registryUrl) {
|
|
89
|
+
export function getAuthHeaderForRegistry(configByUri, registryUrl, packageName) {
|
|
90
90
|
const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {});
|
|
91
|
-
return getAuthHeader(registryUrl);
|
|
91
|
+
return getAuthHeader(registryUrl, packageName ? { pkgName: packageName } : undefined);
|
|
92
92
|
}
|
|
93
93
|
//# sourceMappingURL=common.js.map
|
package/lib/unpublish.js
CHANGED
|
@@ -55,7 +55,7 @@ export async function handler(opts, params) {
|
|
|
55
55
|
async function unpublishPackage(packageName, versionRange, opts) {
|
|
56
56
|
const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
|
|
57
57
|
const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
|
|
58
|
-
const authHeader = getAuthHeader(registryUrl);
|
|
58
|
+
const authHeader = getAuthHeader(registryUrl, { pkgName: packageName });
|
|
59
59
|
const packageUrl = new URL(npa(packageName).escapedName, registryUrl).href;
|
|
60
60
|
const fetchFromRegistry = createFetchFromRegistry(opts);
|
|
61
61
|
const pkg = await fetchPackument(packageUrl, fetchFromRegistry, authHeader);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/registry-access.commands",
|
|
3
|
-
"version": "1100.3.
|
|
3
|
+
"version": "1100.3.4",
|
|
4
4
|
"description": "Commands for managing packages on the registry",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -32,33 +32,33 @@
|
|
|
32
32
|
"chalk": "^5.6.2",
|
|
33
33
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
34
34
|
"render-help": "^2.0.0",
|
|
35
|
-
"semver": "^7.8.
|
|
36
|
-
"@pnpm/
|
|
37
|
-
"@pnpm/config.reader": "1101.
|
|
35
|
+
"semver": "^7.8.4",
|
|
36
|
+
"@pnpm/cli.utils": "1101.0.12",
|
|
37
|
+
"@pnpm/config.reader": "1101.9.0",
|
|
38
38
|
"@pnpm/error": "1100.0.0",
|
|
39
|
-
"@pnpm/
|
|
40
|
-
"@pnpm/network.auth-header": "1101.1.
|
|
41
|
-
"@pnpm/network.web-auth": "1101.1.
|
|
42
|
-
"@pnpm/registry
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/
|
|
45
|
-
"@pnpm/
|
|
39
|
+
"@pnpm/network.fetch": "1100.1.3",
|
|
40
|
+
"@pnpm/network.auth-header": "1101.1.2",
|
|
41
|
+
"@pnpm/network.web-auth": "1101.1.1",
|
|
42
|
+
"@pnpm/resolving.registry.types": "1100.1.3",
|
|
43
|
+
"@pnpm/types": "1101.3.2",
|
|
44
|
+
"@pnpm/config.pick-registry-for-package": "1100.0.9",
|
|
45
|
+
"@pnpm/registry-access.client": "1100.1.4"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@pnpm/logger": "^
|
|
48
|
+
"@pnpm/logger": "^1100.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@jest/globals": "30.
|
|
51
|
+
"@jest/globals": "30.4.1",
|
|
52
52
|
"@types/ramda": "0.31.1",
|
|
53
53
|
"@types/semver": "7.7.1",
|
|
54
54
|
"execa": "npm:safe-execa@0.3.0",
|
|
55
|
-
"@pnpm/
|
|
56
|
-
"@pnpm/
|
|
57
|
-
"@pnpm/releasing.commands": "1100.
|
|
58
|
-
"@pnpm/
|
|
59
|
-
"@pnpm/testing.
|
|
60
|
-
"@pnpm/testing.mock
|
|
61
|
-
"@pnpm/
|
|
55
|
+
"@pnpm/prepare": "1100.0.16",
|
|
56
|
+
"@pnpm/registry-access.commands": "1100.3.4",
|
|
57
|
+
"@pnpm/releasing.commands": "1100.5.0",
|
|
58
|
+
"@pnpm/testing.command-defaults": "1100.0.6",
|
|
59
|
+
"@pnpm/testing.mock-agent": "1101.0.3",
|
|
60
|
+
"@pnpm/testing.registry-mock": "1100.0.6",
|
|
61
|
+
"@pnpm/logger": "1100.0.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22.13"
|