zinkee 0.1.20 → 0.1.22

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.
@@ -41,7 +41,8 @@
41
41
  "Bash(_ZINKEE_COMPLETE=zsh_complete COMP_WORDS=\"zinkee config show --foo --bar baz quux ?\" COMP_CWORD=10 node dist/index.js)",
42
42
  "Bash(git -C /home/guillermo/dev/cli status)",
43
43
  "Bash(git -C /home/guillermo/dev/cli branch --show-current)",
44
- "Bash(git -C /home/guillermo/dev/cli diff --stat)"
44
+ "Bash(git -C /home/guillermo/dev/cli diff --stat)",
45
+ "Bash(git fetch *)"
45
46
  ]
46
47
  }
47
48
  }
package/dist/index.js CHANGED
@@ -3306,12 +3306,12 @@ var specificExamples = {
3306
3306
  }`
3307
3307
  },
3308
3308
  {
3309
- description: "Change a DATE variable to use lastWeek.",
3310
- command: "zinkee --json displays variables update 0f6f062f-1478-4df2-96a1-c495d037d260 bbbbbbbb-2222-4222-a222-222222222222 --date-mode dynamic --date-dynamic-option lastWeek",
3309
+ description: "Change a DATE variable to use last12Months.",
3310
+ command: "zinkee --json displays variables update 0f6f062f-1478-4df2-96a1-c495d037d260 bbbbbbbb-2222-4222-a222-222222222222 --date-mode dynamic --date-dynamic-option last12Months",
3311
3311
  raw: `{
3312
3312
  "date": {
3313
3313
  "mode": "dynamic",
3314
- "dynamicOption": "lastWeek"
3314
+ "dynamicOption": "last12Months"
3315
3315
  }
3316
3316
  }`
3317
3317
  }
@@ -3387,8 +3387,38 @@ var specificExamples = {
3387
3387
  }`
3388
3388
  },
3389
3389
  {
3390
- description: "Create a bars CHART widget with a time-serie x-axis and two y-axis series.",
3391
- command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by month" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type bars --x-axis-field due-date --x-axis-date-format MONTH --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --y-axis-serie '{"typeCalc":"COUNT","fieldCalc":"id","color":"#E57373","axisType":"SECONDARY"}' --legend '{"position":"bottom"}'`,
3390
+ description: "Create a CHART widget with a daily time-serie x-axis.",
3391
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by day" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type lines --x-axis-field due-date --x-axis-date-format DATE --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --legend '{"position":"bottom"}'`,
3392
+ raw: `{
3393
+ "type": "CHART",
3394
+ "source": {
3395
+ "originResourceId": "2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e",
3396
+ "isOriginSubSchema": false
3397
+ },
3398
+ "placement": {
3399
+ "layout": { "x": 0, "y": 0, "w": 8, "h": 6 }
3400
+ },
3401
+ "presentation": { "name": "Revenue by day" },
3402
+ "chart": {
3403
+ "chartType": "lines",
3404
+ "xAxisFieldId": "due-date",
3405
+ "xAxisDateFormat": "DATE",
3406
+ "xAxisAsTimeSerie": true,
3407
+ "yAxisSeries": [
3408
+ {
3409
+ "typeCalc": "SUM",
3410
+ "fieldCalc": "amount",
3411
+ "color": "#4B9CD3",
3412
+ "axisType": "PRIMARY"
3413
+ }
3414
+ ],
3415
+ "legend": { "position": "bottom" }
3416
+ }
3417
+ }`
3418
+ },
3419
+ {
3420
+ description: "Create a bars CHART widget with a monthly time-serie x-axis and two y-axis series.",
3421
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by month" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type bars --x-axis-field due-date --x-axis-date-format MONTH_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --y-axis-serie '{"typeCalc":"COUNT","fieldCalc":"id","color":"#E57373","axisType":"SECONDARY"}' --legend '{"position":"bottom"}'`,
3392
3422
  raw: `{
3393
3423
  "type": "CHART",
3394
3424
  "source": {
@@ -3402,7 +3432,7 @@ var specificExamples = {
3402
3432
  "chart": {
3403
3433
  "chartType": "bars",
3404
3434
  "xAxisFieldId": "due-date",
3405
- "xAxisDateFormat": "MONTH",
3435
+ "xAxisDateFormat": "MONTH_YEAR",
3406
3436
  "xAxisAsTimeSerie": true,
3407
3437
  "yAxisSeries": [
3408
3438
  {
@@ -3420,6 +3450,66 @@ var specificExamples = {
3420
3450
  ],
3421
3451
  "legend": { "position": "bottom" }
3422
3452
  }
3453
+ }`
3454
+ },
3455
+ {
3456
+ description: "Create a bars CHART widget with a quarterly time-serie x-axis.",
3457
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by quarter" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type bars --x-axis-field due-date --x-axis-date-format QUARTER_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --legend '{"position":"bottom"}'`,
3458
+ raw: `{
3459
+ "type": "CHART",
3460
+ "source": {
3461
+ "originResourceId": "2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e",
3462
+ "isOriginSubSchema": false
3463
+ },
3464
+ "placement": {
3465
+ "layout": { "x": 0, "y": 0, "w": 8, "h": 6 }
3466
+ },
3467
+ "presentation": { "name": "Revenue by quarter" },
3468
+ "chart": {
3469
+ "chartType": "bars",
3470
+ "xAxisFieldId": "due-date",
3471
+ "xAxisDateFormat": "QUARTER_YEAR",
3472
+ "xAxisAsTimeSerie": true,
3473
+ "yAxisSeries": [
3474
+ {
3475
+ "typeCalc": "SUM",
3476
+ "fieldCalc": "amount",
3477
+ "color": "#4B9CD3",
3478
+ "axisType": "PRIMARY"
3479
+ }
3480
+ ],
3481
+ "legend": { "position": "bottom" }
3482
+ }
3483
+ }`
3484
+ },
3485
+ {
3486
+ description: "Create a CHART widget with a yearly time-serie x-axis.",
3487
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by year" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type lines --x-axis-field due-date --x-axis-date-format YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --legend '{"position":"bottom"}'`,
3488
+ raw: `{
3489
+ "type": "CHART",
3490
+ "source": {
3491
+ "originResourceId": "2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e",
3492
+ "isOriginSubSchema": false
3493
+ },
3494
+ "placement": {
3495
+ "layout": { "x": 0, "y": 0, "w": 8, "h": 6 }
3496
+ },
3497
+ "presentation": { "name": "Revenue by year" },
3498
+ "chart": {
3499
+ "chartType": "lines",
3500
+ "xAxisFieldId": "due-date",
3501
+ "xAxisDateFormat": "YEAR",
3502
+ "xAxisAsTimeSerie": true,
3503
+ "yAxisSeries": [
3504
+ {
3505
+ "typeCalc": "SUM",
3506
+ "fieldCalc": "amount",
3507
+ "color": "#4B9CD3",
3508
+ "axisType": "PRIMARY"
3509
+ }
3510
+ ],
3511
+ "legend": { "position": "bottom" }
3512
+ }
3423
3513
  }`
3424
3514
  },
3425
3515
  {
@@ -3570,13 +3660,13 @@ var specificExamples = {
3570
3660
  }`
3571
3661
  },
3572
3662
  {
3573
- description: "Replace the chart series with weekly lines.",
3574
- command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 22222222-2222-4222-a222-222222222222 --chart-type lines --x-axis-field due-date --x-axis-date-format WEEK --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#2E7D32","axisType":"PRIMARY"}'`,
3663
+ description: "Replace the chart series with quarterly lines.",
3664
+ command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 22222222-2222-4222-a222-222222222222 --chart-type lines --x-axis-field due-date --x-axis-date-format QUARTER_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#2E7D32","axisType":"PRIMARY"}'`,
3575
3665
  raw: `{
3576
3666
  "chart": {
3577
3667
  "chartType": "lines",
3578
3668
  "xAxisFieldId": "due-date",
3579
- "xAxisDateFormat": "WEEK",
3669
+ "xAxisDateFormat": "QUARTER_YEAR",
3580
3670
  "xAxisAsTimeSerie": true,
3581
3671
  "yAxisSeries": [
3582
3672
  {
@@ -7976,6 +8066,7 @@ function parseExpression(input) {
7976
8066
  }
7977
8067
 
7978
8068
  // src/commands/displays.ts
8069
+ var DATE_DYNAMIC_OPTIONS = "today, thisWeek, thisMonth, thisQuarter, thisSemester, thisYear, next7Days, next30Days, next6Months, next12Months, last12Months";
7979
8070
  function getCommandIo4(stdout) {
7980
8071
  return stdout ?? process.stdout;
7981
8072
  }
@@ -8412,7 +8503,7 @@ function registerDisplaysCommands(program, options = {}) {
8412
8503
  }
8413
8504
  printTable([match], void 0, stdout);
8414
8505
  });
8415
- variables.command("create").description("Create variable").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).option("--type <type>").option("--name <name>").option("--allow-multiple").option("--static").option("--default <value>").option("--default-value <value>", "repeatable default value", (v, p = []) => [...p, v], []).option("--source-schema <id>").option("--source-field <id>").option("--filter <expr>", "repeatable filter", collectFilters, []).option("--date-mode <mode>").option("--date-dynamic-option <option>").option("--date-specific <iso>").option("--date-range-start <iso>").option("--date-range-end <iso>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, commandOptions) {
8506
+ variables.command("create").description("Create variable").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).option("--type <type>").option("--name <name>").option("--allow-multiple").option("--static").option("--default <value>").option("--default-value <value>", "repeatable default value", (v, p = []) => [...p, v], []).option("--source-schema <id>").option("--source-field <id>").option("--filter <expr>", "repeatable filter", collectFilters, []).option("--date-mode <mode>").option("--date-dynamic-option <option>", `dynamic date period (${DATE_DYNAMIC_OPTIONS})`).option("--date-specific <iso>").option("--date-range-start <iso>").option("--date-range-end <iso>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, commandOptions) {
8416
8507
  const { api, json, readOnly } = createDisplaysApi(this, filePath);
8417
8508
  ensureWritable3("displays variables create", readOnly, "write");
8418
8509
  const data = await api.createVariable(display, buildVariableBody(commandOptions));
@@ -8422,7 +8513,7 @@ function registerDisplaysCommands(program, options = {}) {
8422
8513
  }
8423
8514
  writeLine4(stdout, `Created variable on display "${display.value}".`);
8424
8515
  });
8425
- variables.command("update").description("Update variable").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).argument("<variable>", "variable id").option("--type <type>").option("--name <name>").option("--allow-multiple").option("--static").option("--default <value>").option("--default-value <value>", "repeatable default value", (v, p = []) => [...p, v], []).option("--source-schema <id>").option("--source-field <id>").option("--filter <expr>", "repeatable filter", collectFilters, []).option("--date-mode <mode>").option("--date-dynamic-option <option>").option("--date-specific <iso>").option("--date-range-start <iso>").option("--date-range-end <iso>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, variableId, commandOptions) {
8516
+ variables.command("update").description("Update variable").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).argument("<variable>", "variable id").option("--type <type>").option("--name <name>").option("--allow-multiple").option("--static").option("--default <value>").option("--default-value <value>", "repeatable default value", (v, p = []) => [...p, v], []).option("--source-schema <id>").option("--source-field <id>").option("--filter <expr>", "repeatable filter", collectFilters, []).option("--date-mode <mode>").option("--date-dynamic-option <option>", `dynamic date period (${DATE_DYNAMIC_OPTIONS})`).option("--date-specific <iso>").option("--date-range-start <iso>").option("--date-range-end <iso>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, variableId, commandOptions) {
8426
8517
  const { api, json, readOnly } = createDisplaysApi(this, filePath);
8427
8518
  ensureWritable3("displays variables update", readOnly, "write");
8428
8519
  const data = await api.updateVariable(display, variableId, buildVariableBody(commandOptions));
@@ -8462,7 +8553,7 @@ function registerDisplaysCommands(program, options = {}) {
8462
8553
  }
8463
8554
  printTable([data], void 0, stdout);
8464
8555
  });
8465
- widgets.command("create").description("Create widget").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).requiredOption("--type <type>", "widget type").option("--name <name>").option("--description <text>").option("--icon <icon>").option("--color <color>").option("--origin-resource <uuid>").option("--origin-subschema").option("--tab <tabId>").option("--slot <slotId>").option("--layout <json>").option("--layout-file <path>").option("--field <field>", "repeatable field", (v, p = []) => [...p, v], []).option("--sort <sort>", "repeatable sort", (v, p = []) => [...p, v], []).option("--filter <expr>", "repeatable filter", collectFilters, []).option("--widget-read-only").option("--hide-add-button").option("--hide-delete-button").option("--hide-sort-button").option("--hide-filter-button").option("--hide-see-button").option("--calc <type>").option("--calc-field <uuid>").option("--kpi-config <json>").option("--chart-type <type>").option("--x-axis-field <uuid>").option("--x-axis-date-format <granularity>").option("--x-axis-time-series").option("--y-axis-serie <json>", "repeatable y axis serie", (v, p = []) => [...p, v], []).option("--legend <json>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, commandOptions) {
8556
+ widgets.command("create").description("Create widget").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).requiredOption("--type <type>", "widget type").option("--name <name>").option("--description <text>").option("--icon <icon>").option("--color <color>").option("--origin-resource <uuid>").option("--origin-subschema").option("--tab <tabId>").option("--slot <slotId>").option("--layout <json>").option("--layout-file <path>").option("--field <field>", "repeatable field", (v, p = []) => [...p, v], []).option("--sort <sort>", "repeatable sort", (v, p = []) => [...p, v], []).option("--filter <expr>", "repeatable filter", collectFilters, []).option("--widget-read-only").option("--hide-add-button").option("--hide-delete-button").option("--hide-sort-button").option("--hide-filter-button").option("--hide-see-button").option("--calc <type>").option("--calc-field <uuid>").option("--kpi-config <json>").option("--chart-type <type>", "chart type (lines, bars, stackedBars, combined)").option("--x-axis-field <uuid>").option("--x-axis-date-format <granularity>", "time granularity (DATE, MONTH_YEAR, QUARTER_YEAR, YEAR)").option("--x-axis-time-series").option("--y-axis-serie <json>", "repeatable y axis serie", (v, p = []) => [...p, v], []).option("--legend <json>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, commandOptions) {
8466
8557
  const { api, json, readOnly } = createDisplaysApi(this, filePath);
8467
8558
  ensureWritable3("displays widgets create", readOnly, "write");
8468
8559
  const data = await api.createWidget(display, buildWidgetBody(commandOptions));
@@ -8472,7 +8563,7 @@ function registerDisplaysCommands(program, options = {}) {
8472
8563
  }
8473
8564
  writeLine4(stdout, `Created widget on display "${display.value}".`);
8474
8565
  });
8475
- widgets.command("update").description("Update widget").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).argument("<widget>", "widget id").option("--type <type>").option("--name <name>").option("--description <text>").option("--icon <icon>").option("--color <color>").option("--origin-resource <uuid>").option("--origin-subschema").option("--tab <tabId>").option("--slot <slotId>").option("--layout <json>").option("--layout-file <path>").option("--field <field>", "repeatable field", (v, p = []) => [...p, v], []).option("--sort <sort>", "repeatable sort", (v, p = []) => [...p, v], []).option("--filter <expr>", "repeatable filter", collectFilters, []).option("--widget-read-only").option("--hide-add-button").option("--hide-delete-button").option("--hide-sort-button").option("--hide-filter-button").option("--hide-see-button").option("--calc <type>").option("--calc-field <uuid>").option("--kpi-config <json>").option("--chart-type <type>").option("--x-axis-field <uuid>").option("--x-axis-date-format <granularity>").option("--x-axis-time-series").option("--y-axis-serie <json>", "repeatable y axis serie", (v, p = []) => [...p, v], []).option("--legend <json>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, widgetId, commandOptions) {
8566
+ widgets.command("update").description("Update widget").argument("<display>", "display uuid or slug", parseUuidOrSlugSelector3).argument("<widget>", "widget id").option("--type <type>").option("--name <name>").option("--description <text>").option("--icon <icon>").option("--color <color>").option("--origin-resource <uuid>").option("--origin-subschema").option("--tab <tabId>").option("--slot <slotId>").option("--layout <json>").option("--layout-file <path>").option("--field <field>", "repeatable field", (v, p = []) => [...p, v], []).option("--sort <sort>", "repeatable sort", (v, p = []) => [...p, v], []).option("--filter <expr>", "repeatable filter", collectFilters, []).option("--widget-read-only").option("--hide-add-button").option("--hide-delete-button").option("--hide-sort-button").option("--hide-filter-button").option("--hide-see-button").option("--calc <type>").option("--calc-field <uuid>").option("--kpi-config <json>").option("--chart-type <type>", "chart type (lines, bars, stackedBars, combined)").option("--x-axis-field <uuid>").option("--x-axis-date-format <granularity>", "time granularity (DATE, MONTH_YEAR, QUARTER_YEAR, YEAR)").option("--x-axis-time-series").option("--y-axis-serie <json>", "repeatable y axis serie", (v, p = []) => [...p, v], []).option("--legend <json>").option("--raw <json>").option("--raw-file <path>").action(async function action(display, widgetId, commandOptions) {
8476
8567
  const { api, json, readOnly } = createDisplaysApi(this, filePath);
8477
8568
  ensureWritable3("displays widgets update", readOnly, "write");
8478
8569
  const data = await api.updateWidget(display, widgetId, buildWidgetBody(commandOptions));