@maschinenlesbar.org/ckan-cli 0.8.0 → 0.9.0
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/README.md +56 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/client.d.ts +25 -1
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/client.js +63 -22
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/index.d.ts +2 -1
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/index.js +2 -1
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/operations.d.ts +441 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/operations.js +1211 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/portals.d.ts +2 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-client/dist/src/portals.js +2 -2
- package/dist/node_modules/@maschinenlesbar.org/ckan-log/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-log/dist/src/index.js +1 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-log/dist/src/log.d.ts +80 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-log/dist/src/log.js +124 -0
- package/dist/node_modules/@maschinenlesbar.org/ckan-log/package.json +25 -0
- package/dist/src/cli/index.js +3 -1
- package/dist/src/cli/io.d.ts +17 -0
- package/dist/src/cli/io.js +14 -0
- package/dist/src/cli/limits.d.ts +19 -0
- package/dist/src/cli/limits.js +53 -0
- package/dist/src/cli/program.js +3 -0
- package/dist/src/cli/run.js +9 -1
- package/dist/src/cli/shared.d.ts +4 -0
- package/dist/src/cli/shared.js +16 -1
- package/node_modules/commander/Readme.md +6 -32
- package/node_modules/commander/index.js +1 -1
- package/node_modules/commander/lib/command.js +22 -9
- package/node_modules/commander/lib/help.js +6 -2
- package/node_modules/commander/lib/option.js +1 -1
- package/node_modules/commander/package.json +2 -1
- package/node_modules/commander/typings/index.d.ts +6 -3
- package/package.json +2 -2
|
@@ -975,7 +975,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
975
975
|
// global overwrites local, like optsWithGlobals
|
|
976
976
|
let source;
|
|
977
977
|
this._getCommandAndAncestors().forEach((cmd) => {
|
|
978
|
-
if (cmd.
|
|
978
|
+
if (Object.hasOwn(cmd._optionValueSources, key)) {
|
|
979
979
|
source = cmd.getOptionValueSource(key);
|
|
980
980
|
}
|
|
981
981
|
});
|
|
@@ -1768,7 +1768,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1768
1768
|
|
|
1769
1769
|
const negativeNumberArg = (arg) => {
|
|
1770
1770
|
// return false if not a negative number
|
|
1771
|
-
if (!/^-(\d+|\d*\.\d+)(
|
|
1771
|
+
if (!/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(arg)) return false;
|
|
1772
1772
|
// negative number is ok unless digit used as an option in command hierarchy
|
|
1773
1773
|
return !this._getCommandAndAncestors().some((cmd) =>
|
|
1774
1774
|
cmd.options
|
|
@@ -2366,7 +2366,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2366
2366
|
* (This does not override a group set directly on the subcommand using .helpGroup().)
|
|
2367
2367
|
*
|
|
2368
2368
|
* @example
|
|
2369
|
-
* program.commandsGroup('Development Commands:);
|
|
2369
|
+
* program.commandsGroup('Development Commands:');
|
|
2370
2370
|
* program.command('watch')...
|
|
2371
2371
|
* program.command('lint')...
|
|
2372
2372
|
* ...
|
|
@@ -2562,7 +2562,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2562
2562
|
* Pass in false to disable the built-in help option.
|
|
2563
2563
|
*
|
|
2564
2564
|
* @example
|
|
2565
|
-
* program.helpOption('-?, --help' 'show help'); // customise
|
|
2565
|
+
* program.helpOption('-?, --help', 'show help'); // customise
|
|
2566
2566
|
* program.helpOption(false); // disable
|
|
2567
2567
|
*
|
|
2568
2568
|
* @param {(string | boolean)} flags
|
|
@@ -2720,7 +2720,12 @@ function incrementNodeInspectorPort(args) {
|
|
|
2720
2720
|
// Testing for these options:
|
|
2721
2721
|
// --inspect[=[host:]port]
|
|
2722
2722
|
// --inspect-brk[=[host:]port]
|
|
2723
|
+
// --inspect-wait[=[host:]port]
|
|
2723
2724
|
// --inspect-port=[host:]port
|
|
2725
|
+
//
|
|
2726
|
+
// Host can be an IP literal encapsulated within square brackets (e.g. [::1]),
|
|
2727
|
+
// an IPv4 address in dotted-decimal form (e.g. 192.168.0.1), or a registered name.
|
|
2728
|
+
// https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.2
|
|
2724
2729
|
return args.map((arg) => {
|
|
2725
2730
|
if (!arg.startsWith('--inspect')) {
|
|
2726
2731
|
return arg;
|
|
@@ -2729,24 +2734,32 @@ function incrementNodeInspectorPort(args) {
|
|
|
2729
2734
|
let debugHost = '127.0.0.1';
|
|
2730
2735
|
let debugPort = '9229';
|
|
2731
2736
|
let match;
|
|
2732
|
-
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
2737
|
+
if ((match = arg.match(/^(--inspect(-brk|-wait)?)$/)) !== null) {
|
|
2733
2738
|
// e.g. --inspect
|
|
2734
2739
|
debugOption = match[1];
|
|
2735
2740
|
} else if (
|
|
2736
|
-
(match = arg.match(
|
|
2741
|
+
(match = arg.match(
|
|
2742
|
+
/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/,
|
|
2743
|
+
)) !== null
|
|
2737
2744
|
) {
|
|
2745
|
+
// Matches a host or a port, but not both. No colon to separate them.
|
|
2738
2746
|
debugOption = match[1];
|
|
2739
2747
|
if (/^\d+$/.test(match[3])) {
|
|
2748
|
+
// Plain digits so a port number.
|
|
2740
2749
|
// e.g. --inspect=1234
|
|
2741
2750
|
debugPort = match[3];
|
|
2742
2751
|
} else {
|
|
2743
|
-
//
|
|
2752
|
+
// Assume a host.
|
|
2753
|
+
// e.g. --inspect=localhost, --inspect=[::1], --inspect=192.168.0.1
|
|
2744
2754
|
debugHost = match[3];
|
|
2745
2755
|
}
|
|
2746
2756
|
} else if (
|
|
2747
|
-
(match = arg.match(
|
|
2757
|
+
(match = arg.match(
|
|
2758
|
+
/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/,
|
|
2759
|
+
)) !== null
|
|
2748
2760
|
) {
|
|
2749
|
-
//
|
|
2761
|
+
// Matched host:port pattern.
|
|
2762
|
+
// e.g. --inspect=localhost:1234, --inspect=[::1]:1234, --inspect=192.168.0.1:1234
|
|
2750
2763
|
debugOption = match[1];
|
|
2751
2764
|
debugHost = match[3];
|
|
2752
2765
|
debugPort = match[4];
|
|
@@ -89,11 +89,15 @@ export class Help {
|
|
|
89
89
|
visibleOptions.push(helpOption); // no changes needed
|
|
90
90
|
} else if (helpOption.long && !removeLong) {
|
|
91
91
|
visibleOptions.push(
|
|
92
|
-
cmd
|
|
92
|
+
cmd
|
|
93
|
+
.createOption(helpOption.long, helpOption.description)
|
|
94
|
+
.helpGroup(helpOption.helpGroupHeading),
|
|
93
95
|
);
|
|
94
96
|
} else if (helpOption.short && !removeShort) {
|
|
95
97
|
visibleOptions.push(
|
|
96
|
-
cmd
|
|
98
|
+
cmd
|
|
99
|
+
.createOption(helpOption.short, helpOption.description)
|
|
100
|
+
.helpGroup(helpOption.helpGroupHeading),
|
|
97
101
|
);
|
|
98
102
|
}
|
|
99
103
|
}
|
|
@@ -15,7 +15,7 @@ export class Option {
|
|
|
15
15
|
this.required = flags.includes('<'); // A value must be supplied when the option is specified.
|
|
16
16
|
this.optional = flags.includes('['); // A value is optional when the option is specified.
|
|
17
17
|
// variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument
|
|
18
|
-
this.variadic = /\
|
|
18
|
+
this.variadic = /\p{ID_Continue}\.\.\.[>\]]$/u.test(flags); // The option can take multiple values.
|
|
19
19
|
this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.
|
|
20
20
|
const optionFlags = splitOptionFlags(flags);
|
|
21
21
|
this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commander",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.1.0",
|
|
4
4
|
"description": "the complete solution for node.js command-line programs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commander",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@types/node": "^22.7.4",
|
|
51
51
|
"eslint": "^10.0.2",
|
|
52
52
|
"eslint-config-prettier": "^10.0.1",
|
|
53
|
+
"eslint-node-test": "^1.0.0",
|
|
53
54
|
"globals": "^17.3.0",
|
|
54
55
|
"prettier": "^3.2.5",
|
|
55
56
|
"tsd": "^0.33.0",
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
|
|
11
11
|
// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
|
|
12
12
|
type LiteralUnion<LiteralType, BaseType extends string | number> =
|
|
13
|
-
|
|
|
14
|
-
| (BaseType & Record<never, never>);
|
|
13
|
+
LiteralType | (BaseType & Record<never, never>);
|
|
15
14
|
|
|
16
15
|
export class CommanderError extends Error {
|
|
17
16
|
code: string;
|
|
@@ -35,7 +34,7 @@ export class InvalidArgumentError extends CommanderError {
|
|
|
35
34
|
*/
|
|
36
35
|
constructor(message: string);
|
|
37
36
|
}
|
|
38
|
-
export { InvalidArgumentError as InvalidOptionArgumentError };
|
|
37
|
+
export { InvalidArgumentError as InvalidOptionArgumentError };
|
|
39
38
|
|
|
40
39
|
export interface ErrorOptions {
|
|
41
40
|
// optional parameter for error()
|
|
@@ -711,10 +710,13 @@ export class Command {
|
|
|
711
710
|
*
|
|
712
711
|
* @returns `this` command for chaining
|
|
713
712
|
*/
|
|
713
|
+
/** @deprecated since v15 */
|
|
714
714
|
storeOptionsAsProperties<T extends OptionValues>(): this & T;
|
|
715
|
+
/** @deprecated since v15 */
|
|
715
716
|
storeOptionsAsProperties<T extends OptionValues>(
|
|
716
717
|
storeAsProperties: true,
|
|
717
718
|
): this & T;
|
|
719
|
+
/** @deprecated since v15 */
|
|
718
720
|
storeOptionsAsProperties(storeAsProperties?: boolean): this;
|
|
719
721
|
|
|
720
722
|
/**
|
|
@@ -758,6 +760,7 @@ export class Command {
|
|
|
758
760
|
*
|
|
759
761
|
* @returns `this` command for chaining
|
|
760
762
|
*/
|
|
763
|
+
/** @deprecated since v15 */
|
|
761
764
|
combineFlagAndOptionalValue(combine?: boolean): this;
|
|
762
765
|
|
|
763
766
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maschinenlesbar.org/ckan-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "TypeScript API client and CLI for any CKAN open-data portal (Action API v3), e.g. the Hamburg Transparenzportal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"commander": "15.
|
|
63
|
+
"commander": "15.1.0"
|
|
64
64
|
},
|
|
65
65
|
"bundleDependencies": [
|
|
66
66
|
"commander"
|