@statezero/core 0.2.21 → 0.2.23

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 (173) hide show
  1. package/dist/actions/backend1/django_app/calculate-hash.d.ts +57 -0
  2. package/dist/actions/backend1/django_app/calculate-hash.js +80 -0
  3. package/dist/actions/backend1/django_app/calculate-hash.schema.json +148 -0
  4. package/dist/actions/backend1/django_app/get-current-username.d.ts +29 -0
  5. package/dist/actions/backend1/django_app/get-current-username.js +65 -0
  6. package/dist/actions/backend1/django_app/get-current-username.schema.json +47 -0
  7. package/dist/actions/backend1/django_app/get-server-status.d.ts +38 -0
  8. package/dist/actions/backend1/django_app/get-server-status.js +68 -0
  9. package/dist/actions/backend1/django_app/get-server-status.schema.json +93 -0
  10. package/dist/actions/backend1/django_app/get-user-info.d.ts +44 -0
  11. package/dist/actions/backend1/django_app/get-user-info.js +70 -0
  12. package/dist/actions/backend1/django_app/get-user-info.schema.json +127 -0
  13. package/dist/actions/backend1/django_app/index.d.ts +1 -0
  14. package/dist/actions/backend1/django_app/index.js +6 -0
  15. package/dist/actions/backend1/django_app/process-data.d.ts +51 -0
  16. package/dist/actions/backend1/django_app/process-data.js +78 -0
  17. package/dist/actions/backend1/django_app/process-data.schema.json +117 -0
  18. package/dist/actions/backend1/django_app/send-notification.d.ts +55 -0
  19. package/dist/actions/backend1/django_app/send-notification.js +81 -0
  20. package/dist/actions/backend1/django_app/send-notification.schema.json +175 -0
  21. package/dist/actions/backend1/index.d.ts +1 -0
  22. package/dist/actions/backend1/index.js +1 -0
  23. package/dist/actions/default/django_app/calculate-hash.d.ts +57 -0
  24. package/dist/actions/default/django_app/calculate-hash.js +80 -0
  25. package/dist/actions/default/django_app/calculate-hash.schema.json +148 -0
  26. package/dist/actions/default/django_app/get-current-username.d.ts +29 -0
  27. package/dist/actions/default/django_app/get-current-username.js +65 -0
  28. package/dist/actions/default/django_app/get-current-username.schema.json +47 -0
  29. package/dist/actions/default/django_app/get-server-status.d.ts +38 -0
  30. package/dist/actions/default/django_app/get-server-status.js +68 -0
  31. package/dist/actions/default/django_app/get-server-status.schema.json +93 -0
  32. package/dist/actions/default/django_app/get-user-info.d.ts +44 -0
  33. package/dist/actions/default/django_app/get-user-info.js +70 -0
  34. package/dist/actions/default/django_app/get-user-info.schema.json +127 -0
  35. package/dist/actions/default/django_app/index.d.ts +1 -0
  36. package/dist/actions/default/django_app/index.js +6 -0
  37. package/dist/actions/default/django_app/process-data.d.ts +51 -0
  38. package/dist/actions/default/django_app/process-data.js +78 -0
  39. package/dist/actions/default/django_app/process-data.schema.json +117 -0
  40. package/dist/actions/default/django_app/send-notification.d.ts +55 -0
  41. package/dist/actions/default/django_app/send-notification.js +81 -0
  42. package/dist/actions/default/django_app/send-notification.schema.json +175 -0
  43. package/dist/actions/default/index.d.ts +1 -0
  44. package/dist/actions/default/index.js +1 -0
  45. package/dist/actions/index.d.ts +1 -0
  46. package/dist/actions/index.js +5 -0
  47. package/dist/flavours/django/dates.js +4 -1
  48. package/dist/flavours/django/querySet.js +0 -1
  49. package/dist/flavours/django/serializers.js +8 -4
  50. package/dist/models/backend1/django_app/comprehensivemodel.d.ts +894 -0
  51. package/dist/models/backend1/django_app/comprehensivemodel.js +71 -0
  52. package/dist/models/backend1/django_app/comprehensivemodel.schema.json +870 -0
  53. package/dist/models/backend1/django_app/custompkmodel.d.ts +92 -0
  54. package/dist/models/backend1/django_app/custompkmodel.js +69 -0
  55. package/dist/models/backend1/django_app/custompkmodel.schema.json +71 -0
  56. package/dist/models/backend1/django_app/dailyrate.d.ts +230 -0
  57. package/dist/models/backend1/django_app/dailyrate.js +71 -0
  58. package/dist/models/backend1/django_app/dailyrate.schema.json +212 -0
  59. package/dist/models/backend1/django_app/deepmodellevel1.d.ts +140 -0
  60. package/dist/models/backend1/django_app/deepmodellevel1.js +72 -0
  61. package/dist/models/backend1/django_app/deepmodellevel1.schema.json +114 -0
  62. package/dist/models/backend1/django_app/deepmodellevel2.d.ts +118 -0
  63. package/dist/models/backend1/django_app/deepmodellevel2.js +71 -0
  64. package/dist/models/backend1/django_app/deepmodellevel2.schema.json +92 -0
  65. package/dist/models/backend1/django_app/deepmodellevel3.d.ts +92 -0
  66. package/dist/models/backend1/django_app/deepmodellevel3.js +69 -0
  67. package/dist/models/backend1/django_app/deepmodellevel3.schema.json +69 -0
  68. package/dist/models/backend1/django_app/dummymodel.d.ts +134 -0
  69. package/dist/models/backend1/django_app/dummymodel.js +71 -0
  70. package/dist/models/backend1/django_app/dummymodel.schema.json +109 -0
  71. package/dist/models/backend1/django_app/dummyrelatedmodel.d.ts +92 -0
  72. package/dist/models/backend1/django_app/dummyrelatedmodel.js +69 -0
  73. package/dist/models/backend1/django_app/dummyrelatedmodel.schema.json +69 -0
  74. package/dist/models/backend1/django_app/filetest.d.ts +140 -0
  75. package/dist/models/backend1/django_app/filetest.js +69 -0
  76. package/dist/models/backend1/django_app/filetest.schema.json +111 -0
  77. package/dist/models/backend1/django_app/index.d.ts +1 -0
  78. package/dist/models/backend1/django_app/index.js +18 -0
  79. package/dist/models/backend1/django_app/modelwithcustompkrelation.d.ts +118 -0
  80. package/dist/models/backend1/django_app/modelwithcustompkrelation.js +71 -0
  81. package/dist/models/backend1/django_app/modelwithcustompkrelation.schema.json +93 -0
  82. package/dist/models/backend1/django_app/modelwithrestrictedfields.d.ts +134 -0
  83. package/dist/models/backend1/django_app/modelwithrestrictedfields.js +71 -0
  84. package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +111 -0
  85. package/dist/models/backend1/django_app/namefiltercustompkmodel.d.ts +92 -0
  86. package/dist/models/backend1/django_app/namefiltercustompkmodel.js +69 -0
  87. package/dist/models/backend1/django_app/namefiltercustompkmodel.schema.json +71 -0
  88. package/dist/models/backend1/django_app/order.d.ts +220 -0
  89. package/dist/models/backend1/django_app/order.js +71 -0
  90. package/dist/models/backend1/django_app/order.schema.json +203 -0
  91. package/dist/models/backend1/django_app/orderitem.d.ts +172 -0
  92. package/dist/models/backend1/django_app/orderitem.js +72 -0
  93. package/dist/models/backend1/django_app/orderitem.schema.json +149 -0
  94. package/dist/models/backend1/django_app/product.d.ts +254 -0
  95. package/dist/models/backend1/django_app/product.js +71 -0
  96. package/dist/models/backend1/django_app/product.schema.json +277 -0
  97. package/dist/models/backend1/django_app/productcategory.d.ts +92 -0
  98. package/dist/models/backend1/django_app/productcategory.js +69 -0
  99. package/dist/models/backend1/django_app/productcategory.schema.json +70 -0
  100. package/dist/models/backend1/django_app/rateplan.d.ts +92 -0
  101. package/dist/models/backend1/django_app/rateplan.js +69 -0
  102. package/dist/models/backend1/django_app/rateplan.schema.json +70 -0
  103. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
  104. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.js +69 -0
  105. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
  106. package/dist/models/backend1/fileobject.d.ts +4 -0
  107. package/dist/models/backend1/fileobject.js +9 -0
  108. package/dist/models/backend1/index.d.ts +2 -0
  109. package/dist/models/backend1/index.js +2 -0
  110. package/dist/models/default/django_app/comprehensivemodel.d.ts +894 -0
  111. package/dist/models/default/django_app/comprehensivemodel.js +71 -0
  112. package/dist/models/default/django_app/comprehensivemodel.schema.json +870 -0
  113. package/dist/models/default/django_app/custompkmodel.d.ts +92 -0
  114. package/dist/models/default/django_app/custompkmodel.js +69 -0
  115. package/dist/models/default/django_app/custompkmodel.schema.json +71 -0
  116. package/dist/models/default/django_app/dailyrate.d.ts +230 -0
  117. package/dist/models/default/django_app/dailyrate.js +71 -0
  118. package/dist/models/default/django_app/dailyrate.schema.json +212 -0
  119. package/dist/models/default/django_app/deepmodellevel1.d.ts +128 -0
  120. package/dist/models/default/django_app/deepmodellevel1.js +72 -0
  121. package/dist/models/default/django_app/deepmodellevel1.schema.json +102 -0
  122. package/dist/models/default/django_app/deepmodellevel2.d.ts +106 -0
  123. package/dist/models/default/django_app/deepmodellevel2.js +71 -0
  124. package/dist/models/default/django_app/deepmodellevel2.schema.json +80 -0
  125. package/dist/models/default/django_app/deepmodellevel3.d.ts +80 -0
  126. package/dist/models/default/django_app/deepmodellevel3.js +69 -0
  127. package/dist/models/default/django_app/deepmodellevel3.schema.json +57 -0
  128. package/dist/models/default/django_app/dummymodel.d.ts +122 -0
  129. package/dist/models/default/django_app/dummymodel.js +71 -0
  130. package/dist/models/default/django_app/dummymodel.schema.json +97 -0
  131. package/dist/models/default/django_app/dummyrelatedmodel.d.ts +80 -0
  132. package/dist/models/default/django_app/dummyrelatedmodel.js +69 -0
  133. package/dist/models/default/django_app/dummyrelatedmodel.schema.json +57 -0
  134. package/dist/models/default/django_app/filetest.d.ts +128 -0
  135. package/dist/models/default/django_app/filetest.js +69 -0
  136. package/dist/models/default/django_app/filetest.schema.json +99 -0
  137. package/dist/models/default/django_app/index.d.ts +1 -0
  138. package/dist/models/default/django_app/index.js +18 -0
  139. package/dist/models/default/django_app/modelwithcustompkrelation.d.ts +118 -0
  140. package/dist/models/default/django_app/modelwithcustompkrelation.js +71 -0
  141. package/dist/models/default/django_app/modelwithcustompkrelation.schema.json +93 -0
  142. package/dist/models/default/django_app/modelwithrestrictedfields.d.ts +134 -0
  143. package/dist/models/default/django_app/modelwithrestrictedfields.js +71 -0
  144. package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +111 -0
  145. package/dist/models/default/django_app/namefiltercustompkmodel.d.ts +92 -0
  146. package/dist/models/default/django_app/namefiltercustompkmodel.js +69 -0
  147. package/dist/models/default/django_app/namefiltercustompkmodel.schema.json +71 -0
  148. package/dist/models/default/django_app/order.d.ts +220 -0
  149. package/dist/models/default/django_app/order.js +71 -0
  150. package/dist/models/default/django_app/order.schema.json +203 -0
  151. package/dist/models/default/django_app/orderitem.d.ts +172 -0
  152. package/dist/models/default/django_app/orderitem.js +72 -0
  153. package/dist/models/default/django_app/orderitem.schema.json +149 -0
  154. package/dist/models/default/django_app/product.d.ts +254 -0
  155. package/dist/models/default/django_app/product.js +71 -0
  156. package/dist/models/default/django_app/product.schema.json +277 -0
  157. package/dist/models/default/django_app/productcategory.d.ts +92 -0
  158. package/dist/models/default/django_app/productcategory.js +69 -0
  159. package/dist/models/default/django_app/productcategory.schema.json +70 -0
  160. package/dist/models/default/django_app/rateplan.d.ts +92 -0
  161. package/dist/models/default/django_app/rateplan.js +69 -0
  162. package/dist/models/default/django_app/rateplan.schema.json +70 -0
  163. package/dist/models/default/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
  164. package/dist/models/default/django_app/restrictedfieldrelatedmodel.js +69 -0
  165. package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
  166. package/dist/models/default/fileobject.d.ts +4 -0
  167. package/dist/models/default/fileobject.js +9 -0
  168. package/dist/models/default/index.d.ts +2 -0
  169. package/dist/models/default/index.js +2 -0
  170. package/dist/models/index.d.ts +1 -0
  171. package/dist/models/index.js +5 -0
  172. package/dist/syncEngine/cache/cache.js +15 -1
  173. package/package.json +1 -1
@@ -0,0 +1,212 @@
1
+ {
2
+ "model_name": "django_app.dailyrate",
3
+ "title": "Daily Rate",
4
+ "class_name": "DailyRate",
5
+ "plural_title": "Daily Rates",
6
+ "primary_key_field": "id",
7
+ "filterable_fields": [
8
+ "rate_plan",
9
+ "closed_to_departure",
10
+ "min_stay_arrival",
11
+ "min_stay_through",
12
+ "stop_sell",
13
+ "price",
14
+ "date",
15
+ "max_stay",
16
+ "closed_to_arrival",
17
+ "id"
18
+ ],
19
+ "searchable_fields": [],
20
+ "ordering_fields": [
21
+ "rate_plan",
22
+ "date"
23
+ ],
24
+ "properties": {
25
+ "id": {
26
+ "type": "integer",
27
+ "title": "Id",
28
+ "required": true,
29
+ "description": null,
30
+ "nullable": false,
31
+ "format": "id",
32
+ "max_length": null,
33
+ "choices": null,
34
+ "default": null,
35
+ "validators": [],
36
+ "max_digits": null,
37
+ "decimal_places": null,
38
+ "read_only": true,
39
+ "ref": null
40
+ },
41
+ "rate_plan": {
42
+ "type": "integer",
43
+ "title": "Rate plan",
44
+ "required": true,
45
+ "description": null,
46
+ "nullable": false,
47
+ "format": "foreign-key",
48
+ "max_length": null,
49
+ "choices": null,
50
+ "default": null,
51
+ "validators": [],
52
+ "max_digits": null,
53
+ "decimal_places": null,
54
+ "read_only": false,
55
+ "ref": null
56
+ },
57
+ "date": {
58
+ "type": "string",
59
+ "title": "Date",
60
+ "required": true,
61
+ "description": null,
62
+ "nullable": false,
63
+ "format": "date",
64
+ "max_length": null,
65
+ "choices": null,
66
+ "default": null,
67
+ "validators": [],
68
+ "max_digits": null,
69
+ "decimal_places": null,
70
+ "read_only": false,
71
+ "ref": null
72
+ },
73
+ "price": {
74
+ "type": "number",
75
+ "title": "Price",
76
+ "required": false,
77
+ "description": null,
78
+ "nullable": true,
79
+ "format": "decimal",
80
+ "max_length": null,
81
+ "choices": null,
82
+ "default": null,
83
+ "validators": [],
84
+ "max_digits": 10,
85
+ "decimal_places": 2,
86
+ "read_only": false,
87
+ "ref": null
88
+ },
89
+ "min_stay_arrival": {
90
+ "type": "integer",
91
+ "title": "Min stay arrival",
92
+ "required": false,
93
+ "description": null,
94
+ "nullable": true,
95
+ "format": null,
96
+ "max_length": null,
97
+ "choices": null,
98
+ "default": null,
99
+ "validators": [],
100
+ "max_digits": null,
101
+ "decimal_places": null,
102
+ "read_only": false,
103
+ "ref": null
104
+ },
105
+ "min_stay_through": {
106
+ "type": "integer",
107
+ "title": "Min stay through",
108
+ "required": false,
109
+ "description": null,
110
+ "nullable": true,
111
+ "format": null,
112
+ "max_length": null,
113
+ "choices": null,
114
+ "default": null,
115
+ "validators": [],
116
+ "max_digits": null,
117
+ "decimal_places": null,
118
+ "read_only": false,
119
+ "ref": null
120
+ },
121
+ "max_stay": {
122
+ "type": "integer",
123
+ "title": "Max stay",
124
+ "required": false,
125
+ "description": null,
126
+ "nullable": true,
127
+ "format": null,
128
+ "max_length": null,
129
+ "choices": null,
130
+ "default": null,
131
+ "validators": [],
132
+ "max_digits": null,
133
+ "decimal_places": null,
134
+ "read_only": false,
135
+ "ref": null
136
+ },
137
+ "closed_to_arrival": {
138
+ "type": "boolean",
139
+ "title": "Closed to arrival",
140
+ "required": false,
141
+ "description": null,
142
+ "nullable": false,
143
+ "format": null,
144
+ "max_length": null,
145
+ "choices": null,
146
+ "default": false,
147
+ "validators": [],
148
+ "max_digits": null,
149
+ "decimal_places": null,
150
+ "read_only": false,
151
+ "ref": null
152
+ },
153
+ "closed_to_departure": {
154
+ "type": "boolean",
155
+ "title": "Closed to departure",
156
+ "required": false,
157
+ "description": null,
158
+ "nullable": false,
159
+ "format": null,
160
+ "max_length": null,
161
+ "choices": null,
162
+ "default": false,
163
+ "validators": [],
164
+ "max_digits": null,
165
+ "decimal_places": null,
166
+ "read_only": false,
167
+ "ref": null
168
+ },
169
+ "stop_sell": {
170
+ "type": "boolean",
171
+ "title": "Stop sell",
172
+ "required": false,
173
+ "description": null,
174
+ "nullable": false,
175
+ "format": null,
176
+ "max_length": null,
177
+ "choices": null,
178
+ "default": false,
179
+ "validators": [],
180
+ "max_digits": null,
181
+ "decimal_places": null,
182
+ "read_only": false,
183
+ "ref": null
184
+ }
185
+ },
186
+ "relationships": {
187
+ "rate_plan": {
188
+ "type": "foreign-key",
189
+ "model": "django_app.rateplan",
190
+ "class_name": "RatePlan",
191
+ "primary_key_field": "id"
192
+ }
193
+ },
194
+ "default_ordering": null,
195
+ "definitions": {
196
+ "MoneyField": {
197
+ "type": "object",
198
+ "properties": {
199
+ "amount": {
200
+ "type": "number"
201
+ },
202
+ "currency": {
203
+ "type": "string"
204
+ }
205
+ }
206
+ }
207
+ },
208
+ "datetime_format": "iso-8601",
209
+ "date_format": "iso-8601",
210
+ "time_format": "iso-8601",
211
+ "display": null
212
+ }
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class DeepModelLevel1QuerySet {
5
+ }
6
+ /**
7
+ * Model-specific Manager implementation
8
+ */
9
+ export class DeepModelLevel1Manager {
10
+ constructor(ModelClass: any);
11
+ newQuerySet(): DeepModelLevel1QuerySet;
12
+ }
13
+ /**
14
+ * Implementation of the DeepModelLevel1 model
15
+ */
16
+ export class DeepModelLevel1 {
17
+ static configKey: string;
18
+ static modelName: string;
19
+ static primaryKeyField: string;
20
+ static objects: DeepModelLevel1Manager;
21
+ static fields: string[];
22
+ static schema: {
23
+ model_name: string;
24
+ title: string;
25
+ class_name: string;
26
+ plural_title: string;
27
+ primary_key_field: string;
28
+ filterable_fields: string[];
29
+ searchable_fields: string[];
30
+ ordering_fields: string[];
31
+ properties: {
32
+ id: {
33
+ type: string;
34
+ title: string;
35
+ required: boolean;
36
+ description: null;
37
+ nullable: boolean;
38
+ format: string;
39
+ max_length: null;
40
+ choices: null;
41
+ default: null;
42
+ validators: never[];
43
+ max_digits: null;
44
+ decimal_places: null;
45
+ read_only: boolean;
46
+ ref: null;
47
+ };
48
+ name: {
49
+ type: string;
50
+ title: string;
51
+ required: boolean;
52
+ description: null;
53
+ nullable: boolean;
54
+ format: null;
55
+ max_length: number;
56
+ choices: null;
57
+ default: null;
58
+ validators: never[];
59
+ max_digits: null;
60
+ decimal_places: null;
61
+ read_only: boolean;
62
+ ref: null;
63
+ };
64
+ level2: {
65
+ type: string;
66
+ title: string;
67
+ required: boolean;
68
+ description: null;
69
+ nullable: boolean;
70
+ format: string;
71
+ max_length: null;
72
+ choices: null;
73
+ default: null;
74
+ validators: never[];
75
+ max_digits: null;
76
+ decimal_places: null;
77
+ read_only: boolean;
78
+ ref: null;
79
+ };
80
+ comprehensive_models: {
81
+ type: string;
82
+ title: string;
83
+ required: boolean;
84
+ description: null;
85
+ nullable: boolean;
86
+ format: string;
87
+ max_length: null;
88
+ choices: null;
89
+ default: null;
90
+ validators: never[];
91
+ max_digits: null;
92
+ decimal_places: null;
93
+ read_only: boolean;
94
+ ref: null;
95
+ };
96
+ };
97
+ relationships: {
98
+ level2: {
99
+ type: string;
100
+ model: string;
101
+ class_name: string;
102
+ primary_key_field: string;
103
+ };
104
+ comprehensive_models: {
105
+ type: string;
106
+ model: string;
107
+ class_name: string;
108
+ primary_key_field: string;
109
+ };
110
+ };
111
+ default_ordering: null;
112
+ definitions: {};
113
+ datetime_format: string;
114
+ date_format: string;
115
+ time_format: string;
116
+ display: null;
117
+ };
118
+ static relationshipFields: Map<string, {
119
+ ModelClass: () => any;
120
+ relationshipType: string;
121
+ }>;
122
+ constructor(data: any);
123
+ /**
124
+ * Define property getters and setters for all model fields
125
+ * @private
126
+ */
127
+ private _defineProperties;
128
+ }
@@ -0,0 +1,72 @@
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 './deepmodellevel1.schema.json';
7
+ /**
8
+ * Model-specific QuerySet implementation
9
+ */
10
+ export class DeepModelLevel1QuerySet extends QuerySet {
11
+ }
12
+ /**
13
+ * Model-specific Manager implementation
14
+ */
15
+ export class DeepModelLevel1Manager extends Manager {
16
+ constructor(ModelClass) {
17
+ super(ModelClass, DeepModelLevel1QuerySet);
18
+ }
19
+ newQuerySet() {
20
+ return new DeepModelLevel1QuerySet(this.ModelClass);
21
+ }
22
+ }
23
+ /**
24
+ * Implementation of the DeepModelLevel1 model
25
+ */
26
+ export class DeepModelLevel1 extends Model {
27
+ constructor(data) {
28
+ DeepModelLevel1.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
+ DeepModelLevel1.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
+ DeepModelLevel1.configKey = 'default';
64
+ DeepModelLevel1.modelName = 'django_app.deepmodellevel1';
65
+ DeepModelLevel1.primaryKeyField = 'id';
66
+ DeepModelLevel1.objects = new DeepModelLevel1Manager(DeepModelLevel1);
67
+ DeepModelLevel1.fields = ['id', 'name', 'level2', 'comprehensive_models'];
68
+ DeepModelLevel1.schema = schemaData;
69
+ DeepModelLevel1.relationshipFields = new Map([
70
+ ['level2', { 'ModelClass': () => getModelClass('django_app.deepmodellevel2', 'default'), 'relationshipType': 'foreign-key' }],
71
+ ['comprehensive_models', { 'ModelClass': () => getModelClass('django_app.comprehensivemodel', 'default'), 'relationshipType': 'many-to-many' }]
72
+ ]);
@@ -0,0 +1,102 @@
1
+ {
2
+ "model_name": "django_app.deepmodellevel1",
3
+ "title": "Deep Model Level1",
4
+ "class_name": "DeepModelLevel1",
5
+ "plural_title": "Deep Model Level1S",
6
+ "primary_key_field": "id",
7
+ "filterable_fields": [
8
+ "name"
9
+ ],
10
+ "searchable_fields": [
11
+ "name"
12
+ ],
13
+ "ordering_fields": [
14
+ "name"
15
+ ],
16
+ "properties": {
17
+ "id": {
18
+ "type": "integer",
19
+ "title": "Id",
20
+ "required": true,
21
+ "description": null,
22
+ "nullable": false,
23
+ "format": "id",
24
+ "max_length": null,
25
+ "choices": null,
26
+ "default": null,
27
+ "validators": [],
28
+ "max_digits": null,
29
+ "decimal_places": null,
30
+ "read_only": true,
31
+ "ref": null
32
+ },
33
+ "name": {
34
+ "type": "string",
35
+ "title": "Name",
36
+ "required": true,
37
+ "description": null,
38
+ "nullable": false,
39
+ "format": null,
40
+ "max_length": 100,
41
+ "choices": null,
42
+ "default": null,
43
+ "validators": [],
44
+ "max_digits": null,
45
+ "decimal_places": null,
46
+ "read_only": false,
47
+ "ref": null
48
+ },
49
+ "level2": {
50
+ "type": "integer",
51
+ "title": "Level2",
52
+ "required": true,
53
+ "description": null,
54
+ "nullable": false,
55
+ "format": "foreign-key",
56
+ "max_length": null,
57
+ "choices": null,
58
+ "default": null,
59
+ "validators": [],
60
+ "max_digits": null,
61
+ "decimal_places": null,
62
+ "read_only": false,
63
+ "ref": null
64
+ },
65
+ "comprehensive_models": {
66
+ "type": "array",
67
+ "title": "Comprehensive models",
68
+ "required": true,
69
+ "description": null,
70
+ "nullable": false,
71
+ "format": "many-to-many",
72
+ "max_length": null,
73
+ "choices": null,
74
+ "default": null,
75
+ "validators": [],
76
+ "max_digits": null,
77
+ "decimal_places": null,
78
+ "read_only": false,
79
+ "ref": null
80
+ }
81
+ },
82
+ "relationships": {
83
+ "level2": {
84
+ "type": "foreign-key",
85
+ "model": "django_app.deepmodellevel2",
86
+ "class_name": "DeepModelLevel2",
87
+ "primary_key_field": "id"
88
+ },
89
+ "comprehensive_models": {
90
+ "type": "many-to-many",
91
+ "model": "django_app.comprehensivemodel",
92
+ "class_name": "ComprehensiveModel",
93
+ "primary_key_field": "id"
94
+ }
95
+ },
96
+ "default_ordering": null,
97
+ "definitions": {},
98
+ "datetime_format": "iso-8601",
99
+ "date_format": "iso-8601",
100
+ "time_format": "iso-8601",
101
+ "display": null
102
+ }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class DeepModelLevel2QuerySet {
5
+ }
6
+ /**
7
+ * Model-specific Manager implementation
8
+ */
9
+ export class DeepModelLevel2Manager {
10
+ constructor(ModelClass: any);
11
+ newQuerySet(): DeepModelLevel2QuerySet;
12
+ }
13
+ /**
14
+ * Implementation of the DeepModelLevel2 model
15
+ */
16
+ export class DeepModelLevel2 {
17
+ static configKey: string;
18
+ static modelName: string;
19
+ static primaryKeyField: string;
20
+ static objects: DeepModelLevel2Manager;
21
+ static fields: string[];
22
+ static schema: {
23
+ model_name: string;
24
+ title: string;
25
+ class_name: string;
26
+ plural_title: string;
27
+ primary_key_field: string;
28
+ filterable_fields: string[];
29
+ searchable_fields: string[];
30
+ ordering_fields: string[];
31
+ properties: {
32
+ id: {
33
+ type: string;
34
+ title: string;
35
+ required: boolean;
36
+ description: null;
37
+ nullable: boolean;
38
+ format: string;
39
+ max_length: null;
40
+ choices: null;
41
+ default: null;
42
+ validators: never[];
43
+ max_digits: null;
44
+ decimal_places: null;
45
+ read_only: boolean;
46
+ ref: null;
47
+ };
48
+ name: {
49
+ type: string;
50
+ title: string;
51
+ required: boolean;
52
+ description: null;
53
+ nullable: boolean;
54
+ format: null;
55
+ max_length: number;
56
+ choices: null;
57
+ default: null;
58
+ validators: never[];
59
+ max_digits: null;
60
+ decimal_places: null;
61
+ read_only: boolean;
62
+ ref: null;
63
+ };
64
+ level3: {
65
+ type: string;
66
+ title: string;
67
+ required: boolean;
68
+ description: null;
69
+ nullable: boolean;
70
+ format: string;
71
+ max_length: null;
72
+ choices: null;
73
+ default: null;
74
+ validators: never[];
75
+ max_digits: null;
76
+ decimal_places: null;
77
+ read_only: boolean;
78
+ ref: null;
79
+ };
80
+ };
81
+ relationships: {
82
+ level3: {
83
+ type: string;
84
+ model: string;
85
+ class_name: string;
86
+ primary_key_field: string;
87
+ };
88
+ };
89
+ default_ordering: null;
90
+ definitions: {};
91
+ datetime_format: string;
92
+ date_format: string;
93
+ time_format: string;
94
+ display: null;
95
+ };
96
+ static relationshipFields: Map<string, {
97
+ ModelClass: () => any;
98
+ relationshipType: string;
99
+ }>;
100
+ constructor(data: any);
101
+ /**
102
+ * Define property getters and setters for all model fields
103
+ * @private
104
+ */
105
+ private _defineProperties;
106
+ }
@@ -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 './deepmodellevel2.schema.json';
7
+ /**
8
+ * Model-specific QuerySet implementation
9
+ */
10
+ export class DeepModelLevel2QuerySet extends QuerySet {
11
+ }
12
+ /**
13
+ * Model-specific Manager implementation
14
+ */
15
+ export class DeepModelLevel2Manager extends Manager {
16
+ constructor(ModelClass) {
17
+ super(ModelClass, DeepModelLevel2QuerySet);
18
+ }
19
+ newQuerySet() {
20
+ return new DeepModelLevel2QuerySet(this.ModelClass);
21
+ }
22
+ }
23
+ /**
24
+ * Implementation of the DeepModelLevel2 model
25
+ */
26
+ export class DeepModelLevel2 extends Model {
27
+ constructor(data) {
28
+ DeepModelLevel2.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
+ DeepModelLevel2.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
+ DeepModelLevel2.configKey = 'default';
64
+ DeepModelLevel2.modelName = 'django_app.deepmodellevel2';
65
+ DeepModelLevel2.primaryKeyField = 'id';
66
+ DeepModelLevel2.objects = new DeepModelLevel2Manager(DeepModelLevel2);
67
+ DeepModelLevel2.fields = ['id', 'name', 'level3'];
68
+ DeepModelLevel2.schema = schemaData;
69
+ DeepModelLevel2.relationshipFields = new Map([
70
+ ['level3', { 'ModelClass': () => getModelClass('django_app.deepmodellevel3', 'default'), 'relationshipType': 'foreign-key' }]
71
+ ]);