@opra/common 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +5535 -5248
- package/cjs/document/api-document.js +18 -12
- package/cjs/document/common/data-type-map.js +1 -1
- package/cjs/document/common/document-element.js +2 -1
- package/cjs/document/constants.js +1 -1
- package/cjs/document/data-type/api-field.js +7 -2
- package/cjs/document/data-type/complex-type-base.js +6 -1
- package/cjs/document/data-type/complex-type.js +8 -5
- 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 +6 -1
- package/cjs/document/data-type/extended-types/date-string.type.js +10 -3
- package/cjs/document/data-type/extended-types/date-time-string.type.js +10 -3
- package/cjs/document/data-type/extended-types/date-time.type.js +10 -3
- package/cjs/document/data-type/extended-types/date.type.js +10 -3
- package/cjs/document/data-type/extended-types/email.type.js +24 -10
- package/cjs/document/data-type/extended-types/field-path.type.js +13 -7
- package/cjs/document/data-type/extended-types/filter.type.js +25 -20
- package/cjs/document/data-type/extended-types/object-id.type.js +6 -1
- package/cjs/document/data-type/extended-types/operation-result.type.js +20 -10
- package/cjs/document/data-type/extended-types/time.type.js +10 -3
- package/cjs/document/data-type/extended-types/url.type.js +6 -1
- package/cjs/document/data-type/extended-types/uuid.type.js +8 -2
- 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/primitive-types/any.type.js +2 -1
- package/cjs/document/data-type/primitive-types/bigint.type.js +6 -1
- package/cjs/document/data-type/primitive-types/boolean.type.js +6 -1
- package/cjs/document/data-type/primitive-types/integer.type.js +6 -1
- package/cjs/document/data-type/primitive-types/null.type.js +6 -1
- package/cjs/document/data-type/primitive-types/number.type.js +10 -3
- package/cjs/document/data-type/primitive-types/object.type.js +2 -1
- package/cjs/document/data-type/primitive-types/string.type.js +14 -5
- package/cjs/document/data-type/simple-type.js +16 -10
- package/cjs/document/data-type/utils/create-mapped-class.js +2 -1
- package/cjs/document/decorators/http-controller.decorator.js +25 -0
- package/cjs/document/decorators/http-operation-entity.decorator.js +55 -19
- package/cjs/document/decorators/http-operation.decorator.js +8 -4
- package/cjs/document/factory/api-document.factory.js +6 -3
- package/cjs/document/factory/data-type.factory.js +98 -57
- package/cjs/document/factory/http-api.factory.js +4 -2
- package/cjs/document/http/http-api.js +2 -2
- package/cjs/document/http/http-controller.js +25 -13
- package/cjs/document/http/http-media-type.js +4 -2
- package/cjs/document/http/http-operation-response.js +2 -1
- package/cjs/document/http/http-operation.js +18 -4
- package/cjs/document/http/http-parameter.js +2 -0
- package/cjs/document/http/http-status-range.js +1 -2
- package/cjs/document/index.js +5 -5
- package/cjs/exception/index.js +5 -5
- package/cjs/filter/antlr/OpraFilterParser.js +28 -82
- package/cjs/filter/ast/index.js +1 -1
- package/cjs/filter/build.js +1 -3
- package/cjs/filter/filter-rules.js +4 -2
- package/cjs/filter/opra-filter.ns.js +2 -2
- package/cjs/filter/parse.js +1 -3
- package/cjs/helpers/mixin-utils.js +2 -1
- package/cjs/helpers/monkey-patches.js +4 -2
- package/cjs/helpers/parse-fields-projection.js +1 -3
- package/cjs/helpers/responsive-map.js +5 -4
- package/cjs/i18n/i18n.js +4 -3
- package/cjs/i18n/index.js +1 -1
- package/cjs/index.js +1 -1
- package/esm/document/api-document.js +18 -12
- package/esm/document/common/data-type-map.js +1 -1
- package/esm/document/common/document-element.js +2 -1
- package/esm/document/constants.js +1 -1
- package/esm/document/data-type/api-field.js +7 -2
- package/esm/document/data-type/complex-type-base.js +6 -1
- package/esm/document/data-type/complex-type.js +8 -5
- 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 +7 -2
- package/esm/document/data-type/extended-types/date-string.type.js +11 -4
- package/esm/document/data-type/extended-types/date-time-string.type.js +11 -4
- package/esm/document/data-type/extended-types/date-time.type.js +11 -4
- package/esm/document/data-type/extended-types/date.type.js +11 -4
- package/esm/document/data-type/extended-types/email.type.js +25 -11
- package/esm/document/data-type/extended-types/field-path.type.js +14 -8
- package/esm/document/data-type/extended-types/filter.type.js +26 -21
- package/esm/document/data-type/extended-types/object-id.type.js +7 -2
- package/esm/document/data-type/extended-types/operation-result.type.js +21 -11
- package/esm/document/data-type/extended-types/time.type.js +11 -4
- package/esm/document/data-type/extended-types/url.type.js +7 -2
- package/esm/document/data-type/extended-types/uuid.type.js +9 -3
- 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/primitive-types/any.type.js +3 -2
- package/esm/document/data-type/primitive-types/bigint.type.js +7 -2
- package/esm/document/data-type/primitive-types/boolean.type.js +7 -2
- package/esm/document/data-type/primitive-types/integer.type.js +7 -2
- package/esm/document/data-type/primitive-types/null.type.js +7 -2
- package/esm/document/data-type/primitive-types/number.type.js +11 -4
- package/esm/document/data-type/primitive-types/object.type.js +3 -2
- package/esm/document/data-type/primitive-types/string.type.js +15 -6
- package/esm/document/data-type/simple-type.js +16 -10
- package/esm/document/data-type/utils/create-mapped-class.js +2 -1
- package/esm/document/decorators/http-controller.decorator.js +25 -0
- package/esm/document/decorators/http-operation-entity.decorator.js +55 -19
- package/esm/document/decorators/http-operation.decorator.js +8 -4
- package/esm/document/factory/api-document.factory.js +5 -3
- package/esm/document/factory/data-type.factory.js +98 -57
- package/esm/document/factory/http-api.factory.js +4 -2
- package/esm/document/http/http-api.js +2 -2
- package/esm/document/http/http-controller.js +24 -13
- package/esm/document/http/http-media-type.js +4 -2
- package/esm/document/http/http-operation-response.js +2 -1
- package/esm/document/http/http-operation.js +17 -4
- package/esm/document/http/http-parameter.js +2 -0
- package/esm/document/http/http-status-range.js +1 -2
- package/esm/document/index.js +5 -5
- package/esm/exception/index.js +5 -5
- 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/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 +8 -7
- package/types/document/api-document.d.ts +3 -6
- package/types/document/data-type/api-field.d.ts +2 -0
- package/types/document/data-type/complex-type.d.ts +1 -1
- package/types/document/data-type/data-type.d.ts +4 -2
- package/types/document/data-type/enum-type.d.ts +2 -2
- package/types/document/data-type/mapped-type.d.ts +2 -2
- package/types/document/data-type/mixin-type.d.ts +2 -2
- 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/factory/api-document.factory.d.ts +1 -1
- package/types/document/factory/data-type.factory.d.ts +5 -0
- package/types/document/http/http-controller.d.ts +1 -0
- package/types/document/http/http-operation.d.ts +1 -0
- package/types/document/http/http-parameter.d.ts +3 -2
- 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/i18n/i18n.d.ts +21 -19
- package/types/index.d.ts +1 -1
- package/types/schema/data-type/simple-type.interface.d.ts +4 -0
- package/types/schema/document.interface.d.ts +13 -1
- package/types/schema/http/http-parameter.interface.d.ts +4 -0
- package/types/schema/index.d.ts +1 -0
- package/cjs/document/data-type/decorators/api-field-decorator.js +0 -26
- package/cjs/document/data-type/decorators/complex-type.decorator.js +0 -33
- package/cjs/document/data-type/decorators/simple-type.decorator.js +0 -67
- package/cjs/document/http/decorators/http-controller.decorator.js +0 -117
- package/cjs/document/http/decorators/http-operation-entity.decorator.js +0 -461
- package/cjs/document/http/decorators/http-operation.decorator.js +0 -183
- package/cjs/helpers/is-url-string.js +0 -12
- package/cjs/http/opra-url-path.js +0 -266
- package/cjs/http/opra-url.js +0 -253
- package/esm/document/data-type/decorators/api-field-decorator.js +0 -22
- package/esm/document/data-type/decorators/complex-type.decorator.js +0 -28
- package/esm/document/data-type/decorators/simple-type.decorator.js +0 -61
- package/esm/document/http/decorators/http-controller.decorator.js +0 -112
- package/esm/document/http/decorators/http-operation-entity.decorator.js +0 -459
- package/esm/document/http/decorators/http-operation.decorator.js +0 -178
- package/esm/helpers/is-url-string.js +0 -7
- package/esm/http/opra-url-path.js +0 -260
- package/esm/http/opra-url.js +0 -249
- package/types/document/data-type/decorators/api-field-decorator.d.ts +0 -5
- package/types/document/data-type/decorators/complex-type.decorator.d.ts +0 -2
- package/types/document/data-type/decorators/simple-type.decorator.d.ts +0 -20
- package/types/document/http/decorators/http-controller.decorator.d.ts +0 -14
- package/types/document/http/decorators/http-operation-entity.decorator.d.ts +0 -100
- package/types/document/http/decorators/http-operation.decorator.d.ts +0 -30
- package/types/helpers/is-url-string.d.ts +0 -2
- package/types/http/opra-url-path.d.ts +0 -55
- package/types/http/opra-url.d.ts +0 -66
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable
|
|
2
|
+
/* eslint-disable */
|
|
3
3
|
// Generated from ./src/filter/antlr/OpraFilter.g4 by ANTLR 4.12.0
|
|
4
4
|
// noinspection ES6UnusedImports,JSUnusedGlobalSymbols,JSUnusedLocalSymbols
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -995,9 +995,7 @@ class RootContext extends antlr4_1.ParserRuleContext {
|
|
|
995
995
|
if (visitor.visitRoot) {
|
|
996
996
|
return visitor.visitRoot(this);
|
|
997
997
|
}
|
|
998
|
-
|
|
999
|
-
return visitor.visitChildren(this);
|
|
1000
|
-
}
|
|
998
|
+
return visitor.visitChildren(this);
|
|
1001
999
|
}
|
|
1002
1000
|
}
|
|
1003
1001
|
exports.RootContext = RootContext;
|
|
@@ -1037,9 +1035,7 @@ class ParenthesizedExpressionContext extends ExpressionContext {
|
|
|
1037
1035
|
if (visitor.visitParenthesizedExpression) {
|
|
1038
1036
|
return visitor.visitParenthesizedExpression(this);
|
|
1039
1037
|
}
|
|
1040
|
-
|
|
1041
|
-
return visitor.visitChildren(this);
|
|
1042
|
-
}
|
|
1038
|
+
return visitor.visitChildren(this);
|
|
1043
1039
|
}
|
|
1044
1040
|
}
|
|
1045
1041
|
exports.ParenthesizedExpressionContext = ParenthesizedExpressionContext;
|
|
@@ -1066,9 +1062,7 @@ class NegativeExpressionContext extends ExpressionContext {
|
|
|
1066
1062
|
if (visitor.visitNegativeExpression) {
|
|
1067
1063
|
return visitor.visitNegativeExpression(this);
|
|
1068
1064
|
}
|
|
1069
|
-
|
|
1070
|
-
return visitor.visitChildren(this);
|
|
1071
|
-
}
|
|
1065
|
+
return visitor.visitChildren(this);
|
|
1072
1066
|
}
|
|
1073
1067
|
}
|
|
1074
1068
|
exports.NegativeExpressionContext = NegativeExpressionContext;
|
|
@@ -1101,9 +1095,7 @@ class ComparisonExpressionContext extends ExpressionContext {
|
|
|
1101
1095
|
if (visitor.visitComparisonExpression) {
|
|
1102
1096
|
return visitor.visitComparisonExpression(this);
|
|
1103
1097
|
}
|
|
1104
|
-
|
|
1105
|
-
return visitor.visitChildren(this);
|
|
1106
|
-
}
|
|
1098
|
+
return visitor.visitChildren(this);
|
|
1107
1099
|
}
|
|
1108
1100
|
}
|
|
1109
1101
|
exports.ComparisonExpressionContext = ComparisonExpressionContext;
|
|
@@ -1136,9 +1128,7 @@ class LogicalExpressionContext extends ExpressionContext {
|
|
|
1136
1128
|
if (visitor.visitLogicalExpression) {
|
|
1137
1129
|
return visitor.visitLogicalExpression(this);
|
|
1138
1130
|
}
|
|
1139
|
-
|
|
1140
|
-
return visitor.visitChildren(this);
|
|
1141
|
-
}
|
|
1131
|
+
return visitor.visitChildren(this);
|
|
1142
1132
|
}
|
|
1143
1133
|
}
|
|
1144
1134
|
exports.LogicalExpressionContext = LogicalExpressionContext;
|
|
@@ -1168,9 +1158,7 @@ class ComparisonLeftContext extends antlr4_1.ParserRuleContext {
|
|
|
1168
1158
|
if (visitor.visitComparisonLeft) {
|
|
1169
1159
|
return visitor.visitComparisonLeft(this);
|
|
1170
1160
|
}
|
|
1171
|
-
|
|
1172
|
-
return visitor.visitChildren(this);
|
|
1173
|
-
}
|
|
1161
|
+
return visitor.visitChildren(this);
|
|
1174
1162
|
}
|
|
1175
1163
|
}
|
|
1176
1164
|
exports.ComparisonLeftContext = ComparisonLeftContext;
|
|
@@ -1209,9 +1197,7 @@ class ComparisonRightContext extends antlr4_1.ParserRuleContext {
|
|
|
1209
1197
|
if (visitor.visitComparisonRight) {
|
|
1210
1198
|
return visitor.visitComparisonRight(this);
|
|
1211
1199
|
}
|
|
1212
|
-
|
|
1213
|
-
return visitor.visitChildren(this);
|
|
1214
|
-
}
|
|
1200
|
+
return visitor.visitChildren(this);
|
|
1215
1201
|
}
|
|
1216
1202
|
}
|
|
1217
1203
|
exports.ComparisonRightContext = ComparisonRightContext;
|
|
@@ -1241,9 +1227,7 @@ class ParenthesizedItemContext extends antlr4_1.ParserRuleContext {
|
|
|
1241
1227
|
if (visitor.visitParenthesizedItem) {
|
|
1242
1228
|
return visitor.visitParenthesizedItem(this);
|
|
1243
1229
|
}
|
|
1244
|
-
|
|
1245
|
-
return visitor.visitChildren(this);
|
|
1246
|
-
}
|
|
1230
|
+
return visitor.visitChildren(this);
|
|
1247
1231
|
}
|
|
1248
1232
|
}
|
|
1249
1233
|
exports.ParenthesizedItemContext = ParenthesizedItemContext;
|
|
@@ -1283,9 +1267,7 @@ class TimeLiteralContext extends ValueContext {
|
|
|
1283
1267
|
if (visitor.visitTimeLiteral) {
|
|
1284
1268
|
return visitor.visitTimeLiteral(this);
|
|
1285
1269
|
}
|
|
1286
|
-
|
|
1287
|
-
return visitor.visitChildren(this);
|
|
1288
|
-
}
|
|
1270
|
+
return visitor.visitChildren(this);
|
|
1289
1271
|
}
|
|
1290
1272
|
}
|
|
1291
1273
|
exports.TimeLiteralContext = TimeLiteralContext;
|
|
@@ -1312,9 +1294,7 @@ class NullLiteralContext extends ValueContext {
|
|
|
1312
1294
|
if (visitor.visitNullLiteral) {
|
|
1313
1295
|
return visitor.visitNullLiteral(this);
|
|
1314
1296
|
}
|
|
1315
|
-
|
|
1316
|
-
return visitor.visitChildren(this);
|
|
1317
|
-
}
|
|
1297
|
+
return visitor.visitChildren(this);
|
|
1318
1298
|
}
|
|
1319
1299
|
}
|
|
1320
1300
|
exports.NullLiteralContext = NullLiteralContext;
|
|
@@ -1341,9 +1321,7 @@ class DateTimeLiteralContext extends ValueContext {
|
|
|
1341
1321
|
if (visitor.visitDateTimeLiteral) {
|
|
1342
1322
|
return visitor.visitDateTimeLiteral(this);
|
|
1343
1323
|
}
|
|
1344
|
-
|
|
1345
|
-
return visitor.visitChildren(this);
|
|
1346
|
-
}
|
|
1324
|
+
return visitor.visitChildren(this);
|
|
1347
1325
|
}
|
|
1348
1326
|
}
|
|
1349
1327
|
exports.DateTimeLiteralContext = DateTimeLiteralContext;
|
|
@@ -1370,9 +1348,7 @@ class StringLiteralContext extends ValueContext {
|
|
|
1370
1348
|
if (visitor.visitStringLiteral) {
|
|
1371
1349
|
return visitor.visitStringLiteral(this);
|
|
1372
1350
|
}
|
|
1373
|
-
|
|
1374
|
-
return visitor.visitChildren(this);
|
|
1375
|
-
}
|
|
1351
|
+
return visitor.visitChildren(this);
|
|
1376
1352
|
}
|
|
1377
1353
|
}
|
|
1378
1354
|
exports.StringLiteralContext = StringLiteralContext;
|
|
@@ -1399,9 +1375,7 @@ class DateLiteralContext extends ValueContext {
|
|
|
1399
1375
|
if (visitor.visitDateLiteral) {
|
|
1400
1376
|
return visitor.visitDateLiteral(this);
|
|
1401
1377
|
}
|
|
1402
|
-
|
|
1403
|
-
return visitor.visitChildren(this);
|
|
1404
|
-
}
|
|
1378
|
+
return visitor.visitChildren(this);
|
|
1405
1379
|
}
|
|
1406
1380
|
}
|
|
1407
1381
|
exports.DateLiteralContext = DateLiteralContext;
|
|
@@ -1428,9 +1402,7 @@ class InfinityLiteralContext extends ValueContext {
|
|
|
1428
1402
|
if (visitor.visitInfinityLiteral) {
|
|
1429
1403
|
return visitor.visitInfinityLiteral(this);
|
|
1430
1404
|
}
|
|
1431
|
-
|
|
1432
|
-
return visitor.visitChildren(this);
|
|
1433
|
-
}
|
|
1405
|
+
return visitor.visitChildren(this);
|
|
1434
1406
|
}
|
|
1435
1407
|
}
|
|
1436
1408
|
exports.InfinityLiteralContext = InfinityLiteralContext;
|
|
@@ -1457,9 +1429,7 @@ class BooleanLiteralContext extends ValueContext {
|
|
|
1457
1429
|
if (visitor.visitBooleanLiteral) {
|
|
1458
1430
|
return visitor.visitBooleanLiteral(this);
|
|
1459
1431
|
}
|
|
1460
|
-
|
|
1461
|
-
return visitor.visitChildren(this);
|
|
1462
|
-
}
|
|
1432
|
+
return visitor.visitChildren(this);
|
|
1463
1433
|
}
|
|
1464
1434
|
}
|
|
1465
1435
|
exports.BooleanLiteralContext = BooleanLiteralContext;
|
|
@@ -1486,9 +1456,7 @@ class NumberLiteralContext extends ValueContext {
|
|
|
1486
1456
|
if (visitor.visitNumberLiteral) {
|
|
1487
1457
|
return visitor.visitNumberLiteral(this);
|
|
1488
1458
|
}
|
|
1489
|
-
|
|
1490
|
-
return visitor.visitChildren(this);
|
|
1491
|
-
}
|
|
1459
|
+
return visitor.visitChildren(this);
|
|
1492
1460
|
}
|
|
1493
1461
|
}
|
|
1494
1462
|
exports.NumberLiteralContext = NumberLiteralContext;
|
|
@@ -1521,9 +1489,7 @@ class QualifiedIdentifierContext extends antlr4_1.ParserRuleContext {
|
|
|
1521
1489
|
if (visitor.visitQualifiedIdentifier) {
|
|
1522
1490
|
return visitor.visitQualifiedIdentifier(this);
|
|
1523
1491
|
}
|
|
1524
|
-
|
|
1525
|
-
return visitor.visitChildren(this);
|
|
1526
|
-
}
|
|
1492
|
+
return visitor.visitChildren(this);
|
|
1527
1493
|
}
|
|
1528
1494
|
}
|
|
1529
1495
|
exports.QualifiedIdentifierContext = QualifiedIdentifierContext;
|
|
@@ -1553,9 +1519,7 @@ class ExternalConstantContext extends antlr4_1.ParserRuleContext {
|
|
|
1553
1519
|
if (visitor.visitExternalConstant) {
|
|
1554
1520
|
return visitor.visitExternalConstant(this);
|
|
1555
1521
|
}
|
|
1556
|
-
|
|
1557
|
-
return visitor.visitChildren(this);
|
|
1558
|
-
}
|
|
1522
|
+
return visitor.visitChildren(this);
|
|
1559
1523
|
}
|
|
1560
1524
|
}
|
|
1561
1525
|
exports.ExternalConstantContext = ExternalConstantContext;
|
|
@@ -1585,9 +1549,7 @@ class IdentifierContext extends antlr4_1.ParserRuleContext {
|
|
|
1585
1549
|
if (visitor.visitIdentifier) {
|
|
1586
1550
|
return visitor.visitIdentifier(this);
|
|
1587
1551
|
}
|
|
1588
|
-
|
|
1589
|
-
return visitor.visitChildren(this);
|
|
1590
|
-
}
|
|
1552
|
+
return visitor.visitChildren(this);
|
|
1591
1553
|
}
|
|
1592
1554
|
}
|
|
1593
1555
|
exports.IdentifierContext = IdentifierContext;
|
|
@@ -1620,9 +1582,7 @@ class ArrayValueContext extends antlr4_1.ParserRuleContext {
|
|
|
1620
1582
|
if (visitor.visitArrayValue) {
|
|
1621
1583
|
return visitor.visitArrayValue(this);
|
|
1622
1584
|
}
|
|
1623
|
-
|
|
1624
|
-
return visitor.visitChildren(this);
|
|
1625
|
-
}
|
|
1585
|
+
return visitor.visitChildren(this);
|
|
1626
1586
|
}
|
|
1627
1587
|
}
|
|
1628
1588
|
exports.ArrayValueContext = ArrayValueContext;
|
|
@@ -1649,9 +1609,7 @@ class BooleanContext extends antlr4_1.ParserRuleContext {
|
|
|
1649
1609
|
if (visitor.visitBoolean) {
|
|
1650
1610
|
return visitor.visitBoolean(this);
|
|
1651
1611
|
}
|
|
1652
|
-
|
|
1653
|
-
return visitor.visitChildren(this);
|
|
1654
|
-
}
|
|
1612
|
+
return visitor.visitChildren(this);
|
|
1655
1613
|
}
|
|
1656
1614
|
}
|
|
1657
1615
|
exports.BooleanContext = BooleanContext;
|
|
@@ -1678,9 +1636,7 @@ class NullContext extends antlr4_1.ParserRuleContext {
|
|
|
1678
1636
|
if (visitor.visitNull) {
|
|
1679
1637
|
return visitor.visitNull(this);
|
|
1680
1638
|
}
|
|
1681
|
-
|
|
1682
|
-
return visitor.visitChildren(this);
|
|
1683
|
-
}
|
|
1639
|
+
return visitor.visitChildren(this);
|
|
1684
1640
|
}
|
|
1685
1641
|
}
|
|
1686
1642
|
exports.NullContext = NullContext;
|
|
@@ -1707,9 +1663,7 @@ class InfinityContext extends antlr4_1.ParserRuleContext {
|
|
|
1707
1663
|
if (visitor.visitInfinity) {
|
|
1708
1664
|
return visitor.visitInfinity(this);
|
|
1709
1665
|
}
|
|
1710
|
-
|
|
1711
|
-
return visitor.visitChildren(this);
|
|
1712
|
-
}
|
|
1666
|
+
return visitor.visitChildren(this);
|
|
1713
1667
|
}
|
|
1714
1668
|
}
|
|
1715
1669
|
exports.InfinityContext = InfinityContext;
|
|
@@ -1736,9 +1690,7 @@ class ArithmeticOperatorContext extends antlr4_1.ParserRuleContext {
|
|
|
1736
1690
|
if (visitor.visitArithmeticOperator) {
|
|
1737
1691
|
return visitor.visitArithmeticOperator(this);
|
|
1738
1692
|
}
|
|
1739
|
-
|
|
1740
|
-
return visitor.visitChildren(this);
|
|
1741
|
-
}
|
|
1693
|
+
return visitor.visitChildren(this);
|
|
1742
1694
|
}
|
|
1743
1695
|
}
|
|
1744
1696
|
exports.ArithmeticOperatorContext = ArithmeticOperatorContext;
|
|
@@ -1765,9 +1717,7 @@ class ComparisonOperatorContext extends antlr4_1.ParserRuleContext {
|
|
|
1765
1717
|
if (visitor.visitComparisonOperator) {
|
|
1766
1718
|
return visitor.visitComparisonOperator(this);
|
|
1767
1719
|
}
|
|
1768
|
-
|
|
1769
|
-
return visitor.visitChildren(this);
|
|
1770
|
-
}
|
|
1720
|
+
return visitor.visitChildren(this);
|
|
1771
1721
|
}
|
|
1772
1722
|
}
|
|
1773
1723
|
exports.ComparisonOperatorContext = ComparisonOperatorContext;
|
|
@@ -1794,9 +1744,7 @@ class LogicalOperatorContext extends antlr4_1.ParserRuleContext {
|
|
|
1794
1744
|
if (visitor.visitLogicalOperator) {
|
|
1795
1745
|
return visitor.visitLogicalOperator(this);
|
|
1796
1746
|
}
|
|
1797
|
-
|
|
1798
|
-
return visitor.visitChildren(this);
|
|
1799
|
-
}
|
|
1747
|
+
return visitor.visitChildren(this);
|
|
1800
1748
|
}
|
|
1801
1749
|
}
|
|
1802
1750
|
exports.LogicalOperatorContext = LogicalOperatorContext;
|
|
@@ -1826,9 +1774,7 @@ class PolarityOperatorContext extends antlr4_1.ParserRuleContext {
|
|
|
1826
1774
|
if (visitor.visitPolarityOperator) {
|
|
1827
1775
|
return visitor.visitPolarityOperator(this);
|
|
1828
1776
|
}
|
|
1829
|
-
|
|
1830
|
-
return visitor.visitChildren(this);
|
|
1831
|
-
}
|
|
1777
|
+
return visitor.visitChildren(this);
|
|
1832
1778
|
}
|
|
1833
1779
|
}
|
|
1834
1780
|
exports.PolarityOperatorContext = PolarityOperatorContext;
|
package/cjs/filter/ast/index.js
CHANGED
|
@@ -9,8 +9,8 @@ tslib_1.__exportStar(require("./expressions/arithmetic-expression.js"), exports)
|
|
|
9
9
|
tslib_1.__exportStar(require("./expressions/array-expression.js"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./expressions/comparison-expression.js"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./expressions/logical-expression.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./expressions/parenthesized-expression.js"), exports);
|
|
13
12
|
tslib_1.__exportStar(require("./expressions/negative-expression.js"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./expressions/parenthesized-expression.js"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./terms/boolean-literal.js"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./terms/date-literal.js"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./terms/null-literal.js"), exports);
|
package/cjs/filter/build.js
CHANGED
|
@@ -109,9 +109,7 @@ function comparisonExpression(op, left, right) {
|
|
|
109
109
|
const rex = wrapEntryValue(right);
|
|
110
110
|
return new index_js_1.ComparisonExpression({ op, left: lex, right: rex });
|
|
111
111
|
}
|
|
112
|
-
const wrapEntryValue = (v) =>
|
|
113
|
-
return Array.isArray(v) ? $array(...v.map(_wrapEntryValue)) : _wrapEntryValue(v);
|
|
114
|
-
};
|
|
112
|
+
const wrapEntryValue = (v) => Array.isArray(v) ? $array(...v.map(_wrapEntryValue)) : _wrapEntryValue(v);
|
|
115
113
|
const _wrapEntryValue = (v) => {
|
|
116
114
|
if (v instanceof index_js_1.Expression)
|
|
117
115
|
return v;
|
|
@@ -33,8 +33,9 @@ class FilterRules {
|
|
|
33
33
|
const ast = typeof filter === 'string' ? index_js_2.OpraFilter.parse(filter) : filter;
|
|
34
34
|
if (ast instanceof index_js_2.OpraFilter.ComparisonExpression) {
|
|
35
35
|
this.normalizeFilter(ast.left, dataType);
|
|
36
|
-
if (!(ast.left instanceof index_js_2.OpraFilter.QualifiedIdentifier && ast.left.field))
|
|
36
|
+
if (!(ast.left instanceof index_js_2.OpraFilter.QualifiedIdentifier && ast.left.field)) {
|
|
37
37
|
throw new TypeError(`Invalid filter query. Left side should be a data field.`);
|
|
38
|
+
}
|
|
38
39
|
// Check if filtering accepted for given field
|
|
39
40
|
// const findManyOp = this.getOperation('findMany');
|
|
40
41
|
const rule = this._rules.get(ast.left.value);
|
|
@@ -48,7 +49,7 @@ class FilterRules {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
// Check if filtering endpoint accepted for given field
|
|
51
|
-
if (rule.operators && !rule.operators.includes(ast.op))
|
|
52
|
+
if (rule.operators && !rule.operators.includes(ast.op)) {
|
|
52
53
|
throw new index_js_1.OpraException({
|
|
53
54
|
message: (0, index_js_4.translate)('error:UNACCEPTED_FILTER_OPERATION', { field: ast.left.value }),
|
|
54
55
|
code: 'UNACCEPTED_FILTER_OPERATION',
|
|
@@ -57,6 +58,7 @@ class FilterRules {
|
|
|
57
58
|
operator: ast.op,
|
|
58
59
|
},
|
|
59
60
|
});
|
|
61
|
+
}
|
|
60
62
|
this.normalizeFilter(ast.right, dataType);
|
|
61
63
|
return ast;
|
|
62
64
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./ast/index.js"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./parse.js"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./build.js"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./opra-error-listener.js"), exports);
|
|
8
6
|
tslib_1.__exportStar(require("./filter-tree-visitor.js"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./opra-error-listener.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./parse.js"), exports);
|
package/cjs/filter/parse.js
CHANGED
|
@@ -25,9 +25,7 @@ function parse(text, visitor) {
|
|
|
25
25
|
const errMsgs = [];
|
|
26
26
|
for (const err of errors) {
|
|
27
27
|
errMsgs.push(err.message +
|
|
28
|
-
(text.includes('\n')
|
|
29
|
-
? ' at ' + 'line: ' + err.line + ' column: ' + err.column
|
|
30
|
-
: ' at ' + ' column: ' + err.column));
|
|
28
|
+
(text.includes('\n') ? ' at line: ' + err.line + ' column: ' + err.column : ' at column: ' + err.column));
|
|
31
29
|
}
|
|
32
30
|
const e = new errors_js_1.SyntaxError(errMsgs.join('\n'));
|
|
33
31
|
e.errors = errors;
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.inheritPropertyInitializers = exports.mergePrototype = void 0;
|
|
4
4
|
function mergePrototype(targetProto, baseProto, filter) {
|
|
5
5
|
for (const k of Object.getOwnPropertyNames(baseProto)) {
|
|
6
|
-
if (k === 'constructor' || k === '__proto__' || k === 'toJSON' || k === 'toString' || (filter && !filter(k)))
|
|
6
|
+
if (k === 'constructor' || k === '__proto__' || k === 'toJSON' || k === 'toString' || (filter && !filter(k))) {
|
|
7
7
|
continue;
|
|
8
|
+
}
|
|
8
9
|
Object.defineProperty(targetProto, k, Object.getOwnPropertyDescriptor(baseProto, k) || Object.create(null));
|
|
9
10
|
}
|
|
10
11
|
}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
/** monkey patch (hijack)
|
|
3
3
|
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json
|
|
4
4
|
*/
|
|
5
|
-
if (!BigInt.prototype.toJSON)
|
|
5
|
+
if (!BigInt.prototype.toJSON) {
|
|
6
6
|
BigInt.prototype.toJSON = function () {
|
|
7
7
|
return this.toString();
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
}
|
|
10
|
+
if (!RegExp.prototype.toJSON) {
|
|
10
11
|
RegExp.prototype.toJSON = function () {
|
|
11
12
|
return this.toString();
|
|
12
13
|
};
|
|
14
|
+
}
|
|
@@ -27,9 +27,7 @@ function parseFieldsProjection(projection, keepCase) {
|
|
|
27
27
|
exports.parseFieldsProjection = parseFieldsProjection;
|
|
28
28
|
function parse(input, target) {
|
|
29
29
|
/** Add dot before brackets which is required to split fields */
|
|
30
|
-
input = input.replace(NO_DOT_BRACKET_PATTERN, s =>
|
|
31
|
-
return s.charAt(0) + '.' + s.substring(1);
|
|
32
|
-
});
|
|
30
|
+
input = input.replace(NO_DOT_BRACKET_PATTERN, s => s.charAt(0) + '.' + s.substring(1));
|
|
33
31
|
const fields = (0, fast_tokenizer_1.splitString)(input, {
|
|
34
32
|
delimiters: '.',
|
|
35
33
|
brackets: true,
|
|
@@ -41,13 +41,14 @@ class ResponsiveMap {
|
|
|
41
41
|
},
|
|
42
42
|
enumerable: false,
|
|
43
43
|
});
|
|
44
|
-
if (options?.wellKnownKeys)
|
|
44
|
+
if (options?.wellKnownKeys) {
|
|
45
45
|
options.wellKnownKeys.forEach(k => {
|
|
46
46
|
if (caseSensitive)
|
|
47
47
|
this[kWellKnownKeys][k] = k;
|
|
48
48
|
else
|
|
49
49
|
this[kWellKnownKeys][k.toLowerCase()] = k;
|
|
50
50
|
});
|
|
51
|
+
}
|
|
51
52
|
this.clear();
|
|
52
53
|
if (init)
|
|
53
54
|
this.setAll(init);
|
|
@@ -73,12 +74,12 @@ class ResponsiveMap {
|
|
|
73
74
|
has(key) {
|
|
74
75
|
if (!key)
|
|
75
76
|
return false;
|
|
76
|
-
return this[kEntries]
|
|
77
|
+
return Object.prototype.hasOwnProperty.call(this[kEntries], this._getStoringKey(key));
|
|
77
78
|
}
|
|
78
79
|
set(key, value) {
|
|
79
80
|
const storeKey = this._getStoringKey(key);
|
|
80
81
|
key = this._getOriginalKey(key);
|
|
81
|
-
const exists = this[kEntries]
|
|
82
|
+
const exists = Object.prototype.hasOwnProperty.call(this[kEntries], storeKey);
|
|
82
83
|
this[kEntries][storeKey] = value;
|
|
83
84
|
if (!exists)
|
|
84
85
|
this[kSize]++;
|
|
@@ -103,7 +104,7 @@ class ResponsiveMap {
|
|
|
103
104
|
}
|
|
104
105
|
delete(key) {
|
|
105
106
|
const storeKey = this._getStoringKey(key);
|
|
106
|
-
const exists = this[kEntries]
|
|
107
|
+
const exists = Object.prototype.hasOwnProperty.call(this[kEntries], storeKey);
|
|
107
108
|
delete this[kEntries][storeKey];
|
|
108
109
|
delete this[kKeyMap][storeKey];
|
|
109
110
|
if (!exists)
|
package/cjs/i18n/i18n.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.I18n = exports.BaseI18n = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fast_tokenizer_1 = require("fast-tokenizer");
|
|
6
5
|
const i18next_1 = tslib_1.__importDefault(require("@browsery/i18next"));
|
|
6
|
+
const fast_tokenizer_1 = require("fast-tokenizer");
|
|
7
7
|
const string_utils_js_1 = require("./string-utils.js");
|
|
8
8
|
exports.BaseI18n = Object.getPrototypeOf(i18next_1.default.createInstance()).constructor;
|
|
9
9
|
class I18n extends exports.BaseI18n {
|
|
@@ -42,7 +42,7 @@ class I18n extends exports.BaseI18n {
|
|
|
42
42
|
const objectStack = new WeakMap();
|
|
43
43
|
return this._deepTranslate(input, objectStack, options);
|
|
44
44
|
}
|
|
45
|
-
createInstance(options
|
|
45
|
+
createInstance(options, callback) {
|
|
46
46
|
return new I18n(options, callback);
|
|
47
47
|
}
|
|
48
48
|
static createInstance(options, callback) {
|
|
@@ -106,8 +106,9 @@ class I18n extends exports.BaseI18n {
|
|
|
106
106
|
input instanceof Map ||
|
|
107
107
|
input instanceof Set ||
|
|
108
108
|
input instanceof WeakMap ||
|
|
109
|
-
input instanceof WeakSet)
|
|
109
|
+
input instanceof WeakSet) {
|
|
110
110
|
return input;
|
|
111
|
+
}
|
|
111
112
|
const out = {};
|
|
112
113
|
objectStack.set(input, out);
|
|
113
114
|
const keys = Object.keys(input);
|
package/cjs/i18n/index.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uid = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
tslib_1.__exportStar(require("./types.js"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./document/index.js"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./exception/index.js"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./filter/index.js"), exports);
|
|
@@ -10,5 +9,6 @@ tslib_1.__exportStar(require("./helpers/index.js"), exports);
|
|
|
10
9
|
tslib_1.__exportStar(require("./http/index.js"), exports);
|
|
11
10
|
tslib_1.__exportStar(require("./i18n/index.js"), exports);
|
|
12
11
|
tslib_1.__exportStar(require("./schema/index.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./types.js"), exports);
|
|
13
13
|
var uid_1 = require("uid");
|
|
14
14
|
Object.defineProperty(exports, "uid", { enumerable: true, get: function () { return uid_1.uid; } });
|
|
@@ -27,18 +27,29 @@ export class ApiDocument extends DocumentElement {
|
|
|
27
27
|
if (dt)
|
|
28
28
|
return this[kTypeNSMap].get(dt);
|
|
29
29
|
}
|
|
30
|
+
findDocument(id) {
|
|
31
|
+
if (this.id === id)
|
|
32
|
+
return this;
|
|
33
|
+
for (const doc of this.references.values()) {
|
|
34
|
+
if (doc.id === id)
|
|
35
|
+
return doc;
|
|
36
|
+
const d = doc.findDocument(id);
|
|
37
|
+
if (d)
|
|
38
|
+
return d;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
30
41
|
toJSON() {
|
|
31
42
|
return this.export();
|
|
32
43
|
}
|
|
33
44
|
/**
|
|
34
45
|
* Export as Opra schema definition object
|
|
35
46
|
*/
|
|
36
|
-
export(
|
|
47
|
+
export() {
|
|
37
48
|
const out = omitUndefined({
|
|
38
49
|
spec: OpraSchema.SpecVersion,
|
|
50
|
+
id: this.id,
|
|
39
51
|
url: this.url,
|
|
40
52
|
info: cloneObject(this.info, true),
|
|
41
|
-
// api: this.api ? this.api.toJSON() : undefined,
|
|
42
53
|
});
|
|
43
54
|
if (this.references.size) {
|
|
44
55
|
let i = 0;
|
|
@@ -46,16 +57,11 @@ export class ApiDocument extends DocumentElement {
|
|
|
46
57
|
for (const [ns, doc] of this.references.entries()) {
|
|
47
58
|
if (doc[BUILTIN])
|
|
48
59
|
continue;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
else if (options?.references === 'relative-url')
|
|
56
|
-
references[ns] = `/$schema?ns=${ns}`;
|
|
57
|
-
else
|
|
58
|
-
references[ns] = doc.export(options);
|
|
60
|
+
references[ns] = {
|
|
61
|
+
id: doc.id,
|
|
62
|
+
url: doc.url,
|
|
63
|
+
info: cloneObject(doc.info, true),
|
|
64
|
+
};
|
|
59
65
|
i++;
|
|
60
66
|
}
|
|
61
67
|
if (i)
|
|
@@ -20,7 +20,7 @@ export class DataTypeMap {
|
|
|
20
20
|
}
|
|
21
21
|
get(nameOrCtor) {
|
|
22
22
|
let name = typeof nameOrCtor === 'string' ? nameOrCtor : this[kCtorMap].get(nameOrCtor);
|
|
23
|
-
if (!name) {
|
|
23
|
+
if (!name && typeof nameOrCtor === 'function') {
|
|
24
24
|
const metadata = Reflect.getMetadata(DATATYPE_METADATA, nameOrCtor);
|
|
25
25
|
name = metadata?.name;
|
|
26
26
|
}
|
|
@@ -13,12 +13,13 @@ export const DocumentElement = function (owner) {
|
|
|
13
13
|
enumerable: false,
|
|
14
14
|
writable: true,
|
|
15
15
|
});
|
|
16
|
-
if (owner)
|
|
16
|
+
if (owner) {
|
|
17
17
|
Object.defineProperty(_this, 'owner', {
|
|
18
18
|
value: owner,
|
|
19
19
|
enumerable: false,
|
|
20
20
|
writable: true,
|
|
21
21
|
});
|
|
22
|
+
}
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* @class DocumentElement
|
|
@@ -4,7 +4,7 @@ export const DECODER = Symbol.for('opra.type.decoder');
|
|
|
4
4
|
export const ENCODER = Symbol('opra.type.encoder');
|
|
5
5
|
export const DECORATOR = Symbol.for('DECORATOR');
|
|
6
6
|
export const BUILTIN = Symbol.for('BUILTIN');
|
|
7
|
-
export const NAMESPACE_PATTERN = /([a-z$_]\w+)(
|
|
7
|
+
export const NAMESPACE_PATTERN = /([a-z$_]\w+):(.+)/i;
|
|
8
8
|
export const CLASS_NAME_PATTERN = /^[a-z][\w_]*$/i;
|
|
9
9
|
export const EXTRACT_TYPENAME_PATTERN = /^(.*)Type(\d*)$/;
|
|
10
10
|
export const kDataTypeMap = Symbol.for('kDataTypeMap');
|
|
@@ -21,8 +21,9 @@ export const ApiField = function (...args) {
|
|
|
21
21
|
_this.name = initArgs.name;
|
|
22
22
|
const origin = initArgs.origin || owner;
|
|
23
23
|
/* istanbul ignore next */
|
|
24
|
-
if (!(origin instanceof ComplexTypeBase))
|
|
24
|
+
if (!(origin instanceof ComplexTypeBase)) {
|
|
25
25
|
throw new Error('Field origin should be one of ComplexType, MappedType or MixinType');
|
|
26
|
+
}
|
|
26
27
|
_this.origin = origin;
|
|
27
28
|
_this.type = initArgs.type || owner.node.getDataType('any');
|
|
28
29
|
_this.description = initArgs.description;
|
|
@@ -33,6 +34,8 @@ export const ApiField = function (...args) {
|
|
|
33
34
|
_this.exclusive = initArgs.exclusive;
|
|
34
35
|
_this.translatable = initArgs.translatable;
|
|
35
36
|
_this.deprecated = initArgs.deprecated;
|
|
37
|
+
_this.readonly = initArgs.readonly;
|
|
38
|
+
_this.writeonly = initArgs.writeonly;
|
|
36
39
|
_this.examples = initArgs.examples;
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
@@ -43,7 +46,7 @@ class ApiFieldClass extends DocumentElement {
|
|
|
43
46
|
toJSON() {
|
|
44
47
|
const typeName = this.type ? this.node.getDataTypeNameWithNs(this.type) : undefined;
|
|
45
48
|
return omitUndefined({
|
|
46
|
-
type:
|
|
49
|
+
type: typeName ? typeName : this.type?.toJSON(),
|
|
47
50
|
description: this.description,
|
|
48
51
|
isArray: this.isArray,
|
|
49
52
|
default: this.default,
|
|
@@ -52,6 +55,8 @@ class ApiFieldClass extends DocumentElement {
|
|
|
52
55
|
exclusive: this.exclusive,
|
|
53
56
|
translatable: this.translatable,
|
|
54
57
|
deprecated: this.deprecated,
|
|
58
|
+
readonly: this.readonly,
|
|
59
|
+
writeonly: this.writeonly,
|
|
55
60
|
examples: this.examples,
|
|
56
61
|
});
|
|
57
62
|
}
|
|
@@ -115,8 +115,9 @@ class ComplexTypeBaseClass extends DataType {
|
|
|
115
115
|
: options?.projection;
|
|
116
116
|
const schema = this._generateSchema(codec, { ...options, projection, currentPath: '' });
|
|
117
117
|
let additionalFields;
|
|
118
|
-
if (this.additionalFields instanceof DataType)
|
|
118
|
+
if (this.additionalFields instanceof DataType) {
|
|
119
119
|
additionalFields = this.additionalFields.generateCodec(codec, options);
|
|
120
|
+
}
|
|
120
121
|
else if (typeof this.additionalFields === 'boolean')
|
|
121
122
|
additionalFields = this.additionalFields;
|
|
122
123
|
else if (Array.isArray(this.additionalFields)) {
|
|
@@ -143,6 +144,10 @@ class ComplexTypeBaseClass extends DataType {
|
|
|
143
144
|
// Process fields
|
|
144
145
|
let fieldName;
|
|
145
146
|
for (const field of this.fields.values()) {
|
|
147
|
+
if ((context.ignoreReadonlyFields && field.readonly) || (context.ignoreWriteonlyFields && field.writeonly)) {
|
|
148
|
+
schema[field.name] = vg.isUndefined({ coerce: true });
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
146
151
|
fieldName = field.name;
|
|
147
152
|
let p;
|
|
148
153
|
if (projection !== '*') {
|