@statezero/core 0.2.3 → 0.2.5

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.
Files changed (54) hide show
  1. package/dist/adaptors/vue/composables.js +0 -12
  2. package/dist/cli/commands/syncModels.js +9 -0
  3. package/dist/core/eventReceivers.js +0 -15
  4. package/dist/flavours/django/model.d.ts +2 -1
  5. package/dist/flavours/django/model.js +9 -1
  6. package/dist/flavours/django/querySet.js +1 -0
  7. package/dist/models/backend1/django_app/comprehensivemodel.js +8 -0
  8. package/dist/models/backend1/django_app/custompkmodel.js +8 -0
  9. package/dist/models/backend1/django_app/dailyrate.d.ts +47 -0
  10. package/dist/models/backend1/django_app/dailyrate.js +71 -0
  11. package/dist/models/backend1/django_app/deepmodellevel1.js +8 -0
  12. package/dist/models/backend1/django_app/deepmodellevel2.js +8 -0
  13. package/dist/models/backend1/django_app/deepmodellevel3.js +8 -0
  14. package/dist/models/backend1/django_app/dummymodel.js +8 -0
  15. package/dist/models/backend1/django_app/dummyrelatedmodel.js +8 -0
  16. package/dist/models/backend1/django_app/filetest.js +8 -0
  17. package/dist/models/backend1/django_app/index.d.ts +2 -0
  18. package/dist/models/backend1/django_app/index.js +2 -0
  19. package/dist/models/backend1/django_app/modelwithcustompkrelation.js +8 -0
  20. package/dist/models/backend1/django_app/namefiltercustompkmodel.js +8 -0
  21. package/dist/models/backend1/django_app/order.js +8 -0
  22. package/dist/models/backend1/django_app/orderitem.js +8 -0
  23. package/dist/models/backend1/django_app/product.js +8 -0
  24. package/dist/models/backend1/django_app/productcategory.js +8 -0
  25. package/dist/models/backend1/django_app/rateplan.d.ts +44 -0
  26. package/dist/models/backend1/django_app/rateplan.js +69 -0
  27. package/dist/models/default/django_app/comprehensivemodel.js +8 -0
  28. package/dist/models/default/django_app/custompkmodel.js +8 -0
  29. package/dist/models/default/django_app/dailyrate.d.ts +47 -0
  30. package/dist/models/default/django_app/dailyrate.js +71 -0
  31. package/dist/models/default/django_app/deepmodellevel1.js +8 -0
  32. package/dist/models/default/django_app/deepmodellevel2.js +8 -0
  33. package/dist/models/default/django_app/deepmodellevel3.js +8 -0
  34. package/dist/models/default/django_app/dummymodel.js +8 -0
  35. package/dist/models/default/django_app/dummyrelatedmodel.js +8 -0
  36. package/dist/models/default/django_app/filetest.js +8 -0
  37. package/dist/models/default/django_app/index.d.ts +2 -0
  38. package/dist/models/default/django_app/index.js +2 -0
  39. package/dist/models/default/django_app/modelwithcustompkrelation.js +8 -0
  40. package/dist/models/default/django_app/namefiltercustompkmodel.js +8 -0
  41. package/dist/models/default/django_app/order.js +8 -0
  42. package/dist/models/default/django_app/orderitem.js +8 -0
  43. package/dist/models/default/django_app/product.js +8 -0
  44. package/dist/models/default/django_app/productcategory.js +8 -0
  45. package/dist/models/default/django_app/rateplan.d.ts +44 -0
  46. package/dist/models/default/django_app/rateplan.js +69 -0
  47. package/dist/syncEngine/stores/modelStore.js +2 -1
  48. package/dist/syncEngine/stores/querysetStore.d.ts +1 -1
  49. package/dist/syncEngine/stores/querysetStore.js +3 -10
  50. package/dist/syncEngine/sync.d.ts +0 -7
  51. package/dist/syncEngine/sync.js +2 -119
  52. package/package.json +1 -2
  53. package/dist/syncEngine/namespaceUtils.d.ts +0 -16
  54. package/dist/syncEngine/namespaceUtils.js +0 -32
@@ -9,18 +9,6 @@ export const querysets = new Map(); // Map of composableId -> queryset
9
9
  function updateSyncManager() {
10
10
  // Get unique querysets from all active composables
11
11
  const uniqueQuerysets = new Set(querysets.values());
12
- // Unsubscribe from querysets no longer followed
13
- for (const [key, info] of syncManager.activeSubscriptions) {
14
- if (!uniqueQuerysets.has(info.queryset)) {
15
- syncManager.unsubscribeFromNamespace(info.queryset);
16
- }
17
- }
18
- // Subscribe to new querysets
19
- for (const queryset of uniqueQuerysets) {
20
- if (!syncManager.activeSubscriptions.has(queryset.semanticKey)) {
21
- syncManager.subscribeToNamespace(queryset);
22
- }
23
- }
24
12
  syncManager.followedQuerysets = uniqueQuerysets;
25
13
  }
26
14
  export function useQueryset(querysetFactory) {
@@ -226,6 +226,15 @@ export class {{className}} extends Model {
226
226
  configurable: true
227
227
  });
228
228
  });
229
+
230
+ // Add a special read-only getter for the repr field
231
+ Object.defineProperty(this, 'repr', {
232
+ get: function() {
233
+ return this.getField('repr');
234
+ },
235
+ enumerable: true, // Make sure repr is enumerable
236
+ configurable: true
237
+ });
229
238
  }
230
239
  }
231
240
  `;
@@ -83,21 +83,6 @@ export class PusherEventReceiver {
83
83
  clearTimeout(this.connectionTimeoutId);
84
84
  this.connectionTimeoutId = null;
85
85
  }
86
- // Notify connected event
87
- this.eventHandlers.forEach((handler) => {
88
- if (handler.onReconnected) {
89
- handler.onReconnected();
90
- }
91
- });
92
- });
93
- this.pusherClient.connection.bind("disconnected", () => {
94
- console.log(`Pusher client disconnected for backend: ${this.configKey}.`);
95
- // Notify disconnected event
96
- this.eventHandlers.forEach((handler) => {
97
- if (handler.onDisconnected) {
98
- handler.onDisconnected();
99
- }
100
- });
101
86
  });
102
87
  this.pusherClient.connection.bind("failed", () => {
103
88
  this._logConnectionError("Pusher connection explicitly failed.");
@@ -91,9 +91,10 @@ export class Model {
91
91
  * By default, it returns all enumerable own properties.
92
92
  * Subclasses should override this to return specific keys.
93
93
  *
94
+ * @param {boolean} includeRepr - Whether to include the repr field (for caching). Default: false.
94
95
  * @returns {Object} The serialized model data.
95
96
  */
96
- serialize(): Object;
97
+ serialize(includeRepr?: boolean): Object;
97
98
  /**
98
99
  * Saves the model instance by either creating a new record or updating an existing one.
99
100
  *
@@ -140,9 +140,10 @@ export class Model {
140
140
  * By default, it returns all enumerable own properties.
141
141
  * Subclasses should override this to return specific keys.
142
142
  *
143
+ * @param {boolean} includeRepr - Whether to include the repr field (for caching). Default: false.
143
144
  * @returns {Object} The serialized model data.
144
145
  */
145
- serialize() {
146
+ serialize(includeRepr = false) {
146
147
  const ModelClass = this.constructor;
147
148
  const data = {};
148
149
  // Collect all field values (already in internal format)
@@ -162,6 +163,13 @@ export class Model {
162
163
  data[field] = value;
163
164
  }
164
165
  }
166
+ // Include repr field if requested (for caching purposes)
167
+ if (includeRepr && !isNil(this._pk)) {
168
+ const storedData = modelStoreRegistry.getEntity(ModelClass, this._pk);
169
+ if (storedData && storedData.repr) {
170
+ data.repr = storedData.repr;
171
+ }
172
+ }
165
173
  // Data is already in internal format, so return as-is for API transmission
166
174
  return data;
167
175
  }
@@ -3,6 +3,7 @@ import { Model } from "./model.js";
3
3
  import { ModelSerializer, relationshipFieldSerializer, dateFieldSerializer } from "./serializers.js";
4
4
  import axios from "axios";
5
5
  import { QueryExecutor } from "./queryExecutor.js";
6
+ import { json } from "stream/consumers";
6
7
  import { v7 } from "uuid";
7
8
  import hash from "object-hash";
8
9
  import rfdc from "rfdc";
@@ -49,6 +49,14 @@ export class ComprehensiveModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class CustomPKModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class DailyRateQuerySet extends QuerySet<any> {
5
+ constructor(ModelClass: ModelConstructor, config?: {
6
+ nodes?: QueryNode[] | undefined;
7
+ orderBy?: {
8
+ field: string;
9
+ direction: "asc" | "desc";
10
+ }[] | undefined;
11
+ fields?: Set<string> | undefined;
12
+ aggregations?: Aggregation[] | undefined;
13
+ initialQueryset?: string | undefined;
14
+ serializerOptions?: SerializerOptions;
15
+ materialized?: boolean | undefined;
16
+ } | undefined, parent?: null);
17
+ }
18
+ /**
19
+ * Model-specific Manager implementation
20
+ */
21
+ export class DailyRateManager extends Manager {
22
+ constructor(ModelClass: any);
23
+ }
24
+ /**
25
+ * Implementation of the DailyRate model
26
+ */
27
+ export class DailyRate extends Model {
28
+ static configKey: string;
29
+ static modelName: string;
30
+ static primaryKeyField: string;
31
+ static objects: DailyRateManager;
32
+ static fields: string[];
33
+ static schema: any;
34
+ static relationshipFields: Map<string, {
35
+ ModelClass: () => Function | null;
36
+ relationshipType: string;
37
+ }>;
38
+ constructor(data: any);
39
+ /**
40
+ * Define property getters and setters for all model fields
41
+ * @private
42
+ */
43
+ private _defineProperties;
44
+ }
45
+ import { QuerySet } from '../../../../src';
46
+ import { Manager } from '../../../../src';
47
+ import { Model } from '../../../../src';
@@ -0,0 +1,71 @@
1
+ /**
2
+ * This file was auto-generated. Do not make direct changes to the file.
3
+ */
4
+ import { Model, Manager, QuerySet, getModelClass } from '../../../../src';
5
+ import { wrapReactiveModel } from '../../../../src';
6
+ import schemaData from './dailyrate.schema.json';
7
+ /**
8
+ * Model-specific QuerySet implementation
9
+ */
10
+ export class DailyRateQuerySet extends QuerySet {
11
+ }
12
+ /**
13
+ * Model-specific Manager implementation
14
+ */
15
+ export class DailyRateManager extends Manager {
16
+ constructor(ModelClass) {
17
+ super(ModelClass, DailyRateQuerySet);
18
+ }
19
+ newQuerySet() {
20
+ return new DailyRateQuerySet(this.ModelClass);
21
+ }
22
+ }
23
+ /**
24
+ * Implementation of the DailyRate model
25
+ */
26
+ export class DailyRate extends Model {
27
+ constructor(data) {
28
+ DailyRate.validateFields(data);
29
+ super(data);
30
+ // Define getters and setters for all fields
31
+ this._defineProperties();
32
+ return wrapReactiveModel(this);
33
+ }
34
+ /**
35
+ * Define property getters and setters for all model fields
36
+ * @private
37
+ */
38
+ _defineProperties() {
39
+ // For each field, define a property that gets/sets from internal storage
40
+ DailyRate.fields.forEach(field => {
41
+ Object.defineProperty(this, field, {
42
+ get: function () {
43
+ return this.getField(field);
44
+ },
45
+ set: function (value) {
46
+ this.setField(field, value);
47
+ },
48
+ enumerable: true, // Make sure fields are enumerable for serialization
49
+ configurable: true
50
+ });
51
+ });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
60
+ }
61
+ }
62
+ // Bind this model to its backend
63
+ DailyRate.configKey = 'backend1';
64
+ DailyRate.modelName = 'django_app.dailyrate';
65
+ DailyRate.primaryKeyField = 'id';
66
+ DailyRate.objects = new DailyRateManager(DailyRate);
67
+ DailyRate.fields = ['id', 'rate_plan', 'date', 'price', 'min_stay_arrival', 'min_stay_through', 'max_stay', 'closed_to_arrival', 'closed_to_departure', 'stop_sell'];
68
+ DailyRate.schema = schemaData;
69
+ DailyRate.relationshipFields = new Map([
70
+ ['rate_plan', { 'ModelClass': () => getModelClass('django_app.rateplan', 'backend1'), 'relationshipType': 'foreign-key' }]
71
+ ]);
@@ -49,6 +49,14 @@ export class DeepModelLevel1 extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class DeepModelLevel2 extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class DeepModelLevel3 extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class DummyModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class DummyRelatedModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class FileTest extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -12,3 +12,5 @@ export * from "./productcategory";
12
12
  export * from "./product";
13
13
  export * from "./order";
14
14
  export * from "./orderitem";
15
+ export * from "./rateplan";
16
+ export * from "./dailyrate";
@@ -12,3 +12,5 @@ export * from './productcategory';
12
12
  export * from './product';
13
13
  export * from './order';
14
14
  export * from './orderitem';
15
+ export * from './rateplan';
16
+ export * from './dailyrate';
@@ -49,6 +49,14 @@ export class ModelWithCustomPKRelation extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class NameFilterCustomPKModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class Order extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class OrderItem extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class Product extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class ProductCategory extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class RatePlanQuerySet extends QuerySet<any> {
5
+ constructor(ModelClass: ModelConstructor, config?: {
6
+ nodes?: QueryNode[] | undefined;
7
+ orderBy?: {
8
+ field: string;
9
+ direction: "asc" | "desc";
10
+ }[] | undefined;
11
+ fields?: Set<string> | undefined;
12
+ aggregations?: Aggregation[] | undefined;
13
+ initialQueryset?: string | undefined;
14
+ serializerOptions?: SerializerOptions;
15
+ materialized?: boolean | undefined;
16
+ } | undefined, parent?: null);
17
+ }
18
+ /**
19
+ * Model-specific Manager implementation
20
+ */
21
+ export class RatePlanManager extends Manager {
22
+ constructor(ModelClass: any);
23
+ }
24
+ /**
25
+ * Implementation of the RatePlan model
26
+ */
27
+ export class RatePlan extends Model {
28
+ static configKey: string;
29
+ static modelName: string;
30
+ static primaryKeyField: string;
31
+ static objects: RatePlanManager;
32
+ static fields: string[];
33
+ static schema: any;
34
+ static relationshipFields: Map<any, any>;
35
+ constructor(data: any);
36
+ /**
37
+ * Define property getters and setters for all model fields
38
+ * @private
39
+ */
40
+ private _defineProperties;
41
+ }
42
+ import { QuerySet } from '../../../../src';
43
+ import { Manager } from '../../../../src';
44
+ import { Model } from '../../../../src';
@@ -0,0 +1,69 @@
1
+ /**
2
+ * This file was auto-generated. Do not make direct changes to the file.
3
+ */
4
+ import { Model, Manager, QuerySet, getModelClass } from '../../../../src';
5
+ import { wrapReactiveModel } from '../../../../src';
6
+ import schemaData from './rateplan.schema.json';
7
+ /**
8
+ * Model-specific QuerySet implementation
9
+ */
10
+ export class RatePlanQuerySet extends QuerySet {
11
+ }
12
+ /**
13
+ * Model-specific Manager implementation
14
+ */
15
+ export class RatePlanManager extends Manager {
16
+ constructor(ModelClass) {
17
+ super(ModelClass, RatePlanQuerySet);
18
+ }
19
+ newQuerySet() {
20
+ return new RatePlanQuerySet(this.ModelClass);
21
+ }
22
+ }
23
+ /**
24
+ * Implementation of the RatePlan model
25
+ */
26
+ export class RatePlan extends Model {
27
+ constructor(data) {
28
+ RatePlan.validateFields(data);
29
+ super(data);
30
+ // Define getters and setters for all fields
31
+ this._defineProperties();
32
+ return wrapReactiveModel(this);
33
+ }
34
+ /**
35
+ * Define property getters and setters for all model fields
36
+ * @private
37
+ */
38
+ _defineProperties() {
39
+ // For each field, define a property that gets/sets from internal storage
40
+ RatePlan.fields.forEach(field => {
41
+ Object.defineProperty(this, field, {
42
+ get: function () {
43
+ return this.getField(field);
44
+ },
45
+ set: function (value) {
46
+ this.setField(field, value);
47
+ },
48
+ enumerable: true, // Make sure fields are enumerable for serialization
49
+ configurable: true
50
+ });
51
+ });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
60
+ }
61
+ }
62
+ // Bind this model to its backend
63
+ RatePlan.configKey = 'backend1';
64
+ RatePlan.modelName = 'django_app.rateplan';
65
+ RatePlan.primaryKeyField = 'id';
66
+ RatePlan.objects = new RatePlanManager(RatePlan);
67
+ RatePlan.fields = ['id', 'name'];
68
+ RatePlan.schema = schemaData;
69
+ RatePlan.relationshipFields = new Map([]);
@@ -49,6 +49,14 @@ export class ComprehensiveModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -49,6 +49,14 @@ export class CustomPKModel extends Model {
49
49
  configurable: true
50
50
  });
51
51
  });
52
+ // Add a special read-only getter for the repr field
53
+ Object.defineProperty(this, 'repr', {
54
+ get: function () {
55
+ return this.getField('repr');
56
+ },
57
+ enumerable: true, // Make sure repr is enumerable
58
+ configurable: true
59
+ });
52
60
  }
53
61
  }
54
62
  // Bind this model to its backend
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class DailyRateQuerySet extends QuerySet<any> {
5
+ constructor(ModelClass: ModelConstructor, config?: {
6
+ nodes?: QueryNode[] | undefined;
7
+ orderBy?: {
8
+ field: string;
9
+ direction: "asc" | "desc";
10
+ }[] | undefined;
11
+ fields?: Set<string> | undefined;
12
+ aggregations?: Aggregation[] | undefined;
13
+ initialQueryset?: string | undefined;
14
+ serializerOptions?: SerializerOptions;
15
+ materialized?: boolean | undefined;
16
+ } | undefined, parent?: null);
17
+ }
18
+ /**
19
+ * Model-specific Manager implementation
20
+ */
21
+ export class DailyRateManager extends Manager {
22
+ constructor(ModelClass: any);
23
+ }
24
+ /**
25
+ * Implementation of the DailyRate model
26
+ */
27
+ export class DailyRate extends Model {
28
+ static configKey: string;
29
+ static modelName: string;
30
+ static primaryKeyField: string;
31
+ static objects: DailyRateManager;
32
+ static fields: string[];
33
+ static schema: any;
34
+ static relationshipFields: Map<string, {
35
+ ModelClass: () => Function | null;
36
+ relationshipType: string;
37
+ }>;
38
+ constructor(data: any);
39
+ /**
40
+ * Define property getters and setters for all model fields
41
+ * @private
42
+ */
43
+ private _defineProperties;
44
+ }
45
+ import { QuerySet } from '../../../../src';
46
+ import { Manager } from '../../../../src';
47
+ import { Model } from '../../../../src';