@statezero/core 0.2.38 → 0.2.40
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/dist/actions/backend1/django_app/calculate-hash.d.ts +57 -0
- package/dist/actions/backend1/django_app/calculate-hash.js +80 -0
- package/dist/actions/backend1/django_app/calculate-hash.schema.json +148 -0
- package/dist/actions/backend1/django_app/get-current-username.d.ts +29 -0
- package/dist/actions/backend1/django_app/get-current-username.js +65 -0
- package/dist/actions/backend1/django_app/get-current-username.schema.json +47 -0
- package/dist/actions/backend1/django_app/get-server-status.d.ts +38 -0
- package/dist/actions/backend1/django_app/get-server-status.js +68 -0
- package/dist/actions/backend1/django_app/get-server-status.schema.json +93 -0
- package/dist/actions/backend1/django_app/get-user-info.d.ts +44 -0
- package/dist/actions/backend1/django_app/get-user-info.js +70 -0
- package/dist/actions/backend1/django_app/get-user-info.schema.json +127 -0
- package/dist/actions/backend1/django_app/index.d.ts +1 -0
- package/dist/actions/backend1/django_app/index.js +6 -0
- package/dist/actions/backend1/django_app/process-data.d.ts +51 -0
- package/dist/actions/backend1/django_app/process-data.js +78 -0
- package/dist/actions/backend1/django_app/process-data.schema.json +117 -0
- package/dist/actions/backend1/django_app/send-notification.d.ts +55 -0
- package/dist/actions/backend1/django_app/send-notification.js +81 -0
- package/dist/actions/backend1/django_app/send-notification.schema.json +175 -0
- package/dist/actions/backend1/index.d.ts +1 -0
- package/dist/actions/backend1/index.js +1 -0
- package/dist/actions/default/django_app/calculate-hash.d.ts +57 -0
- package/dist/actions/default/django_app/calculate-hash.js +80 -0
- package/dist/actions/default/django_app/calculate-hash.schema.json +148 -0
- package/dist/actions/default/django_app/get-current-username.d.ts +29 -0
- package/dist/actions/default/django_app/get-current-username.js +65 -0
- package/dist/actions/default/django_app/get-current-username.schema.json +47 -0
- package/dist/actions/default/django_app/get-server-status.d.ts +38 -0
- package/dist/actions/default/django_app/get-server-status.js +68 -0
- package/dist/actions/default/django_app/get-server-status.schema.json +93 -0
- package/dist/actions/default/django_app/get-user-info.d.ts +44 -0
- package/dist/actions/default/django_app/get-user-info.js +70 -0
- package/dist/actions/default/django_app/get-user-info.schema.json +127 -0
- package/dist/actions/default/django_app/index.d.ts +1 -0
- package/dist/actions/default/django_app/index.js +6 -0
- package/dist/actions/default/django_app/process-data.d.ts +51 -0
- package/dist/actions/default/django_app/process-data.js +78 -0
- package/dist/actions/default/django_app/process-data.schema.json +117 -0
- package/dist/actions/default/django_app/send-notification.d.ts +55 -0
- package/dist/actions/default/django_app/send-notification.js +81 -0
- package/dist/actions/default/django_app/send-notification.schema.json +175 -0
- package/dist/actions/default/index.d.ts +1 -0
- package/dist/actions/default/index.js +1 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +5 -0
- package/dist/adaptors/react/composables.d.ts +1 -0
- package/dist/adaptors/react/composables.js +4 -0
- package/dist/adaptors/react/index.d.ts +1 -0
- package/dist/adaptors/react/index.js +1 -0
- package/dist/adaptors/vue/components/LayoutRenderer.js +46 -49
- package/dist/adaptors/vue/components/defaults/index.d.ts +7 -0
- package/dist/adaptors/vue/components/defaults/index.js +31 -0
- package/dist/adaptors/vue/components/index.d.ts +1 -0
- package/dist/adaptors/vue/components/index.js +7 -0
- package/dist/adaptors/vue/composables.d.ts +2 -0
- package/dist/adaptors/vue/composables.js +44 -0
- package/dist/adaptors/vue/index.d.ts +3 -0
- package/dist/adaptors/vue/index.js +4 -0
- package/dist/adaptors/vue/reactivity.d.ts +18 -0
- package/dist/adaptors/vue/reactivity.js +132 -0
- package/dist/cli/commands/sync.d.ts +6 -0
- package/dist/cli/commands/sync.js +30 -0
- package/dist/cli/commands/syncActions.d.ts +46 -0
- package/dist/cli/commands/syncActions.js +717 -0
- package/dist/cli/commands/syncModels.d.ts +132 -0
- package/dist/cli/commands/syncModels.js +1120 -0
- package/dist/cli/configFileLoader.d.ts +10 -0
- package/dist/cli/configFileLoader.js +85 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +22 -0
- package/dist/config.d.ts +57 -0
- package/dist/config.js +273 -0
- package/dist/core/eventReceivers.d.ts +185 -0
- package/dist/core/eventReceivers.js +266 -0
- package/dist/core/utils.d.ts +8 -0
- package/dist/core/utils.js +62 -0
- package/dist/errorHandler.d.ts +21 -0
- package/dist/errorHandler.js +27 -0
- package/dist/filtering/localFiltering.d.ts +110 -0
- package/dist/filtering/localFiltering.js +1080 -0
- package/dist/flavours/django/dates.d.ts +34 -0
- package/dist/flavours/django/dates.js +113 -0
- package/dist/flavours/django/errors.d.ts +138 -0
- package/dist/flavours/django/errors.js +195 -0
- package/dist/flavours/django/f.d.ts +6 -0
- package/dist/flavours/django/f.js +91 -0
- package/dist/flavours/django/files.d.ts +62 -0
- package/dist/flavours/django/files.js +355 -0
- package/dist/flavours/django/makeApiCall.d.ts +36 -0
- package/dist/flavours/django/makeApiCall.js +169 -0
- package/dist/flavours/django/manager.d.ts +204 -0
- package/dist/flavours/django/manager.js +222 -0
- package/dist/flavours/django/model.d.ts +137 -0
- package/dist/flavours/django/model.js +366 -0
- package/dist/flavours/django/operationFactory.d.ts +73 -0
- package/dist/flavours/django/operationFactory.js +248 -0
- package/dist/flavours/django/q.d.ts +70 -0
- package/dist/flavours/django/q.js +43 -0
- package/dist/flavours/django/queryExecutor.d.ts +149 -0
- package/dist/flavours/django/queryExecutor.js +590 -0
- package/dist/flavours/django/querySet.d.ts +301 -0
- package/dist/flavours/django/querySet.js +736 -0
- package/dist/flavours/django/serializers.d.ts +39 -0
- package/dist/flavours/django/serializers.js +296 -0
- package/dist/flavours/django/tempPk.d.ts +31 -0
- package/dist/flavours/django/tempPk.js +92 -0
- package/dist/flavours/django/utils.d.ts +19 -0
- package/dist/flavours/django/utils.js +29 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +48 -0
- package/dist/models/backend1/django_app/comprehensivemodel.d.ts +894 -0
- package/dist/models/backend1/django_app/comprehensivemodel.js +71 -0
- package/dist/models/backend1/django_app/comprehensivemodel.schema.json +870 -0
- package/dist/models/backend1/django_app/custompkmodel.d.ts +92 -0
- package/dist/models/backend1/django_app/custompkmodel.js +69 -0
- package/dist/models/backend1/django_app/custompkmodel.schema.json +71 -0
- package/dist/models/backend1/django_app/dailyrate.d.ts +230 -0
- package/dist/models/backend1/django_app/dailyrate.js +71 -0
- package/dist/models/backend1/django_app/dailyrate.schema.json +212 -0
- package/dist/models/backend1/django_app/deepmodellevel1.d.ts +140 -0
- package/dist/models/backend1/django_app/deepmodellevel1.js +72 -0
- package/dist/models/backend1/django_app/deepmodellevel1.schema.json +114 -0
- package/dist/models/backend1/django_app/deepmodellevel2.d.ts +118 -0
- package/dist/models/backend1/django_app/deepmodellevel2.js +71 -0
- package/dist/models/backend1/django_app/deepmodellevel2.schema.json +92 -0
- package/dist/models/backend1/django_app/deepmodellevel3.d.ts +92 -0
- package/dist/models/backend1/django_app/deepmodellevel3.js +69 -0
- package/dist/models/backend1/django_app/deepmodellevel3.schema.json +69 -0
- package/dist/models/backend1/django_app/dummymodel.d.ts +134 -0
- package/dist/models/backend1/django_app/dummymodel.js +71 -0
- package/dist/models/backend1/django_app/dummymodel.schema.json +109 -0
- package/dist/models/backend1/django_app/dummyrelatedmodel.d.ts +92 -0
- package/dist/models/backend1/django_app/dummyrelatedmodel.js +69 -0
- package/dist/models/backend1/django_app/dummyrelatedmodel.schema.json +69 -0
- package/dist/models/backend1/django_app/filetest.d.ts +140 -0
- package/dist/models/backend1/django_app/filetest.js +69 -0
- package/dist/models/backend1/django_app/filetest.schema.json +111 -0
- package/dist/models/backend1/django_app/index.d.ts +1 -0
- package/dist/models/backend1/django_app/index.js +21 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel1.d.ts +118 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel1.js +71 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel1.schema.json +94 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel2.d.ts +118 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel2.js +71 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel2.schema.json +94 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel3.d.ts +134 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel3.js +71 -0
- package/dist/models/backend1/django_app/m2mdepthtestlevel3.schema.json +112 -0
- package/dist/models/backend1/django_app/modelwithcustompkrelation.d.ts +118 -0
- package/dist/models/backend1/django_app/modelwithcustompkrelation.js +71 -0
- package/dist/models/backend1/django_app/modelwithcustompkrelation.schema.json +93 -0
- package/dist/models/backend1/django_app/modelwithrestrictedfields.d.ts +134 -0
- package/dist/models/backend1/django_app/modelwithrestrictedfields.js +71 -0
- package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +111 -0
- package/dist/models/backend1/django_app/namefiltercustompkmodel.d.ts +92 -0
- package/dist/models/backend1/django_app/namefiltercustompkmodel.js +69 -0
- package/dist/models/backend1/django_app/namefiltercustompkmodel.schema.json +71 -0
- package/dist/models/backend1/django_app/order.d.ts +220 -0
- package/dist/models/backend1/django_app/order.js +71 -0
- package/dist/models/backend1/django_app/order.schema.json +203 -0
- package/dist/models/backend1/django_app/orderitem.d.ts +172 -0
- package/dist/models/backend1/django_app/orderitem.js +72 -0
- package/dist/models/backend1/django_app/orderitem.schema.json +149 -0
- package/dist/models/backend1/django_app/product.d.ts +254 -0
- package/dist/models/backend1/django_app/product.js +71 -0
- package/dist/models/backend1/django_app/product.schema.json +277 -0
- package/dist/models/backend1/django_app/productcategory.d.ts +92 -0
- package/dist/models/backend1/django_app/productcategory.js +69 -0
- package/dist/models/backend1/django_app/productcategory.schema.json +70 -0
- package/dist/models/backend1/django_app/rateplan.d.ts +92 -0
- package/dist/models/backend1/django_app/rateplan.js +69 -0
- package/dist/models/backend1/django_app/rateplan.schema.json +70 -0
- package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
- package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.js +69 -0
- package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
- package/dist/models/backend1/fileobject.d.ts +4 -0
- package/dist/models/backend1/fileobject.js +9 -0
- package/dist/models/backend1/index.d.ts +2 -0
- package/dist/models/backend1/index.js +2 -0
- package/dist/models/default/django_app/comprehensivemodel.d.ts +894 -0
- package/dist/models/default/django_app/comprehensivemodel.js +71 -0
- package/dist/models/default/django_app/comprehensivemodel.schema.json +870 -0
- package/dist/models/default/django_app/custompkmodel.d.ts +92 -0
- package/dist/models/default/django_app/custompkmodel.js +69 -0
- package/dist/models/default/django_app/custompkmodel.schema.json +71 -0
- package/dist/models/default/django_app/dailyrate.d.ts +230 -0
- package/dist/models/default/django_app/dailyrate.js +71 -0
- package/dist/models/default/django_app/dailyrate.schema.json +212 -0
- package/dist/models/default/django_app/deepmodellevel1.d.ts +128 -0
- package/dist/models/default/django_app/deepmodellevel1.js +72 -0
- package/dist/models/default/django_app/deepmodellevel1.schema.json +102 -0
- package/dist/models/default/django_app/deepmodellevel2.d.ts +106 -0
- package/dist/models/default/django_app/deepmodellevel2.js +71 -0
- package/dist/models/default/django_app/deepmodellevel2.schema.json +80 -0
- package/dist/models/default/django_app/deepmodellevel3.d.ts +80 -0
- package/dist/models/default/django_app/deepmodellevel3.js +69 -0
- package/dist/models/default/django_app/deepmodellevel3.schema.json +57 -0
- package/dist/models/default/django_app/dummymodel.d.ts +122 -0
- package/dist/models/default/django_app/dummymodel.js +71 -0
- package/dist/models/default/django_app/dummymodel.schema.json +97 -0
- package/dist/models/default/django_app/dummyrelatedmodel.d.ts +80 -0
- package/dist/models/default/django_app/dummyrelatedmodel.js +69 -0
- package/dist/models/default/django_app/dummyrelatedmodel.schema.json +57 -0
- package/dist/models/default/django_app/filetest.d.ts +128 -0
- package/dist/models/default/django_app/filetest.js +69 -0
- package/dist/models/default/django_app/filetest.schema.json +99 -0
- package/dist/models/default/django_app/index.d.ts +1 -0
- package/dist/models/default/django_app/index.js +21 -0
- package/dist/models/default/django_app/m2mdepthtestlevel1.d.ts +118 -0
- package/dist/models/default/django_app/m2mdepthtestlevel1.js +71 -0
- package/dist/models/default/django_app/m2mdepthtestlevel1.schema.json +94 -0
- package/dist/models/default/django_app/m2mdepthtestlevel2.d.ts +118 -0
- package/dist/models/default/django_app/m2mdepthtestlevel2.js +71 -0
- package/dist/models/default/django_app/m2mdepthtestlevel2.schema.json +94 -0
- package/dist/models/default/django_app/m2mdepthtestlevel3.d.ts +134 -0
- package/dist/models/default/django_app/m2mdepthtestlevel3.js +71 -0
- package/dist/models/default/django_app/m2mdepthtestlevel3.schema.json +112 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.d.ts +118 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.js +71 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.schema.json +93 -0
- package/dist/models/default/django_app/modelwithrestrictedfields.d.ts +134 -0
- package/dist/models/default/django_app/modelwithrestrictedfields.js +71 -0
- package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +111 -0
- package/dist/models/default/django_app/namefiltercustompkmodel.d.ts +92 -0
- package/dist/models/default/django_app/namefiltercustompkmodel.js +69 -0
- package/dist/models/default/django_app/namefiltercustompkmodel.schema.json +71 -0
- package/dist/models/default/django_app/order.d.ts +220 -0
- package/dist/models/default/django_app/order.js +71 -0
- package/dist/models/default/django_app/order.schema.json +203 -0
- package/dist/models/default/django_app/orderitem.d.ts +172 -0
- package/dist/models/default/django_app/orderitem.js +72 -0
- package/dist/models/default/django_app/orderitem.schema.json +149 -0
- package/dist/models/default/django_app/product.d.ts +254 -0
- package/dist/models/default/django_app/product.js +71 -0
- package/dist/models/default/django_app/product.schema.json +277 -0
- package/dist/models/default/django_app/productcategory.d.ts +92 -0
- package/dist/models/default/django_app/productcategory.js +69 -0
- package/dist/models/default/django_app/productcategory.schema.json +70 -0
- package/dist/models/default/django_app/rateplan.d.ts +92 -0
- package/dist/models/default/django_app/rateplan.js +69 -0
- package/dist/models/default/django_app/rateplan.schema.json +70 -0
- package/dist/models/default/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
- package/dist/models/default/django_app/restrictedfieldrelatedmodel.js +69 -0
- package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
- package/dist/models/default/fileobject.d.ts +4 -0
- package/dist/models/default/fileobject.js +9 -0
- package/dist/models/default/index.d.ts +2 -0
- package/dist/models/default/index.js +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +5 -0
- package/dist/react-entry.d.ts +2 -0
- package/dist/react-entry.js +2 -0
- package/dist/reactiveAdaptor.d.ts +24 -0
- package/dist/reactiveAdaptor.js +38 -0
- package/dist/reset.d.ts +15 -0
- package/dist/reset.js +97 -0
- package/dist/setup.d.ts +15 -0
- package/dist/setup.js +33 -0
- package/dist/syncEngine/cache/cache.d.ts +75 -0
- package/dist/syncEngine/cache/cache.js +355 -0
- package/dist/syncEngine/metrics/metricOptCalcs.d.ts +79 -0
- package/dist/syncEngine/metrics/metricOptCalcs.js +284 -0
- package/dist/syncEngine/registries/metricRegistry.d.ts +58 -0
- package/dist/syncEngine/registries/metricRegistry.js +171 -0
- package/dist/syncEngine/registries/modelStoreRegistry.d.ts +11 -0
- package/dist/syncEngine/registries/modelStoreRegistry.js +63 -0
- package/dist/syncEngine/registries/querysetStoreGraph.d.ts +41 -0
- package/dist/syncEngine/registries/querysetStoreGraph.js +174 -0
- package/dist/syncEngine/registries/querysetStoreRegistry.d.ts +72 -0
- package/dist/syncEngine/registries/querysetStoreRegistry.js +335 -0
- package/dist/syncEngine/stores/metricStore.d.ts +55 -0
- package/dist/syncEngine/stores/metricStore.js +222 -0
- package/dist/syncEngine/stores/modelStore.d.ts +53 -0
- package/dist/syncEngine/stores/modelStore.js +565 -0
- package/dist/syncEngine/stores/operation.d.ts +139 -0
- package/dist/syncEngine/stores/operation.js +291 -0
- package/dist/syncEngine/stores/operationEventHandlers.d.ts +8 -0
- package/dist/syncEngine/stores/operationEventHandlers.js +348 -0
- package/dist/syncEngine/stores/querysetStore.d.ts +60 -0
- package/dist/syncEngine/stores/querysetStore.js +294 -0
- package/dist/syncEngine/stores/reactivity.d.ts +3 -0
- package/dist/syncEngine/stores/reactivity.js +4 -0
- package/dist/syncEngine/stores/utils.d.ts +14 -0
- package/dist/syncEngine/stores/utils.js +32 -0
- package/dist/syncEngine/sync.d.ts +51 -0
- package/dist/syncEngine/sync.js +419 -0
- package/dist/testing.d.ts +63 -0
- package/dist/testing.js +175 -0
- package/dist/vue-entry.d.ts +15 -0
- package/dist/vue-entry.js +7 -0
- package/package.json +6 -7
- package/dist/adaptors/vue/components/layout.tailwind.css +0 -51
- /package/{dist → src}/adaptors/vue/components/layout.css +0 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import Pusher from "pusher-js";
|
|
2
|
+
/**
|
|
3
|
+
* Structure of events received from the server.
|
|
4
|
+
* @typedef {Object} ModelEvent
|
|
5
|
+
* @property {string} [type] - Support both frontend (type) and backend (event) naming conventions.
|
|
6
|
+
* @property {string} [event]
|
|
7
|
+
* @property {string} model
|
|
8
|
+
* @property {any} [data]
|
|
9
|
+
* @property {string} [operationId]
|
|
10
|
+
* @property {string} [namespace]
|
|
11
|
+
* @property {(string|number)[]} [instances] - For bulk events.
|
|
12
|
+
* @property {string} [pk_field_name]
|
|
13
|
+
* @property {string} [configKey] - The backend configuration key this event is associated with.
|
|
14
|
+
* @property {any} [key] - Additional open-ended keys.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Event types that can be received from the server.
|
|
18
|
+
* @readonly
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
21
|
+
export const EventType = {
|
|
22
|
+
CREATE: "create",
|
|
23
|
+
UPDATE: "update",
|
|
24
|
+
DELETE: "delete",
|
|
25
|
+
BULK_CREATE: "bulk_create",
|
|
26
|
+
BULK_UPDATE: "bulk_update",
|
|
27
|
+
BULK_DELETE: "bulk_delete",
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Callback for handling model events.
|
|
31
|
+
* @callback EventHandler
|
|
32
|
+
* @param {ModelEvent} event - The event object.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* A namespace resolver function.
|
|
36
|
+
* @callback NamespaceResolver
|
|
37
|
+
* @param {string} modelName - The model name.
|
|
38
|
+
* @returns {string} The namespace.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Options for instantiating a Pusher client.
|
|
42
|
+
* @typedef {Object} PusherClientOptions
|
|
43
|
+
* @property {string} appKey
|
|
44
|
+
* @property {string} cluster
|
|
45
|
+
* @property {boolean} [forceTLS]
|
|
46
|
+
* @property {string} authEndpoint
|
|
47
|
+
* @property {function(): Object<string, string>} [getAuthHeaders]
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Configuration options for Pusher event receivers.
|
|
51
|
+
* @typedef {Object} PusherReceiverOptions
|
|
52
|
+
* @property {PusherClientOptions} clientOptions
|
|
53
|
+
* @property {function(string): string} [formatChannelName] - Optional channel name formatter. Default: (namespace) => `private-${namespace}`
|
|
54
|
+
* @property {NamespaceResolver} [namespaceResolver] - Optional namespace resolver. Default: (modelName) => modelName.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* Implementation of EventReceiver that uses Pusher.
|
|
58
|
+
*/
|
|
59
|
+
export class PusherEventReceiver {
|
|
60
|
+
/**
|
|
61
|
+
* @param {PusherReceiverOptions} options
|
|
62
|
+
* @param {string} configKey - The backend configuration key
|
|
63
|
+
*/
|
|
64
|
+
constructor(options, configKey) {
|
|
65
|
+
const { clientOptions, formatChannelName, namespaceResolver } = options;
|
|
66
|
+
const CONNECTION_TIMEOUT = 10000; // 10 seconds
|
|
67
|
+
this.configKey = configKey;
|
|
68
|
+
this.connectionTimeoutId = null;
|
|
69
|
+
if (clientOptions.appKey &&
|
|
70
|
+
/^\d+$/.test(clientOptions.appKey) &&
|
|
71
|
+
clientOptions.appKey.length < 15) {
|
|
72
|
+
console.warn(`%c[Pusher Warning] The provided appKey ("${clientOptions.appKey}") looks like a numeric app_id. Pusher requires the alphanumeric key, not the ID. Please verify your configuration for backend: "${this.configKey}".`, "color: orange; font-weight: bold; font-size: 14px;");
|
|
73
|
+
}
|
|
74
|
+
this.pusherClient = new Pusher(clientOptions.appKey, {
|
|
75
|
+
cluster: clientOptions.cluster,
|
|
76
|
+
forceTLS: clientOptions.forceTLS ?? true,
|
|
77
|
+
authEndpoint: clientOptions.authEndpoint,
|
|
78
|
+
auth: { headers: clientOptions.getAuthHeaders?.() || {} },
|
|
79
|
+
});
|
|
80
|
+
this.pusherClient.connection.bind("connected", () => {
|
|
81
|
+
console.log(`Pusher client connected successfully for backend: ${this.configKey}.`);
|
|
82
|
+
if (this.connectionTimeoutId) {
|
|
83
|
+
clearTimeout(this.connectionTimeoutId);
|
|
84
|
+
this.connectionTimeoutId = null;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
this.pusherClient.connection.bind("failed", () => {
|
|
88
|
+
this._logConnectionError("Pusher connection explicitly failed.");
|
|
89
|
+
if (this.connectionTimeoutId) {
|
|
90
|
+
clearTimeout(this.connectionTimeoutId);
|
|
91
|
+
this.connectionTimeoutId = null;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
this.connectionTimeoutId = setTimeout(() => {
|
|
95
|
+
if (this.pusherClient.connection.state !== "connected") {
|
|
96
|
+
this._logConnectionError(`Pusher connection timed out after ${CONNECTION_TIMEOUT / 1000} seconds.`);
|
|
97
|
+
}
|
|
98
|
+
}, CONNECTION_TIMEOUT);
|
|
99
|
+
this.formatChannelName = formatChannelName ?? ((ns) => `private-${ns}`);
|
|
100
|
+
this.namespaceResolver = namespaceResolver ?? ((modelName) => modelName);
|
|
101
|
+
this.channels = new Map();
|
|
102
|
+
this.eventHandlers = new Set();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @private
|
|
106
|
+
* @param {string} reason
|
|
107
|
+
*/
|
|
108
|
+
_logConnectionError(reason) {
|
|
109
|
+
console.error(`%c
|
|
110
|
+
████████████████████████████████████████████████████████████████
|
|
111
|
+
█ █
|
|
112
|
+
█ PUSHER CONNECTION FAILED for backend: "${this.configKey}" █
|
|
113
|
+
█ █
|
|
114
|
+
████████████████████████████████████████████████████████████████
|
|
115
|
+
%c
|
|
116
|
+
Reason: ${reason}
|
|
117
|
+
|
|
118
|
+
CRITICAL: Real-time updates from the server will NOT be received.
|
|
119
|
+
This application will not reflect remote changes propagated via Pusher.
|
|
120
|
+
|
|
121
|
+
Common causes:
|
|
122
|
+
1. Incorrect 'appKey' or 'cluster' in the configuration.
|
|
123
|
+
2. The 'authEndpoint' is unreachable or returning an error (check network tab).
|
|
124
|
+
3. Network connectivity issues (firewall, offline).
|
|
125
|
+
4. Using an 'app_id' instead of the 'appKey'.`, "background-color: red; color: white; font-weight: bold; font-size: 16px; padding: 10px;", "color: red; font-size: 12px;");
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Set the namespace resolver function.
|
|
129
|
+
* @param {NamespaceResolver} resolver
|
|
130
|
+
*/
|
|
131
|
+
setNamespaceResolver(resolver) {
|
|
132
|
+
this.namespaceResolver = resolver;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Connect to Pusher (no-op since Pusher handles connection automatically).
|
|
136
|
+
*/
|
|
137
|
+
connect() { }
|
|
138
|
+
/**
|
|
139
|
+
* Subscribe to events for a specific namespace.
|
|
140
|
+
* @param {string} namespace
|
|
141
|
+
*/
|
|
142
|
+
subscribe(namespace) {
|
|
143
|
+
if (this.channels.has(namespace))
|
|
144
|
+
return;
|
|
145
|
+
const channelName = namespace.startsWith("private-")
|
|
146
|
+
? namespace
|
|
147
|
+
: this.formatChannelName(namespace);
|
|
148
|
+
console.log(`Subscribing to channel: ${channelName} for backend: ${this.configKey}`);
|
|
149
|
+
const channel = this.pusherClient.subscribe(channelName);
|
|
150
|
+
channel.bind("pusher:subscription_succeeded", () => {
|
|
151
|
+
console.log(`Subscription succeeded for channel: ${channelName}`);
|
|
152
|
+
});
|
|
153
|
+
channel.bind("pusher:subscription_error", (status) => {
|
|
154
|
+
console.error(`Subscription error for channel: ${channelName}. Status:`, status);
|
|
155
|
+
if (status.status === 401 || status.status === 403) {
|
|
156
|
+
console.error(`%cAuthentication failed for channel ${channelName}. Check your authEndpoint and server-side permissions.`, "color: orange; font-weight: bold;");
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
Object.values(EventType).forEach((eventType) => {
|
|
160
|
+
channel.bind(eventType, (data) => {
|
|
161
|
+
const event = {
|
|
162
|
+
...data,
|
|
163
|
+
type: data.event || eventType,
|
|
164
|
+
namespace,
|
|
165
|
+
configKey: this.configKey,
|
|
166
|
+
};
|
|
167
|
+
this.eventHandlers.forEach((handler) => handler(event));
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
this.channels.set(namespace, channel);
|
|
171
|
+
}
|
|
172
|
+
unsubscribe(namespace) {
|
|
173
|
+
const channel = this.channels.get(namespace);
|
|
174
|
+
if (!channel)
|
|
175
|
+
return;
|
|
176
|
+
Object.values(EventType).forEach((eventType) => {
|
|
177
|
+
channel.unbind(eventType);
|
|
178
|
+
});
|
|
179
|
+
const channelName = namespace.startsWith("private-")
|
|
180
|
+
? namespace
|
|
181
|
+
: this.formatChannelName(namespace);
|
|
182
|
+
this.pusherClient.unsubscribe(channelName);
|
|
183
|
+
this.channels.delete(namespace);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Disconnect from Pusher.
|
|
187
|
+
*/
|
|
188
|
+
disconnect() {
|
|
189
|
+
if (this.connectionTimeoutId) {
|
|
190
|
+
clearTimeout(this.connectionTimeoutId);
|
|
191
|
+
this.connectionTimeoutId = null;
|
|
192
|
+
}
|
|
193
|
+
[...this.channels.keys()].forEach((ns) => this.unsubscribe(ns));
|
|
194
|
+
this.pusherClient.disconnect();
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Add handler for model events
|
|
198
|
+
* @param {EventHandler} handler
|
|
199
|
+
*/
|
|
200
|
+
addModelEventHandler(handler) {
|
|
201
|
+
this.eventHandlers.add(handler);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Legacy method - adds event handler for backwards compatibility
|
|
205
|
+
* @param {EventHandler} handler
|
|
206
|
+
*/
|
|
207
|
+
addEventHandler(handler) {
|
|
208
|
+
this.eventHandlers.add(handler);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Remove an event handler callback.
|
|
212
|
+
* @param {EventHandler} handler
|
|
213
|
+
*/
|
|
214
|
+
removeEventHandler(handler) {
|
|
215
|
+
this.eventHandlers.delete(handler);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Get namespace from model name using the resolver.
|
|
219
|
+
* @param {string} modelName
|
|
220
|
+
* @returns {string}
|
|
221
|
+
*/
|
|
222
|
+
getNamespace(modelName) {
|
|
223
|
+
return this.namespaceResolver(modelName);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Map of event receivers by backend key
|
|
227
|
+
const eventReceivers = new Map();
|
|
228
|
+
/**
|
|
229
|
+
* Set an event receiver for a specific backend.
|
|
230
|
+
* @param {string} configKey - The backend configuration key
|
|
231
|
+
* @param {EventReceiver} receiver - The event receiver instance
|
|
232
|
+
*/
|
|
233
|
+
export function setEventReceiver(configKey, receiver) {
|
|
234
|
+
const currentReceiver = eventReceivers.get(configKey);
|
|
235
|
+
if (currentReceiver) {
|
|
236
|
+
currentReceiver.disconnect();
|
|
237
|
+
}
|
|
238
|
+
eventReceivers.set(configKey, receiver);
|
|
239
|
+
receiver.connect();
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Get the event receiver for a specific backend.
|
|
243
|
+
* @param {string} configKey - The backend configuration key
|
|
244
|
+
* @returns {EventReceiver|null}
|
|
245
|
+
*/
|
|
246
|
+
export function getEventReceiver(configKey = "default") {
|
|
247
|
+
return eventReceivers.get(configKey);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Get all registered event receivers.
|
|
251
|
+
* @returns {Map<string, EventReceiver>}
|
|
252
|
+
*/
|
|
253
|
+
export function getAllEventReceivers() {
|
|
254
|
+
return eventReceivers;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Set a custom namespace resolver function for a specific backend.
|
|
258
|
+
* @param {string} configKey - The backend configuration key
|
|
259
|
+
* @param {NamespaceResolver} resolver
|
|
260
|
+
*/
|
|
261
|
+
export function setNamespaceResolver(configKey, resolver) {
|
|
262
|
+
const receiver = getEventReceiver(configKey);
|
|
263
|
+
if (receiver) {
|
|
264
|
+
receiver.setNamespaceResolver(resolver);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get a model class by name, loading it from the correct folder structure
|
|
3
|
+
*
|
|
4
|
+
* @param {string} modelName - The model name (e.g. 'app.model')
|
|
5
|
+
* @param {string} configKey - Optional config key override (defaults to Model.configKey)
|
|
6
|
+
* @returns {Function|null} - The model class or null if not found
|
|
7
|
+
*/
|
|
8
|
+
export function getModelClass(modelName: string, configKey?: string): Function | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { configInstance } from '../../config.js';
|
|
2
|
+
// Cache for model classes to avoid repeated imports
|
|
3
|
+
const modelClassCache = {};
|
|
4
|
+
/**
|
|
5
|
+
* Get a model class by name, loading it from the correct folder structure
|
|
6
|
+
*
|
|
7
|
+
* @param {string} modelName - The model name (e.g. 'app.model')
|
|
8
|
+
* @param {string} configKey - Optional config key override (defaults to Model.configKey)
|
|
9
|
+
* @returns {Function|null} - The model class or null if not found
|
|
10
|
+
*/
|
|
11
|
+
export function getModelClass(modelName, configKey = this.configKey || 'default') {
|
|
12
|
+
// Check cache first
|
|
13
|
+
const cacheKey = `${configKey}:${modelName}`;
|
|
14
|
+
if (modelClassCache[cacheKey]) {
|
|
15
|
+
return modelClassCache[cacheKey];
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const config = configInstance.getConfig();
|
|
19
|
+
const backendConfig = config.backendConfigs[configKey];
|
|
20
|
+
if (!backendConfig) {
|
|
21
|
+
throw new Error(`No backend configuration found for key: ${configKey}`);
|
|
22
|
+
}
|
|
23
|
+
const baseDir = backendConfig.GENERATED_TYPES_DIR.replace(/\/$/, '');
|
|
24
|
+
// Split the model name into parts (e.g., 'app.model' -> ['app', 'model'])
|
|
25
|
+
const parts = modelName.split('.');
|
|
26
|
+
// The last part is the actual model name
|
|
27
|
+
const modelClassName = parts[parts.length - 1];
|
|
28
|
+
// The path is all parts except the last one, joined by '/'
|
|
29
|
+
const pathParts = parts.slice(0, parts.length - 1);
|
|
30
|
+
const path = pathParts.length > 0 ? `/${pathParts.join('/')}` : '';
|
|
31
|
+
// Construct the full path to the module
|
|
32
|
+
const modulePath = `${baseDir}${path}/${modelClassName}.js`;
|
|
33
|
+
// Load the module using require (in Node.js) or dynamic import (in browser)
|
|
34
|
+
// This implementation uses dynamic import as it's more common in modern JS environments
|
|
35
|
+
let ModelClass;
|
|
36
|
+
try {
|
|
37
|
+
// For Node.js environments, you might use require
|
|
38
|
+
// ModelClass = require(modulePath).default;
|
|
39
|
+
// For browser/ES modules using dynamic import
|
|
40
|
+
// Note: This is a synchronous approach to handle dynamic imports
|
|
41
|
+
// In a real implementation, this would need to be async or preloaded
|
|
42
|
+
// Since we can't do a true dynamic import synchronously, here we're assuming
|
|
43
|
+
// there's a global registry that was populated during build/load time
|
|
44
|
+
const allModels = window.__MODEL_REGISTRY__ || {};
|
|
45
|
+
ModelClass = allModels[modulePath];
|
|
46
|
+
if (!ModelClass) {
|
|
47
|
+
throw new Error(`Model not found in registry: ${modulePath}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (importError) {
|
|
51
|
+
console.error(`Error loading model class from ${modulePath}:`, importError);
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
// Cache the model class
|
|
55
|
+
modelClassCache[cacheKey] = ModelClass;
|
|
56
|
+
return ModelClass;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error(`Error getting model class for ${modelName}:`, error);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register a global error handler for StateZero errors.
|
|
3
|
+
* Errors still propagate to call sites - this is for side effects like toasts.
|
|
4
|
+
*
|
|
5
|
+
* @param {Function} handler - Callback receiving the error
|
|
6
|
+
* @returns {Function} Unsubscribe function
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // In a Vue component with access to toast
|
|
10
|
+
* const unsubscribe = onStateZeroError((error) => {
|
|
11
|
+
* toast.error(error.message)
|
|
12
|
+
* })
|
|
13
|
+
* onUnmounted(() => unsubscribe())
|
|
14
|
+
*/
|
|
15
|
+
export function onStateZeroError(handler: Function): Function;
|
|
16
|
+
/**
|
|
17
|
+
* Emit an error to all registered handlers.
|
|
18
|
+
* @param {Error} error - The error that occurred
|
|
19
|
+
*/
|
|
20
|
+
export function emitError(error: Error): void;
|
|
21
|
+
export const errorEmitter: any;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mitt from 'mitt';
|
|
2
|
+
export const errorEmitter = mitt();
|
|
3
|
+
/**
|
|
4
|
+
* Register a global error handler for StateZero errors.
|
|
5
|
+
* Errors still propagate to call sites - this is for side effects like toasts.
|
|
6
|
+
*
|
|
7
|
+
* @param {Function} handler - Callback receiving the error
|
|
8
|
+
* @returns {Function} Unsubscribe function
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // In a Vue component with access to toast
|
|
12
|
+
* const unsubscribe = onStateZeroError((error) => {
|
|
13
|
+
* toast.error(error.message)
|
|
14
|
+
* })
|
|
15
|
+
* onUnmounted(() => unsubscribe())
|
|
16
|
+
*/
|
|
17
|
+
export function onStateZeroError(handler) {
|
|
18
|
+
errorEmitter.on('error', handler);
|
|
19
|
+
return () => errorEmitter.off('error', handler);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Emit an error to all registered handlers.
|
|
23
|
+
* @param {Error} error - The error that occurred
|
|
24
|
+
*/
|
|
25
|
+
export function emitError(error) {
|
|
26
|
+
errorEmitter.emit('error', error);
|
|
27
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect a QuerySet.build() and collect every field path
|
|
3
|
+
* you’ll need to fetch before running sift.
|
|
4
|
+
*
|
|
5
|
+
* @param {Object} queryBuild – result of QuerySet.build()
|
|
6
|
+
* @param {Class} ModelClass – the root model class
|
|
7
|
+
* @returns {string[]} Array of dot-notation paths, e.g. ['author.id','createdAt.year']
|
|
8
|
+
*/
|
|
9
|
+
export function getRequiredFields(queryBuild: Object, ModelClass: Class): string[];
|
|
10
|
+
export function pickRequiredFields(requiredPaths: any, instance: any): {};
|
|
11
|
+
/**
|
|
12
|
+
* Filter and order a collection of data objects according to a QuerySet's AST.
|
|
13
|
+
* This combines getRequiredFields, pickRequiredFields, and processQuery in one function.
|
|
14
|
+
*
|
|
15
|
+
* @param {Array<Object>} data - Collection of objects to filter and order
|
|
16
|
+
* @param {Object} ast - Abstract Syntax Tree from QuerySet.build()
|
|
17
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
18
|
+
* @param {boolean} [returnFullObjects=false] - If true, returns full objects instead of just primary keys
|
|
19
|
+
* @returns {Array} Filtered and ordered results (primary keys or full objects based on returnFullObjects)
|
|
20
|
+
*/
|
|
21
|
+
export function filter(data: Array<Object>, ast: Object, ModelClass: Class, returnFullObjects?: boolean): any[];
|
|
22
|
+
/**
|
|
23
|
+
* Process a Django-style field path with relationships to match Django ORM behavior.
|
|
24
|
+
* This handles nested relationships by traversing the model schema and properly
|
|
25
|
+
* resolving relationship fields to their primary keys.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} fieldPath - The Django-style field path (e.g., 'level2__level3__name')
|
|
28
|
+
* @param {any} value - The value to filter by
|
|
29
|
+
* @param {Class} ModelClass - The root model class to start traversal from
|
|
30
|
+
* @param {Object} options - Additional options
|
|
31
|
+
* @returns {Object} An object with processed field path and operator
|
|
32
|
+
*/
|
|
33
|
+
export function processFieldPath(fieldPath: string, value: any, ModelClass: Class, options?: Object): Object;
|
|
34
|
+
/**
|
|
35
|
+
* Convert Django-style filter conditions to Sift-compatible criteria
|
|
36
|
+
* @param {Object} conditions - Filter conditions
|
|
37
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
38
|
+
* @returns {Object} Sift-compatible criteria
|
|
39
|
+
*/
|
|
40
|
+
export function convertToSiftCriteria(conditions: Object, ModelClass: Class): Object;
|
|
41
|
+
/**
|
|
42
|
+
* Processes a Q object array to match the backend AST structure
|
|
43
|
+
* @param {Array} qConditions - Array of Q objects or conditions
|
|
44
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
45
|
+
* @returns {Object} Sift criteria for Q conditions
|
|
46
|
+
*/
|
|
47
|
+
export function processQConditions(qConditions: any[], ModelClass: Class): Object;
|
|
48
|
+
/**
|
|
49
|
+
* Convert a filter node to sift criteria with proper relationship traversal
|
|
50
|
+
* @param {Object} filterNode - The filter node to convert
|
|
51
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
52
|
+
* @returns {Object} Sift criteria object
|
|
53
|
+
*/
|
|
54
|
+
export function convertFilterNodeToSiftCriteria(filterNode: Object, ModelClass: Class): Object;
|
|
55
|
+
/**
|
|
56
|
+
* Apply search criteria to a dataset
|
|
57
|
+
* @param {Array} data - Collection of objects to search
|
|
58
|
+
* @param {Object} searchNode - Search node from query
|
|
59
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
60
|
+
* @returns {Array} Filtered results
|
|
61
|
+
*/
|
|
62
|
+
export function applySearch(data: any[], searchNode: Object, ModelClass: Class): any[];
|
|
63
|
+
/**
|
|
64
|
+
* Applies ordering to a dataset based on a list of fields
|
|
65
|
+
* @param {Array} data - Collection of objects to order
|
|
66
|
+
* @param {Array<string>} orderBy - Fields to order by (prefix with - for descending)
|
|
67
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
68
|
+
* @returns {Array} Ordered results
|
|
69
|
+
*/
|
|
70
|
+
export function applyOrderBy(data: any[], orderBy: Array<string>, ModelClass: Class): any[];
|
|
71
|
+
/**
|
|
72
|
+
* Process an array of denormalized objects to filter & order them,
|
|
73
|
+
* then return just the matching primary-keys in order.
|
|
74
|
+
*
|
|
75
|
+
* @param {Array<Object>} data – denormalized rows, e.g. [{ id:1, name:"A", related:{ name:"B" } }, …]
|
|
76
|
+
* @param {Object} queryBuild – the result of QuerySet.build()
|
|
77
|
+
* @param {Class} ModelClass – your model class (for fieldPath resolution & date-ops)
|
|
78
|
+
* @returns {Array<*>} – the primary keys of matching rows, in order
|
|
79
|
+
*/
|
|
80
|
+
export function processQuery(data: Array<Object>, queryBuild: Object, ModelClass: Class): Array<any>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates custom operations for date parts to be used with Sift
|
|
83
|
+
* @param {string} timezone - The timezone to use for date operations
|
|
84
|
+
* @param {Class} ModelClass - The model class for serialization
|
|
85
|
+
* @returns {Object} Object containing custom operations
|
|
86
|
+
*/
|
|
87
|
+
export function createDateOperations(timezone?: string, ModelClass?: Class): Object;
|
|
88
|
+
/**
|
|
89
|
+
* Process a Django-style filter query to use with sift, including date part operations
|
|
90
|
+
* @param {Object} criteria - Sift criteria with possible date operations
|
|
91
|
+
* @param {Class} ModelClass - The model class for schema traversal
|
|
92
|
+
* @returns {Function} Sift filter function with date operations support
|
|
93
|
+
*/
|
|
94
|
+
export function createFilterWithDateOperations(criteria: Object, ModelClass: Class): Function;
|
|
95
|
+
/**
|
|
96
|
+
* Creates a special operator for date part comparison (e.g., created_at__hour__gt: 12)
|
|
97
|
+
* @param {string} field - Processed field path
|
|
98
|
+
* @param {string} datePart - The date part to extract ('year', 'month', etc.)
|
|
99
|
+
* @param {string} comparisonOperator - The comparison operator ('gt', 'lt', etc.)
|
|
100
|
+
* @param {any} value - Value to filter by
|
|
101
|
+
* @param {boolean} isRelationship - Whether the field is a relationship
|
|
102
|
+
* @returns {Object} Object with field name and custom operator
|
|
103
|
+
*/
|
|
104
|
+
export function createDatePartComparisonOperator(field: string, datePart: string, comparisonOperator: string, value: any, isRelationship: boolean): Object;
|
|
105
|
+
/**
|
|
106
|
+
* Gets the backend timezone for a model class
|
|
107
|
+
* @param {Class} ModelClass - The model class
|
|
108
|
+
* @returns {string} The backend timezone or 'UTC' as fallback
|
|
109
|
+
*/
|
|
110
|
+
export function getBackendTimezone(ModelClass: Class): string;
|