groovectl 0.1.1 → 0.2.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/CHANGELOG.md +39 -0
- package/README.md +203 -45
- package/dist/app/collection-service.d.ts +7 -1
- package/dist/app/collection-service.d.ts.map +1 -1
- package/dist/app/collection-service.js +64 -14
- package/dist/app/collection-service.js.map +1 -1
- package/dist/app/database-service.d.ts +12 -7
- package/dist/app/database-service.d.ts.map +1 -1
- package/dist/app/database-service.js +90 -12
- package/dist/app/database-service.js.map +1 -1
- package/dist/app/marketplace-offers.d.ts +25 -0
- package/dist/app/marketplace-offers.d.ts.map +1 -0
- package/dist/app/marketplace-offers.js +237 -0
- package/dist/app/marketplace-offers.js.map +1 -0
- package/dist/app/marketplace-service.d.ts +29 -2
- package/dist/app/marketplace-service.d.ts.map +1 -1
- package/dist/app/marketplace-service.js +220 -3
- package/dist/app/marketplace-service.js.map +1 -1
- package/dist/app/user-service.d.ts +11 -0
- package/dist/app/user-service.d.ts.map +1 -0
- package/dist/app/user-service.js +73 -0
- package/dist/app/user-service.js.map +1 -0
- package/dist/cli/commands/artist.d.ts.map +1 -1
- package/dist/cli/commands/artist.js +29 -8
- package/dist/cli/commands/artist.js.map +1 -1
- package/dist/cli/commands/collection.d.ts.map +1 -1
- package/dist/cli/commands/collection.js +201 -10
- package/dist/cli/commands/collection.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +15 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/database-common.d.ts +4 -3
- package/dist/cli/commands/database-common.d.ts.map +1 -1
- package/dist/cli/commands/database-common.js +9 -5
- package/dist/cli/commands/database-common.js.map +1 -1
- package/dist/cli/commands/label.d.ts.map +1 -1
- package/dist/cli/commands/label.js +11 -4
- package/dist/cli/commands/label.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +58 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/marketplace.d.ts.map +1 -1
- package/dist/cli/commands/marketplace.js +613 -28
- package/dist/cli/commands/marketplace.js.map +1 -1
- package/dist/cli/commands/master.d.ts.map +1 -1
- package/dist/cli/commands/master.js +53 -11
- package/dist/cli/commands/master.js.map +1 -1
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +135 -23
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +38 -0
- package/dist/cli/commands/schema.d.ts.map +1 -0
- package/dist/cli/commands/schema.js +125 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +36 -17
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/user.d.ts +5 -0
- package/dist/cli/commands/user.d.ts.map +1 -0
- package/dist/cli/commands/user.js +43 -0
- package/dist/cli/commands/user.js.map +1 -0
- package/dist/cli/commands/wantlist.d.ts.map +1 -1
- package/dist/cli/commands/wantlist.js +44 -8
- package/dist/cli/commands/wantlist.js.map +1 -1
- package/dist/cli/create-program.d.ts +3 -1
- package/dist/cli/create-program.d.ts.map +1 -1
- package/dist/cli/create-program.js +42 -10
- package/dist/cli/create-program.js.map +1 -1
- package/dist/cli/global-options.d.ts +4 -0
- package/dist/cli/global-options.d.ts.map +1 -1
- package/dist/cli/global-options.js +3 -0
- package/dist/cli/global-options.js.map +1 -1
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +63 -6
- package/dist/cli/run-cli.js.map +1 -1
- package/dist/cli/runtime.d.ts +7 -2
- package/dist/cli/runtime.d.ts.map +1 -1
- package/dist/cli/runtime.js +15 -11
- package/dist/cli/runtime.js.map +1 -1
- package/dist/config/schema.d.ts +1 -1
- package/dist/config/store.d.ts.map +1 -1
- package/dist/config/store.js +15 -1
- package/dist/config/store.js.map +1 -1
- package/dist/discogs/client.d.ts +126 -8
- package/dist/discogs/client.d.ts.map +1 -1
- package/dist/discogs/client.js +117 -19
- package/dist/discogs/client.js.map +1 -1
- package/dist/discogs/database-schemas.d.ts +24 -12
- package/dist/discogs/database-schemas.d.ts.map +1 -1
- package/dist/discogs/database-schemas.js +10 -0
- package/dist/discogs/database-schemas.js.map +1 -1
- package/dist/discogs/marketplace-page.d.ts +10 -0
- package/dist/discogs/marketplace-page.d.ts.map +1 -0
- package/dist/discogs/marketplace-page.js +140 -0
- package/dist/discogs/marketplace-page.js.map +1 -0
- package/dist/discogs/marketplace-schemas.d.ts +332 -1
- package/dist/discogs/marketplace-schemas.d.ts.map +1 -1
- package/dist/discogs/marketplace-schemas.js +137 -1
- package/dist/discogs/marketplace-schemas.js.map +1 -1
- package/dist/discogs/schemas.d.ts +66 -8
- package/dist/discogs/schemas.d.ts.map +1 -1
- package/dist/discogs/schemas.js +62 -4
- package/dist/discogs/schemas.js.map +1 -1
- package/dist/discogs/user-schemas.d.ts +117 -8
- package/dist/discogs/user-schemas.d.ts.map +1 -1
- package/dist/discogs/user-schemas.js +64 -0
- package/dist/discogs/user-schemas.js.map +1 -1
- package/dist/domain/database-resource.d.ts +2 -0
- package/dist/domain/database-resource.d.ts.map +1 -1
- package/dist/domain/marketplace.d.ts +124 -0
- package/dist/domain/marketplace.d.ts.map +1 -1
- package/dist/domain/marketplace.js +76 -0
- package/dist/domain/marketplace.js.map +1 -1
- package/dist/domain/release.d.ts +48 -0
- package/dist/domain/release.d.ts.map +1 -1
- package/dist/domain/search-result.d.ts +2 -0
- package/dist/domain/search-result.d.ts.map +1 -1
- package/dist/domain/user-resource.d.ts +57 -1
- package/dist/domain/user-resource.d.ts.map +1 -1
- package/dist/http/marketplace-request.d.ts +3 -0
- package/dist/http/marketplace-request.d.ts.map +1 -0
- package/dist/http/marketplace-request.js +67 -0
- package/dist/http/marketplace-request.js.map +1 -0
- package/dist/output/records.d.ts +4 -2
- package/dist/output/records.d.ts.map +1 -1
- package/dist/output/records.js +20 -4
- package/dist/output/records.js.map +1 -1
- package/package.json +2 -1
- package/dist/output/renderer.d.ts +0 -8
- package/dist/output/renderer.d.ts.map +0 -1
- package/dist/output/renderer.js +0 -54
- package/dist/output/renderer.js.map +0 -1
|
@@ -1,38 +1,592 @@
|
|
|
1
1
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
2
|
-
import { MarketplaceService } from "../../app/marketplace-service.js";
|
|
2
|
+
import { MarketplaceService, } from "../../app/marketplace-service.js";
|
|
3
3
|
import { AppError } from "../../errors/app-error.js";
|
|
4
|
-
import { marketplaceCurrencies, } from "../../domain/marketplace.js";
|
|
5
|
-
import { renderRecord } from "../../output/records.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { marketplaceCurrencies, marketplaceInventorySorts, marketplaceListingStatuses, marketplaceOfferSorts, marketplaceOrderSorts, mediaGrades, normalizeMediaCondition, normalizeSleeveCondition, } from "../../domain/marketplace.js";
|
|
5
|
+
import { renderRecord, renderRecords, validateOutputFields, } from "../../output/records.js";
|
|
6
|
+
import { confirmDestructiveAction } from "../confirmation.js";
|
|
7
|
+
import { nonNegativeInteger, positiveInteger } from "../create-program.js";
|
|
8
|
+
import { fieldsFor, isQuiet, tokenRequestFor } from "../global-options.js";
|
|
9
|
+
import { addListOptions, addOutputOptions, asAsync, outputFormat, validateListOptions, } from "./database-common.js";
|
|
10
|
+
const statsColumns = columnsFor([
|
|
11
|
+
"releaseId",
|
|
12
|
+
"lowestPrice",
|
|
13
|
+
"numForSale",
|
|
14
|
+
"blockedFromSale",
|
|
15
|
+
"resourceUrl",
|
|
16
|
+
"marketplaceUrl",
|
|
17
|
+
]);
|
|
18
|
+
const priceSuggestionColumns = columnsFor([
|
|
19
|
+
"releaseId",
|
|
20
|
+
"grade",
|
|
21
|
+
"condition",
|
|
22
|
+
"price",
|
|
23
|
+
]);
|
|
24
|
+
const listingColumns = columnsFor([
|
|
25
|
+
"id",
|
|
26
|
+
"status",
|
|
27
|
+
"price",
|
|
28
|
+
"originalPrice",
|
|
29
|
+
"shippingPrice",
|
|
30
|
+
"condition",
|
|
31
|
+
"sleeveCondition",
|
|
32
|
+
"comments",
|
|
33
|
+
"postedAt",
|
|
34
|
+
"shipsFrom",
|
|
35
|
+
"seller",
|
|
36
|
+
"release",
|
|
37
|
+
"resourceUrl",
|
|
38
|
+
"marketplaceUrl",
|
|
39
|
+
]);
|
|
40
|
+
const inventoryColumns = columnsFor([
|
|
41
|
+
"id",
|
|
42
|
+
"status",
|
|
43
|
+
"price",
|
|
44
|
+
"originalPrice",
|
|
45
|
+
"shippingPrice",
|
|
46
|
+
"condition",
|
|
47
|
+
"sleeveCondition",
|
|
48
|
+
"allowOffers",
|
|
49
|
+
"shipsFrom",
|
|
50
|
+
"seller",
|
|
51
|
+
"release",
|
|
52
|
+
"comments",
|
|
53
|
+
"postedAt",
|
|
54
|
+
"marketplaceUrl",
|
|
55
|
+
"resourceUrl",
|
|
56
|
+
]);
|
|
57
|
+
const listingMutationColumns = columnsFor([
|
|
58
|
+
"action",
|
|
59
|
+
"listingId",
|
|
60
|
+
"releaseId",
|
|
61
|
+
"status",
|
|
62
|
+
"condition",
|
|
63
|
+
"sleeveCondition",
|
|
64
|
+
"price",
|
|
65
|
+
"allowOffers",
|
|
66
|
+
"comments",
|
|
67
|
+
"marketplaceUrl",
|
|
68
|
+
"resourceUrl",
|
|
69
|
+
"dryRun",
|
|
70
|
+
]);
|
|
71
|
+
const orderColumns = columnsFor([
|
|
72
|
+
"id",
|
|
73
|
+
"status",
|
|
74
|
+
"nextStatus",
|
|
75
|
+
"created",
|
|
76
|
+
"lastActivity",
|
|
77
|
+
"archived",
|
|
78
|
+
"buyer",
|
|
79
|
+
"seller",
|
|
80
|
+
"items",
|
|
81
|
+
"shipping",
|
|
82
|
+
"fee",
|
|
83
|
+
"total",
|
|
84
|
+
"shippingAddress",
|
|
85
|
+
"additionalInstructions",
|
|
86
|
+
"marketplaceUrl",
|
|
87
|
+
"resourceUrl",
|
|
88
|
+
]);
|
|
89
|
+
const orderMessageColumns = columnsFor([
|
|
90
|
+
"timestamp",
|
|
91
|
+
"type",
|
|
92
|
+
"from",
|
|
93
|
+
"subject",
|
|
94
|
+
"message",
|
|
95
|
+
]);
|
|
96
|
+
const feeColumns = columnsFor(["price", "fee"]);
|
|
97
|
+
const offerColumns = columnsFor([
|
|
98
|
+
"id",
|
|
99
|
+
"releaseId",
|
|
100
|
+
"price",
|
|
101
|
+
"condition",
|
|
102
|
+
"sleeveCondition",
|
|
103
|
+
"shipsFrom",
|
|
104
|
+
"seller",
|
|
105
|
+
"comments",
|
|
106
|
+
"shippingText",
|
|
107
|
+
"availability",
|
|
108
|
+
"marketplaceUrl",
|
|
109
|
+
"source",
|
|
110
|
+
"sourceUrl",
|
|
111
|
+
"readAt",
|
|
112
|
+
]);
|
|
9
113
|
export function createMarketplaceCommand(io, runtime) {
|
|
10
114
|
const marketplace = new Command("marketplace")
|
|
11
|
-
.description("Read
|
|
12
|
-
.addHelpText("after", "\nData provided by Discogs. One-shot
|
|
115
|
+
.description("Read Discogs Marketplace prices, offers, inventory, listings, and orders.")
|
|
116
|
+
.addHelpText("after", "\nData provided by Discogs. One-shot commands; no monitoring or stored market data.");
|
|
13
117
|
addOptions(marketplace
|
|
14
118
|
.command("stats")
|
|
15
119
|
.description("Get a release's current lowest item price, sale count and blocked status (excludes shipping/tax).")
|
|
16
120
|
.argument("<release-id>", "Discogs release ID", positiveInteger)).action(async (id, options, command) => {
|
|
17
|
-
await read(command, options, (service) => service.getStats(id, options.currency));
|
|
121
|
+
await read(command, options, statsColumns, (service) => service.getStats(id, options.currency));
|
|
122
|
+
});
|
|
123
|
+
addOutputOptions(marketplace
|
|
124
|
+
.command("price-suggestions")
|
|
125
|
+
.description("Get Discogs suggested market prices by media condition for a release (requires a User Token with seller settings).")
|
|
126
|
+
.argument("<release-id>", "Discogs release ID", positiveInteger)).action(async (id, options, command) => {
|
|
127
|
+
const requestedFormat = outputFormat(options, command);
|
|
128
|
+
const fields = fieldsFor(command);
|
|
129
|
+
validateOutputFields(priceSuggestionColumns, fields);
|
|
130
|
+
const format = await runtime.formatFor(command, requestedFormat, options.json);
|
|
131
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
132
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
133
|
+
const suggestions = await new MarketplaceService(client).getPriceSuggestions(id);
|
|
134
|
+
await renderRecords(asAsync(suggestions), format, priceSuggestionColumns, io.stdout, fields);
|
|
18
135
|
});
|
|
19
136
|
const listing = marketplace
|
|
20
137
|
.command("listing")
|
|
21
|
-
.description("Read
|
|
138
|
+
.description("Read or manage individual Marketplace listings.");
|
|
22
139
|
addOptions(listing
|
|
23
140
|
.command("get")
|
|
24
141
|
.description("Get public details by listing ID. Does not search listings by release.")
|
|
25
142
|
.argument("<listing-id>", "Discogs listing ID", positiveInteger)).action(async (id, options, command) => {
|
|
26
|
-
await read(command, options, (service) => service.getListing(id, options.currency));
|
|
143
|
+
await read(command, options, listingColumns, (service) => service.getListing(id, options.currency));
|
|
144
|
+
});
|
|
145
|
+
addOutputOptions(listing
|
|
146
|
+
.command("create")
|
|
147
|
+
.description("Create a new Marketplace listing for a release (defaults to Draft status for safety).")
|
|
148
|
+
.argument("<release-id>", "Discogs release ID", positiveInteger))
|
|
149
|
+
.requiredOption("--condition <grade>", "Media condition (M, NM, VG+, VG, G+, G, F, P or full Discogs name).", mediaConditionArg)
|
|
150
|
+
.requiredOption("--price <amount>", "Non-negative decimal listing price in your seller currency.", decimalPrice)
|
|
151
|
+
.addOption(new Option("--status <status>", "Initial listing status")
|
|
152
|
+
.choices(["Draft", "For Sale"])
|
|
153
|
+
.default("Draft"))
|
|
154
|
+
.option("--sleeve-condition <grade>", "Sleeve condition (M..P, Generic, Not Graded, No Cover, or full Discogs name).", sleeveConditionArg)
|
|
155
|
+
.option("--comments <text>", "Public seller comments for buyers")
|
|
156
|
+
.option("--allow-offers", "Allow buyers to make offers on this listing")
|
|
157
|
+
.option("--external-id <id>", "Seller external SKU or inventory reference")
|
|
158
|
+
.option("--location <text>", "Seller shelf or storage location")
|
|
159
|
+
.option("--weight <grams>", "Weight in grams", nonNegativeInteger)
|
|
160
|
+
.option("--format-quantity <count>", "Item count for shipping calculation", positiveInteger)
|
|
161
|
+
.option("--dry-run", "Show the intended listing without writing.")
|
|
162
|
+
.action(async (releaseId, options, command) => {
|
|
163
|
+
const format = await runtime.formatFor(command, outputFormat(options, command), options.json);
|
|
164
|
+
const fields = fieldsFor(command);
|
|
165
|
+
validateOutputFields(listingMutationColumns, fields);
|
|
166
|
+
const payload = {
|
|
167
|
+
release_id: releaseId,
|
|
168
|
+
condition: options.condition,
|
|
169
|
+
price: Number(options.price),
|
|
170
|
+
status: options.status,
|
|
171
|
+
...(options.sleeveCondition === undefined
|
|
172
|
+
? {}
|
|
173
|
+
: { sleeve_condition: options.sleeveCondition }),
|
|
174
|
+
...(options.comments === undefined
|
|
175
|
+
? {}
|
|
176
|
+
: { comments: options.comments }),
|
|
177
|
+
...(options.allowOffers === undefined
|
|
178
|
+
? {}
|
|
179
|
+
: { allow_offers: options.allowOffers }),
|
|
180
|
+
...(options.externalId === undefined
|
|
181
|
+
? {}
|
|
182
|
+
: { external_id: options.externalId }),
|
|
183
|
+
...(options.location === undefined
|
|
184
|
+
? {}
|
|
185
|
+
: { location: options.location }),
|
|
186
|
+
...(options.weight === undefined ? {} : { weight: options.weight }),
|
|
187
|
+
...(options.formatQuantity === undefined
|
|
188
|
+
? {}
|
|
189
|
+
: { format_quantity: options.formatQuantity }),
|
|
190
|
+
};
|
|
191
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
192
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
193
|
+
if (options.dryRun === true) {
|
|
194
|
+
renderRecord({
|
|
195
|
+
action: "marketplace.listing.create",
|
|
196
|
+
releaseId,
|
|
197
|
+
status: payload.status,
|
|
198
|
+
condition: payload.condition,
|
|
199
|
+
sleeveCondition: payload.sleeve_condition ?? null,
|
|
200
|
+
price: payload.price,
|
|
201
|
+
...(payload.allow_offers === undefined
|
|
202
|
+
? {}
|
|
203
|
+
: { allowOffers: payload.allow_offers }),
|
|
204
|
+
...(payload.comments === undefined
|
|
205
|
+
? {}
|
|
206
|
+
: { comments: payload.comments }),
|
|
207
|
+
dryRun: true,
|
|
208
|
+
}, format, listingMutationColumns, io.stdout, fields);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const created = await new MarketplaceService(client).createListing(payload);
|
|
212
|
+
renderRecord(created, format, listingMutationColumns, io.stdout, fields);
|
|
213
|
+
});
|
|
214
|
+
addOutputOptions(listing
|
|
215
|
+
.command("update")
|
|
216
|
+
.description("Update an existing Marketplace listing (merges with current listing fields).")
|
|
217
|
+
.argument("<listing-id>", "Discogs listing ID", positiveInteger))
|
|
218
|
+
.option("--condition <grade>", "Media condition (M..P or full Discogs name).", mediaConditionArg)
|
|
219
|
+
.option("--sleeve-condition <grade>", "Sleeve condition (M..P, Generic, Not Graded, No Cover, or full Discogs name).", sleeveConditionArg)
|
|
220
|
+
.option("--price <amount>", "Updated listing price", decimalPrice)
|
|
221
|
+
.addOption(new Option("--status <status>", "Listing status").choices([
|
|
222
|
+
"Draft",
|
|
223
|
+
"For Sale",
|
|
224
|
+
]))
|
|
225
|
+
.option("--comments <text>", "Updated seller comments")
|
|
226
|
+
.option("--allow-offers", "Allow buyer offers")
|
|
227
|
+
.option("--no-allow-offers", "Disallow buyer offers")
|
|
228
|
+
.option("--external-id <id>", "Seller external SKU or inventory reference")
|
|
229
|
+
.option("--location <text>", "Seller storage location")
|
|
230
|
+
.option("--weight <grams>", "Weight in grams", nonNegativeInteger)
|
|
231
|
+
.option("--format-quantity <count>", "Item count for shipping calculation", positiveInteger)
|
|
232
|
+
.option("--dry-run", "Show the merged listing update without writing.")
|
|
233
|
+
.action(async (listingId, options, command) => {
|
|
234
|
+
const allowOffersSource = command.getOptionValueSource("allowOffers");
|
|
235
|
+
const allowOffers = allowOffersSource === "cli" ? options.allowOffers : undefined;
|
|
236
|
+
const patch = {
|
|
237
|
+
...(options.condition === undefined
|
|
238
|
+
? {}
|
|
239
|
+
: { condition: options.condition }),
|
|
240
|
+
...(options.sleeveCondition === undefined
|
|
241
|
+
? {}
|
|
242
|
+
: { sleeveCondition: options.sleeveCondition }),
|
|
243
|
+
...(options.price === undefined
|
|
244
|
+
? {}
|
|
245
|
+
: { price: Number(options.price) }),
|
|
246
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
247
|
+
...(options.comments === undefined
|
|
248
|
+
? {}
|
|
249
|
+
: { comments: options.comments }),
|
|
250
|
+
...(allowOffers === undefined ? {} : { allowOffers }),
|
|
251
|
+
...(options.externalId === undefined
|
|
252
|
+
? {}
|
|
253
|
+
: { externalId: options.externalId }),
|
|
254
|
+
...(options.location === undefined
|
|
255
|
+
? {}
|
|
256
|
+
: { location: options.location }),
|
|
257
|
+
...(options.weight === undefined ? {} : { weight: options.weight }),
|
|
258
|
+
...(options.formatQuantity === undefined
|
|
259
|
+
? {}
|
|
260
|
+
: { formatQuantity: options.formatQuantity }),
|
|
261
|
+
};
|
|
262
|
+
if (Object.keys(patch).length === 0) {
|
|
263
|
+
throw new AppError({
|
|
264
|
+
kind: "usage",
|
|
265
|
+
code: "GROOVECTL_USAGE",
|
|
266
|
+
message: "Provide at least one field to update (for example --price, --status, --condition, or --comments).",
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
const format = await runtime.formatFor(command, outputFormat(options, command), options.json);
|
|
270
|
+
const fields = fieldsFor(command);
|
|
271
|
+
validateOutputFields(listingMutationColumns, fields);
|
|
272
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
273
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
274
|
+
const service = new MarketplaceService(client);
|
|
275
|
+
const merged = await service.prepareListingUpdate(listingId, patch);
|
|
276
|
+
if (options.dryRun !== true) {
|
|
277
|
+
await service.updateListing(listingId, merged);
|
|
278
|
+
}
|
|
279
|
+
renderRecord({
|
|
280
|
+
action: "marketplace.listing.update",
|
|
281
|
+
listingId,
|
|
282
|
+
releaseId: merged.release_id,
|
|
283
|
+
status: merged.status,
|
|
284
|
+
condition: merged.condition,
|
|
285
|
+
sleeveCondition: merged.sleeve_condition ?? null,
|
|
286
|
+
price: merged.price,
|
|
287
|
+
...(merged.allow_offers === undefined
|
|
288
|
+
? {}
|
|
289
|
+
: { allowOffers: merged.allow_offers }),
|
|
290
|
+
...(merged.comments === undefined
|
|
291
|
+
? {}
|
|
292
|
+
: { comments: merged.comments }),
|
|
293
|
+
marketplaceUrl: `https://www.discogs.com/sell/item/${String(listingId)}`,
|
|
294
|
+
resourceUrl: `https://api.discogs.com/marketplace/listings/${String(listingId)}`,
|
|
295
|
+
dryRun: options.dryRun === true,
|
|
296
|
+
}, format, listingMutationColumns, io.stdout, fields);
|
|
297
|
+
});
|
|
298
|
+
addOutputOptions(listing
|
|
299
|
+
.command("delete")
|
|
300
|
+
.description("Delete a Marketplace listing.")
|
|
301
|
+
.argument("<listing-id>", "Discogs listing ID", positiveInteger))
|
|
302
|
+
.option("--yes", "Skip the confirmation prompt.")
|
|
303
|
+
.option("--dry-run", "Show the intended deletion without writing.")
|
|
304
|
+
.action(async (listingId, options, command) => {
|
|
305
|
+
const format = await runtime.formatFor(command, outputFormat(options, command), options.json);
|
|
306
|
+
const fields = fieldsFor(command);
|
|
307
|
+
validateOutputFields(listingMutationColumns, fields);
|
|
308
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
309
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
310
|
+
if (options.dryRun !== true) {
|
|
311
|
+
await confirmDestructiveAction(runtime, options.yes === true, `Delete Marketplace listing ${String(listingId)}?`);
|
|
312
|
+
await new MarketplaceService(client).deleteListing(listingId);
|
|
313
|
+
}
|
|
314
|
+
renderRecord({
|
|
315
|
+
action: "marketplace.listing.delete",
|
|
316
|
+
listingId,
|
|
317
|
+
marketplaceUrl: `https://www.discogs.com/sell/item/${String(listingId)}`,
|
|
318
|
+
resourceUrl: `https://api.discogs.com/marketplace/listings/${String(listingId)}`,
|
|
319
|
+
dryRun: options.dryRun === true,
|
|
320
|
+
}, format, listingMutationColumns, io.stdout, fields);
|
|
321
|
+
});
|
|
322
|
+
addListOptions(marketplace
|
|
323
|
+
.command("listings")
|
|
324
|
+
.description("Read a release's website offers (best-effort HTML, not the official API).")
|
|
325
|
+
.argument("<release-id>", "Discogs release ID", positiveInteger))
|
|
326
|
+
.option("--html <file>", "Read a saved English release Marketplace page instead of the network.")
|
|
327
|
+
.addOption(new Option("--sort <order>", "Offer sort order for live reads")
|
|
328
|
+
.choices([...marketplaceOfferSorts])
|
|
329
|
+
.default("price-asc"))
|
|
330
|
+
.option("--ships-from <country>", "Seller country, e.g. United Kingdom (not the release country).", nonEmpty)
|
|
331
|
+
.addOption(new Option("--currency <code>", "Keep prices in this original currency; no conversion.").choices([...marketplaceCurrencies]))
|
|
332
|
+
.addOption(new Option("--min-media <grade>", "Minimum media grade.").choices([
|
|
333
|
+
...mediaGrades,
|
|
334
|
+
]))
|
|
335
|
+
.addOption(new Option("--min-sleeve <grade>", "Minimum sleeve grade; unknown/generic sleeves do not match.").choices([...mediaGrades]))
|
|
336
|
+
.option("--max-price <amount>", "Maximum item price; requires --currency, excludes shipping and tax.", decimalPrice)
|
|
337
|
+
.option("--min-seller-rating <percent>", "Minimum seller positive feedback percentage (0–100).", percentage)
|
|
338
|
+
.option("--include-unavailable", "Include offers the page marks unavailable to its destination.")
|
|
339
|
+
.action(async (id, options, command) => {
|
|
340
|
+
validateListOptions(options, command);
|
|
341
|
+
if (options.html !== undefined &&
|
|
342
|
+
(options.all === true ||
|
|
343
|
+
options.page !== undefined ||
|
|
344
|
+
command.getOptionValueSource("sort") === "cli")) {
|
|
345
|
+
throw new AppError({
|
|
346
|
+
kind: "usage",
|
|
347
|
+
code: "GROOVECTL_HTML_PAGINATION_CONFLICT",
|
|
348
|
+
message: "--html reads one saved page; do not combine it with --all, --page, or --sort.",
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
if (options.maxPrice !== undefined && options.currency === undefined) {
|
|
352
|
+
throw new AppError({
|
|
353
|
+
kind: "usage",
|
|
354
|
+
code: "GROOVECTL_CURRENCY_REQUIRED",
|
|
355
|
+
message: "--max-price requires --currency to avoid comparing different currencies.",
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
const fields = fieldsFor(command);
|
|
359
|
+
validateOutputFields(offerColumns, fields);
|
|
360
|
+
const format = await runtime.formatFor(command, options.format, options.json);
|
|
361
|
+
const service = await runtime.marketplaceOffersFor(command);
|
|
362
|
+
if (!isQuiet(command) && runtime.errorFormat !== "json") {
|
|
363
|
+
io.stderr.write(options.html !== undefined
|
|
364
|
+
? "Source: saved HTML (freshness and destination unknown); only that page is read. Filters apply locally.\n"
|
|
365
|
+
: `Source: Discogs website, not API-verified. ${options.all === true ? "Reading pages serially." : "Reading one page; use --all for all pages."} Filters apply to the pages read. Shipping/tax are not included.\n`);
|
|
366
|
+
}
|
|
367
|
+
await renderRecords(service.list(id, options), format, offerColumns, io.stdout, fields, options.limit);
|
|
368
|
+
});
|
|
369
|
+
addListOptions(marketplace
|
|
370
|
+
.command("inventory")
|
|
371
|
+
.description("List a seller's Marketplace inventory (defaults to the authenticated user when username is omitted).")
|
|
372
|
+
.argument("[username]", "Seller username", nonEmpty))
|
|
373
|
+
.addOption(new Option("--status <status>", "Filter by listing status").choices([
|
|
374
|
+
...marketplaceListingStatuses,
|
|
375
|
+
]))
|
|
376
|
+
.addOption(new Option("--sort <field>", "Sort inventory by field").choices([
|
|
377
|
+
...marketplaceInventorySorts,
|
|
378
|
+
]))
|
|
379
|
+
.addOption(new Option("--sort-order <order>", "Sort order").choices(["asc", "desc"]))
|
|
380
|
+
.action(async (username, options, command) => {
|
|
381
|
+
validateListOptions(options, command);
|
|
382
|
+
const fields = fieldsFor(command);
|
|
383
|
+
validateOutputFields(inventoryColumns, fields);
|
|
384
|
+
const format = await runtime.formatFor(command, outputFormat(options, command), options.json);
|
|
385
|
+
const policy = username === undefined ? "token_required" : "token_optional";
|
|
386
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, policy));
|
|
387
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
388
|
+
const targetUsername = username ?? (await client.getIdentity()).username;
|
|
389
|
+
const service = new MarketplaceService(client);
|
|
390
|
+
const shared = {
|
|
391
|
+
per_page: options.perPage,
|
|
392
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
393
|
+
...(options.sort === undefined ? {} : { sort: options.sort }),
|
|
394
|
+
...(options.sortOrder === undefined
|
|
395
|
+
? {}
|
|
396
|
+
: { sort_order: options.sortOrder }),
|
|
397
|
+
};
|
|
398
|
+
try {
|
|
399
|
+
const values = options.all === true
|
|
400
|
+
? service.getInventoryAll(targetUsername, shared)
|
|
401
|
+
: asAsync(await service.getInventory(targetUsername, {
|
|
402
|
+
...shared,
|
|
403
|
+
...(options.page === undefined
|
|
404
|
+
? {}
|
|
405
|
+
: { page: options.page }),
|
|
406
|
+
}));
|
|
407
|
+
await renderRecords(values, format, inventoryColumns, io.stdout, fields, options.limit);
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
410
|
+
rethrowAnonymousAuthError(resolved, error);
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
const orders = marketplace
|
|
414
|
+
.command("orders")
|
|
415
|
+
.description("Read and manage authenticated seller Marketplace orders.");
|
|
416
|
+
addListOptions(orders.command("list").description("List Marketplace orders."))
|
|
417
|
+
.option("--status <status>", "Filter orders by status")
|
|
418
|
+
.option("--created-after <iso>", "Filter orders created after ISO timestamp")
|
|
419
|
+
.option("--created-before <iso>", "Filter orders created before ISO timestamp")
|
|
420
|
+
.option("--archived", "Include archived orders")
|
|
421
|
+
.addOption(new Option("--sort <field>", "Sort orders by field").choices([
|
|
422
|
+
...marketplaceOrderSorts,
|
|
423
|
+
]))
|
|
424
|
+
.addOption(new Option("--sort-order <order>", "Sort order").choices(["asc", "desc"]))
|
|
425
|
+
.action(async (options, command) => {
|
|
426
|
+
validateListOptions(options, command);
|
|
427
|
+
const fields = fieldsFor(command);
|
|
428
|
+
validateOutputFields(orderColumns, fields);
|
|
429
|
+
const format = await runtime.formatFor(command, outputFormat(options, command), options.json);
|
|
430
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
431
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
432
|
+
const service = new MarketplaceService(client);
|
|
433
|
+
const shared = {
|
|
434
|
+
per_page: options.perPage,
|
|
435
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
436
|
+
...(options.createdAfter === undefined
|
|
437
|
+
? {}
|
|
438
|
+
: { created_after: options.createdAfter }),
|
|
439
|
+
...(options.createdBefore === undefined
|
|
440
|
+
? {}
|
|
441
|
+
: { created_before: options.createdBefore }),
|
|
442
|
+
...(options.archived === true ? { archived: true } : {}),
|
|
443
|
+
...(options.sort === undefined ? {} : { sort: options.sort }),
|
|
444
|
+
...(options.sortOrder === undefined
|
|
445
|
+
? {}
|
|
446
|
+
: { sort_order: options.sortOrder }),
|
|
447
|
+
};
|
|
448
|
+
const values = options.all === true
|
|
449
|
+
? service.getOrdersAll(shared)
|
|
450
|
+
: asAsync(await service.getOrders({
|
|
451
|
+
...shared,
|
|
452
|
+
...(options.page === undefined ? {} : { page: options.page }),
|
|
453
|
+
}));
|
|
454
|
+
await renderRecords(values, format, orderColumns, io.stdout, fields, options.limit);
|
|
455
|
+
});
|
|
456
|
+
addOutputOptions(orders
|
|
457
|
+
.command("get")
|
|
458
|
+
.description("Get details for one Marketplace order.")
|
|
459
|
+
.argument("<order-id>", "Discogs order ID (for example: 12345-1)", nonEmpty)).action(async (orderId, options, command) => {
|
|
460
|
+
const requestedFormat = outputFormat(options, command);
|
|
461
|
+
const fields = fieldsFor(command);
|
|
462
|
+
validateOutputFields(orderColumns, fields);
|
|
463
|
+
const format = await runtime.formatFor(command, requestedFormat, options.json);
|
|
464
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
465
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
466
|
+
const order = await new MarketplaceService(client).getOrder(orderId);
|
|
467
|
+
renderRecord(order, format, orderColumns, io.stdout, fields);
|
|
468
|
+
});
|
|
469
|
+
addOutputOptions(orders
|
|
470
|
+
.command("update")
|
|
471
|
+
.description("Update a Marketplace order's status and/or shipping amount.")
|
|
472
|
+
.argument("<order-id>", "Discogs order ID", nonEmpty))
|
|
473
|
+
.option("--status <status>", "New order status", nonEmpty)
|
|
474
|
+
.option("--shipping <amount>", "New shipping amount", decimalPrice)
|
|
475
|
+
.option("--dry-run", "Show the intended update without writing.")
|
|
476
|
+
.action(async (orderId, options, command) => {
|
|
477
|
+
if (options.status === undefined && options.shipping === undefined) {
|
|
478
|
+
throw new AppError({
|
|
479
|
+
kind: "usage",
|
|
480
|
+
code: "GROOVECTL_USAGE",
|
|
481
|
+
message: "Provide --status and/or --shipping.",
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
const dryRunColumns = columnsFor(["action", "orderId", "status", "shipping", "dryRun"]);
|
|
485
|
+
const requestedFormat = outputFormat(options, command);
|
|
486
|
+
const fields = fieldsFor(command);
|
|
487
|
+
const dryRun = options.dryRun === true;
|
|
488
|
+
validateOutputFields(dryRun ? dryRunColumns : orderColumns, fields);
|
|
489
|
+
const format = await runtime.formatFor(command, requestedFormat, options.json);
|
|
490
|
+
const payload = {
|
|
491
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
492
|
+
...(options.shipping === undefined
|
|
493
|
+
? {}
|
|
494
|
+
: { shipping: Number(options.shipping) }),
|
|
495
|
+
};
|
|
496
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
497
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
498
|
+
if (dryRun) {
|
|
499
|
+
renderRecord({
|
|
500
|
+
action: "marketplace.orders.update",
|
|
501
|
+
orderId,
|
|
502
|
+
...(payload.status === undefined
|
|
503
|
+
? {}
|
|
504
|
+
: { status: payload.status }),
|
|
505
|
+
...(payload.shipping === undefined
|
|
506
|
+
? {}
|
|
507
|
+
: { shipping: payload.shipping }),
|
|
508
|
+
dryRun: true,
|
|
509
|
+
}, format, dryRunColumns, io.stdout, fields);
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const updated = await new MarketplaceService(client).updateOrder(orderId, payload);
|
|
513
|
+
renderRecord(updated, format, orderColumns, io.stdout, fields);
|
|
514
|
+
});
|
|
515
|
+
addListOptions(orders
|
|
516
|
+
.command("messages")
|
|
517
|
+
.description("List messages on a Marketplace order.")
|
|
518
|
+
.argument("<order-id>", "Discogs order ID", nonEmpty)).action(async (orderId, options, command) => {
|
|
519
|
+
validateListOptions(options, command);
|
|
520
|
+
const fields = fieldsFor(command);
|
|
521
|
+
validateOutputFields(orderMessageColumns, fields);
|
|
522
|
+
const format = await runtime.formatFor(command, outputFormat(options, command), options.json);
|
|
523
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
524
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
525
|
+
const service = new MarketplaceService(client);
|
|
526
|
+
const values = options.all === true
|
|
527
|
+
? service.getOrderMessagesAll(orderId, { per_page: options.perPage })
|
|
528
|
+
: asAsync(await service.getOrderMessages(orderId, {
|
|
529
|
+
per_page: options.perPage,
|
|
530
|
+
...(options.page === undefined ? {} : { page: options.page }),
|
|
531
|
+
}));
|
|
532
|
+
await renderRecords(values, format, orderMessageColumns, io.stdout, fields, options.limit);
|
|
533
|
+
});
|
|
534
|
+
addOutputOptions(orders
|
|
535
|
+
.command("message")
|
|
536
|
+
.description("Post a message (and optionally update status) on a Marketplace order.")
|
|
537
|
+
.argument("<order-id>", "Discogs order ID", nonEmpty))
|
|
538
|
+
.option("--message <text>", "Message text to post", nonEmpty)
|
|
539
|
+
.option("--status <status>", "Optional new order status", nonEmpty)
|
|
540
|
+
.option("--dry-run", "Show the intended message without writing.")
|
|
541
|
+
.action(async (orderId, options, command) => {
|
|
542
|
+
if (options.message === undefined && options.status === undefined) {
|
|
543
|
+
throw new AppError({
|
|
544
|
+
kind: "usage",
|
|
545
|
+
code: "GROOVECTL_USAGE",
|
|
546
|
+
message: "Provide --message and/or --status.",
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
const dryRunColumns = columnsFor(["action", "orderId", "message", "status", "dryRun"]);
|
|
550
|
+
const requestedFormat = outputFormat(options, command);
|
|
551
|
+
const fields = fieldsFor(command);
|
|
552
|
+
const dryRun = options.dryRun === true;
|
|
553
|
+
validateOutputFields(dryRun ? dryRunColumns : orderMessageColumns, fields);
|
|
554
|
+
const format = await runtime.formatFor(command, requestedFormat, options.json);
|
|
555
|
+
const payload = {
|
|
556
|
+
...(options.message === undefined
|
|
557
|
+
? {}
|
|
558
|
+
: { message: options.message }),
|
|
559
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
560
|
+
};
|
|
561
|
+
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_required"));
|
|
562
|
+
const client = await runtime.clientFor(command, resolved?.token);
|
|
563
|
+
if (dryRun) {
|
|
564
|
+
renderRecord({
|
|
565
|
+
action: "marketplace.orders.message",
|
|
566
|
+
orderId,
|
|
567
|
+
...(payload.message === undefined
|
|
568
|
+
? {}
|
|
569
|
+
: { message: payload.message }),
|
|
570
|
+
...(payload.status === undefined
|
|
571
|
+
? {}
|
|
572
|
+
: { status: payload.status }),
|
|
573
|
+
dryRun: true,
|
|
574
|
+
}, format, dryRunColumns, io.stdout, fields);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
const posted = await new MarketplaceService(client).addOrderMessage(orderId, payload);
|
|
578
|
+
renderRecord(posted, format, orderMessageColumns, io.stdout, fields);
|
|
27
579
|
});
|
|
28
580
|
addOptions(marketplace
|
|
29
581
|
.command("fee")
|
|
30
582
|
.description("Ask Discogs for the selling fee for an item price (default currency: USD).")
|
|
31
583
|
.argument("<price>", "Non-negative decimal item price", decimalPrice)).action(async (price, options, command) => {
|
|
32
|
-
await read(command, options, (service) => service.getFee(price, options.currency));
|
|
584
|
+
await read(command, options, feeColumns, (service) => service.getFee(price, options.currency));
|
|
33
585
|
});
|
|
34
|
-
async function read(command, options, request) {
|
|
35
|
-
outputFormat(options);
|
|
586
|
+
async function read(command, options, columns, request) {
|
|
587
|
+
outputFormat(options, command);
|
|
588
|
+
const fields = fieldsFor(command);
|
|
589
|
+
validateOutputFields(columns, fields);
|
|
36
590
|
const format = await runtime.formatFor(command, options.format, options.json);
|
|
37
591
|
const resolved = await runtime.tokens.resolve(tokenRequestFor(command, "token_optional"));
|
|
38
592
|
const client = await runtime.clientFor(command, resolved?.token);
|
|
@@ -41,24 +595,55 @@ export function createMarketplaceCommand(io, runtime) {
|
|
|
41
595
|
value = await request(new MarketplaceService(client));
|
|
42
596
|
}
|
|
43
597
|
catch (error) {
|
|
44
|
-
|
|
45
|
-
error instanceof AppError &&
|
|
46
|
-
error.httpStatus === 401) {
|
|
47
|
-
throw new AppError({
|
|
48
|
-
kind: "auth_required",
|
|
49
|
-
code: "GROOVECTL_AUTH_REQUIRED",
|
|
50
|
-
message: "Discogs requires a User Token for this Marketplace request.",
|
|
51
|
-
remediation: "Use --token to enter one securely, --token-stdin, DISCOGS_TOKEN, or auth login, then retry.",
|
|
52
|
-
httpStatus: 401,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
throw error;
|
|
598
|
+
rethrowAnonymousAuthError(resolved, error);
|
|
56
599
|
}
|
|
57
|
-
|
|
58
|
-
renderRecord(value, format, columns, io.stdout, fieldsFor(command));
|
|
600
|
+
renderRecord(value, format, columns, io.stdout, fields);
|
|
59
601
|
}
|
|
60
602
|
return marketplace;
|
|
61
603
|
}
|
|
604
|
+
function rethrowAnonymousAuthError(resolved, error) {
|
|
605
|
+
if (resolved === undefined &&
|
|
606
|
+
error instanceof AppError &&
|
|
607
|
+
error.httpStatus === 401) {
|
|
608
|
+
throw new AppError({
|
|
609
|
+
kind: "auth_required",
|
|
610
|
+
code: "GROOVECTL_AUTH_REQUIRED",
|
|
611
|
+
message: "Discogs requires a User Token for this Marketplace request.",
|
|
612
|
+
remediation: "Use --token to enter one securely, --token-stdin, DISCOGS_TOKEN, or auth login, then retry.",
|
|
613
|
+
httpStatus: 401,
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
throw error;
|
|
617
|
+
}
|
|
618
|
+
function columnsFor(keys) {
|
|
619
|
+
return keys.map((key) => ({ key, value: (item) => item[key] }));
|
|
620
|
+
}
|
|
621
|
+
function nonEmpty(value) {
|
|
622
|
+
if (!value.trim()) {
|
|
623
|
+
throw new InvalidArgumentError("expected a non-empty value");
|
|
624
|
+
}
|
|
625
|
+
return value.trim();
|
|
626
|
+
}
|
|
627
|
+
function mediaConditionArg(value) {
|
|
628
|
+
const normalized = normalizeMediaCondition(value);
|
|
629
|
+
if (normalized === undefined) {
|
|
630
|
+
throw new InvalidArgumentError(`expected a Discogs media grade (${mediaGrades.join(", ")}) or full condition name`);
|
|
631
|
+
}
|
|
632
|
+
return normalized;
|
|
633
|
+
}
|
|
634
|
+
function sleeveConditionArg(value) {
|
|
635
|
+
const normalized = normalizeSleeveCondition(value);
|
|
636
|
+
if (normalized === undefined) {
|
|
637
|
+
throw new InvalidArgumentError(`expected a Discogs sleeve grade (${mediaGrades.join(", ")}, Generic, Not Graded, No Cover) or full condition name`);
|
|
638
|
+
}
|
|
639
|
+
return normalized;
|
|
640
|
+
}
|
|
641
|
+
function percentage(value) {
|
|
642
|
+
if (!/^\d+(?:\.\d+)?$/u.test(value) || Number(value) > 100) {
|
|
643
|
+
throw new InvalidArgumentError("expected a percentage between 0 and 100");
|
|
644
|
+
}
|
|
645
|
+
return Number(value);
|
|
646
|
+
}
|
|
62
647
|
function addOptions(command) {
|
|
63
648
|
return addOutputOptions(command).addOption(new Option("--currency <code>", "Currency for the response; omit to use the API default.").choices([...marketplaceCurrencies]));
|
|
64
649
|
}
|