zinkee 0.1.37 → 0.1.39

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.
@@ -1458,6 +1458,50 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1458
1458
  response: `{
1459
1459
  "displayId": "0f6f062f-1478-4df2-96a1-c495d037d260",
1460
1460
  "widgetId": "11111111-1111-4111-a111-111111111111"
1461
+ }`,
1462
+ },
1463
+ {
1464
+ description:
1465
+ "Create a TABLE widget with locked fields: contact-name locked permanently (no conditions) and status locked while invoice-number is empty, with before/after lock messages.",
1466
+ command:
1467
+ `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type table --name Invoices --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":8}' --field contact-name --field invoice-number --field status --field amount --lock-field contact-name --lock-condition "status:invoice-number:is_empty" --lock-message-before "status:Status locks until the invoice number is set." --lock-message-after "status:Status is locked because the invoice number is missing."`,
1468
+ raw: `{
1469
+ "type": "TABLE_OR_SUBTABLE",
1470
+ "source": {
1471
+ "originResourceId": "2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e",
1472
+ "isOriginSubSchema": false
1473
+ },
1474
+ "placement": {
1475
+ "layout": { "x": 0, "y": 0, "w": 12, "h": 8 }
1476
+ },
1477
+ "presentation": { "name": "Invoices" },
1478
+ "view": {
1479
+ "fields": ["contact-name", "invoice-number", "status", "amount"]
1480
+ },
1481
+ "behavior": {
1482
+ "lockedFields": [
1483
+ {
1484
+ "field": { "fieldId": "contact-name" },
1485
+ "conditions": []
1486
+ },
1487
+ {
1488
+ "field": { "fieldId": "status" },
1489
+ "conditions": [
1490
+ {
1491
+ "origin": { "fieldId": "invoice-number" },
1492
+ "comparisonOperator": "IS_EMPTY",
1493
+ "values": []
1494
+ }
1495
+ ],
1496
+ "messageBeforeLock": "Status locks until the invoice number is set.",
1497
+ "messageAfterLock": "Status is locked because the invoice number is missing."
1498
+ }
1499
+ ]
1500
+ }
1501
+ }`,
1502
+ response: `{
1503
+ "displayId": "0f6f062f-1478-4df2-96a1-c495d037d260",
1504
+ "widgetId": "11111111-1111-4111-a111-111111111111"
1461
1505
  }`,
1462
1506
  },
1463
1507
  {
@@ -1858,6 +1902,46 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1858
1902
  "hideDeleteButton": true,
1859
1903
  "hideFilterButton": true
1860
1904
  }
1905
+ }`,
1906
+ },
1907
+ {
1908
+ description:
1909
+ "Configure locked fields (replaces the stored configuration): contact-name locked permanently, status locked while invoice-number is empty. Empty conditions = always locked; conditions combine with AND. Enforcement happens in display widgets only, never in the database view.",
1910
+ command:
1911
+ `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 11111111-1111-4111-a111-111111111111 --lock-field contact-name --lock-condition "status:invoice-number:is_empty" --lock-message-before "status:Status locks until the invoice number is set." --lock-message-after "status:Status is locked because the invoice number is missing."`,
1912
+ raw: `{
1913
+ "behavior": {
1914
+ "lockedFields": [
1915
+ {
1916
+ "field": { "fieldId": "contact-name" },
1917
+ "conditions": []
1918
+ },
1919
+ {
1920
+ "field": { "fieldId": "status" },
1921
+ "conditions": [
1922
+ {
1923
+ "origin": { "fieldId": "invoice-number" },
1924
+ "comparisonOperator": "IS_EMPTY",
1925
+ "values": []
1926
+ }
1927
+ ],
1928
+ "messageBeforeLock": "Status locks until the invoice number is set.",
1929
+ "messageAfterLock": "Status is locked because the invoice number is missing."
1930
+ }
1931
+ ]
1932
+ }
1933
+ }`,
1934
+ response: `{
1935
+ "displayId": "0f6f062f-1478-4df2-96a1-c495d037d260",
1936
+ "widgetId": "11111111-1111-4111-a111-111111111111"
1937
+ }`,
1938
+ },
1939
+ {
1940
+ description: "Clear the locked-fields configuration.",
1941
+ command:
1942
+ 'zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 11111111-1111-4111-a111-111111111111 --clear-locked-fields',
1943
+ raw: `{
1944
+ "behavior": { "lockedFields": [] }
1861
1945
  }`,
1862
1946
  },
1863
1947
  {
@@ -1967,42 +2051,92 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
1967
2051
  ]),
1968
2052
  "displays cross-widget-filter set": buildCommandExamples([
1969
2053
  {
1970
- description: "Link one source widget/field to several target widgets through the same field.",
2054
+ description:
2055
+ "Single configuration with flags: link one source widget/field to several targets. The whole array is replaced.",
1971
2056
  command:
1972
2057
  'zinkee --json displays cross-widget-filter set 0f6f062f-1478-4df2-96a1-c495d037d260 --source-widget 11111111-1111-4111-a111-111111111111 --source-field c60b8526-5835-4c9f-aecd-9a16c7704a34 --target 22222222-2222-4222-a222-222222222222:c60b8526-5835-4c9f-aecd-9a16c7704a34 --target 33333333-3333-4333-a333-333333333333:c60b8526-5835-4c9f-aecd-9a16c7704a34',
1973
- raw: `{
1974
- "source": {
1975
- "widgetId": "11111111-1111-4111-a111-111111111111",
1976
- "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
1977
- },
1978
- "targets": [
1979
- {
1980
- "widgetId": "22222222-2222-4222-a222-222222222222",
2058
+ raw: `[
2059
+ {
2060
+ "source": {
2061
+ "widgetId": "11111111-1111-4111-a111-111111111111",
1981
2062
  "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
1982
2063
  },
2064
+ "targets": [
2065
+ {
2066
+ "widgetId": "22222222-2222-4222-a222-222222222222",
2067
+ "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2068
+ },
2069
+ {
2070
+ "widgetId": "33333333-3333-4333-a333-333333333333",
2071
+ "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2072
+ }
2073
+ ]
2074
+ }
2075
+ ]`,
2076
+ },
1983
2077
  {
1984
- "widgetId": "33333333-3333-4333-a333-333333333333",
2078
+ description:
2079
+ "Several independent configurations with --raw (each source filters its own targets). A widget cannot be a target of two configurations.",
2080
+ command:
2081
+ "zinkee --json displays cross-widget-filter set 0f6f062f-1478-4df2-96a1-c495d037d260 --raw '[{\"source\":{\"widgetId\":\"11111111-1111-4111-a111-111111111111\",\"fieldId\":\"c60b8526-5835-4c9f-aecd-9a16c7704a34\"},\"targets\":[{\"widgetId\":\"22222222-2222-4222-a222-222222222222\",\"fieldId\":\"c60b8526-5835-4c9f-aecd-9a16c7704a34\"}]},{\"source\":{\"widgetId\":\"44444444-4444-4444-a444-444444444444\",\"fieldId\":\"a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890\"},\"targets\":[{\"widgetId\":\"55555555-5555-4555-a555-555555555555\",\"fieldId\":\"a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890\"}]}]'",
2082
+ raw: `[
2083
+ {
2084
+ "source": {
2085
+ "widgetId": "11111111-1111-4111-a111-111111111111",
1985
2086
  "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
1986
- }
1987
- ]
1988
- }`,
2087
+ },
2088
+ "targets": [
2089
+ {
2090
+ "widgetId": "22222222-2222-4222-a222-222222222222",
2091
+ "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2092
+ }
2093
+ ]
2094
+ },
2095
+ {
2096
+ "source": {
2097
+ "widgetId": "44444444-4444-4444-a444-444444444444",
2098
+ "fieldId": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890"
2099
+ },
2100
+ "targets": [
2101
+ {
2102
+ "widgetId": "55555555-5555-4555-a555-555555555555",
2103
+ "fieldId": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890"
2104
+ }
2105
+ ]
2106
+ }
2107
+ ]`,
1989
2108
  },
1990
2109
  {
1991
- description: "Filter one target widget by the status field of the source.",
2110
+ description:
2111
+ "Hierarchy chain with --raw-file: a target of one configuration is the source of the next (click Parent → filters Child, click Child → filters Grandchild).",
1992
2112
  command:
1993
- 'zinkee --json displays cross-widget-filter set 0f6f062f-1478-4df2-96a1-c495d037d260 --source-widget 11111111-1111-4111-a111-111111111111 --source-field a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890 --target 66666666-6666-4666-a666-666666666666:a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890',
1994
- raw: `{
1995
- "source": {
1996
- "widgetId": "11111111-1111-4111-a111-111111111111",
1997
- "fieldId": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890"
2113
+ "zinkee --json displays cross-widget-filter set 0f6f062f-1478-4df2-96a1-c495d037d260 --raw-file cross-widget-filter.json",
2114
+ raw: `[
2115
+ {
2116
+ "source": {
2117
+ "widgetId": "11111111-1111-4111-a111-111111111111",
2118
+ "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2119
+ },
2120
+ "targets": [
2121
+ {
2122
+ "widgetId": "22222222-2222-4222-a222-222222222222",
2123
+ "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2124
+ }
2125
+ ]
1998
2126
  },
1999
- "targets": [
2000
- {
2001
- "widgetId": "66666666-6666-4666-a666-666666666666",
2127
+ {
2128
+ "source": {
2129
+ "widgetId": "22222222-2222-4222-a222-222222222222",
2002
2130
  "fieldId": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890"
2003
- }
2004
- ]
2005
- }`,
2131
+ },
2132
+ "targets": [
2133
+ {
2134
+ "widgetId": "33333333-3333-4333-a333-333333333333",
2135
+ "fieldId": "a8f1d7e3-2b5c-4d9e-8a1b-3c4d5e6f7890"
2136
+ }
2137
+ ]
2138
+ }
2139
+ ]`,
2006
2140
  },
2007
2141
  ]),
2008
2142
  "schemas list": buildCommandExamples([
@@ -2900,18 +3034,20 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
2900
3034
  }
2901
3035
  }
2902
3036
  ],
2903
- "crossWidgetFilter": {
2904
- "source": {
2905
- "widgetId": "11111111-1111-4111-a111-111111111111",
2906
- "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2907
- },
2908
- "targets": [
2909
- {
2910
- "widgetId": "22222222-2222-4222-a222-222222222222",
3037
+ "crossWidgetFilter": [
3038
+ {
3039
+ "sourceWidget": {
3040
+ "widgetId": "11111111-1111-4111-a111-111111111111",
2911
3041
  "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
2912
- }
2913
- ]
2914
- },
3042
+ },
3043
+ "targetWidgets": [
3044
+ {
3045
+ "widgetId": "22222222-2222-4222-a222-222222222222",
3046
+ "fieldId": "c60b8526-5835-4c9f-aecd-9a16c7704a34"
3047
+ }
3048
+ ]
3049
+ }
3050
+ ],
2915
3051
  "navigationTargets": [
2916
3052
  {
2917
3053
  "id": "nav-target-customer",