@opra/common 1.0.0-alpha.3 → 1.0.0-alpha.31
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/browser.js +6035 -5791
- package/cjs/document/api-document.js +11 -0
- package/cjs/document/common/api-base.js +1 -1
- package/cjs/document/common/document-element.js +4 -1
- package/cjs/document/data-type/api-field.js +12 -6
- package/cjs/document/data-type/complex-type-base.js +10 -3
- package/cjs/document/data-type/complex-type.js +6 -2
- package/cjs/document/data-type/data-type.js +2 -1
- package/cjs/document/data-type/enum-type.js +5 -2
- package/cjs/document/data-type/extended-types/base64.type.js +4 -0
- package/cjs/document/data-type/extended-types/date-string.type.js +6 -2
- package/cjs/document/data-type/extended-types/date-time-string.type.js +6 -2
- package/cjs/document/data-type/extended-types/date-time.type.js +6 -2
- package/cjs/document/data-type/extended-types/date.type.js +6 -2
- package/cjs/document/data-type/extended-types/email.type.js +6 -2
- package/cjs/document/data-type/extended-types/field-path.type.js +5 -3
- package/cjs/document/data-type/extended-types/filter.type.js +19 -17
- package/cjs/document/data-type/extended-types/object-id.type.js +4 -0
- package/cjs/document/data-type/extended-types/time.type.js +6 -2
- package/cjs/document/data-type/extended-types/url.type.js +6 -2
- package/cjs/document/data-type/extended-types/uuid.type.js +4 -0
- package/cjs/document/data-type/mapped-type.js +12 -5
- package/cjs/document/data-type/mixin-type.js +5 -1
- package/cjs/document/data-type/omit-type.js +7 -2
- package/cjs/document/data-type/partial-type.js +7 -2
- package/cjs/document/data-type/pick-type.js +1 -2
- package/cjs/document/data-type/primitive-types/bigint.type.js +4 -0
- package/cjs/document/data-type/primitive-types/boolean.type.js +4 -0
- package/cjs/document/data-type/primitive-types/integer.type.js +4 -0
- package/cjs/document/data-type/primitive-types/null.type.js +4 -0
- package/cjs/document/data-type/primitive-types/number.type.js +4 -0
- package/cjs/document/data-type/primitive-types/object.type.js +0 -3
- package/cjs/document/data-type/primitive-types/string.type.js +4 -0
- package/cjs/document/data-type/required-type.js +1 -2
- package/cjs/document/data-type/simple-type.js +17 -16
- package/cjs/document/data-type/utils/create-mapped-class.js +3 -3
- package/cjs/document/data-type/utils/get-is-inherited-predicate-fn.js +1 -2
- package/cjs/document/decorators/api-field-decorator.js +4 -6
- package/cjs/document/decorators/complex-type.decorator.js +1 -2
- package/cjs/document/decorators/http-controller.decorator.js +26 -2
- package/cjs/document/decorators/http-operation-entity.decorator.js +123 -93
- package/cjs/document/decorators/http-operation.decorator.js +12 -6
- package/cjs/document/decorators/simple-type.decorator.js +2 -3
- package/cjs/document/factory/api-document.factory.js +14 -11
- package/cjs/document/factory/data-type.factory.js +97 -56
- package/cjs/document/factory/http-api.factory.js +3 -1
- package/cjs/document/http/http-api.js +2 -3
- package/cjs/document/http/http-controller.js +26 -14
- package/cjs/document/http/http-media-type.js +21 -4
- package/cjs/document/http/http-operation-response.js +2 -2
- package/cjs/document/http/http-operation.js +28 -4
- package/cjs/document/http/http-parameter.js +4 -0
- package/cjs/document/http/http-request-body.js +0 -1
- package/cjs/document/http/http-status-range.js +6 -4
- package/cjs/document/index.js +5 -5
- package/cjs/document/utils/parse-regexp.util.js +1 -2
- package/cjs/document/utils/string-compare.util.js +1 -2
- package/cjs/exception/index.js +5 -5
- package/cjs/exception/opra-exception.js +1 -0
- package/cjs/filter/antlr/OpraFilterParser.js +28 -82
- package/cjs/filter/ast/index.js +1 -1
- package/cjs/filter/build.js +22 -25
- package/cjs/filter/filter-rules.js +4 -2
- package/cjs/filter/opra-filter.ns.js +2 -2
- package/cjs/filter/parse.js +2 -5
- package/cjs/filter/utils.js +2 -3
- package/cjs/helpers/function-utils.js +1 -2
- package/cjs/helpers/get-stack-filename.js +2 -3
- package/cjs/helpers/mixin-utils.js +4 -4
- package/cjs/helpers/monkey-patches.js +4 -2
- package/cjs/helpers/object-utils.js +5 -6
- package/cjs/helpers/parse-fields-projection.js +4 -6
- package/cjs/helpers/responsive-map.js +5 -4
- package/cjs/helpers/type-guards.js +10 -11
- package/cjs/i18n/i18n.js +4 -3
- package/cjs/i18n/index.js +1 -1
- package/cjs/i18n/string-utils.js +2 -3
- package/cjs/i18n/translate.js +1 -2
- package/cjs/index.js +1 -1
- package/cjs/schema/type-guards.js +7 -8
- package/esm/document/api-document.js +11 -0
- package/esm/document/common/api-base.js +1 -1
- package/esm/document/common/document-element.js +4 -1
- package/esm/document/data-type/api-field.js +12 -6
- package/esm/document/data-type/complex-type-base.js +10 -3
- package/esm/document/data-type/complex-type.js +6 -2
- package/esm/document/data-type/data-type.js +2 -1
- package/esm/document/data-type/enum-type.js +5 -2
- package/esm/document/data-type/extended-types/base64.type.js +4 -0
- package/esm/document/data-type/extended-types/date-string.type.js +6 -2
- package/esm/document/data-type/extended-types/date-time-string.type.js +6 -2
- package/esm/document/data-type/extended-types/date-time.type.js +6 -2
- package/esm/document/data-type/extended-types/date.type.js +6 -2
- package/esm/document/data-type/extended-types/email.type.js +6 -2
- package/esm/document/data-type/extended-types/field-path.type.js +5 -3
- package/esm/document/data-type/extended-types/filter.type.js +19 -17
- package/esm/document/data-type/extended-types/object-id.type.js +4 -0
- package/esm/document/data-type/extended-types/time.type.js +6 -2
- package/esm/document/data-type/extended-types/url.type.js +6 -2
- package/esm/document/data-type/extended-types/uuid.type.js +4 -0
- package/esm/document/data-type/mapped-type.js +12 -5
- package/esm/document/data-type/mixin-type.js +5 -1
- package/esm/document/data-type/omit-type.js +6 -0
- package/esm/document/data-type/partial-type.js +6 -0
- package/esm/document/data-type/primitive-types/bigint.type.js +4 -0
- package/esm/document/data-type/primitive-types/boolean.type.js +4 -0
- package/esm/document/data-type/primitive-types/integer.type.js +4 -0
- package/esm/document/data-type/primitive-types/null.type.js +4 -0
- package/esm/document/data-type/primitive-types/number.type.js +4 -0
- package/esm/document/data-type/primitive-types/object.type.js +0 -3
- package/esm/document/data-type/primitive-types/string.type.js +4 -0
- package/esm/document/data-type/simple-type.js +17 -16
- package/esm/document/data-type/utils/create-mapped-class.js +2 -1
- package/esm/document/decorators/api-field-decorator.js +1 -2
- package/esm/document/decorators/http-controller.decorator.js +25 -0
- package/esm/document/decorators/http-operation-entity.decorator.js +80 -50
- package/esm/document/decorators/http-operation.decorator.js +11 -4
- package/esm/document/factory/api-document.factory.js +14 -10
- package/esm/document/factory/data-type.factory.js +97 -56
- package/esm/document/factory/http-api.factory.js +3 -1
- package/esm/document/http/http-api.js +2 -3
- package/esm/document/http/http-controller.js +25 -14
- package/esm/document/http/http-media-type.js +20 -4
- package/esm/document/http/http-operation-response.js +2 -2
- package/esm/document/http/http-operation.js +27 -4
- package/esm/document/http/http-parameter.js +4 -0
- package/esm/document/http/http-request-body.js +0 -1
- package/esm/document/http/http-status-range.js +6 -4
- package/esm/document/index.js +5 -5
- package/esm/exception/index.js +5 -5
- package/esm/exception/opra-exception.js +1 -0
- package/esm/filter/antlr/OpraFilterParser.js +28 -82
- package/esm/filter/ast/index.js +1 -1
- package/esm/filter/build.js +1 -3
- package/esm/filter/filter-rules.js +4 -2
- package/esm/filter/opra-filter.ns.js +2 -2
- package/esm/filter/parse.js +1 -3
- package/esm/helpers/mixin-utils.js +2 -1
- package/esm/helpers/monkey-patches.js +4 -2
- package/esm/helpers/object-utils.js +2 -2
- package/esm/helpers/parse-fields-projection.js +1 -3
- package/esm/helpers/responsive-map.js +5 -4
- package/esm/i18n/i18n.js +4 -3
- package/esm/i18n/index.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +12 -8
- package/types/document/api-document.d.ts +1 -0
- package/types/document/common/api-base.d.ts +1 -1
- package/types/document/common/document-element.d.ts +1 -0
- package/types/document/data-type/api-field.d.ts +12 -0
- package/types/document/data-type/complex-type-base.d.ts +1 -1
- package/types/document/data-type/complex-type.d.ts +1 -1
- package/types/document/data-type/data-type.d.ts +5 -2
- package/types/document/data-type/enum-type.d.ts +2 -2
- package/types/document/data-type/mapped-type.d.ts +3 -3
- package/types/document/data-type/mixin-type.d.ts +2 -2
- package/types/document/data-type/omit-type.d.ts +0 -6
- package/types/document/data-type/partial-type.d.ts +0 -6
- package/types/document/data-type/pick-type.d.ts +2 -2
- package/types/document/data-type/required-type.d.ts +7 -7
- package/types/document/data-type/simple-type.d.ts +4 -2
- package/types/document/decorators/http-controller.decorator.d.ts +1 -0
- package/types/document/decorators/http-operation-entity.decorator.d.ts +1 -0
- package/types/document/factory/data-type.factory.d.ts +5 -0
- package/types/document/http/http-api.d.ts +1 -1
- package/types/document/http/http-controller.d.ts +1 -0
- package/types/document/http/http-media-type.d.ts +2 -1
- package/types/document/http/http-operation.d.ts +5 -3
- package/types/document/http/http-parameter.d.ts +3 -2
- package/types/document/http/http-status-range.d.ts +2 -1
- package/types/document/index.d.ts +5 -5
- package/types/exception/index.d.ts +5 -5
- package/types/filter/ast/index.d.ts +1 -1
- package/types/filter/opra-filter.ns.d.ts +2 -2
- package/types/helpers/type-guards.d.ts +0 -2
- package/types/i18n/i18n.d.ts +21 -19
- package/types/index.d.ts +1 -1
- package/types/schema/data-type/data-type.interface.d.ts +1 -1
- package/types/schema/data-type/mapped-type.interface.d.ts +2 -2
- package/types/schema/data-type/simple-type.interface.d.ts +4 -0
- package/types/schema/data-type-container.interface.d.ts +1 -1
- package/types/schema/document.interface.d.ts +1 -1
- package/types/schema/http/http-controller.interface.d.ts +2 -2
- package/types/schema/http/http-media-type.interface.d.ts +1 -1
- package/types/schema/http/http-operation-response.interface.d.ts +2 -2
- package/types/schema/http/http-operation.interface.d.ts +8 -4
- package/types/schema/http/http-parameter.interface.d.ts +5 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ApiDocument = void 0;
|
|
5
|
+
const super_fast_md5_1 = require("super-fast-md5");
|
|
5
6
|
const index_js_1 = require("../helpers/index.js");
|
|
6
7
|
const index_js_2 = require("../schema/index.js");
|
|
7
8
|
const data_type_map_js_1 = require("./common/data-type-map.js");
|
|
@@ -16,6 +17,8 @@ class ApiDocument extends document_element_js_1.DocumentElement {
|
|
|
16
17
|
constructor() {
|
|
17
18
|
super(null);
|
|
18
19
|
this[_a] = new WeakMap();
|
|
20
|
+
this.id = '';
|
|
21
|
+
this.info = {};
|
|
19
22
|
this.references = new index_js_1.ResponsiveMap();
|
|
20
23
|
this.types = new data_type_map_js_1.DataTypeMap();
|
|
21
24
|
this.node[constants_js_1.kDataTypeMap] = this.types;
|
|
@@ -80,6 +83,14 @@ class ApiDocument extends document_element_js_1.DocumentElement {
|
|
|
80
83
|
out.api = this.api.toJSON();
|
|
81
84
|
return out;
|
|
82
85
|
}
|
|
86
|
+
invalidate() {
|
|
87
|
+
/** Generate id */
|
|
88
|
+
const x = this.export();
|
|
89
|
+
delete x.id;
|
|
90
|
+
this.id = (0, super_fast_md5_1.md5)(JSON.stringify(x));
|
|
91
|
+
/** Clear [kTypeNSMap] */
|
|
92
|
+
this[constants_js_1.kTypeNSMap] = new WeakMap();
|
|
93
|
+
}
|
|
83
94
|
_findDataType(nameOrCtor, visitedRefs) {
|
|
84
95
|
let result = this.types.get(nameOrCtor);
|
|
85
96
|
if (result || !this.references.size)
|
|
@@ -7,7 +7,7 @@ const document_element_js_1 = require("./document-element.js");
|
|
|
7
7
|
class ApiBase extends document_element_js_1.DocumentElement {
|
|
8
8
|
constructor(owner) {
|
|
9
9
|
super(owner);
|
|
10
|
-
this.
|
|
10
|
+
this.name = 'OpraApi';
|
|
11
11
|
}
|
|
12
12
|
toJSON() {
|
|
13
13
|
return (0, index_js_1.omitUndefined)({
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocumentElement = void 0;
|
|
4
4
|
const ts_gems_1 = require("ts-gems");
|
|
5
|
+
const uid_1 = require("uid");
|
|
5
6
|
const document_node_js_1 = require("./document-node.js");
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
@@ -11,17 +12,19 @@ exports.DocumentElement = function (owner) {
|
|
|
11
12
|
if (!this)
|
|
12
13
|
throw new TypeError('"this" should be passed to call class constructor');
|
|
13
14
|
const _this = (0, ts_gems_1.asMutable)(this);
|
|
15
|
+
_this.id = (0, uid_1.uid)(16);
|
|
14
16
|
Object.defineProperty(_this, 'node', {
|
|
15
17
|
value: new document_node_js_1.DocumentNode(this, owner?.node),
|
|
16
18
|
enumerable: false,
|
|
17
19
|
writable: true,
|
|
18
20
|
});
|
|
19
|
-
if (owner)
|
|
21
|
+
if (owner) {
|
|
20
22
|
Object.defineProperty(_this, 'owner', {
|
|
21
23
|
value: owner,
|
|
22
24
|
enumerable: false,
|
|
23
25
|
writable: true,
|
|
24
26
|
});
|
|
27
|
+
}
|
|
25
28
|
};
|
|
26
29
|
/**
|
|
27
30
|
* @class DocumentElement
|
|
@@ -24,8 +24,9 @@ exports.ApiField = function (...args) {
|
|
|
24
24
|
_this.name = initArgs.name;
|
|
25
25
|
const origin = initArgs.origin || owner;
|
|
26
26
|
/* istanbul ignore next */
|
|
27
|
-
if (!(origin instanceof complex_type_base_js_1.ComplexTypeBase))
|
|
27
|
+
if (!(origin instanceof complex_type_base_js_1.ComplexTypeBase)) {
|
|
28
28
|
throw new Error('Field origin should be one of ComplexType, MappedType or MixinType');
|
|
29
|
+
}
|
|
29
30
|
_this.origin = origin;
|
|
30
31
|
_this.type = initArgs.type || owner.node.getDataType('any');
|
|
31
32
|
_this.description = initArgs.description;
|
|
@@ -36,7 +37,10 @@ exports.ApiField = function (...args) {
|
|
|
36
37
|
_this.exclusive = initArgs.exclusive;
|
|
37
38
|
_this.translatable = initArgs.translatable;
|
|
38
39
|
_this.deprecated = initArgs.deprecated;
|
|
40
|
+
_this.readonly = initArgs.readonly;
|
|
41
|
+
_this.writeonly = initArgs.writeonly;
|
|
39
42
|
_this.examples = initArgs.examples;
|
|
43
|
+
_this.hidden = initArgs.hidden;
|
|
40
44
|
};
|
|
41
45
|
/**
|
|
42
46
|
*
|
|
@@ -48,13 +52,15 @@ class ApiFieldClass extends document_element_js_1.DocumentElement {
|
|
|
48
52
|
return (0, index_js_1.omitUndefined)({
|
|
49
53
|
type: typeName ? typeName : this.type?.toJSON(),
|
|
50
54
|
description: this.description,
|
|
51
|
-
isArray: this.isArray,
|
|
55
|
+
isArray: this.isArray || undefined,
|
|
52
56
|
default: this.default,
|
|
53
57
|
fixed: this.fixed,
|
|
54
|
-
required: this.required,
|
|
55
|
-
exclusive: this.exclusive,
|
|
56
|
-
translatable: this.translatable,
|
|
57
|
-
deprecated: this.deprecated,
|
|
58
|
+
required: this.required || undefined,
|
|
59
|
+
exclusive: this.exclusive || undefined,
|
|
60
|
+
translatable: this.translatable || undefined,
|
|
61
|
+
deprecated: this.deprecated || undefined,
|
|
62
|
+
readonly: this.readonly || undefined,
|
|
63
|
+
writeonly: this.writeonly || undefined,
|
|
58
64
|
examples: this.examples,
|
|
59
65
|
});
|
|
60
66
|
}
|
|
@@ -118,8 +118,9 @@ class ComplexTypeBaseClass extends data_type_js_1.DataType {
|
|
|
118
118
|
: options?.projection;
|
|
119
119
|
const schema = this._generateSchema(codec, { ...options, projection, currentPath: '' });
|
|
120
120
|
let additionalFields;
|
|
121
|
-
if (this.additionalFields instanceof data_type_js_1.DataType)
|
|
121
|
+
if (this.additionalFields instanceof data_type_js_1.DataType) {
|
|
122
122
|
additionalFields = this.additionalFields.generateCodec(codec, options);
|
|
123
|
+
}
|
|
123
124
|
else if (typeof this.additionalFields === 'boolean')
|
|
124
125
|
additionalFields = this.additionalFields;
|
|
125
126
|
else if (Array.isArray(this.additionalFields)) {
|
|
@@ -131,7 +132,7 @@ class ComplexTypeBaseClass extends data_type_js_1.DataType {
|
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
return valgen_1.vg.isObject(schema, {
|
|
134
|
-
ctor: this.ctor,
|
|
135
|
+
ctor: this.name === 'object' ? Object : this.ctor,
|
|
135
136
|
additionalFields,
|
|
136
137
|
name: this.name,
|
|
137
138
|
coerce: true,
|
|
@@ -146,6 +147,12 @@ class ComplexTypeBaseClass extends data_type_js_1.DataType {
|
|
|
146
147
|
// Process fields
|
|
147
148
|
let fieldName;
|
|
148
149
|
for (const field of this.fields.values()) {
|
|
150
|
+
if ((context.ignoreReadonlyFields && field.readonly) ||
|
|
151
|
+
(context.ignoreWriteonlyFields && field.writeonly) ||
|
|
152
|
+
(context.ignoreHiddenFields && field.hidden)) {
|
|
153
|
+
schema[field.name] = valgen_1.vg.isUndefined({ coerce: true });
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
149
156
|
fieldName = field.name;
|
|
150
157
|
let p;
|
|
151
158
|
if (projection !== '*') {
|
|
@@ -164,7 +171,7 @@ class ComplexTypeBaseClass extends data_type_js_1.DataType {
|
|
|
164
171
|
const fn = this._generateFieldCodec(codec, field, {
|
|
165
172
|
...context,
|
|
166
173
|
partial: context.partial === 'deep' ? context.partial : undefined,
|
|
167
|
-
projection
|
|
174
|
+
projection,
|
|
168
175
|
currentPath: currentPath + (currentPath ? '.' : '') + fieldName,
|
|
169
176
|
});
|
|
170
177
|
schema[fieldName] = context.partial || !field.required ? valgen_1.vg.optional(fn) : valgen_1.vg.required(fn);
|
|
@@ -29,11 +29,13 @@ exports.ComplexType = function (...args) {
|
|
|
29
29
|
if (initArgs.base) {
|
|
30
30
|
context.enter('.base', () => {
|
|
31
31
|
// noinspection SuspiciousTypeOfGuard
|
|
32
|
-
if (!(initArgs.base instanceof complex_type_base_js_1.ComplexTypeBase))
|
|
32
|
+
if (!(initArgs.base instanceof complex_type_base_js_1.ComplexTypeBase)) {
|
|
33
33
|
throw new TypeError(`"${initArgs.base.kind}" can't be set as base for a "${this.kind}"`);
|
|
34
|
+
}
|
|
34
35
|
_this.base = initArgs.base;
|
|
35
|
-
if (_this.additionalFields == null && _this.base.additionalFields)
|
|
36
|
+
if (_this.additionalFields == null && _this.base.additionalFields) {
|
|
36
37
|
_this.additionalFields = _this.base.additionalFields;
|
|
38
|
+
}
|
|
37
39
|
/** Copy fields from base */
|
|
38
40
|
for (const v of _this.base.fields.values()) {
|
|
39
41
|
this.fields.set(v.name, new api_field_js_1.ApiField(this, v));
|
|
@@ -60,6 +62,8 @@ exports.ComplexType = function (...args) {
|
|
|
60
62
|
*/
|
|
61
63
|
class ComplexTypeClass extends complex_type_base_js_1.ComplexTypeBase {
|
|
62
64
|
extendsFrom(baseType) {
|
|
65
|
+
if (!(baseType instanceof data_type_js_1.DataType))
|
|
66
|
+
baseType = this.node.getDataType(baseType);
|
|
63
67
|
if (!(baseType instanceof complex_type_base_js_1.ComplexTypeBase))
|
|
64
68
|
return false;
|
|
65
69
|
if (baseType === this)
|
|
@@ -14,8 +14,9 @@ exports.DataType = function (owner, initArgs,
|
|
|
14
14
|
context) {
|
|
15
15
|
if (!this)
|
|
16
16
|
throw new TypeError('"this" should be passed to call class constructor');
|
|
17
|
-
if (initArgs?.name && !constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
17
|
+
if (initArgs?.name && !constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name)) {
|
|
18
18
|
throw new TypeError(`"${initArgs.name}" is not a valid DataType name`);
|
|
19
|
+
}
|
|
19
20
|
document_element_js_1.DocumentElement.call(this, owner);
|
|
20
21
|
const _this = (0, ts_gems_1.asMutable)(this);
|
|
21
22
|
_this.kind = initArgs.kind;
|
|
@@ -22,8 +22,9 @@ exports.EnumType = function (...args) {
|
|
|
22
22
|
_this.kind = index_js_2.OpraSchema.EnumType.Kind;
|
|
23
23
|
if (initArgs.base) {
|
|
24
24
|
// noinspection SuspiciousTypeOfGuard
|
|
25
|
-
if (!(initArgs.base instanceof exports.EnumType))
|
|
26
|
-
throw new TypeError(`"${initArgs.base.kind}" can't be set as base for a "${
|
|
25
|
+
if (!(initArgs.base instanceof exports.EnumType)) {
|
|
26
|
+
throw new TypeError(`"${initArgs.base.kind}" can't be set as base for a "${_this.kind}"`);
|
|
27
|
+
}
|
|
27
28
|
_this.base = initArgs.base;
|
|
28
29
|
}
|
|
29
30
|
_this.instance = initArgs.instance;
|
|
@@ -38,6 +39,8 @@ exports.EnumType = function (...args) {
|
|
|
38
39
|
*/
|
|
39
40
|
class EnumTypeClass extends data_type_js_1.DataType {
|
|
40
41
|
extendsFrom(baseType) {
|
|
42
|
+
if (!(baseType instanceof data_type_js_1.DataType))
|
|
43
|
+
baseType = this.node.getDataType(baseType);
|
|
41
44
|
if (!(baseType instanceof exports.EnumType))
|
|
42
45
|
return false;
|
|
43
46
|
if (baseType === this)
|
|
@@ -21,6 +21,10 @@ exports.Base64Type = Base64Type;
|
|
|
21
21
|
exports.Base64Type = Base64Type = tslib_1.__decorate([
|
|
22
22
|
(0, simple_type_js_1.SimpleType)({
|
|
23
23
|
description: 'A stream of bytes, base64 encoded',
|
|
24
|
+
nameMappings: {
|
|
25
|
+
js: 'string',
|
|
26
|
+
json: 'string',
|
|
27
|
+
},
|
|
24
28
|
}),
|
|
25
29
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
26
30
|
], Base64Type);
|
|
@@ -37,11 +37,15 @@ tslib_1.__decorate([
|
|
|
37
37
|
tslib_1.__metadata("design:type", String)
|
|
38
38
|
], DateStringType.prototype, "maxValue", void 0);
|
|
39
39
|
exports.DateStringType = DateStringType = tslib_1.__decorate([
|
|
40
|
-
(0, simple_type_js_1.SimpleType)({
|
|
40
|
+
((0, simple_type_js_1.SimpleType)({
|
|
41
41
|
description: 'Date string value',
|
|
42
|
+
nameMappings: {
|
|
43
|
+
js: 'string',
|
|
44
|
+
json: 'string',
|
|
45
|
+
},
|
|
42
46
|
})
|
|
43
47
|
.Example('2021-04-18', 'Full date value')
|
|
44
48
|
.Example('2021-04', 'Date value without day')
|
|
45
|
-
.Example('2021', 'Year only value'),
|
|
49
|
+
.Example('2021', 'Year only value')),
|
|
46
50
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
47
51
|
], DateStringType);
|
|
@@ -37,14 +37,18 @@ tslib_1.__decorate([
|
|
|
37
37
|
tslib_1.__metadata("design:type", String)
|
|
38
38
|
], DateTimeStringType.prototype, "maxValue", void 0);
|
|
39
39
|
exports.DateTimeStringType = DateTimeStringType = tslib_1.__decorate([
|
|
40
|
-
(0, simple_type_js_1.SimpleType)({
|
|
40
|
+
((0, simple_type_js_1.SimpleType)({
|
|
41
41
|
description: 'DateTime string value',
|
|
42
|
+
nameMappings: {
|
|
43
|
+
js: 'string',
|
|
44
|
+
json: 'string',
|
|
45
|
+
},
|
|
42
46
|
})
|
|
43
47
|
.Example('2021-04-18T22:30:15+01:00', 'Full date-time value with timezone')
|
|
44
48
|
.Example('2021-04-18T22:30:15', 'Full date-time value without timezone')
|
|
45
49
|
.Example('2021-04-18 22:30', 'Date-time value')
|
|
46
50
|
.Example('2021-04-18', 'Date value')
|
|
47
51
|
.Example('2021-04', 'Date value without day')
|
|
48
|
-
.Example('2021', 'Year only value'),
|
|
52
|
+
.Example('2021', 'Year only value')),
|
|
49
53
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
50
54
|
], DateTimeStringType);
|
|
@@ -51,11 +51,15 @@ tslib_1.__decorate([
|
|
|
51
51
|
tslib_1.__metadata("design:type", String)
|
|
52
52
|
], DateTimeType.prototype, "maxValue", void 0);
|
|
53
53
|
exports.DateTimeType = DateTimeType = tslib_1.__decorate([
|
|
54
|
-
(0, simple_type_js_1.SimpleType)({
|
|
54
|
+
((0, simple_type_js_1.SimpleType)({
|
|
55
55
|
description: 'A full datetime value',
|
|
56
|
+
nameMappings: {
|
|
57
|
+
js: 'string',
|
|
58
|
+
json: 'string',
|
|
59
|
+
},
|
|
56
60
|
})
|
|
57
61
|
.Example('2021-04-18T22:30:15')
|
|
58
62
|
.Example('2021-04-18 22:30:15')
|
|
59
|
-
.Example('2021-04-18 22:30'),
|
|
63
|
+
.Example('2021-04-18 22:30')),
|
|
60
64
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
61
65
|
], DateTimeType);
|
|
@@ -51,8 +51,12 @@ tslib_1.__decorate([
|
|
|
51
51
|
tslib_1.__metadata("design:type", String)
|
|
52
52
|
], DateType.prototype, "maxValue", void 0);
|
|
53
53
|
exports.DateType = DateType = tslib_1.__decorate([
|
|
54
|
-
(0, simple_type_js_1.SimpleType)({
|
|
54
|
+
((0, simple_type_js_1.SimpleType)({
|
|
55
55
|
description: 'A date without time',
|
|
56
|
-
|
|
56
|
+
nameMappings: {
|
|
57
|
+
js: 'Date',
|
|
58
|
+
json: 'string',
|
|
59
|
+
},
|
|
60
|
+
}).Example('2021-04-18', 'Full date value')),
|
|
57
61
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
58
62
|
], DateType);
|
|
@@ -83,8 +83,12 @@ tslib_1.__decorate([
|
|
|
83
83
|
tslib_1.__metadata("design:type", String)
|
|
84
84
|
], EmailType.prototype, "blacklistedChars", void 0);
|
|
85
85
|
exports.EmailType = EmailType = tslib_1.__decorate([
|
|
86
|
-
(0, simple_type_js_1.SimpleType)({
|
|
86
|
+
((0, simple_type_js_1.SimpleType)({
|
|
87
87
|
description: 'An email value',
|
|
88
|
-
|
|
88
|
+
nameMappings: {
|
|
89
|
+
js: 'string',
|
|
90
|
+
json: 'string',
|
|
91
|
+
},
|
|
92
|
+
}).Example('some.body@example.com')),
|
|
89
93
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
90
94
|
], EmailType);
|
|
@@ -15,9 +15,7 @@ let FieldPathType = class FieldPathType {
|
|
|
15
15
|
? element.node.getComplexType(properties.dataType)
|
|
16
16
|
: element.node.getComplexType('object');
|
|
17
17
|
const allowSigns = properties.allowSigns;
|
|
18
|
-
const decodeFieldPath = (0, valgen_1.validator)('decodeFieldPath',
|
|
19
|
-
return dataType.normalizeFieldPath(input, { allowSigns });
|
|
20
|
-
});
|
|
18
|
+
const decodeFieldPath = (0, valgen_1.validator)('decodeFieldPath', (input) => dataType.normalizeFieldPath(input, { allowSigns }));
|
|
21
19
|
return valgen_1.vg.pipe([valgen_1.toString, decodeFieldPath]);
|
|
22
20
|
}
|
|
23
21
|
[constants_js_1.ENCODER](properties, element) {
|
|
@@ -52,6 +50,10 @@ tslib_1.__decorate([
|
|
|
52
50
|
exports.FieldPathType = FieldPathType = tslib_1.__decorate([
|
|
53
51
|
(0, simple_type_js_1.SimpleType)({
|
|
54
52
|
description: 'Field path',
|
|
53
|
+
nameMappings: {
|
|
54
|
+
js: 'string',
|
|
55
|
+
json: 'string',
|
|
56
|
+
},
|
|
55
57
|
}),
|
|
56
58
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
57
59
|
], FieldPathType);
|
|
@@ -49,27 +49,29 @@ tslib_1.__decorate([
|
|
|
49
49
|
exports.FilterType = FilterType = tslib_1.__decorate([
|
|
50
50
|
(0, simple_type_js_1.SimpleType)({
|
|
51
51
|
description: 'A query filter',
|
|
52
|
+
nameMappings: {
|
|
53
|
+
js: 'object',
|
|
54
|
+
json: 'string',
|
|
55
|
+
},
|
|
52
56
|
}),
|
|
53
57
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
54
58
|
], FilterType);
|
|
55
|
-
const decodeFilter = (dataType, rules) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return filter;
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
context.fail(_this, `Not a valid filter expression. ${e.message}`, input, e.errors);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
59
|
+
const decodeFilter = (dataType, rules) => (0, valgen_1.validator)('decodeFilter', (input, context, _this) => {
|
|
60
|
+
if (typeof input === 'string') {
|
|
61
|
+
try {
|
|
62
|
+
const filter = index_js_1.OpraFilter.parse(input);
|
|
63
|
+
if (rules)
|
|
64
|
+
return rules.normalizeFilter(filter, dataType);
|
|
65
|
+
return filter;
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
catch (e) {
|
|
68
|
+
context.fail(_this, `Not a valid filter expression. ${e.message}`, input, e.errors);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
context.fail(_this, `Nt a valid filter expression string`, input);
|
|
73
|
+
});
|
|
74
|
+
const encodeFilter = (0, valgen_1.validator)('encodeFilter', (input, context, _this) => {
|
|
73
75
|
if (input instanceof index_js_1.OpraFilter.Ast) {
|
|
74
76
|
return input.toString();
|
|
75
77
|
}
|
|
@@ -21,6 +21,10 @@ exports.ObjectIdType = ObjectIdType;
|
|
|
21
21
|
exports.ObjectIdType = ObjectIdType = tslib_1.__decorate([
|
|
22
22
|
(0, simple_type_js_1.SimpleType)({
|
|
23
23
|
description: 'A MongoDB ObjectID value',
|
|
24
|
+
nameMappings: {
|
|
25
|
+
js: 'object',
|
|
26
|
+
json: 'string',
|
|
27
|
+
},
|
|
24
28
|
}),
|
|
25
29
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
26
30
|
], ObjectIdType);
|
|
@@ -41,10 +41,14 @@ tslib_1.__decorate([
|
|
|
41
41
|
tslib_1.__metadata("design:type", String)
|
|
42
42
|
], TimeType.prototype, "maxValue", void 0);
|
|
43
43
|
exports.TimeType = TimeType = tslib_1.__decorate([
|
|
44
|
-
(0, simple_type_js_1.SimpleType)({
|
|
44
|
+
((0, simple_type_js_1.SimpleType)({
|
|
45
45
|
description: 'Time string in 24h format',
|
|
46
|
+
nameMappings: {
|
|
47
|
+
js: 'string',
|
|
48
|
+
json: 'string',
|
|
49
|
+
},
|
|
46
50
|
})
|
|
47
51
|
.Example('18:23:00', 'Full time value')
|
|
48
|
-
.Example('18:23:00', 'Time value without seconds'),
|
|
52
|
+
.Example('18:23:00', 'Time value without seconds')),
|
|
49
53
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
50
54
|
], TimeType);
|
|
@@ -19,8 +19,12 @@ let UrlType = class UrlType {
|
|
|
19
19
|
};
|
|
20
20
|
exports.UrlType = UrlType;
|
|
21
21
|
exports.UrlType = UrlType = tslib_1.__decorate([
|
|
22
|
-
(0, simple_type_js_1.SimpleType)({
|
|
22
|
+
((0, simple_type_js_1.SimpleType)({
|
|
23
23
|
description: 'A Uniform Resource Identifier Reference (RFC 3986 icon) value',
|
|
24
|
-
|
|
24
|
+
nameMappings: {
|
|
25
|
+
js: 'string',
|
|
26
|
+
json: 'string',
|
|
27
|
+
},
|
|
28
|
+
}).Example('http://tempuri.org')),
|
|
25
29
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
26
30
|
], UrlType);
|
|
@@ -27,6 +27,10 @@ tslib_1.__decorate([
|
|
|
27
27
|
exports.UuidType = UuidType = tslib_1.__decorate([
|
|
28
28
|
(0, simple_type_js_1.SimpleType)({
|
|
29
29
|
description: 'A Universal Unique Identifier (UUID) value',
|
|
30
|
+
nameMappings: {
|
|
31
|
+
js: 'string',
|
|
32
|
+
json: 'string',
|
|
33
|
+
},
|
|
30
34
|
}),
|
|
31
35
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
32
36
|
], UuidType);
|
|
@@ -7,6 +7,7 @@ const index_js_1 = require("../../helpers/index.js");
|
|
|
7
7
|
const index_js_2 = require("../../schema/index.js");
|
|
8
8
|
const api_field_js_1 = require("./api-field.js");
|
|
9
9
|
const complex_type_base_js_1 = require("./complex-type-base.js");
|
|
10
|
+
const data_type_js_1 = require("./data-type.js");
|
|
10
11
|
const get_is_inherited_predicate_fn_js_1 = require("./utils/get-is-inherited-predicate-fn.js");
|
|
11
12
|
/**
|
|
12
13
|
* MappedType constructor
|
|
@@ -21,22 +22,25 @@ exports.MappedType = function (...args) {
|
|
|
21
22
|
_this.kind = index_js_2.OpraSchema.MappedType.Kind;
|
|
22
23
|
if (initArgs.base) {
|
|
23
24
|
// noinspection SuspiciousTypeOfGuard
|
|
24
|
-
if (!(initArgs.base instanceof complex_type_base_js_1.ComplexTypeBase))
|
|
25
|
+
if (!(initArgs.base instanceof complex_type_base_js_1.ComplexTypeBase)) {
|
|
25
26
|
throw new TypeError(`"${initArgs.base.kind}" can't be set as base for a "${this.kind}"`);
|
|
27
|
+
}
|
|
26
28
|
_this.base = initArgs.base;
|
|
27
29
|
_this.ctor = initArgs.ctor || _this.base.ctor;
|
|
28
30
|
if (initArgs.pick)
|
|
29
31
|
_this.pick = initArgs.pick.map(f => _this.base.normalizeFieldPath(f));
|
|
30
32
|
else if (initArgs.omit)
|
|
31
33
|
_this.omit = initArgs.omit.map(f => _this.base.normalizeFieldPath(f));
|
|
32
|
-
else if (initArgs.partial)
|
|
34
|
+
else if (initArgs.partial) {
|
|
33
35
|
_this.partial = Array.isArray(initArgs.partial)
|
|
34
36
|
? initArgs.partial.map(f => _this.base.normalizeFieldPath(f))
|
|
35
37
|
: initArgs.partial;
|
|
36
|
-
|
|
38
|
+
}
|
|
39
|
+
else if (initArgs.required) {
|
|
37
40
|
_this.required = Array.isArray(initArgs.required)
|
|
38
41
|
? initArgs.required.map(f => _this.base.normalizeFieldPath(f))
|
|
39
42
|
: initArgs.required;
|
|
43
|
+
}
|
|
40
44
|
/** Copy fields from base */
|
|
41
45
|
const isInheritedPredicate = (0, get_is_inherited_predicate_fn_js_1.getIsInheritedPredicateFn)(_this.pick, _this.omit);
|
|
42
46
|
const partial = Array.isArray(_this.partial) ? _this.partial.map(x => x.toLowerCase()) : _this.partial;
|
|
@@ -56,8 +60,9 @@ exports.MappedType = function (...args) {
|
|
|
56
60
|
}
|
|
57
61
|
if (!_this.pick ||
|
|
58
62
|
_this.base.additionalFields === false ||
|
|
59
|
-
(Array.isArray(_this.base.additionalFields) && _this.base.additionalFields?.[0] === 'error'))
|
|
63
|
+
(Array.isArray(_this.base.additionalFields) && _this.base.additionalFields?.[0] === 'error')) {
|
|
60
64
|
_this.additionalFields = _this.base.additionalFields;
|
|
65
|
+
}
|
|
61
66
|
if (initArgs.base.keyField && isInheritedPredicate(initArgs.base.keyField))
|
|
62
67
|
_this.keyField = initArgs.base.keyField;
|
|
63
68
|
}
|
|
@@ -68,6 +73,8 @@ exports.MappedType = function (...args) {
|
|
|
68
73
|
*/
|
|
69
74
|
class MappedTypeClass extends complex_type_base_js_1.ComplexTypeBase {
|
|
70
75
|
extendsFrom(baseType) {
|
|
76
|
+
if (!(baseType instanceof data_type_js_1.DataType))
|
|
77
|
+
baseType = this.node.getDataType(baseType);
|
|
71
78
|
if (!(baseType instanceof complex_type_base_js_1.ComplexTypeBase))
|
|
72
79
|
return false;
|
|
73
80
|
if (baseType === this)
|
|
@@ -88,4 +95,4 @@ class MappedTypeClass extends complex_type_base_js_1.ComplexTypeBase {
|
|
|
88
95
|
}
|
|
89
96
|
}
|
|
90
97
|
exports.MappedType.prototype = MappedTypeClass.prototype;
|
|
91
|
-
exports.MappedType._applyMixin = () =>
|
|
98
|
+
exports.MappedType._applyMixin = () => undefined;
|
|
@@ -8,6 +8,7 @@ const index_js_2 = require("../../schema/index.js");
|
|
|
8
8
|
const constants_js_1 = require("../constants.js");
|
|
9
9
|
const api_field_js_1 = require("./api-field.js");
|
|
10
10
|
const complex_type_base_js_1 = require("./complex-type-base.js");
|
|
11
|
+
const data_type_js_1 = require("./data-type.js");
|
|
11
12
|
/**
|
|
12
13
|
* @class MixinType
|
|
13
14
|
*/
|
|
@@ -43,6 +44,8 @@ exports.MixinType = function (...args) {
|
|
|
43
44
|
*/
|
|
44
45
|
class MixinTypeClass extends complex_type_base_js_1.ComplexTypeBase {
|
|
45
46
|
extendsFrom(baseType) {
|
|
47
|
+
if (!(baseType instanceof data_type_js_1.DataType))
|
|
48
|
+
baseType = this.node.getDataType(baseType);
|
|
46
49
|
if (!(baseType instanceof complex_type_base_js_1.ComplexTypeBase))
|
|
47
50
|
return false;
|
|
48
51
|
if (baseType === this)
|
|
@@ -97,8 +100,9 @@ function MixinTypeFactory(...args) {
|
|
|
97
100
|
if (!(itemMeta &&
|
|
98
101
|
(itemMeta.kind === index_js_2.OpraSchema.ComplexType.Kind ||
|
|
99
102
|
itemMeta.kind === index_js_2.OpraSchema.MixinType.Kind ||
|
|
100
|
-
itemMeta.kind === index_js_2.OpraSchema.MappedType.Kind)))
|
|
103
|
+
itemMeta.kind === index_js_2.OpraSchema.MappedType.Kind))) {
|
|
101
104
|
throw new TypeError(`Class "${c.name}" is not a ${index_js_2.OpraSchema.ComplexType.Kind}, ${index_js_2.OpraSchema.MixinType.Kind} or ${index_js_2.OpraSchema.MappedType.Kind}`);
|
|
105
|
+
}
|
|
102
106
|
metadata.types.push(c);
|
|
103
107
|
(0, index_js_1.mergePrototype)(MixinClass.prototype, c.prototype);
|
|
104
108
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OmitType =
|
|
3
|
+
exports.OmitType = OmitType;
|
|
4
4
|
const create_mapped_class_js_1 = require("./utils/create-mapped-class.js");
|
|
5
|
+
/**
|
|
6
|
+
* Create a new MappedType that omits given fields from base type
|
|
7
|
+
* @param baseType
|
|
8
|
+
* @param keys
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
5
11
|
/**
|
|
6
12
|
*
|
|
7
13
|
*/
|
|
8
14
|
function OmitType(baseType, keys, options) {
|
|
9
15
|
return (0, create_mapped_class_js_1.createMappedClass)(baseType, { omit: keys }, options);
|
|
10
16
|
}
|
|
11
|
-
exports.OmitType = OmitType;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartialType =
|
|
3
|
+
exports.PartialType = PartialType;
|
|
4
4
|
const create_mapped_class_js_1 = require("./utils/create-mapped-class.js");
|
|
5
|
+
/**
|
|
6
|
+
* Create a new MappedType that marks given or all fields as optional
|
|
7
|
+
* @param baseType
|
|
8
|
+
* @param keys
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
5
11
|
/**
|
|
6
12
|
*
|
|
7
13
|
*/
|
|
@@ -10,4 +16,3 @@ function PartialType(base, ...args) {
|
|
|
10
16
|
const options = Array.isArray(args[0]) ? args[1] : args[0];
|
|
11
17
|
return (0, create_mapped_class_js_1.createMappedClass)(base, { partial: keys }, options);
|
|
12
18
|
}
|
|
13
|
-
exports.PartialType = PartialType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PickType =
|
|
3
|
+
exports.PickType = PickType;
|
|
4
4
|
const create_mapped_class_js_1 = require("./utils/create-mapped-class.js");
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -8,4 +8,3 @@ const create_mapped_class_js_1 = require("./utils/create-mapped-class.js");
|
|
|
8
8
|
function PickType(baseType, keys, options) {
|
|
9
9
|
return (0, create_mapped_class_js_1.createMappedClass)(baseType, { pick: keys }, options);
|
|
10
10
|
}
|
|
11
|
-
exports.PickType = PickType;
|
|
@@ -26,6 +26,10 @@ exports.BigintType = BigintType;
|
|
|
26
26
|
exports.BigintType = BigintType = tslib_1.__decorate([
|
|
27
27
|
(0, simple_type_js_1.SimpleType)({
|
|
28
28
|
description: 'BigInt number',
|
|
29
|
+
nameMappings: {
|
|
30
|
+
js: 'bigint',
|
|
31
|
+
json: 'string',
|
|
32
|
+
},
|
|
29
33
|
}),
|
|
30
34
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
31
35
|
], BigintType);
|
|
@@ -21,6 +21,10 @@ exports.BooleanType = BooleanType;
|
|
|
21
21
|
exports.BooleanType = BooleanType = tslib_1.__decorate([
|
|
22
22
|
(0, simple_type_js_1.SimpleType)({
|
|
23
23
|
description: 'Simple true/false value',
|
|
24
|
+
nameMappings: {
|
|
25
|
+
js: 'boolean',
|
|
26
|
+
json: 'boolean',
|
|
27
|
+
},
|
|
24
28
|
}),
|
|
25
29
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
26
30
|
], BooleanType);
|
|
@@ -26,6 +26,10 @@ exports.IntegerType = IntegerType;
|
|
|
26
26
|
exports.IntegerType = IntegerType = tslib_1.__decorate([
|
|
27
27
|
(0, simple_type_js_1.SimpleType)({
|
|
28
28
|
description: 'An integer number',
|
|
29
|
+
nameMappings: {
|
|
30
|
+
js: 'number',
|
|
31
|
+
json: 'number',
|
|
32
|
+
},
|
|
29
33
|
}),
|
|
30
34
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
31
35
|
], IntegerType);
|
|
@@ -21,6 +21,10 @@ exports.NullType = NullType;
|
|
|
21
21
|
exports.NullType = NullType = tslib_1.__decorate([
|
|
22
22
|
(0, simple_type_js_1.SimpleType)({
|
|
23
23
|
description: 'A Null value',
|
|
24
|
+
nameMappings: {
|
|
25
|
+
js: 'null',
|
|
26
|
+
json: 'null',
|
|
27
|
+
},
|
|
24
28
|
}),
|
|
25
29
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
26
30
|
], NullType);
|
|
@@ -38,6 +38,10 @@ tslib_1.__decorate([
|
|
|
38
38
|
exports.NumberType = NumberType = tslib_1.__decorate([
|
|
39
39
|
(0, simple_type_js_1.SimpleType)({
|
|
40
40
|
description: 'Both Integer as well as Floating-Point numbers',
|
|
41
|
+
nameMappings: {
|
|
42
|
+
js: 'number',
|
|
43
|
+
json: 'number',
|
|
44
|
+
},
|
|
41
45
|
}),
|
|
42
46
|
tslib_1.__metadata("design:paramtypes", [Object])
|
|
43
47
|
], NumberType);
|