zinkee 0.1.25 → 0.1.26

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.
@@ -1283,7 +1283,7 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1283
1283
  description:
1284
1284
  "Create a TABLE widget (CLI normalises --type table to TABLE_OR_SUBTABLE).",
1285
1285
  command:
1286
- `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type table --name Customers --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":8}' --field id --field contact-name --field status --sort '{"fieldId":"id","direction":"DESC"}'`,
1286
+ `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type table --name Customers --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":8}' --field contact-name --field status --field amount --sort '{"fieldId":"contact-name","direction":"ASC"}'`,
1287
1287
  raw: `{
1288
1288
  "type": "TABLE_OR_SUBTABLE",
1289
1289
  "source": {
@@ -1298,11 +1298,11 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1298
1298
  },
1299
1299
  "query": {
1300
1300
  "sorts": [
1301
- { "fieldId": "id", "direction": "DESC" }
1301
+ { "fieldId": "contact-name", "direction": "ASC" }
1302
1302
  ]
1303
1303
  },
1304
1304
  "view": {
1305
- "fields": ["id", "contact-name", "status"]
1305
+ "fields": ["contact-name", "status", "amount"]
1306
1306
  }
1307
1307
  }`,
1308
1308
  response: `{
@@ -1387,7 +1387,7 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1387
1387
  {
1388
1388
  description: "Create a bars CHART widget with a monthly time-serie x-axis and two y-axis series.",
1389
1389
  command:
1390
- `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"}'`,
1390
+ `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":"contact-name","color":"#E57373","axisType":"SECONDARY"}' --legend '{"position":"bottom"}'`,
1391
1391
  raw: `{
1392
1392
  "type": "CHART",
1393
1393
  "source": {
@@ -1412,7 +1412,7 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1412
1412
  },
1413
1413
  {
1414
1414
  "typeCalc": "COUNT",
1415
- "fieldCalc": "id",
1415
+ "fieldCalc": "contact-name",
1416
1416
  "color": "#E57373",
1417
1417
  "axisType": "SECONDARY"
1418
1418
  }
@@ -1484,9 +1484,10 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1484
1484
  }`,
1485
1485
  },
1486
1486
  {
1487
- description: "Create a TIMELINE widget.",
1487
+ description:
1488
+ "Create a TIMELINE widget via flags. The typed view state lives in view.viewAdditionalProperties.viewState; field references there must be UUIDs (slugs are only resolved in --field). cardConfig uses category1/category2/category4 (no category3). Use --view-state for UI scalars (granularity, sidebarWidth, show* ...).",
1488
1489
  command:
1489
- `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type TIMELINE --name "Customer schedule" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":6}' --field contact-name --field due-date`,
1490
+ `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type TIMELINE --name "Customer schedule" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":6}' --field c60b8526-5835-4c9f-aecd-9a16c7704a34 --field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --field d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90 --start-date-field d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90 --end-date-field e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9012 --label-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --group-field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --subgroup-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --progress-field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --card-title-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --card-category1-field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --card-category2-field d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90 --card-category4-field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --card-description-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --view-state '{"granularity":"month","sidebarWidth":300,"showUngroupedEvents":true,"showUnsubgroupedEvents":true}'`,
1490
1491
  raw: `{
1491
1492
  "type": "TIMELINE",
1492
1493
  "source": {
@@ -1498,15 +1499,43 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1498
1499
  },
1499
1500
  "presentation": { "name": "Customer schedule" },
1500
1501
  "view": {
1501
- "fields": ["contact-name", "due-date"]
1502
+ "fields": [
1503
+ "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1504
+ "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1505
+ "c52efe3f-2825-4c60-a7e3-34dd4c1ce043",
1506
+ "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90"
1507
+ ],
1508
+ "viewAdditionalProperties": {
1509
+ "viewState": {
1510
+ "granularity": "month",
1511
+ "sidebarWidth": 300,
1512
+ "showUngroupedEvents": true,
1513
+ "showUnsubgroupedEvents": true,
1514
+ "fieldMapping": {
1515
+ "startDateField": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
1516
+ "endDateField": "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9012",
1517
+ "labelField": "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1518
+ "groupField": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1519
+ "subgroupField": "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1520
+ "progressField": "c52efe3f-2825-4c60-a7e3-34dd4c1ce043",
1521
+ "cardConfig": {
1522
+ "titleField": "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1523
+ "category1Field": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1524
+ "category2Field": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
1525
+ "category4Field": "c52efe3f-2825-4c60-a7e3-34dd4c1ce043",
1526
+ "descriptionField": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
1527
+ }
1528
+ }
1529
+ }
1530
+ }
1502
1531
  }
1503
1532
  }`,
1504
1533
  },
1505
1534
  {
1506
1535
  description:
1507
- "Create a KANBAN widget with a status filter and groupsExpanded config (rich query/view requires --raw).",
1536
+ "Create a KANBAN widget via flags. The typed view state lives in view.viewAdditionalProperties.viewState; field references there must be UUIDs (slugs are only resolved in --field). cardConfig uses category1/category2/category3 (no category4). --aggregation-method/--aggregation-field set the card aggregation; use --view-state for UI scalars.",
1508
1537
  command:
1509
- `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --raw '{"type":"KANBAN","source":{"originResourceId":"2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e","isOriginSubSchema":false},"placement":{"layout":{"x":0,"y":0,"w":12,"h":8}},"presentation":{"name":"Status board"},"query":{"filters":[{"origin":{"schemaId":"contacts","fieldId":"status"},"comparisonOperator":"ANY_OF","values":["1","2","3"]}]},"view":{"fields":["contact-name","status","amount"],"groupsExpanded":{"1":true,"2":true,"3":false}}}'`,
1538
+ `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type KANBAN --name "Status board" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":8}' --field c60b8526-5835-4c9f-aecd-9a16c7704a34 --field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --field d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90 --column-field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --swimlane-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --card-title-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --card-category1-field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --card-category2-field d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90 --card-category3-field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --card-description-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --aggregation-method sum --aggregation-field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --view-state '{"hideEmptyColumns":false,"showNoValueColumn":true,"showNoValueSwimlane":true}'`,
1510
1539
  raw: `{
1511
1540
  "type": "KANBAN",
1512
1541
  "source": {
@@ -1517,28 +1546,43 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1517
1546
  "layout": { "x": 0, "y": 0, "w": 12, "h": 8 }
1518
1547
  },
1519
1548
  "presentation": { "name": "Status board" },
1520
- "query": {
1521
- "filters": [
1522
- {
1523
- "origin": {
1524
- "schemaId": "contacts",
1525
- "fieldId": "status"
1526
- },
1527
- "comparisonOperator": "ANY_OF",
1528
- "values": ["1", "2", "3"]
1529
- }
1530
- ]
1531
- },
1532
1549
  "view": {
1533
- "fields": ["contact-name", "status", "amount"],
1534
- "groupsExpanded": { "1": true, "2": true, "3": false }
1550
+ "fields": [
1551
+ "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1552
+ "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1553
+ "c52efe3f-2825-4c60-a7e3-34dd4c1ce043",
1554
+ "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90"
1555
+ ],
1556
+ "viewAdditionalProperties": {
1557
+ "viewState": {
1558
+ "hideEmptyColumns": false,
1559
+ "showNoValueColumn": true,
1560
+ "showNoValueSwimlane": true,
1561
+ "fieldMapping": {
1562
+ "columnField": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1563
+ "swimlaneField": "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1564
+ "cardConfig": {
1565
+ "titleField": "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1566
+ "category1Field": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1567
+ "category2Field": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
1568
+ "category3Field": "c52efe3f-2825-4c60-a7e3-34dd4c1ce043",
1569
+ "descriptionField": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
1570
+ },
1571
+ "aggregationConfig": {
1572
+ "method": "sum",
1573
+ "fieldId": "c52efe3f-2825-4c60-a7e3-34dd4c1ce043"
1574
+ }
1575
+ }
1576
+ }
1577
+ }
1535
1578
  }
1536
1579
  }`,
1537
1580
  },
1538
1581
  {
1539
- description: "Create a HIERARCHY widget rooted on a parent field.",
1582
+ description:
1583
+ "Create a HIERARCHY widget via flags. Declare columns once (--hierarchy-label, repeatable --hierarchy-info <id:name>, --hierarchy-number <id:name:aggregation>), map the root level (the view's own table) with --hierarchy-root-* and add each child level as a JSON object with --hierarchy-child. label is required per level; info/number mappings are optional. Column ids (e.g. col_1779975207355_zfndknslw) are unique opaque identifiers you choose — not the column name — and are reused as columnId in every mapping. All field references must be UUIDs.",
1540
1584
  command:
1541
- `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --raw '{"type":"HIERARCHY","source":{"originResourceId":"2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e","isOriginSubSchema":false},"placement":{"layout":{"x":0,"y":0,"w":12,"h":6}},"presentation":{"name":"Org tree"},"view":{"fields":["contact-name","status"],"hierarchyConfig":{"parentFieldId":"contact-name"}}}'`,
1585
+ `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type HIERARCHY --name "Org tree" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":6}' --field c60b8526-5835-4c9f-aecd-9a16c7704a34 --field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --field c52efe3f-2825-4c60-a7e3-34dd4c1ce043 --hierarchy-label "Name" --hierarchy-info "col_1779975207355_zfndknslw:Status" --hierarchy-info "col_1779975243018_qm4t7xb2pa:Description" --hierarchy-number "col_1779975261490_h8kd3nv9ws:Total amount:SUM" --hierarchy-root-name "Customers" --hierarchy-root-label-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --hierarchy-root-info "col_1779975207355_zfndknslw:a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890" --hierarchy-root-number "col_1779975261490_h8kd3nv9ws:c52efe3f-2825-4c60-a7e3-34dd4c1ce043" --hierarchy-child '{"name":"Projects","schemaId":"3ec9cdef-7e0a-4cdd-8019-8fb9281f5d6f","childFieldId":"80deefae-af3d-4000-b322-bfe1594f8073","labelFieldId":"50dbef0b-7e0a-4fdd-8019-8fb9281f5d70","infoMappings":[{"columnId":"col_1779975243018_qm4t7xb2pa","fieldId":"60dcef0c-8f1b-4eee-9120-9fc0392f6e71"}],"numberMappings":[{"columnId":"col_1779975261490_h8kd3nv9ws","fieldId":"70ddef0d-9f2c-4fff-a221-afd0493f7f72"}]}'`,
1542
1586
  raw: `{
1543
1587
  "type": "HIERARCHY",
1544
1588
  "source": {
@@ -1550,9 +1594,46 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1550
1594
  },
1551
1595
  "presentation": { "name": "Org tree" },
1552
1596
  "view": {
1553
- "fields": ["contact-name", "status"],
1597
+ "fields": [
1598
+ "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1599
+ "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890",
1600
+ "c52efe3f-2825-4c60-a7e3-34dd4c1ce043"
1601
+ ],
1554
1602
  "hierarchyConfig": {
1555
- "parentFieldId": "contact-name"
1603
+ "columns": {
1604
+ "label": "Name",
1605
+ "infos": [
1606
+ { "id": "col_1779975207355_zfndknslw", "name": "Status" },
1607
+ { "id": "col_1779975243018_qm4t7xb2pa", "name": "Description" }
1608
+ ],
1609
+ "numbers": [
1610
+ { "id": "col_1779975261490_h8kd3nv9ws", "name": "Total amount", "aggregation": "SUM" }
1611
+ ]
1612
+ },
1613
+ "rootLevel": {
1614
+ "name": "Customers",
1615
+ "labelFieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34",
1616
+ "infoMappings": [
1617
+ { "columnId": "col_1779975207355_zfndknslw", "fieldId": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890" }
1618
+ ],
1619
+ "numberMappings": [
1620
+ { "columnId": "col_1779975261490_h8kd3nv9ws", "fieldId": "c52efe3f-2825-4c60-a7e3-34dd4c1ce043" }
1621
+ ]
1622
+ },
1623
+ "childLevels": [
1624
+ {
1625
+ "name": "Projects",
1626
+ "schemaId": "3ec9cdef-7e0a-4cdd-8019-8fb9281f5d6f",
1627
+ "childFieldId": "80deefae-af3d-4000-b322-bfe1594f8073",
1628
+ "labelFieldId": "50dbef0b-7e0a-4fdd-8019-8fb9281f5d70",
1629
+ "infoMappings": [
1630
+ { "columnId": "col_1779975243018_qm4t7xb2pa", "fieldId": "60dcef0c-8f1b-4eee-9120-9fc0392f6e71" }
1631
+ ],
1632
+ "numberMappings": [
1633
+ { "columnId": "col_1779975261490_h8kd3nv9ws", "fieldId": "70ddef0d-9f2c-4fff-a221-afd0493f7f72" }
1634
+ ]
1635
+ }
1636
+ ]
1556
1637
  }
1557
1638
  }
1558
1639
  }`,
@@ -1562,13 +1643,13 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1562
1643
  {
1563
1644
  description: "Move placement, update view columns, rename the widget and lock it.",
1564
1645
  command:
1565
- `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 11111111-1111-4111-a111-111111111111 --layout '{"x":1,"y":2,"w":8,"h":4}' --field id --field contact-name --field status --name "Revenue Updated" --widget-read-only`,
1646
+ `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 11111111-1111-4111-a111-111111111111 --layout '{"x":1,"y":2,"w":8,"h":4}' --field contact-name --field status --field amount --name "Revenue Updated" --widget-read-only`,
1566
1647
  raw: `{
1567
1648
  "placement": {
1568
1649
  "layout": { "x": 1, "y": 2, "w": 8, "h": 4 }
1569
1650
  },
1570
1651
  "view": {
1571
- "fields": ["id", "contact-name", "status"]
1652
+ "fields": ["contact-name", "status", "amount"]
1572
1653
  },
1573
1654
  "presentation": { "name": "Revenue Updated" },
1574
1655
  "behavior": { "readOnly": true }
@@ -2644,7 +2725,7 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
2644
2725
  "hideDeleteButton": false
2645
2726
  },
2646
2727
  "view": {
2647
- "fields": ["id", "contact-name", "status", "amount"],
2728
+ "fields": ["contact-name", "status", "amount"],
2648
2729
  "columnSize": { "contact-name": 240 }
2649
2730
  }
2650
2731
  }
@@ -2868,7 +2949,7 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
2868
2949
  "hideDeleteButton": false
2869
2950
  },
2870
2951
  "view": {
2871
- "fields": ["id", "contact-name", "status", "amount"],
2952
+ "fields": ["contact-name", "status", "amount"],
2872
2953
  "columnSize": { "contact-name": 240 }
2873
2954
  }
2874
2955
  }`,