@open-mercato/cli 0.10.1-develop.7758.1.fb3a60392f → 0.10.1-develop.7759.1.416727583e
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/.turbo/turbo-build.log +1 -1
- package/dist/agentic/guides/module-facts.json +162 -162
- package/dist/agentic/guides/module-facts.v2.json +162 -162
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/index.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
- package/dist/agentic/guides/modules/cart/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/promotions/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/dist/lib/module-search-args.js +97 -0
- package/dist/lib/module-search-args.js.map +7 -0
- package/dist/lib/module-search-index.js +677 -0
- package/dist/lib/module-search-index.js.map +7 -0
- package/dist/lib/module-search.js +668 -0
- package/dist/lib/module-search.js.map +7 -0
- package/dist/lib/modules-config.js +5 -0
- package/dist/lib/modules-config.js.map +2 -2
- package/dist/mercato.js +13 -3
- package/dist/mercato.js.map +2 -2
- package/package.json +8 -7
- package/src/__tests__/mercato.test.ts +57 -0
- package/src/lib/__fixtures__/module-search/README.md +97 -0
- package/src/lib/__fixtures__/module-search/built-in.json +235 -0
- package/src/lib/__fixtures__/module-search/catalog-parity.json +4076 -0
- package/src/lib/__fixtures__/module-search/modules-index.json +1980 -0
- package/src/lib/__tests__/module-search.test.ts +929 -0
- package/src/lib/module-search-args.ts +116 -0
- package/src/lib/module-search-index.ts +1033 -0
- package/src/lib/module-search.ts +952 -0
- package/src/lib/modules-config.ts +8 -0
- package/src/mercato.ts +17 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# staff — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/staff
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# storage_s3 — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/storage-s3 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/storage-s3 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/storage-s3/src/modules/storage_s3
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_akeneo — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/sync-akeneo 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/sync-akeneo 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/sync-akeneo/src/modules/sync_akeneo
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_excel — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/sync_excel
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# system_status_overlays — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/enterprise 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/enterprise/src/modules/system_status_overlays
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# telemetry — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/telemetry 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/telemetry 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/telemetry/src/modules/telemetry
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# tillio — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/tillio 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/tillio 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/tillio/src/modules/tillio
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# translations — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/translations
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# warranty_claims — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/warranty_claims
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# webhooks — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/webhooks 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/webhooks 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/webhooks/src/modules/webhooks
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# wms — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/wms
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# workflows — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.7759.1.416727583e; core 0.10.1-develop.7759.1.416727583e — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/workflows
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1185,7 +1185,7 @@
|
|
|
1185
1185
|
"facts": {
|
|
1186
1186
|
"title": "Example Module",
|
|
1187
1187
|
"description": "Demonstrates pages, APIs, entities and DI.",
|
|
1188
|
-
"coreVersion": "0.10.1-develop.
|
|
1188
|
+
"coreVersion": "0.10.1-develop.7759.1.416727583e",
|
|
1189
1189
|
"sourcePackage": null,
|
|
1190
1190
|
"sourceVersion": null,
|
|
1191
1191
|
"sourceRoot": "src/modules/example",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"generator": "@open-mercato/cli@0.10.1-develop.
|
|
3
|
+
"generator": "@open-mercato/cli@0.10.1-develop.7759.1.416727583e",
|
|
4
4
|
"files": {
|
|
5
5
|
"AGENTS.md": "b27342ee5f61e805ba52703fdb7ec822b030490f734b4d80f48dfd1e05fa4cf5",
|
|
6
6
|
"BACKWARD_COMPATIBILITY.md": "bac9a78af24b35909285d6d52f411d72aa5469204d9f434e9d5b5590ba7edfec"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const MODULE_SEARCH_KINDS = ["module", "provider", "library", "tool", "built-in"];
|
|
2
|
+
const MODULE_SEARCH_DEFAULT_LIMIT = 10;
|
|
3
|
+
const MODULE_SEARCH_MAX_LIMIT = 20;
|
|
4
|
+
const QUERY_MAX_LENGTH = 200;
|
|
5
|
+
const CATEGORY_PATTERN = /^[a-z0-9][a-z0-9-]{0,40}$/;
|
|
6
|
+
function readValue(args, index, flag) {
|
|
7
|
+
const next = args[index + 1];
|
|
8
|
+
if (next === void 0 || next.startsWith("--")) {
|
|
9
|
+
throw new Error(`${flag} requires a value`);
|
|
10
|
+
}
|
|
11
|
+
return next;
|
|
12
|
+
}
|
|
13
|
+
function splitFlag(arg) {
|
|
14
|
+
const eq = arg.indexOf("=");
|
|
15
|
+
return eq === -1 ? { flag: arg, inline: null } : { flag: arg.slice(0, eq), inline: arg.slice(eq + 1) };
|
|
16
|
+
}
|
|
17
|
+
function parseKinds(value) {
|
|
18
|
+
const kinds = value.split(",").map((item) => item.trim()).filter((item) => item !== "");
|
|
19
|
+
if (kinds.length === 0) throw new Error("--kind requires a value");
|
|
20
|
+
return kinds.map((kind) => {
|
|
21
|
+
const match = MODULE_SEARCH_KINDS.find((candidate) => candidate === kind);
|
|
22
|
+
if (!match) throw new Error(`--kind must be one of: ${MODULE_SEARCH_KINDS.join(", ")}`);
|
|
23
|
+
return match;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function parseLimit(value) {
|
|
27
|
+
if (!/^\d+$/.test(value)) throw new Error(`--limit must be a whole number between 1 and ${MODULE_SEARCH_MAX_LIMIT}`);
|
|
28
|
+
const limit = Number(value);
|
|
29
|
+
if (limit < 1 || limit > MODULE_SEARCH_MAX_LIMIT) {
|
|
30
|
+
throw new Error(`--limit must be a whole number between 1 and ${MODULE_SEARCH_MAX_LIMIT}`);
|
|
31
|
+
}
|
|
32
|
+
return limit;
|
|
33
|
+
}
|
|
34
|
+
function parseModuleSearchArgs(args) {
|
|
35
|
+
const words = [];
|
|
36
|
+
let category = null;
|
|
37
|
+
let kinds = null;
|
|
38
|
+
let allLines = false;
|
|
39
|
+
let limit = MODULE_SEARCH_DEFAULT_LIMIT;
|
|
40
|
+
let json = false;
|
|
41
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
42
|
+
const arg = args[index];
|
|
43
|
+
if (!arg) continue;
|
|
44
|
+
if (!arg.startsWith("--")) {
|
|
45
|
+
words.push(arg);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const { flag, inline } = splitFlag(arg);
|
|
49
|
+
if (flag === "--json" || flag === "--all-lines") {
|
|
50
|
+
if (inline !== null) throw new Error(`${flag} does not accept a value`);
|
|
51
|
+
if (flag === "--json") json = true;
|
|
52
|
+
else allLines = true;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (flag === "--category" || flag === "--kind" || flag === "--limit") {
|
|
56
|
+
const value = inline ?? readValue(args, index, flag);
|
|
57
|
+
if (inline === null) index += 1;
|
|
58
|
+
if (flag === "--category") {
|
|
59
|
+
if (!CATEGORY_PATTERN.test(value)) throw new Error("--category expects a catalog category id, for example payments-finance");
|
|
60
|
+
category = value;
|
|
61
|
+
} else if (flag === "--kind") {
|
|
62
|
+
kinds = parseKinds(value);
|
|
63
|
+
} else {
|
|
64
|
+
limit = parseLimit(value);
|
|
65
|
+
}
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`Unsupported option: ${flag}`);
|
|
69
|
+
}
|
|
70
|
+
const query = words.join(" ").trim();
|
|
71
|
+
if (query.length > QUERY_MAX_LENGTH) throw new Error(`The query is longer than ${QUERY_MAX_LENGTH} characters`);
|
|
72
|
+
return { query: query === "" ? null : query, category, kinds, allLines, limit, json };
|
|
73
|
+
}
|
|
74
|
+
function parseModuleInfoArgs(args) {
|
|
75
|
+
let ref = null;
|
|
76
|
+
let json = false;
|
|
77
|
+
for (const arg of args) {
|
|
78
|
+
if (!arg) continue;
|
|
79
|
+
if (arg === "--json") {
|
|
80
|
+
json = true;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (arg.startsWith("--")) throw new Error(`Unsupported option: ${splitFlag(arg).flag}`);
|
|
84
|
+
if (ref !== null) throw new Error("module info takes one package name or module id");
|
|
85
|
+
ref = arg.trim();
|
|
86
|
+
}
|
|
87
|
+
if (ref !== null && ref.length > 220) throw new Error("The package name or module id is too long");
|
|
88
|
+
return { ref: ref === "" ? null : ref, json };
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
MODULE_SEARCH_DEFAULT_LIMIT,
|
|
92
|
+
MODULE_SEARCH_KINDS,
|
|
93
|
+
MODULE_SEARCH_MAX_LIMIT,
|
|
94
|
+
parseModuleInfoArgs,
|
|
95
|
+
parseModuleSearchArgs
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=module-search-args.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/module-search-args.ts"],
|
|
4
|
+
"sourcesContent": ["export const MODULE_SEARCH_KINDS = ['module', 'provider', 'library', 'tool', 'built-in'] as const\nexport type ModuleSearchKind = (typeof MODULE_SEARCH_KINDS)[number]\n\nexport type ParsedModuleSearchArgs = {\n query: string | null\n category: string | null\n kinds: ModuleSearchKind[] | null\n allLines: boolean\n limit: number\n json: boolean\n}\n\nexport type ParsedModuleInfoArgs = {\n ref: string | null\n json: boolean\n}\n\nexport const MODULE_SEARCH_DEFAULT_LIMIT = 10\nexport const MODULE_SEARCH_MAX_LIMIT = 20\nconst QUERY_MAX_LENGTH = 200\nconst CATEGORY_PATTERN = /^[a-z0-9][a-z0-9-]{0,40}$/\n\nfunction readValue(args: string[], index: number, flag: string): string {\n const next = args[index + 1]\n if (next === undefined || next.startsWith('--')) {\n throw new Error(`${flag} requires a value`)\n }\n return next\n}\n\nfunction splitFlag(arg: string): { flag: string; inline: string | null } {\n const eq = arg.indexOf('=')\n return eq === -1 ? { flag: arg, inline: null } : { flag: arg.slice(0, eq), inline: arg.slice(eq + 1) }\n}\n\nfunction parseKinds(value: string): ModuleSearchKind[] {\n const kinds = value\n .split(',')\n .map((item) => item.trim())\n .filter((item) => item !== '')\n if (kinds.length === 0) throw new Error('--kind requires a value')\n return kinds.map((kind) => {\n const match = MODULE_SEARCH_KINDS.find((candidate) => candidate === kind)\n if (!match) throw new Error(`--kind must be one of: ${MODULE_SEARCH_KINDS.join(', ')}`)\n return match\n })\n}\n\nfunction parseLimit(value: string): number {\n if (!/^\\d+$/.test(value)) throw new Error(`--limit must be a whole number between 1 and ${MODULE_SEARCH_MAX_LIMIT}`)\n const limit = Number(value)\n if (limit < 1 || limit > MODULE_SEARCH_MAX_LIMIT) {\n throw new Error(`--limit must be a whole number between 1 and ${MODULE_SEARCH_MAX_LIMIT}`)\n }\n return limit\n}\n\nexport function parseModuleSearchArgs(args: string[]): ParsedModuleSearchArgs {\n const words: string[] = []\n let category: string | null = null\n let kinds: ModuleSearchKind[] | null = null\n let allLines = false\n let limit = MODULE_SEARCH_DEFAULT_LIMIT\n let json = false\n\n for (let index = 0; index < args.length; index += 1) {\n const arg = args[index]\n if (!arg) continue\n if (!arg.startsWith('--')) {\n words.push(arg)\n continue\n }\n const { flag, inline } = splitFlag(arg)\n if (flag === '--json' || flag === '--all-lines') {\n if (inline !== null) throw new Error(`${flag} does not accept a value`)\n if (flag === '--json') json = true\n else allLines = true\n continue\n }\n if (flag === '--category' || flag === '--kind' || flag === '--limit') {\n const value = inline ?? readValue(args, index, flag)\n if (inline === null) index += 1\n if (flag === '--category') {\n if (!CATEGORY_PATTERN.test(value)) throw new Error('--category expects a catalog category id, for example payments-finance')\n category = value\n } else if (flag === '--kind') {\n kinds = parseKinds(value)\n } else {\n limit = parseLimit(value)\n }\n continue\n }\n throw new Error(`Unsupported option: ${flag}`)\n }\n\n const query = words.join(' ').trim()\n if (query.length > QUERY_MAX_LENGTH) throw new Error(`The query is longer than ${QUERY_MAX_LENGTH} characters`)\n return { query: query === '' ? null : query, category, kinds, allLines, limit, json }\n}\n\nexport function parseModuleInfoArgs(args: string[]): ParsedModuleInfoArgs {\n let ref: string | null = null\n let json = false\n for (const arg of args) {\n if (!arg) continue\n if (arg === '--json') {\n json = true\n continue\n }\n if (arg.startsWith('--')) throw new Error(`Unsupported option: ${splitFlag(arg).flag}`)\n if (ref !== null) throw new Error('module info takes one package name or module id')\n ref = arg.trim()\n }\n if (ref !== null && ref.length > 220) throw new Error('The package name or module id is too long')\n return { ref: ref === '' ? null : ref, json }\n}\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,sBAAsB,CAAC,UAAU,YAAY,WAAW,QAAQ,UAAU;AAiBhF,MAAM,8BAA8B;AACpC,MAAM,0BAA0B;AACvC,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AAEzB,SAAS,UAAU,MAAgB,OAAe,MAAsB;AACtE,QAAM,OAAO,KAAK,QAAQ,CAAC;AAC3B,MAAI,SAAS,UAAa,KAAK,WAAW,IAAI,GAAG;AAC/C,UAAM,IAAI,MAAM,GAAG,IAAI,mBAAmB;AAAA,EAC5C;AACA,SAAO;AACT;AAEA,SAAS,UAAU,KAAsD;AACvE,QAAM,KAAK,IA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