@scrapeatlas/cli 0.7.0 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrapeatlas/cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Official ScrapeAtlas CLI — discover and call social data API endpoints from your terminal.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "bin/",
11
11
  "src/",
12
12
  "catalog.json",
13
+ "compatibility-catalog.json",
13
14
  "README.md",
14
15
  "LICENSE"
15
16
  ],
package/src/cli.mjs CHANGED
@@ -6,6 +6,10 @@ import { CliError, origin, request } from './http.mjs';
6
6
  import { convert, kebab, valid } from './schema.mjs';
7
7
 
8
8
  const catalog = JSON.parse(await readFile(new URL('../catalog.json', import.meta.url), 'utf8'));
9
+ const compatibilityCatalog = JSON.parse(
10
+ await readFile(new URL('../compatibility-catalog.json', import.meta.url), 'utf8')
11
+ );
12
+ const callableCatalog = [...catalog, ...compatibilityCatalog];
9
13
  const pkg = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
10
14
  const globalOptions = {
11
15
  help: { type: 'boolean', short: 'h' },
@@ -146,8 +150,8 @@ export async function run(args) {
146
150
  const words = rough.positionals;
147
151
  const operation =
148
152
  words[0] === 'call'
149
- ? catalog.find((entry) => entry.operation === words[1])
150
- : catalog.find((entry) => entry.platform === words[0] && entry.action === words[1]);
153
+ ? callableCatalog.find((entry) => entry.operation === words[1])
154
+ : callableCatalog.find((entry) => entry.platform === words[0] && entry.action === words[1]);
151
155
  const { values: options, positionals, names } = parse(args, operation);
152
156
  if (options.output) {
153
157
  try {