@pnpm/registry-access.commands 1100.2.15 → 1100.2.16

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.
@@ -14,7 +14,7 @@ export function cliOptionsTypes() {
14
14
  }
15
15
  export async function updateDeprecation(opts, { deprecated, packageName, versionRange }) {
16
16
  const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
17
- const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, registryUrl);
17
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
18
18
  const authHeader = getAuthHeader(registryUrl);
19
19
  const packageUrl = new URL(npa(packageName).escapedName, registryUrl).href;
20
20
  const fetchFromRegistry = createFetchFromRegistry(opts);
package/lib/distTag.js CHANGED
@@ -4,6 +4,7 @@ import { PnpmError } from '@pnpm/error';
4
4
  import { createGetAuthHeaderByURI } from '@pnpm/network.auth-header';
5
5
  import { createFetchFromRegistry } from '@pnpm/network.fetch';
6
6
  import npa from '@pnpm/npm-package-arg';
7
+ import { setDistTag } from '@pnpm/registry-access.client';
7
8
  import { renderHelp } from 'render-help';
8
9
  import semver from 'semver';
9
10
  import { parsePackageSpec, rcOptionsTypes } from './common.js';
@@ -103,19 +104,15 @@ async function distTagAdd(opts, params) {
103
104
  const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl);
104
105
  const fetchFromRegistry = createFetchFromRegistry(opts);
105
106
  const otp = opts.cliOptions?.otp;
106
- const distTagUrl = getDistTagUrl(packageName, registryUrl, tag);
107
- const response = await fetchFromRegistry(distTagUrl, {
108
- authHeaderValue: authHeader,
109
- method: 'PUT',
110
- headers: {
111
- 'content-type': 'application/json',
112
- ...(otp ? { 'npm-otp': otp } : {}),
113
- },
114
- body: JSON.stringify(version),
107
+ await setDistTag({
108
+ packageName,
109
+ version,
110
+ distTag: tag,
111
+ registryUrl,
112
+ authHeader,
113
+ fetchFromRegistry,
114
+ otp,
115
115
  });
116
- if (!response.ok) {
117
- await throwRegistryError(response, `set dist-tag "${tag}" on`);
118
- }
119
116
  return `+${tag}: ${packageName}@${version}`;
120
117
  }
121
118
  async function distTagRm(opts, params) {
@@ -150,7 +147,7 @@ async function distTagRm(opts, params) {
150
147
  return `-${tag}: ${packageName}@${distTags[tag]}`;
151
148
  }
152
149
  function getAuthHeaderForRegistry(configByUri, registryUrl) {
153
- const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {}, registryUrl);
150
+ const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {});
154
151
  return getAuthHeader(registryUrl);
155
152
  }
156
153
  function getDistTagUrl(packageName, registryUrl, tag) {
package/lib/owner.js CHANGED
@@ -133,7 +133,7 @@ async function ownerRm(opts, params) {
133
133
  return `-${owner}: ${packageName}`;
134
134
  }
135
135
  function getAuthHeaderForRegistry(configByUri, registryUrl) {
136
- const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {}, registryUrl);
136
+ const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {});
137
137
  return getAuthHeader(registryUrl);
138
138
  }
139
139
  function getOwnerUrl(escapedName, registryUrl, owner) {
package/lib/ping.js CHANGED
@@ -38,7 +38,7 @@ export async function handler(opts) {
38
38
  const pingUrlObject = new URL('./-/ping', normalizedRegistryUrl);
39
39
  pingUrlObject.searchParams.set('write', 'true');
40
40
  const pingUrl = pingUrlObject.toString();
41
- const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, normalizedRegistryUrl);
41
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
42
42
  const authHeaderValue = getAuthHeader(normalizedRegistryUrl);
43
43
  const fetchFromRegistry = createFetchFromRegistry(opts);
44
44
  const start = Date.now();
package/lib/search.js CHANGED
@@ -52,7 +52,7 @@ export async function handler(opts, params) {
52
52
  searchUrl.searchParams.set('text', query);
53
53
  searchUrl.searchParams.set('size', (opts.searchLimit ?? 20).toString());
54
54
  const fetchFromRegistry = createFetchFromRegistry(opts);
55
- const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, opts.registries?.default);
55
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
56
56
  const response = await fetchFromRegistry(searchUrl.toString(), {
57
57
  authHeaderValue: getAuthHeader(registry),
58
58
  });
@@ -87,7 +87,7 @@ async function performLegacyStarAction(args) {
87
87
  }
88
88
  }
89
89
  export function getAuthHeaderForRegistry(configByUri, registryUrl) {
90
- const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {}, registryUrl);
90
+ const getAuthHeader = createGetAuthHeaderByURI(configByUri ?? {});
91
91
  return getAuthHeader(registryUrl);
92
92
  }
93
93
  //# sourceMappingURL=common.js.map
package/lib/unpublish.js CHANGED
@@ -54,7 +54,7 @@ export async function handler(opts, params) {
54
54
  }
55
55
  async function unpublishPackage(packageName, versionRange, opts) {
56
56
  const registryUrl = pickRegistryForPackage(opts.registries ?? { default: 'https://registry.npmjs.org/' }, packageName);
57
- const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, registryUrl);
57
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
58
58
  const authHeader = getAuthHeader(registryUrl);
59
59
  const packageUrl = new URL(npa(packageName).escapedName, registryUrl).href;
60
60
  const fetchFromRegistry = createFetchFromRegistry(opts);
package/lib/whoami.js CHANGED
@@ -22,7 +22,7 @@ export function help() {
22
22
  }
23
23
  export async function handler(opts) {
24
24
  const registryUrl = normalizeRegistryUrl(opts.registries?.default ?? 'https://registry.npmjs.org/');
25
- const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, registryUrl);
25
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {});
26
26
  const authHeader = getAuthHeader(registryUrl);
27
27
  if (!authHeader) {
28
28
  throw new PnpmError('WHOAMI_UNAUTHORIZED', 'You must be logged in to use whoami');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/registry-access.commands",
3
- "version": "1100.2.15",
3
+ "version": "1100.2.16",
4
4
  "description": "Commands for managing packages on the registry",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -25,18 +25,19 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@pnpm/npm-package-arg": "^2.0.0",
28
- "chalk": "^5.6.0",
28
+ "chalk": "^5.6.2",
29
29
  "ramda": "npm:@pnpm/ramda@0.28.1",
30
30
  "render-help": "^2.0.0",
31
- "semver": "^7.7.2",
32
- "@pnpm/cli.utils": "1101.0.7",
33
- "@pnpm/config.reader": "1101.4.0",
31
+ "semver": "^7.8.1",
32
+ "@pnpm/cli.utils": "1101.0.8",
33
+ "@pnpm/config.pick-registry-for-package": "1100.0.6",
34
34
  "@pnpm/error": "1100.0.0",
35
- "@pnpm/config.pick-registry-for-package": "1100.0.5",
36
- "@pnpm/network.auth-header": "1100.0.3",
37
- "@pnpm/resolving.registry.types": "1100.0.4",
38
- "@pnpm/types": "1101.1.1",
39
- "@pnpm/network.fetch": "1100.0.6"
35
+ "@pnpm/config.reader": "1101.4.1",
36
+ "@pnpm/network.auth-header": "1101.0.0",
37
+ "@pnpm/registry-access.client": "1100.0.1",
38
+ "@pnpm/network.fetch": "1100.0.7",
39
+ "@pnpm/types": "1101.2.0",
40
+ "@pnpm/resolving.registry.types": "1100.0.5"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@jest/globals": "30.3.0",
@@ -44,11 +45,11 @@
44
45
  "@types/ramda": "0.31.1",
45
46
  "@types/semver": "7.7.1",
46
47
  "execa": "npm:safe-execa@0.3.0",
47
- "@pnpm/prepare": "1100.0.10",
48
- "@pnpm/registry-access.commands": "1100.2.15",
49
- "@pnpm/releasing.commands": "1100.3.0",
50
- "@pnpm/testing.command-defaults": "1100.0.1",
51
- "@pnpm/testing.mock-agent": "1100.0.6"
48
+ "@pnpm/prepare": "1100.0.11",
49
+ "@pnpm/registry-access.commands": "1100.2.16",
50
+ "@pnpm/testing.mock-agent": "1100.0.7",
51
+ "@pnpm/releasing.commands": "1100.3.1",
52
+ "@pnpm/testing.command-defaults": "1100.0.1"
52
53
  },
53
54
  "engines": {
54
55
  "node": ">=22.13"