@vltpkg/cli-sdk 0.0.0-2

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.
Files changed (136) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +20 -0
  3. package/dist/esm/commands/config.d.ts +5 -0
  4. package/dist/esm/commands/config.d.ts.map +1 -0
  5. package/dist/esm/commands/config.js +153 -0
  6. package/dist/esm/commands/config.js.map +1 -0
  7. package/dist/esm/commands/exec.d.ts +5 -0
  8. package/dist/esm/commands/exec.d.ts.map +1 -0
  9. package/dist/esm/commands/exec.js +22 -0
  10. package/dist/esm/commands/exec.js.map +1 -0
  11. package/dist/esm/commands/gui.d.ts +6 -0
  12. package/dist/esm/commands/gui.d.ts.map +1 -0
  13. package/dist/esm/commands/gui.js +14 -0
  14. package/dist/esm/commands/gui.js.map +1 -0
  15. package/dist/esm/commands/help.d.ts +4 -0
  16. package/dist/esm/commands/help.d.ts.map +1 -0
  17. package/dist/esm/commands/help.js +10 -0
  18. package/dist/esm/commands/help.js.map +1 -0
  19. package/dist/esm/commands/init.d.ts +9 -0
  20. package/dist/esm/commands/init.d.ts.map +1 -0
  21. package/dist/esm/commands/init.js +25 -0
  22. package/dist/esm/commands/init.js.map +1 -0
  23. package/dist/esm/commands/install/reporter.d.ts +10 -0
  24. package/dist/esm/commands/install/reporter.d.ts.map +1 -0
  25. package/dist/esm/commands/install/reporter.js +66 -0
  26. package/dist/esm/commands/install/reporter.js.map +1 -0
  27. package/dist/esm/commands/install-exec.d.ts +4 -0
  28. package/dist/esm/commands/install-exec.d.ts.map +1 -0
  29. package/dist/esm/commands/install-exec.js +13 -0
  30. package/dist/esm/commands/install-exec.js.map +1 -0
  31. package/dist/esm/commands/install.d.ts +7 -0
  32. package/dist/esm/commands/install.d.ts.map +1 -0
  33. package/dist/esm/commands/install.js +21 -0
  34. package/dist/esm/commands/install.js.map +1 -0
  35. package/dist/esm/commands/list.d.ts +15 -0
  36. package/dist/esm/commands/list.d.ts.map +1 -0
  37. package/dist/esm/commands/list.js +91 -0
  38. package/dist/esm/commands/list.js.map +1 -0
  39. package/dist/esm/commands/login.d.ts +4 -0
  40. package/dist/esm/commands/login.d.ts.map +1 -0
  41. package/dist/esm/commands/login.js +13 -0
  42. package/dist/esm/commands/login.js.map +1 -0
  43. package/dist/esm/commands/logout.d.ts +4 -0
  44. package/dist/esm/commands/logout.d.ts.map +1 -0
  45. package/dist/esm/commands/logout.js +13 -0
  46. package/dist/esm/commands/logout.js.map +1 -0
  47. package/dist/esm/commands/pkg.d.ts +8 -0
  48. package/dist/esm/commands/pkg.d.ts.map +1 -0
  49. package/dist/esm/commands/pkg.js +121 -0
  50. package/dist/esm/commands/pkg.js.map +1 -0
  51. package/dist/esm/commands/query.d.ts +16 -0
  52. package/dist/esm/commands/query.d.ts.map +1 -0
  53. package/dist/esm/commands/query.js +75 -0
  54. package/dist/esm/commands/query.js.map +1 -0
  55. package/dist/esm/commands/run-exec.d.ts +5 -0
  56. package/dist/esm/commands/run-exec.d.ts.map +1 -0
  57. package/dist/esm/commands/run-exec.js +13 -0
  58. package/dist/esm/commands/run-exec.js.map +1 -0
  59. package/dist/esm/commands/run.d.ts +5 -0
  60. package/dist/esm/commands/run.d.ts.map +1 -0
  61. package/dist/esm/commands/run.js +39 -0
  62. package/dist/esm/commands/run.js.map +1 -0
  63. package/dist/esm/commands/token.d.ts +4 -0
  64. package/dist/esm/commands/token.d.ts.map +1 -0
  65. package/dist/esm/commands/token.js +30 -0
  66. package/dist/esm/commands/token.js.map +1 -0
  67. package/dist/esm/commands/uninstall.d.ts +4 -0
  68. package/dist/esm/commands/uninstall.d.ts.map +1 -0
  69. package/dist/esm/commands/uninstall.js +15 -0
  70. package/dist/esm/commands/uninstall.js.map +1 -0
  71. package/dist/esm/commands/whoami.d.ts +11 -0
  72. package/dist/esm/commands/whoami.d.ts.map +1 -0
  73. package/dist/esm/commands/whoami.js +19 -0
  74. package/dist/esm/commands/whoami.js.map +1 -0
  75. package/dist/esm/config/definition.d.ts +286 -0
  76. package/dist/esm/config/definition.d.ts.map +1 -0
  77. package/dist/esm/config/definition.js +475 -0
  78. package/dist/esm/config/definition.js.map +1 -0
  79. package/dist/esm/config/index.d.ts +213 -0
  80. package/dist/esm/config/index.d.ts.map +1 -0
  81. package/dist/esm/config/index.js +504 -0
  82. package/dist/esm/config/index.js.map +1 -0
  83. package/dist/esm/config/merge.d.ts +2 -0
  84. package/dist/esm/config/merge.d.ts.map +1 -0
  85. package/dist/esm/config/merge.js +23 -0
  86. package/dist/esm/config/merge.js.map +1 -0
  87. package/dist/esm/config/usage.d.ts +18 -0
  88. package/dist/esm/config/usage.d.ts.map +1 -0
  89. package/dist/esm/config/usage.js +40 -0
  90. package/dist/esm/config/usage.js.map +1 -0
  91. package/dist/esm/exec-command.d.ts +34 -0
  92. package/dist/esm/exec-command.d.ts.map +1 -0
  93. package/dist/esm/exec-command.js +159 -0
  94. package/dist/esm/exec-command.js.map +1 -0
  95. package/dist/esm/ignored-homedir-folder-names.d.ts +7 -0
  96. package/dist/esm/ignored-homedir-folder-names.d.ts.map +1 -0
  97. package/dist/esm/ignored-homedir-folder-names.js +35 -0
  98. package/dist/esm/ignored-homedir-folder-names.js.map +1 -0
  99. package/dist/esm/index.d.ts +17 -0
  100. package/dist/esm/index.d.ts.map +1 -0
  101. package/dist/esm/index.js +47 -0
  102. package/dist/esm/index.js.map +1 -0
  103. package/dist/esm/output.d.ts +25 -0
  104. package/dist/esm/output.d.ts.map +1 -0
  105. package/dist/esm/output.js +86 -0
  106. package/dist/esm/output.js.map +1 -0
  107. package/dist/esm/package.json +3 -0
  108. package/dist/esm/parse-add-remove-args.d.ts +22 -0
  109. package/dist/esm/parse-add-remove-args.d.ts.map +1 -0
  110. package/dist/esm/parse-add-remove-args.js +71 -0
  111. package/dist/esm/parse-add-remove-args.js.map +1 -0
  112. package/dist/esm/print-err.d.ts +3 -0
  113. package/dist/esm/print-err.d.ts.map +1 -0
  114. package/dist/esm/print-err.js +47 -0
  115. package/dist/esm/print-err.js.map +1 -0
  116. package/dist/esm/project-info.d.ts +32 -0
  117. package/dist/esm/project-info.d.ts.map +1 -0
  118. package/dist/esm/project-info.js +90 -0
  119. package/dist/esm/project-info.js.map +1 -0
  120. package/dist/esm/read-password.d.ts +8 -0
  121. package/dist/esm/read-password.d.ts.map +1 -0
  122. package/dist/esm/read-password.js +33 -0
  123. package/dist/esm/read-password.js.map +1 -0
  124. package/dist/esm/read-project-folders.d.ts +27 -0
  125. package/dist/esm/read-project-folders.d.ts.map +1 -0
  126. package/dist/esm/read-project-folders.js +66 -0
  127. package/dist/esm/read-project-folders.js.map +1 -0
  128. package/dist/esm/start-gui.d.ts +36 -0
  129. package/dist/esm/start-gui.d.ts.map +1 -0
  130. package/dist/esm/start-gui.js +357 -0
  131. package/dist/esm/start-gui.js.map +1 -0
  132. package/dist/esm/view.d.ts +31 -0
  133. package/dist/esm/view.d.ts.map +1 -0
  134. package/dist/esm/view.js +31 -0
  135. package/dist/esm/view.js.map +1 -0
  136. package/package.json +107 -0
@@ -0,0 +1,19 @@
1
+ import { RegistryClient } from '@vltpkg/registry-client';
2
+ import { commandUsage } from "../config/usage.js";
3
+ export const usage = () => commandUsage({
4
+ command: 'whoami',
5
+ usage: [''],
6
+ description: `Look up the username for the currently active token,
7
+ when logged into a registry.`,
8
+ });
9
+ export const views = {
10
+ human: r => r.username,
11
+ json: r => r,
12
+ };
13
+ export const command = async (conf) => {
14
+ const rc = new RegistryClient(conf.options);
15
+ const response = await rc.request(new URL('-/whoami', conf.options.registry), { cache: false });
16
+ const { username } = response.json();
17
+ return { username };
18
+ };
19
+ //# sourceMappingURL=whoami.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../src/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIjD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,EAAE;+CAC8B;CAC5C,CAAC,CAAA;AAMJ,MAAM,CAAC,MAAM,KAAK,GAAyB;IACzC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;IACtB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACb,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAA6B,KAAK,EAAC,IAAI,EAAC,EAAE;IAC5D,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,OAAO,CAC/B,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC1C,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;IACD,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;IACpC,OAAO,EAAE,QAAQ,EAAE,CAAA;AACrB,CAAC,CAAA","sourcesContent":["import { RegistryClient } from '@vltpkg/registry-client'\nimport type { JSONField } from '@vltpkg/types'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'whoami',\n usage: [''],\n description: `Look up the username for the currently active token,\n when logged into a registry.`,\n })\n\ntype CommandResult = {\n username?: JSONField\n}\n\nexport const views: Views<CommandResult> = {\n human: r => r.username,\n json: r => r,\n}\n\nexport const command: CommandFn<CommandResult> = async conf => {\n const rc = new RegistryClient(conf.options)\n const response = await rc.request(\n new URL('-/whoami', conf.options.registry),\n { cache: false },\n )\n const { username } = response.json()\n return { username }\n}\n"]}
@@ -0,0 +1,286 @@
1
+ export declare const defaultView: string;
2
+ /**
3
+ * Command aliases mapped to their canonical names
4
+ */
5
+ export declare const commands: {
6
+ readonly i: "install";
7
+ readonly add: "install";
8
+ readonly rm: "uninstall";
9
+ readonly u: "uninstall";
10
+ readonly r: "run";
11
+ readonly 'run-script': "run";
12
+ readonly rx: "run-exec";
13
+ readonly x: "exec";
14
+ readonly h: "help";
15
+ readonly '?': "help";
16
+ readonly conf: "config";
17
+ readonly ix: "install-exec";
18
+ readonly ls: "list";
19
+ readonly config: "config";
20
+ readonly exec: "exec";
21
+ readonly gui: "gui";
22
+ readonly help: "help";
23
+ readonly init: "init";
24
+ readonly 'install-exec': "install-exec";
25
+ readonly install: "install";
26
+ readonly login: "login";
27
+ readonly logout: "logout";
28
+ readonly list: "list";
29
+ readonly pkg: "pkg";
30
+ readonly query: "query";
31
+ readonly 'run-exec': "run-exec";
32
+ readonly run: "run";
33
+ readonly token: "token";
34
+ readonly uninstall: "uninstall";
35
+ readonly whoami: "whoami";
36
+ };
37
+ /**
38
+ * Canonical command names mapped to an array of its aliases
39
+ */
40
+ export declare const commandAliases: Map<string, string[]>;
41
+ export type Commands = typeof commands;
42
+ export declare const getCommand: (s?: string) => Commands[keyof Commands] | undefined;
43
+ /**
44
+ * Fields that are parsed as a set of key=value pairs
45
+ */
46
+ export declare const recordFields: readonly ["git-hosts", "registries", "git-host-archives", "scope-registries"];
47
+ export type RecordField = (typeof recordFields)[number];
48
+ export declare const isRecordField: (s: string) => s is RecordField;
49
+ export declare const definition: import("jackspeak").Jack<{
50
+ color: {
51
+ short: string;
52
+ description: string;
53
+ };
54
+ 'no-color': {
55
+ short: string;
56
+ description: string;
57
+ };
58
+ } & {
59
+ color: import("jackspeak").ConfigOption<"boolean", false, undefined>;
60
+ 'no-color': import("jackspeak").ConfigOption<"boolean", false, undefined>;
61
+ } & {
62
+ registry: {
63
+ hint: string;
64
+ default: string;
65
+ description: string;
66
+ };
67
+ } & {
68
+ registry: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
69
+ } & {
70
+ registries: {
71
+ hint: string;
72
+ description: string;
73
+ };
74
+ 'scope-registries': {
75
+ hint: string;
76
+ description: string;
77
+ };
78
+ 'git-hosts': {
79
+ hint: string;
80
+ short: string;
81
+ description: string;
82
+ };
83
+ 'git-host-archives': {
84
+ hint: string;
85
+ short: string;
86
+ description: string;
87
+ };
88
+ } & {
89
+ registries: import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
90
+ 'scope-registries': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
91
+ 'git-hosts': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
92
+ 'git-host-archives': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
93
+ } & {
94
+ cache: {
95
+ hint: string;
96
+ description: string;
97
+ default: string;
98
+ };
99
+ tag: {
100
+ description: string;
101
+ default: string;
102
+ };
103
+ before: {
104
+ hint: string;
105
+ description: string;
106
+ };
107
+ os: {
108
+ description: string;
109
+ default: NodeJS.Platform;
110
+ };
111
+ arch: {
112
+ description: string;
113
+ default: NodeJS.Architecture;
114
+ };
115
+ 'node-version': {
116
+ hint: string;
117
+ description: string;
118
+ default: string;
119
+ };
120
+ } & {
121
+ cache: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
122
+ tag: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
123
+ before: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
124
+ os: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
125
+ arch: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
126
+ 'node-version': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
127
+ } & {
128
+ 'git-shallow': {
129
+ description: string;
130
+ };
131
+ } & {
132
+ 'git-shallow': import("jackspeak").ConfigOption<"boolean", false, undefined>;
133
+ } & {
134
+ 'fetch-retries': {
135
+ hint: string;
136
+ description: string;
137
+ default: number;
138
+ };
139
+ 'fetch-retry-factor': {
140
+ hint: string;
141
+ description: string;
142
+ default: number;
143
+ };
144
+ 'fetch-retry-mintimeout': {
145
+ hint: string;
146
+ description: string;
147
+ default: number;
148
+ };
149
+ 'fetch-retry-maxtimeout': {
150
+ hint: string;
151
+ description: string;
152
+ default: number;
153
+ };
154
+ } & {
155
+ 'fetch-retries': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
156
+ 'fetch-retry-factor': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
157
+ 'fetch-retry-mintimeout': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
158
+ 'fetch-retry-maxtimeout': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
159
+ } & {
160
+ identity: {
161
+ short: string;
162
+ validate: (v: unknown) => boolean;
163
+ hint: string;
164
+ default: string;
165
+ description: string;
166
+ };
167
+ } & {
168
+ identity: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
169
+ } & {
170
+ workspace: {
171
+ hint: string;
172
+ short: string;
173
+ description: string;
174
+ };
175
+ 'workspace-group': {
176
+ short: string;
177
+ description: string;
178
+ };
179
+ } & {
180
+ workspace: import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
181
+ 'workspace-group': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
182
+ } & {
183
+ recursive: {
184
+ short: string;
185
+ description: string;
186
+ };
187
+ bail: {
188
+ short: string;
189
+ description: string;
190
+ default: true;
191
+ };
192
+ 'no-bail': {
193
+ short: string;
194
+ description: string;
195
+ };
196
+ } & {
197
+ recursive: import("jackspeak").ConfigOption<"boolean", false, undefined>;
198
+ bail: import("jackspeak").ConfigOption<"boolean", false, undefined>;
199
+ 'no-bail': import("jackspeak").ConfigOption<"boolean", false, undefined>;
200
+ } & {
201
+ config: {
202
+ hint: string;
203
+ description: string;
204
+ validOptions: readonly ["user", "project"];
205
+ default: string;
206
+ };
207
+ editor: {
208
+ hint: string;
209
+ description: string;
210
+ default: string;
211
+ };
212
+ 'script-shell': {
213
+ hint: string;
214
+ description: string;
215
+ };
216
+ 'fallback-command': {
217
+ hint: string;
218
+ description: string;
219
+ default: string;
220
+ validOptions: string[];
221
+ };
222
+ } & {
223
+ config: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
224
+ editor: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
225
+ 'script-shell': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
226
+ 'fallback-command': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
227
+ } & {
228
+ package: {
229
+ hint: string;
230
+ description: string;
231
+ };
232
+ } & {
233
+ package: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
234
+ } & {
235
+ view: {
236
+ hint: string;
237
+ default: string;
238
+ description: string;
239
+ validOptions: readonly ["human", "json", "mermaid", "gui", "inspect"];
240
+ };
241
+ } & {
242
+ view: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
243
+ } & {
244
+ 'dashboard-root': {
245
+ hint: string;
246
+ description: string;
247
+ };
248
+ } & {
249
+ 'dashboard-root': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
250
+ } & {
251
+ 'save-dev': {
252
+ short: string;
253
+ description: string;
254
+ };
255
+ 'save-optional': {
256
+ short: string;
257
+ description: string;
258
+ };
259
+ 'save-peer': {
260
+ description: string;
261
+ };
262
+ 'save-prod': {
263
+ short: string;
264
+ description: string;
265
+ };
266
+ } & {
267
+ 'save-dev': import("jackspeak").ConfigOption<"boolean", false, undefined>;
268
+ 'save-optional': import("jackspeak").ConfigOption<"boolean", false, undefined>;
269
+ 'save-peer': import("jackspeak").ConfigOption<"boolean", false, undefined>;
270
+ 'save-prod': import("jackspeak").ConfigOption<"boolean", false, undefined>;
271
+ } & {
272
+ version: {
273
+ short: string;
274
+ description: string;
275
+ };
276
+ } & {
277
+ version: import("jackspeak").ConfigOption<"boolean", false, undefined>;
278
+ } & {
279
+ help: {
280
+ short: string;
281
+ description: string;
282
+ };
283
+ } & {
284
+ help: import("jackspeak").ConfigOption<"boolean", false, undefined>;
285
+ }>;
286
+ //# sourceMappingURL=definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/config/definition.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,QAA0C,CAAA;AAuClE;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGX,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,cAAc,uBAW1B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAA;AAEtC,eAAO,MAAM,UAAU,OACjB,MAAM,KACT,QAAQ,CAAC,MAAM,QAAQ,CAAC,GAAG,SACkC,CAAA;AAKhE;;GAEG;AACH,eAAO,MAAM,YAAY,+EAKf,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,aAAa,MAAO,MAAM,KAAG,CAAC,IAAI,WACN,CAAA;AAwCzC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAqMH,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyMvB,CAAA"}