@quatrain/core 0.4.0 → 0.4.1
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.
|
@@ -3,7 +3,7 @@ import { DataObjectProperties } from '../properties/';
|
|
|
3
3
|
import { Query } from '../backends/Query';
|
|
4
4
|
export declare abstract class AbstractObject {
|
|
5
5
|
static PROPS_DEFINITION: DataObjectProperties;
|
|
6
|
-
static COLLECTION: string;
|
|
6
|
+
static COLLECTION: string | undefined;
|
|
7
7
|
static LABEL_KEY: string;
|
|
8
8
|
protected _dataObject: DataObjectClass<any>;
|
|
9
9
|
constructor(dao: DataObjectClass<any>);
|
|
@@ -8,13 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var _a;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.AbstractObject = void 0;
|
|
14
13
|
const Query_1 = require("../backends/Query");
|
|
15
14
|
class AbstractObject {
|
|
16
15
|
constructor(dao) {
|
|
17
16
|
this._dataObject = dao;
|
|
17
|
+
AbstractObject.COLLECTION = this.constructor.name.toLowerCase();
|
|
18
18
|
}
|
|
19
19
|
get(key) {
|
|
20
20
|
return this._dataObject.get(key);
|
|
@@ -47,8 +47,8 @@ class AbstractObject {
|
|
|
47
47
|
return this._dataObject.uri;
|
|
48
48
|
}
|
|
49
49
|
toJSON() {
|
|
50
|
-
var
|
|
51
|
-
return typeof this.uri === 'string' ? this.uri : (
|
|
50
|
+
var _a;
|
|
51
|
+
return typeof this.uri === 'string' ? this.uri : (_a = this.uri) === null || _a === void 0 ? void 0 : _a.toJSON();
|
|
52
52
|
}
|
|
53
53
|
save() {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -65,9 +65,6 @@ class AbstractObject {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
exports.AbstractObject = AbstractObject;
|
|
68
|
-
_a = AbstractObject;
|
|
69
68
|
AbstractObject.PROPS_DEFINITION = [];
|
|
70
|
-
// Which name to use in backend as table/collection identifer
|
|
71
|
-
AbstractObject.COLLECTION = _a.constructor.name.toLowerCase();
|
|
72
69
|
// Which property's value to use in backend as label for object reference
|
|
73
70
|
AbstractObject.LABEL_KEY = 'name';
|
package/lib/components/User.d.ts
CHANGED
package/lib/components/User.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Core objects for business apps",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
"push": "yarn version --patch --no-git-tag-version ; yarn publish --access public",
|
|
28
28
|
"prepublish": "tsc"
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|