@tolinax/ayoune-cli 2024.2.8 → 2024.2.9

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.
@@ -6,7 +6,7 @@ import { promptEntry } from "../prompts/promptEntry.js";
6
6
  import { handleCollectionOperation } from "../operations/handleCollectionOperation.js";
7
7
  import { localStorage } from "../helpers/localStorage.js";
8
8
  import { parseInteger } from "../helpers/parseInt.js";
9
- import { handleGetOperation } from "../operations/handleGetOperation";
9
+ import { handleGetOperation } from "../operations/handleGetOperation.js";
10
10
  export function createModulesCommand(program) {
11
11
  program
12
12
  .command("modules")
@@ -1,25 +1,25 @@
1
- // Operation handling functions
2
- import { apiCallHandler } from "../api/apiCallHandler.js";
3
- import { spinner } from "../../index.js";
4
- import { handleResponseFormatOptions } from "../helpers/handleResponseFormatOptions.js";
5
- export async function handleGetOperation(module, collection, opts) {
6
- spinner.start({
7
- text: `Getting entries in [${collection}]`,
8
- color: "magenta",
9
- });
10
- let res = await apiCallHandler(`${module}/${collection.toLowerCase()}`, "get", null, {
11
- page: opts.page,
12
- responseFormat: opts.responseFormat,
13
- limit: opts.limit,
14
- from: opts.from,
15
- fields: opts.fields,
16
- hideMeta: opts.hideMeta,
17
- verbosity: opts.verbosity,
18
- });
19
- let { plainResult, result, meta, content } = handleResponseFormatOptions(opts, res);
20
- spinner.success({
21
- text: `Got ${opts.limit} entries of ${meta.pageInfo.totalEntries} : Page ${meta.pageInfo.page} of ${meta.pageInfo.totalPages}`,
22
- });
23
- spinner.stop();
24
- return { data: plainResult, content, result, meta };
25
- }
1
+ // Operation handling functions
2
+ import { apiCallHandler } from "../api/apiCallHandler.js";
3
+ import { spinner } from "../../index.js";
4
+ import { handleResponseFormatOptions } from "../helpers/handleResponseFormatOptions.js";
5
+ export async function handleGetOperation(module, collection, opts) {
6
+ spinner.start({
7
+ text: `Getting entries in [${collection}]`,
8
+ color: "magenta",
9
+ });
10
+ let res = await apiCallHandler(`${module}/${collection.toLowerCase()}`, "get", null, {
11
+ page: opts.page,
12
+ responseFormat: opts.responseFormat,
13
+ limit: opts.limit,
14
+ from: opts.from,
15
+ fields: opts.fields,
16
+ hideMeta: opts.hideMeta,
17
+ verbosity: opts.verbosity,
18
+ });
19
+ let { plainResult, result, meta, content } = handleResponseFormatOptions(opts, res);
20
+ spinner.success({
21
+ text: `Got ${opts.limit} entries of ${meta.pageInfo.totalEntries} : Page ${meta.pageInfo.page} of ${meta.pageInfo.totalPages}`,
22
+ });
23
+ spinner.stop();
24
+ return { data: plainResult, content, result, meta };
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolinax/ayoune-cli",
3
- "version": "2024.2.8",
3
+ "version": "2024.2.9",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",