@quatrain/core 1.0.0-beta8 → 1.0.0
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/lib/Core.d.ts +4 -10
- package/lib/Core.js +25 -14
- package/lib/components/AbstractObject.d.ts +1 -1
- package/lib/components/BaseObjectCore.d.ts +5 -45
- package/lib/components/BaseObjectCore.js +45 -63
- package/lib/components/DataObject.d.ts +3 -7
- package/lib/components/DataObject.js +14 -43
- package/lib/components/ObjectUri.d.ts +23 -4
- package/lib/components/ObjectUri.js +47 -18
- package/lib/components/index.d.ts +1 -3
- package/lib/components/index.js +1 -8
- package/lib/index.d.ts +5 -15
- package/lib/index.js +7 -33
- package/lib/properties/ArrayProperty.js +3 -0
- package/lib/properties/BaseProperty.js +2 -2
- package/lib/properties/CollectionProperty.d.ts +1 -16
- package/lib/properties/CollectionProperty.js +0 -41
- package/lib/properties/FileProperty.d.ts +10 -0
- package/lib/properties/FileProperty.js +12 -0
- package/lib/properties/ObjectProperty.d.ts +7 -0
- package/lib/properties/ObjectProperty.js +17 -10
- package/lib/properties/Property.d.ts +3 -1
- package/lib/properties/Property.js +4 -0
- package/lib/properties/index.d.ts +2 -1
- package/lib/properties/index.js +3 -1
- package/package.json +4 -2
- package/lib/Auth.d.ts +0 -25
- package/lib/Auth.js +0 -9
- package/lib/Backend.d.ts +0 -38
- package/lib/Backend.js +0 -10
- package/lib/authentication/AbstractAuthAdapter.d.ts +0 -21
- package/lib/authentication/AbstractAuthAdapter.js +0 -28
- package/lib/authentication/AuthenticationError.d.ts +0 -2
- package/lib/authentication/AuthenticationError.js +0 -6
- package/lib/authentication/index.d.ts +0 -4
- package/lib/authentication/index.js +0 -7
- package/lib/authentication/middlewares/AbstractAuthMiddleware.d.ts +0 -0
- package/lib/authentication/middlewares/AbstractAuthMiddleware.js +0 -1
- package/lib/authentication/middlewares/Middleware.d.ts +0 -5
- package/lib/authentication/middlewares/Middleware.js +0 -2
- package/lib/authentication/types/AuthInterface.d.ts +0 -9
- package/lib/authentication/types/AuthInterface.js +0 -2
- package/lib/backends/AbstractAdapter.d.ts +0 -42
- package/lib/backends/AbstractAdapter.js +0 -86
- package/lib/backends/BackendError.d.ts +0 -2
- package/lib/backends/BackendError.js +0 -6
- package/lib/backends/Filter.d.ts +0 -17
- package/lib/backends/Filter.js +0 -14
- package/lib/backends/FilterOperators.d.ts +0 -13
- package/lib/backends/FilterOperators.js +0 -16
- package/lib/backends/Filters.d.ts +0 -11
- package/lib/backends/Filters.js +0 -14
- package/lib/backends/Limits.d.ts +0 -9
- package/lib/backends/Limits.js +0 -10
- package/lib/backends/MockAdapter.d.ts +0 -25
- package/lib/backends/MockAdapter.js +0 -189
- package/lib/backends/NotFoundError.d.ts +0 -2
- package/lib/backends/NotFoundError.js +0 -6
- package/lib/backends/Query.d.ts +0 -54
- package/lib/backends/Query.js +0 -131
- package/lib/backends/SortAndLimit.d.ts +0 -11
- package/lib/backends/SortAndLimit.js +0 -11
- package/lib/backends/Sorting.d.ts +0 -9
- package/lib/backends/Sorting.js +0 -10
- package/lib/backends/index.d.ts +0 -12
- package/lib/backends/index.js +0 -46
- package/lib/backends/middlewares/AbstractMiddleware.d.ts +0 -0
- package/lib/backends/middlewares/AbstractMiddleware.js +0 -1
- package/lib/backends/middlewares/InjectKeywordsMiddleware.d.ts +0 -9
- package/lib/backends/middlewares/InjectKeywordsMiddleware.js +0 -47
- package/lib/backends/middlewares/InjectMetaMiddleware.d.ts +0 -13
- package/lib/backends/middlewares/InjectMetaMiddleware.js +0 -33
- package/lib/backends/middlewares/Middleware.d.ts +0 -5
- package/lib/backends/middlewares/Middleware.js +0 -2
- package/lib/backends/middlewares/types/MiddlewareParams.d.ts +0 -3
- package/lib/backends/middlewares/types/MiddlewareParams.js +0 -2
- package/lib/backends/types/BackendInterface.d.ts +0 -13
- package/lib/backends/types/BackendInterface.js +0 -2
- package/lib/backends/types/CollectionHierarchy.d.ts +0 -3
- package/lib/backends/types/CollectionHierarchy.js +0 -6
- package/lib/components/BaseRepository.d.ts +0 -25
- package/lib/components/BaseRepository.js +0 -132
- package/lib/components/EntityRepository.d.ts +0 -6
- package/lib/components/EntityRepository.js +0 -14
- package/lib/components/UserRepository.d.ts +0 -7
- package/lib/components/UserRepository.js +0 -36
- package/lib/components/types/RepositoryClass.d.ts +0 -40
- package/lib/components/types/RepositoryClass.js +0 -2
- package/lib/utils/DataGenerator.d.ts +0 -9
- package/lib/utils/DataGenerator.js +0 -102
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -5
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ObjectUri = void 0;
|
|
4
|
-
const Core_1 = require("../Core");
|
|
5
4
|
class ObjectUri {
|
|
6
5
|
/**
|
|
7
6
|
* create object uri from string:
|
|
8
7
|
* ex: 'xyz', '@backend:xyz', 'collection/xyz', '@backend:collection/xyz'
|
|
9
8
|
* some backends will need a collection or table name, some may deduct it from object
|
|
10
|
-
* @param str
|
|
9
|
+
* @param str partial or full resource path
|
|
10
|
+
* @param label optional label to describe path
|
|
11
11
|
*/
|
|
12
12
|
constructor(str = '', label = '') {
|
|
13
13
|
this._pairs = [];
|
|
14
14
|
this._literal = '';
|
|
15
|
-
this._backend = Core_1.Core.defaultBackend;
|
|
16
15
|
this._path = ObjectUri.DEFAULT;
|
|
17
16
|
this._uid = undefined;
|
|
18
17
|
this._collection = undefined;
|
|
@@ -21,40 +20,45 @@ class ObjectUri {
|
|
|
21
20
|
this._label = label;
|
|
22
21
|
if (str.includes(':')) {
|
|
23
22
|
const [backend, path] = str.split(':');
|
|
24
|
-
this._backend = backend
|
|
23
|
+
this._backend = backend;
|
|
25
24
|
this._path = path;
|
|
26
25
|
}
|
|
27
26
|
else {
|
|
28
27
|
this._path = str;
|
|
29
28
|
}
|
|
30
29
|
const parts = this._path.split(ObjectUri.DEFAULT);
|
|
31
|
-
|
|
30
|
+
const isFilePath = parts[parts.length - 1].indexOf('.') !== -1;
|
|
31
|
+
if (isFilePath) {
|
|
32
|
+
this._uid = parts[parts.length - 1];
|
|
33
|
+
}
|
|
34
|
+
else if (parts.length === 1) {
|
|
32
35
|
// It is allowed to only give the uid part of the uri
|
|
33
|
-
// provided that collection will be injected by another
|
|
36
|
+
// provided that collection will be injected by another means
|
|
34
37
|
this._uid = parts[0].length > 0 ? parts[0] : undefined;
|
|
35
38
|
this._collection = ObjectUri.MISSING_COLLECTION;
|
|
36
39
|
this._pairs.push(`${ObjectUri.MISSING_COLLECTION}${ObjectUri.DEFAULT}${this._uid}`);
|
|
37
40
|
this._label = label || this._uid;
|
|
38
41
|
}
|
|
39
42
|
else if (parts.length % 2 === 0) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
this._pairs.push(`${parts[i]}${ObjectUri.DEFAULT}${parts[i + 1]}`);
|
|
46
|
-
i += 2;
|
|
43
|
+
this._path = parts.slice(parts.length - 2).join(ObjectUri.DEFAULT);
|
|
44
|
+
this._uid = parts[parts.length - 1];
|
|
45
|
+
this._collection = parts[parts.length - 2];
|
|
46
|
+
if (parts.length > 2) {
|
|
47
|
+
this._parent = new ObjectUri(parts.slice(0, parts.length - 2).join(ObjectUri.DEFAULT));
|
|
47
48
|
}
|
|
48
49
|
this._label = label || this._uid;
|
|
49
50
|
}
|
|
50
|
-
else {
|
|
51
|
+
else if (!isFilePath) {
|
|
52
|
+
// if the last part is not a filename with extension, throw error
|
|
51
53
|
throw new Error(`Path parts number must be 1 or even, received: '${str}'`);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
set class(objClass) {
|
|
55
57
|
this._objClass = objClass;
|
|
56
58
|
if (objClass) {
|
|
57
|
-
this._collection =
|
|
59
|
+
this._collection =
|
|
60
|
+
objClass.COLLECTION ||
|
|
61
|
+
(objClass.name && objClass.name.toLowerCase());
|
|
58
62
|
}
|
|
59
63
|
else {
|
|
60
64
|
this._collection = undefined;
|
|
@@ -66,17 +70,42 @@ class ObjectUri {
|
|
|
66
70
|
get backend() {
|
|
67
71
|
return this._backend;
|
|
68
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the full path of the resource
|
|
75
|
+
* including optional parents' path
|
|
76
|
+
* @returns string
|
|
77
|
+
*/
|
|
69
78
|
get path() {
|
|
79
|
+
return this._parent
|
|
80
|
+
? `${this._parent.path}${ObjectUri.DEFAULT}${this._path}`
|
|
81
|
+
: this._path;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the own path of the resource
|
|
85
|
+
* without the optional parents' paths
|
|
86
|
+
* @returns string
|
|
87
|
+
*/
|
|
88
|
+
get ownPath() {
|
|
70
89
|
return this._path;
|
|
71
90
|
}
|
|
91
|
+
get parent() {
|
|
92
|
+
return this._parent;
|
|
93
|
+
}
|
|
72
94
|
set label(label) {
|
|
73
95
|
this._label = label;
|
|
74
96
|
}
|
|
75
97
|
get label() {
|
|
76
98
|
return this._label;
|
|
77
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Return the full path litteral
|
|
102
|
+
* including the backend alias
|
|
103
|
+
* @returns string
|
|
104
|
+
*/
|
|
78
105
|
get literal() {
|
|
79
|
-
return
|
|
106
|
+
return this._str.includes(':')
|
|
107
|
+
? this._str
|
|
108
|
+
: `${this._backend}:${this._str}`;
|
|
80
109
|
}
|
|
81
110
|
set path(path) {
|
|
82
111
|
// if (this._path && this._path !== ObjectUri.DEFAULT) {
|
|
@@ -108,7 +137,7 @@ class ObjectUri {
|
|
|
108
137
|
*/
|
|
109
138
|
toReference() {
|
|
110
139
|
return {
|
|
111
|
-
ref: this.
|
|
140
|
+
ref: this.path,
|
|
112
141
|
uri: this._literal,
|
|
113
142
|
label: this._label,
|
|
114
143
|
};
|
|
@@ -116,7 +145,7 @@ class ObjectUri {
|
|
|
116
145
|
toJSON() {
|
|
117
146
|
return {
|
|
118
147
|
backend: this._backend,
|
|
119
|
-
ref: this.
|
|
148
|
+
ref: this.path,
|
|
120
149
|
label: this._label || '',
|
|
121
150
|
};
|
|
122
151
|
}
|
|
@@ -2,9 +2,7 @@ import { DataObject, DataObjectParams } from './DataObject';
|
|
|
2
2
|
import { DataObjectClass } from './types/DataObjectClass';
|
|
3
3
|
import { ObjectUri } from './ObjectUri';
|
|
4
4
|
import { AbstractObject } from './AbstractObject';
|
|
5
|
-
import { BaseObjectCore } from './BaseObjectCore';
|
|
6
5
|
import { BaseObjectProperties } from './BaseObject';
|
|
7
|
-
import BaseRepository from './BaseRepository';
|
|
8
6
|
import { User, UserProperties } from './User';
|
|
9
7
|
import { Entity } from './Entity';
|
|
10
|
-
export { DataObject, DataObjectParams, DataObjectClass, ObjectUri, AbstractObject,
|
|
8
|
+
export { DataObject, DataObjectParams, DataObjectClass, ObjectUri, AbstractObject, User, Entity, BaseObjectProperties, UserProperties, };
|
package/lib/components/index.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UserProperties = exports.BaseObjectProperties = exports.Entity = exports.User = exports.
|
|
3
|
+
exports.UserProperties = exports.BaseObjectProperties = exports.Entity = exports.User = exports.AbstractObject = exports.ObjectUri = exports.DataObject = void 0;
|
|
7
4
|
const DataObject_1 = require("./DataObject");
|
|
8
5
|
Object.defineProperty(exports, "DataObject", { enumerable: true, get: function () { return DataObject_1.DataObject; } });
|
|
9
6
|
const ObjectUri_1 = require("./ObjectUri");
|
|
10
7
|
Object.defineProperty(exports, "ObjectUri", { enumerable: true, get: function () { return ObjectUri_1.ObjectUri; } });
|
|
11
8
|
const AbstractObject_1 = require("./AbstractObject");
|
|
12
9
|
Object.defineProperty(exports, "AbstractObject", { enumerable: true, get: function () { return AbstractObject_1.AbstractObject; } });
|
|
13
|
-
const BaseObjectCore_1 = require("./BaseObjectCore");
|
|
14
|
-
Object.defineProperty(exports, "BaseObjectCore", { enumerable: true, get: function () { return BaseObjectCore_1.BaseObjectCore; } });
|
|
15
10
|
const BaseObject_1 = require("./BaseObject");
|
|
16
11
|
Object.defineProperty(exports, "BaseObjectProperties", { enumerable: true, get: function () { return BaseObject_1.BaseObjectProperties; } });
|
|
17
|
-
const BaseRepository_1 = __importDefault(require("./BaseRepository"));
|
|
18
|
-
exports.BaseRepository = BaseRepository_1.default;
|
|
19
12
|
const User_1 = require("./User");
|
|
20
13
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
21
14
|
Object.defineProperty(exports, "UserProperties", { enumerable: true, get: function () { return User_1.UserProperties; } });
|
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Core } from './Core';
|
|
2
2
|
import * as statuses from './common/statuses';
|
|
3
|
-
import * as utils from './utils';
|
|
4
3
|
import { Property } from './properties/Property';
|
|
5
4
|
import { BaseProperty, BasePropertyType } from './properties/BaseProperty';
|
|
6
5
|
import { StringProperty, StringPropertyType } from './properties/StringProperty';
|
|
7
6
|
import { EnumProperty, EnumPropertyType } from './properties/EnumProperty';
|
|
8
7
|
import { BooleanProperty, BooleanPropertyType } from './properties/BooleanProperty';
|
|
9
|
-
import { ObjectProperty, ObjectPropertyType } from './properties/ObjectProperty';
|
|
8
|
+
import { ObjectProperty, ObjectPropertyType, returnAs } from './properties/ObjectProperty';
|
|
10
9
|
import { DateTimeProperty, DateTimePropertyType } from './properties/DateTimeProperty';
|
|
11
10
|
import { HashProperty, HashPropertyType } from './properties/HashProperty';
|
|
11
|
+
import { CollectionProperty, CollectionPropertyType } from './properties/CollectionProperty';
|
|
12
|
+
import { ArrayProperty, ArrayPropertyType } from './properties/ArrayProperty';
|
|
12
13
|
import { AbstractObject } from './components/AbstractObject';
|
|
13
14
|
import { ObjectUri } from './components/ObjectUri';
|
|
14
15
|
import { DataObjectClass } from './components/types/DataObjectClass';
|
|
@@ -16,18 +17,7 @@ import { DataObject } from './components/DataObject';
|
|
|
16
17
|
import { BaseObjectCore } from './components/BaseObjectCore';
|
|
17
18
|
import { BaseObject, BaseObjectProperties } from './components/BaseObject';
|
|
18
19
|
import { Proxy } from './components/types/ProxyConstructor';
|
|
19
|
-
import {
|
|
20
|
-
import { InjectKeywordsMiddleware } from './backends/middlewares/InjectKeywordsMiddleware';
|
|
21
|
-
import RepositoryClass from './components/types/RepositoryClass';
|
|
22
|
-
import BaseRepository from './components/BaseRepository';
|
|
23
|
-
import { BackendAction, BackendParameters, BackendParametersKeys, BackendRecordType } from './Backend';
|
|
24
|
-
import Middleware from './backends/middlewares/Middleware';
|
|
25
|
-
import { UserType, User } from './components/User';
|
|
26
|
-
import UserRepository from './components/UserRepository';
|
|
20
|
+
import { UserType, User, UserProperties } from './components/User';
|
|
27
21
|
import { EntityType, Entity } from './components/Entity';
|
|
28
|
-
import EntityRepository from './components/EntityRepository';
|
|
29
|
-
import { AuthAction, AuthParameters, AuthParametersKeys } from './Auth';
|
|
30
|
-
import { AuthInterface, AbstractAuthAdapter, AuthenticationError } from './authentication';
|
|
31
|
-
import { AbstractAdapter, MockAdapter, BackendError, Query, QueryMetaType, QueryResultType, Filter, Filters, Limits, Sorting, SortAndLimit } from './backends';
|
|
32
22
|
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, GoneError } from './common/ResourcesErrors';
|
|
33
|
-
export { statuses,
|
|
23
|
+
export { statuses, Core, Property, BaseProperty, BasePropertyType, BooleanProperty, BooleanPropertyType, DateTimeProperty, DateTimePropertyType, EnumProperty, EnumPropertyType, HashProperty, HashPropertyType, CollectionProperty, CollectionPropertyType, ArrayProperty, ArrayPropertyType, ObjectProperty, ObjectPropertyType, returnAs, StringProperty, StringPropertyType, ObjectUri, DataObjectClass, DataObject, AbstractObject, BaseObject, BaseObjectCore, BaseObjectProperties, User, UserType, UserProperties, Proxy, Entity, EntityType, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, GoneError, };
|
package/lib/index.js
CHANGED
|
@@ -22,17 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.GoneError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.
|
|
26
|
+
exports.GoneError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.Entity = exports.UserProperties = exports.User = exports.BaseObjectProperties = exports.BaseObjectCore = exports.AbstractObject = exports.DataObject = exports.ObjectUri = exports.StringProperty = exports.returnAs = exports.ObjectProperty = exports.ArrayProperty = exports.CollectionProperty = exports.HashProperty = exports.EnumProperty = exports.DateTimeProperty = exports.BooleanProperty = exports.BaseProperty = exports.Property = exports.Core = exports.statuses = void 0;
|
|
30
27
|
const Core_1 = require("./Core");
|
|
31
28
|
Object.defineProperty(exports, "Core", { enumerable: true, get: function () { return Core_1.Core; } });
|
|
32
29
|
const statuses = __importStar(require("./common/statuses"));
|
|
33
30
|
exports.statuses = statuses;
|
|
34
|
-
const utils = __importStar(require("./utils"));
|
|
35
|
-
exports.utils = utils;
|
|
36
31
|
const Property_1 = require("./properties/Property");
|
|
37
32
|
Object.defineProperty(exports, "Property", { enumerable: true, get: function () { return Property_1.Property; } });
|
|
38
33
|
const BaseProperty_1 = require("./properties/BaseProperty");
|
|
@@ -45,10 +40,15 @@ const BooleanProperty_1 = require("./properties/BooleanProperty");
|
|
|
45
40
|
Object.defineProperty(exports, "BooleanProperty", { enumerable: true, get: function () { return BooleanProperty_1.BooleanProperty; } });
|
|
46
41
|
const ObjectProperty_1 = require("./properties/ObjectProperty");
|
|
47
42
|
Object.defineProperty(exports, "ObjectProperty", { enumerable: true, get: function () { return ObjectProperty_1.ObjectProperty; } });
|
|
43
|
+
Object.defineProperty(exports, "returnAs", { enumerable: true, get: function () { return ObjectProperty_1.returnAs; } });
|
|
48
44
|
const DateTimeProperty_1 = require("./properties/DateTimeProperty");
|
|
49
45
|
Object.defineProperty(exports, "DateTimeProperty", { enumerable: true, get: function () { return DateTimeProperty_1.DateTimeProperty; } });
|
|
50
46
|
const HashProperty_1 = require("./properties/HashProperty");
|
|
51
47
|
Object.defineProperty(exports, "HashProperty", { enumerable: true, get: function () { return HashProperty_1.HashProperty; } });
|
|
48
|
+
const CollectionProperty_1 = require("./properties/CollectionProperty");
|
|
49
|
+
Object.defineProperty(exports, "CollectionProperty", { enumerable: true, get: function () { return CollectionProperty_1.CollectionProperty; } });
|
|
50
|
+
const ArrayProperty_1 = require("./properties/ArrayProperty");
|
|
51
|
+
Object.defineProperty(exports, "ArrayProperty", { enumerable: true, get: function () { return ArrayProperty_1.ArrayProperty; } });
|
|
52
52
|
const AbstractObject_1 = require("./components/AbstractObject");
|
|
53
53
|
Object.defineProperty(exports, "AbstractObject", { enumerable: true, get: function () { return AbstractObject_1.AbstractObject; } });
|
|
54
54
|
const ObjectUri_1 = require("./components/ObjectUri");
|
|
@@ -59,37 +59,11 @@ const BaseObjectCore_1 = require("./components/BaseObjectCore");
|
|
|
59
59
|
Object.defineProperty(exports, "BaseObjectCore", { enumerable: true, get: function () { return BaseObjectCore_1.BaseObjectCore; } });
|
|
60
60
|
const BaseObject_1 = require("./components/BaseObject");
|
|
61
61
|
Object.defineProperty(exports, "BaseObjectProperties", { enumerable: true, get: function () { return BaseObject_1.BaseObjectProperties; } });
|
|
62
|
-
const InjectMetaMiddleware_1 = require("./backends/middlewares/InjectMetaMiddleware");
|
|
63
|
-
Object.defineProperty(exports, "InjectMetaMiddleware", { enumerable: true, get: function () { return InjectMetaMiddleware_1.InjectMetaMiddleware; } });
|
|
64
|
-
const InjectKeywordsMiddleware_1 = require("./backends/middlewares/InjectKeywordsMiddleware");
|
|
65
|
-
Object.defineProperty(exports, "InjectKeywordsMiddleware", { enumerable: true, get: function () { return InjectKeywordsMiddleware_1.InjectKeywordsMiddleware; } });
|
|
66
|
-
const BaseRepository_1 = __importDefault(require("./components/BaseRepository"));
|
|
67
|
-
exports.BaseRepository = BaseRepository_1.default;
|
|
68
|
-
const Backend_1 = require("./Backend");
|
|
69
|
-
Object.defineProperty(exports, "BackendAction", { enumerable: true, get: function () { return Backend_1.BackendAction; } });
|
|
70
62
|
const User_1 = require("./components/User");
|
|
71
63
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
72
|
-
|
|
73
|
-
exports.UserRepository = UserRepository_1.default;
|
|
64
|
+
Object.defineProperty(exports, "UserProperties", { enumerable: true, get: function () { return User_1.UserProperties; } });
|
|
74
65
|
const Entity_1 = require("./components/Entity");
|
|
75
66
|
Object.defineProperty(exports, "Entity", { enumerable: true, get: function () { return Entity_1.Entity; } });
|
|
76
|
-
const EntityRepository_1 = __importDefault(require("./components/EntityRepository"));
|
|
77
|
-
exports.EntityRepository = EntityRepository_1.default;
|
|
78
|
-
const Auth_1 = require("./Auth");
|
|
79
|
-
Object.defineProperty(exports, "AuthAction", { enumerable: true, get: function () { return Auth_1.AuthAction; } });
|
|
80
|
-
const authentication_1 = require("./authentication");
|
|
81
|
-
Object.defineProperty(exports, "AbstractAuthAdapter", { enumerable: true, get: function () { return authentication_1.AbstractAuthAdapter; } });
|
|
82
|
-
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return authentication_1.AuthenticationError; } });
|
|
83
|
-
const backends_1 = require("./backends");
|
|
84
|
-
Object.defineProperty(exports, "AbstractAdapter", { enumerable: true, get: function () { return backends_1.AbstractAdapter; } });
|
|
85
|
-
Object.defineProperty(exports, "MockAdapter", { enumerable: true, get: function () { return backends_1.MockAdapter; } });
|
|
86
|
-
Object.defineProperty(exports, "BackendError", { enumerable: true, get: function () { return backends_1.BackendError; } });
|
|
87
|
-
Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return backends_1.Query; } });
|
|
88
|
-
Object.defineProperty(exports, "Filter", { enumerable: true, get: function () { return backends_1.Filter; } });
|
|
89
|
-
Object.defineProperty(exports, "Filters", { enumerable: true, get: function () { return backends_1.Filters; } });
|
|
90
|
-
Object.defineProperty(exports, "Limits", { enumerable: true, get: function () { return backends_1.Limits; } });
|
|
91
|
-
Object.defineProperty(exports, "Sorting", { enumerable: true, get: function () { return backends_1.Sorting; } });
|
|
92
|
-
Object.defineProperty(exports, "SortAndLimit", { enumerable: true, get: function () { return backends_1.SortAndLimit; } });
|
|
93
67
|
const ResourcesErrors_1 = require("./common/ResourcesErrors");
|
|
94
68
|
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return ResourcesErrors_1.BadRequestError; } });
|
|
95
69
|
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return ResourcesErrors_1.UnauthorizedError; } });
|
|
@@ -31,6 +31,9 @@ class ArrayProperty extends BaseProperty_1.BaseProperty {
|
|
|
31
31
|
return this._maxLength;
|
|
32
32
|
}
|
|
33
33
|
set(value, setChanged = true) {
|
|
34
|
+
if (value === null) {
|
|
35
|
+
value = [];
|
|
36
|
+
}
|
|
34
37
|
if (!Array.isArray(value)) {
|
|
35
38
|
throw new Error(`value ${JSON.stringify(value)} is not an array`);
|
|
36
39
|
}
|
|
@@ -51,7 +51,7 @@ class BaseProperty {
|
|
|
51
51
|
throw new Error(`Value '${this._name}' already defined as '${this._value}' and protected from change`);
|
|
52
52
|
}
|
|
53
53
|
if (value !== this._value) {
|
|
54
|
-
console.log(this.name, value, this._value)
|
|
54
|
+
// console.log(this.name, value, this._value)
|
|
55
55
|
this._value = value;
|
|
56
56
|
this._hasChanged = setChanged;
|
|
57
57
|
}
|
|
@@ -61,7 +61,7 @@ class BaseProperty {
|
|
|
61
61
|
return this;
|
|
62
62
|
}
|
|
63
63
|
val(transform = undefined) {
|
|
64
|
-
console.log(transform && transform(this._value), typeof transform);
|
|
64
|
+
// console.log(transform && transform(this._value), typeof transform);
|
|
65
65
|
return typeof transform === 'function'
|
|
66
66
|
? transform(this._value)
|
|
67
67
|
: this._value || this._defaultValue;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BaseProperty, BasePropertyType } from './BaseProperty';
|
|
2
|
-
import { Query, QueryResultType } from '../backends/Query';
|
|
3
|
-
import { Filter } from '../backends/Filter';
|
|
4
2
|
import { ObjectUri } from '../components/ObjectUri';
|
|
5
|
-
import { returnAs } from '../backends/Query';
|
|
6
3
|
import { DataObjectClass } from '../components/types/DataObjectClass';
|
|
7
|
-
import { BaseObjectCore } from '../
|
|
4
|
+
import { BaseObjectCore } from '../';
|
|
8
5
|
export interface CollectionPropertyType extends BasePropertyType {
|
|
9
6
|
instanceOf: typeof BaseObjectCore;
|
|
10
7
|
backend?: any;
|
|
@@ -14,20 +11,8 @@ export declare class CollectionProperty extends BaseProperty {
|
|
|
14
11
|
static TYPE: string;
|
|
15
12
|
protected _value: Array<any> | Array<DataObjectClass<any>> | Array<ObjectUri> | undefined;
|
|
16
13
|
protected _instanceOf: typeof BaseObjectCore;
|
|
17
|
-
protected _backend: any;
|
|
18
14
|
protected _parentKey: string;
|
|
19
|
-
protected _query: Query<any>;
|
|
20
|
-
protected _filters: Filter[] | Filter | undefined;
|
|
21
15
|
constructor(config: CollectionPropertyType);
|
|
22
|
-
protected _setQuery(filters?: Filter[]): Query<typeof BaseObjectCore>;
|
|
23
16
|
set(value: Array<any>, setChanged?: boolean): this;
|
|
24
|
-
/**
|
|
25
|
-
* get objects matching collection class and filters
|
|
26
|
-
* in the requested format
|
|
27
|
-
* @param filters
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
get(filters?: Filter[] | undefined): Query<any>;
|
|
31
|
-
val(transform?: returnAs): Promise<QueryResultType<any>>;
|
|
32
17
|
toJSON(): any[] | DataObjectClass<any>[] | ObjectUri[] | undefined;
|
|
33
18
|
}
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.CollectionProperty = void 0;
|
|
13
4
|
const BaseProperty_1 = require("./BaseProperty");
|
|
14
5
|
const Core_1 = require("../Core");
|
|
15
|
-
const Query_1 = require("../backends/Query");
|
|
16
6
|
class CollectionProperty extends BaseProperty_1.BaseProperty {
|
|
17
7
|
constructor(config) {
|
|
18
8
|
var _a, _b;
|
|
19
9
|
super(config);
|
|
20
10
|
this._value = undefined;
|
|
21
|
-
this._filters = undefined;
|
|
22
|
-
console.log(config);
|
|
23
11
|
if (!config.instanceOf) {
|
|
24
12
|
throw new Error(`Parameter 'instanceOf' is mandatory`);
|
|
25
13
|
}
|
|
@@ -27,41 +15,12 @@ class CollectionProperty extends BaseProperty_1.BaseProperty {
|
|
|
27
15
|
typeof config.instanceOf === 'string'
|
|
28
16
|
? Core_1.Core.classRegistry[config.instanceOf]
|
|
29
17
|
: config.instanceOf;
|
|
30
|
-
this._backend = config.backend
|
|
31
|
-
? Core_1.Core.getBackend(config.backend)
|
|
32
|
-
: undefined;
|
|
33
18
|
this._parentKey =
|
|
34
19
|
config.parentKey || ((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.uri) === null || _b === void 0 ? void 0 : _b.collection) || 'unknown';
|
|
35
|
-
this._query = this._setQuery();
|
|
36
|
-
}
|
|
37
|
-
_setQuery(filters) {
|
|
38
|
-
const query = this._instanceOf.query();
|
|
39
|
-
query.where(this._parentKey, this._parent ? this._parent.uri : 'unknown');
|
|
40
|
-
if (filters) {
|
|
41
|
-
query.filters = filters;
|
|
42
|
-
}
|
|
43
|
-
return query;
|
|
44
20
|
}
|
|
45
21
|
set(value, setChanged = true) {
|
|
46
22
|
return super.set(value, setChanged);
|
|
47
23
|
}
|
|
48
|
-
/**
|
|
49
|
-
* get objects matching collection class and filters
|
|
50
|
-
* in the requested format
|
|
51
|
-
* @param filters
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
get(filters = undefined) {
|
|
55
|
-
if (!this._query || this._filters !== filters) {
|
|
56
|
-
this._query = this._setQuery(filters);
|
|
57
|
-
}
|
|
58
|
-
return this._query;
|
|
59
|
-
}
|
|
60
|
-
val(transform = Query_1.returnAs.AS_DATAOBJECTS) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return yield this.get().execute(transform, this._backend);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
24
|
toJSON() {
|
|
66
25
|
return this._value;
|
|
67
26
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ObjectUri } from '../components/ObjectUri';
|
|
2
|
+
import { BaseProperty, BasePropertyType } from './BaseProperty';
|
|
3
|
+
import { BaseObjectClass } from '../components/types/BaseObjectClass';
|
|
4
|
+
export interface FilePropertyType extends BasePropertyType {
|
|
5
|
+
}
|
|
6
|
+
export declare class FileProperty extends BaseProperty {
|
|
7
|
+
static TYPE: string;
|
|
8
|
+
_value: BaseObjectClass | ObjectUri | undefined;
|
|
9
|
+
constructor(config: FilePropertyType);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileProperty = void 0;
|
|
4
|
+
const BaseProperty_1 = require("./BaseProperty");
|
|
5
|
+
class FileProperty extends BaseProperty_1.BaseProperty {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super(config);
|
|
8
|
+
this._value = undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.FileProperty = FileProperty;
|
|
12
|
+
FileProperty.TYPE = 'file';
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ObjectUri } from '../components/ObjectUri';
|
|
2
2
|
import { BaseProperty, BasePropertyType } from './BaseProperty';
|
|
3
3
|
import { BaseObjectClass } from '../components/types/BaseObjectClass';
|
|
4
|
+
export declare enum returnAs {
|
|
5
|
+
AS_OBJECTURIS = "objectUris",
|
|
6
|
+
AS_DATAOBJECTS = "dataObjects",
|
|
7
|
+
AS_INSTANCES = "classInstances",
|
|
8
|
+
AS_IS = "asIs"
|
|
9
|
+
}
|
|
4
10
|
export interface ObjectPropertyType extends BasePropertyType {
|
|
5
11
|
instanceOf: any;
|
|
6
12
|
}
|
|
@@ -9,6 +15,7 @@ export declare class ObjectProperty extends BaseProperty {
|
|
|
9
15
|
_value: BaseObjectClass | ObjectUri | undefined;
|
|
10
16
|
_instanceOf: any;
|
|
11
17
|
constructor(config: ObjectPropertyType);
|
|
18
|
+
get instanceOf(): any;
|
|
12
19
|
val(transform?: string | undefined): any;
|
|
13
20
|
set(value: object, setChanged?: boolean): this;
|
|
14
21
|
toJSON(): any;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectProperty = void 0;
|
|
3
|
+
exports.ObjectProperty = exports.returnAs = void 0;
|
|
4
4
|
const DataObject_1 = require("../components/DataObject");
|
|
5
5
|
const ObjectUri_1 = require("../components/ObjectUri");
|
|
6
6
|
const BaseProperty_1 = require("./BaseProperty");
|
|
7
|
-
const Query_1 = require("../backends/Query");
|
|
8
7
|
const Core_1 = require("../Core");
|
|
8
|
+
// TODO move in types
|
|
9
|
+
var returnAs;
|
|
10
|
+
(function (returnAs) {
|
|
11
|
+
returnAs["AS_OBJECTURIS"] = "objectUris";
|
|
12
|
+
returnAs["AS_DATAOBJECTS"] = "dataObjects";
|
|
13
|
+
returnAs["AS_INSTANCES"] = "classInstances";
|
|
14
|
+
returnAs["AS_IS"] = "asIs";
|
|
15
|
+
})(returnAs || (exports.returnAs = returnAs = {}));
|
|
9
16
|
class ObjectProperty extends BaseProperty_1.BaseProperty {
|
|
10
17
|
constructor(config) {
|
|
11
18
|
super(config);
|
|
12
19
|
this._value = undefined;
|
|
13
20
|
this._instanceOf = config.instanceOf;
|
|
14
21
|
}
|
|
22
|
+
get instanceOf() {
|
|
23
|
+
return this._instanceOf;
|
|
24
|
+
}
|
|
15
25
|
val(transform = undefined) {
|
|
16
26
|
if (typeof this._instanceOf === 'string') {
|
|
17
|
-
console.log(`Getting instance from string ${this._instanceOf}`);
|
|
18
27
|
this._instanceOf = Core_1.Core.getClass(this._instanceOf);
|
|
19
|
-
//throw new Error(`Parameter 'instanceOf' was not properly setted`)
|
|
20
28
|
}
|
|
21
29
|
if (!this._value) {
|
|
22
30
|
return this._defaultValue;
|
|
23
31
|
}
|
|
24
32
|
switch (transform) {
|
|
25
|
-
case
|
|
33
|
+
case returnAs.AS_DATAOBJECTS:
|
|
26
34
|
if (this._value instanceof DataObject_1.DataObject) {
|
|
27
35
|
console.log(`Returning already existing dataObject`);
|
|
28
36
|
return this._value;
|
|
@@ -38,15 +46,15 @@ class ObjectProperty extends BaseProperty_1.BaseProperty {
|
|
|
38
46
|
console.log(`Converting instance -> dataObject`);
|
|
39
47
|
return this._value.dataObject;
|
|
40
48
|
}
|
|
41
|
-
case
|
|
49
|
+
case returnAs.AS_INSTANCES:
|
|
42
50
|
if (this._value instanceof DataObject_1.DataObject) {
|
|
43
51
|
console.log(`Converting dataObject -> instance`);
|
|
44
52
|
return Reflect.construct(this._instanceOf, [this._value]);
|
|
45
53
|
}
|
|
46
54
|
else if (this._value instanceof ObjectUri_1.ObjectUri) {
|
|
47
|
-
console.log('ObjectProperty', this)
|
|
55
|
+
// console.log('ObjectProperty', this)
|
|
48
56
|
console.log(`Converting objectUri -> dataObject -> instance`);
|
|
49
|
-
console.log(this._instanceOf)
|
|
57
|
+
// console.log(this._instanceOf)
|
|
50
58
|
const dao = DataObject_1.DataObject.factory({
|
|
51
59
|
properties: Reflect.get(this._instanceOf, 'PROPS_DEFINITION'),
|
|
52
60
|
uri: this._value,
|
|
@@ -57,8 +65,7 @@ class ObjectProperty extends BaseProperty_1.BaseProperty {
|
|
|
57
65
|
console.log(`Returning already existing instance`);
|
|
58
66
|
return this._value;
|
|
59
67
|
}
|
|
60
|
-
|
|
61
|
-
case Query_1.returnAs.AS_OBJECTURIS:
|
|
68
|
+
case returnAs.AS_OBJECTURIS:
|
|
62
69
|
default:
|
|
63
70
|
return this._value;
|
|
64
71
|
}
|
|
@@ -7,6 +7,7 @@ import { HashPropertyType } from './HashProperty';
|
|
|
7
7
|
import { StringPropertyType } from './StringProperty';
|
|
8
8
|
import { NumberPropertyType } from './NumberProperty';
|
|
9
9
|
import { ObjectPropertyType } from './ObjectProperty';
|
|
10
|
+
import { FilePropertyType } from './FileProperty';
|
|
10
11
|
export declare class Property {
|
|
11
12
|
static TYPE_ANY: string;
|
|
12
13
|
static TYPE_NUMBER: string;
|
|
@@ -18,5 +19,6 @@ export declare class Property {
|
|
|
18
19
|
static TYPE_DATETIME: string;
|
|
19
20
|
static TYPE_ARRAY: string;
|
|
20
21
|
static TYPE_MAP: string;
|
|
21
|
-
static
|
|
22
|
+
static TYPE_FILE: string;
|
|
23
|
+
static factory(params: ObjectPropertyType & StringPropertyType & NumberPropertyType & EnumPropertyType & BooleanPropertyType & HashPropertyType & DateTimePropertyType & FilePropertyType, parent: DataObjectClass<any>): BaseProperty;
|
|
22
24
|
}
|
|
@@ -12,6 +12,7 @@ const ObjectProperty_1 = require("./ObjectProperty");
|
|
|
12
12
|
const CollectionProperty_1 = require("./CollectionProperty");
|
|
13
13
|
const ArrayProperty_1 = require("./ArrayProperty");
|
|
14
14
|
const MapProperty_1 = require("./MapProperty");
|
|
15
|
+
const FileProperty_1 = require("./FileProperty");
|
|
15
16
|
class Property {
|
|
16
17
|
static factory(params, parent) {
|
|
17
18
|
params.parent = parent;
|
|
@@ -41,6 +42,8 @@ class Property {
|
|
|
41
42
|
return new ArrayProperty_1.ArrayProperty(params);
|
|
42
43
|
case MapProperty_1.MapProperty.TYPE:
|
|
43
44
|
return new MapProperty_1.MapProperty(params);
|
|
45
|
+
case FileProperty_1.FileProperty.TYPE:
|
|
46
|
+
return new FileProperty_1.FileProperty(params);
|
|
44
47
|
default:
|
|
45
48
|
throw new Error(`Unknown property type ${params.type}`);
|
|
46
49
|
}
|
|
@@ -57,3 +60,4 @@ Property.TYPE_HASH = 'hash';
|
|
|
57
60
|
Property.TYPE_DATETIME = 'datetime';
|
|
58
61
|
Property.TYPE_ARRAY = 'array';
|
|
59
62
|
Property.TYPE_MAP = 'map';
|
|
63
|
+
Property.TYPE_FILE = 'file';
|
|
@@ -9,9 +9,10 @@ import { BooleanProperty, BooleanPropertyType } from './BooleanProperty';
|
|
|
9
9
|
import { DateTimeProperty, DateTimePropertyType } from './DateTimeProperty';
|
|
10
10
|
import { ObjectProperty, ObjectPropertyType } from './ObjectProperty';
|
|
11
11
|
import { MapProperty, MapPropertyType } from './MapProperty';
|
|
12
|
+
import { FileProperty, FilePropertyType } from './FileProperty';
|
|
12
13
|
import { CollectionProperty, CollectionPropertyType } from './CollectionProperty';
|
|
13
14
|
import { PropertyTypes } from './types/PropertyTypes';
|
|
14
|
-
export { Property, BaseProperty, BasePropertyType, ArrayProperty, ArrayPropertyType, NumberProperty, NumberPropertyType, BooleanProperty, BooleanPropertyType, DateTimeProperty, DateTimePropertyType, EnumProperty, EnumPropertyType, ObjectProperty, ObjectPropertyType, StringProperty, StringPropertyType, HashProperty, HashPropertyType, MapProperty, MapPropertyType, CollectionProperty, CollectionPropertyType, };
|
|
15
|
+
export { Property, BaseProperty, BasePropertyType, ArrayProperty, ArrayPropertyType, NumberProperty, NumberPropertyType, BooleanProperty, BooleanPropertyType, DateTimeProperty, DateTimePropertyType, EnumProperty, EnumPropertyType, ObjectProperty, ObjectPropertyType, StringProperty, StringPropertyType, HashProperty, HashPropertyType, MapProperty, MapPropertyType, FileProperty, FilePropertyType, CollectionProperty, CollectionPropertyType, };
|
|
15
16
|
type BaseType = {
|
|
16
17
|
type: PropertyTypes;
|
|
17
18
|
};
|
package/lib/properties/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CollectionProperty = exports.MapProperty = exports.HashProperty = exports.StringProperty = exports.ObjectProperty = exports.EnumProperty = exports.DateTimeProperty = exports.BooleanProperty = exports.NumberProperty = exports.ArrayProperty = exports.BaseProperty = exports.Property = void 0;
|
|
3
|
+
exports.CollectionProperty = exports.FileProperty = exports.MapProperty = exports.HashProperty = exports.StringProperty = exports.ObjectProperty = exports.EnumProperty = exports.DateTimeProperty = exports.BooleanProperty = exports.NumberProperty = exports.ArrayProperty = exports.BaseProperty = exports.Property = void 0;
|
|
4
4
|
const Property_1 = require("./Property");
|
|
5
5
|
Object.defineProperty(exports, "Property", { enumerable: true, get: function () { return Property_1.Property; } });
|
|
6
6
|
const BaseProperty_1 = require("./BaseProperty");
|
|
@@ -23,5 +23,7 @@ const ObjectProperty_1 = require("./ObjectProperty");
|
|
|
23
23
|
Object.defineProperty(exports, "ObjectProperty", { enumerable: true, get: function () { return ObjectProperty_1.ObjectProperty; } });
|
|
24
24
|
const MapProperty_1 = require("./MapProperty");
|
|
25
25
|
Object.defineProperty(exports, "MapProperty", { enumerable: true, get: function () { return MapProperty_1.MapProperty; } });
|
|
26
|
+
const FileProperty_1 = require("./FileProperty");
|
|
27
|
+
Object.defineProperty(exports, "FileProperty", { enumerable: true, get: function () { return FileProperty_1.FileProperty; } });
|
|
26
28
|
const CollectionProperty_1 = require("./CollectionProperty");
|
|
27
29
|
Object.defineProperty(exports, "CollectionProperty", { enumerable: true, get: function () { return CollectionProperty_1.CollectionProperty; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/core",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Core objects for business apps",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@tsconfig/recommended": "^1.0.1",
|
|
15
15
|
"@types/jest": "^27.0.3",
|
|
16
|
+
"@types/node-persist": "^3.1.8",
|
|
16
17
|
"jest": "^27.4.7",
|
|
17
18
|
"jest-node-exports-resolver": "^1.1.6",
|
|
18
19
|
"trace-unhandled": "^2.0.1",
|
|
@@ -21,7 +22,8 @@
|
|
|
21
22
|
"typescript": "^5.1.5"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@faker-js/faker": "^7.6.0"
|
|
25
|
+
"@faker-js/faker": "^7.6.0",
|
|
26
|
+
"node-persist": "^4.0.3"
|
|
25
27
|
},
|
|
26
28
|
"scripts": {
|
|
27
29
|
"test": "tsc && jest --verbose",
|