@shell-shock/core 0.10.0 → 0.12.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/dist/components/docs.cjs +4 -4
- package/dist/components/docs.cjs.map +1 -1
- package/dist/components/docs.d.cts +5 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/helpers.cjs +9 -0
- package/dist/components/helpers.cjs.map +1 -1
- package/dist/components/helpers.d.cts +15 -7
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +15 -7
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/helpers.mjs +9 -1
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/options-parser-logic.cjs +167 -87
- package/dist/components/options-parser-logic.cjs.map +1 -1
- package/dist/components/options-parser-logic.d.cts +15 -15
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +15 -15
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +163 -83
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/usage.cjs +5 -5
- package/dist/components/usage.cjs.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +2 -2
- package/dist/components/usage.mjs +4 -4
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +2 -2
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts +9 -9
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +9 -9
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +5 -5
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/contexts/options.cjs +2 -2
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.d.cts +1 -1
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +4 -4
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +2 -2
- package/dist/helpers/automd.cjs.map +1 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/paths.cjs +125 -0
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +121 -0
- package/dist/helpers/paths.mjs.map +1 -0
- package/dist/helpers/persistence.cjs +68 -116
- package/dist/helpers/persistence.cjs.map +1 -1
- package/dist/helpers/persistence.mjs +68 -116
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +4 -4
- package/dist/helpers/update-package-json.cjs.map +1 -1
- package/dist/helpers/utilities.cjs +1 -1
- package/dist/helpers/utilities.mjs +1 -1
- package/dist/helpers/validations.cjs +2 -3
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs +2 -2
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +14 -11
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/plugin-utils/deepkit.cjs +72 -0
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +24 -0
- package/dist/plugin-utils/deepkit.d.cts.map +1 -0
- package/dist/plugin-utils/deepkit.d.mts +24 -0
- package/dist/plugin-utils/deepkit.d.mts.map +1 -0
- package/dist/plugin-utils/deepkit.mjs +70 -0
- package/dist/plugin-utils/deepkit.mjs.map +1 -0
- package/dist/plugin-utils/description-helpers.cjs +105 -0
- package/dist/plugin-utils/description-helpers.cjs.map +1 -0
- package/dist/plugin-utils/description-helpers.d.cts +44 -0
- package/dist/plugin-utils/description-helpers.d.cts.map +1 -0
- package/dist/plugin-utils/description-helpers.d.mts +44 -0
- package/dist/plugin-utils/description-helpers.d.mts.map +1 -0
- package/dist/plugin-utils/description-helpers.mjs +101 -0
- package/dist/plugin-utils/description-helpers.mjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.cjs +2 -2
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/index.cjs +32 -18
- package/dist/plugin-utils/index.d.cts +4 -1
- package/dist/plugin-utils/index.d.mts +4 -1
- package/dist/plugin-utils/index.mjs +4 -1
- package/dist/plugin-utils/reflect.cjs +4 -5
- package/dist/plugin-utils/reflect.cjs.map +1 -1
- package/dist/plugin-utils/reflect.mjs +4 -4
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +89 -0
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +42 -0
- package/dist/plugin-utils/type-checks.d.cts.map +1 -0
- package/dist/plugin-utils/type-checks.d.mts +42 -0
- package/dist/plugin-utils/type-checks.d.mts.map +1 -0
- package/dist/plugin-utils/type-checks.mjs +84 -0
- package/dist/plugin-utils/type-checks.mjs.map +1 -0
- package/dist/plugin.cjs +31 -29
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +15 -13
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +132 -0
- package/dist/resolver/deepkit.cjs.map +1 -0
- package/dist/resolver/deepkit.mjs +131 -0
- package/dist/resolver/deepkit.mjs.map +1 -0
- package/dist/resolver/helpers.cjs +167 -0
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +162 -0
- package/dist/resolver/helpers.mjs.map +1 -0
- package/dist/resolver/module.cjs +144 -0
- package/dist/resolver/module.cjs.map +1 -0
- package/dist/resolver/module.mjs +143 -0
- package/dist/resolver/module.mjs.map +1 -0
- package/dist/resolver/resolve.cjs +209 -0
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +208 -0
- package/dist/resolver/resolve.mjs.map +1 -0
- package/dist/types/command.cjs +127 -104
- package/dist/types/command.cjs.map +1 -1
- package/dist/types/command.d.cts +39 -78
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +39 -78
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +115 -95
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +5 -3
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.cts +7 -3
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +7 -3
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +5 -3
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +1 -1
- package/dist/types/context.cjs.map +1 -1
- package/dist/types/context.d.cts +2 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +2 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +1 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/index.cjs +13 -10
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +2 -2
- package/package.json +24 -75
- package/dist/helpers/resolve-command.cjs +0 -430
- package/dist/helpers/resolve-command.cjs.map +0 -1
- package/dist/helpers/resolve-command.mjs +0 -425
- package/dist/helpers/resolve-command.mjs.map +0 -1
package/dist/types/command.cjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/types/command.ts
|
|
3
|
-
const __Ω
|
|
3
|
+
const __ΩPick = [
|
|
4
|
+
"T",
|
|
4
5
|
"K",
|
|
6
|
+
"Pick",
|
|
7
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
8
|
+
];
|
|
9
|
+
const __ΩPartial = [
|
|
5
10
|
"T",
|
|
6
|
-
"
|
|
7
|
-
"l
|
|
11
|
+
"Partial",
|
|
12
|
+
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
8
13
|
];
|
|
9
14
|
const __ΩOmit = [
|
|
10
15
|
"T",
|
|
@@ -14,11 +19,11 @@ const __ΩOmit = [
|
|
|
14
19
|
"Omit",
|
|
15
20
|
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
16
21
|
];
|
|
17
|
-
const __Ω
|
|
18
|
-
"T",
|
|
22
|
+
const __ΩRecord = [
|
|
19
23
|
"K",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
24
|
+
"T",
|
|
25
|
+
"Record",
|
|
26
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
22
27
|
];
|
|
23
28
|
const __ΩExclude = [
|
|
24
29
|
"T",
|
|
@@ -26,9 +31,21 @@ const __ΩExclude = [
|
|
|
26
31
|
"Exclude",
|
|
27
32
|
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
28
33
|
];
|
|
34
|
+
const __ΩCommandParameterType = ["CommandParameterType", "P&')P&'JFJw!y"];
|
|
35
|
+
const CommandParameterKinds = {
|
|
36
|
+
string: "string",
|
|
37
|
+
number: "number",
|
|
38
|
+
boolean: "boolean"
|
|
39
|
+
};
|
|
40
|
+
const __ΩCommandParameterKind = [
|
|
41
|
+
() => CommandParameterKinds,
|
|
42
|
+
() => CommandParameterKinds,
|
|
43
|
+
"CommandParameterKind",
|
|
44
|
+
"i!i\"gfw#y"
|
|
45
|
+
];
|
|
29
46
|
const __ΩBaseCommandParameter = [
|
|
30
47
|
"name",
|
|
31
|
-
|
|
48
|
+
() => __ΩCommandParameterKind,
|
|
32
49
|
"kind",
|
|
33
50
|
"title",
|
|
34
51
|
"description",
|
|
@@ -37,96 +54,124 @@ const __ΩBaseCommandParameter = [
|
|
|
37
54
|
"env",
|
|
38
55
|
"optional",
|
|
39
56
|
"BaseCommandParameter",
|
|
40
|
-
"P&4
|
|
57
|
+
"P&4!n\"4#&4$&4%&F4&P&.'J4()4)Mw*y"
|
|
41
58
|
];
|
|
42
59
|
const __ΩStringCommandParameter = [
|
|
43
60
|
() => __ΩBaseCommandParameter,
|
|
44
|
-
|
|
61
|
+
"string",
|
|
45
62
|
"kind",
|
|
46
63
|
"default",
|
|
64
|
+
"email",
|
|
65
|
+
"uri",
|
|
66
|
+
"uuid",
|
|
67
|
+
"ipv4",
|
|
68
|
+
"ipv6",
|
|
69
|
+
"date",
|
|
70
|
+
"time",
|
|
71
|
+
"date-time",
|
|
72
|
+
"duration",
|
|
73
|
+
"format",
|
|
47
74
|
"variadic",
|
|
48
75
|
"choices",
|
|
49
76
|
"StringCommandParameter",
|
|
50
|
-
"Pn
|
|
77
|
+
"Pn!.\"4#&4$8P.%.&.'.(.).*.+.,.-J4.8)4/&F408Mw1y"
|
|
51
78
|
];
|
|
52
79
|
const __ΩNumberCommandParameter = [
|
|
53
80
|
() => __ΩBaseCommandParameter,
|
|
54
|
-
|
|
81
|
+
"number",
|
|
55
82
|
"kind",
|
|
56
83
|
"default",
|
|
57
84
|
"variadic",
|
|
58
85
|
"choices",
|
|
59
86
|
"NumberCommandParameter",
|
|
60
|
-
"Pn
|
|
87
|
+
"Pn!.\"4#'4$8)4%'F4&8Mw'y"
|
|
61
88
|
];
|
|
62
89
|
const __ΩBooleanCommandParameter = [
|
|
63
90
|
() => __ΩBaseCommandParameter,
|
|
64
|
-
|
|
91
|
+
"boolean",
|
|
65
92
|
"kind",
|
|
66
93
|
"default",
|
|
67
|
-
"isNegativeOf",
|
|
68
|
-
"skipAddingNegative",
|
|
69
94
|
"BooleanCommandParameter",
|
|
70
|
-
"Pn
|
|
95
|
+
"Pn!.\"4#)4$8Mw%y"
|
|
71
96
|
];
|
|
72
|
-
const __Ω
|
|
97
|
+
const __ΩCommandParameter = [
|
|
73
98
|
() => __ΩStringCommandParameter,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
"Pn
|
|
99
|
+
() => __ΩNumberCommandParameter,
|
|
100
|
+
() => __ΩBooleanCommandParameter,
|
|
101
|
+
"CommandParameter",
|
|
102
|
+
"Pn!n\"n#Jw$y"
|
|
78
103
|
];
|
|
79
|
-
const __Ω
|
|
104
|
+
const __ΩAsCommandParameterConfig = [
|
|
105
|
+
"T",
|
|
106
|
+
() => __ΩPick,
|
|
107
|
+
"kind",
|
|
108
|
+
"alias",
|
|
109
|
+
() => __ΩPartial,
|
|
110
|
+
() => __ΩOmit,
|
|
111
|
+
"kind",
|
|
112
|
+
"alias",
|
|
113
|
+
"alias",
|
|
114
|
+
"AsCommandParameterConfig",
|
|
115
|
+
"b!Pe\"!P.#.$Jo\"#e\"!P.'.(Jo&#o%\"PP&&FJ4)8MKw*y"
|
|
116
|
+
];
|
|
117
|
+
const __ΩStringCommandParameterConfig = [
|
|
118
|
+
() => __ΩAsCommandParameterConfig,
|
|
119
|
+
() => __ΩStringCommandParameter,
|
|
120
|
+
"StringCommandParameterConfig",
|
|
121
|
+
"n\"o!\"w#y"
|
|
122
|
+
];
|
|
123
|
+
const __ΩNumberCommandParameterConfig = [
|
|
124
|
+
() => __ΩAsCommandParameterConfig,
|
|
80
125
|
() => __ΩNumberCommandParameter,
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
126
|
+
"NumberCommandParameterConfig",
|
|
127
|
+
"n\"o!\"w#y"
|
|
128
|
+
];
|
|
129
|
+
const __ΩBooleanCommandParameterConfig = [
|
|
130
|
+
() => __ΩAsCommandParameterConfig,
|
|
131
|
+
() => __ΩBooleanCommandParameter,
|
|
132
|
+
"BooleanCommandParameterConfig",
|
|
133
|
+
"n\"o!\"w#y"
|
|
134
|
+
];
|
|
135
|
+
const __ΩCommandParameterConfig = [
|
|
136
|
+
() => __ΩStringCommandParameterConfig,
|
|
137
|
+
() => __ΩNumberCommandParameterConfig,
|
|
138
|
+
() => __ΩBooleanCommandParameterConfig,
|
|
139
|
+
"CommandParameterConfig",
|
|
140
|
+
"Pn!n\"n#Jw$y"
|
|
85
141
|
];
|
|
86
142
|
const __ΩBooleanCommandOption = [
|
|
87
143
|
() => __ΩBooleanCommandParameter,
|
|
88
|
-
"ReflectionProperty",
|
|
89
|
-
"reflection",
|
|
90
144
|
"isNegativeOf",
|
|
91
145
|
"skipAddingNegative",
|
|
92
146
|
"BooleanCommandOption",
|
|
93
|
-
"Pn
|
|
147
|
+
"Pn!&4\"8)4#8Mw$y"
|
|
94
148
|
];
|
|
95
149
|
const __ΩCommandOption = [
|
|
96
|
-
() => __Ω
|
|
97
|
-
() => __Ω
|
|
150
|
+
() => __ΩStringCommandParameter,
|
|
151
|
+
() => __ΩNumberCommandParameter,
|
|
98
152
|
() => __ΩBooleanCommandOption,
|
|
99
153
|
"CommandOption",
|
|
100
154
|
"Pn!n\"n#Jw$y"
|
|
101
155
|
];
|
|
102
|
-
const __Ω
|
|
103
|
-
() => __Ω
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"Pn!\"w\"4#Mw$y"
|
|
156
|
+
const __ΩCommandOptionConfig = [
|
|
157
|
+
() => __ΩAsCommandParameterConfig,
|
|
158
|
+
() => __ΩCommandOption,
|
|
159
|
+
"CommandOptionConfig",
|
|
160
|
+
"n\"o!\"w#y"
|
|
108
161
|
];
|
|
109
|
-
const __Ω
|
|
162
|
+
const __ΩCommandArgument = [
|
|
163
|
+
() => __ΩStringCommandParameter,
|
|
110
164
|
() => __ΩNumberCommandParameter,
|
|
111
|
-
"ReflectionParameter",
|
|
112
|
-
"reflection",
|
|
113
|
-
"NumberCommandArgument",
|
|
114
|
-
"Pn!\"w\"4#Mw$y"
|
|
115
|
-
];
|
|
116
|
-
const __ΩBooleanCommandArgument = [
|
|
117
165
|
() => __ΩBooleanCommandParameter,
|
|
118
|
-
"ReflectionParameter",
|
|
119
|
-
"reflection",
|
|
120
|
-
"BooleanCommandArgument",
|
|
121
|
-
"Pn!\"w\"4#Mw$y"
|
|
122
|
-
];
|
|
123
|
-
const __ΩCommandArgument = [
|
|
124
|
-
() => __ΩStringCommandArgument,
|
|
125
|
-
() => __ΩNumberCommandArgument,
|
|
126
|
-
() => __ΩBooleanCommandArgument,
|
|
127
166
|
"CommandArgument",
|
|
128
167
|
"Pn!n\"n#Jw$y"
|
|
129
168
|
];
|
|
169
|
+
const __ΩCommandArgumentConfig = [
|
|
170
|
+
() => __ΩAsCommandParameterConfig,
|
|
171
|
+
() => __ΩCommandArgument,
|
|
172
|
+
"CommandArgumentConfig",
|
|
173
|
+
"n\"o!\"w#y"
|
|
174
|
+
];
|
|
130
175
|
const __ΩCommandBase = [
|
|
131
176
|
"id",
|
|
132
177
|
"name",
|
|
@@ -140,15 +185,15 @@ const __ΩCommandBase = [
|
|
|
140
185
|
"CommandBase",
|
|
141
186
|
"PP&,J4!&4\"P&,J4#&F4$&4%8&4&8&F4'8&4(8)4)Mw*y"
|
|
142
187
|
];
|
|
143
|
-
const __Ω
|
|
188
|
+
const __ΩCommandConfig = [
|
|
144
189
|
() => __ΩCommandBase,
|
|
145
190
|
"id",
|
|
146
191
|
"entry",
|
|
147
|
-
"
|
|
192
|
+
"CommandConfig",
|
|
148
193
|
"Pn!&4\"!4#Mw$y"
|
|
149
194
|
];
|
|
150
195
|
const __ΩCommandTree = [
|
|
151
|
-
() => __Ω
|
|
196
|
+
() => __ΩCommandConfig,
|
|
152
197
|
"title",
|
|
153
198
|
"description",
|
|
154
199
|
"alias",
|
|
@@ -156,95 +201,73 @@ const __ΩCommandTree = [
|
|
|
156
201
|
() => __ΩCommandOption,
|
|
157
202
|
"options",
|
|
158
203
|
() => __ΩCommandArgument,
|
|
159
|
-
"
|
|
204
|
+
"args",
|
|
160
205
|
0,
|
|
161
206
|
"parent",
|
|
162
207
|
() => __ΩRecord,
|
|
163
208
|
0,
|
|
164
209
|
"children",
|
|
165
|
-
"ReflectionFunction",
|
|
166
|
-
"reflection",
|
|
167
210
|
"CommandTree",
|
|
168
|
-
"Pn!P&4\"&4#&F4$&n&o%#4'n(F4)P,n*J4+&n-o,#4.
|
|
169
|
-
];
|
|
170
|
-
const __ΩSerializedCommandOption = [
|
|
171
|
-
() => __ΩOmit,
|
|
172
|
-
() => __ΩCommandOption,
|
|
173
|
-
"reflection",
|
|
174
|
-
"SerializedCommandOption",
|
|
175
|
-
"n\".#o!#w$y"
|
|
176
|
-
];
|
|
177
|
-
const __ΩSerializedCommandArgument = [
|
|
178
|
-
() => __ΩOmit,
|
|
179
|
-
() => __ΩCommandArgument,
|
|
180
|
-
"reflection",
|
|
181
|
-
"SerializedCommandArgument",
|
|
182
|
-
"n\".#o!#w$y"
|
|
211
|
+
"Pn!P&4\"&4#&F4$&n&o%#4'n(F4)P,n*J4+&n-o,#4.MKw/y"
|
|
183
212
|
];
|
|
184
213
|
const __ΩSerializedCommandTree = [
|
|
185
214
|
() => __ΩOmit,
|
|
186
215
|
() => __ΩCommandTree,
|
|
187
|
-
"options",
|
|
188
|
-
"arguments",
|
|
189
216
|
"parent",
|
|
190
217
|
"children",
|
|
191
|
-
"reflection",
|
|
192
|
-
() => __ΩRecord,
|
|
193
|
-
() => __ΩSerializedCommandOption,
|
|
194
|
-
"options",
|
|
195
|
-
() => __ΩSerializedCommandArgument,
|
|
196
|
-
"arguments",
|
|
197
218
|
"parent",
|
|
198
219
|
() => __ΩRecord,
|
|
199
220
|
0,
|
|
200
221
|
"children",
|
|
201
|
-
"SerializedTypes",
|
|
202
|
-
"reflection",
|
|
203
222
|
"SerializedCommandTree",
|
|
204
|
-
"Pn\"P
|
|
223
|
+
"Pn\"P.#.$Jo!#PP,&J4%&n'o(MKw)y"
|
|
205
224
|
];
|
|
206
|
-
const __Ω
|
|
225
|
+
const __ΩCommandMetadata = [
|
|
207
226
|
"title",
|
|
208
227
|
"description",
|
|
209
228
|
"alias",
|
|
210
229
|
"icon",
|
|
211
|
-
"
|
|
230
|
+
"CommandMetadata",
|
|
212
231
|
"P&4!8&4\"8P&&FJ4#8&4$8Mw%y"
|
|
213
232
|
];
|
|
214
|
-
const __ΩCommandParameterSchema = ["CommandParameterSchema", "P!!Jw!y"];
|
|
215
233
|
const __ΩCommandModule = [
|
|
216
|
-
() => __Ω
|
|
234
|
+
() => __ΩCommandMetadata,
|
|
217
235
|
"metadata",
|
|
218
236
|
() => __ΩRecord,
|
|
219
|
-
() => __Ω
|
|
237
|
+
() => __ΩCommandOptionConfig,
|
|
238
|
+
"JSONSchema7Object",
|
|
239
|
+
"StandardJSONSchemaV1",
|
|
220
240
|
"options",
|
|
221
|
-
() => __Ω
|
|
222
|
-
"
|
|
241
|
+
() => __ΩCommandArgumentConfig,
|
|
242
|
+
"args",
|
|
223
243
|
"default",
|
|
224
244
|
"CommandModule",
|
|
225
|
-
"Pn!4\"
|
|
245
|
+
"Pn!4\"8P&n$o##\"w%\"w&!J4'8Pn(F!\"w&!J4)8!4*8Mw+y"
|
|
226
246
|
];
|
|
227
247
|
|
|
228
248
|
//#endregion
|
|
249
|
+
exports.CommandParameterKinds = CommandParameterKinds;
|
|
250
|
+
exports.__ΩAsCommandParameterConfig = __ΩAsCommandParameterConfig;
|
|
229
251
|
exports.__ΩBaseCommandParameter = __ΩBaseCommandParameter;
|
|
230
|
-
exports.__ΩBooleanCommandArgument = __ΩBooleanCommandArgument;
|
|
231
252
|
exports.__ΩBooleanCommandOption = __ΩBooleanCommandOption;
|
|
232
253
|
exports.__ΩBooleanCommandParameter = __ΩBooleanCommandParameter;
|
|
254
|
+
exports.__ΩBooleanCommandParameterConfig = __ΩBooleanCommandParameterConfig;
|
|
233
255
|
exports.__ΩCommandArgument = __ΩCommandArgument;
|
|
256
|
+
exports.__ΩCommandArgumentConfig = __ΩCommandArgumentConfig;
|
|
234
257
|
exports.__ΩCommandBase = __ΩCommandBase;
|
|
235
|
-
exports.__Ω
|
|
258
|
+
exports.__ΩCommandConfig = __ΩCommandConfig;
|
|
259
|
+
exports.__ΩCommandMetadata = __ΩCommandMetadata;
|
|
236
260
|
exports.__ΩCommandModule = __ΩCommandModule;
|
|
237
261
|
exports.__ΩCommandOption = __ΩCommandOption;
|
|
238
|
-
exports.__Ω
|
|
262
|
+
exports.__ΩCommandOptionConfig = __ΩCommandOptionConfig;
|
|
263
|
+
exports.__ΩCommandParameter = __ΩCommandParameter;
|
|
264
|
+
exports.__ΩCommandParameterConfig = __ΩCommandParameterConfig;
|
|
265
|
+
exports.__ΩCommandParameterKind = __ΩCommandParameterKind;
|
|
266
|
+
exports.__ΩCommandParameterType = __ΩCommandParameterType;
|
|
239
267
|
exports.__ΩCommandTree = __ΩCommandTree;
|
|
240
|
-
exports.__ΩMetadata = __ΩMetadata;
|
|
241
|
-
exports.__ΩNumberCommandArgument = __ΩNumberCommandArgument;
|
|
242
|
-
exports.__ΩNumberCommandOption = __ΩNumberCommandOption;
|
|
243
268
|
exports.__ΩNumberCommandParameter = __ΩNumberCommandParameter;
|
|
244
|
-
exports.__Ω
|
|
245
|
-
exports.__ΩSerializedCommandOption = __ΩSerializedCommandOption;
|
|
269
|
+
exports.__ΩNumberCommandParameterConfig = __ΩNumberCommandParameterConfig;
|
|
246
270
|
exports.__ΩSerializedCommandTree = __ΩSerializedCommandTree;
|
|
247
|
-
exports.__ΩStringCommandArgument = __ΩStringCommandArgument;
|
|
248
|
-
exports.__ΩStringCommandOption = __ΩStringCommandOption;
|
|
249
271
|
exports.__ΩStringCommandParameter = __ΩStringCommandParameter;
|
|
272
|
+
exports.__ΩStringCommandParameterConfig = __ΩStringCommandParameterConfig;
|
|
250
273
|
//# sourceMappingURL=command.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.cjs","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\
|
|
1
|
+
{"version":3,"file":"command.cjs","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema7TupleType } from \"@stryke/json\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { JSONSchema7Object } from \"json-schema\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\n\nexport type CommandParameterType =\n | string\n | number\n | boolean\n | (string | number)[];\n\nexport const CommandParameterKinds = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\"\n} as const;\n\nexport type CommandParameterKind =\n (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: CommandParameterKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n /**\n * The default value.\n */\n default?: string;\n /**\n * A standard string format to validate the option value against.\n */\n format?:\n | \"email\"\n | \"uri\"\n | \"uuid\"\n | \"ipv4\"\n | \"ipv6\"\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\";\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n /**\n * The default value.\n */\n default?: boolean;\n}\n\nexport type CommandParameter =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\n\nexport type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<\n T,\n \"kind\" | \"alias\"\n> &\n Partial<Omit<T, \"kind\" | \"alias\">> & {\n alias?: string | string[];\n };\n\nexport type StringCommandParameterConfig =\n AsCommandParameterConfig<StringCommandParameter>;\nexport type NumberCommandParameterConfig =\n AsCommandParameterConfig<NumberCommandParameter>;\nexport type BooleanCommandParameterConfig =\n AsCommandParameterConfig<BooleanCommandParameter>;\n\nexport type CommandParameterConfig =\n | StringCommandParameterConfig\n | NumberCommandParameterConfig\n | BooleanCommandParameterConfig;\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption;\nexport type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;\n\nexport type CommandArgument =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\nexport type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandConfig extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n};\n\nexport type SerializedCommandTree = Omit<CommandTree, \"parent\" | \"children\"> & {\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n};\n\nexport interface CommandMetadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: CommandMetadata;\n options?:\n | Record<string, CommandOptionConfig>\n | JSONSchema7Object\n | StandardJSONSchemaV1<Record<string, CommandParameterType>>\n | z3.AnyZodObject;\n args?:\n | CommandArgumentConfig[]\n | JsonSchema7TupleType\n | StandardJSONSchemaV1<CommandParameterType[]>\n | z3.AnyZodTuple;\n default?: AnyFunction;\n}\n"],"mappings":";;AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,UAAU;CAAC;CAAK;OAAW;OAAc;CAAA;CAAA;CAAA;;;;;;;AAE/C,MAAM,aAAa;CAAC;CAAK;CAAK;CAAW;CAA6B;AACtE,MAAM,0BAA0B,CAAC,wBAAwB,gBAAW;AAEpE,MAAa,wBAAwB;;CAEjC,QAAQ;CACR,SAAS;CACZ;AACD,MAAM,0BAA0B;OAAO;OAAoB;CAAA;CAAA;CAAA;AAE3D,MAAM,0BAA0B;CAAC;OAAG;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpC,MAAM,4BAA4B;OAAO;CAAyB;CAAI;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,4BAA4B;OAAO;CAAwB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEjE,MAAM,6BAA6B;OAAO;CAAW;CAAA;CAAA;CAAA;CAAA;CAAA;AAErD,MAAM,sBAAsB;OAAO;OAA0B;OAAA;CAAA;CAAA;CAAA;;;;;;;;;;;;;;AAI7D,MAAM,kCAAG;OAAA;OAAA;CAAA;CAAA;CAAA;AAET,MAAM,kCAAI;OAAA;OAAA;CAAA;CAAA;CAAA;;;;;;;AAIV,MAAM,4BAAY;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;AAElB,MAAM,0BAAa;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAInB,MAAM,yBAAyB;OAAO;OAA8B;CAAA;CAAA;CAAA;AAEpE,MAAM,qBAAqB;OAAO;OAAI;OAAA;CAAA;CAAA;CAAA;AAEtC,MAAM,2BAAc;OAAA;OAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,iBAAQ;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEd,MAAM,mBAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,iBAAiB;OAAK;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE5B,MAAM,2BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,qBAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEf,MAAM,mBAAmB;OAAE;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/types/command.d.cts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
2
|
-
import {
|
|
2
|
+
import { StandardJSONSchemaV1 } from "@standard-schema/spec";
|
|
3
|
+
import { JsonSchema7TupleType } from "@stryke/json";
|
|
3
4
|
import { AnyFunction } from "@stryke/types/base";
|
|
5
|
+
import { JSONSchema7Object } from "json-schema";
|
|
4
6
|
import * as z3 from "zod/v3";
|
|
5
|
-
import * as z4 from "zod/v4/core";
|
|
6
7
|
|
|
7
8
|
//#region src/types/command.d.ts
|
|
9
|
+
type CommandParameterType = string | number | boolean | (string | number)[];
|
|
10
|
+
declare const CommandParameterKinds: {
|
|
11
|
+
readonly string: "string";
|
|
12
|
+
readonly number: "number";
|
|
13
|
+
readonly boolean: "boolean";
|
|
14
|
+
};
|
|
15
|
+
type CommandParameterKind = (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];
|
|
8
16
|
interface BaseCommandParameter {
|
|
9
17
|
/**
|
|
10
18
|
* The option name.
|
|
@@ -13,7 +21,7 @@ interface BaseCommandParameter {
|
|
|
13
21
|
/**
|
|
14
22
|
* The option kind.
|
|
15
23
|
*/
|
|
16
|
-
kind:
|
|
24
|
+
kind: CommandParameterKind;
|
|
17
25
|
/**
|
|
18
26
|
* The display title.
|
|
19
27
|
*/
|
|
@@ -39,11 +47,15 @@ interface StringCommandParameter extends BaseCommandParameter {
|
|
|
39
47
|
/**
|
|
40
48
|
* The option kind.
|
|
41
49
|
*/
|
|
42
|
-
kind:
|
|
50
|
+
kind: "string";
|
|
43
51
|
/**
|
|
44
52
|
* The default value.
|
|
45
53
|
*/
|
|
46
54
|
default?: string;
|
|
55
|
+
/**
|
|
56
|
+
* A standard string format to validate the option value against.
|
|
57
|
+
*/
|
|
58
|
+
format?: "email" | "uri" | "uuid" | "ipv4" | "ipv6" | "date" | "time" | "date-time" | "duration";
|
|
47
59
|
/**
|
|
48
60
|
* Whether the option accepts multiple values.
|
|
49
61
|
*/
|
|
@@ -57,7 +69,7 @@ interface NumberCommandParameter extends BaseCommandParameter {
|
|
|
57
69
|
/**
|
|
58
70
|
* The option kind.
|
|
59
71
|
*/
|
|
60
|
-
kind:
|
|
72
|
+
kind: "number";
|
|
61
73
|
/**
|
|
62
74
|
* The default value.
|
|
63
75
|
*/
|
|
@@ -75,37 +87,21 @@ interface BooleanCommandParameter extends BaseCommandParameter {
|
|
|
75
87
|
/**
|
|
76
88
|
* The option kind.
|
|
77
89
|
*/
|
|
78
|
-
kind:
|
|
90
|
+
kind: "boolean";
|
|
79
91
|
/**
|
|
80
92
|
* The default value.
|
|
81
93
|
*/
|
|
82
94
|
default?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* The option this negates.
|
|
85
|
-
*/
|
|
86
|
-
isNegativeOf?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Whether to skip adding a negative option.
|
|
89
|
-
*/
|
|
90
|
-
skipAddingNegative?: boolean;
|
|
91
|
-
}
|
|
92
|
-
interface StringCommandOption extends StringCommandParameter {
|
|
93
|
-
/**
|
|
94
|
-
* The property reflection.
|
|
95
|
-
*/
|
|
96
|
-
reflection?: ReflectionProperty;
|
|
97
|
-
}
|
|
98
|
-
interface NumberCommandOption extends NumberCommandParameter {
|
|
99
|
-
/**
|
|
100
|
-
* The property reflection.
|
|
101
|
-
*/
|
|
102
|
-
reflection?: ReflectionProperty;
|
|
103
95
|
}
|
|
96
|
+
type CommandParameter = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
|
|
97
|
+
type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<T, "kind" | "alias"> & Partial<Omit<T, "kind" | "alias">> & {
|
|
98
|
+
alias?: string | string[];
|
|
99
|
+
};
|
|
100
|
+
type StringCommandParameterConfig = AsCommandParameterConfig<StringCommandParameter>;
|
|
101
|
+
type NumberCommandParameterConfig = AsCommandParameterConfig<NumberCommandParameter>;
|
|
102
|
+
type BooleanCommandParameterConfig = AsCommandParameterConfig<BooleanCommandParameter>;
|
|
103
|
+
type CommandParameterConfig = StringCommandParameterConfig | NumberCommandParameterConfig | BooleanCommandParameterConfig;
|
|
104
104
|
interface BooleanCommandOption extends BooleanCommandParameter {
|
|
105
|
-
/**
|
|
106
|
-
* The property reflection.
|
|
107
|
-
*/
|
|
108
|
-
reflection?: ReflectionProperty;
|
|
109
105
|
/**
|
|
110
106
|
* The option this negates.
|
|
111
107
|
*/
|
|
@@ -115,26 +111,10 @@ interface BooleanCommandOption extends BooleanCommandParameter {
|
|
|
115
111
|
*/
|
|
116
112
|
skipAddingNegative?: boolean;
|
|
117
113
|
}
|
|
118
|
-
type CommandOption =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*/
|
|
123
|
-
reflection: ReflectionParameter;
|
|
124
|
-
}
|
|
125
|
-
interface NumberCommandArgument extends NumberCommandParameter {
|
|
126
|
-
/**
|
|
127
|
-
* The parameter reflection.
|
|
128
|
-
*/
|
|
129
|
-
reflection: ReflectionParameter;
|
|
130
|
-
}
|
|
131
|
-
interface BooleanCommandArgument extends BooleanCommandParameter {
|
|
132
|
-
/**
|
|
133
|
-
* The parameter reflection.
|
|
134
|
-
*/
|
|
135
|
-
reflection: ReflectionParameter;
|
|
136
|
-
}
|
|
137
|
-
type CommandArgument = StringCommandArgument | NumberCommandArgument | BooleanCommandArgument;
|
|
114
|
+
type CommandOption = StringCommandParameter | NumberCommandParameter | BooleanCommandOption;
|
|
115
|
+
type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;
|
|
116
|
+
type CommandArgument = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
|
|
117
|
+
type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;
|
|
138
118
|
interface CommandBase {
|
|
139
119
|
/**
|
|
140
120
|
* The command id.
|
|
@@ -176,7 +156,7 @@ interface CommandBase {
|
|
|
176
156
|
*/
|
|
177
157
|
isVirtual: boolean;
|
|
178
158
|
}
|
|
179
|
-
interface
|
|
159
|
+
interface CommandConfig extends CommandBase {
|
|
180
160
|
/**
|
|
181
161
|
* The command id.
|
|
182
162
|
*/
|
|
@@ -186,7 +166,7 @@ interface CommandInput extends CommandBase {
|
|
|
186
166
|
*/
|
|
187
167
|
entry: ResolvedEntryTypeDefinition;
|
|
188
168
|
}
|
|
189
|
-
type CommandTree =
|
|
169
|
+
type CommandTree = CommandConfig & {
|
|
190
170
|
/**
|
|
191
171
|
* The display title.
|
|
192
172
|
*/
|
|
@@ -206,7 +186,7 @@ type CommandTree = CommandInput & {
|
|
|
206
186
|
/**
|
|
207
187
|
* The positional arguments provided to the command.
|
|
208
188
|
*/
|
|
209
|
-
|
|
189
|
+
args: CommandArgument[];
|
|
210
190
|
/**
|
|
211
191
|
* The parent command.
|
|
212
192
|
*/
|
|
@@ -215,22 +195,8 @@ type CommandTree = CommandInput & {
|
|
|
215
195
|
* Child commands.
|
|
216
196
|
*/
|
|
217
197
|
children: Record<string, CommandTree>;
|
|
218
|
-
/**
|
|
219
|
-
* The command handler reflection.
|
|
220
|
-
*/
|
|
221
|
-
reflection: ReflectionFunction | null;
|
|
222
198
|
};
|
|
223
|
-
type
|
|
224
|
-
type SerializedCommandArgument = Omit<CommandArgument, "reflection">;
|
|
225
|
-
type SerializedCommandTree = Omit<CommandTree, "options" | "arguments" | "parent" | "children" | "reflection"> & {
|
|
226
|
-
/**
|
|
227
|
-
* The command options.
|
|
228
|
-
*/
|
|
229
|
-
options: Record<string, SerializedCommandOption>;
|
|
230
|
-
/**
|
|
231
|
-
* The positional arguments provided to the command.
|
|
232
|
-
*/
|
|
233
|
-
arguments: SerializedCommandArgument[];
|
|
199
|
+
type SerializedCommandTree = Omit<CommandTree, "parent" | "children"> & {
|
|
234
200
|
/**
|
|
235
201
|
* The parent command id.
|
|
236
202
|
*/
|
|
@@ -239,12 +205,8 @@ type SerializedCommandTree = Omit<CommandTree, "options" | "arguments" | "parent
|
|
|
239
205
|
* Serialized child commands.
|
|
240
206
|
*/
|
|
241
207
|
children: Record<string, SerializedCommandTree>;
|
|
242
|
-
/**
|
|
243
|
-
* The command handler reflection.
|
|
244
|
-
*/
|
|
245
|
-
reflection?: SerializedTypes;
|
|
246
208
|
};
|
|
247
|
-
interface
|
|
209
|
+
interface CommandMetadata {
|
|
248
210
|
/**
|
|
249
211
|
* The display name of the command.
|
|
250
212
|
*
|
|
@@ -271,13 +233,12 @@ interface Metadata {
|
|
|
271
233
|
*/
|
|
272
234
|
icon?: string;
|
|
273
235
|
}
|
|
274
|
-
type CommandParameterSchema = z3.ZodTypeAny | z4.$ZodType;
|
|
275
236
|
interface CommandModule {
|
|
276
|
-
metadata?:
|
|
277
|
-
options?: Record<string,
|
|
278
|
-
|
|
237
|
+
metadata?: CommandMetadata;
|
|
238
|
+
options?: Record<string, CommandOptionConfig> | JSONSchema7Object | StandardJSONSchemaV1<Record<string, CommandParameterType>> | z3.AnyZodObject;
|
|
239
|
+
args?: CommandArgumentConfig[] | JsonSchema7TupleType | StandardJSONSchemaV1<CommandParameterType[]> | z3.AnyZodTuple;
|
|
279
240
|
default?: AnyFunction;
|
|
280
241
|
}
|
|
281
242
|
//#endregion
|
|
282
|
-
export {
|
|
243
|
+
export { AsCommandParameterConfig, BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, StringCommandParameter, StringCommandParameterConfig };
|
|
283
244
|
//# sourceMappingURL=command.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.cts","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.cts","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAyBY,oBAAA;cAMC;EAND,SAAA,MAAA,EAAA,QAAoB;EAMnB,SAAA,MAAA,EAAA,QAIH;EAEE,SAAA,OAAA,EAAA,SAAoB;AAGhC,CAAA;AA+BiB,KAlCL,oBAAA,GAkC4B,CAAA,OAjC9B,qBAiC0D,CAAA,CAAA,MAAA,OAjCtB,qBAiCsB,CAAA;AAiCnD,UAhEA,oBAAA,CAgEuB;EAoBvB;AAWjB;;EAEI,IAAA,EAAA,MAAA;EACA;;AAEJ;EAA+C,IAAA,EA5FvC,oBA4FuC;EAC7C;;;EAGQ,KAAA,EAAA,MAAA;EAAR;;AAIF;EAEY,WAAA,EAAA,MAAA;EAEA;AAGZ;;EAEI,KAAA,EAAA,MAAA,EAAA;EACA;;AAEJ;EAWY,GAAA,EAAA,MAAA,GAAA,KAAa;EACrB;;;EAEoB,QAAA,EAAA,OAAA;AACxB;AAEY,UA1GK,sBAAA,SAA+B,oBA0GrB,CAAA;EACvB;;;EAEuB,IAAA,EAAA,QAAA;EACf;AAEZ;AAkDA;EAYY,OAAA,CAAA,EAAA,MAAW;EAAG;;;EAoBlB,MAAA,CAAA,EAAA,OAAA,GAAA,KAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,WAAA,GAAA,UAAA;EAIS;;;EAIC,QAAA,EAAA,OAAA;EAGN;;;EAQe,OAAA,CAAA,EAAA,MAAA,EAAA;;AAAT,UApLD,sBAAA,SAA+B,oBAoL9B,CAAA;EAGD;AA+BjB;;EAGqB,IAAA,EAAA,QAAA;EAAf;;;EAEqB,OAAA,CAAA,EAAA,MAAA;EAArB;;;EAIA,QAAA,EAAA,OAAA;EACqB;;;EAEf,OAAA,CAAA,EAAA,MAAA,EAAA;;UA9MK,uBAAA,SAAgC;;;;;;;;;;KAWrC,gBAAA,GACR,yBACA,yBACA;KAEQ,mCAAmC,wBAAwB,KACrE,uBAGA,QAAQ,KAAK;;;KAIH,4BAAA,GACV,yBAAyB;KACf,4BAAA,GACV,yBAAyB;KACf,6BAAA,GACV,yBAAyB;KAEf,sBAAA,GACR,+BACA,+BACA;UAEa,oBAAA,SAA6B;;;;;;;;;;KAWlC,aAAA,GACR,yBACA,yBACA;KACQ,mBAAA,GAAsB,yBAAyB;KAE/C,eAAA,GACR,yBACA,yBACA;KACQ,qBAAA,GAAwB,yBAAyB;UAE5C,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkDA,aAAA,SAAsB;;;;;;;;SAS9B;;KAGG,WAAA,GAAc;;;;;;;;;;;;;;;;WAgBf,eAAe;;;;QAIlB;;;;iBAIS;;;;YAIL,eAAe;;KAGf,qBAAA,GAAwB,KAAK;;;;;;;;YAQ7B,eAAe;;UAGV,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+BA,aAAA;aACJ;YAEP,eAAe,uBACf,oBACA,qBAAqB,eAAe,yBACpC,EAAA,CAAG;SAEH,0BACA,uBACA,qBAAqB,0BACrB,EAAA,CAAG;YACG"}
|