@limetech/lime-crm-building-blocks 1.116.0 → 1.116.2
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/CHANGELOG.md +14 -0
- package/dist/cjs/{_Map-60aae0ed.js → _Map-BlpAtLvq.js} +12 -24
- package/dist/cjs/{_MapCache-8b125fbb.js → _MapCache-De1Fwe0H.js} +5 -7
- package/dist/cjs/{_Uint8Array-95263550.js → _Uint8Array-C_lvn5HO.js} +6 -14
- package/dist/cjs/{_baseIsEqual-f2d60d3e.js → _baseIsEqual-BtwicGmu.js} +4 -4
- package/dist/cjs/{_defineProperty-40a6ad5d.js → _defineProperty-eImBwVFM.js} +2 -4
- package/dist/cjs/{_getTag-8809c5c6.js → _getTag-CdUodI28.js} +18 -39
- package/dist/cjs/{get-932b213e.js → get-BRGtX379.js} +6 -14
- package/dist/cjs/{index-519b904a.js → index-C_OnxXhP.js} +541 -322
- package/dist/cjs/index.esm-DhBVH875.js +838 -0
- package/dist/cjs/{isSymbol-5b36aeee.js → isSymbol-D8S28StA.js} +1 -1
- package/dist/cjs/lime-crm-building-blocks.cjs.js +7 -7
- package/dist/cjs/{lime-query-validation-c118b96d.js → lime-query-validation-CWlZPm8m.js} +8 -8
- package/dist/cjs/limebb-alert-dialog.cjs.entry.js +5 -8
- package/dist/cjs/limebb-browser.cjs.entry.js +11 -14
- package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +15 -20
- package/dist/cjs/limebb-chat-list.cjs.entry.js +11 -12
- package/dist/cjs/limebb-component-config.cjs.entry.js +17 -16
- package/dist/cjs/limebb-component-picker.cjs.entry.js +9 -12
- package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +9 -12
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1907 -1790
- package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +4 -7
- package/dist/cjs/limebb-data-cells.cjs.entry.js +5 -8
- package/dist/cjs/limebb-date-picker.cjs.entry.js +7 -9
- package/dist/cjs/limebb-date-range.cjs.entry.js +6 -9
- package/dist/cjs/limebb-document-chips.cjs.entry.js +10 -11
- package/dist/cjs/limebb-document-item.cjs.entry.js +6 -9
- package/dist/cjs/limebb-document-picker.cjs.entry.js +6 -9
- package/dist/cjs/limebb-empty-state.cjs.entry.js +3 -6
- package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +4 -7
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +8 -11
- package/dist/cjs/limebb-feed.cjs.entry.js +430 -168
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +4 -6
- package/dist/cjs/limebb-info-tile-currency-format.cjs.entry.js +2 -4
- package/dist/cjs/limebb-info-tile-date-format.cjs.entry.js +4 -7
- package/dist/cjs/limebb-info-tile-decimal-format.cjs.entry.js +2 -4
- package/dist/cjs/limebb-info-tile-format.cjs.entry.js +5 -8
- package/dist/cjs/limebb-info-tile-relative-date-format.cjs.entry.js +2 -4
- package/dist/cjs/limebb-info-tile-unit-format.cjs.entry.js +2 -4
- package/dist/cjs/limebb-info-tile.cjs.entry.js +27 -24
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +8 -11
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +8 -11
- package/dist/cjs/limebb-kanban.cjs.entry.js +5 -8
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +9 -12
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +27 -29
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +26 -30
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +25 -30
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +6 -9
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +9 -12
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +8 -12
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +9 -12
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +5 -8
- package/dist/cjs/limebb-loader.cjs.entry.js +12 -10
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +29 -49
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +5 -8
- package/dist/cjs/limebb-mention.cjs.entry.js +6 -9
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +10 -14
- package/dist/cjs/limebb-notification-item.cjs.entry.js +9 -12
- package/dist/cjs/limebb-notification-list.cjs.entry.js +10 -11
- package/dist/cjs/limebb-object-chip.cjs.entry.js +16 -15
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +9 -10
- package/dist/cjs/limebb-property-selector.cjs.entry.js +9 -12
- package/dist/cjs/limebb-text-editor-picker.cjs.entry.js +9 -10
- package/dist/cjs/limebb-text-editor.cjs.entry.js +53 -307
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +8 -9
- package/dist/cjs/{limetype-3c1c53b6.js → limetype-6tkuY6nm.js} +2 -2
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/alert-dialog/alert-dialog.css +133 -1
- package/dist/collection/components/alert-dialog/alert-dialog.js +11 -10
- package/dist/collection/components/browser/browser.js +14 -9
- package/dist/collection/components/chat-list/chat-icon-list/chat-icon-list.css +9 -11
- package/dist/collection/components/chat-list/chat-icon-list/chat-icon-list.js +3 -2
- package/dist/collection/components/chat-list/chat-item/chat-item.css +9 -0
- package/dist/collection/components/chat-list/chat-item/chat-item.js +11 -8
- package/dist/collection/components/chat-list/chat-list.css +9 -0
- package/dist/collection/components/chat-list/chat-list.js +15 -12
- package/dist/collection/components/chat-list/typing-indicator/typing-indicator.js +1 -1
- package/dist/collection/components/component-command-picker/component-config/component-config.js +23 -19
- package/dist/collection/components/component-command-picker/component-picker/component-picker.js +21 -18
- package/dist/collection/components/composer-toolbar/composer-toolbar.js +14 -10
- package/dist/collection/components/currency-picker/currency-picker.js +15 -13
- package/dist/collection/components/dashboard-widget/dashboard-widget.js +11 -10
- package/dist/collection/components/data-cells/data-cells.css +9 -0
- package/dist/collection/components/data-cells/data-cells.js +8 -5
- package/dist/collection/components/date-picker/date-picker.js +20 -17
- package/dist/collection/components/date-range/date-range.js +19 -15
- package/dist/collection/components/document-chips/document-chips.js +5 -4
- package/dist/collection/components/document-picker/document-item/document-item.js +13 -8
- package/dist/collection/components/document-picker/document-picker.css +9 -0
- package/dist/collection/components/document-picker/document-picker.js +18 -13
- package/dist/collection/components/empty-state/empty-state.js +6 -5
- package/dist/collection/components/feed/feed-item/feed-timeline-item.css +41 -11
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +12 -9
- package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.css +9 -0
- package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +3 -3
- package/dist/collection/components/feed/feed.js +21 -18
- package/dist/collection/components/icon-picker/icon-picker.js +15 -15
- package/dist/collection/components/info-tile/format/config/info-tile-currency-format.js +8 -4
- package/dist/collection/components/info-tile/format/config/info-tile-date-format.js +4 -2
- package/dist/collection/components/info-tile/format/config/info-tile-decimal-format.js +4 -2
- package/dist/collection/components/info-tile/format/config/info-tile-format.js +11 -7
- package/dist/collection/components/info-tile/format/config/info-tile-relative-date-format.js +4 -2
- package/dist/collection/components/info-tile/format/config/info-tile-unit-format.js +4 -2
- package/dist/collection/components/info-tile/info-tile.js +29 -23
- package/dist/collection/components/kanban/kanban-group/kanban-group.css +25 -9
- package/dist/collection/components/kanban/kanban-group/kanban-group.js +19 -16
- package/dist/collection/components/kanban/kanban-item/kanban-item.css +9 -0
- package/dist/collection/components/kanban/kanban-item/kanban-item.js +9 -5
- package/dist/collection/components/kanban/kanban.js +10 -5
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.js +12 -8
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +11 -9
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.css +9 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +14 -10
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +9 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +14 -10
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.css +9 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +15 -11
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +17 -14
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +13 -9
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +13 -9
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +22 -19
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +12 -8
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +12 -8
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +12 -10
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js +11 -7
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.css +17 -1
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +11 -7
- package/dist/collection/components/limeobject/file-viewer/file-viewer.js +8 -5
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/loader/loader.js +4 -2
- package/dist/collection/components/locale-picker/locale-picker.js +23 -19
- package/dist/collection/components/mention/mention.js +4 -4
- package/dist/collection/components/navigation-button/navigation-button.css +24 -1
- package/dist/collection/components/navigation-button/navigation-button.js +10 -9
- package/dist/collection/components/notification-list/notification-item/notification-item.css +9 -0
- package/dist/collection/components/notification-list/notification-item/notification-item.js +9 -5
- package/dist/collection/components/notification-list/notification-list.css +9 -0
- package/dist/collection/components/notification-list/notification-list.js +12 -8
- package/dist/collection/components/object-chip/object-chip.js +7 -6
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.css +9 -0
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +21 -19
- package/dist/collection/components/summary-popover/summary-popover.js +28 -21
- package/dist/collection/components/text-editor/mention-group-counter.js +8 -7
- package/dist/collection/components/text-editor/text-editor-picker.js +10 -7
- package/dist/collection/components/text-editor/text-editor.js +37 -29
- package/dist/collection/components/trend-indicator/trend-indicator.css +9 -0
- package/dist/collection/components/trend-indicator/trend-indicator.js +19 -17
- package/dist/components/_Map.js +1 -342
- package/dist/components/_MapCache.js +1 -433
- package/dist/components/_Uint8Array.js +1 -349
- package/dist/components/_baseIsEqual.js +1 -494
- package/dist/components/_defineProperty.js +1 -13
- package/dist/components/_getTag.js +1 -421
- package/dist/components/chat-icon-list.js +1 -55
- package/dist/components/chat-item.js +1 -184
- package/dist/components/currency-picker.js +1 -1917
- package/dist/components/date-picker.js +1 -151
- package/dist/components/document-item.js +1 -212
- package/dist/components/dom.js +1 -26
- package/dist/components/empty-state.js +1 -61
- package/dist/components/extension-mapping.js +1 -55
- package/dist/components/feed-item-thumbnail-file-info.js +1 -33
- package/dist/components/feed-timeline-item.js +1 -453
- package/dist/components/get.js +1 -308
- package/dist/components/highlight-item.handler.js +1 -36
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.esm.js +1 -963
- package/dist/components/index.js +1 -1
- package/dist/components/isSymbol.js +1 -28
- package/dist/components/kanban-group.js +1 -148
- package/dist/components/kanban-item.js +1 -182
- package/dist/components/keycodes.js +1 -7
- package/dist/components/lime-query-filter-builder.js +1 -132
- package/dist/components/lime-query-filter-comparison.js +1 -180
- package/dist/components/lime-query-filter-expression.js +1 -420
- package/dist/components/lime-query-validation.js +1 -617
- package/dist/components/lime-query-value-input.js +1 -387
- package/dist/components/limebb-alert-dialog.js +1 -71
- package/dist/components/limebb-browser.js +1 -116
- package/dist/components/limebb-chat-icon-list.js +1 -6
- package/dist/components/limebb-chat-item.js +1 -6
- package/dist/components/limebb-chat-list.js +1 -302
- package/dist/components/limebb-component-config.js +1 -176
- package/dist/components/limebb-component-picker.js +1 -180
- package/dist/components/limebb-composer-toolbar.js +1 -136
- package/dist/components/limebb-currency-picker.js +1 -6
- package/dist/components/limebb-dashboard-widget.js +1 -48
- package/dist/components/limebb-data-cells.js +1 -169
- package/dist/components/limebb-date-picker.js +1 -6
- package/dist/components/limebb-date-range.js +1 -83
- package/dist/components/limebb-document-chips.js +1 -437
- package/dist/components/limebb-document-item.js +1 -6
- package/dist/components/limebb-document-picker.js +1 -111
- package/dist/components/limebb-empty-state.js +1 -6
- package/dist/components/limebb-feed-item-thumbnail-file-info.js +1 -6
- package/dist/components/limebb-feed-timeline-item.js +1 -6
- package/dist/components/limebb-feed.js +1 -398
- package/dist/components/limebb-icon-picker.js +1 -53026
- package/dist/components/limebb-info-tile-currency-format.js +1 -116
- package/dist/components/limebb-info-tile-date-format.js +1 -272
- package/dist/components/limebb-info-tile-decimal-format.js +1 -95
- package/dist/components/limebb-info-tile-format.js +1 -144
- package/dist/components/limebb-info-tile-relative-date-format.js +1 -72
- package/dist/components/limebb-info-tile-unit-format.js +1 -183
- package/dist/components/limebb-info-tile.js +1 -626
- package/dist/components/limebb-kanban-group.js +1 -6
- package/dist/components/limebb-kanban-item.js +1 -6
- package/dist/components/limebb-kanban.js +1 -79
- package/dist/components/limebb-lime-query-builder.js +1 -424
- package/dist/components/limebb-lime-query-filter-builder.js +1 -6
- package/dist/components/limebb-lime-query-filter-comparison.js +1 -6
- package/dist/components/limebb-lime-query-filter-expression.js +1 -6
- package/dist/components/limebb-lime-query-filter-group.js +1 -6
- package/dist/components/limebb-lime-query-filter-not.js +1 -6
- package/dist/components/limebb-lime-query-order-by-editor.js +1 -6
- package/dist/components/limebb-lime-query-order-by-item.js +1 -6
- package/dist/components/limebb-lime-query-response-format-builder.js +1 -310
- package/dist/components/limebb-lime-query-response-format-editor.js +1 -6
- package/dist/components/limebb-lime-query-response-format-item.js +1 -6
- package/dist/components/limebb-lime-query-value-input.js +1 -6
- package/dist/components/limebb-limeobject-file-viewer.js +1 -175
- package/dist/components/limebb-limetype-field.js +1 -6
- package/dist/components/limebb-live-docs-info.js +1 -6
- package/dist/components/limebb-loader.js +1 -78
- package/dist/components/limebb-locale-picker.js +1 -1165
- package/dist/components/limebb-mention-group-counter.js +1 -48
- package/dist/components/limebb-mention.js +1 -79
- package/dist/components/limebb-navigation-button.js +1 -6
- package/dist/components/limebb-notification-item.js +1 -6
- package/dist/components/limebb-notification-list.js +1 -253
- package/dist/components/limebb-object-chip.js +1 -253
- package/dist/components/limebb-percentage-visualizer.js +1 -6
- package/dist/components/limebb-property-selector.js +1 -6
- package/dist/components/limebb-summary-popover.js +1 -6
- package/dist/components/limebb-text-editor-picker.js +1 -6
- package/dist/components/limebb-text-editor.js +1 -1902
- package/dist/components/limebb-trend-indicator.js +1 -175
- package/dist/components/limebb-typing-indicator.js +1 -6
- package/dist/components/limetype-field.js +1 -216
- package/dist/components/limetype.js +1 -85
- package/dist/components/live-docs-info.js +1 -34
- package/dist/components/navigation-button.js +1 -74
- package/dist/components/negate.js +1 -40
- package/dist/components/non-null.js +1 -10
- package/dist/components/notification-item.js +1 -168
- package/dist/components/order-by-editor.js +1 -139
- package/dist/components/order-by-item.js +1 -73
- package/dist/components/percentage-class.js +1 -64
- package/dist/components/percentage-visualizer.js +1 -219
- package/dist/components/property-selector.js +1 -372
- package/dist/components/random-string.js +1 -22
- package/dist/components/response-format-editor.js +1 -331
- package/dist/components/response-format-item.js +1 -126
- package/dist/components/summary-popover.js +1 -159
- package/dist/components/text-editor-picker.js +1 -128
- package/dist/components/typing-indicator.js +1 -31
- package/dist/esm/{_Map-aede53b6.js → _Map-ByjZfyP_.js} +8 -20
- package/dist/esm/{_MapCache-af496e9d.js → _MapCache-C_kVhYUl.js} +5 -7
- package/dist/esm/{_Uint8Array-d6ebd526.js → _Uint8Array-DVXPnoWk.js} +6 -10
- package/dist/esm/{_baseIsEqual-077b6bb3.js → _baseIsEqual-DB13O4pD.js} +4 -4
- package/dist/esm/{_defineProperty-e6a185c3.js → _defineProperty-DSmG08hO.js} +2 -4
- package/dist/esm/{_getTag-d02a95fa.js → _getTag-DZlkp9mJ.js} +12 -32
- package/dist/esm/{get-3e42932b.js → get-Bo260bSC.js} +6 -14
- package/dist/esm/{index-d86e55c0.js → index-BIwHMk6j.js} +539 -300
- package/dist/esm/index.esm-BjlE4usG.js +823 -0
- package/dist/esm/{isSymbol-1c5f65cc.js → isSymbol-Ci8cASb6.js} +1 -1
- package/dist/esm/lime-crm-building-blocks.js +6 -5
- package/dist/esm/{lime-query-validation-01797a51.js → lime-query-validation-S9h8L6bg.js} +8 -8
- package/dist/esm/limebb-alert-dialog.entry.js +5 -6
- package/dist/esm/limebb-browser.entry.js +11 -12
- package/dist/esm/limebb-chat-icon-list_3.entry.js +15 -18
- package/dist/esm/limebb-chat-list.entry.js +11 -10
- package/dist/esm/limebb-component-config.entry.js +17 -14
- package/dist/esm/limebb-component-picker.entry.js +9 -10
- package/dist/esm/limebb-composer-toolbar.entry.js +9 -10
- package/dist/esm/limebb-currency-picker.entry.js +1908 -1789
- package/dist/esm/limebb-dashboard-widget.entry.js +4 -5
- package/dist/esm/limebb-data-cells.entry.js +5 -6
- package/dist/esm/limebb-date-picker.entry.js +7 -7
- package/dist/esm/limebb-date-range.entry.js +6 -7
- package/dist/esm/limebb-document-chips.entry.js +10 -9
- package/dist/esm/limebb-document-item.entry.js +6 -7
- package/dist/esm/limebb-document-picker.entry.js +6 -7
- package/dist/esm/limebb-empty-state.entry.js +3 -4
- package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +4 -5
- package/dist/esm/limebb-feed-timeline-item.entry.js +8 -9
- package/dist/esm/limebb-feed.entry.js +430 -166
- package/dist/esm/limebb-icon-picker.entry.js +4 -4
- package/dist/esm/limebb-info-tile-currency-format.entry.js +2 -2
- package/dist/esm/limebb-info-tile-date-format.entry.js +4 -5
- package/dist/esm/limebb-info-tile-decimal-format.entry.js +2 -2
- package/dist/esm/limebb-info-tile-format.entry.js +5 -6
- package/dist/esm/limebb-info-tile-relative-date-format.entry.js +2 -2
- package/dist/esm/limebb-info-tile-unit-format.entry.js +2 -2
- package/dist/esm/limebb-info-tile.entry.js +27 -22
- package/dist/esm/limebb-kanban-group.entry.js +8 -9
- package/dist/esm/limebb-kanban-item.entry.js +8 -9
- package/dist/esm/limebb-kanban.entry.js +5 -6
- package/dist/esm/limebb-lime-query-builder.entry.js +9 -10
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +27 -27
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +26 -28
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +25 -28
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +6 -7
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +9 -10
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +8 -10
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +9 -10
- package/dist/esm/limebb-live-docs-info.entry.js +5 -6
- package/dist/esm/limebb-loader.entry.js +12 -8
- package/dist/esm/limebb-locale-picker.entry.js +29 -47
- package/dist/esm/limebb-mention-group-counter.entry.js +5 -6
- package/dist/esm/limebb-mention.entry.js +6 -7
- package/dist/esm/limebb-navigation-button_2.entry.js +10 -12
- package/dist/esm/limebb-notification-item.entry.js +9 -10
- package/dist/esm/limebb-notification-list.entry.js +10 -9
- package/dist/esm/limebb-object-chip.entry.js +16 -13
- package/dist/esm/limebb-percentage-visualizer.entry.js +9 -8
- package/dist/esm/limebb-property-selector.entry.js +9 -10
- package/dist/esm/limebb-text-editor-picker.entry.js +9 -8
- package/dist/esm/limebb-text-editor.entry.js +53 -305
- package/dist/esm/limebb-trend-indicator.entry.js +8 -7
- package/dist/esm/{limetype-12fbba0f.js → limetype-B3nph1qc.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-eb4aa158.entry.js → p-0afc0db2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-12aadae6.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-1428aa13.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-152edb10.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-1a61674f.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-1f02a411.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-21ec697f.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3252e153.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3263f8d5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-32f8477f.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-35a51259.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-38201f65.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3ef87b11.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-43e22f6d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-e79f16ca.entry.js → p-4446f170.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-4625a9c5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-77e7d7da.entry.js → p-49afe71b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-4ddd75bc.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-528f3635.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-52fb2a66.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-60e22f51.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-62437a1d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-626421bf.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-685dd8a1.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-5277ceca.entry.js → p-6cb2d9dd.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-6fdee70a.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-71191041.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-f7122d8e.entry.js → p-740ae712.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-8477cb5d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-50aad872.entry.js → p-8e2cc2e8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-9ae55a96.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-B8RiYkLS.js +1 -0
- package/dist/lime-crm-building-blocks/p-BIwHMk6j.js +2 -0
- package/dist/lime-crm-building-blocks/p-BJ8HvfgI.js +1 -0
- package/dist/lime-crm-building-blocks/p-ByjZfyP_.js +1 -0
- package/dist/lime-crm-building-blocks/{p-0a266c26.js → p-CMfAKLlA.js} +1 -1
- package/dist/lime-crm-building-blocks/p-CQ-z_HTt.js +1 -0
- package/dist/lime-crm-building-blocks/p-CcGMZOP-.js +1 -0
- package/dist/lime-crm-building-blocks/p-Dm_AIMQj.js +1 -0
- package/dist/lime-crm-building-blocks/p-V3xfp9dg.js +1 -0
- package/dist/lime-crm-building-blocks/p-aaeecca6.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-ac59093c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-acbc40f5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-b2383e7f.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-b36ad4e8.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-6fb504cb.entry.js → p-b3ee6683.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-ba42e434.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-bac3d599.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-be8dc8ae.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-0707d5b0.entry.js → p-c3b13800.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-b3ad9f5e.entry.js → p-c6bbcbee.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-cff9bccd.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-d2a01f51.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-dabb227b.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-e2e9adff.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-ebe6040f.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-eec0a0c8.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-f23ea0e7.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-0190354e.entry.js → p-fa41a9e6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-fcedbc77.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-fdf269f7.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-mljVfXwO.js +1 -0
- package/dist/lime-crm-building-blocks/p-wbuFLk-j.js +1 -0
- package/dist/lime-crm-building-blocks/p-yc--7_7T.js +1 -0
- package/dist/types/components.d.ts +608 -114
- package/dist/types/stencil-public-runtime.d.ts +192 -12
- package/package.json +10 -10
- package/dist/cjs/index.esm-e01e9bd4.js +0 -977
- package/dist/esm/index.esm-11a8b9e2.js +0 -963
- package/dist/lime-crm-building-blocks/p-121877f3.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-123190c3.js +0 -1
- package/dist/lime-crm-building-blocks/p-1317cdfa.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-199799ff.js +0 -1
- package/dist/lime-crm-building-blocks/p-1a89328d.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-1b361f60.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-2612f2f6.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-2babfa69.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-2d5e5ab5.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-331fced5.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-35897ec3.js +0 -1
- package/dist/lime-crm-building-blocks/p-3a16d7cf.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3da67f32.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3dd32e10.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-4894ca5d.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-4b494de7.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-4ca1caf4.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-4eb7a47c.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-50abea43.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-520df198.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-52cf8641.js +0 -2
- package/dist/lime-crm-building-blocks/p-5322fd19.js +0 -1
- package/dist/lime-crm-building-blocks/p-548e0f2a.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-579be797.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-6a87a407.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-6ad6a88d.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-7365ec1c.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-7e6fb4af.js +0 -1
- package/dist/lime-crm-building-blocks/p-81583fc8.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-85709273.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-87d3f42c.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-8dca4e46.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-95b6eaf5.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-973146f7.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-9c25aa2b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-a959dd49.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b2763851.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b31772c8.js +0 -1
- package/dist/lime-crm-building-blocks/p-b675d5f0.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b7959ddb.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-d298b34e.js +0 -1
- package/dist/lime-crm-building-blocks/p-d47b6c3c.js +0 -1
- package/dist/lime-crm-building-blocks/p-d9045aaa.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-d994067b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-da42650a.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-dae67f66.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-dce9c951.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-dd5af257.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-ea4daa32.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-eb56d4eb.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-f788a48d.js +0 -1
- package/dist/lime-crm-building-blocks/p-fb292b3f.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-fe2b91d9.js +0 -1
- package/loader/package.json +0 -11
- /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
- /package/dist/cjs/{dom-2ea30350.js → dom--t_vVnyU.js} +0 -0
- /package/dist/cjs/{extension-mapping-63bdafd3.js → extension-mapping-CvK-Mz3f.js} +0 -0
- /package/dist/cjs/{file-extension-7c2eae39.js → file-extension-DolkaRwB.js} +0 -0
- /package/dist/cjs/{highlight-item.handler-584ab58a.js → highlight-item.handler-BVqvzXiD.js} +0 -0
- /package/dist/cjs/{keycodes-88522d7f.js → keycodes-BCQoLEdB.js} +0 -0
- /package/dist/cjs/{negate-e0a2bf77.js → negate-Bg3SqQh6.js} +0 -0
- /package/dist/cjs/{non-null-3bf14aa1.js → non-null-BMnREsqJ.js} +0 -0
- /package/dist/cjs/{percentage-class-012e94d9.js → percentage-class-DVoYzFLR.js} +0 -0
- /package/dist/cjs/{property-resolution-5f798b03.js → property-resolution-Bz1zPcfq.js} +0 -0
- /package/dist/cjs/{random-string-aac0a74b.js → random-string-BdZGIsGg.js} +0 -0
- /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
- /package/dist/esm/{dom-9cc051d7.js → dom-B95D7tDb.js} +0 -0
- /package/dist/esm/{extension-mapping-fcade195.js → extension-mapping-Bcm94u_z.js} +0 -0
- /package/dist/esm/{file-extension-568475d1.js → file-extension-DtnPTzDv.js} +0 -0
- /package/dist/esm/{highlight-item.handler-dfbf11c0.js → highlight-item.handler-BWMpG2bS.js} +0 -0
- /package/dist/esm/{keycodes-58a1fcc9.js → keycodes-CwMJvF_Z.js} +0 -0
- /package/dist/esm/{negate-55744008.js → negate-ooVD-6_a.js} +0 -0
- /package/dist/esm/{non-null-5a66a269.js → non-null-CkTg5UPD.js} +0 -0
- /package/dist/esm/{percentage-class-2766f8ef.js → percentage-class-BaQl_Elp.js} +0 -0
- /package/dist/esm/{property-resolution-e4e8dcf7.js → property-resolution-CQUZjrU4.js} +0 -0
- /package/dist/esm/{random-string-f6ef6fbf.js → random-string-C2JP2nLw.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-4a85590d.js → p-B95D7tDb.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-66352a1e.js → p-BWMpG2bS.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-a99197b1.js → p-BaQl_Elp.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-ab2a95a6.js → p-Bcm94u_z.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-fbda77a7.js → p-C2JP2nLw.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-b02c99d5.js → p-CQUZjrU4.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-1484e300.js → p-CkTg5UPD.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-463d3174.js → p-CwMJvF_Z.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-e1255160.js → p-DQuL1Twl.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-b42e9740.js → p-DtnPTzDv.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-7c9484b1.js → p-ooVD-6_a.js} +0 -0
|
@@ -1,617 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { g as getPropertyFromPath, a as getNormalizedProperties, v as validatePropertyPath } from './property-selector.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Dynamic filter values and placeholders that are valid in Lime Query
|
|
6
|
-
*/
|
|
7
|
-
const VALID_DYNAMIC_VALUES = new Set([
|
|
8
|
-
// Temporal
|
|
9
|
-
'$yesterday',
|
|
10
|
-
'$now',
|
|
11
|
-
'$today',
|
|
12
|
-
'$tomorrow',
|
|
13
|
-
// Ranges
|
|
14
|
-
'$this_week',
|
|
15
|
-
'$this_month',
|
|
16
|
-
'$this_quarter',
|
|
17
|
-
'$this_year',
|
|
18
|
-
]);
|
|
19
|
-
/**
|
|
20
|
-
* Pattern for relative date functions: $previous_day(x), $next_month(x), etc.
|
|
21
|
-
*/
|
|
22
|
-
const RELATIVE_DATE_PATTERN = /^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/;
|
|
23
|
-
/**
|
|
24
|
-
* Pattern for user context variables: $me, $me.office.name, etc.
|
|
25
|
-
*/
|
|
26
|
-
const USER_CONTEXT_PATTERN = /^\$me(\.\w+)*$/;
|
|
27
|
-
/**
|
|
28
|
-
* Check if a value is a valid dynamic value or placeholder
|
|
29
|
-
* @param value
|
|
30
|
-
*/
|
|
31
|
-
function isValidDynamicValue(value) {
|
|
32
|
-
if (typeof value !== 'string') {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return (VALID_DYNAMIC_VALUES.has(value) ||
|
|
36
|
-
RELATIVE_DATE_PATTERN.test(value) ||
|
|
37
|
-
USER_CONTEXT_PATTERN.test(value));
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Validate a placeholder value
|
|
41
|
-
* @param value The value to check (might be a placeholder)
|
|
42
|
-
* @param activeLimetype The limetype of the active object
|
|
43
|
-
* @param limetypes Record of all available limetypes
|
|
44
|
-
* @returns Validation result with error message if invalid
|
|
45
|
-
*/
|
|
46
|
-
function validatePlaceholder(value, activeLimetype, limetypes) {
|
|
47
|
-
// Check if it's a valid dynamic value ($today, $me, etc.)
|
|
48
|
-
if (isValidDynamicValue(value)) {
|
|
49
|
-
return { valid: true };
|
|
50
|
-
}
|
|
51
|
-
// Not a placeholder, no validation needed
|
|
52
|
-
if (typeof value !== 'string' || !value.startsWith('%activeObject%')) {
|
|
53
|
-
return { valid: true };
|
|
54
|
-
}
|
|
55
|
-
// Placeholder used but no active limetype specified
|
|
56
|
-
// This is always valid - activeLimetype is optional and only used for validation
|
|
57
|
-
if (!activeLimetype) {
|
|
58
|
-
return { valid: true };
|
|
59
|
-
}
|
|
60
|
-
// Extract property path from placeholder
|
|
61
|
-
const propertyPath = value.replace(/^%activeObject%\.?/, '');
|
|
62
|
-
// %activeObject% without property path is valid (references the ID)
|
|
63
|
-
if (!propertyPath) {
|
|
64
|
-
return { valid: true };
|
|
65
|
-
}
|
|
66
|
-
// Validate the property path exists on the active limetype
|
|
67
|
-
try {
|
|
68
|
-
const property = getPropertyFromPath(limetypes, activeLimetype, propertyPath);
|
|
69
|
-
if (!property) {
|
|
70
|
-
return {
|
|
71
|
-
valid: false,
|
|
72
|
-
error: `Property path '${propertyPath}' does not exist on limetype '${activeLimetype}'`,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
// Path validation is already done by getPropertyFromPath
|
|
76
|
-
// If we can traverse the path successfully, it means all intermediate
|
|
77
|
-
// properties are valid single relations (belongsTo/hasOne).
|
|
78
|
-
// hasMany relations cannot be traversed in paths.
|
|
79
|
-
return { valid: true };
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
return {
|
|
83
|
-
valid: false,
|
|
84
|
-
error: `Invalid placeholder path: ${error.message}`,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Validates a filter expression key (property path).
|
|
90
|
-
* Supports both regular property paths and placeholders.
|
|
91
|
-
*
|
|
92
|
-
* @param key - Property path to validate (e.g., "name", "company.name", "%activeObject%.name")
|
|
93
|
-
* @param limetypes - All limetype definitions
|
|
94
|
-
* @param limetype - The limetype being filtered
|
|
95
|
-
* @param activeLimetype - Active limetype for placeholder resolution
|
|
96
|
-
* @returns Validation result with error message if invalid
|
|
97
|
-
*/
|
|
98
|
-
function validateFilterKey(key, limetypes, limetype, activeLimetype) {
|
|
99
|
-
// 1. Handle empty/missing keys
|
|
100
|
-
if (!key) {
|
|
101
|
-
return { valid: false, error: 'Filter key cannot be empty' };
|
|
102
|
-
}
|
|
103
|
-
// 2. Check if key is a placeholder
|
|
104
|
-
if (key.startsWith('%activeObject%')) {
|
|
105
|
-
const placeholderResult = validatePlaceholder(key, activeLimetype, limetypes);
|
|
106
|
-
if (!placeholderResult.valid) {
|
|
107
|
-
return placeholderResult;
|
|
108
|
-
}
|
|
109
|
-
// Extract property path after the placeholder and validate for hasMany/hasAndBelongsToMany
|
|
110
|
-
const propertyPath = key.replace(/^%activeObject%\.?/, '');
|
|
111
|
-
if (propertyPath && activeLimetype) {
|
|
112
|
-
const { error } = validatePropertyPath(limetypes, activeLimetype, propertyPath);
|
|
113
|
-
if (error) {
|
|
114
|
-
return { valid: false, error };
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return placeholderResult;
|
|
118
|
-
}
|
|
119
|
-
// 3. Validate regular property path (including intermediate properties)
|
|
120
|
-
const { error } = validatePropertyPath(limetypes, limetype, key);
|
|
121
|
-
if (error) {
|
|
122
|
-
return { valid: false, error };
|
|
123
|
-
}
|
|
124
|
-
// validatePropertyPath always returns an error if property is undefined,
|
|
125
|
-
// so if we reach here, the property exists and is valid
|
|
126
|
-
return { valid: true };
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Validate a response format against limetype schemas
|
|
130
|
-
* Throws errors for invalid property references
|
|
131
|
-
* Returns visual mode limitations for features not yet supported in visual mode
|
|
132
|
-
* @param responseFormat
|
|
133
|
-
* @param limetypes Record of all available limetypes
|
|
134
|
-
* @param limetype The root limetype for this query
|
|
135
|
-
* @param visualModeEnabled Whether visual mode is enabled
|
|
136
|
-
* @returns Visual mode limitations found (if any)
|
|
137
|
-
*/
|
|
138
|
-
function validateResponseFormat(responseFormat, limetypes, limetype, visualModeEnabled = true) {
|
|
139
|
-
const visualModeLimitations = [];
|
|
140
|
-
// Check for visual-mode-unsupported features
|
|
141
|
-
if (visualModeEnabled && responseFormat.aggregates) {
|
|
142
|
-
visualModeLimitations.push('responseFormat.aggregates is not yet supported in visual mode');
|
|
143
|
-
}
|
|
144
|
-
// Validate object properties (throws on invalid properties)
|
|
145
|
-
if (responseFormat.object) {
|
|
146
|
-
const objectLimitations = validatePropertySelection(responseFormat.object, limetypes, limetype, visualModeEnabled);
|
|
147
|
-
visualModeLimitations.push(...objectLimitations);
|
|
148
|
-
}
|
|
149
|
-
return visualModeLimitations;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Extract non-metadata keys from a property value object
|
|
153
|
-
* Filters out _alias and all # properties (which are treated as comments)
|
|
154
|
-
* @param propValue Property value object
|
|
155
|
-
* @param propName Property name (for error messages)
|
|
156
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
157
|
-
* @returns Object with non-metadata keys and any visual mode limitations found
|
|
158
|
-
*/
|
|
159
|
-
function extractNonMetadataKeys(propValue, propName, visualModeEnabled = true) {
|
|
160
|
-
const keys = Object.keys(propValue);
|
|
161
|
-
const visualModeLimitations = [];
|
|
162
|
-
// Check for # properties other than #description (visual mode limitation)
|
|
163
|
-
if (visualModeEnabled) {
|
|
164
|
-
const unsupportedHashProps = keys.filter((k) => k.startsWith('#') && k !== '#description');
|
|
165
|
-
if (unsupportedHashProps.length > 0) {
|
|
166
|
-
visualModeLimitations.push(`Property '${propName}' contains # properties not supported in visual mode: ${unsupportedHashProps.join(', ')}`);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
// Filter out _alias and all # properties (they are metadata/comments)
|
|
170
|
-
const nonMetadataKeys = keys.filter((k) => k !== '_alias' && !k.startsWith('#'));
|
|
171
|
-
return { keys: nonMetadataKeys, visualModeLimitations };
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Validate a relation property value
|
|
175
|
-
* @param propName Property name
|
|
176
|
-
* @param propValue Property value
|
|
177
|
-
* @param limetypes Record of all available limetypes
|
|
178
|
-
* @param property
|
|
179
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
180
|
-
* @returns Visual mode limitations found (if any)
|
|
181
|
-
*/
|
|
182
|
-
function validateRelationProperty(propName, propValue, limetypes, property, visualModeEnabled = true) {
|
|
183
|
-
// null is valid - just return the relation ID
|
|
184
|
-
if (propValue === null) {
|
|
185
|
-
return [];
|
|
186
|
-
}
|
|
187
|
-
if (typeof propValue !== 'object') {
|
|
188
|
-
throw new TypeError(`Relation property '${propName}' must be null or an object`);
|
|
189
|
-
}
|
|
190
|
-
const propValueObj = propValue;
|
|
191
|
-
const { keys: otherKeys, visualModeLimitations } = extractNonMetadataKeys(propValueObj, propName, visualModeEnabled);
|
|
192
|
-
// If it's just {} or { _alias: "...", "#...": "..." }, that's valid
|
|
193
|
-
if (otherKeys.length === 0) {
|
|
194
|
-
return visualModeLimitations;
|
|
195
|
-
}
|
|
196
|
-
// Otherwise, validate nested properties
|
|
197
|
-
const relatedLimetype = property.relation.getLimetype();
|
|
198
|
-
if (!relatedLimetype) {
|
|
199
|
-
throw new Error(`Could not determine related limetype for property '${propName}'`);
|
|
200
|
-
}
|
|
201
|
-
// Build a clean PropertySelection without metadata for recursive validation
|
|
202
|
-
const cleanSelection = {};
|
|
203
|
-
for (const key of otherKeys) {
|
|
204
|
-
cleanSelection[key] = propValueObj[key];
|
|
205
|
-
}
|
|
206
|
-
const nestedLimitations = validatePropertySelection(cleanSelection, limetypes, relatedLimetype.name, visualModeEnabled);
|
|
207
|
-
return [...visualModeLimitations, ...nestedLimitations];
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Validate a non-relation property value
|
|
211
|
-
* @param propName Property name
|
|
212
|
-
* @param propValue Property value
|
|
213
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
214
|
-
* @returns Visual mode limitations found (if any)
|
|
215
|
-
*/
|
|
216
|
-
function validateNonRelationProperty(propName, propValue, visualModeEnabled = true) {
|
|
217
|
-
// null is valid
|
|
218
|
-
if (propValue === null) {
|
|
219
|
-
return [];
|
|
220
|
-
}
|
|
221
|
-
// Allow empty object {} or object with only metadata (_alias, #...)
|
|
222
|
-
if (typeof propValue === 'object') {
|
|
223
|
-
const { keys: nonMetadataKeys, visualModeLimitations } = extractNonMetadataKeys(propValue, propName, visualModeEnabled);
|
|
224
|
-
if (nonMetadataKeys.length === 0) {
|
|
225
|
-
// {} or { _alias: "...", "#...": "..." } is valid
|
|
226
|
-
return visualModeLimitations;
|
|
227
|
-
}
|
|
228
|
-
throw new Error(`Non-relation property '${propName}' cannot have nested properties other than _alias or # properties (got: ${nonMetadataKeys.join(', ')})`);
|
|
229
|
-
}
|
|
230
|
-
throw new Error(`Non-relation property '${propName}' must be null or an object (got ${typeof propValue})`);
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Validate a single property entry
|
|
234
|
-
* @param propName Property name
|
|
235
|
-
* @param propValue Property value
|
|
236
|
-
* @param normalizedProperties Normalized properties of the limetype
|
|
237
|
-
* @param limetypes Record of all available limetypes
|
|
238
|
-
* @param limetype Current limetype name
|
|
239
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
240
|
-
* @returns Visual mode limitations found (if any)
|
|
241
|
-
*/
|
|
242
|
-
function validateSinglePropertyEntry(propName, propValue, normalizedProperties, limetypes, limetype, visualModeEnabled = true) {
|
|
243
|
-
// Allow empty string (editing state in visual mode)
|
|
244
|
-
if (propName === '') {
|
|
245
|
-
// Only validate empty property name in visual mode
|
|
246
|
-
if (visualModeEnabled && propValue !== null) {
|
|
247
|
-
throw new Error('Empty property name must have null value');
|
|
248
|
-
}
|
|
249
|
-
return [];
|
|
250
|
-
}
|
|
251
|
-
// Validate property exists on limetype
|
|
252
|
-
const property = normalizedProperties[propName];
|
|
253
|
-
if (!property) {
|
|
254
|
-
throw new Error(`Property '${propName}' does not exist on limetype '${limetype}'`);
|
|
255
|
-
}
|
|
256
|
-
// Validate value based on property type
|
|
257
|
-
if (property.relation) {
|
|
258
|
-
return validateRelationProperty(propName, propValue, limetypes, property, visualModeEnabled);
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
return validateNonRelationProperty(propName, propValue, visualModeEnabled);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Validate a property selection object against a limetype schema
|
|
266
|
-
* Recursively validates nested property selections for relations
|
|
267
|
-
* @param selection
|
|
268
|
-
* @param limetypes Record of all available limetypes
|
|
269
|
-
* @param limetype The limetype for this level of the selection
|
|
270
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
271
|
-
* @returns Visual mode limitations found (if any)
|
|
272
|
-
*/
|
|
273
|
-
function validatePropertySelection(selection, limetypes, limetype, visualModeEnabled = true) {
|
|
274
|
-
const limetypeObj = limetypes[limetype];
|
|
275
|
-
if (!limetypeObj) {
|
|
276
|
-
throw new Error(`Unknown limetype: ${limetype}`);
|
|
277
|
-
}
|
|
278
|
-
const normalizedProperties = getNormalizedProperties(limetypeObj);
|
|
279
|
-
const allVisualModeLimitations = [];
|
|
280
|
-
for (const [propName, propValue] of Object.entries(selection)) {
|
|
281
|
-
// Skip # properties (comments/metadata that backend accepts via unknown=INCLUDE)
|
|
282
|
-
// Note: _alias only appears inside property value objects, not at this level
|
|
283
|
-
if (propName.startsWith('#')) {
|
|
284
|
-
continue;
|
|
285
|
-
}
|
|
286
|
-
const limitations = validateSinglePropertyEntry(propName, propValue, normalizedProperties, limetypes, limetype, visualModeEnabled);
|
|
287
|
-
allVisualModeLimitations.push(...limitations);
|
|
288
|
-
}
|
|
289
|
-
return allVisualModeLimitations;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Validate a comparison expression (has 'key' property)
|
|
293
|
-
* @param filter
|
|
294
|
-
* @param activeLimetype
|
|
295
|
-
* @param limetypes
|
|
296
|
-
* @param limetype
|
|
297
|
-
*/
|
|
298
|
-
function validateComparisonExpression(filter, activeLimetype, limetypes, limetype) {
|
|
299
|
-
// Validate operator
|
|
300
|
-
const allValidOperators = Object.values(re);
|
|
301
|
-
if (!allValidOperators.includes(filter.op)) {
|
|
302
|
-
throw new Error(`Unsupported filter operator: ${filter.op}`);
|
|
303
|
-
}
|
|
304
|
-
// Validate filter key
|
|
305
|
-
const keyResult = validateFilterKey(filter.key, limetypes, limetype, activeLimetype);
|
|
306
|
-
if (!keyResult.valid) {
|
|
307
|
-
throw new Error(`Invalid filter key '${filter.key}': ${keyResult.error}`);
|
|
308
|
-
}
|
|
309
|
-
// Validate placeholder
|
|
310
|
-
const result = validatePlaceholder(filter.exp, activeLimetype, limetypes);
|
|
311
|
-
if (!result.valid) {
|
|
312
|
-
throw new Error(`Invalid placeholder in filter '${filter.key}': ${result.error}`);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Validate a group expression (AND/OR/NOT)
|
|
317
|
-
* @param filter
|
|
318
|
-
* @param activeLimetype
|
|
319
|
-
* @param limetypes
|
|
320
|
-
* @param limetype
|
|
321
|
-
* @param visualModeEnabled
|
|
322
|
-
*/
|
|
323
|
-
function validateGroupExpression(filter, activeLimetype, limetypes, limetype, visualModeEnabled) {
|
|
324
|
-
// Validate operator
|
|
325
|
-
if (filter.op !== re.AND &&
|
|
326
|
-
filter.op !== re.OR &&
|
|
327
|
-
filter.op !== re.NOT) {
|
|
328
|
-
throw new Error(`Unsupported group operator: ${filter.op}`);
|
|
329
|
-
}
|
|
330
|
-
// Recursively validate children
|
|
331
|
-
if (filter.op === re.NOT) {
|
|
332
|
-
validateFilterPlaceholders(filter.exp, activeLimetype, limetypes, limetype, visualModeEnabled);
|
|
333
|
-
}
|
|
334
|
-
else if (filter.op === re.AND || filter.op === re.OR) {
|
|
335
|
-
const expressions = filter.exp;
|
|
336
|
-
for (const expr of expressions) {
|
|
337
|
-
validateFilterPlaceholders(expr, activeLimetype, limetypes, limetype, visualModeEnabled);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Validate placeholders in a filter expression
|
|
343
|
-
* @param filter Filter expression to validate
|
|
344
|
-
* @param activeLimetype The limetype of the active object
|
|
345
|
-
* @param limetypes Record of all available limetypes
|
|
346
|
-
* @param limetype The limetype being filtered
|
|
347
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
348
|
-
*/
|
|
349
|
-
function validateFilterPlaceholders(filter, activeLimetype, limetypes, limetype, visualModeEnabled = true) {
|
|
350
|
-
if (!filter) {
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
if ('key' in filter) {
|
|
354
|
-
validateComparisonExpression(filter, activeLimetype, limetypes, limetype);
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
if ('exp' in filter) {
|
|
358
|
-
validateGroupExpression(filter, activeLimetype, limetypes, limetype, visualModeEnabled);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Validate Lime Query filter and collect errors and visual mode limitations
|
|
363
|
-
* @param filter The filter expression or group to validate
|
|
364
|
-
* @param activeLimetype Optional active object limetype for placeholder validation
|
|
365
|
-
* @param limetypes Record of all available limetypes
|
|
366
|
-
* @param limetype The limetype being filtered
|
|
367
|
-
* @param visualModeEnabled Whether visual mode is enabled
|
|
368
|
-
* @returns Object with validation errors and visual mode limitations
|
|
369
|
-
*/
|
|
370
|
-
function validateLimeQueryFilterInternal(filter, activeLimetype, limetypes, limetype, visualModeEnabled) {
|
|
371
|
-
const errors = [];
|
|
372
|
-
const limitations = [];
|
|
373
|
-
try {
|
|
374
|
-
validateFilterPlaceholders(filter, activeLimetype, limetypes, limetype, visualModeEnabled);
|
|
375
|
-
}
|
|
376
|
-
catch (error) {
|
|
377
|
-
const errorMessage = error.message;
|
|
378
|
-
// Invalid keys are BOTH spec violations AND rendering limitations:
|
|
379
|
-
// - Backend will reject them (validation error)
|
|
380
|
-
// - Visual mode can't show them in property selector (visual limitation)
|
|
381
|
-
if (errorMessage.includes('Invalid filter key') ||
|
|
382
|
-
errorMessage.includes('Cannot filter on many-relation')) {
|
|
383
|
-
errors.push(`Invalid filter: ${errorMessage}`);
|
|
384
|
-
limitations.push(errorMessage);
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
errors.push(`Invalid filter: ${errorMessage}`);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
return { errors, limitations };
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Validate orderBy specification
|
|
394
|
-
* @param orderBy Array of orderBy items to validate
|
|
395
|
-
* @param limetypes Record of all available limetypes
|
|
396
|
-
* @param limetype The limetype for this Lime Query
|
|
397
|
-
* @returns Array of validation error messages
|
|
398
|
-
*/
|
|
399
|
-
function validateOrderBy(orderBy, limetypes, limetype) {
|
|
400
|
-
const errors = [];
|
|
401
|
-
if (!Array.isArray(orderBy)) {
|
|
402
|
-
errors.push('orderBy must be an array');
|
|
403
|
-
return errors;
|
|
404
|
-
}
|
|
405
|
-
if (!limetype || !limetypes[limetype]) {
|
|
406
|
-
// Can't validate property paths without limetype
|
|
407
|
-
return errors;
|
|
408
|
-
}
|
|
409
|
-
for (const [index, item] of orderBy.entries()) {
|
|
410
|
-
const itemErrors = validateOrderByItem(item, index, limetypes, limetype);
|
|
411
|
-
errors.push(...itemErrors);
|
|
412
|
-
}
|
|
413
|
-
return errors;
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Validate a single orderBy item
|
|
417
|
-
* @param item The orderBy item to validate
|
|
418
|
-
* @param index The index of the item in the array (for error messages)
|
|
419
|
-
* @param limetypes Record of all available limetypes
|
|
420
|
-
* @param limetype The limetype for this Lime Query
|
|
421
|
-
* @returns Array of validation error messages for this item
|
|
422
|
-
*/
|
|
423
|
-
function validateOrderByItem(item, index, limetypes, limetype) {
|
|
424
|
-
const errors = [];
|
|
425
|
-
const objectError = validateOrderByItemIsObject(item, index);
|
|
426
|
-
if (objectError) {
|
|
427
|
-
return [objectError];
|
|
428
|
-
}
|
|
429
|
-
const keys = Object.keys(item);
|
|
430
|
-
const keyError = validateOrderByItemHasSingleKey(keys, index);
|
|
431
|
-
if (keyError) {
|
|
432
|
-
return [keyError];
|
|
433
|
-
}
|
|
434
|
-
const propertyPath = keys[0];
|
|
435
|
-
const direction = item[propertyPath];
|
|
436
|
-
const directionError = validateOrderByDirection(direction, index);
|
|
437
|
-
if (directionError) {
|
|
438
|
-
errors.push(directionError);
|
|
439
|
-
}
|
|
440
|
-
const pathError = validateOrderByPropertyPath(propertyPath, limetypes, limetype, index);
|
|
441
|
-
if (pathError) {
|
|
442
|
-
errors.push(pathError);
|
|
443
|
-
}
|
|
444
|
-
return errors;
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Validate that the orderBy item is an object
|
|
448
|
-
* @param item
|
|
449
|
-
* @param index
|
|
450
|
-
*/
|
|
451
|
-
function validateOrderByItemIsObject(item, index) {
|
|
452
|
-
if (typeof item !== 'object' || item === null) {
|
|
453
|
-
return `orderBy[${index}] must be an object`;
|
|
454
|
-
}
|
|
455
|
-
return null;
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Validate that the orderBy item has exactly one property key
|
|
459
|
-
* @param keys
|
|
460
|
-
* @param index
|
|
461
|
-
*/
|
|
462
|
-
function validateOrderByItemHasSingleKey(keys, index) {
|
|
463
|
-
if (keys.length === 0) {
|
|
464
|
-
return `orderBy[${index}] must have a property path`;
|
|
465
|
-
}
|
|
466
|
-
if (keys.length > 1) {
|
|
467
|
-
return `orderBy[${index}] must have exactly one property, got ${keys.length}`;
|
|
468
|
-
}
|
|
469
|
-
return null;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Validate that the sort direction is either ASC or DESC
|
|
473
|
-
* @param direction
|
|
474
|
-
* @param index
|
|
475
|
-
*/
|
|
476
|
-
function validateOrderByDirection(direction, index) {
|
|
477
|
-
if (direction !== 'ASC' && direction !== 'DESC') {
|
|
478
|
-
return `orderBy[${index}]: direction must be 'ASC' or 'DESC', got '${direction}'`;
|
|
479
|
-
}
|
|
480
|
-
return null;
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Validate that the property path exists on the limetype
|
|
484
|
-
* @param propertyPath
|
|
485
|
-
* @param limetypes
|
|
486
|
-
* @param limetype
|
|
487
|
-
* @param index
|
|
488
|
-
*/
|
|
489
|
-
function validateOrderByPropertyPath(propertyPath, limetypes, limetype, index) {
|
|
490
|
-
if (!propertyPath || propertyPath === '') {
|
|
491
|
-
return null;
|
|
492
|
-
}
|
|
493
|
-
const property = getPropertyFromPath(limetypes, limetype, propertyPath);
|
|
494
|
-
if (!property) {
|
|
495
|
-
return `orderBy[${index}]: property path '${propertyPath}' does not exist on limetype '${limetype}'`;
|
|
496
|
-
}
|
|
497
|
-
return null;
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* Validate Lime Query response format and collect errors/limitations
|
|
501
|
-
* @param responseFormat The response format to validate
|
|
502
|
-
* @param limetypes Record of all available limetypes
|
|
503
|
-
* @param limetype The limetype for this Lime Query
|
|
504
|
-
* @param visualModeEnabled Whether visual mode is enabled
|
|
505
|
-
* @returns Object with validation errors and visual mode limitations
|
|
506
|
-
*/
|
|
507
|
-
function validateLimeQueryResponseFormatInternal(responseFormat, limetypes, limetype, visualModeEnabled) {
|
|
508
|
-
const errors = [];
|
|
509
|
-
const limitations = [];
|
|
510
|
-
try {
|
|
511
|
-
const formatLimitations = validateResponseFormat(responseFormat, limetypes, limetype, visualModeEnabled);
|
|
512
|
-
limitations.push(...formatLimitations);
|
|
513
|
-
}
|
|
514
|
-
catch (error) {
|
|
515
|
-
errors.push(`Invalid responseFormat: ${error.message}`);
|
|
516
|
-
}
|
|
517
|
-
return { errors, limitations };
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Validate a Lime Query
|
|
521
|
-
* Returns validation result with separate arrays for validity errors and visual mode limitations
|
|
522
|
-
* @param limeQuery The Lime Query to validate
|
|
523
|
-
* @param limetypes Record of all available limetypes
|
|
524
|
-
* @param activeLimetype Optional active object limetype for placeholder validation
|
|
525
|
-
* @param visualModeEnabled Whether visual mode is enabled (affects validation)
|
|
526
|
-
* @returns LimeQueryValidationResult with validity status and any errors/limitations
|
|
527
|
-
*/
|
|
528
|
-
function isLimeQuerySupported(limeQuery, limetypes, activeLimetype, visualModeEnabled = true) {
|
|
529
|
-
// Handle empty/undefined Lime Query
|
|
530
|
-
if (!limeQuery) {
|
|
531
|
-
return {
|
|
532
|
-
valid: true,
|
|
533
|
-
visualModeSupported: true,
|
|
534
|
-
validationErrors: [],
|
|
535
|
-
visualModeLimitations: [],
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
const validationErrors = [];
|
|
539
|
-
const visualModeLimitations = [];
|
|
540
|
-
// Validate limetype exists
|
|
541
|
-
if (limeQuery.limetype && !limetypes[limeQuery.limetype]) {
|
|
542
|
-
validationErrors.push(`Unknown limetype: ${limeQuery.limetype}`);
|
|
543
|
-
}
|
|
544
|
-
// Check for offset without orderBy (Lime Query requirement)
|
|
545
|
-
if (limeQuery.offset !== undefined && !limeQuery.orderBy) {
|
|
546
|
-
validationErrors.push('offset requires orderBy to be specified');
|
|
547
|
-
}
|
|
548
|
-
// Validate orderBy
|
|
549
|
-
if (limeQuery.orderBy) {
|
|
550
|
-
const orderByErrors = validateOrderBy(limeQuery.orderBy, limetypes, limeQuery.limetype);
|
|
551
|
-
validationErrors.push(...orderByErrors);
|
|
552
|
-
}
|
|
553
|
-
// Check for visual-mode-unsupported top-level properties
|
|
554
|
-
if (visualModeEnabled && limeQuery.offset !== undefined) {
|
|
555
|
-
visualModeLimitations.push('offset is not yet supported in visual mode');
|
|
556
|
-
}
|
|
557
|
-
// Validate filter
|
|
558
|
-
if (limeQuery.filter) {
|
|
559
|
-
const { errors, limitations } = validateLimeQueryFilterInternal(limeQuery.filter, activeLimetype, limetypes, limeQuery.limetype, visualModeEnabled);
|
|
560
|
-
validationErrors.push(...errors);
|
|
561
|
-
visualModeLimitations.push(...limitations);
|
|
562
|
-
}
|
|
563
|
-
// Validate responseFormat
|
|
564
|
-
if (limeQuery.responseFormat) {
|
|
565
|
-
const { errors, limitations } = validateLimeQueryResponseFormatInternal(limeQuery.responseFormat, limetypes, limeQuery.limetype, visualModeEnabled);
|
|
566
|
-
validationErrors.push(...errors);
|
|
567
|
-
visualModeLimitations.push(...limitations);
|
|
568
|
-
}
|
|
569
|
-
return {
|
|
570
|
-
valid: validationErrors.length === 0,
|
|
571
|
-
visualModeSupported: visualModeLimitations.length === 0,
|
|
572
|
-
validationErrors,
|
|
573
|
-
visualModeLimitations,
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
// ============================================================================
|
|
577
|
-
// Specialized Validators for Modular Builders
|
|
578
|
-
// ============================================================================
|
|
579
|
-
/**
|
|
580
|
-
* Validate a ResponseFormat in isolation (for response-format-builder)
|
|
581
|
-
*
|
|
582
|
-
* This validator is designed for the response-format-builder component,
|
|
583
|
-
* which only handles ResponseFormat editing without the full LimeQuery context.
|
|
584
|
-
*
|
|
585
|
-
* @param responseFormat - The response format to validate
|
|
586
|
-
* @param limetypes - Record of all available limetypes
|
|
587
|
-
* @param limetype - The limetype context for validation
|
|
588
|
-
* @param visualModeEnabled - Whether visual mode is enabled (affects validation)
|
|
589
|
-
* @returns Validation result with errors and visual mode limitations
|
|
590
|
-
*/
|
|
591
|
-
function validateResponseFormatOnly(responseFormat, limetypes, limetype, visualModeEnabled = true) {
|
|
592
|
-
const validationErrors = [];
|
|
593
|
-
const visualModeLimitations = [];
|
|
594
|
-
// Validate limetype exists
|
|
595
|
-
if (!limetypes[limetype]) {
|
|
596
|
-
validationErrors.push(`Unknown limetype: ${limetype}`);
|
|
597
|
-
// Can't proceed with property validation if limetype is unknown
|
|
598
|
-
return {
|
|
599
|
-
valid: false,
|
|
600
|
-
visualModeSupported: false,
|
|
601
|
-
validationErrors,
|
|
602
|
-
visualModeLimitations,
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
// Use internal validation logic
|
|
606
|
-
const { errors, limitations } = validateLimeQueryResponseFormatInternal(responseFormat, limetypes, limetype, visualModeEnabled);
|
|
607
|
-
validationErrors.push(...errors);
|
|
608
|
-
visualModeLimitations.push(...limitations);
|
|
609
|
-
return {
|
|
610
|
-
valid: validationErrors.length === 0,
|
|
611
|
-
visualModeSupported: visualModeLimitations.length === 0,
|
|
612
|
-
validationErrors,
|
|
613
|
-
visualModeLimitations,
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
export { isLimeQuerySupported as i, validateResponseFormatOnly as v };
|
|
1
|
+
import{X as r}from"./index.esm.js";import{g as t,a as o,v as e}from"./property-selector.js";const n=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),i=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,s=/^\$me(\.\w+)*$/;function a(r,o,e){if(function(r){return"string"==typeof r&&(n.has(r)||i.test(r)||s.test(r))}(r))return{valid:!0};if("string"!=typeof r||!r.startsWith("%activeObject%"))return{valid:!0};if(!o)return{valid:!0};const a=r.replace(/^%activeObject%\.?/,"");if(!a)return{valid:!0};try{return t(e,o,a)?{valid:!0}:{valid:!1,error:`Property path '${a}' does not exist on limetype '${o}'`}}catch(r){return{valid:!1,error:`Invalid placeholder path: ${r.message}`}}}function u(r,t,o=!0){const e=Object.keys(r),n=[];if(o){const r=e.filter((r=>r.startsWith("#")&&"#description"!==r));r.length>0&&n.push(`Property '${t}' contains # properties not supported in visual mode: ${r.join(", ")}`)}return{keys:e.filter((r=>"_alias"!==r&&!r.startsWith("#"))),visualModeLimitations:n}}function l(r,t,o,e,n,i=!0){if(""===r){if(i&&null!==t)throw new Error("Empty property name must have null value");return[]}const s=o[r];if(!s)throw new Error(`Property '${r}' does not exist on limetype '${n}'`);return s.relation?function(r,t,o,e,n=!0){if(null===t)return[];if("object"!=typeof t)throw new TypeError(`Relation property '${r}' must be null or an object`);const i=t,{keys:s,visualModeLimitations:a}=u(i,r,n);if(0===s.length)return a;const l=e.relation.getLimetype();if(!l)throw new Error(`Could not determine related limetype for property '${r}'`);const f={};for(const r of s)f[r]=i[r];const p=c(f,o,l.name,n);return[...a,...p]}(r,t,e,s,i):function(r,t,o=!0){if(null===t)return[];if("object"==typeof t){const{keys:e,visualModeLimitations:n}=u(t,r,o);if(0===e.length)return n;throw new Error(`Non-relation property '${r}' cannot have nested properties other than _alias or # properties (got: ${e.join(", ")})`)}throw new Error(`Non-relation property '${r}' must be null or an object (got ${typeof t})`)}(r,t,i)}function c(r,t,e,n=!0){const i=t[e];if(!i)throw new Error(`Unknown limetype: ${e}`);const s=o(i),a=[];for(const[o,i]of Object.entries(r)){if(o.startsWith("#"))continue;const r=l(o,i,s,t,e,n);a.push(...r)}return a}function f(t,o,n,i,s=!0){t&&("key"in t?function(t,o,n,i){if(!Object.values(r).includes(t.op))throw new Error(`Unsupported filter operator: ${t.op}`);const s=function(r,t,o,n){if(!r)return{valid:!1,error:"Filter key cannot be empty"};if(r.startsWith("%activeObject%")){const o=a(r,n,t);if(!o.valid)return o;const i=r.replace(/^%activeObject%\.?/,"");if(i&&n){const{error:r}=e(t,n,i);if(r)return{valid:!1,error:r}}return o}const{error:i}=e(t,o,r);return i?{valid:!1,error:i}:{valid:!0}}(t.key,n,i,o);if(!s.valid)throw new Error(`Invalid filter key '${t.key}': ${s.error}`);const u=a(t.exp,o,n);if(!u.valid)throw new Error(`Invalid placeholder in filter '${t.key}': ${u.error}`)}(t,o,n,i):"exp"in t&&function(t,o,e,n,i){if(t.op!==r.AND&&t.op!==r.OR&&t.op!==r.NOT)throw new Error(`Unsupported group operator: ${t.op}`);if(t.op===r.NOT)f(t.exp,o,e,n,i);else if(t.op===r.AND||t.op===r.OR){const r=t.exp;for(const t of r)f(t,o,e,n,i)}}(t,o,n,i,s))}function p(r,o,e,n){const i=[],s=function(r,t){return"object"!=typeof r||null===r?`orderBy[${t}] must be an object`:null}(r,o);if(s)return[s];const a=Object.keys(r),u=function(r,t){return 0===r.length?`orderBy[${t}] must have a property path`:r.length>1?`orderBy[${t}] must have exactly one property, got ${r.length}`:null}(a,o);if(u)return[u];const l=a[0],c=function(r,t){return"ASC"!==r&&"DESC"!==r?`orderBy[${t}]: direction must be 'ASC' or 'DESC', got '${r}'`:null}(r[l],o);c&&i.push(c);const f=function(r,o,e,n){if(!r||""===r)return null;return t(o,e,r)?null:`orderBy[${n}]: property path '${r}' does not exist on limetype '${e}'`}(l,e,n,o);return f&&i.push(f),i}function d(r,t,o,e){const n=[],i=[];try{const n=function(r,t,o,e=!0){const n=[];if(e&&r.aggregates&&n.push("responseFormat.aggregates is not yet supported in visual mode"),r.object){const i=c(r.object,t,o,e);n.push(...i)}return n}(r,t,o,e);i.push(...n)}catch(r){n.push(`Invalid responseFormat: ${r.message}`)}return{errors:n,limitations:i}}function y(r,t,o,e=!0){if(!r)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};const n=[],i=[];if(r.limetype&&!t[r.limetype]&&n.push(`Unknown limetype: ${r.limetype}`),void 0===r.offset||r.orderBy||n.push("offset requires orderBy to be specified"),r.orderBy){const o=function(r,t,o){const e=[];if(!Array.isArray(r))return e.push("orderBy must be an array"),e;if(!o||!t[o])return e;for(const[n,i]of r.entries()){const r=p(i,n,t,o);e.push(...r)}return e}(r.orderBy,t,r.limetype);n.push(...o)}if(e&&void 0!==r.offset&&i.push("offset is not yet supported in visual mode"),r.filter){const{errors:s,limitations:a}=function(r,t,o,e,n){const i=[],s=[];try{f(r,t,o,e,n)}catch(r){const t=r.message;t.includes("Invalid filter key")||t.includes("Cannot filter on many-relation")?(i.push(`Invalid filter: ${t}`),s.push(t)):i.push(`Invalid filter: ${t}`)}return{errors:i,limitations:s}}(r.filter,o,t,r.limetype,e);n.push(...s),i.push(...a)}if(r.responseFormat){const{errors:o,limitations:s}=d(r.responseFormat,t,r.limetype,e);n.push(...o),i.push(...s)}return{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}function v(r,t,o,e=!0){const n=[],i=[];if(!t[o])return n.push(`Unknown limetype: ${o}`),{valid:!1,visualModeSupported:!1,validationErrors:n,visualModeLimitations:i};const{errors:s,limitations:a}=d(r,t,o,e);return n.push(...s),i.push(...a),{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}export{y as i,v}
|