@opra/common 1.0.0-alpha.11 → 1.0.0-alpha.13
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 +175 -165
- package/cjs/document/api-document.js +10 -0
- package/cjs/document/common/document-element.js +3 -0
- package/cjs/document/decorators/http-operation-entity.decorator.js +4 -15
- package/cjs/document/decorators/http-operation.decorator.js +3 -0
- package/cjs/document/factory/api-document.factory.js +13 -8
- package/cjs/document/http/http-operation.js +11 -1
- package/cjs/document/http/http-status-range.js +5 -2
- package/esm/document/api-document.js +9 -0
- package/esm/document/common/document-element.js +2 -0
- package/esm/document/decorators/http-operation-entity.decorator.js +4 -15
- package/esm/document/decorators/http-operation.decorator.js +3 -0
- package/esm/document/factory/api-document.factory.js +13 -7
- package/esm/document/http/http-operation.js +11 -1
- package/esm/document/http/http-status-range.js +5 -2
- package/package.json +1 -1
- package/types/document/api-document.d.ts +1 -0
- package/types/document/common/document-element.d.ts +1 -0
- package/types/document/http/http-operation.d.ts +3 -2
- package/types/document/http/http-status-range.d.ts +2 -1
- package/types/schema/http/http-operation.interface.d.ts +4 -0
package/browser.js
CHANGED
|
@@ -828,6 +828,7 @@ __name(ComplexTypeDecorator, "ComplexTypeDecorator");
|
|
|
828
828
|
import { asMutable as asMutable4 } from "ts-gems";
|
|
829
829
|
|
|
830
830
|
// ../../build/common/esm/document/common/document-element.js
|
|
831
|
+
import crypto from "node:crypto";
|
|
831
832
|
import { asMutable } from "ts-gems";
|
|
832
833
|
|
|
833
834
|
// ../../build/common/esm/document/common/document-node.js
|
|
@@ -953,6 +954,7 @@ var DocumentElement = /* @__PURE__ */ __name(function(owner) {
|
|
|
953
954
|
if (!this)
|
|
954
955
|
throw new TypeError('"this" should be passed to call class constructor');
|
|
955
956
|
const _this = asMutable(this);
|
|
957
|
+
_this.id = crypto.randomBytes(16).toString("base64url");
|
|
956
958
|
Object.defineProperty(_this, "node", {
|
|
957
959
|
value: new DocumentNode(this, owner?.node),
|
|
958
960
|
enumerable: false,
|
|
@@ -3092,6 +3094,9 @@ function HttpOperationDecoratorFactory(decoratorChain, options) {
|
|
|
3092
3094
|
responseMeta.contentType = responseMeta.contentType || MimeTypes.opra_response_json;
|
|
3093
3095
|
responseMeta.contentEncoding = responseMeta.contentEncoding || "utf-8";
|
|
3094
3096
|
}
|
|
3097
|
+
if (responseMeta.contentType === MimeTypes.opra_response_json) {
|
|
3098
|
+
responseMeta.contentEncoding = responseMeta.contentEncoding || "utf-8";
|
|
3099
|
+
}
|
|
3095
3100
|
decoratorChain.push((meta) => {
|
|
3096
3101
|
meta.responses = meta.responses || [];
|
|
3097
3102
|
meta.responses.push(responseMeta);
|
|
@@ -3174,6 +3179,7 @@ var HttpOperation2 = /* @__PURE__ */ __name(function(...args) {
|
|
|
3174
3179
|
_this.types = _this.node[kDataTypeMap] = new DataTypeMap();
|
|
3175
3180
|
_this.name = initArgs.name;
|
|
3176
3181
|
_this.path = initArgs.path;
|
|
3182
|
+
_this.mergePath = initArgs.mergePath;
|
|
3177
3183
|
_this.method = initArgs.method || "GET";
|
|
3178
3184
|
_this.description = initArgs.description;
|
|
3179
3185
|
_this.composition = initArgs.composition;
|
|
@@ -3200,7 +3206,15 @@ var HttpOperationClass = class extends DocumentElement {
|
|
|
3200
3206
|
}
|
|
3201
3207
|
getFullUrl() {
|
|
3202
3208
|
const out = this.owner.getFullUrl();
|
|
3203
|
-
|
|
3209
|
+
if (out) {
|
|
3210
|
+
if (this.path) {
|
|
3211
|
+
if (this.mergePath)
|
|
3212
|
+
return out + this.path;
|
|
3213
|
+
return nodePath2.posix.join(out, this.path);
|
|
3214
|
+
}
|
|
3215
|
+
return out;
|
|
3216
|
+
}
|
|
3217
|
+
return this.path || "/";
|
|
3204
3218
|
}
|
|
3205
3219
|
toJSON() {
|
|
3206
3220
|
const out = omitUndefined({
|
|
@@ -3208,6 +3222,7 @@ var HttpOperationClass = class extends DocumentElement {
|
|
|
3208
3222
|
description: this.description,
|
|
3209
3223
|
method: this.method,
|
|
3210
3224
|
path: this.path,
|
|
3225
|
+
mergePath: this.mergePath,
|
|
3211
3226
|
composition: this.composition,
|
|
3212
3227
|
requestBody: this.requestBody?.toJSON()
|
|
3213
3228
|
});
|
|
@@ -3274,8 +3289,11 @@ var HttpStatusRange = class {
|
|
|
3274
3289
|
this.end = m[2] ? parseInt(m[2], 10) : this.start;
|
|
3275
3290
|
}
|
|
3276
3291
|
}
|
|
3277
|
-
|
|
3278
|
-
return this.
|
|
3292
|
+
includes(statusCode) {
|
|
3293
|
+
return statusCode >= this.start && statusCode <= this.end;
|
|
3294
|
+
}
|
|
3295
|
+
intersects(start, end) {
|
|
3296
|
+
return end >= this.start && start <= this.end;
|
|
3279
3297
|
}
|
|
3280
3298
|
toString() {
|
|
3281
3299
|
if (this.start === this.end)
|
|
@@ -3711,6 +3729,7 @@ var HttpApiFactory = class {
|
|
|
3711
3729
|
};
|
|
3712
3730
|
|
|
3713
3731
|
// ../../build/common/esm/document/api-document.js
|
|
3732
|
+
import crypto2 from "node:crypto";
|
|
3714
3733
|
var _a2;
|
|
3715
3734
|
var ApiDocument = class extends DocumentElement {
|
|
3716
3735
|
static {
|
|
@@ -3783,6 +3802,12 @@ var ApiDocument = class extends DocumentElement {
|
|
|
3783
3802
|
out.api = this.api.toJSON();
|
|
3784
3803
|
return out;
|
|
3785
3804
|
}
|
|
3805
|
+
invalidate() {
|
|
3806
|
+
const x = this.export();
|
|
3807
|
+
delete x.id;
|
|
3808
|
+
this.id = crypto2.createHash("md5").update(JSON.stringify(x)).digest("base64url");
|
|
3809
|
+
this[kTypeNSMap] = /* @__PURE__ */ new WeakMap();
|
|
3810
|
+
}
|
|
3786
3811
|
_findDataType(nameOrCtor, visitedRefs) {
|
|
3787
3812
|
let result = this.types.get(nameOrCtor);
|
|
3788
3813
|
if (result || !this.references.size)
|
|
@@ -3827,8 +3852,20 @@ var ApiDocument = class extends DocumentElement {
|
|
|
3827
3852
|
};
|
|
3828
3853
|
_a2 = kTypeNSMap;
|
|
3829
3854
|
|
|
3855
|
+
// ../../node_modules/tslib/tslib.es6.mjs
|
|
3856
|
+
function __decorate(decorators, target, key, desc) {
|
|
3857
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3858
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3859
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3860
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3861
|
+
}
|
|
3862
|
+
__name(__decorate, "__decorate");
|
|
3863
|
+
function __metadata(metadataKey, metadataValue) {
|
|
3864
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
3865
|
+
}
|
|
3866
|
+
__name(__metadata, "__metadata");
|
|
3867
|
+
|
|
3830
3868
|
// ../../build/common/esm/document/data-type/extended-types/base64.type.js
|
|
3831
|
-
import { __decorate, __metadata } from "tslib";
|
|
3832
3869
|
import { vg as vg3 } from "valgen";
|
|
3833
3870
|
var Base64Type = class Base64Type2 {
|
|
3834
3871
|
static {
|
|
@@ -3857,7 +3894,6 @@ Base64Type = __decorate([
|
|
|
3857
3894
|
], Base64Type);
|
|
3858
3895
|
|
|
3859
3896
|
// ../../build/common/esm/document/data-type/extended-types/date.type.js
|
|
3860
|
-
import { __decorate as __decorate2, __metadata as __metadata2 } from "tslib";
|
|
3861
3897
|
import { isDateString, toString, vg as vg4 } from "valgen";
|
|
3862
3898
|
var DateType = class DateType2 {
|
|
3863
3899
|
static {
|
|
@@ -3894,19 +3930,19 @@ var DateType = class DateType2 {
|
|
|
3894
3930
|
return x.length > 0 ? vg4.pipe([fn, ...x], { returnIndex: 0 }) : fn;
|
|
3895
3931
|
}
|
|
3896
3932
|
};
|
|
3897
|
-
|
|
3933
|
+
__decorate([
|
|
3898
3934
|
SimpleType2.Attribute({
|
|
3899
3935
|
description: "Minimum value"
|
|
3900
3936
|
}),
|
|
3901
|
-
|
|
3937
|
+
__metadata("design:type", String)
|
|
3902
3938
|
], DateType.prototype, "minValue", void 0);
|
|
3903
|
-
|
|
3939
|
+
__decorate([
|
|
3904
3940
|
SimpleType2.Attribute({
|
|
3905
3941
|
description: "Maximum value"
|
|
3906
3942
|
}),
|
|
3907
|
-
|
|
3943
|
+
__metadata("design:type", String)
|
|
3908
3944
|
], DateType.prototype, "maxValue", void 0);
|
|
3909
|
-
DateType =
|
|
3945
|
+
DateType = __decorate([
|
|
3910
3946
|
SimpleType2({
|
|
3911
3947
|
description: "A date without time",
|
|
3912
3948
|
nameMappings: {
|
|
@@ -3914,11 +3950,10 @@ DateType = __decorate2([
|
|
|
3914
3950
|
json: "string"
|
|
3915
3951
|
}
|
|
3916
3952
|
}).Example("2021-04-18", "Full date value"),
|
|
3917
|
-
|
|
3953
|
+
__metadata("design:paramtypes", [Object])
|
|
3918
3954
|
], DateType);
|
|
3919
3955
|
|
|
3920
3956
|
// ../../build/common/esm/document/data-type/extended-types/date-string.type.js
|
|
3921
|
-
import { __decorate as __decorate3, __metadata as __metadata3 } from "tslib";
|
|
3922
3957
|
import { vg as vg5 } from "valgen";
|
|
3923
3958
|
var DateStringType = class DateStringType2 {
|
|
3924
3959
|
static {
|
|
@@ -3941,19 +3976,19 @@ var DateStringType = class DateStringType2 {
|
|
|
3941
3976
|
return this[DECODER](properties);
|
|
3942
3977
|
}
|
|
3943
3978
|
};
|
|
3944
|
-
|
|
3979
|
+
__decorate([
|
|
3945
3980
|
SimpleType2.Attribute({
|
|
3946
3981
|
description: "Minimum value"
|
|
3947
3982
|
}),
|
|
3948
|
-
|
|
3983
|
+
__metadata("design:type", String)
|
|
3949
3984
|
], DateStringType.prototype, "minValue", void 0);
|
|
3950
|
-
|
|
3985
|
+
__decorate([
|
|
3951
3986
|
SimpleType2.Attribute({
|
|
3952
3987
|
description: "Maximum value"
|
|
3953
3988
|
}),
|
|
3954
|
-
|
|
3989
|
+
__metadata("design:type", String)
|
|
3955
3990
|
], DateStringType.prototype, "maxValue", void 0);
|
|
3956
|
-
DateStringType =
|
|
3991
|
+
DateStringType = __decorate([
|
|
3957
3992
|
SimpleType2({
|
|
3958
3993
|
description: "Date string value",
|
|
3959
3994
|
nameMappings: {
|
|
@@ -3961,11 +3996,10 @@ DateStringType = __decorate3([
|
|
|
3961
3996
|
json: "string"
|
|
3962
3997
|
}
|
|
3963
3998
|
}).Example("2021-04-18", "Full date value").Example("2021-04", "Date value without day").Example("2021", "Year only value"),
|
|
3964
|
-
|
|
3999
|
+
__metadata("design:paramtypes", [Object])
|
|
3965
4000
|
], DateStringType);
|
|
3966
4001
|
|
|
3967
4002
|
// ../../build/common/esm/document/data-type/extended-types/date-time.type.js
|
|
3968
|
-
import { __decorate as __decorate4, __metadata as __metadata4 } from "tslib";
|
|
3969
4003
|
import { isDateString as isDateString2, toString as toString2, vg as vg6 } from "valgen";
|
|
3970
4004
|
var DateTimeType = class DateTimeType2 {
|
|
3971
4005
|
static {
|
|
@@ -4002,19 +4036,19 @@ var DateTimeType = class DateTimeType2 {
|
|
|
4002
4036
|
return x.length > 0 ? vg6.pipe([fn, ...x], { returnIndex: 0 }) : fn;
|
|
4003
4037
|
}
|
|
4004
4038
|
};
|
|
4005
|
-
|
|
4039
|
+
__decorate([
|
|
4006
4040
|
SimpleType2.Attribute({
|
|
4007
4041
|
description: "Minimum value"
|
|
4008
4042
|
}),
|
|
4009
|
-
|
|
4043
|
+
__metadata("design:type", String)
|
|
4010
4044
|
], DateTimeType.prototype, "minValue", void 0);
|
|
4011
|
-
|
|
4045
|
+
__decorate([
|
|
4012
4046
|
SimpleType2.Attribute({
|
|
4013
4047
|
description: "Maximum value"
|
|
4014
4048
|
}),
|
|
4015
|
-
|
|
4049
|
+
__metadata("design:type", String)
|
|
4016
4050
|
], DateTimeType.prototype, "maxValue", void 0);
|
|
4017
|
-
DateTimeType =
|
|
4051
|
+
DateTimeType = __decorate([
|
|
4018
4052
|
SimpleType2({
|
|
4019
4053
|
description: "A full datetime value",
|
|
4020
4054
|
nameMappings: {
|
|
@@ -4022,11 +4056,10 @@ DateTimeType = __decorate4([
|
|
|
4022
4056
|
json: "string"
|
|
4023
4057
|
}
|
|
4024
4058
|
}).Example("2021-04-18T22:30:15").Example("2021-04-18 22:30:15").Example("2021-04-18 22:30"),
|
|
4025
|
-
|
|
4059
|
+
__metadata("design:paramtypes", [Object])
|
|
4026
4060
|
], DateTimeType);
|
|
4027
4061
|
|
|
4028
4062
|
// ../../build/common/esm/document/data-type/extended-types/date-time-string.type.js
|
|
4029
|
-
import { __decorate as __decorate5, __metadata as __metadata5 } from "tslib";
|
|
4030
4063
|
import { vg as vg7 } from "valgen";
|
|
4031
4064
|
var DateTimeStringType = class DateTimeStringType2 {
|
|
4032
4065
|
static {
|
|
@@ -4049,19 +4082,19 @@ var DateTimeStringType = class DateTimeStringType2 {
|
|
|
4049
4082
|
return this[DECODER](properties);
|
|
4050
4083
|
}
|
|
4051
4084
|
};
|
|
4052
|
-
|
|
4085
|
+
__decorate([
|
|
4053
4086
|
SimpleType2.Attribute({
|
|
4054
4087
|
description: "Minimum value"
|
|
4055
4088
|
}),
|
|
4056
|
-
|
|
4089
|
+
__metadata("design:type", String)
|
|
4057
4090
|
], DateTimeStringType.prototype, "minValue", void 0);
|
|
4058
|
-
|
|
4091
|
+
__decorate([
|
|
4059
4092
|
SimpleType2.Attribute({
|
|
4060
4093
|
description: "Maximum value"
|
|
4061
4094
|
}),
|
|
4062
|
-
|
|
4095
|
+
__metadata("design:type", String)
|
|
4063
4096
|
], DateTimeStringType.prototype, "maxValue", void 0);
|
|
4064
|
-
DateTimeStringType =
|
|
4097
|
+
DateTimeStringType = __decorate([
|
|
4065
4098
|
SimpleType2({
|
|
4066
4099
|
description: "DateTime string value",
|
|
4067
4100
|
nameMappings: {
|
|
@@ -4069,11 +4102,10 @@ DateTimeStringType = __decorate5([
|
|
|
4069
4102
|
json: "string"
|
|
4070
4103
|
}
|
|
4071
4104
|
}).Example("2021-04-18T22:30:15+01:00", "Full date-time value with timezone").Example("2021-04-18T22:30:15", "Full date-time value without timezone").Example("2021-04-18 22:30", "Date-time value").Example("2021-04-18", "Date value").Example("2021-04", "Date value without day").Example("2021", "Year only value"),
|
|
4072
|
-
|
|
4105
|
+
__metadata("design:paramtypes", [Object])
|
|
4073
4106
|
], DateTimeStringType);
|
|
4074
4107
|
|
|
4075
4108
|
// ../../build/common/esm/document/data-type/extended-types/email.type.js
|
|
4076
|
-
import { __decorate as __decorate6, __metadata as __metadata6 } from "tslib";
|
|
4077
4109
|
import { vg as vg8 } from "valgen";
|
|
4078
4110
|
var EmailType = class EmailType2 {
|
|
4079
4111
|
static {
|
|
@@ -4090,67 +4122,67 @@ var EmailType = class EmailType2 {
|
|
|
4090
4122
|
return vg8.isEmail({ ...properties, coerce: true });
|
|
4091
4123
|
}
|
|
4092
4124
|
};
|
|
4093
|
-
|
|
4125
|
+
__decorate([
|
|
4094
4126
|
SimpleType2.Attribute({
|
|
4095
4127
|
description: "If set to `true`, the validator will also match `Display Name <email-address>",
|
|
4096
4128
|
default: false
|
|
4097
4129
|
}),
|
|
4098
|
-
|
|
4130
|
+
__metadata("design:type", Boolean)
|
|
4099
4131
|
], EmailType.prototype, "allowDisplayName", void 0);
|
|
4100
|
-
|
|
4132
|
+
__decorate([
|
|
4101
4133
|
SimpleType2.Attribute({
|
|
4102
4134
|
description: "If set to `true`, the validator will reject strings without the format `Display Name <email-address>",
|
|
4103
4135
|
default: false
|
|
4104
4136
|
}),
|
|
4105
|
-
|
|
4137
|
+
__metadata("design:type", Boolean)
|
|
4106
4138
|
], EmailType.prototype, "requireDisplayName", void 0);
|
|
4107
|
-
|
|
4139
|
+
__decorate([
|
|
4108
4140
|
SimpleType2.Attribute({
|
|
4109
4141
|
description: "If set to `false`, the validator will not allow any non-English UTF8 character in email address's local part",
|
|
4110
4142
|
default: true
|
|
4111
4143
|
}),
|
|
4112
|
-
|
|
4144
|
+
__metadata("design:type", Boolean)
|
|
4113
4145
|
], EmailType.prototype, "utf8LocalPart", void 0);
|
|
4114
|
-
|
|
4146
|
+
__decorate([
|
|
4115
4147
|
SimpleType2.Attribute({
|
|
4116
4148
|
description: "If set to `true`, the validator will not check for the standard max length of an email",
|
|
4117
4149
|
default: false
|
|
4118
4150
|
}),
|
|
4119
|
-
|
|
4151
|
+
__metadata("design:type", Boolean)
|
|
4120
4152
|
], EmailType.prototype, "ignoreMaxLength", void 0);
|
|
4121
|
-
|
|
4153
|
+
__decorate([
|
|
4122
4154
|
SimpleType2.Attribute({
|
|
4123
4155
|
description: "If set to `true`, the validator will allow IP addresses in the host part",
|
|
4124
4156
|
default: false
|
|
4125
4157
|
}),
|
|
4126
|
-
|
|
4158
|
+
__metadata("design:type", Boolean)
|
|
4127
4159
|
], EmailType.prototype, "allowIpDomain", void 0);
|
|
4128
|
-
|
|
4160
|
+
__decorate([
|
|
4129
4161
|
SimpleType2.Attribute({
|
|
4130
4162
|
description: "If set to `true`, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by GMail.",
|
|
4131
4163
|
default: false
|
|
4132
4164
|
}),
|
|
4133
|
-
|
|
4165
|
+
__metadata("design:type", Boolean)
|
|
4134
4166
|
], EmailType.prototype, "domainSpecificValidation", void 0);
|
|
4135
|
-
|
|
4167
|
+
__decorate([
|
|
4136
4168
|
SimpleType2.Attribute({
|
|
4137
4169
|
description: "If set to an array of strings and the part of the email after the @ symbol one of the strings defined in it, the validation fails."
|
|
4138
4170
|
}),
|
|
4139
|
-
|
|
4171
|
+
__metadata("design:type", Array)
|
|
4140
4172
|
], EmailType.prototype, "hostBlacklist", void 0);
|
|
4141
|
-
|
|
4173
|
+
__decorate([
|
|
4142
4174
|
SimpleType2.Attribute({
|
|
4143
4175
|
description: "If set to an array of strings and the part of the email after the @ symbol matches none of the strings defined in it, the validation fails."
|
|
4144
4176
|
}),
|
|
4145
|
-
|
|
4177
|
+
__metadata("design:type", Array)
|
|
4146
4178
|
], EmailType.prototype, "hostWhitelist", void 0);
|
|
4147
|
-
|
|
4179
|
+
__decorate([
|
|
4148
4180
|
SimpleType2.Attribute({
|
|
4149
4181
|
description: "If set to a string, then the validator will reject emails that include any of the characters in the string, in the name part."
|
|
4150
4182
|
}),
|
|
4151
|
-
|
|
4183
|
+
__metadata("design:type", String)
|
|
4152
4184
|
], EmailType.prototype, "blacklistedChars", void 0);
|
|
4153
|
-
EmailType =
|
|
4185
|
+
EmailType = __decorate([
|
|
4154
4186
|
SimpleType2({
|
|
4155
4187
|
description: "An email value",
|
|
4156
4188
|
nameMappings: {
|
|
@@ -4158,11 +4190,10 @@ EmailType = __decorate6([
|
|
|
4158
4190
|
json: "string"
|
|
4159
4191
|
}
|
|
4160
4192
|
}).Example("some.body@example.com"),
|
|
4161
|
-
|
|
4193
|
+
__metadata("design:paramtypes", [Object])
|
|
4162
4194
|
], EmailType);
|
|
4163
4195
|
|
|
4164
4196
|
// ../../build/common/esm/document/data-type/extended-types/field-path.type.js
|
|
4165
|
-
import { __decorate as __decorate7, __metadata as __metadata7 } from "tslib";
|
|
4166
4197
|
import { toString as toString3, validator as validator2, vg as vg9 } from "valgen";
|
|
4167
4198
|
var FieldPathType = class FieldPathType2 {
|
|
4168
4199
|
static {
|
|
@@ -4190,19 +4221,19 @@ var FieldPathType = class FieldPathType2 {
|
|
|
4190
4221
|
};
|
|
4191
4222
|
}
|
|
4192
4223
|
};
|
|
4193
|
-
|
|
4224
|
+
__decorate([
|
|
4194
4225
|
SimpleType2.Attribute({
|
|
4195
4226
|
description: "Data type which field belong to"
|
|
4196
4227
|
}),
|
|
4197
|
-
|
|
4228
|
+
__metadata("design:type", Object)
|
|
4198
4229
|
], FieldPathType.prototype, "dataType", void 0);
|
|
4199
|
-
|
|
4230
|
+
__decorate([
|
|
4200
4231
|
SimpleType2.Attribute({
|
|
4201
4232
|
description: 'Determines if signs (+,-) are allowed. If set "first" signs are allowed only beginning of the field pathIf set "each" signs are allowed at each field in the path'
|
|
4202
4233
|
}),
|
|
4203
|
-
|
|
4234
|
+
__metadata("design:type", String)
|
|
4204
4235
|
], FieldPathType.prototype, "allowSigns", void 0);
|
|
4205
|
-
FieldPathType =
|
|
4236
|
+
FieldPathType = __decorate([
|
|
4206
4237
|
SimpleType2({
|
|
4207
4238
|
description: "Field path",
|
|
4208
4239
|
nameMappings: {
|
|
@@ -4210,11 +4241,10 @@ FieldPathType = __decorate7([
|
|
|
4210
4241
|
json: "string"
|
|
4211
4242
|
}
|
|
4212
4243
|
}),
|
|
4213
|
-
|
|
4244
|
+
__metadata("design:paramtypes", [Object])
|
|
4214
4245
|
], FieldPathType);
|
|
4215
4246
|
|
|
4216
4247
|
// ../../build/common/esm/document/data-type/extended-types/filter.type.js
|
|
4217
|
-
import { __decorate as __decorate8, __metadata as __metadata8 } from "tslib";
|
|
4218
4248
|
import { validator as validator3 } from "valgen";
|
|
4219
4249
|
|
|
4220
4250
|
// ../../build/common/esm/exception/opra-http-error.js
|
|
@@ -12086,20 +12116,20 @@ var FilterType = class FilterType2 {
|
|
|
12086
12116
|
};
|
|
12087
12117
|
}
|
|
12088
12118
|
};
|
|
12089
|
-
|
|
12119
|
+
__decorate([
|
|
12090
12120
|
SimpleType2.Attribute({
|
|
12091
12121
|
description: "Data type which filtering fields belong to"
|
|
12092
12122
|
}),
|
|
12093
|
-
|
|
12123
|
+
__metadata("design:type", Object)
|
|
12094
12124
|
], FilterType.prototype, "dataType", void 0);
|
|
12095
|
-
|
|
12125
|
+
__decorate([
|
|
12096
12126
|
SimpleType2.Attribute({
|
|
12097
12127
|
description: "Stringified JSON object defines filtering rules",
|
|
12098
12128
|
format: "string"
|
|
12099
12129
|
}),
|
|
12100
|
-
|
|
12130
|
+
__metadata("design:type", Object)
|
|
12101
12131
|
], FilterType.prototype, "rules", void 0);
|
|
12102
|
-
FilterType =
|
|
12132
|
+
FilterType = __decorate([
|
|
12103
12133
|
SimpleType2({
|
|
12104
12134
|
description: "A query filter",
|
|
12105
12135
|
nameMappings: {
|
|
@@ -12107,7 +12137,7 @@ FilterType = __decorate8([
|
|
|
12107
12137
|
json: "string"
|
|
12108
12138
|
}
|
|
12109
12139
|
}),
|
|
12110
|
-
|
|
12140
|
+
__metadata("design:paramtypes", [Object])
|
|
12111
12141
|
], FilterType);
|
|
12112
12142
|
var decodeFilter = /* @__PURE__ */ __name((dataType, rules) => validator3("decodeFilter", (input, context, _this) => {
|
|
12113
12143
|
if (typeof input === "string") {
|
|
@@ -12131,7 +12161,6 @@ var encodeFilter = validator3("encodeFilter", (input, context, _this) => {
|
|
|
12131
12161
|
});
|
|
12132
12162
|
|
|
12133
12163
|
// ../../build/common/esm/document/data-type/extended-types/object-id.type.js
|
|
12134
|
-
import { __decorate as __decorate9, __metadata as __metadata9 } from "tslib";
|
|
12135
12164
|
import { vg as vg10 } from "valgen";
|
|
12136
12165
|
var ObjectIdType = class ObjectIdType2 {
|
|
12137
12166
|
static {
|
|
@@ -12148,7 +12177,7 @@ var ObjectIdType = class ObjectIdType2 {
|
|
|
12148
12177
|
return vg10.isObjectId({ coerce: true });
|
|
12149
12178
|
}
|
|
12150
12179
|
};
|
|
12151
|
-
ObjectIdType =
|
|
12180
|
+
ObjectIdType = __decorate([
|
|
12152
12181
|
SimpleType2({
|
|
12153
12182
|
description: "A MongoDB ObjectID value",
|
|
12154
12183
|
nameMappings: {
|
|
@@ -12156,11 +12185,10 @@ ObjectIdType = __decorate9([
|
|
|
12156
12185
|
json: "string"
|
|
12157
12186
|
}
|
|
12158
12187
|
}),
|
|
12159
|
-
|
|
12188
|
+
__metadata("design:paramtypes", [Object])
|
|
12160
12189
|
], ObjectIdType);
|
|
12161
12190
|
|
|
12162
12191
|
// ../../build/common/esm/document/data-type/extended-types/operation-result.type.js
|
|
12163
|
-
import { __decorate as __decorate10, __metadata as __metadata10 } from "tslib";
|
|
12164
12192
|
var OperationResult = class OperationResult2 {
|
|
12165
12193
|
static {
|
|
12166
12194
|
__name(this, "OperationResult");
|
|
@@ -12170,39 +12198,39 @@ var OperationResult = class OperationResult2 {
|
|
|
12170
12198
|
Object.assign(this, init);
|
|
12171
12199
|
}
|
|
12172
12200
|
};
|
|
12173
|
-
|
|
12201
|
+
__decorate([
|
|
12174
12202
|
ApiField(),
|
|
12175
|
-
|
|
12203
|
+
__metadata("design:type", Number)
|
|
12176
12204
|
], OperationResult.prototype, "affected", void 0);
|
|
12177
|
-
|
|
12205
|
+
__decorate([
|
|
12178
12206
|
ApiField(),
|
|
12179
|
-
|
|
12207
|
+
__metadata("design:type", Number)
|
|
12180
12208
|
], OperationResult.prototype, "totalMatches", void 0);
|
|
12181
|
-
|
|
12209
|
+
__decorate([
|
|
12182
12210
|
ApiField(),
|
|
12183
|
-
|
|
12211
|
+
__metadata("design:type", String)
|
|
12184
12212
|
], OperationResult.prototype, "context", void 0);
|
|
12185
|
-
|
|
12213
|
+
__decorate([
|
|
12186
12214
|
ApiField(),
|
|
12187
|
-
|
|
12215
|
+
__metadata("design:type", String)
|
|
12188
12216
|
], OperationResult.prototype, "type", void 0);
|
|
12189
|
-
|
|
12217
|
+
__decorate([
|
|
12190
12218
|
ApiField(),
|
|
12191
|
-
|
|
12219
|
+
__metadata("design:type", String)
|
|
12192
12220
|
], OperationResult.prototype, "message", void 0);
|
|
12193
|
-
|
|
12221
|
+
__decorate([
|
|
12194
12222
|
ApiField({ type: "any" }),
|
|
12195
|
-
|
|
12223
|
+
__metadata("design:type", Object)
|
|
12196
12224
|
], OperationResult.prototype, "payload", void 0);
|
|
12197
|
-
|
|
12225
|
+
__decorate([
|
|
12198
12226
|
ApiField({ type: "object" }),
|
|
12199
|
-
|
|
12227
|
+
__metadata("design:type", Array)
|
|
12200
12228
|
], OperationResult.prototype, "errors", void 0);
|
|
12201
|
-
OperationResult =
|
|
12229
|
+
OperationResult = __decorate([
|
|
12202
12230
|
ComplexType2({
|
|
12203
12231
|
description: "Operation result"
|
|
12204
12232
|
}),
|
|
12205
|
-
|
|
12233
|
+
__metadata("design:paramtypes", [Object])
|
|
12206
12234
|
], OperationResult);
|
|
12207
12235
|
(function(OperationResult3) {
|
|
12208
12236
|
function forPayload(type) {
|
|
@@ -12214,13 +12242,13 @@ OperationResult = __decorate10([
|
|
|
12214
12242
|
super(...args);
|
|
12215
12243
|
}
|
|
12216
12244
|
};
|
|
12217
|
-
|
|
12245
|
+
__decorate([
|
|
12218
12246
|
ApiField({ type, required: true }),
|
|
12219
|
-
|
|
12247
|
+
__metadata("design:type", Object)
|
|
12220
12248
|
], OperationResult_.prototype, "payload", void 0);
|
|
12221
|
-
OperationResult_ =
|
|
12249
|
+
OperationResult_ = __decorate([
|
|
12222
12250
|
ComplexType2({ embedded: true }),
|
|
12223
|
-
|
|
12251
|
+
__metadata("design:paramtypes", [Object])
|
|
12224
12252
|
], OperationResult_);
|
|
12225
12253
|
return OperationResult_;
|
|
12226
12254
|
}
|
|
@@ -12229,7 +12257,6 @@ OperationResult = __decorate10([
|
|
|
12229
12257
|
})(OperationResult || (OperationResult = {}));
|
|
12230
12258
|
|
|
12231
12259
|
// ../../build/common/esm/document/data-type/extended-types/time.type.js
|
|
12232
|
-
import { __decorate as __decorate11, __metadata as __metadata11 } from "tslib";
|
|
12233
12260
|
import { vg as vg11 } from "valgen";
|
|
12234
12261
|
var TIME_PATTERN2 = /^([0-1][0-9]|2[0-4]):([0-5][0-9])(?::([0-5][0-9]))?$/;
|
|
12235
12262
|
var TimeType = class TimeType2 {
|
|
@@ -12256,19 +12283,19 @@ var TimeType = class TimeType2 {
|
|
|
12256
12283
|
return this[DECODER](properties);
|
|
12257
12284
|
}
|
|
12258
12285
|
};
|
|
12259
|
-
|
|
12286
|
+
__decorate([
|
|
12260
12287
|
SimpleType2.Attribute({
|
|
12261
12288
|
description: "Minimum value"
|
|
12262
12289
|
}),
|
|
12263
|
-
|
|
12290
|
+
__metadata("design:type", String)
|
|
12264
12291
|
], TimeType.prototype, "minValue", void 0);
|
|
12265
|
-
|
|
12292
|
+
__decorate([
|
|
12266
12293
|
SimpleType2.Attribute({
|
|
12267
12294
|
description: "Maximum value"
|
|
12268
12295
|
}),
|
|
12269
|
-
|
|
12296
|
+
__metadata("design:type", String)
|
|
12270
12297
|
], TimeType.prototype, "maxValue", void 0);
|
|
12271
|
-
TimeType =
|
|
12298
|
+
TimeType = __decorate([
|
|
12272
12299
|
SimpleType2({
|
|
12273
12300
|
description: "Time string in 24h format",
|
|
12274
12301
|
nameMappings: {
|
|
@@ -12276,11 +12303,10 @@ TimeType = __decorate11([
|
|
|
12276
12303
|
json: "string"
|
|
12277
12304
|
}
|
|
12278
12305
|
}).Example("18:23:00", "Full time value").Example("18:23:00", "Time value without seconds"),
|
|
12279
|
-
|
|
12306
|
+
__metadata("design:paramtypes", [Object])
|
|
12280
12307
|
], TimeType);
|
|
12281
12308
|
|
|
12282
12309
|
// ../../build/common/esm/document/data-type/extended-types/url.type.js
|
|
12283
|
-
import { __decorate as __decorate12, __metadata as __metadata12 } from "tslib";
|
|
12284
12310
|
import { vg as vg12 } from "valgen";
|
|
12285
12311
|
var UrlType = class UrlType2 {
|
|
12286
12312
|
static {
|
|
@@ -12297,7 +12323,7 @@ var UrlType = class UrlType2 {
|
|
|
12297
12323
|
return vg12.isURL({ coerce: true });
|
|
12298
12324
|
}
|
|
12299
12325
|
};
|
|
12300
|
-
UrlType =
|
|
12326
|
+
UrlType = __decorate([
|
|
12301
12327
|
SimpleType2({
|
|
12302
12328
|
description: "A Uniform Resource Identifier Reference (RFC 3986 icon) value",
|
|
12303
12329
|
nameMappings: {
|
|
@@ -12305,11 +12331,10 @@ UrlType = __decorate12([
|
|
|
12305
12331
|
json: "string"
|
|
12306
12332
|
}
|
|
12307
12333
|
}).Example("http://tempuri.org"),
|
|
12308
|
-
|
|
12334
|
+
__metadata("design:paramtypes", [Object])
|
|
12309
12335
|
], UrlType);
|
|
12310
12336
|
|
|
12311
12337
|
// ../../build/common/esm/document/data-type/extended-types/uuid.type.js
|
|
12312
|
-
import { __decorate as __decorate13, __metadata as __metadata13 } from "tslib";
|
|
12313
12338
|
import { vg as vg13 } from "valgen";
|
|
12314
12339
|
var UuidType = class UuidType2 {
|
|
12315
12340
|
static {
|
|
@@ -12326,13 +12351,13 @@ var UuidType = class UuidType2 {
|
|
|
12326
12351
|
return vg13.isUUID(properties?.version, { coerce: true });
|
|
12327
12352
|
}
|
|
12328
12353
|
};
|
|
12329
|
-
|
|
12354
|
+
__decorate([
|
|
12330
12355
|
SimpleType2.Attribute({
|
|
12331
12356
|
description: "Version of the UUID"
|
|
12332
12357
|
}),
|
|
12333
|
-
|
|
12358
|
+
__metadata("design:type", Number)
|
|
12334
12359
|
], UuidType.prototype, "version", void 0);
|
|
12335
|
-
UuidType =
|
|
12360
|
+
UuidType = __decorate([
|
|
12336
12361
|
SimpleType2({
|
|
12337
12362
|
description: "A Universal Unique Identifier (UUID) value",
|
|
12338
12363
|
nameMappings: {
|
|
@@ -12340,7 +12365,7 @@ UuidType = __decorate13([
|
|
|
12340
12365
|
json: "string"
|
|
12341
12366
|
}
|
|
12342
12367
|
}),
|
|
12343
|
-
|
|
12368
|
+
__metadata("design:paramtypes", [Object])
|
|
12344
12369
|
], UuidType);
|
|
12345
12370
|
|
|
12346
12371
|
// ../../build/common/esm/document/data-type/utils/create-mapped-class.js
|
|
@@ -12411,7 +12436,6 @@ function PickType(baseType, keys, options) {
|
|
|
12411
12436
|
__name(PickType, "PickType");
|
|
12412
12437
|
|
|
12413
12438
|
// ../../build/common/esm/document/data-type/primitive-types/any.type.js
|
|
12414
|
-
import { __decorate as __decorate14, __metadata as __metadata14 } from "tslib";
|
|
12415
12439
|
import { isAny as isAny2 } from "valgen";
|
|
12416
12440
|
var AnyType = class AnyType2 {
|
|
12417
12441
|
static {
|
|
@@ -12428,19 +12452,17 @@ var AnyType = class AnyType2 {
|
|
|
12428
12452
|
return isAny2;
|
|
12429
12453
|
}
|
|
12430
12454
|
};
|
|
12431
|
-
AnyType =
|
|
12455
|
+
AnyType = __decorate([
|
|
12432
12456
|
SimpleType2({
|
|
12433
12457
|
description: "Represents any value"
|
|
12434
12458
|
}),
|
|
12435
|
-
|
|
12459
|
+
__metadata("design:paramtypes", [Object])
|
|
12436
12460
|
], AnyType);
|
|
12437
12461
|
|
|
12438
12462
|
// ../../build/common/esm/document/data-type/primitive-types/bigint.type.js
|
|
12439
|
-
import { __decorate as __decorate16, __metadata as __metadata16 } from "tslib";
|
|
12440
12463
|
import { toBigint, vg as vg15 } from "valgen";
|
|
12441
12464
|
|
|
12442
12465
|
// ../../build/common/esm/document/data-type/primitive-types/number.type.js
|
|
12443
|
-
import { __decorate as __decorate15, __metadata as __metadata15 } from "tslib";
|
|
12444
12466
|
import { toNumber, vg as vg14 } from "valgen";
|
|
12445
12467
|
var NumberType = class NumberType2 {
|
|
12446
12468
|
static {
|
|
@@ -12462,19 +12484,19 @@ var NumberType = class NumberType2 {
|
|
|
12462
12484
|
return this[DECODER](properties);
|
|
12463
12485
|
}
|
|
12464
12486
|
};
|
|
12465
|
-
|
|
12487
|
+
__decorate([
|
|
12466
12488
|
SimpleType2.Attribute({
|
|
12467
12489
|
description: "Determines the minimum value"
|
|
12468
12490
|
}),
|
|
12469
|
-
|
|
12491
|
+
__metadata("design:type", Number)
|
|
12470
12492
|
], NumberType.prototype, "minValue", void 0);
|
|
12471
|
-
|
|
12493
|
+
__decorate([
|
|
12472
12494
|
SimpleType2.Attribute({
|
|
12473
12495
|
description: "Determines the maximum value"
|
|
12474
12496
|
}),
|
|
12475
|
-
|
|
12497
|
+
__metadata("design:type", Number)
|
|
12476
12498
|
], NumberType.prototype, "maxValue", void 0);
|
|
12477
|
-
NumberType =
|
|
12499
|
+
NumberType = __decorate([
|
|
12478
12500
|
SimpleType2({
|
|
12479
12501
|
description: "Both Integer as well as Floating-Point numbers",
|
|
12480
12502
|
nameMappings: {
|
|
@@ -12482,7 +12504,7 @@ NumberType = __decorate15([
|
|
|
12482
12504
|
json: "number"
|
|
12483
12505
|
}
|
|
12484
12506
|
}),
|
|
12485
|
-
|
|
12507
|
+
__metadata("design:paramtypes", [Object])
|
|
12486
12508
|
], NumberType);
|
|
12487
12509
|
|
|
12488
12510
|
// ../../build/common/esm/document/data-type/primitive-types/bigint.type.js
|
|
@@ -12505,7 +12527,7 @@ var BigintType = class BigintType2 extends NumberType {
|
|
|
12505
12527
|
return this[DECODER](properties);
|
|
12506
12528
|
}
|
|
12507
12529
|
};
|
|
12508
|
-
BigintType =
|
|
12530
|
+
BigintType = __decorate([
|
|
12509
12531
|
SimpleType2({
|
|
12510
12532
|
description: "BigInt number",
|
|
12511
12533
|
nameMappings: {
|
|
@@ -12513,11 +12535,10 @@ BigintType = __decorate16([
|
|
|
12513
12535
|
json: "string"
|
|
12514
12536
|
}
|
|
12515
12537
|
}),
|
|
12516
|
-
|
|
12538
|
+
__metadata("design:paramtypes", [Object])
|
|
12517
12539
|
], BigintType);
|
|
12518
12540
|
|
|
12519
12541
|
// ../../build/common/esm/document/data-type/primitive-types/boolean.type.js
|
|
12520
|
-
import { __decorate as __decorate17, __metadata as __metadata17 } from "tslib";
|
|
12521
12542
|
import { toBoolean } from "valgen";
|
|
12522
12543
|
var BooleanType = class BooleanType2 {
|
|
12523
12544
|
static {
|
|
@@ -12534,7 +12555,7 @@ var BooleanType = class BooleanType2 {
|
|
|
12534
12555
|
return toBoolean;
|
|
12535
12556
|
}
|
|
12536
12557
|
};
|
|
12537
|
-
BooleanType =
|
|
12558
|
+
BooleanType = __decorate([
|
|
12538
12559
|
SimpleType2({
|
|
12539
12560
|
description: "Simple true/false value",
|
|
12540
12561
|
nameMappings: {
|
|
@@ -12542,11 +12563,10 @@ BooleanType = __decorate17([
|
|
|
12542
12563
|
json: "boolean"
|
|
12543
12564
|
}
|
|
12544
12565
|
}),
|
|
12545
|
-
|
|
12566
|
+
__metadata("design:paramtypes", [Object])
|
|
12546
12567
|
], BooleanType);
|
|
12547
12568
|
|
|
12548
12569
|
// ../../build/common/esm/document/data-type/primitive-types/integer.type.js
|
|
12549
|
-
import { __decorate as __decorate18, __metadata as __metadata18 } from "tslib";
|
|
12550
12570
|
import { toInteger, vg as vg16 } from "valgen";
|
|
12551
12571
|
var IntegerType = class IntegerType2 extends NumberType {
|
|
12552
12572
|
static {
|
|
@@ -12567,7 +12587,7 @@ var IntegerType = class IntegerType2 extends NumberType {
|
|
|
12567
12587
|
return this[DECODER](properties);
|
|
12568
12588
|
}
|
|
12569
12589
|
};
|
|
12570
|
-
IntegerType =
|
|
12590
|
+
IntegerType = __decorate([
|
|
12571
12591
|
SimpleType2({
|
|
12572
12592
|
description: "An integer number",
|
|
12573
12593
|
nameMappings: {
|
|
@@ -12575,11 +12595,10 @@ IntegerType = __decorate18([
|
|
|
12575
12595
|
json: "number"
|
|
12576
12596
|
}
|
|
12577
12597
|
}),
|
|
12578
|
-
|
|
12598
|
+
__metadata("design:paramtypes", [Object])
|
|
12579
12599
|
], IntegerType);
|
|
12580
12600
|
|
|
12581
12601
|
// ../../build/common/esm/document/data-type/primitive-types/null.type.js
|
|
12582
|
-
import { __decorate as __decorate19, __metadata as __metadata19 } from "tslib";
|
|
12583
12602
|
import { isNull } from "valgen";
|
|
12584
12603
|
var NullType = class NullType2 {
|
|
12585
12604
|
static {
|
|
@@ -12596,7 +12615,7 @@ var NullType = class NullType2 {
|
|
|
12596
12615
|
return isNull;
|
|
12597
12616
|
}
|
|
12598
12617
|
};
|
|
12599
|
-
NullType =
|
|
12618
|
+
NullType = __decorate([
|
|
12600
12619
|
SimpleType2({
|
|
12601
12620
|
description: "A Null value",
|
|
12602
12621
|
nameMappings: {
|
|
@@ -12604,11 +12623,10 @@ NullType = __decorate19([
|
|
|
12604
12623
|
json: "null"
|
|
12605
12624
|
}
|
|
12606
12625
|
}),
|
|
12607
|
-
|
|
12626
|
+
__metadata("design:paramtypes", [Object])
|
|
12608
12627
|
], NullType);
|
|
12609
12628
|
|
|
12610
12629
|
// ../../build/common/esm/document/data-type/primitive-types/object.type.js
|
|
12611
|
-
import { __decorate as __decorate20, __metadata as __metadata20 } from "tslib";
|
|
12612
12630
|
var ObjectType = class ObjectType2 {
|
|
12613
12631
|
static {
|
|
12614
12632
|
__name(this, "ObjectType");
|
|
@@ -12618,19 +12636,18 @@ var ObjectType = class ObjectType2 {
|
|
|
12618
12636
|
Object.assign(this, properties);
|
|
12619
12637
|
}
|
|
12620
12638
|
};
|
|
12621
|
-
ObjectType =
|
|
12639
|
+
ObjectType = __decorate([
|
|
12622
12640
|
ComplexType2({
|
|
12623
12641
|
name: "object",
|
|
12624
12642
|
description: "A non modelled object",
|
|
12625
12643
|
additionalFields: true
|
|
12626
12644
|
}),
|
|
12627
|
-
|
|
12645
|
+
__metadata("design:paramtypes", [Object])
|
|
12628
12646
|
], ObjectType);
|
|
12629
12647
|
var metadata = Reflect.getMetadata(DATATYPE_METADATA, ObjectType);
|
|
12630
12648
|
metadata.ctor = Object;
|
|
12631
12649
|
|
|
12632
12650
|
// ../../build/common/esm/document/data-type/primitive-types/string.type.js
|
|
12633
|
-
import { __decorate as __decorate21, __metadata as __metadata21 } from "tslib";
|
|
12634
12651
|
import { toString as toString4, vg as vg17 } from "valgen";
|
|
12635
12652
|
var StringType = class StringType2 {
|
|
12636
12653
|
static {
|
|
@@ -12660,31 +12677,31 @@ var StringType = class StringType2 {
|
|
|
12660
12677
|
return this[DECODER](properties);
|
|
12661
12678
|
}
|
|
12662
12679
|
};
|
|
12663
|
-
|
|
12680
|
+
__decorate([
|
|
12664
12681
|
SimpleType2.Attribute({
|
|
12665
12682
|
description: "Regex pattern to be used for validation"
|
|
12666
12683
|
}),
|
|
12667
|
-
|
|
12684
|
+
__metadata("design:type", Object)
|
|
12668
12685
|
], StringType.prototype, "pattern", void 0);
|
|
12669
|
-
|
|
12686
|
+
__decorate([
|
|
12670
12687
|
SimpleType2.Attribute({
|
|
12671
12688
|
description: "Name of the pattern"
|
|
12672
12689
|
}),
|
|
12673
|
-
|
|
12690
|
+
__metadata("design:type", String)
|
|
12674
12691
|
], StringType.prototype, "patternName", void 0);
|
|
12675
|
-
|
|
12692
|
+
__decorate([
|
|
12676
12693
|
SimpleType2.Attribute({
|
|
12677
12694
|
description: "Minimum number of characters"
|
|
12678
12695
|
}),
|
|
12679
|
-
|
|
12696
|
+
__metadata("design:type", Number)
|
|
12680
12697
|
], StringType.prototype, "minLength", void 0);
|
|
12681
|
-
|
|
12698
|
+
__decorate([
|
|
12682
12699
|
SimpleType2.Attribute({
|
|
12683
12700
|
description: "Minimum number of characters"
|
|
12684
12701
|
}),
|
|
12685
|
-
|
|
12702
|
+
__metadata("design:type", Number)
|
|
12686
12703
|
], StringType.prototype, "maxLength", void 0);
|
|
12687
|
-
StringType =
|
|
12704
|
+
StringType = __decorate([
|
|
12688
12705
|
SimpleType2({
|
|
12689
12706
|
description: "A sequence of characters",
|
|
12690
12707
|
nameMappings: {
|
|
@@ -12692,7 +12709,7 @@ StringType = __decorate21([
|
|
|
12692
12709
|
json: "string"
|
|
12693
12710
|
}
|
|
12694
12711
|
}),
|
|
12695
|
-
|
|
12712
|
+
__metadata("design:paramtypes", [Object])
|
|
12696
12713
|
], StringType);
|
|
12697
12714
|
|
|
12698
12715
|
// ../../build/common/esm/document/data-type/required-type.js
|
|
@@ -12739,8 +12756,6 @@ HttpOperation2.Entity.Create = function(arg0, arg1) {
|
|
|
12739
12756
|
description: "The request was well-formed but was unable to process operation due to one or many errors.",
|
|
12740
12757
|
contentType: MimeTypes.opra_response_json
|
|
12741
12758
|
});
|
|
12742
|
-
if (typeof args.type === "function")
|
|
12743
|
-
decorator.UseType(args.type);
|
|
12744
12759
|
decoratorChain.push((operationMeta) => {
|
|
12745
12760
|
const compositionOptions = operationMeta.compositionOptions = operationMeta.compositionOptions || {};
|
|
12746
12761
|
compositionOptions.type = getDataTypeName(args.type);
|
|
@@ -12766,8 +12781,6 @@ HttpOperation2.Entity.Delete = function(arg0, arg1) {
|
|
|
12766
12781
|
description: "The request was well-formed but was unable to process operation due to one or many errors.",
|
|
12767
12782
|
contentType: MimeTypes.opra_response_json
|
|
12768
12783
|
});
|
|
12769
|
-
if (typeof args.type === "function")
|
|
12770
|
-
decorator.UseType(args.type);
|
|
12771
12784
|
decorator.KeyParam = (name, prmOptions) => {
|
|
12772
12785
|
const paramMeta = typeof prmOptions === "string" || typeof prmOptions === "function" ? {
|
|
12773
12786
|
name,
|
|
@@ -12784,6 +12797,7 @@ HttpOperation2.Entity.Delete = function(arg0, arg1) {
|
|
|
12784
12797
|
decoratorChain.push((meta) => {
|
|
12785
12798
|
if (!meta.path?.includes(":" + name))
|
|
12786
12799
|
meta.path = (meta.path || "") + "@:" + name;
|
|
12800
|
+
meta.mergePath = true;
|
|
12787
12801
|
});
|
|
12788
12802
|
return decorator;
|
|
12789
12803
|
};
|
|
@@ -12818,8 +12832,6 @@ HttpOperation2.Entity.DeleteMany = function(arg0, arg1) {
|
|
|
12818
12832
|
type: filterType,
|
|
12819
12833
|
description: "Determines filter fields"
|
|
12820
12834
|
});
|
|
12821
|
-
if (typeof args.type === "function")
|
|
12822
|
-
decorator.UseType(args.type);
|
|
12823
12835
|
decoratorChain.push((operationMeta) => {
|
|
12824
12836
|
const compositionOptions = operationMeta.compositionOptions = operationMeta.compositionOptions || {};
|
|
12825
12837
|
compositionOptions.type = getDataTypeName(args.type);
|
|
@@ -12886,8 +12898,6 @@ HttpOperation2.Entity.FindMany = function(arg0, arg1) {
|
|
|
12886
12898
|
isArray: true,
|
|
12887
12899
|
arraySeparator: ","
|
|
12888
12900
|
});
|
|
12889
|
-
if (typeof args.type === "function")
|
|
12890
|
-
decorator.UseType(args.type);
|
|
12891
12901
|
decoratorChain.push((operationMeta) => {
|
|
12892
12902
|
const compositionOptions = operationMeta.compositionOptions = operationMeta.compositionOptions || {};
|
|
12893
12903
|
compositionOptions.type = getDataTypeName(args.type);
|
|
@@ -12946,8 +12956,6 @@ HttpOperation2.Entity.Get = function(arg0, arg1) {
|
|
|
12946
12956
|
description: "The request was well-formed but was unable to process operation due to one or many errors.",
|
|
12947
12957
|
contentType: MimeTypes.opra_response_json
|
|
12948
12958
|
});
|
|
12949
|
-
if (typeof args.type === "function")
|
|
12950
|
-
decorator.UseType(args.type);
|
|
12951
12959
|
decorator.KeyParam = (name, prmOptions) => {
|
|
12952
12960
|
const paramMeta = typeof prmOptions === "string" || typeof prmOptions === "function" ? {
|
|
12953
12961
|
name,
|
|
@@ -12964,6 +12972,7 @@ HttpOperation2.Entity.Get = function(arg0, arg1) {
|
|
|
12964
12972
|
decoratorChain.push((meta) => {
|
|
12965
12973
|
if (!meta.path?.includes(":" + name))
|
|
12966
12974
|
meta.path = (meta.path || "") + "@:" + name;
|
|
12975
|
+
meta.mergePath = true;
|
|
12967
12976
|
});
|
|
12968
12977
|
return decorator;
|
|
12969
12978
|
};
|
|
@@ -12994,10 +13003,7 @@ HttpOperation2.Entity.UpdateMany = function(arg0, arg1) {
|
|
|
12994
13003
|
required: true
|
|
12995
13004
|
}
|
|
12996
13005
|
}));
|
|
12997
|
-
decorator.RequestContent(args.requestBody?.type || args.type)
|
|
12998
|
-
if (typeof args.type === "function")
|
|
12999
|
-
decorator.UseType(args.type);
|
|
13000
|
-
decorator.Response(HttpStatusCode.OK, {
|
|
13006
|
+
decorator.RequestContent(args.requestBody?.type || args.type).Response(HttpStatusCode.OK, {
|
|
13001
13007
|
description: 'Operation is successful. Returns OperationResult with "affected" field.',
|
|
13002
13008
|
contentType: MimeTypes.opra_response_json
|
|
13003
13009
|
}).Response(HttpStatusCode.UNPROCESSABLE_ENTITY, {
|
|
@@ -13063,8 +13069,6 @@ HttpOperation2.Entity.Update = function(arg0, arg1) {
|
|
|
13063
13069
|
description: "The request was well-formed but was unable to process operation due to one or many errors.",
|
|
13064
13070
|
contentType: MimeTypes.opra_response_json
|
|
13065
13071
|
});
|
|
13066
|
-
if (typeof args.type === "function")
|
|
13067
|
-
decorator.UseType(args.type);
|
|
13068
13072
|
decorator.KeyParam = (name, prmOptions) => {
|
|
13069
13073
|
const paramMeta = typeof prmOptions === "string" || typeof prmOptions === "function" ? {
|
|
13070
13074
|
name,
|
|
@@ -13081,6 +13085,7 @@ HttpOperation2.Entity.Update = function(arg0, arg1) {
|
|
|
13081
13085
|
decoratorChain.push((meta) => {
|
|
13082
13086
|
if (!meta.path?.includes(":" + name))
|
|
13083
13087
|
meta.path = (meta.path || "") + "@:" + name;
|
|
13088
|
+
meta.mergePath = true;
|
|
13084
13089
|
});
|
|
13085
13090
|
return decorator;
|
|
13086
13091
|
};
|
|
@@ -13110,8 +13115,6 @@ function getDataTypeName(typ) {
|
|
|
13110
13115
|
__name(getDataTypeName, "getDataTypeName");
|
|
13111
13116
|
|
|
13112
13117
|
// ../../build/common/esm/document/factory/api-document.factory.js
|
|
13113
|
-
import crypto from "node:crypto";
|
|
13114
|
-
import { asMutable as asMutable15 } from "ts-gems";
|
|
13115
13118
|
var OPRA_SPEC_URL = "https://oprajs.com/spec/v" + OpraSchema.SpecVersion;
|
|
13116
13119
|
var ApiDocumentFactory = class _ApiDocumentFactory {
|
|
13117
13120
|
static {
|
|
@@ -13162,9 +13165,14 @@ var ApiDocumentFactory = class _ApiDocumentFactory {
|
|
|
13162
13165
|
init.url = schemaOrUrl;
|
|
13163
13166
|
} else
|
|
13164
13167
|
init = schemaOrUrl;
|
|
13168
|
+
let builtinDocument;
|
|
13165
13169
|
if (!document[BUILTIN]) {
|
|
13166
|
-
const
|
|
13167
|
-
|
|
13170
|
+
const t = document.node.findDataType("string");
|
|
13171
|
+
builtinDocument = t?.node.getDocument();
|
|
13172
|
+
if (!builtinDocument) {
|
|
13173
|
+
builtinDocument = await this.createBuiltinDocument(context);
|
|
13174
|
+
document.references.set("opra", builtinDocument);
|
|
13175
|
+
}
|
|
13168
13176
|
}
|
|
13169
13177
|
init.spec = init.spec || OpraSchema.SpecVersion;
|
|
13170
13178
|
document.url = init.url;
|
|
@@ -13184,8 +13192,11 @@ var ApiDocumentFactory = class _ApiDocumentFactory {
|
|
|
13184
13192
|
return;
|
|
13185
13193
|
}
|
|
13186
13194
|
const refDoc = new ApiDocument();
|
|
13195
|
+
if (builtinDocument)
|
|
13196
|
+
refDoc.references.set("opra", builtinDocument);
|
|
13187
13197
|
await this.initDocument(refDoc, context, r);
|
|
13188
|
-
document.
|
|
13198
|
+
const preDoc = document.findDocument(refDoc.id);
|
|
13199
|
+
document.references.set(ns, preDoc || refDoc);
|
|
13189
13200
|
});
|
|
13190
13201
|
}
|
|
13191
13202
|
});
|
|
@@ -13205,8 +13216,7 @@ var ApiDocumentFactory = class _ApiDocumentFactory {
|
|
|
13205
13216
|
context.addError(`Unknown service protocol (${init.api.protocol})`);
|
|
13206
13217
|
});
|
|
13207
13218
|
}
|
|
13208
|
-
|
|
13209
|
-
asMutable15(document).id = crypto.createHash("md5").update(JSON.stringify(x)).digest("base64url");
|
|
13219
|
+
document.invalidate();
|
|
13210
13220
|
}
|
|
13211
13221
|
/**
|
|
13212
13222
|
*
|