@statezero/core 0.1.76 → 0.1.77
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.js +77 -0
- package/dist/actions/backend1/django_app/get-current-username.js +62 -0
- package/dist/actions/backend1/django_app/get-server-status.js +65 -0
- package/dist/actions/backend1/django_app/get-user-info.js +67 -0
- package/dist/actions/backend1/django_app/process-data.js +75 -0
- package/dist/actions/backend1/django_app/send-notification.js +78 -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/{django_app → default/django_app}/calculate-hash.js +1 -1
- package/dist/actions/default/django_app/get-current-username.d.ts +29 -0
- package/dist/actions/{django_app → default/django_app}/get-current-username.js +1 -1
- package/dist/actions/default/django_app/get-server-status.d.ts +38 -0
- package/dist/actions/{django_app → default/django_app}/get-server-status.js +1 -1
- package/dist/actions/default/django_app/get-user-info.d.ts +44 -0
- package/dist/actions/{django_app → default/django_app}/get-user-info.js +1 -1
- package/dist/actions/default/django_app/index.d.ts +6 -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/{django_app → default/django_app}/process-data.js +1 -1
- package/dist/actions/default/django_app/send-notification.d.ts +55 -0
- package/dist/actions/{django_app → default/django_app}/send-notification.js +1 -1
- package/dist/actions/default/index.d.ts +1 -0
- package/dist/actions/default/index.js +1 -0
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +5 -1
- package/dist/cli/commands/syncActions.js +38 -5
- package/dist/cli/commands/syncModels.js +44 -7
- package/dist/filtering/localFiltering.js +56 -9
- package/dist/models/{django_app → backend1/django_app}/comprehensivemodel.d.ts +3 -3
- package/dist/models/backend1/django_app/comprehensivemodel.js +63 -0
- package/dist/models/{django_app → backend1/django_app}/custompkmodel.d.ts +3 -3
- package/dist/models/backend1/django_app/custompkmodel.js +61 -0
- package/dist/models/{django_app → backend1/django_app}/deepmodellevel1.d.ts +3 -3
- package/dist/models/backend1/django_app/deepmodellevel1.js +64 -0
- package/dist/models/{django_app → backend1/django_app}/deepmodellevel2.d.ts +3 -3
- package/dist/models/backend1/django_app/deepmodellevel2.js +63 -0
- package/dist/models/{django_app → backend1/django_app}/deepmodellevel3.d.ts +3 -3
- package/dist/models/backend1/django_app/deepmodellevel3.js +61 -0
- package/dist/models/{django_app → backend1/django_app}/dummymodel.d.ts +3 -3
- package/dist/models/backend1/django_app/dummymodel.js +63 -0
- package/dist/models/{django_app → backend1/django_app}/dummyrelatedmodel.d.ts +3 -3
- package/dist/models/backend1/django_app/dummyrelatedmodel.js +61 -0
- package/dist/models/{django_app → backend1/django_app}/filetest.d.ts +3 -3
- package/dist/models/backend1/django_app/filetest.js +61 -0
- package/dist/models/{django_app → backend1/django_app}/modelwithcustompkrelation.d.ts +3 -3
- package/dist/models/backend1/django_app/modelwithcustompkrelation.js +63 -0
- package/dist/models/{django_app → backend1/django_app}/namefiltercustompkmodel.d.ts +3 -3
- package/dist/models/backend1/django_app/namefiltercustompkmodel.js +61 -0
- package/dist/models/{django_app → backend1/django_app}/order.d.ts +3 -3
- package/dist/models/backend1/django_app/order.js +61 -0
- package/dist/models/{django_app → backend1/django_app}/orderitem.d.ts +3 -3
- package/dist/models/backend1/django_app/orderitem.js +64 -0
- package/dist/models/{django_app → backend1/django_app}/product.d.ts +3 -3
- package/dist/models/backend1/django_app/product.js +63 -0
- package/dist/models/{django_app → backend1/django_app}/productcategory.d.ts +3 -3
- package/dist/models/backend1/django_app/productcategory.js +61 -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 +47 -0
- package/dist/models/{django_app → default/django_app}/comprehensivemodel.js +2 -2
- package/dist/models/default/django_app/custompkmodel.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/custompkmodel.js +2 -2
- package/dist/models/default/django_app/deepmodellevel1.d.ts +47 -0
- package/dist/models/{django_app → default/django_app}/deepmodellevel1.js +2 -2
- package/dist/models/default/django_app/deepmodellevel2.d.ts +47 -0
- package/dist/models/{django_app → default/django_app}/deepmodellevel2.js +2 -2
- package/dist/models/default/django_app/deepmodellevel3.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/deepmodellevel3.js +2 -2
- package/dist/models/default/django_app/dummymodel.d.ts +47 -0
- package/dist/models/{django_app → default/django_app}/dummymodel.js +2 -2
- package/dist/models/default/django_app/dummyrelatedmodel.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/dummyrelatedmodel.js +2 -2
- package/dist/models/default/django_app/filetest.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/filetest.js +2 -2
- package/dist/models/default/django_app/index.d.ts +14 -0
- package/dist/models/default/django_app/index.js +14 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.d.ts +47 -0
- package/dist/models/{django_app → default/django_app}/modelwithcustompkrelation.js +2 -2
- package/dist/models/default/django_app/namefiltercustompkmodel.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/namefiltercustompkmodel.js +2 -2
- package/dist/models/default/django_app/order.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/order.js +2 -2
- package/dist/models/default/django_app/orderitem.d.ts +47 -0
- package/dist/models/{django_app → default/django_app}/orderitem.js +2 -2
- package/dist/models/default/django_app/product.d.ts +47 -0
- package/dist/models/{django_app → default/django_app}/product.js +2 -2
- package/dist/models/default/django_app/productcategory.d.ts +44 -0
- package/dist/models/{django_app → default/django_app}/productcategory.js +2 -2
- package/dist/models/default/fileobject.d.ts +4 -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 -2
- package/dist/models/index.js +5 -2
- package/package.json +1 -1
- package/dist/models/fileobject.d.ts +0 -4
- /package/dist/actions/{django_app → backend1/django_app}/calculate-hash.d.ts +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/get-current-username.d.ts +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/get-server-status.d.ts +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/get-user-info.d.ts +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/index.d.ts +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/index.js +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/process-data.d.ts +0 -0
- /package/dist/actions/{django_app → backend1/django_app}/send-notification.d.ts +0 -0
- /package/dist/models/{django_app → backend1/django_app}/index.d.ts +0 -0
- /package/dist/models/{django_app → backend1/django_app}/index.js +0 -0
- /package/dist/models/{fileobject.js → default/fileobject.js} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
DeepModelLevel1.configKey = 'backend1';
|
|
56
|
+
DeepModelLevel1.modelName = 'django_app.deepmodellevel1';
|
|
57
|
+
DeepModelLevel1.primaryKeyField = 'id';
|
|
58
|
+
DeepModelLevel1.objects = new DeepModelLevel1Manager(DeepModelLevel1);
|
|
59
|
+
DeepModelLevel1.fields = ['id', 'name', 'level2', 'comprehensive_models'];
|
|
60
|
+
DeepModelLevel1.schema = schemaData;
|
|
61
|
+
DeepModelLevel1.relationshipFields = new Map([
|
|
62
|
+
['level2', { 'ModelClass': () => getModelClass('django_app.deepmodellevel2', 'backend1'), 'relationshipType': 'foreign-key' }],
|
|
63
|
+
['comprehensive_models', { 'ModelClass': () => getModelClass('django_app.comprehensivemodel', 'backend1'), 'relationshipType': 'many-to-many' }]
|
|
64
|
+
]);
|
|
@@ -42,6 +42,6 @@ export class DeepModelLevel2 extends Model {
|
|
|
42
42
|
*/
|
|
43
43
|
private _defineProperties;
|
|
44
44
|
}
|
|
45
|
-
import { QuerySet } from '
|
|
46
|
-
import { Manager } from '
|
|
47
|
-
import { Model } from '
|
|
45
|
+
import { QuerySet } from '../../../../src';
|
|
46
|
+
import { Manager } from '../../../../src';
|
|
47
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
DeepModelLevel2.configKey = 'backend1';
|
|
56
|
+
DeepModelLevel2.modelName = 'django_app.deepmodellevel2';
|
|
57
|
+
DeepModelLevel2.primaryKeyField = 'id';
|
|
58
|
+
DeepModelLevel2.objects = new DeepModelLevel2Manager(DeepModelLevel2);
|
|
59
|
+
DeepModelLevel2.fields = ['id', 'name', 'level3'];
|
|
60
|
+
DeepModelLevel2.schema = schemaData;
|
|
61
|
+
DeepModelLevel2.relationshipFields = new Map([
|
|
62
|
+
['level3', { 'ModelClass': () => getModelClass('django_app.deepmodellevel3', 'backend1'), 'relationshipType': 'foreign-key' }]
|
|
63
|
+
]);
|
|
@@ -39,6 +39,6 @@ export class DeepModelLevel3 extends Model {
|
|
|
39
39
|
*/
|
|
40
40
|
private _defineProperties;
|
|
41
41
|
}
|
|
42
|
-
import { QuerySet } from '
|
|
43
|
-
import { Manager } from '
|
|
44
|
-
import { Model } from '
|
|
42
|
+
import { QuerySet } from '../../../../src';
|
|
43
|
+
import { Manager } from '../../../../src';
|
|
44
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,61 @@
|
|
|
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 './deepmodellevel3.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class DeepModelLevel3QuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class DeepModelLevel3Manager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, DeepModelLevel3QuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new DeepModelLevel3QuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the DeepModelLevel3 model
|
|
25
|
+
*/
|
|
26
|
+
export class DeepModelLevel3 extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
DeepModelLevel3.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
|
+
DeepModelLevel3.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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
DeepModelLevel3.configKey = 'backend1';
|
|
56
|
+
DeepModelLevel3.modelName = 'django_app.deepmodellevel3';
|
|
57
|
+
DeepModelLevel3.primaryKeyField = 'id';
|
|
58
|
+
DeepModelLevel3.objects = new DeepModelLevel3Manager(DeepModelLevel3);
|
|
59
|
+
DeepModelLevel3.fields = ['id', 'name'];
|
|
60
|
+
DeepModelLevel3.schema = schemaData;
|
|
61
|
+
DeepModelLevel3.relationshipFields = new Map([]);
|
|
@@ -42,6 +42,6 @@ export class DummyModel extends Model {
|
|
|
42
42
|
*/
|
|
43
43
|
private _defineProperties;
|
|
44
44
|
}
|
|
45
|
-
import { QuerySet } from '
|
|
46
|
-
import { Manager } from '
|
|
47
|
-
import { Model } from '
|
|
45
|
+
import { QuerySet } from '../../../../src';
|
|
46
|
+
import { Manager } from '../../../../src';
|
|
47
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,63 @@
|
|
|
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 './dummymodel.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class DummyModelQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class DummyModelManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, DummyModelQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new DummyModelQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the DummyModel model
|
|
25
|
+
*/
|
|
26
|
+
export class DummyModel extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
DummyModel.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
|
+
DummyModel.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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
DummyModel.configKey = 'backend1';
|
|
56
|
+
DummyModel.modelName = 'django_app.dummymodel';
|
|
57
|
+
DummyModel.primaryKeyField = 'id';
|
|
58
|
+
DummyModel.objects = new DummyModelManager(DummyModel);
|
|
59
|
+
DummyModel.fields = ['id', 'name', 'value', 'related'];
|
|
60
|
+
DummyModel.schema = schemaData;
|
|
61
|
+
DummyModel.relationshipFields = new Map([
|
|
62
|
+
['related', { 'ModelClass': () => getModelClass('django_app.dummyrelatedmodel', 'backend1'), 'relationshipType': 'foreign-key' }]
|
|
63
|
+
]);
|
|
@@ -39,6 +39,6 @@ export class DummyRelatedModel extends Model {
|
|
|
39
39
|
*/
|
|
40
40
|
private _defineProperties;
|
|
41
41
|
}
|
|
42
|
-
import { QuerySet } from '
|
|
43
|
-
import { Manager } from '
|
|
44
|
-
import { Model } from '
|
|
42
|
+
import { QuerySet } from '../../../../src';
|
|
43
|
+
import { Manager } from '../../../../src';
|
|
44
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,61 @@
|
|
|
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 './dummyrelatedmodel.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class DummyRelatedModelQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class DummyRelatedModelManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, DummyRelatedModelQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new DummyRelatedModelQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the DummyRelatedModel model
|
|
25
|
+
*/
|
|
26
|
+
export class DummyRelatedModel extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
DummyRelatedModel.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
|
+
DummyRelatedModel.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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
DummyRelatedModel.configKey = 'backend1';
|
|
56
|
+
DummyRelatedModel.modelName = 'django_app.dummyrelatedmodel';
|
|
57
|
+
DummyRelatedModel.primaryKeyField = 'id';
|
|
58
|
+
DummyRelatedModel.objects = new DummyRelatedModelManager(DummyRelatedModel);
|
|
59
|
+
DummyRelatedModel.fields = ['id', 'name'];
|
|
60
|
+
DummyRelatedModel.schema = schemaData;
|
|
61
|
+
DummyRelatedModel.relationshipFields = new Map([]);
|
|
@@ -39,6 +39,6 @@ export class FileTest extends Model {
|
|
|
39
39
|
*/
|
|
40
40
|
private _defineProperties;
|
|
41
41
|
}
|
|
42
|
-
import { QuerySet } from '
|
|
43
|
-
import { Manager } from '
|
|
44
|
-
import { Model } from '
|
|
42
|
+
import { QuerySet } from '../../../../src';
|
|
43
|
+
import { Manager } from '../../../../src';
|
|
44
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,61 @@
|
|
|
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 './filetest.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class FileTestQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class FileTestManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, FileTestQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new FileTestQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the FileTest model
|
|
25
|
+
*/
|
|
26
|
+
export class FileTest extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
FileTest.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
|
+
FileTest.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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
FileTest.configKey = 'backend1';
|
|
56
|
+
FileTest.modelName = 'django_app.filetest';
|
|
57
|
+
FileTest.primaryKeyField = 'id';
|
|
58
|
+
FileTest.objects = new FileTestManager(FileTest);
|
|
59
|
+
FileTest.fields = ['id', 'title', 'document', 'image', 'created_at'];
|
|
60
|
+
FileTest.schema = schemaData;
|
|
61
|
+
FileTest.relationshipFields = new Map([]);
|
|
@@ -42,6 +42,6 @@ export class ModelWithCustomPKRelation extends Model {
|
|
|
42
42
|
*/
|
|
43
43
|
private _defineProperties;
|
|
44
44
|
}
|
|
45
|
-
import { QuerySet } from '
|
|
46
|
-
import { Manager } from '
|
|
47
|
-
import { Model } from '
|
|
45
|
+
import { QuerySet } from '../../../../src';
|
|
46
|
+
import { Manager } from '../../../../src';
|
|
47
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
ModelWithCustomPKRelation.configKey = 'backend1';
|
|
56
|
+
ModelWithCustomPKRelation.modelName = 'django_app.modelwithcustompkrelation';
|
|
57
|
+
ModelWithCustomPKRelation.primaryKeyField = 'id';
|
|
58
|
+
ModelWithCustomPKRelation.objects = new ModelWithCustomPKRelationManager(ModelWithCustomPKRelation);
|
|
59
|
+
ModelWithCustomPKRelation.fields = ['id', 'name', 'custom_pk_related'];
|
|
60
|
+
ModelWithCustomPKRelation.schema = schemaData;
|
|
61
|
+
ModelWithCustomPKRelation.relationshipFields = new Map([
|
|
62
|
+
['custom_pk_related', { 'ModelClass': () => getModelClass('django_app.custompkmodel', 'backend1'), 'relationshipType': 'foreign-key' }]
|
|
63
|
+
]);
|
|
@@ -39,6 +39,6 @@ export class NameFilterCustomPKModel extends Model {
|
|
|
39
39
|
*/
|
|
40
40
|
private _defineProperties;
|
|
41
41
|
}
|
|
42
|
-
import { QuerySet } from '
|
|
43
|
-
import { Manager } from '
|
|
44
|
-
import { Model } from '
|
|
42
|
+
import { QuerySet } from '../../../../src';
|
|
43
|
+
import { Manager } from '../../../../src';
|
|
44
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,61 @@
|
|
|
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 './namefiltercustompkmodel.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class NameFilterCustomPKModelQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class NameFilterCustomPKModelManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, NameFilterCustomPKModelQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new NameFilterCustomPKModelQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the NameFilterCustomPKModel model
|
|
25
|
+
*/
|
|
26
|
+
export class NameFilterCustomPKModel extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
NameFilterCustomPKModel.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
|
+
NameFilterCustomPKModel.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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
NameFilterCustomPKModel.configKey = 'backend1';
|
|
56
|
+
NameFilterCustomPKModel.modelName = 'django_app.namefiltercustompkmodel';
|
|
57
|
+
NameFilterCustomPKModel.primaryKeyField = 'custom_pk';
|
|
58
|
+
NameFilterCustomPKModel.objects = new NameFilterCustomPKModelManager(NameFilterCustomPKModel);
|
|
59
|
+
NameFilterCustomPKModel.fields = ['custom_pk', 'name'];
|
|
60
|
+
NameFilterCustomPKModel.schema = schemaData;
|
|
61
|
+
NameFilterCustomPKModel.relationshipFields = new Map([]);
|
|
@@ -39,6 +39,6 @@ export class Order extends Model {
|
|
|
39
39
|
*/
|
|
40
40
|
private _defineProperties;
|
|
41
41
|
}
|
|
42
|
-
import { QuerySet } from '
|
|
43
|
-
import { Manager } from '
|
|
44
|
-
import { Model } from '
|
|
42
|
+
import { QuerySet } from '../../../../src';
|
|
43
|
+
import { Manager } from '../../../../src';
|
|
44
|
+
import { Model } from '../../../../src';
|
|
@@ -0,0 +1,61 @@
|
|
|
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 './order.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class OrderQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class OrderManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, OrderQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new OrderQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the Order model
|
|
25
|
+
*/
|
|
26
|
+
export class Order extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
Order.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
|
+
Order.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
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Bind this model to its backend
|
|
55
|
+
Order.configKey = 'backend1';
|
|
56
|
+
Order.modelName = 'django_app.order';
|
|
57
|
+
Order.primaryKeyField = 'id';
|
|
58
|
+
Order.objects = new OrderManager(Order);
|
|
59
|
+
Order.fields = ['id', 'order_number', 'customer_name', 'customer_email', 'total', 'status', 'created_at', 'last_updated'];
|
|
60
|
+
Order.schema = schemaData;
|
|
61
|
+
Order.relationshipFields = new Map([]);
|
|
@@ -42,6 +42,6 @@ export class OrderItem extends Model {
|
|
|
42
42
|
*/
|
|
43
43
|
private _defineProperties;
|
|
44
44
|
}
|
|
45
|
-
import { QuerySet } from '
|
|
46
|
-
import { Manager } from '
|
|
47
|
-
import { Model } from '
|
|
45
|
+
import { QuerySet } from '../../../../src';
|
|
46
|
+
import { Manager } from '../../../../src';
|
|
47
|
+
import { Model } from '../../../../src';
|