@statezero/core 0.2.22 → 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 (171) 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/serializers.js +8 -4
  49. package/dist/models/backend1/django_app/comprehensivemodel.d.ts +894 -0
  50. package/dist/models/backend1/django_app/comprehensivemodel.js +71 -0
  51. package/dist/models/backend1/django_app/comprehensivemodel.schema.json +870 -0
  52. package/dist/models/backend1/django_app/custompkmodel.d.ts +92 -0
  53. package/dist/models/backend1/django_app/custompkmodel.js +69 -0
  54. package/dist/models/backend1/django_app/custompkmodel.schema.json +71 -0
  55. package/dist/models/backend1/django_app/dailyrate.d.ts +230 -0
  56. package/dist/models/backend1/django_app/dailyrate.js +71 -0
  57. package/dist/models/backend1/django_app/dailyrate.schema.json +212 -0
  58. package/dist/models/backend1/django_app/deepmodellevel1.d.ts +140 -0
  59. package/dist/models/backend1/django_app/deepmodellevel1.js +72 -0
  60. package/dist/models/backend1/django_app/deepmodellevel1.schema.json +114 -0
  61. package/dist/models/backend1/django_app/deepmodellevel2.d.ts +118 -0
  62. package/dist/models/backend1/django_app/deepmodellevel2.js +71 -0
  63. package/dist/models/backend1/django_app/deepmodellevel2.schema.json +92 -0
  64. package/dist/models/backend1/django_app/deepmodellevel3.d.ts +92 -0
  65. package/dist/models/backend1/django_app/deepmodellevel3.js +69 -0
  66. package/dist/models/backend1/django_app/deepmodellevel3.schema.json +69 -0
  67. package/dist/models/backend1/django_app/dummymodel.d.ts +134 -0
  68. package/dist/models/backend1/django_app/dummymodel.js +71 -0
  69. package/dist/models/backend1/django_app/dummymodel.schema.json +109 -0
  70. package/dist/models/backend1/django_app/dummyrelatedmodel.d.ts +92 -0
  71. package/dist/models/backend1/django_app/dummyrelatedmodel.js +69 -0
  72. package/dist/models/backend1/django_app/dummyrelatedmodel.schema.json +69 -0
  73. package/dist/models/backend1/django_app/filetest.d.ts +140 -0
  74. package/dist/models/backend1/django_app/filetest.js +69 -0
  75. package/dist/models/backend1/django_app/filetest.schema.json +111 -0
  76. package/dist/models/backend1/django_app/index.d.ts +1 -0
  77. package/dist/models/backend1/django_app/index.js +18 -0
  78. package/dist/models/backend1/django_app/modelwithcustompkrelation.d.ts +118 -0
  79. package/dist/models/backend1/django_app/modelwithcustompkrelation.js +71 -0
  80. package/dist/models/backend1/django_app/modelwithcustompkrelation.schema.json +93 -0
  81. package/dist/models/backend1/django_app/modelwithrestrictedfields.d.ts +134 -0
  82. package/dist/models/backend1/django_app/modelwithrestrictedfields.js +71 -0
  83. package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +111 -0
  84. package/dist/models/backend1/django_app/namefiltercustompkmodel.d.ts +92 -0
  85. package/dist/models/backend1/django_app/namefiltercustompkmodel.js +69 -0
  86. package/dist/models/backend1/django_app/namefiltercustompkmodel.schema.json +71 -0
  87. package/dist/models/backend1/django_app/order.d.ts +220 -0
  88. package/dist/models/backend1/django_app/order.js +71 -0
  89. package/dist/models/backend1/django_app/order.schema.json +203 -0
  90. package/dist/models/backend1/django_app/orderitem.d.ts +172 -0
  91. package/dist/models/backend1/django_app/orderitem.js +72 -0
  92. package/dist/models/backend1/django_app/orderitem.schema.json +149 -0
  93. package/dist/models/backend1/django_app/product.d.ts +254 -0
  94. package/dist/models/backend1/django_app/product.js +71 -0
  95. package/dist/models/backend1/django_app/product.schema.json +277 -0
  96. package/dist/models/backend1/django_app/productcategory.d.ts +92 -0
  97. package/dist/models/backend1/django_app/productcategory.js +69 -0
  98. package/dist/models/backend1/django_app/productcategory.schema.json +70 -0
  99. package/dist/models/backend1/django_app/rateplan.d.ts +92 -0
  100. package/dist/models/backend1/django_app/rateplan.js +69 -0
  101. package/dist/models/backend1/django_app/rateplan.schema.json +70 -0
  102. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
  103. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.js +69 -0
  104. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
  105. package/dist/models/backend1/fileobject.d.ts +4 -0
  106. package/dist/models/backend1/fileobject.js +9 -0
  107. package/dist/models/backend1/index.d.ts +2 -0
  108. package/dist/models/backend1/index.js +2 -0
  109. package/dist/models/default/django_app/comprehensivemodel.d.ts +894 -0
  110. package/dist/models/default/django_app/comprehensivemodel.js +71 -0
  111. package/dist/models/default/django_app/comprehensivemodel.schema.json +870 -0
  112. package/dist/models/default/django_app/custompkmodel.d.ts +92 -0
  113. package/dist/models/default/django_app/custompkmodel.js +69 -0
  114. package/dist/models/default/django_app/custompkmodel.schema.json +71 -0
  115. package/dist/models/default/django_app/dailyrate.d.ts +230 -0
  116. package/dist/models/default/django_app/dailyrate.js +71 -0
  117. package/dist/models/default/django_app/dailyrate.schema.json +212 -0
  118. package/dist/models/default/django_app/deepmodellevel1.d.ts +128 -0
  119. package/dist/models/default/django_app/deepmodellevel1.js +72 -0
  120. package/dist/models/default/django_app/deepmodellevel1.schema.json +102 -0
  121. package/dist/models/default/django_app/deepmodellevel2.d.ts +106 -0
  122. package/dist/models/default/django_app/deepmodellevel2.js +71 -0
  123. package/dist/models/default/django_app/deepmodellevel2.schema.json +80 -0
  124. package/dist/models/default/django_app/deepmodellevel3.d.ts +80 -0
  125. package/dist/models/default/django_app/deepmodellevel3.js +69 -0
  126. package/dist/models/default/django_app/deepmodellevel3.schema.json +57 -0
  127. package/dist/models/default/django_app/dummymodel.d.ts +122 -0
  128. package/dist/models/default/django_app/dummymodel.js +71 -0
  129. package/dist/models/default/django_app/dummymodel.schema.json +97 -0
  130. package/dist/models/default/django_app/dummyrelatedmodel.d.ts +80 -0
  131. package/dist/models/default/django_app/dummyrelatedmodel.js +69 -0
  132. package/dist/models/default/django_app/dummyrelatedmodel.schema.json +57 -0
  133. package/dist/models/default/django_app/filetest.d.ts +128 -0
  134. package/dist/models/default/django_app/filetest.js +69 -0
  135. package/dist/models/default/django_app/filetest.schema.json +99 -0
  136. package/dist/models/default/django_app/index.d.ts +1 -0
  137. package/dist/models/default/django_app/index.js +18 -0
  138. package/dist/models/default/django_app/modelwithcustompkrelation.d.ts +118 -0
  139. package/dist/models/default/django_app/modelwithcustompkrelation.js +71 -0
  140. package/dist/models/default/django_app/modelwithcustompkrelation.schema.json +93 -0
  141. package/dist/models/default/django_app/modelwithrestrictedfields.d.ts +134 -0
  142. package/dist/models/default/django_app/modelwithrestrictedfields.js +71 -0
  143. package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +111 -0
  144. package/dist/models/default/django_app/namefiltercustompkmodel.d.ts +92 -0
  145. package/dist/models/default/django_app/namefiltercustompkmodel.js +69 -0
  146. package/dist/models/default/django_app/namefiltercustompkmodel.schema.json +71 -0
  147. package/dist/models/default/django_app/order.d.ts +220 -0
  148. package/dist/models/default/django_app/order.js +71 -0
  149. package/dist/models/default/django_app/order.schema.json +203 -0
  150. package/dist/models/default/django_app/orderitem.d.ts +172 -0
  151. package/dist/models/default/django_app/orderitem.js +72 -0
  152. package/dist/models/default/django_app/orderitem.schema.json +149 -0
  153. package/dist/models/default/django_app/product.d.ts +254 -0
  154. package/dist/models/default/django_app/product.js +71 -0
  155. package/dist/models/default/django_app/product.schema.json +277 -0
  156. package/dist/models/default/django_app/productcategory.d.ts +92 -0
  157. package/dist/models/default/django_app/productcategory.js +69 -0
  158. package/dist/models/default/django_app/productcategory.schema.json +70 -0
  159. package/dist/models/default/django_app/rateplan.d.ts +92 -0
  160. package/dist/models/default/django_app/rateplan.js +69 -0
  161. package/dist/models/default/django_app/rateplan.schema.json +70 -0
  162. package/dist/models/default/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
  163. package/dist/models/default/django_app/restrictedfieldrelatedmodel.js +69 -0
  164. package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
  165. package/dist/models/default/fileobject.d.ts +4 -0
  166. package/dist/models/default/fileobject.js +9 -0
  167. package/dist/models/default/index.d.ts +2 -0
  168. package/dist/models/default/index.js +2 -0
  169. package/dist/models/index.d.ts +1 -0
  170. package/dist/models/index.js +5 -0
  171. package/package.json +1 -1
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class ModelWithCustomPKRelationQuerySet {
5
+ }
6
+ /**
7
+ * Model-specific Manager implementation
8
+ */
9
+ export class ModelWithCustomPKRelationManager {
10
+ constructor(ModelClass: any);
11
+ newQuerySet(): ModelWithCustomPKRelationQuerySet;
12
+ }
13
+ /**
14
+ * Implementation of the ModelWithCustomPKRelation model
15
+ */
16
+ export class ModelWithCustomPKRelation {
17
+ static configKey: string;
18
+ static modelName: string;
19
+ static primaryKeyField: string;
20
+ static objects: ModelWithCustomPKRelationManager;
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
+ custom_pk_related: {
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
+ custom_pk_related: {
83
+ type: string;
84
+ model: string;
85
+ class_name: string;
86
+ primary_key_field: string;
87
+ };
88
+ };
89
+ default_ordering: null;
90
+ definitions: {
91
+ MoneyField: {
92
+ type: string;
93
+ properties: {
94
+ amount: {
95
+ type: string;
96
+ };
97
+ currency: {
98
+ type: string;
99
+ };
100
+ };
101
+ };
102
+ };
103
+ datetime_format: string;
104
+ date_format: string;
105
+ time_format: string;
106
+ display: null;
107
+ };
108
+ static relationshipFields: Map<string, {
109
+ ModelClass: () => any;
110
+ relationshipType: string;
111
+ }>;
112
+ constructor(data: any);
113
+ /**
114
+ * Define property getters and setters for all model fields
115
+ * @private
116
+ */
117
+ private _defineProperties;
118
+ }
@@ -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 './modelwithcustompkrelation.schema.json';
7
+ /**
8
+ * Model-specific QuerySet implementation
9
+ */
10
+ export class ModelWithCustomPKRelationQuerySet extends QuerySet {
11
+ }
12
+ /**
13
+ * Model-specific Manager implementation
14
+ */
15
+ export class ModelWithCustomPKRelationManager extends Manager {
16
+ constructor(ModelClass) {
17
+ super(ModelClass, ModelWithCustomPKRelationQuerySet);
18
+ }
19
+ newQuerySet() {
20
+ return new ModelWithCustomPKRelationQuerySet(this.ModelClass);
21
+ }
22
+ }
23
+ /**
24
+ * Implementation of the ModelWithCustomPKRelation model
25
+ */
26
+ export class ModelWithCustomPKRelation extends Model {
27
+ constructor(data) {
28
+ ModelWithCustomPKRelation.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
+ ModelWithCustomPKRelation.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
+ ModelWithCustomPKRelation.configKey = 'backend1';
64
+ ModelWithCustomPKRelation.modelName = 'django_app.modelwithcustompkrelation';
65
+ ModelWithCustomPKRelation.primaryKeyField = 'id';
66
+ ModelWithCustomPKRelation.objects = new ModelWithCustomPKRelationManager(ModelWithCustomPKRelation);
67
+ ModelWithCustomPKRelation.fields = ['id', 'name', 'custom_pk_related'];
68
+ ModelWithCustomPKRelation.schema = schemaData;
69
+ ModelWithCustomPKRelation.relationshipFields = new Map([
70
+ ['custom_pk_related', { 'ModelClass': () => getModelClass('django_app.custompkmodel', 'backend1'), 'relationshipType': 'foreign-key' }]
71
+ ]);
@@ -0,0 +1,93 @@
1
+ {
2
+ "model_name": "django_app.modelwithcustompkrelation",
3
+ "title": "Model With Custom Pk Relation",
4
+ "class_name": "ModelWithCustomPKRelation",
5
+ "plural_title": "Model With Custom Pk Relations",
6
+ "primary_key_field": "id",
7
+ "filterable_fields": [
8
+ "custom_pk_related",
9
+ "name"
10
+ ],
11
+ "searchable_fields": [
12
+ "name"
13
+ ],
14
+ "ordering_fields": [
15
+ "name"
16
+ ],
17
+ "properties": {
18
+ "id": {
19
+ "type": "integer",
20
+ "title": "Id",
21
+ "required": true,
22
+ "description": null,
23
+ "nullable": false,
24
+ "format": "id",
25
+ "max_length": null,
26
+ "choices": null,
27
+ "default": null,
28
+ "validators": [],
29
+ "max_digits": null,
30
+ "decimal_places": null,
31
+ "read_only": true,
32
+ "ref": null
33
+ },
34
+ "name": {
35
+ "type": "string",
36
+ "title": "Name",
37
+ "required": true,
38
+ "description": null,
39
+ "nullable": false,
40
+ "format": null,
41
+ "max_length": 100,
42
+ "choices": null,
43
+ "default": null,
44
+ "validators": [],
45
+ "max_digits": null,
46
+ "decimal_places": null,
47
+ "read_only": false,
48
+ "ref": null
49
+ },
50
+ "custom_pk_related": {
51
+ "type": "integer",
52
+ "title": "Custom pk related",
53
+ "required": true,
54
+ "description": null,
55
+ "nullable": false,
56
+ "format": "foreign-key",
57
+ "max_length": null,
58
+ "choices": null,
59
+ "default": null,
60
+ "validators": [],
61
+ "max_digits": null,
62
+ "decimal_places": null,
63
+ "read_only": false,
64
+ "ref": null
65
+ }
66
+ },
67
+ "relationships": {
68
+ "custom_pk_related": {
69
+ "type": "foreign-key",
70
+ "model": "django_app.custompkmodel",
71
+ "class_name": "CustomPKModel",
72
+ "primary_key_field": "custom_pk"
73
+ }
74
+ },
75
+ "default_ordering": null,
76
+ "definitions": {
77
+ "MoneyField": {
78
+ "type": "object",
79
+ "properties": {
80
+ "amount": {
81
+ "type": "number"
82
+ },
83
+ "currency": {
84
+ "type": "string"
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "datetime_format": "iso-8601",
90
+ "date_format": "iso-8601",
91
+ "time_format": "iso-8601",
92
+ "display": null
93
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class ModelWithRestrictedFieldsQuerySet {
5
+ }
6
+ /**
7
+ * Model-specific Manager implementation
8
+ */
9
+ export class ModelWithRestrictedFieldsManager {
10
+ constructor(ModelClass: any);
11
+ newQuerySet(): ModelWithRestrictedFieldsQuerySet;
12
+ }
13
+ /**
14
+ * Implementation of the ModelWithRestrictedFields model
15
+ */
16
+ export class ModelWithRestrictedFields {
17
+ static configKey: string;
18
+ static modelName: string;
19
+ static primaryKeyField: string;
20
+ static objects: ModelWithRestrictedFieldsManager;
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
+ admin_only_field: {
65
+ type: string;
66
+ title: string;
67
+ required: boolean;
68
+ description: null;
69
+ nullable: boolean;
70
+ format: null;
71
+ max_length: number;
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
+ restricted_related: {
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
+ restricted_related: {
99
+ type: string;
100
+ model: string;
101
+ class_name: string;
102
+ primary_key_field: string;
103
+ };
104
+ };
105
+ default_ordering: null;
106
+ definitions: {
107
+ MoneyField: {
108
+ type: string;
109
+ properties: {
110
+ amount: {
111
+ type: string;
112
+ };
113
+ currency: {
114
+ type: string;
115
+ };
116
+ };
117
+ };
118
+ };
119
+ datetime_format: string;
120
+ date_format: string;
121
+ time_format: string;
122
+ display: null;
123
+ };
124
+ static relationshipFields: Map<string, {
125
+ ModelClass: () => any;
126
+ relationshipType: string;
127
+ }>;
128
+ constructor(data: any);
129
+ /**
130
+ * Define property getters and setters for all model fields
131
+ * @private
132
+ */
133
+ private _defineProperties;
134
+ }
@@ -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 './modelwithrestrictedfields.schema.json';
7
+ /**
8
+ * Model-specific QuerySet implementation
9
+ */
10
+ export class ModelWithRestrictedFieldsQuerySet extends QuerySet {
11
+ }
12
+ /**
13
+ * Model-specific Manager implementation
14
+ */
15
+ export class ModelWithRestrictedFieldsManager extends Manager {
16
+ constructor(ModelClass) {
17
+ super(ModelClass, ModelWithRestrictedFieldsQuerySet);
18
+ }
19
+ newQuerySet() {
20
+ return new ModelWithRestrictedFieldsQuerySet(this.ModelClass);
21
+ }
22
+ }
23
+ /**
24
+ * Implementation of the ModelWithRestrictedFields model
25
+ */
26
+ export class ModelWithRestrictedFields extends Model {
27
+ constructor(data) {
28
+ ModelWithRestrictedFields.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
+ ModelWithRestrictedFields.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
+ ModelWithRestrictedFields.configKey = 'backend1';
64
+ ModelWithRestrictedFields.modelName = 'django_app.modelwithrestrictedfields';
65
+ ModelWithRestrictedFields.primaryKeyField = 'id';
66
+ ModelWithRestrictedFields.objects = new ModelWithRestrictedFieldsManager(ModelWithRestrictedFields);
67
+ ModelWithRestrictedFields.fields = ['id', 'name', 'admin_only_field', 'restricted_related'];
68
+ ModelWithRestrictedFields.schema = schemaData;
69
+ ModelWithRestrictedFields.relationshipFields = new Map([
70
+ ['restricted_related', { 'ModelClass': () => getModelClass('django_app.restrictedfieldrelatedmodel', 'backend1'), 'relationshipType': 'foreign-key' }]
71
+ ]);
@@ -0,0 +1,111 @@
1
+ {
2
+ "model_name": "django_app.modelwithrestrictedfields",
3
+ "title": "Model With Restricted Fields",
4
+ "class_name": "ModelWithRestrictedFields",
5
+ "plural_title": "Model With Restricted Fieldss",
6
+ "primary_key_field": "id",
7
+ "filterable_fields": [
8
+ "admin_only_field",
9
+ "id",
10
+ "restricted_related",
11
+ "name"
12
+ ],
13
+ "searchable_fields": [
14
+ "name"
15
+ ],
16
+ "ordering_fields": [
17
+ "name"
18
+ ],
19
+ "properties": {
20
+ "id": {
21
+ "type": "integer",
22
+ "title": "Id",
23
+ "required": true,
24
+ "description": null,
25
+ "nullable": false,
26
+ "format": "id",
27
+ "max_length": null,
28
+ "choices": null,
29
+ "default": null,
30
+ "validators": [],
31
+ "max_digits": null,
32
+ "decimal_places": null,
33
+ "read_only": true,
34
+ "ref": null
35
+ },
36
+ "name": {
37
+ "type": "string",
38
+ "title": "Name",
39
+ "required": true,
40
+ "description": null,
41
+ "nullable": false,
42
+ "format": null,
43
+ "max_length": 100,
44
+ "choices": null,
45
+ "default": null,
46
+ "validators": [],
47
+ "max_digits": null,
48
+ "decimal_places": null,
49
+ "read_only": false,
50
+ "ref": null
51
+ },
52
+ "admin_only_field": {
53
+ "type": "string",
54
+ "title": "Admin only field",
55
+ "required": true,
56
+ "description": null,
57
+ "nullable": false,
58
+ "format": null,
59
+ "max_length": 100,
60
+ "choices": null,
61
+ "default": null,
62
+ "validators": [],
63
+ "max_digits": null,
64
+ "decimal_places": null,
65
+ "read_only": false,
66
+ "ref": null
67
+ },
68
+ "restricted_related": {
69
+ "type": "integer",
70
+ "title": "Restricted related",
71
+ "required": false,
72
+ "description": null,
73
+ "nullable": true,
74
+ "format": "foreign-key",
75
+ "max_length": null,
76
+ "choices": null,
77
+ "default": null,
78
+ "validators": [],
79
+ "max_digits": null,
80
+ "decimal_places": null,
81
+ "read_only": false,
82
+ "ref": null
83
+ }
84
+ },
85
+ "relationships": {
86
+ "restricted_related": {
87
+ "type": "foreign-key",
88
+ "model": "django_app.restrictedfieldrelatedmodel",
89
+ "class_name": "RestrictedFieldRelatedModel",
90
+ "primary_key_field": "id"
91
+ }
92
+ },
93
+ "default_ordering": null,
94
+ "definitions": {
95
+ "MoneyField": {
96
+ "type": "object",
97
+ "properties": {
98
+ "amount": {
99
+ "type": "number"
100
+ },
101
+ "currency": {
102
+ "type": "string"
103
+ }
104
+ }
105
+ }
106
+ },
107
+ "datetime_format": "iso-8601",
108
+ "date_format": "iso-8601",
109
+ "time_format": "iso-8601",
110
+ "display": null
111
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Model-specific QuerySet implementation
3
+ */
4
+ export class NameFilterCustomPKModelQuerySet {
5
+ }
6
+ /**
7
+ * Model-specific Manager implementation
8
+ */
9
+ export class NameFilterCustomPKModelManager {
10
+ constructor(ModelClass: any);
11
+ newQuerySet(): NameFilterCustomPKModelQuerySet;
12
+ }
13
+ /**
14
+ * Implementation of the NameFilterCustomPKModel model
15
+ */
16
+ export class NameFilterCustomPKModel {
17
+ static configKey: string;
18
+ static modelName: string;
19
+ static primaryKeyField: string;
20
+ static objects: NameFilterCustomPKModelManager;
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
+ custom_pk: {
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
+ };
65
+ relationships: {};
66
+ default_ordering: null;
67
+ definitions: {
68
+ MoneyField: {
69
+ type: string;
70
+ properties: {
71
+ amount: {
72
+ type: string;
73
+ };
74
+ currency: {
75
+ type: string;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ datetime_format: string;
81
+ date_format: string;
82
+ time_format: string;
83
+ display: null;
84
+ };
85
+ static relationshipFields: Map<any, any>;
86
+ constructor(data: any);
87
+ /**
88
+ * Define property getters and setters for all model fields
89
+ * @private
90
+ */
91
+ private _defineProperties;
92
+ }