@npmcli/config 10.4.2 → 10.4.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/definitions/definitions.js +110 -0
- package/lib/index.js +8 -2
- package/package.json +4 -4
|
@@ -274,6 +274,16 @@ const definitions = {
|
|
|
274
274
|
`,
|
|
275
275
|
flatten,
|
|
276
276
|
}),
|
|
277
|
+
'bypass-2fa': new Definition('bypass-2fa', {
|
|
278
|
+
default: false,
|
|
279
|
+
type: Boolean,
|
|
280
|
+
description: `
|
|
281
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
282
|
+
setting this to true will allow the token to bypass two-factor
|
|
283
|
+
authentication. This is useful for automation and CI/CD workflows.
|
|
284
|
+
`,
|
|
285
|
+
flatten,
|
|
286
|
+
}),
|
|
277
287
|
ca: new Definition('ca', {
|
|
278
288
|
default: null,
|
|
279
289
|
type: [null, String, Array],
|
|
@@ -624,6 +634,16 @@ const definitions = {
|
|
|
624
634
|
Can be either true (expect some results) or false (expect no results).
|
|
625
635
|
`,
|
|
626
636
|
}),
|
|
637
|
+
expires: new Definition('expires', {
|
|
638
|
+
default: null,
|
|
639
|
+
type: [null, Number],
|
|
640
|
+
description: `
|
|
641
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
642
|
+
this sets the expiration in days. If not specified, the server
|
|
643
|
+
will determine the default expiration.
|
|
644
|
+
`,
|
|
645
|
+
flatten,
|
|
646
|
+
}),
|
|
627
647
|
'fetch-retries': new Definition('fetch-retries', {
|
|
628
648
|
default: 2,
|
|
629
649
|
type: Number,
|
|
@@ -1281,6 +1301,16 @@ const definitions = {
|
|
|
1281
1301
|
Show extended information in \`ls\`, \`search\`, and \`help-search\`.
|
|
1282
1302
|
`,
|
|
1283
1303
|
}),
|
|
1304
|
+
name: new Definition('name', {
|
|
1305
|
+
default: null,
|
|
1306
|
+
type: [null, String],
|
|
1307
|
+
hint: '<name>',
|
|
1308
|
+
description: `
|
|
1309
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1310
|
+
this sets the name/description for the token.
|
|
1311
|
+
`,
|
|
1312
|
+
flatten,
|
|
1313
|
+
}),
|
|
1284
1314
|
maxsockets: new Definition('maxsockets', {
|
|
1285
1315
|
default: 15,
|
|
1286
1316
|
type: Number,
|
|
@@ -1409,6 +1439,17 @@ const definitions = {
|
|
|
1409
1439
|
definitions.omit.flatten('omit', obj, flatOptions)
|
|
1410
1440
|
},
|
|
1411
1441
|
}),
|
|
1442
|
+
orgs: new Definition('orgs', {
|
|
1443
|
+
default: null,
|
|
1444
|
+
type: [null, String, Array],
|
|
1445
|
+
hint: '<org1,org2>',
|
|
1446
|
+
description: `
|
|
1447
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1448
|
+
this limits the token access to specific organizations. Provide
|
|
1449
|
+
a comma-separated list of organization names.
|
|
1450
|
+
`,
|
|
1451
|
+
flatten,
|
|
1452
|
+
}),
|
|
1412
1453
|
optional: new Definition('optional', {
|
|
1413
1454
|
default: null,
|
|
1414
1455
|
type: [null, Boolean],
|
|
@@ -1505,6 +1546,17 @@ const definitions = {
|
|
|
1505
1546
|
`,
|
|
1506
1547
|
flatten,
|
|
1507
1548
|
}),
|
|
1549
|
+
packages: new Definition('packages', {
|
|
1550
|
+
default: [],
|
|
1551
|
+
type: [null, String, Array],
|
|
1552
|
+
hint: '<pkg1,pkg2>',
|
|
1553
|
+
description: `
|
|
1554
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1555
|
+
this limits the token access to specific packages. Provide
|
|
1556
|
+
a comma-separated list of package names.
|
|
1557
|
+
`,
|
|
1558
|
+
flatten,
|
|
1559
|
+
}),
|
|
1508
1560
|
parseable: new Definition('parseable', {
|
|
1509
1561
|
default: false,
|
|
1510
1562
|
type: Boolean,
|
|
@@ -1900,6 +1952,64 @@ const definitions = {
|
|
|
1900
1952
|
flatOptions.projectScope = scope
|
|
1901
1953
|
},
|
|
1902
1954
|
}),
|
|
1955
|
+
scopes: new Definition('scopes', {
|
|
1956
|
+
default: null,
|
|
1957
|
+
type: [null, String, Array],
|
|
1958
|
+
hint: '<@scope1,@scope2>',
|
|
1959
|
+
description: `
|
|
1960
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1961
|
+
this limits the token access to specific scopes. Provide
|
|
1962
|
+
a comma-separated list of scope names (with or without @ prefix).
|
|
1963
|
+
`,
|
|
1964
|
+
flatten,
|
|
1965
|
+
}),
|
|
1966
|
+
'packages-all': new Definition('packages-all', {
|
|
1967
|
+
default: false,
|
|
1968
|
+
type: Boolean,
|
|
1969
|
+
description: `
|
|
1970
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1971
|
+
grants the token access to all packages instead of limiting to
|
|
1972
|
+
specific packages.
|
|
1973
|
+
`,
|
|
1974
|
+
flatten,
|
|
1975
|
+
}),
|
|
1976
|
+
'packages-and-scopes-permission': new Definition('packages-and-scopes-permission', {
|
|
1977
|
+
default: null,
|
|
1978
|
+
type: [null, 'read-only', 'read-write', 'no-access'],
|
|
1979
|
+
description: `
|
|
1980
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1981
|
+
sets the permission level for packages and scopes. Options are
|
|
1982
|
+
"read-only", "read-write", or "no-access".
|
|
1983
|
+
`,
|
|
1984
|
+
flatten,
|
|
1985
|
+
}),
|
|
1986
|
+
'orgs-permission': new Definition('orgs-permission', {
|
|
1987
|
+
default: null,
|
|
1988
|
+
type: [null, 'read-only', 'read-write', 'no-access'],
|
|
1989
|
+
description: `
|
|
1990
|
+
When creating a Granular Access Token with \`npm token create\`,
|
|
1991
|
+
sets the permission level for organizations. Options are
|
|
1992
|
+
"read-only", "read-write", or "no-access".
|
|
1993
|
+
`,
|
|
1994
|
+
flatten,
|
|
1995
|
+
}),
|
|
1996
|
+
password: new Definition('password', {
|
|
1997
|
+
default: null,
|
|
1998
|
+
type: [null, String],
|
|
1999
|
+
description: `
|
|
2000
|
+
Password for authentication. Can be provided via command line when
|
|
2001
|
+
creating tokens, though it's generally safer to be prompted for it.
|
|
2002
|
+
`,
|
|
2003
|
+
flatten,
|
|
2004
|
+
}),
|
|
2005
|
+
'token-description': new Definition('token-description', {
|
|
2006
|
+
default: null,
|
|
2007
|
+
type: [null, String],
|
|
2008
|
+
description: `
|
|
2009
|
+
Description text for the token when using \`npm token create\`.
|
|
2010
|
+
`,
|
|
2011
|
+
flatten,
|
|
2012
|
+
}),
|
|
1903
2013
|
'script-shell': new Definition('script-shell', {
|
|
1904
2014
|
default: null,
|
|
1905
2015
|
defaultDescription: `
|
package/lib/index.js
CHANGED
|
@@ -132,15 +132,21 @@ class Config {
|
|
|
132
132
|
|
|
133
133
|
this.sources = new Map([])
|
|
134
134
|
|
|
135
|
-
this.list = []
|
|
136
135
|
for (const { data } of this.data.values()) {
|
|
137
136
|
this.list.unshift(data)
|
|
138
137
|
}
|
|
139
|
-
Object.freeze(this.list)
|
|
140
138
|
|
|
141
139
|
this.#loaded = false
|
|
142
140
|
}
|
|
143
141
|
|
|
142
|
+
get list () {
|
|
143
|
+
const list = []
|
|
144
|
+
for (const { data } of this.data.values()) {
|
|
145
|
+
list.unshift(data)
|
|
146
|
+
}
|
|
147
|
+
return list
|
|
148
|
+
}
|
|
149
|
+
|
|
144
150
|
get loaded () {
|
|
145
151
|
return this.#loaded
|
|
146
152
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/config",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.4",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@npmcli/map-workspaces": "^5.0.0",
|
|
41
41
|
"@npmcli/package-json": "^7.0.0",
|
|
42
42
|
"ci-info": "^4.0.0",
|
|
43
|
-
"ini": "^
|
|
44
|
-
"nopt": "^
|
|
45
|
-
"proc-log": "^
|
|
43
|
+
"ini": "^6.0.0",
|
|
44
|
+
"nopt": "^9.0.0",
|
|
45
|
+
"proc-log": "^6.0.0",
|
|
46
46
|
"semver": "^7.3.5",
|
|
47
47
|
"walk-up-path": "^4.0.0"
|
|
48
48
|
},
|