@navios/core 1.0.0-alpha.2 → 1.0.0-alpha.4
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/CHANGELOG.md +90 -0
- package/lib/{index-BJjk2X1S.d.mts → index-6S7veHKD.d.mts} +845 -294
- package/lib/index-6S7veHKD.d.mts.map +1 -0
- package/lib/{index-DZ6NU03y.d.cts → index-r0i2txmg.d.cts} +845 -294
- package/lib/index-r0i2txmg.d.cts.map +1 -0
- package/lib/index.cjs +4420 -84
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +2 -2
- package/lib/index.d.mts +2 -2
- package/lib/index.mjs +4328 -3
- package/lib/index.mjs.map +1 -0
- package/lib/legacy-compat/index.cjs +41 -126
- package/lib/legacy-compat/index.cjs.map +1 -1
- package/lib/legacy-compat/index.d.cts +4 -60
- package/lib/legacy-compat/index.d.cts.map +1 -1
- package/lib/legacy-compat/index.d.mts +4 -60
- package/lib/legacy-compat/index.d.mts.map +1 -1
- package/lib/legacy-compat/index.mjs +14 -119
- package/lib/legacy-compat/index.mjs.map +1 -1
- package/lib/navios.factory-BanZIvtR.cjs +4134 -0
- package/lib/navios.factory-BanZIvtR.cjs.map +1 -0
- package/lib/navios.factory-C75yZCoD.mjs +3831 -0
- package/lib/navios.factory-C75yZCoD.mjs.map +1 -0
- package/lib/testing/index.cjs +3 -3
- package/lib/testing/index.cjs.map +1 -1
- package/lib/testing/index.d.cts +1 -1
- package/lib/testing/index.d.mts +1 -1
- package/lib/testing/index.mjs +2 -2
- package/lib/tokens-4J9sredA.mjs +100 -0
- package/lib/tokens-4J9sredA.mjs.map +1 -0
- package/lib/tokens-BuXXB01L.cjs +196 -0
- package/lib/tokens-BuXXB01L.cjs.map +1 -0
- package/lib/{use-guards.decorator-Be_QUx6b.mjs → use-guards.decorator-BecoQSmE.mjs} +3 -70
- package/lib/use-guards.decorator-BecoQSmE.mjs.map +1 -0
- package/lib/{use-guards.decorator-B6tghdxM.cjs → use-guards.decorator-DgD-kxF5.cjs} +7 -158
- package/lib/use-guards.decorator-DgD-kxF5.cjs.map +1 -0
- package/package.json +4 -4
- package/src/__tests__/attribute.factory.spec.mts +300 -0
- package/src/__tests__/console-logger.service.spec.mts +312 -0
- package/src/__tests__/guard-runner.service.spec.mts +399 -0
- package/src/__tests__/logger.service.spec.mts +147 -0
- package/src/__tests__/responders.spec.mts +6 -5
- package/src/factories/adapter.factory.mts +20 -0
- package/src/factories/endpoint-adapter.factory.mts +1 -1
- package/src/factories/http-adapter.factory.mts +1 -1
- package/src/factories/index.mts +1 -0
- package/src/factories/multipart-adapter.factory.mts +1 -1
- package/src/factories/reply.factory.mts +1 -1
- package/src/factories/request.factory.mts +1 -1
- package/src/factories/stream-adapter.factory.mts +1 -1
- package/src/factories/xml-stream-adapter.factory.mts +1 -1
- package/src/index.mts +1 -0
- package/src/interfaces/abstract-adapter.interface.mts +32 -0
- package/src/interfaces/abstract-http-adapter.interface.mts +27 -20
- package/src/interfaces/abstract-http-handler-adapter.interface.mts +86 -2
- package/src/interfaces/adapter-environment.interface.mts +74 -0
- package/src/interfaces/index.mts +2 -0
- package/src/interfaces/plugin.interface.mts +50 -16
- package/src/legacy-compat/attribute.factory.mts +2 -2
- package/src/legacy-compat/decorators/controller.decorator.mts +1 -1
- package/src/legacy-compat/decorators/endpoint.decorator.mts +1 -1
- package/src/legacy-compat/decorators/header.decorator.mts +2 -1
- package/src/legacy-compat/decorators/http-code.decorator.mts +2 -1
- package/src/legacy-compat/decorators/index.mts +2 -2
- package/src/legacy-compat/decorators/module.decorator.mts +1 -1
- package/src/legacy-compat/decorators/multipart.decorator.mts +1 -1
- package/src/legacy-compat/decorators/stream.decorator.mts +1 -1
- package/src/legacy-compat/decorators/use-guards.decorator.mts +1 -1
- package/src/legacy-compat/index.mts +10 -5
- package/src/logger/console-logger.service.mts +97 -7
- package/src/metadata/module.metadata.mts +43 -0
- package/src/navios.application.mts +172 -60
- package/src/navios.environment.mts +22 -12
- package/src/navios.factory.mts +31 -10
- package/src/services/abstract-handler-adapter.service.mts +366 -0
- package/src/services/index.mts +1 -0
- package/src/services/module-loader.service.mts +1 -0
- package/src/tokens/adapter.token.mts +6 -0
- package/src/tokens/http-adapter.token.mts +1 -1
- package/src/tokens/index.mts +1 -0
- package/src/utils/adapter-supports.util.mts +47 -0
- package/src/utils/index.mts +1 -0
- package/lib/index-BJjk2X1S.d.mts.map +0 -1
- package/lib/index-DZ6NU03y.d.cts.map +0 -1
- package/lib/src-C46ePe3d.cjs +0 -8022
- package/lib/src-C46ePe3d.cjs.map +0 -1
- package/lib/src-K2k0riYJ.mjs +0 -7587
- package/lib/src-K2k0riYJ.mjs.map +0 -1
- package/lib/use-guards.decorator-B6tghdxM.cjs.map +0 -1
- package/lib/use-guards.decorator-Be_QUx6b.mjs.map +0 -1
- package/src/legacy-compat/context-compat.mts +0 -95
- package/src/legacy-compat/decorators/factory.decorator.mts +0 -37
- package/src/legacy-compat/decorators/injectable.decorator.mts +0 -41
package/lib/index.mjs
CHANGED
|
@@ -1,6 +1,4331 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { A as isFunction, B as isLogLevelEnabled, C as generateRequestId, D as addLeadingSlash, E as setRequestIdEnabled, F as isString, G as yellow, H as isLogLevel, I as isSymbol, L as isUndefined, M as isNumber, N as isObject, O as isConstructor, P as isPlainObject, R as normalizePath, S as loggerOptionsSchema, T as runWithRequestId, U as LOG_LEVELS, V as filterLogLevels, W as clc, _ as HttpException, a as assertAdapterSupports, b as Logger, c as AbstractHandlerAdapterService, d as _ErrorResponseProducerService, f as ForbiddenResponderToken, g as FrameworkError, h as ValidationErrorResponderToken, i as adapterSupports, j as isNil, k as isEmpty, l as ControllerResolverService, m as NotFoundResponderToken, n as _NaviosApplication, o as _ModuleLoaderService, p as InternalServerErrorResponderToken, r as _NaviosEnvironment, s as _GuardRunnerService, t as NaviosFactory, u as _InstanceResolverService, v as _LoggerInstance, w as getRequestId, x as LoggerOutput, y as _ConsoleLogger, z as stripEndSlash } from "./navios.factory-C75yZCoD.mjs";
|
|
2
|
+
import { _ as getAllEndpointMetadata, a as HttpCode, c as Controller, d as hasManagedMetadata, f as ControllerMetadataKey, g as EndpointMetadataKey, h as hasControllerMetadata, i as Module, l as NaviosManagedMetadataKey, m as getControllerMetadata, n as Stream, o as Header, p as extractControllerMetadata, r as Multipart, s as Endpoint, t as UseGuards, u as getManagedMetadata, v as getEndpointMetadata } from "./use-guards.decorator-BecoQSmE.mjs";
|
|
3
|
+
import { a as NaviosOptionsToken, c as ExecutionContext, d as AdapterToken, f as ModuleMetadataKey, g as hasModuleMetadata, h as getModuleMetadata, i as Reply, l as ExecutionContextInjectionToken, m as getModuleCustomEntry, n as StreamAdapterToken, o as MultipartAdapterToken, p as extractModuleMetadata, r as Request, s as HttpAdapterToken, t as XmlStreamAdapterToken, u as EndpointAdapterToken } from "./tokens-4J9sredA.mjs";
|
|
4
|
+
import { Factory, Injectable, InjectableScope, InjectionToken, inject } from "@navios/di";
|
|
5
|
+
import { env } from "node:process";
|
|
6
|
+
import { ZodError, treeifyError, z as z$1 } from "zod/v4";
|
|
7
|
+
import { NaviosError } from "@navios/builder";
|
|
3
8
|
|
|
4
9
|
export * from "@navios/di"
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
//#region src/config/utils/helpers.mts
|
|
12
|
+
function envInt(key, defaultValue) {
|
|
13
|
+
const envKey = env[key] || process.env[key];
|
|
14
|
+
return envKey ? parseInt(envKey, 10) : defaultValue;
|
|
15
|
+
}
|
|
16
|
+
function envString(key, defaultValue) {
|
|
17
|
+
return env[key] || process.env[key] || defaultValue || void 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/config/config.service.mts
|
|
22
|
+
function applyDecs2203RFactory$12() {
|
|
23
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
24
|
+
return function addInitializer(initializer) {
|
|
25
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
26
|
+
assertCallable(initializer, "An initializer");
|
|
27
|
+
initializers.push(initializer);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
31
|
+
var kindStr;
|
|
32
|
+
switch (kind) {
|
|
33
|
+
case 1:
|
|
34
|
+
kindStr = "accessor";
|
|
35
|
+
break;
|
|
36
|
+
case 2:
|
|
37
|
+
kindStr = "method";
|
|
38
|
+
break;
|
|
39
|
+
case 3:
|
|
40
|
+
kindStr = "getter";
|
|
41
|
+
break;
|
|
42
|
+
case 4:
|
|
43
|
+
kindStr = "setter";
|
|
44
|
+
break;
|
|
45
|
+
default: kindStr = "field";
|
|
46
|
+
}
|
|
47
|
+
var ctx = {
|
|
48
|
+
kind: kindStr,
|
|
49
|
+
name: isPrivate ? "#" + name : name,
|
|
50
|
+
static: isStatic,
|
|
51
|
+
private: isPrivate,
|
|
52
|
+
metadata
|
|
53
|
+
};
|
|
54
|
+
var decoratorFinishedRef = { v: false };
|
|
55
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
56
|
+
var get, set;
|
|
57
|
+
if (kind === 0) if (isPrivate) {
|
|
58
|
+
get = desc.get;
|
|
59
|
+
set = desc.set;
|
|
60
|
+
} else {
|
|
61
|
+
get = function() {
|
|
62
|
+
return this[name];
|
|
63
|
+
};
|
|
64
|
+
set = function(v) {
|
|
65
|
+
this[name] = v;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
else if (kind === 2) get = function() {
|
|
69
|
+
return desc.value;
|
|
70
|
+
};
|
|
71
|
+
else {
|
|
72
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
73
|
+
return desc.get.call(this);
|
|
74
|
+
};
|
|
75
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
76
|
+
desc.set.call(this, v);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
ctx.access = get && set ? {
|
|
80
|
+
get,
|
|
81
|
+
set
|
|
82
|
+
} : get ? { get } : { set };
|
|
83
|
+
try {
|
|
84
|
+
return dec(value, ctx);
|
|
85
|
+
} finally {
|
|
86
|
+
decoratorFinishedRef.v = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
90
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
91
|
+
}
|
|
92
|
+
function assertCallable(fn, hint) {
|
|
93
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
94
|
+
}
|
|
95
|
+
function assertValidReturnValue(kind, value) {
|
|
96
|
+
var type = typeof value;
|
|
97
|
+
if (kind === 1) {
|
|
98
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
99
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
100
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
101
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
102
|
+
} else if (type !== "function") {
|
|
103
|
+
var hint;
|
|
104
|
+
if (kind === 0) hint = "field";
|
|
105
|
+
else if (kind === 10) hint = "class";
|
|
106
|
+
else hint = "method";
|
|
107
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
111
|
+
var decs = decInfo[0];
|
|
112
|
+
var desc, init, value;
|
|
113
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
114
|
+
get: decInfo[3],
|
|
115
|
+
set: decInfo[4]
|
|
116
|
+
};
|
|
117
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
118
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
119
|
+
else desc = { value: decInfo[3] };
|
|
120
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
121
|
+
if (kind === 1) value = {
|
|
122
|
+
get: desc.get,
|
|
123
|
+
set: desc.set
|
|
124
|
+
};
|
|
125
|
+
else if (kind === 2) value = desc.value;
|
|
126
|
+
else if (kind === 3) value = desc.get;
|
|
127
|
+
else if (kind === 4) value = desc.set;
|
|
128
|
+
var newValue, get, set;
|
|
129
|
+
if (typeof decs === "function") {
|
|
130
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
131
|
+
if (newValue !== void 0) {
|
|
132
|
+
assertValidReturnValue(kind, newValue);
|
|
133
|
+
if (kind === 0) init = newValue;
|
|
134
|
+
else if (kind === 1) {
|
|
135
|
+
init = newValue.init;
|
|
136
|
+
get = newValue.get || value.get;
|
|
137
|
+
set = newValue.set || value.set;
|
|
138
|
+
value = {
|
|
139
|
+
get,
|
|
140
|
+
set
|
|
141
|
+
};
|
|
142
|
+
} else value = newValue;
|
|
143
|
+
}
|
|
144
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
145
|
+
var dec = decs[i];
|
|
146
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
147
|
+
if (newValue !== void 0) {
|
|
148
|
+
assertValidReturnValue(kind, newValue);
|
|
149
|
+
var newInit;
|
|
150
|
+
if (kind === 0) newInit = newValue;
|
|
151
|
+
else if (kind === 1) {
|
|
152
|
+
newInit = newValue.init;
|
|
153
|
+
get = newValue.get || value.get;
|
|
154
|
+
set = newValue.set || value.set;
|
|
155
|
+
value = {
|
|
156
|
+
get,
|
|
157
|
+
set
|
|
158
|
+
};
|
|
159
|
+
} else value = newValue;
|
|
160
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
161
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
162
|
+
else init.push(newInit);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (kind === 0 || kind === 1) {
|
|
166
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
167
|
+
return init$1;
|
|
168
|
+
};
|
|
169
|
+
else if (typeof init !== "function") {
|
|
170
|
+
var ownInitializers = init;
|
|
171
|
+
init = function(instance, init$1) {
|
|
172
|
+
var value$1 = init$1;
|
|
173
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
174
|
+
return value$1;
|
|
175
|
+
};
|
|
176
|
+
} else {
|
|
177
|
+
var originalInitializer = init;
|
|
178
|
+
init = function(instance, init$1) {
|
|
179
|
+
return originalInitializer.call(instance, init$1);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
ret.push(init);
|
|
183
|
+
}
|
|
184
|
+
if (kind !== 0) {
|
|
185
|
+
if (kind === 1) {
|
|
186
|
+
desc.get = value.get;
|
|
187
|
+
desc.set = value.set;
|
|
188
|
+
} else if (kind === 2) desc.value = value;
|
|
189
|
+
else if (kind === 3) desc.get = value;
|
|
190
|
+
else if (kind === 4) desc.set = value;
|
|
191
|
+
if (isPrivate) if (kind === 1) {
|
|
192
|
+
ret.push(function(instance, args) {
|
|
193
|
+
return value.get.call(instance, args);
|
|
194
|
+
});
|
|
195
|
+
ret.push(function(instance, args) {
|
|
196
|
+
return value.set.call(instance, args);
|
|
197
|
+
});
|
|
198
|
+
} else if (kind === 2) ret.push(value);
|
|
199
|
+
else ret.push(function(instance, args) {
|
|
200
|
+
return value.call(instance, args);
|
|
201
|
+
});
|
|
202
|
+
else Object.defineProperty(base, name, desc);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
206
|
+
var ret = [];
|
|
207
|
+
var protoInitializers;
|
|
208
|
+
var staticInitializers;
|
|
209
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
210
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
211
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
212
|
+
var decInfo = decInfos[i];
|
|
213
|
+
if (!Array.isArray(decInfo)) continue;
|
|
214
|
+
var kind = decInfo[1];
|
|
215
|
+
var name = decInfo[2];
|
|
216
|
+
var isPrivate = decInfo.length > 3;
|
|
217
|
+
var isStatic = kind >= 5;
|
|
218
|
+
var base;
|
|
219
|
+
var initializers;
|
|
220
|
+
if (isStatic) {
|
|
221
|
+
base = Class;
|
|
222
|
+
kind = kind - 5;
|
|
223
|
+
staticInitializers = staticInitializers || [];
|
|
224
|
+
initializers = staticInitializers;
|
|
225
|
+
} else {
|
|
226
|
+
base = Class.prototype;
|
|
227
|
+
protoInitializers = protoInitializers || [];
|
|
228
|
+
initializers = protoInitializers;
|
|
229
|
+
}
|
|
230
|
+
if (kind !== 0 && !isPrivate) {
|
|
231
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
232
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
233
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
234
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
235
|
+
else existingNonFields.set(name, true);
|
|
236
|
+
}
|
|
237
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
238
|
+
}
|
|
239
|
+
pushInitializers(ret, protoInitializers);
|
|
240
|
+
pushInitializers(ret, staticInitializers);
|
|
241
|
+
return ret;
|
|
242
|
+
}
|
|
243
|
+
function pushInitializers(ret, initializers) {
|
|
244
|
+
if (initializers) ret.push(function(instance) {
|
|
245
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
246
|
+
return instance;
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
250
|
+
if (classDecs.length > 0) {
|
|
251
|
+
var initializers = [];
|
|
252
|
+
var newClass = targetClass;
|
|
253
|
+
var name = targetClass.name;
|
|
254
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
255
|
+
var decoratorFinishedRef = { v: false };
|
|
256
|
+
try {
|
|
257
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
258
|
+
kind: "class",
|
|
259
|
+
name,
|
|
260
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
261
|
+
metadata
|
|
262
|
+
});
|
|
263
|
+
} finally {
|
|
264
|
+
decoratorFinishedRef.v = true;
|
|
265
|
+
}
|
|
266
|
+
if (nextNewClass !== void 0) {
|
|
267
|
+
assertValidReturnValue(10, nextNewClass);
|
|
268
|
+
newClass = nextNewClass;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
272
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
273
|
+
}];
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function defineMetadata(Class, metadata) {
|
|
277
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
278
|
+
configurable: true,
|
|
279
|
+
enumerable: true,
|
|
280
|
+
value: metadata
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
284
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
285
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
286
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
287
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
288
|
+
return {
|
|
289
|
+
e,
|
|
290
|
+
get c() {
|
|
291
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function _apply_decs_2203_r$12(targetClass, memberDecs, classDecs, parentClass) {
|
|
297
|
+
return (_apply_decs_2203_r$12 = applyDecs2203RFactory$12())(targetClass, memberDecs, classDecs, parentClass);
|
|
298
|
+
}
|
|
299
|
+
var _dec$12, _initClass$12;
|
|
300
|
+
/**
|
|
301
|
+
* Schema for validating configuration service options.
|
|
302
|
+
*/ const ConfigServiceOptionsSchema = z$1.record(z$1.string(), z$1.unknown());
|
|
303
|
+
/**
|
|
304
|
+
* Injection token for ConfigService.
|
|
305
|
+
*/ const ConfigServiceToken = InjectionToken.create(Symbol.for("ConfigService"), ConfigServiceOptionsSchema);
|
|
306
|
+
let _ConfigService;
|
|
307
|
+
_dec$12 = Injectable({ token: ConfigServiceToken });
|
|
308
|
+
var ConfigService = class {
|
|
309
|
+
config;
|
|
310
|
+
static {
|
|
311
|
+
({c: [_ConfigService, _initClass$12]} = _apply_decs_2203_r$12(this, [], [_dec$12]));
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Creates a new ConfigService instance.
|
|
315
|
+
*
|
|
316
|
+
* @param config - The configuration object
|
|
317
|
+
*/ constructor(config = {}) {
|
|
318
|
+
this.config = config;
|
|
319
|
+
}
|
|
320
|
+
logger = inject(Logger, { context: _ConfigService.name });
|
|
321
|
+
/**
|
|
322
|
+
* Gets the entire configuration object.
|
|
323
|
+
*
|
|
324
|
+
* @returns The complete configuration object
|
|
325
|
+
*/ getConfig() {
|
|
326
|
+
return this.config;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Gets a configuration value by key path.
|
|
330
|
+
*
|
|
331
|
+
* Returns `null` if the key is not found or if any part of the path is invalid.
|
|
332
|
+
*
|
|
333
|
+
* @param key - Dot-separated path to the configuration value (e.g., 'database.host')
|
|
334
|
+
* @returns The configuration value or `null` if not found
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```typescript
|
|
338
|
+
* const host = config.get('database.host') // string | null
|
|
339
|
+
* const port = config.get('database.port') // number | null
|
|
340
|
+
* ```
|
|
341
|
+
*/ get(key) {
|
|
342
|
+
try {
|
|
343
|
+
const parts = String(key).split(".");
|
|
344
|
+
let value = this.config;
|
|
345
|
+
for (const part of parts) {
|
|
346
|
+
if (value === null || value === void 0 || typeof value !== "object") return null;
|
|
347
|
+
value = value[part];
|
|
348
|
+
}
|
|
349
|
+
return value ?? null;
|
|
350
|
+
} catch (error) {
|
|
351
|
+
this.logger.debug?.(`Failed to get config value for key ${String(key)}`, error);
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Gets a configuration value by key path, or returns a default value if not found.
|
|
357
|
+
*
|
|
358
|
+
* @param key - Dot-separated path to the configuration value
|
|
359
|
+
* @param defaultValue - Default value to return if the key is not found
|
|
360
|
+
* @returns The configuration value or the default value
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* ```typescript
|
|
364
|
+
* const port = config.getOrDefault('database.port', 5432) // number
|
|
365
|
+
* ```
|
|
366
|
+
*/ getOrDefault(key, defaultValue) {
|
|
367
|
+
const value = this.get(key);
|
|
368
|
+
return value !== null ? value : defaultValue;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Gets a configuration value by key path, or throws an error if not found.
|
|
372
|
+
*
|
|
373
|
+
* @param key - Dot-separated path to the configuration value
|
|
374
|
+
* @param errorMessage - Optional custom error message
|
|
375
|
+
* @returns The configuration value
|
|
376
|
+
* @throws Error if the key is not found
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```typescript
|
|
380
|
+
* const host = config.getOrThrow('database.host') // string (throws if not found)
|
|
381
|
+
* const apiKey = config.getOrThrow('api.key', 'API key is required') // string
|
|
382
|
+
* ```
|
|
383
|
+
*/ getOrThrow(key, errorMessage) {
|
|
384
|
+
const value = this.get(key);
|
|
385
|
+
if (value === null) {
|
|
386
|
+
const message = errorMessage || `Configuration value for key "${String(key)}" is not defined`;
|
|
387
|
+
this.logger.error(message);
|
|
388
|
+
throw new NaviosError(message);
|
|
389
|
+
}
|
|
390
|
+
return value;
|
|
391
|
+
}
|
|
392
|
+
static {
|
|
393
|
+
_initClass$12();
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/config/config.provider.mts
|
|
399
|
+
/**
|
|
400
|
+
* Schema for configuration provider options.
|
|
401
|
+
*/ const ConfigProviderOptions = z$1.object({ load: z$1.function({ output: ConfigServiceOptionsSchema }) });
|
|
402
|
+
/**
|
|
403
|
+
* Creates a factory injection token for ConfigService that loads configuration asynchronously.
|
|
404
|
+
*
|
|
405
|
+
* Use this when you need to load configuration from a file, database, or other async source.
|
|
406
|
+
*
|
|
407
|
+
* @param options - Configuration provider options
|
|
408
|
+
* @param options.load - Async function that loads and returns the configuration object
|
|
409
|
+
* @returns A factory injection token for ConfigService
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```typescript
|
|
413
|
+
* const MyConfigService = provideConfig({
|
|
414
|
+
* load: async () => {
|
|
415
|
+
* const config = await loadConfigFromFile('config.json')
|
|
416
|
+
* return config
|
|
417
|
+
* },
|
|
418
|
+
* })
|
|
419
|
+
*
|
|
420
|
+
* // Use in module setup
|
|
421
|
+
* container.bind(ConfigServiceToken).toFactory(configProvider)
|
|
422
|
+
* ```
|
|
423
|
+
*/ function provideConfig(options) {
|
|
424
|
+
return InjectionToken.factory(ConfigServiceToken, async () => options.load());
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Pre-configured ConfigService provider that uses environment variables.
|
|
428
|
+
*
|
|
429
|
+
* Provides a ConfigService instance bound to `process.env`.
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* // Use environment variables as configuration
|
|
434
|
+
* container.bind(ConfigServiceToken).toValue(EnvConfigProvider)
|
|
435
|
+
* ```
|
|
436
|
+
*/ const EnvConfigProvider = InjectionToken.bound(ConfigServiceToken, { ...env });
|
|
437
|
+
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region src/exceptions/bad-request.exception.mts
|
|
440
|
+
/**
|
|
441
|
+
* Exception that represents a 400 Bad Request HTTP error.
|
|
442
|
+
*
|
|
443
|
+
* Use this exception when the client's request is malformed or invalid.
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* ```typescript
|
|
447
|
+
* @Endpoint(createUserEndpoint)
|
|
448
|
+
* async createUser(request: EndpointParams<typeof createUserEndpoint>) {
|
|
449
|
+
* if (!request.data.email) {
|
|
450
|
+
* throw new BadRequestException('Email is required')
|
|
451
|
+
* }
|
|
452
|
+
* // ...
|
|
453
|
+
* }
|
|
454
|
+
* ```
|
|
455
|
+
*/ var BadRequestException = class extends HttpException {
|
|
456
|
+
/**
|
|
457
|
+
* Creates a new BadRequestException.
|
|
458
|
+
*
|
|
459
|
+
* @param message - Error message or response object
|
|
460
|
+
*/ constructor(message) {
|
|
461
|
+
super(400, message);
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region src/exceptions/forbidden.exception.mts
|
|
467
|
+
/**
|
|
468
|
+
* Exception that represents a 403 Forbidden HTTP error.
|
|
469
|
+
*
|
|
470
|
+
* Use this exception when the client is authenticated but does not have
|
|
471
|
+
* permission to access the requested resource.
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* ```typescript
|
|
475
|
+
* @Endpoint(deleteUserEndpoint)
|
|
476
|
+
* @UseGuards(AuthGuard, RoleGuard)
|
|
477
|
+
* async deleteUser(request: EndpointParams<typeof deleteUserEndpoint>) {
|
|
478
|
+
* if (!this.userService.hasPermission(request.user, 'delete')) {
|
|
479
|
+
* throw new ForbiddenException('Insufficient permissions')
|
|
480
|
+
* }
|
|
481
|
+
* // ...
|
|
482
|
+
* }
|
|
483
|
+
* ```
|
|
484
|
+
*/ var ForbiddenException = class extends HttpException {
|
|
485
|
+
/**
|
|
486
|
+
* Creates a new ForbiddenException.
|
|
487
|
+
*
|
|
488
|
+
* @param message - Error message
|
|
489
|
+
*/ constructor(message) {
|
|
490
|
+
super(403, message);
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/exceptions/internal-server-error.exception.mts
|
|
496
|
+
/**
|
|
497
|
+
* Exception that represents a 500 Internal Server Error HTTP error.
|
|
498
|
+
*
|
|
499
|
+
* Use this exception when an unexpected error occurs on the server.
|
|
500
|
+
* Generally, you should let unhandled errors bubble up rather than catching
|
|
501
|
+
* and rethrowing as InternalServerErrorException, as Navios will handle them appropriately.
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* ```typescript
|
|
505
|
+
* @Endpoint(processPaymentEndpoint)
|
|
506
|
+
* async processPayment(request: EndpointParams<typeof processPaymentEndpoint>) {
|
|
507
|
+
* try {
|
|
508
|
+
* return await this.paymentService.process(request.data)
|
|
509
|
+
* } catch (error) {
|
|
510
|
+
* this.logger.error('Payment processing failed', error)
|
|
511
|
+
* throw new InternalServerErrorException('Payment processing failed', error)
|
|
512
|
+
* }
|
|
513
|
+
* }
|
|
514
|
+
* ```
|
|
515
|
+
*/ var InternalServerErrorException = class extends HttpException {
|
|
516
|
+
/**
|
|
517
|
+
* Creates a new InternalServerErrorException.
|
|
518
|
+
*
|
|
519
|
+
* @param message - Error message or response object
|
|
520
|
+
* @param error - Optional underlying error for logging
|
|
521
|
+
*/ constructor(message, error) {
|
|
522
|
+
super(500, message, error);
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region src/exceptions/not-found.exception.mts
|
|
528
|
+
/**
|
|
529
|
+
* Exception that represents a 404 Not Found HTTP error.
|
|
530
|
+
*
|
|
531
|
+
* Use this exception when the requested resource does not exist.
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* ```typescript
|
|
535
|
+
* @Endpoint(getUserEndpoint)
|
|
536
|
+
* async getUser(request: EndpointParams<typeof getUserEndpoint>) {
|
|
537
|
+
* const user = await this.userService.findById(request.urlParams.userId)
|
|
538
|
+
* if (!user) {
|
|
539
|
+
* throw new NotFoundException('User not found')
|
|
540
|
+
* }
|
|
541
|
+
* return user
|
|
542
|
+
* }
|
|
543
|
+
* ```
|
|
544
|
+
*/ var NotFoundException = class extends HttpException {
|
|
545
|
+
response;
|
|
546
|
+
error;
|
|
547
|
+
/**
|
|
548
|
+
* Creates a new NotFoundException.
|
|
549
|
+
*
|
|
550
|
+
* @param response - Error message or response object
|
|
551
|
+
* @param error - Optional underlying error for logging
|
|
552
|
+
*/ constructor(response, error) {
|
|
553
|
+
super(404, response, error), this.response = response, this.error = error;
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region src/exceptions/unauthorized.exception.mts
|
|
559
|
+
/**
|
|
560
|
+
* Exception that represents a 401 Unauthorized HTTP error.
|
|
561
|
+
*
|
|
562
|
+
* Use this exception when the client is not authenticated or authentication failed.
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
* ```typescript
|
|
566
|
+
* @Endpoint(getUserEndpoint)
|
|
567
|
+
* @UseGuards(AuthGuard)
|
|
568
|
+
* async getUser(request: EndpointParams<typeof getUserEndpoint>) {
|
|
569
|
+
* if (!request.headers.authorization) {
|
|
570
|
+
* throw new UnauthorizedException('Authentication required')
|
|
571
|
+
* }
|
|
572
|
+
* // ...
|
|
573
|
+
* }
|
|
574
|
+
* ```
|
|
575
|
+
*/ var UnauthorizedException = class extends HttpException {
|
|
576
|
+
/**
|
|
577
|
+
* Creates a new UnauthorizedException.
|
|
578
|
+
*
|
|
579
|
+
* @param message - Error message or response object
|
|
580
|
+
* @param error - Optional underlying error for logging
|
|
581
|
+
*/ constructor(message, error) {
|
|
582
|
+
super(401, message, error);
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region src/exceptions/conflict.exception.mts
|
|
588
|
+
/**
|
|
589
|
+
* Exception that represents a 409 Conflict HTTP error.
|
|
590
|
+
*
|
|
591
|
+
* Use this exception when the request conflicts with the current state of the resource
|
|
592
|
+
* (e.g., trying to create a resource that already exists).
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
* ```typescript
|
|
596
|
+
* @Endpoint(createUserEndpoint)
|
|
597
|
+
* async createUser(request: EndpointParams<typeof createUserEndpoint>) {
|
|
598
|
+
* const existing = await this.userService.findByEmail(request.data.email)
|
|
599
|
+
* if (existing) {
|
|
600
|
+
* throw new ConflictException('User with this email already exists')
|
|
601
|
+
* }
|
|
602
|
+
* // ...
|
|
603
|
+
* }
|
|
604
|
+
* ```
|
|
605
|
+
*/ var ConflictException = class extends HttpException {
|
|
606
|
+
/**
|
|
607
|
+
* Creates a new ConflictException.
|
|
608
|
+
*
|
|
609
|
+
* @param message - Error message or response object
|
|
610
|
+
* @param error - Optional underlying error for logging
|
|
611
|
+
*/ constructor(message, error) {
|
|
612
|
+
super(409, message, error);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region src/responders/services/forbidden-responder.service.mts
|
|
618
|
+
function applyDecs2203RFactory$11() {
|
|
619
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
620
|
+
return function addInitializer(initializer) {
|
|
621
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
622
|
+
assertCallable(initializer, "An initializer");
|
|
623
|
+
initializers.push(initializer);
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
627
|
+
var kindStr;
|
|
628
|
+
switch (kind) {
|
|
629
|
+
case 1:
|
|
630
|
+
kindStr = "accessor";
|
|
631
|
+
break;
|
|
632
|
+
case 2:
|
|
633
|
+
kindStr = "method";
|
|
634
|
+
break;
|
|
635
|
+
case 3:
|
|
636
|
+
kindStr = "getter";
|
|
637
|
+
break;
|
|
638
|
+
case 4:
|
|
639
|
+
kindStr = "setter";
|
|
640
|
+
break;
|
|
641
|
+
default: kindStr = "field";
|
|
642
|
+
}
|
|
643
|
+
var ctx = {
|
|
644
|
+
kind: kindStr,
|
|
645
|
+
name: isPrivate ? "#" + name : name,
|
|
646
|
+
static: isStatic,
|
|
647
|
+
private: isPrivate,
|
|
648
|
+
metadata
|
|
649
|
+
};
|
|
650
|
+
var decoratorFinishedRef = { v: false };
|
|
651
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
652
|
+
var get, set;
|
|
653
|
+
if (kind === 0) if (isPrivate) {
|
|
654
|
+
get = desc.get;
|
|
655
|
+
set = desc.set;
|
|
656
|
+
} else {
|
|
657
|
+
get = function() {
|
|
658
|
+
return this[name];
|
|
659
|
+
};
|
|
660
|
+
set = function(v) {
|
|
661
|
+
this[name] = v;
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
else if (kind === 2) get = function() {
|
|
665
|
+
return desc.value;
|
|
666
|
+
};
|
|
667
|
+
else {
|
|
668
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
669
|
+
return desc.get.call(this);
|
|
670
|
+
};
|
|
671
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
672
|
+
desc.set.call(this, v);
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
ctx.access = get && set ? {
|
|
676
|
+
get,
|
|
677
|
+
set
|
|
678
|
+
} : get ? { get } : { set };
|
|
679
|
+
try {
|
|
680
|
+
return dec(value, ctx);
|
|
681
|
+
} finally {
|
|
682
|
+
decoratorFinishedRef.v = true;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
686
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
687
|
+
}
|
|
688
|
+
function assertCallable(fn, hint) {
|
|
689
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
690
|
+
}
|
|
691
|
+
function assertValidReturnValue(kind, value) {
|
|
692
|
+
var type = typeof value;
|
|
693
|
+
if (kind === 1) {
|
|
694
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
695
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
696
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
697
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
698
|
+
} else if (type !== "function") {
|
|
699
|
+
var hint;
|
|
700
|
+
if (kind === 0) hint = "field";
|
|
701
|
+
else if (kind === 10) hint = "class";
|
|
702
|
+
else hint = "method";
|
|
703
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
707
|
+
var decs = decInfo[0];
|
|
708
|
+
var desc, init, value;
|
|
709
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
710
|
+
get: decInfo[3],
|
|
711
|
+
set: decInfo[4]
|
|
712
|
+
};
|
|
713
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
714
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
715
|
+
else desc = { value: decInfo[3] };
|
|
716
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
717
|
+
if (kind === 1) value = {
|
|
718
|
+
get: desc.get,
|
|
719
|
+
set: desc.set
|
|
720
|
+
};
|
|
721
|
+
else if (kind === 2) value = desc.value;
|
|
722
|
+
else if (kind === 3) value = desc.get;
|
|
723
|
+
else if (kind === 4) value = desc.set;
|
|
724
|
+
var newValue, get, set;
|
|
725
|
+
if (typeof decs === "function") {
|
|
726
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
727
|
+
if (newValue !== void 0) {
|
|
728
|
+
assertValidReturnValue(kind, newValue);
|
|
729
|
+
if (kind === 0) init = newValue;
|
|
730
|
+
else if (kind === 1) {
|
|
731
|
+
init = newValue.init;
|
|
732
|
+
get = newValue.get || value.get;
|
|
733
|
+
set = newValue.set || value.set;
|
|
734
|
+
value = {
|
|
735
|
+
get,
|
|
736
|
+
set
|
|
737
|
+
};
|
|
738
|
+
} else value = newValue;
|
|
739
|
+
}
|
|
740
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
741
|
+
var dec = decs[i];
|
|
742
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
743
|
+
if (newValue !== void 0) {
|
|
744
|
+
assertValidReturnValue(kind, newValue);
|
|
745
|
+
var newInit;
|
|
746
|
+
if (kind === 0) newInit = newValue;
|
|
747
|
+
else if (kind === 1) {
|
|
748
|
+
newInit = newValue.init;
|
|
749
|
+
get = newValue.get || value.get;
|
|
750
|
+
set = newValue.set || value.set;
|
|
751
|
+
value = {
|
|
752
|
+
get,
|
|
753
|
+
set
|
|
754
|
+
};
|
|
755
|
+
} else value = newValue;
|
|
756
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
757
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
758
|
+
else init.push(newInit);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (kind === 0 || kind === 1) {
|
|
762
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
763
|
+
return init$1;
|
|
764
|
+
};
|
|
765
|
+
else if (typeof init !== "function") {
|
|
766
|
+
var ownInitializers = init;
|
|
767
|
+
init = function(instance, init$1) {
|
|
768
|
+
var value$1 = init$1;
|
|
769
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
770
|
+
return value$1;
|
|
771
|
+
};
|
|
772
|
+
} else {
|
|
773
|
+
var originalInitializer = init;
|
|
774
|
+
init = function(instance, init$1) {
|
|
775
|
+
return originalInitializer.call(instance, init$1);
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
ret.push(init);
|
|
779
|
+
}
|
|
780
|
+
if (kind !== 0) {
|
|
781
|
+
if (kind === 1) {
|
|
782
|
+
desc.get = value.get;
|
|
783
|
+
desc.set = value.set;
|
|
784
|
+
} else if (kind === 2) desc.value = value;
|
|
785
|
+
else if (kind === 3) desc.get = value;
|
|
786
|
+
else if (kind === 4) desc.set = value;
|
|
787
|
+
if (isPrivate) if (kind === 1) {
|
|
788
|
+
ret.push(function(instance, args) {
|
|
789
|
+
return value.get.call(instance, args);
|
|
790
|
+
});
|
|
791
|
+
ret.push(function(instance, args) {
|
|
792
|
+
return value.set.call(instance, args);
|
|
793
|
+
});
|
|
794
|
+
} else if (kind === 2) ret.push(value);
|
|
795
|
+
else ret.push(function(instance, args) {
|
|
796
|
+
return value.call(instance, args);
|
|
797
|
+
});
|
|
798
|
+
else Object.defineProperty(base, name, desc);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
802
|
+
var ret = [];
|
|
803
|
+
var protoInitializers;
|
|
804
|
+
var staticInitializers;
|
|
805
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
806
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
807
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
808
|
+
var decInfo = decInfos[i];
|
|
809
|
+
if (!Array.isArray(decInfo)) continue;
|
|
810
|
+
var kind = decInfo[1];
|
|
811
|
+
var name = decInfo[2];
|
|
812
|
+
var isPrivate = decInfo.length > 3;
|
|
813
|
+
var isStatic = kind >= 5;
|
|
814
|
+
var base;
|
|
815
|
+
var initializers;
|
|
816
|
+
if (isStatic) {
|
|
817
|
+
base = Class;
|
|
818
|
+
kind = kind - 5;
|
|
819
|
+
staticInitializers = staticInitializers || [];
|
|
820
|
+
initializers = staticInitializers;
|
|
821
|
+
} else {
|
|
822
|
+
base = Class.prototype;
|
|
823
|
+
protoInitializers = protoInitializers || [];
|
|
824
|
+
initializers = protoInitializers;
|
|
825
|
+
}
|
|
826
|
+
if (kind !== 0 && !isPrivate) {
|
|
827
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
828
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
829
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
830
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
831
|
+
else existingNonFields.set(name, true);
|
|
832
|
+
}
|
|
833
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
834
|
+
}
|
|
835
|
+
pushInitializers(ret, protoInitializers);
|
|
836
|
+
pushInitializers(ret, staticInitializers);
|
|
837
|
+
return ret;
|
|
838
|
+
}
|
|
839
|
+
function pushInitializers(ret, initializers) {
|
|
840
|
+
if (initializers) ret.push(function(instance) {
|
|
841
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
842
|
+
return instance;
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
846
|
+
if (classDecs.length > 0) {
|
|
847
|
+
var initializers = [];
|
|
848
|
+
var newClass = targetClass;
|
|
849
|
+
var name = targetClass.name;
|
|
850
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
851
|
+
var decoratorFinishedRef = { v: false };
|
|
852
|
+
try {
|
|
853
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
854
|
+
kind: "class",
|
|
855
|
+
name,
|
|
856
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
857
|
+
metadata
|
|
858
|
+
});
|
|
859
|
+
} finally {
|
|
860
|
+
decoratorFinishedRef.v = true;
|
|
861
|
+
}
|
|
862
|
+
if (nextNewClass !== void 0) {
|
|
863
|
+
assertValidReturnValue(10, nextNewClass);
|
|
864
|
+
newClass = nextNewClass;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
868
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
869
|
+
}];
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
function defineMetadata(Class, metadata) {
|
|
873
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
874
|
+
configurable: true,
|
|
875
|
+
enumerable: true,
|
|
876
|
+
value: metadata
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
880
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
881
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
882
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
883
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
884
|
+
return {
|
|
885
|
+
e,
|
|
886
|
+
get c() {
|
|
887
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
function _apply_decs_2203_r$11(targetClass, memberDecs, classDecs, parentClass) {
|
|
893
|
+
return (_apply_decs_2203_r$11 = applyDecs2203RFactory$11())(targetClass, memberDecs, classDecs, parentClass);
|
|
894
|
+
}
|
|
895
|
+
var _dec$11, _initClass$11;
|
|
896
|
+
let _ForbiddenResponderService;
|
|
897
|
+
_dec$11 = Injectable({
|
|
898
|
+
token: ForbiddenResponderToken,
|
|
899
|
+
priority: -10
|
|
900
|
+
});
|
|
901
|
+
var ForbiddenResponderService = class {
|
|
902
|
+
static {
|
|
903
|
+
({c: [_ForbiddenResponderService, _initClass$11]} = _apply_decs_2203_r$11(this, [], [_dec$11]));
|
|
904
|
+
}
|
|
905
|
+
getResponse(error, description) {
|
|
906
|
+
if (description) return this.createResponse(description);
|
|
907
|
+
if (error && typeof error === "object" && "response" in error && error.response) {
|
|
908
|
+
if (typeof error.response === "string") return this.createResponse(error.response);
|
|
909
|
+
}
|
|
910
|
+
return this.createResponse("Access to this resource is forbidden");
|
|
911
|
+
}
|
|
912
|
+
createResponse(detail) {
|
|
913
|
+
return {
|
|
914
|
+
statusCode: 403,
|
|
915
|
+
payload: {
|
|
916
|
+
type: "about:blank",
|
|
917
|
+
title: "Forbidden",
|
|
918
|
+
status: 403,
|
|
919
|
+
detail
|
|
920
|
+
},
|
|
921
|
+
headers: { "Content-Type": "application/problem+json" }
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
static {
|
|
925
|
+
_initClass$11();
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
//#endregion
|
|
930
|
+
//#region src/responders/services/internal-server-error-responder.service.mts
|
|
931
|
+
function applyDecs2203RFactory$10() {
|
|
932
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
933
|
+
return function addInitializer(initializer) {
|
|
934
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
935
|
+
assertCallable(initializer, "An initializer");
|
|
936
|
+
initializers.push(initializer);
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
940
|
+
var kindStr;
|
|
941
|
+
switch (kind) {
|
|
942
|
+
case 1:
|
|
943
|
+
kindStr = "accessor";
|
|
944
|
+
break;
|
|
945
|
+
case 2:
|
|
946
|
+
kindStr = "method";
|
|
947
|
+
break;
|
|
948
|
+
case 3:
|
|
949
|
+
kindStr = "getter";
|
|
950
|
+
break;
|
|
951
|
+
case 4:
|
|
952
|
+
kindStr = "setter";
|
|
953
|
+
break;
|
|
954
|
+
default: kindStr = "field";
|
|
955
|
+
}
|
|
956
|
+
var ctx = {
|
|
957
|
+
kind: kindStr,
|
|
958
|
+
name: isPrivate ? "#" + name : name,
|
|
959
|
+
static: isStatic,
|
|
960
|
+
private: isPrivate,
|
|
961
|
+
metadata
|
|
962
|
+
};
|
|
963
|
+
var decoratorFinishedRef = { v: false };
|
|
964
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
965
|
+
var get, set;
|
|
966
|
+
if (kind === 0) if (isPrivate) {
|
|
967
|
+
get = desc.get;
|
|
968
|
+
set = desc.set;
|
|
969
|
+
} else {
|
|
970
|
+
get = function() {
|
|
971
|
+
return this[name];
|
|
972
|
+
};
|
|
973
|
+
set = function(v) {
|
|
974
|
+
this[name] = v;
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
else if (kind === 2) get = function() {
|
|
978
|
+
return desc.value;
|
|
979
|
+
};
|
|
980
|
+
else {
|
|
981
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
982
|
+
return desc.get.call(this);
|
|
983
|
+
};
|
|
984
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
985
|
+
desc.set.call(this, v);
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
ctx.access = get && set ? {
|
|
989
|
+
get,
|
|
990
|
+
set
|
|
991
|
+
} : get ? { get } : { set };
|
|
992
|
+
try {
|
|
993
|
+
return dec(value, ctx);
|
|
994
|
+
} finally {
|
|
995
|
+
decoratorFinishedRef.v = true;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
999
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
1000
|
+
}
|
|
1001
|
+
function assertCallable(fn, hint) {
|
|
1002
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
1003
|
+
}
|
|
1004
|
+
function assertValidReturnValue(kind, value) {
|
|
1005
|
+
var type = typeof value;
|
|
1006
|
+
if (kind === 1) {
|
|
1007
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1008
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
1009
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
1010
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
1011
|
+
} else if (type !== "function") {
|
|
1012
|
+
var hint;
|
|
1013
|
+
if (kind === 0) hint = "field";
|
|
1014
|
+
else if (kind === 10) hint = "class";
|
|
1015
|
+
else hint = "method";
|
|
1016
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
1020
|
+
var decs = decInfo[0];
|
|
1021
|
+
var desc, init, value;
|
|
1022
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
1023
|
+
get: decInfo[3],
|
|
1024
|
+
set: decInfo[4]
|
|
1025
|
+
};
|
|
1026
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
1027
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
1028
|
+
else desc = { value: decInfo[3] };
|
|
1029
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
1030
|
+
if (kind === 1) value = {
|
|
1031
|
+
get: desc.get,
|
|
1032
|
+
set: desc.set
|
|
1033
|
+
};
|
|
1034
|
+
else if (kind === 2) value = desc.value;
|
|
1035
|
+
else if (kind === 3) value = desc.get;
|
|
1036
|
+
else if (kind === 4) value = desc.set;
|
|
1037
|
+
var newValue, get, set;
|
|
1038
|
+
if (typeof decs === "function") {
|
|
1039
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1040
|
+
if (newValue !== void 0) {
|
|
1041
|
+
assertValidReturnValue(kind, newValue);
|
|
1042
|
+
if (kind === 0) init = newValue;
|
|
1043
|
+
else if (kind === 1) {
|
|
1044
|
+
init = newValue.init;
|
|
1045
|
+
get = newValue.get || value.get;
|
|
1046
|
+
set = newValue.set || value.set;
|
|
1047
|
+
value = {
|
|
1048
|
+
get,
|
|
1049
|
+
set
|
|
1050
|
+
};
|
|
1051
|
+
} else value = newValue;
|
|
1052
|
+
}
|
|
1053
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
1054
|
+
var dec = decs[i];
|
|
1055
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1056
|
+
if (newValue !== void 0) {
|
|
1057
|
+
assertValidReturnValue(kind, newValue);
|
|
1058
|
+
var newInit;
|
|
1059
|
+
if (kind === 0) newInit = newValue;
|
|
1060
|
+
else if (kind === 1) {
|
|
1061
|
+
newInit = newValue.init;
|
|
1062
|
+
get = newValue.get || value.get;
|
|
1063
|
+
set = newValue.set || value.set;
|
|
1064
|
+
value = {
|
|
1065
|
+
get,
|
|
1066
|
+
set
|
|
1067
|
+
};
|
|
1068
|
+
} else value = newValue;
|
|
1069
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
1070
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
1071
|
+
else init.push(newInit);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
if (kind === 0 || kind === 1) {
|
|
1075
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
1076
|
+
return init$1;
|
|
1077
|
+
};
|
|
1078
|
+
else if (typeof init !== "function") {
|
|
1079
|
+
var ownInitializers = init;
|
|
1080
|
+
init = function(instance, init$1) {
|
|
1081
|
+
var value$1 = init$1;
|
|
1082
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
1083
|
+
return value$1;
|
|
1084
|
+
};
|
|
1085
|
+
} else {
|
|
1086
|
+
var originalInitializer = init;
|
|
1087
|
+
init = function(instance, init$1) {
|
|
1088
|
+
return originalInitializer.call(instance, init$1);
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
ret.push(init);
|
|
1092
|
+
}
|
|
1093
|
+
if (kind !== 0) {
|
|
1094
|
+
if (kind === 1) {
|
|
1095
|
+
desc.get = value.get;
|
|
1096
|
+
desc.set = value.set;
|
|
1097
|
+
} else if (kind === 2) desc.value = value;
|
|
1098
|
+
else if (kind === 3) desc.get = value;
|
|
1099
|
+
else if (kind === 4) desc.set = value;
|
|
1100
|
+
if (isPrivate) if (kind === 1) {
|
|
1101
|
+
ret.push(function(instance, args) {
|
|
1102
|
+
return value.get.call(instance, args);
|
|
1103
|
+
});
|
|
1104
|
+
ret.push(function(instance, args) {
|
|
1105
|
+
return value.set.call(instance, args);
|
|
1106
|
+
});
|
|
1107
|
+
} else if (kind === 2) ret.push(value);
|
|
1108
|
+
else ret.push(function(instance, args) {
|
|
1109
|
+
return value.call(instance, args);
|
|
1110
|
+
});
|
|
1111
|
+
else Object.defineProperty(base, name, desc);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
1115
|
+
var ret = [];
|
|
1116
|
+
var protoInitializers;
|
|
1117
|
+
var staticInitializers;
|
|
1118
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
1119
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
1120
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
1121
|
+
var decInfo = decInfos[i];
|
|
1122
|
+
if (!Array.isArray(decInfo)) continue;
|
|
1123
|
+
var kind = decInfo[1];
|
|
1124
|
+
var name = decInfo[2];
|
|
1125
|
+
var isPrivate = decInfo.length > 3;
|
|
1126
|
+
var isStatic = kind >= 5;
|
|
1127
|
+
var base;
|
|
1128
|
+
var initializers;
|
|
1129
|
+
if (isStatic) {
|
|
1130
|
+
base = Class;
|
|
1131
|
+
kind = kind - 5;
|
|
1132
|
+
staticInitializers = staticInitializers || [];
|
|
1133
|
+
initializers = staticInitializers;
|
|
1134
|
+
} else {
|
|
1135
|
+
base = Class.prototype;
|
|
1136
|
+
protoInitializers = protoInitializers || [];
|
|
1137
|
+
initializers = protoInitializers;
|
|
1138
|
+
}
|
|
1139
|
+
if (kind !== 0 && !isPrivate) {
|
|
1140
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
1141
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
1142
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
1143
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
1144
|
+
else existingNonFields.set(name, true);
|
|
1145
|
+
}
|
|
1146
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
1147
|
+
}
|
|
1148
|
+
pushInitializers(ret, protoInitializers);
|
|
1149
|
+
pushInitializers(ret, staticInitializers);
|
|
1150
|
+
return ret;
|
|
1151
|
+
}
|
|
1152
|
+
function pushInitializers(ret, initializers) {
|
|
1153
|
+
if (initializers) ret.push(function(instance) {
|
|
1154
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
1155
|
+
return instance;
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
1159
|
+
if (classDecs.length > 0) {
|
|
1160
|
+
var initializers = [];
|
|
1161
|
+
var newClass = targetClass;
|
|
1162
|
+
var name = targetClass.name;
|
|
1163
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
1164
|
+
var decoratorFinishedRef = { v: false };
|
|
1165
|
+
try {
|
|
1166
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
1167
|
+
kind: "class",
|
|
1168
|
+
name,
|
|
1169
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
1170
|
+
metadata
|
|
1171
|
+
});
|
|
1172
|
+
} finally {
|
|
1173
|
+
decoratorFinishedRef.v = true;
|
|
1174
|
+
}
|
|
1175
|
+
if (nextNewClass !== void 0) {
|
|
1176
|
+
assertValidReturnValue(10, nextNewClass);
|
|
1177
|
+
newClass = nextNewClass;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
1181
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
1182
|
+
}];
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
function defineMetadata(Class, metadata) {
|
|
1186
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
1187
|
+
configurable: true,
|
|
1188
|
+
enumerable: true,
|
|
1189
|
+
value: metadata
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
1193
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1194
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
1195
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
1196
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
1197
|
+
return {
|
|
1198
|
+
e,
|
|
1199
|
+
get c() {
|
|
1200
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
function _apply_decs_2203_r$10(targetClass, memberDecs, classDecs, parentClass) {
|
|
1206
|
+
return (_apply_decs_2203_r$10 = applyDecs2203RFactory$10())(targetClass, memberDecs, classDecs, parentClass);
|
|
1207
|
+
}
|
|
1208
|
+
var _dec$10, _initClass$10;
|
|
1209
|
+
let _InternalServerErrorResponderService;
|
|
1210
|
+
_dec$10 = Injectable({
|
|
1211
|
+
token: InternalServerErrorResponderToken,
|
|
1212
|
+
priority: -10
|
|
1213
|
+
});
|
|
1214
|
+
var InternalServerErrorResponderService = class {
|
|
1215
|
+
static {
|
|
1216
|
+
({c: [_InternalServerErrorResponderService, _initClass$10]} = _apply_decs_2203_r$10(this, [], [_dec$10]));
|
|
1217
|
+
}
|
|
1218
|
+
getResponse(error, description) {
|
|
1219
|
+
const message = error instanceof Error ? error.message : "Internal Server Error";
|
|
1220
|
+
return {
|
|
1221
|
+
statusCode: 500,
|
|
1222
|
+
payload: {
|
|
1223
|
+
type: "about:blank",
|
|
1224
|
+
title: "Internal Server Error",
|
|
1225
|
+
status: 500,
|
|
1226
|
+
detail: description ?? message
|
|
1227
|
+
},
|
|
1228
|
+
headers: { "Content-Type": "application/problem+json" }
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
static {
|
|
1232
|
+
_initClass$10();
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region src/responders/services/not-found-responder.service.mts
|
|
1238
|
+
function applyDecs2203RFactory$9() {
|
|
1239
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
1240
|
+
return function addInitializer(initializer) {
|
|
1241
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
1242
|
+
assertCallable(initializer, "An initializer");
|
|
1243
|
+
initializers.push(initializer);
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
1247
|
+
var kindStr;
|
|
1248
|
+
switch (kind) {
|
|
1249
|
+
case 1:
|
|
1250
|
+
kindStr = "accessor";
|
|
1251
|
+
break;
|
|
1252
|
+
case 2:
|
|
1253
|
+
kindStr = "method";
|
|
1254
|
+
break;
|
|
1255
|
+
case 3:
|
|
1256
|
+
kindStr = "getter";
|
|
1257
|
+
break;
|
|
1258
|
+
case 4:
|
|
1259
|
+
kindStr = "setter";
|
|
1260
|
+
break;
|
|
1261
|
+
default: kindStr = "field";
|
|
1262
|
+
}
|
|
1263
|
+
var ctx = {
|
|
1264
|
+
kind: kindStr,
|
|
1265
|
+
name: isPrivate ? "#" + name : name,
|
|
1266
|
+
static: isStatic,
|
|
1267
|
+
private: isPrivate,
|
|
1268
|
+
metadata
|
|
1269
|
+
};
|
|
1270
|
+
var decoratorFinishedRef = { v: false };
|
|
1271
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
1272
|
+
var get, set;
|
|
1273
|
+
if (kind === 0) if (isPrivate) {
|
|
1274
|
+
get = desc.get;
|
|
1275
|
+
set = desc.set;
|
|
1276
|
+
} else {
|
|
1277
|
+
get = function() {
|
|
1278
|
+
return this[name];
|
|
1279
|
+
};
|
|
1280
|
+
set = function(v) {
|
|
1281
|
+
this[name] = v;
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
else if (kind === 2) get = function() {
|
|
1285
|
+
return desc.value;
|
|
1286
|
+
};
|
|
1287
|
+
else {
|
|
1288
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
1289
|
+
return desc.get.call(this);
|
|
1290
|
+
};
|
|
1291
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
1292
|
+
desc.set.call(this, v);
|
|
1293
|
+
};
|
|
1294
|
+
}
|
|
1295
|
+
ctx.access = get && set ? {
|
|
1296
|
+
get,
|
|
1297
|
+
set
|
|
1298
|
+
} : get ? { get } : { set };
|
|
1299
|
+
try {
|
|
1300
|
+
return dec(value, ctx);
|
|
1301
|
+
} finally {
|
|
1302
|
+
decoratorFinishedRef.v = true;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
1306
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
1307
|
+
}
|
|
1308
|
+
function assertCallable(fn, hint) {
|
|
1309
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
1310
|
+
}
|
|
1311
|
+
function assertValidReturnValue(kind, value) {
|
|
1312
|
+
var type = typeof value;
|
|
1313
|
+
if (kind === 1) {
|
|
1314
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1315
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
1316
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
1317
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
1318
|
+
} else if (type !== "function") {
|
|
1319
|
+
var hint;
|
|
1320
|
+
if (kind === 0) hint = "field";
|
|
1321
|
+
else if (kind === 10) hint = "class";
|
|
1322
|
+
else hint = "method";
|
|
1323
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
1327
|
+
var decs = decInfo[0];
|
|
1328
|
+
var desc, init, value;
|
|
1329
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
1330
|
+
get: decInfo[3],
|
|
1331
|
+
set: decInfo[4]
|
|
1332
|
+
};
|
|
1333
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
1334
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
1335
|
+
else desc = { value: decInfo[3] };
|
|
1336
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
1337
|
+
if (kind === 1) value = {
|
|
1338
|
+
get: desc.get,
|
|
1339
|
+
set: desc.set
|
|
1340
|
+
};
|
|
1341
|
+
else if (kind === 2) value = desc.value;
|
|
1342
|
+
else if (kind === 3) value = desc.get;
|
|
1343
|
+
else if (kind === 4) value = desc.set;
|
|
1344
|
+
var newValue, get, set;
|
|
1345
|
+
if (typeof decs === "function") {
|
|
1346
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1347
|
+
if (newValue !== void 0) {
|
|
1348
|
+
assertValidReturnValue(kind, newValue);
|
|
1349
|
+
if (kind === 0) init = newValue;
|
|
1350
|
+
else if (kind === 1) {
|
|
1351
|
+
init = newValue.init;
|
|
1352
|
+
get = newValue.get || value.get;
|
|
1353
|
+
set = newValue.set || value.set;
|
|
1354
|
+
value = {
|
|
1355
|
+
get,
|
|
1356
|
+
set
|
|
1357
|
+
};
|
|
1358
|
+
} else value = newValue;
|
|
1359
|
+
}
|
|
1360
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
1361
|
+
var dec = decs[i];
|
|
1362
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1363
|
+
if (newValue !== void 0) {
|
|
1364
|
+
assertValidReturnValue(kind, newValue);
|
|
1365
|
+
var newInit;
|
|
1366
|
+
if (kind === 0) newInit = newValue;
|
|
1367
|
+
else if (kind === 1) {
|
|
1368
|
+
newInit = newValue.init;
|
|
1369
|
+
get = newValue.get || value.get;
|
|
1370
|
+
set = newValue.set || value.set;
|
|
1371
|
+
value = {
|
|
1372
|
+
get,
|
|
1373
|
+
set
|
|
1374
|
+
};
|
|
1375
|
+
} else value = newValue;
|
|
1376
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
1377
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
1378
|
+
else init.push(newInit);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
if (kind === 0 || kind === 1) {
|
|
1382
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
1383
|
+
return init$1;
|
|
1384
|
+
};
|
|
1385
|
+
else if (typeof init !== "function") {
|
|
1386
|
+
var ownInitializers = init;
|
|
1387
|
+
init = function(instance, init$1) {
|
|
1388
|
+
var value$1 = init$1;
|
|
1389
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
1390
|
+
return value$1;
|
|
1391
|
+
};
|
|
1392
|
+
} else {
|
|
1393
|
+
var originalInitializer = init;
|
|
1394
|
+
init = function(instance, init$1) {
|
|
1395
|
+
return originalInitializer.call(instance, init$1);
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
ret.push(init);
|
|
1399
|
+
}
|
|
1400
|
+
if (kind !== 0) {
|
|
1401
|
+
if (kind === 1) {
|
|
1402
|
+
desc.get = value.get;
|
|
1403
|
+
desc.set = value.set;
|
|
1404
|
+
} else if (kind === 2) desc.value = value;
|
|
1405
|
+
else if (kind === 3) desc.get = value;
|
|
1406
|
+
else if (kind === 4) desc.set = value;
|
|
1407
|
+
if (isPrivate) if (kind === 1) {
|
|
1408
|
+
ret.push(function(instance, args) {
|
|
1409
|
+
return value.get.call(instance, args);
|
|
1410
|
+
});
|
|
1411
|
+
ret.push(function(instance, args) {
|
|
1412
|
+
return value.set.call(instance, args);
|
|
1413
|
+
});
|
|
1414
|
+
} else if (kind === 2) ret.push(value);
|
|
1415
|
+
else ret.push(function(instance, args) {
|
|
1416
|
+
return value.call(instance, args);
|
|
1417
|
+
});
|
|
1418
|
+
else Object.defineProperty(base, name, desc);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
1422
|
+
var ret = [];
|
|
1423
|
+
var protoInitializers;
|
|
1424
|
+
var staticInitializers;
|
|
1425
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
1426
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
1427
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
1428
|
+
var decInfo = decInfos[i];
|
|
1429
|
+
if (!Array.isArray(decInfo)) continue;
|
|
1430
|
+
var kind = decInfo[1];
|
|
1431
|
+
var name = decInfo[2];
|
|
1432
|
+
var isPrivate = decInfo.length > 3;
|
|
1433
|
+
var isStatic = kind >= 5;
|
|
1434
|
+
var base;
|
|
1435
|
+
var initializers;
|
|
1436
|
+
if (isStatic) {
|
|
1437
|
+
base = Class;
|
|
1438
|
+
kind = kind - 5;
|
|
1439
|
+
staticInitializers = staticInitializers || [];
|
|
1440
|
+
initializers = staticInitializers;
|
|
1441
|
+
} else {
|
|
1442
|
+
base = Class.prototype;
|
|
1443
|
+
protoInitializers = protoInitializers || [];
|
|
1444
|
+
initializers = protoInitializers;
|
|
1445
|
+
}
|
|
1446
|
+
if (kind !== 0 && !isPrivate) {
|
|
1447
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
1448
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
1449
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
1450
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
1451
|
+
else existingNonFields.set(name, true);
|
|
1452
|
+
}
|
|
1453
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
1454
|
+
}
|
|
1455
|
+
pushInitializers(ret, protoInitializers);
|
|
1456
|
+
pushInitializers(ret, staticInitializers);
|
|
1457
|
+
return ret;
|
|
1458
|
+
}
|
|
1459
|
+
function pushInitializers(ret, initializers) {
|
|
1460
|
+
if (initializers) ret.push(function(instance) {
|
|
1461
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
1462
|
+
return instance;
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
1466
|
+
if (classDecs.length > 0) {
|
|
1467
|
+
var initializers = [];
|
|
1468
|
+
var newClass = targetClass;
|
|
1469
|
+
var name = targetClass.name;
|
|
1470
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
1471
|
+
var decoratorFinishedRef = { v: false };
|
|
1472
|
+
try {
|
|
1473
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
1474
|
+
kind: "class",
|
|
1475
|
+
name,
|
|
1476
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
1477
|
+
metadata
|
|
1478
|
+
});
|
|
1479
|
+
} finally {
|
|
1480
|
+
decoratorFinishedRef.v = true;
|
|
1481
|
+
}
|
|
1482
|
+
if (nextNewClass !== void 0) {
|
|
1483
|
+
assertValidReturnValue(10, nextNewClass);
|
|
1484
|
+
newClass = nextNewClass;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
1488
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
1489
|
+
}];
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
function defineMetadata(Class, metadata) {
|
|
1493
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
1494
|
+
configurable: true,
|
|
1495
|
+
enumerable: true,
|
|
1496
|
+
value: metadata
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
1500
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1501
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
1502
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
1503
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
1504
|
+
return {
|
|
1505
|
+
e,
|
|
1506
|
+
get c() {
|
|
1507
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
1508
|
+
}
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
function _apply_decs_2203_r$9(targetClass, memberDecs, classDecs, parentClass) {
|
|
1513
|
+
return (_apply_decs_2203_r$9 = applyDecs2203RFactory$9())(targetClass, memberDecs, classDecs, parentClass);
|
|
1514
|
+
}
|
|
1515
|
+
var _dec$9, _initClass$9;
|
|
1516
|
+
let _NotFoundResponderService;
|
|
1517
|
+
_dec$9 = Injectable({
|
|
1518
|
+
token: NotFoundResponderToken,
|
|
1519
|
+
priority: -10
|
|
1520
|
+
});
|
|
1521
|
+
var NotFoundResponderService = class {
|
|
1522
|
+
static {
|
|
1523
|
+
({c: [_NotFoundResponderService, _initClass$9]} = _apply_decs_2203_r$9(this, [], [_dec$9]));
|
|
1524
|
+
}
|
|
1525
|
+
getResponse(error, description) {
|
|
1526
|
+
if (description) return this.createResponse(description);
|
|
1527
|
+
if (error && typeof error === "object" && "response" in error && error.response) {
|
|
1528
|
+
if (typeof error.response === "string") return this.createResponse(error.response);
|
|
1529
|
+
}
|
|
1530
|
+
return this.createResponse("The requested resource was not found");
|
|
1531
|
+
}
|
|
1532
|
+
createResponse(detail) {
|
|
1533
|
+
return {
|
|
1534
|
+
statusCode: 404,
|
|
1535
|
+
payload: {
|
|
1536
|
+
type: "about:blank",
|
|
1537
|
+
title: "Not Found",
|
|
1538
|
+
status: 404,
|
|
1539
|
+
detail
|
|
1540
|
+
},
|
|
1541
|
+
headers: { "Content-Type": "application/problem+json" }
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
static {
|
|
1545
|
+
_initClass$9();
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1549
|
+
//#endregion
|
|
1550
|
+
//#region src/responders/services/validation-error-responder.service.mts
|
|
1551
|
+
function applyDecs2203RFactory$8() {
|
|
1552
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
1553
|
+
return function addInitializer(initializer) {
|
|
1554
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
1555
|
+
assertCallable(initializer, "An initializer");
|
|
1556
|
+
initializers.push(initializer);
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
1560
|
+
var kindStr;
|
|
1561
|
+
switch (kind) {
|
|
1562
|
+
case 1:
|
|
1563
|
+
kindStr = "accessor";
|
|
1564
|
+
break;
|
|
1565
|
+
case 2:
|
|
1566
|
+
kindStr = "method";
|
|
1567
|
+
break;
|
|
1568
|
+
case 3:
|
|
1569
|
+
kindStr = "getter";
|
|
1570
|
+
break;
|
|
1571
|
+
case 4:
|
|
1572
|
+
kindStr = "setter";
|
|
1573
|
+
break;
|
|
1574
|
+
default: kindStr = "field";
|
|
1575
|
+
}
|
|
1576
|
+
var ctx = {
|
|
1577
|
+
kind: kindStr,
|
|
1578
|
+
name: isPrivate ? "#" + name : name,
|
|
1579
|
+
static: isStatic,
|
|
1580
|
+
private: isPrivate,
|
|
1581
|
+
metadata
|
|
1582
|
+
};
|
|
1583
|
+
var decoratorFinishedRef = { v: false };
|
|
1584
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
1585
|
+
var get, set;
|
|
1586
|
+
if (kind === 0) if (isPrivate) {
|
|
1587
|
+
get = desc.get;
|
|
1588
|
+
set = desc.set;
|
|
1589
|
+
} else {
|
|
1590
|
+
get = function() {
|
|
1591
|
+
return this[name];
|
|
1592
|
+
};
|
|
1593
|
+
set = function(v) {
|
|
1594
|
+
this[name] = v;
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
else if (kind === 2) get = function() {
|
|
1598
|
+
return desc.value;
|
|
1599
|
+
};
|
|
1600
|
+
else {
|
|
1601
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
1602
|
+
return desc.get.call(this);
|
|
1603
|
+
};
|
|
1604
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
1605
|
+
desc.set.call(this, v);
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
ctx.access = get && set ? {
|
|
1609
|
+
get,
|
|
1610
|
+
set
|
|
1611
|
+
} : get ? { get } : { set };
|
|
1612
|
+
try {
|
|
1613
|
+
return dec(value, ctx);
|
|
1614
|
+
} finally {
|
|
1615
|
+
decoratorFinishedRef.v = true;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
1619
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
1620
|
+
}
|
|
1621
|
+
function assertCallable(fn, hint) {
|
|
1622
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
1623
|
+
}
|
|
1624
|
+
function assertValidReturnValue(kind, value) {
|
|
1625
|
+
var type = typeof value;
|
|
1626
|
+
if (kind === 1) {
|
|
1627
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1628
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
1629
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
1630
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
1631
|
+
} else if (type !== "function") {
|
|
1632
|
+
var hint;
|
|
1633
|
+
if (kind === 0) hint = "field";
|
|
1634
|
+
else if (kind === 10) hint = "class";
|
|
1635
|
+
else hint = "method";
|
|
1636
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
1640
|
+
var decs = decInfo[0];
|
|
1641
|
+
var desc, init, value;
|
|
1642
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
1643
|
+
get: decInfo[3],
|
|
1644
|
+
set: decInfo[4]
|
|
1645
|
+
};
|
|
1646
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
1647
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
1648
|
+
else desc = { value: decInfo[3] };
|
|
1649
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
1650
|
+
if (kind === 1) value = {
|
|
1651
|
+
get: desc.get,
|
|
1652
|
+
set: desc.set
|
|
1653
|
+
};
|
|
1654
|
+
else if (kind === 2) value = desc.value;
|
|
1655
|
+
else if (kind === 3) value = desc.get;
|
|
1656
|
+
else if (kind === 4) value = desc.set;
|
|
1657
|
+
var newValue, get, set;
|
|
1658
|
+
if (typeof decs === "function") {
|
|
1659
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1660
|
+
if (newValue !== void 0) {
|
|
1661
|
+
assertValidReturnValue(kind, newValue);
|
|
1662
|
+
if (kind === 0) init = newValue;
|
|
1663
|
+
else if (kind === 1) {
|
|
1664
|
+
init = newValue.init;
|
|
1665
|
+
get = newValue.get || value.get;
|
|
1666
|
+
set = newValue.set || value.set;
|
|
1667
|
+
value = {
|
|
1668
|
+
get,
|
|
1669
|
+
set
|
|
1670
|
+
};
|
|
1671
|
+
} else value = newValue;
|
|
1672
|
+
}
|
|
1673
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
1674
|
+
var dec = decs[i];
|
|
1675
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1676
|
+
if (newValue !== void 0) {
|
|
1677
|
+
assertValidReturnValue(kind, newValue);
|
|
1678
|
+
var newInit;
|
|
1679
|
+
if (kind === 0) newInit = newValue;
|
|
1680
|
+
else if (kind === 1) {
|
|
1681
|
+
newInit = newValue.init;
|
|
1682
|
+
get = newValue.get || value.get;
|
|
1683
|
+
set = newValue.set || value.set;
|
|
1684
|
+
value = {
|
|
1685
|
+
get,
|
|
1686
|
+
set
|
|
1687
|
+
};
|
|
1688
|
+
} else value = newValue;
|
|
1689
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
1690
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
1691
|
+
else init.push(newInit);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
if (kind === 0 || kind === 1) {
|
|
1695
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
1696
|
+
return init$1;
|
|
1697
|
+
};
|
|
1698
|
+
else if (typeof init !== "function") {
|
|
1699
|
+
var ownInitializers = init;
|
|
1700
|
+
init = function(instance, init$1) {
|
|
1701
|
+
var value$1 = init$1;
|
|
1702
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
1703
|
+
return value$1;
|
|
1704
|
+
};
|
|
1705
|
+
} else {
|
|
1706
|
+
var originalInitializer = init;
|
|
1707
|
+
init = function(instance, init$1) {
|
|
1708
|
+
return originalInitializer.call(instance, init$1);
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
ret.push(init);
|
|
1712
|
+
}
|
|
1713
|
+
if (kind !== 0) {
|
|
1714
|
+
if (kind === 1) {
|
|
1715
|
+
desc.get = value.get;
|
|
1716
|
+
desc.set = value.set;
|
|
1717
|
+
} else if (kind === 2) desc.value = value;
|
|
1718
|
+
else if (kind === 3) desc.get = value;
|
|
1719
|
+
else if (kind === 4) desc.set = value;
|
|
1720
|
+
if (isPrivate) if (kind === 1) {
|
|
1721
|
+
ret.push(function(instance, args) {
|
|
1722
|
+
return value.get.call(instance, args);
|
|
1723
|
+
});
|
|
1724
|
+
ret.push(function(instance, args) {
|
|
1725
|
+
return value.set.call(instance, args);
|
|
1726
|
+
});
|
|
1727
|
+
} else if (kind === 2) ret.push(value);
|
|
1728
|
+
else ret.push(function(instance, args) {
|
|
1729
|
+
return value.call(instance, args);
|
|
1730
|
+
});
|
|
1731
|
+
else Object.defineProperty(base, name, desc);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
1735
|
+
var ret = [];
|
|
1736
|
+
var protoInitializers;
|
|
1737
|
+
var staticInitializers;
|
|
1738
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
1739
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
1740
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
1741
|
+
var decInfo = decInfos[i];
|
|
1742
|
+
if (!Array.isArray(decInfo)) continue;
|
|
1743
|
+
var kind = decInfo[1];
|
|
1744
|
+
var name = decInfo[2];
|
|
1745
|
+
var isPrivate = decInfo.length > 3;
|
|
1746
|
+
var isStatic = kind >= 5;
|
|
1747
|
+
var base;
|
|
1748
|
+
var initializers;
|
|
1749
|
+
if (isStatic) {
|
|
1750
|
+
base = Class;
|
|
1751
|
+
kind = kind - 5;
|
|
1752
|
+
staticInitializers = staticInitializers || [];
|
|
1753
|
+
initializers = staticInitializers;
|
|
1754
|
+
} else {
|
|
1755
|
+
base = Class.prototype;
|
|
1756
|
+
protoInitializers = protoInitializers || [];
|
|
1757
|
+
initializers = protoInitializers;
|
|
1758
|
+
}
|
|
1759
|
+
if (kind !== 0 && !isPrivate) {
|
|
1760
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
1761
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
1762
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
1763
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
1764
|
+
else existingNonFields.set(name, true);
|
|
1765
|
+
}
|
|
1766
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
1767
|
+
}
|
|
1768
|
+
pushInitializers(ret, protoInitializers);
|
|
1769
|
+
pushInitializers(ret, staticInitializers);
|
|
1770
|
+
return ret;
|
|
1771
|
+
}
|
|
1772
|
+
function pushInitializers(ret, initializers) {
|
|
1773
|
+
if (initializers) ret.push(function(instance) {
|
|
1774
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
1775
|
+
return instance;
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
1779
|
+
if (classDecs.length > 0) {
|
|
1780
|
+
var initializers = [];
|
|
1781
|
+
var newClass = targetClass;
|
|
1782
|
+
var name = targetClass.name;
|
|
1783
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
1784
|
+
var decoratorFinishedRef = { v: false };
|
|
1785
|
+
try {
|
|
1786
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
1787
|
+
kind: "class",
|
|
1788
|
+
name,
|
|
1789
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
1790
|
+
metadata
|
|
1791
|
+
});
|
|
1792
|
+
} finally {
|
|
1793
|
+
decoratorFinishedRef.v = true;
|
|
1794
|
+
}
|
|
1795
|
+
if (nextNewClass !== void 0) {
|
|
1796
|
+
assertValidReturnValue(10, nextNewClass);
|
|
1797
|
+
newClass = nextNewClass;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
1801
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
1802
|
+
}];
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
function defineMetadata(Class, metadata) {
|
|
1806
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
1807
|
+
configurable: true,
|
|
1808
|
+
enumerable: true,
|
|
1809
|
+
value: metadata
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
1813
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1814
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
1815
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
1816
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
1817
|
+
return {
|
|
1818
|
+
e,
|
|
1819
|
+
get c() {
|
|
1820
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
function _apply_decs_2203_r$8(targetClass, memberDecs, classDecs, parentClass) {
|
|
1826
|
+
return (_apply_decs_2203_r$8 = applyDecs2203RFactory$8())(targetClass, memberDecs, classDecs, parentClass);
|
|
1827
|
+
}
|
|
1828
|
+
var _dec$8, _initClass$8;
|
|
1829
|
+
let _ValidationErrorResponderService;
|
|
1830
|
+
_dec$8 = Injectable({
|
|
1831
|
+
token: ValidationErrorResponderToken,
|
|
1832
|
+
priority: -10
|
|
1833
|
+
});
|
|
1834
|
+
var ValidationErrorResponderService = class {
|
|
1835
|
+
static {
|
|
1836
|
+
({c: [_ValidationErrorResponderService, _initClass$8]} = _apply_decs_2203_r$8(this, [], [_dec$8]));
|
|
1837
|
+
}
|
|
1838
|
+
getResponse(error, description) {
|
|
1839
|
+
if (error instanceof ZodError) return {
|
|
1840
|
+
statusCode: 400,
|
|
1841
|
+
payload: {
|
|
1842
|
+
type: "about:blank",
|
|
1843
|
+
title: "Validation Error",
|
|
1844
|
+
status: 400,
|
|
1845
|
+
detail: description ?? "Request validation failed",
|
|
1846
|
+
errors: treeifyError(error)
|
|
1847
|
+
},
|
|
1848
|
+
headers: { "Content-Type": "application/problem+json" }
|
|
1849
|
+
};
|
|
1850
|
+
return {
|
|
1851
|
+
statusCode: 400,
|
|
1852
|
+
payload: {
|
|
1853
|
+
type: "about:blank",
|
|
1854
|
+
title: "Validation Error",
|
|
1855
|
+
status: 400,
|
|
1856
|
+
detail: description ?? (error instanceof Error ? error.message : "Validation failed")
|
|
1857
|
+
},
|
|
1858
|
+
headers: { "Content-Type": "application/problem+json" }
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
static {
|
|
1862
|
+
_initClass$8();
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
//#endregion
|
|
1867
|
+
//#region src/attribute.factory.mts
|
|
1868
|
+
/**
|
|
1869
|
+
* Factory for creating custom attribute decorators.
|
|
1870
|
+
*
|
|
1871
|
+
* Attributes allow you to add custom metadata to modules, controllers, and endpoints.
|
|
1872
|
+
* This is useful for cross-cutting concerns like rate limiting, caching, API versioning, etc.
|
|
1873
|
+
*
|
|
1874
|
+
* @example
|
|
1875
|
+
* ```typescript
|
|
1876
|
+
* // Create a simple boolean attribute
|
|
1877
|
+
* const Public = AttributeFactory.createAttribute(Symbol.for('Public'))
|
|
1878
|
+
*
|
|
1879
|
+
* // Use it as a decorator
|
|
1880
|
+
* @Controller()
|
|
1881
|
+
* @Public()
|
|
1882
|
+
* export class PublicController { }
|
|
1883
|
+
*
|
|
1884
|
+
* // Check if attribute exists
|
|
1885
|
+
* if (AttributeFactory.has(Public, controllerMetadata)) {
|
|
1886
|
+
* // Skip authentication
|
|
1887
|
+
* }
|
|
1888
|
+
* ```
|
|
1889
|
+
*
|
|
1890
|
+
* @example
|
|
1891
|
+
* ```typescript
|
|
1892
|
+
* // Create an attribute with a validated value
|
|
1893
|
+
* const RateLimit = AttributeFactory.createAttribute(
|
|
1894
|
+
* Symbol.for('RateLimit'),
|
|
1895
|
+
* z.object({ requests: z.number(), window: z.number() })
|
|
1896
|
+
* )
|
|
1897
|
+
*
|
|
1898
|
+
* // Use it with a value
|
|
1899
|
+
* @Endpoint(apiEndpoint)
|
|
1900
|
+
* @RateLimit({ requests: 100, window: 60000 })
|
|
1901
|
+
* async handler() { }
|
|
1902
|
+
*
|
|
1903
|
+
* // Get the value
|
|
1904
|
+
* const limit = AttributeFactory.get(RateLimit, endpointMetadata)
|
|
1905
|
+
* // limit is typed as { requests: number, window: number } | null
|
|
1906
|
+
* ```
|
|
1907
|
+
*/ var AttributeFactory = class {
|
|
1908
|
+
static createAttribute(token, schema) {
|
|
1909
|
+
const res = (value) => (target, context) => {
|
|
1910
|
+
if (context.kind !== "class" && context.kind !== "method") throw new Error("[Navios] Attribute can only be applied to classes or methods");
|
|
1911
|
+
const isController = context.kind === "class" && hasControllerMetadata(target);
|
|
1912
|
+
const isModule = context.kind === "class" && hasModuleMetadata(target);
|
|
1913
|
+
const isManaged = context.kind === "class" && hasManagedMetadata(target);
|
|
1914
|
+
if (context.kind === "class" && !isController && !isModule && !isManaged) throw new Error("[Navios] Attribute can only be applied to classes with @Controller, @Module, or other Navios-managed decorators");
|
|
1915
|
+
let metadata = context.kind === "class" ? isController ? getControllerMetadata(target, context) : isModule ? getModuleMetadata(target, context) : isManaged ? getManagedMetadata(target) : null : getEndpointMetadata(target, context);
|
|
1916
|
+
if (!metadata) throw new Error("[Navios] Could not determine metadata for attribute target");
|
|
1917
|
+
if (schema) {
|
|
1918
|
+
const validatedValue = schema.safeParse(value);
|
|
1919
|
+
if (!validatedValue.success) throw new Error(`[Navios] Invalid value for attribute ${token.toString()}: ${validatedValue.error}`);
|
|
1920
|
+
metadata.customAttributes.set(token, validatedValue.data);
|
|
1921
|
+
} else metadata.customAttributes.set(token, true);
|
|
1922
|
+
return target;
|
|
1923
|
+
};
|
|
1924
|
+
res.token = token;
|
|
1925
|
+
if (schema) res.schema = schema;
|
|
1926
|
+
return res;
|
|
1927
|
+
}
|
|
1928
|
+
static get(attribute, target) {
|
|
1929
|
+
return target.customAttributes.get(attribute.token) ?? null;
|
|
1930
|
+
}
|
|
1931
|
+
static getAll(attribute, target) {
|
|
1932
|
+
const values = Array.from(target.customAttributes.entries()).filter(([key]) => key === attribute.token).map(([, value]) => value);
|
|
1933
|
+
return values.length > 0 ? values : null;
|
|
1934
|
+
}
|
|
1935
|
+
static getLast(attribute, target) {
|
|
1936
|
+
for (let i = target.length - 1; i >= 0; i--) {
|
|
1937
|
+
const value = target[i].customAttributes.get(attribute.token);
|
|
1938
|
+
if (value) return value;
|
|
1939
|
+
}
|
|
1940
|
+
return null;
|
|
1941
|
+
}
|
|
1942
|
+
static has(attribute, target) {
|
|
1943
|
+
return target.customAttributes.has(attribute.token);
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
|
|
1947
|
+
//#endregion
|
|
1948
|
+
//#region src/factories/adapter.factory.mts
|
|
1949
|
+
function applyDecs2203RFactory$7() {
|
|
1950
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
1951
|
+
return function addInitializer(initializer) {
|
|
1952
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
1953
|
+
assertCallable(initializer, "An initializer");
|
|
1954
|
+
initializers.push(initializer);
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
1958
|
+
var kindStr;
|
|
1959
|
+
switch (kind) {
|
|
1960
|
+
case 1:
|
|
1961
|
+
kindStr = "accessor";
|
|
1962
|
+
break;
|
|
1963
|
+
case 2:
|
|
1964
|
+
kindStr = "method";
|
|
1965
|
+
break;
|
|
1966
|
+
case 3:
|
|
1967
|
+
kindStr = "getter";
|
|
1968
|
+
break;
|
|
1969
|
+
case 4:
|
|
1970
|
+
kindStr = "setter";
|
|
1971
|
+
break;
|
|
1972
|
+
default: kindStr = "field";
|
|
1973
|
+
}
|
|
1974
|
+
var ctx = {
|
|
1975
|
+
kind: kindStr,
|
|
1976
|
+
name: isPrivate ? "#" + name : name,
|
|
1977
|
+
static: isStatic,
|
|
1978
|
+
private: isPrivate,
|
|
1979
|
+
metadata
|
|
1980
|
+
};
|
|
1981
|
+
var decoratorFinishedRef = { v: false };
|
|
1982
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
1983
|
+
var get, set;
|
|
1984
|
+
if (kind === 0) if (isPrivate) {
|
|
1985
|
+
get = desc.get;
|
|
1986
|
+
set = desc.set;
|
|
1987
|
+
} else {
|
|
1988
|
+
get = function() {
|
|
1989
|
+
return this[name];
|
|
1990
|
+
};
|
|
1991
|
+
set = function(v) {
|
|
1992
|
+
this[name] = v;
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
else if (kind === 2) get = function() {
|
|
1996
|
+
return desc.value;
|
|
1997
|
+
};
|
|
1998
|
+
else {
|
|
1999
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
2000
|
+
return desc.get.call(this);
|
|
2001
|
+
};
|
|
2002
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
2003
|
+
desc.set.call(this, v);
|
|
2004
|
+
};
|
|
2005
|
+
}
|
|
2006
|
+
ctx.access = get && set ? {
|
|
2007
|
+
get,
|
|
2008
|
+
set
|
|
2009
|
+
} : get ? { get } : { set };
|
|
2010
|
+
try {
|
|
2011
|
+
return dec(value, ctx);
|
|
2012
|
+
} finally {
|
|
2013
|
+
decoratorFinishedRef.v = true;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
2017
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
2018
|
+
}
|
|
2019
|
+
function assertCallable(fn, hint) {
|
|
2020
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
2021
|
+
}
|
|
2022
|
+
function assertValidReturnValue(kind, value) {
|
|
2023
|
+
var type = typeof value;
|
|
2024
|
+
if (kind === 1) {
|
|
2025
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2026
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
2027
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
2028
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
2029
|
+
} else if (type !== "function") {
|
|
2030
|
+
var hint;
|
|
2031
|
+
if (kind === 0) hint = "field";
|
|
2032
|
+
else if (kind === 10) hint = "class";
|
|
2033
|
+
else hint = "method";
|
|
2034
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
2038
|
+
var decs = decInfo[0];
|
|
2039
|
+
var desc, init, value;
|
|
2040
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
2041
|
+
get: decInfo[3],
|
|
2042
|
+
set: decInfo[4]
|
|
2043
|
+
};
|
|
2044
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
2045
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
2046
|
+
else desc = { value: decInfo[3] };
|
|
2047
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
2048
|
+
if (kind === 1) value = {
|
|
2049
|
+
get: desc.get,
|
|
2050
|
+
set: desc.set
|
|
2051
|
+
};
|
|
2052
|
+
else if (kind === 2) value = desc.value;
|
|
2053
|
+
else if (kind === 3) value = desc.get;
|
|
2054
|
+
else if (kind === 4) value = desc.set;
|
|
2055
|
+
var newValue, get, set;
|
|
2056
|
+
if (typeof decs === "function") {
|
|
2057
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2058
|
+
if (newValue !== void 0) {
|
|
2059
|
+
assertValidReturnValue(kind, newValue);
|
|
2060
|
+
if (kind === 0) init = newValue;
|
|
2061
|
+
else if (kind === 1) {
|
|
2062
|
+
init = newValue.init;
|
|
2063
|
+
get = newValue.get || value.get;
|
|
2064
|
+
set = newValue.set || value.set;
|
|
2065
|
+
value = {
|
|
2066
|
+
get,
|
|
2067
|
+
set
|
|
2068
|
+
};
|
|
2069
|
+
} else value = newValue;
|
|
2070
|
+
}
|
|
2071
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
2072
|
+
var dec = decs[i];
|
|
2073
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2074
|
+
if (newValue !== void 0) {
|
|
2075
|
+
assertValidReturnValue(kind, newValue);
|
|
2076
|
+
var newInit;
|
|
2077
|
+
if (kind === 0) newInit = newValue;
|
|
2078
|
+
else if (kind === 1) {
|
|
2079
|
+
newInit = newValue.init;
|
|
2080
|
+
get = newValue.get || value.get;
|
|
2081
|
+
set = newValue.set || value.set;
|
|
2082
|
+
value = {
|
|
2083
|
+
get,
|
|
2084
|
+
set
|
|
2085
|
+
};
|
|
2086
|
+
} else value = newValue;
|
|
2087
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
2088
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
2089
|
+
else init.push(newInit);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
if (kind === 0 || kind === 1) {
|
|
2093
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
2094
|
+
return init$1;
|
|
2095
|
+
};
|
|
2096
|
+
else if (typeof init !== "function") {
|
|
2097
|
+
var ownInitializers = init;
|
|
2098
|
+
init = function(instance, init$1) {
|
|
2099
|
+
var value$1 = init$1;
|
|
2100
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
2101
|
+
return value$1;
|
|
2102
|
+
};
|
|
2103
|
+
} else {
|
|
2104
|
+
var originalInitializer = init;
|
|
2105
|
+
init = function(instance, init$1) {
|
|
2106
|
+
return originalInitializer.call(instance, init$1);
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
ret.push(init);
|
|
2110
|
+
}
|
|
2111
|
+
if (kind !== 0) {
|
|
2112
|
+
if (kind === 1) {
|
|
2113
|
+
desc.get = value.get;
|
|
2114
|
+
desc.set = value.set;
|
|
2115
|
+
} else if (kind === 2) desc.value = value;
|
|
2116
|
+
else if (kind === 3) desc.get = value;
|
|
2117
|
+
else if (kind === 4) desc.set = value;
|
|
2118
|
+
if (isPrivate) if (kind === 1) {
|
|
2119
|
+
ret.push(function(instance, args) {
|
|
2120
|
+
return value.get.call(instance, args);
|
|
2121
|
+
});
|
|
2122
|
+
ret.push(function(instance, args) {
|
|
2123
|
+
return value.set.call(instance, args);
|
|
2124
|
+
});
|
|
2125
|
+
} else if (kind === 2) ret.push(value);
|
|
2126
|
+
else ret.push(function(instance, args) {
|
|
2127
|
+
return value.call(instance, args);
|
|
2128
|
+
});
|
|
2129
|
+
else Object.defineProperty(base, name, desc);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
2133
|
+
var ret = [];
|
|
2134
|
+
var protoInitializers;
|
|
2135
|
+
var staticInitializers;
|
|
2136
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
2137
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
2138
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
2139
|
+
var decInfo = decInfos[i];
|
|
2140
|
+
if (!Array.isArray(decInfo)) continue;
|
|
2141
|
+
var kind = decInfo[1];
|
|
2142
|
+
var name = decInfo[2];
|
|
2143
|
+
var isPrivate = decInfo.length > 3;
|
|
2144
|
+
var isStatic = kind >= 5;
|
|
2145
|
+
var base;
|
|
2146
|
+
var initializers;
|
|
2147
|
+
if (isStatic) {
|
|
2148
|
+
base = Class;
|
|
2149
|
+
kind = kind - 5;
|
|
2150
|
+
staticInitializers = staticInitializers || [];
|
|
2151
|
+
initializers = staticInitializers;
|
|
2152
|
+
} else {
|
|
2153
|
+
base = Class.prototype;
|
|
2154
|
+
protoInitializers = protoInitializers || [];
|
|
2155
|
+
initializers = protoInitializers;
|
|
2156
|
+
}
|
|
2157
|
+
if (kind !== 0 && !isPrivate) {
|
|
2158
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
2159
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
2160
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
2161
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
2162
|
+
else existingNonFields.set(name, true);
|
|
2163
|
+
}
|
|
2164
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
2165
|
+
}
|
|
2166
|
+
pushInitializers(ret, protoInitializers);
|
|
2167
|
+
pushInitializers(ret, staticInitializers);
|
|
2168
|
+
return ret;
|
|
2169
|
+
}
|
|
2170
|
+
function pushInitializers(ret, initializers) {
|
|
2171
|
+
if (initializers) ret.push(function(instance) {
|
|
2172
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
2173
|
+
return instance;
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
2177
|
+
if (classDecs.length > 0) {
|
|
2178
|
+
var initializers = [];
|
|
2179
|
+
var newClass = targetClass;
|
|
2180
|
+
var name = targetClass.name;
|
|
2181
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
2182
|
+
var decoratorFinishedRef = { v: false };
|
|
2183
|
+
try {
|
|
2184
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
2185
|
+
kind: "class",
|
|
2186
|
+
name,
|
|
2187
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
2188
|
+
metadata
|
|
2189
|
+
});
|
|
2190
|
+
} finally {
|
|
2191
|
+
decoratorFinishedRef.v = true;
|
|
2192
|
+
}
|
|
2193
|
+
if (nextNewClass !== void 0) {
|
|
2194
|
+
assertValidReturnValue(10, nextNewClass);
|
|
2195
|
+
newClass = nextNewClass;
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
2199
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
2200
|
+
}];
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
function defineMetadata(Class, metadata) {
|
|
2204
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
2205
|
+
configurable: true,
|
|
2206
|
+
enumerable: true,
|
|
2207
|
+
value: metadata
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
2211
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2212
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
2213
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
2214
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
2215
|
+
return {
|
|
2216
|
+
e,
|
|
2217
|
+
get c() {
|
|
2218
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
function _apply_decs_2203_r$7(targetClass, memberDecs, classDecs, parentClass) {
|
|
2224
|
+
return (_apply_decs_2203_r$7 = applyDecs2203RFactory$7())(targetClass, memberDecs, classDecs, parentClass);
|
|
2225
|
+
}
|
|
2226
|
+
var _dec$7, _initClass$7;
|
|
2227
|
+
let _AdapterFactory;
|
|
2228
|
+
_dec$7 = Factory({ token: AdapterToken });
|
|
2229
|
+
var AdapterFactory = class {
|
|
2230
|
+
static {
|
|
2231
|
+
({c: [_AdapterFactory, _initClass$7]} = _apply_decs_2203_r$7(this, [], [_dec$7]));
|
|
2232
|
+
}
|
|
2233
|
+
environment = inject(_NaviosEnvironment);
|
|
2234
|
+
create(ctx) {
|
|
2235
|
+
const service = this.environment.getToken(AdapterToken);
|
|
2236
|
+
if (!service) throw new Error("AdapterToken service not found in environment");
|
|
2237
|
+
return ctx.inject(service);
|
|
2238
|
+
}
|
|
2239
|
+
static {
|
|
2240
|
+
_initClass$7();
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
//#endregion
|
|
2245
|
+
//#region src/factories/endpoint-adapter.factory.mts
|
|
2246
|
+
function applyDecs2203RFactory$6() {
|
|
2247
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
2248
|
+
return function addInitializer(initializer) {
|
|
2249
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
2250
|
+
assertCallable(initializer, "An initializer");
|
|
2251
|
+
initializers.push(initializer);
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
2255
|
+
var kindStr;
|
|
2256
|
+
switch (kind) {
|
|
2257
|
+
case 1:
|
|
2258
|
+
kindStr = "accessor";
|
|
2259
|
+
break;
|
|
2260
|
+
case 2:
|
|
2261
|
+
kindStr = "method";
|
|
2262
|
+
break;
|
|
2263
|
+
case 3:
|
|
2264
|
+
kindStr = "getter";
|
|
2265
|
+
break;
|
|
2266
|
+
case 4:
|
|
2267
|
+
kindStr = "setter";
|
|
2268
|
+
break;
|
|
2269
|
+
default: kindStr = "field";
|
|
2270
|
+
}
|
|
2271
|
+
var ctx = {
|
|
2272
|
+
kind: kindStr,
|
|
2273
|
+
name: isPrivate ? "#" + name : name,
|
|
2274
|
+
static: isStatic,
|
|
2275
|
+
private: isPrivate,
|
|
2276
|
+
metadata
|
|
2277
|
+
};
|
|
2278
|
+
var decoratorFinishedRef = { v: false };
|
|
2279
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
2280
|
+
var get, set;
|
|
2281
|
+
if (kind === 0) if (isPrivate) {
|
|
2282
|
+
get = desc.get;
|
|
2283
|
+
set = desc.set;
|
|
2284
|
+
} else {
|
|
2285
|
+
get = function() {
|
|
2286
|
+
return this[name];
|
|
2287
|
+
};
|
|
2288
|
+
set = function(v) {
|
|
2289
|
+
this[name] = v;
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2292
|
+
else if (kind === 2) get = function() {
|
|
2293
|
+
return desc.value;
|
|
2294
|
+
};
|
|
2295
|
+
else {
|
|
2296
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
2297
|
+
return desc.get.call(this);
|
|
2298
|
+
};
|
|
2299
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
2300
|
+
desc.set.call(this, v);
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
ctx.access = get && set ? {
|
|
2304
|
+
get,
|
|
2305
|
+
set
|
|
2306
|
+
} : get ? { get } : { set };
|
|
2307
|
+
try {
|
|
2308
|
+
return dec(value, ctx);
|
|
2309
|
+
} finally {
|
|
2310
|
+
decoratorFinishedRef.v = true;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
2314
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
2315
|
+
}
|
|
2316
|
+
function assertCallable(fn, hint) {
|
|
2317
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
2318
|
+
}
|
|
2319
|
+
function assertValidReturnValue(kind, value) {
|
|
2320
|
+
var type = typeof value;
|
|
2321
|
+
if (kind === 1) {
|
|
2322
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2323
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
2324
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
2325
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
2326
|
+
} else if (type !== "function") {
|
|
2327
|
+
var hint;
|
|
2328
|
+
if (kind === 0) hint = "field";
|
|
2329
|
+
else if (kind === 10) hint = "class";
|
|
2330
|
+
else hint = "method";
|
|
2331
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
2335
|
+
var decs = decInfo[0];
|
|
2336
|
+
var desc, init, value;
|
|
2337
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
2338
|
+
get: decInfo[3],
|
|
2339
|
+
set: decInfo[4]
|
|
2340
|
+
};
|
|
2341
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
2342
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
2343
|
+
else desc = { value: decInfo[3] };
|
|
2344
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
2345
|
+
if (kind === 1) value = {
|
|
2346
|
+
get: desc.get,
|
|
2347
|
+
set: desc.set
|
|
2348
|
+
};
|
|
2349
|
+
else if (kind === 2) value = desc.value;
|
|
2350
|
+
else if (kind === 3) value = desc.get;
|
|
2351
|
+
else if (kind === 4) value = desc.set;
|
|
2352
|
+
var newValue, get, set;
|
|
2353
|
+
if (typeof decs === "function") {
|
|
2354
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2355
|
+
if (newValue !== void 0) {
|
|
2356
|
+
assertValidReturnValue(kind, newValue);
|
|
2357
|
+
if (kind === 0) init = newValue;
|
|
2358
|
+
else if (kind === 1) {
|
|
2359
|
+
init = newValue.init;
|
|
2360
|
+
get = newValue.get || value.get;
|
|
2361
|
+
set = newValue.set || value.set;
|
|
2362
|
+
value = {
|
|
2363
|
+
get,
|
|
2364
|
+
set
|
|
2365
|
+
};
|
|
2366
|
+
} else value = newValue;
|
|
2367
|
+
}
|
|
2368
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
2369
|
+
var dec = decs[i];
|
|
2370
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2371
|
+
if (newValue !== void 0) {
|
|
2372
|
+
assertValidReturnValue(kind, newValue);
|
|
2373
|
+
var newInit;
|
|
2374
|
+
if (kind === 0) newInit = newValue;
|
|
2375
|
+
else if (kind === 1) {
|
|
2376
|
+
newInit = newValue.init;
|
|
2377
|
+
get = newValue.get || value.get;
|
|
2378
|
+
set = newValue.set || value.set;
|
|
2379
|
+
value = {
|
|
2380
|
+
get,
|
|
2381
|
+
set
|
|
2382
|
+
};
|
|
2383
|
+
} else value = newValue;
|
|
2384
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
2385
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
2386
|
+
else init.push(newInit);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
if (kind === 0 || kind === 1) {
|
|
2390
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
2391
|
+
return init$1;
|
|
2392
|
+
};
|
|
2393
|
+
else if (typeof init !== "function") {
|
|
2394
|
+
var ownInitializers = init;
|
|
2395
|
+
init = function(instance, init$1) {
|
|
2396
|
+
var value$1 = init$1;
|
|
2397
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
2398
|
+
return value$1;
|
|
2399
|
+
};
|
|
2400
|
+
} else {
|
|
2401
|
+
var originalInitializer = init;
|
|
2402
|
+
init = function(instance, init$1) {
|
|
2403
|
+
return originalInitializer.call(instance, init$1);
|
|
2404
|
+
};
|
|
2405
|
+
}
|
|
2406
|
+
ret.push(init);
|
|
2407
|
+
}
|
|
2408
|
+
if (kind !== 0) {
|
|
2409
|
+
if (kind === 1) {
|
|
2410
|
+
desc.get = value.get;
|
|
2411
|
+
desc.set = value.set;
|
|
2412
|
+
} else if (kind === 2) desc.value = value;
|
|
2413
|
+
else if (kind === 3) desc.get = value;
|
|
2414
|
+
else if (kind === 4) desc.set = value;
|
|
2415
|
+
if (isPrivate) if (kind === 1) {
|
|
2416
|
+
ret.push(function(instance, args) {
|
|
2417
|
+
return value.get.call(instance, args);
|
|
2418
|
+
});
|
|
2419
|
+
ret.push(function(instance, args) {
|
|
2420
|
+
return value.set.call(instance, args);
|
|
2421
|
+
});
|
|
2422
|
+
} else if (kind === 2) ret.push(value);
|
|
2423
|
+
else ret.push(function(instance, args) {
|
|
2424
|
+
return value.call(instance, args);
|
|
2425
|
+
});
|
|
2426
|
+
else Object.defineProperty(base, name, desc);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
2430
|
+
var ret = [];
|
|
2431
|
+
var protoInitializers;
|
|
2432
|
+
var staticInitializers;
|
|
2433
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
2434
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
2435
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
2436
|
+
var decInfo = decInfos[i];
|
|
2437
|
+
if (!Array.isArray(decInfo)) continue;
|
|
2438
|
+
var kind = decInfo[1];
|
|
2439
|
+
var name = decInfo[2];
|
|
2440
|
+
var isPrivate = decInfo.length > 3;
|
|
2441
|
+
var isStatic = kind >= 5;
|
|
2442
|
+
var base;
|
|
2443
|
+
var initializers;
|
|
2444
|
+
if (isStatic) {
|
|
2445
|
+
base = Class;
|
|
2446
|
+
kind = kind - 5;
|
|
2447
|
+
staticInitializers = staticInitializers || [];
|
|
2448
|
+
initializers = staticInitializers;
|
|
2449
|
+
} else {
|
|
2450
|
+
base = Class.prototype;
|
|
2451
|
+
protoInitializers = protoInitializers || [];
|
|
2452
|
+
initializers = protoInitializers;
|
|
2453
|
+
}
|
|
2454
|
+
if (kind !== 0 && !isPrivate) {
|
|
2455
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
2456
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
2457
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
2458
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
2459
|
+
else existingNonFields.set(name, true);
|
|
2460
|
+
}
|
|
2461
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
2462
|
+
}
|
|
2463
|
+
pushInitializers(ret, protoInitializers);
|
|
2464
|
+
pushInitializers(ret, staticInitializers);
|
|
2465
|
+
return ret;
|
|
2466
|
+
}
|
|
2467
|
+
function pushInitializers(ret, initializers) {
|
|
2468
|
+
if (initializers) ret.push(function(instance) {
|
|
2469
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
2470
|
+
return instance;
|
|
2471
|
+
});
|
|
2472
|
+
}
|
|
2473
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
2474
|
+
if (classDecs.length > 0) {
|
|
2475
|
+
var initializers = [];
|
|
2476
|
+
var newClass = targetClass;
|
|
2477
|
+
var name = targetClass.name;
|
|
2478
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
2479
|
+
var decoratorFinishedRef = { v: false };
|
|
2480
|
+
try {
|
|
2481
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
2482
|
+
kind: "class",
|
|
2483
|
+
name,
|
|
2484
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
2485
|
+
metadata
|
|
2486
|
+
});
|
|
2487
|
+
} finally {
|
|
2488
|
+
decoratorFinishedRef.v = true;
|
|
2489
|
+
}
|
|
2490
|
+
if (nextNewClass !== void 0) {
|
|
2491
|
+
assertValidReturnValue(10, nextNewClass);
|
|
2492
|
+
newClass = nextNewClass;
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
2496
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
2497
|
+
}];
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
function defineMetadata(Class, metadata) {
|
|
2501
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
2502
|
+
configurable: true,
|
|
2503
|
+
enumerable: true,
|
|
2504
|
+
value: metadata
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
2508
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2509
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
2510
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
2511
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
2512
|
+
return {
|
|
2513
|
+
e,
|
|
2514
|
+
get c() {
|
|
2515
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
function _apply_decs_2203_r$6(targetClass, memberDecs, classDecs, parentClass) {
|
|
2521
|
+
return (_apply_decs_2203_r$6 = applyDecs2203RFactory$6())(targetClass, memberDecs, classDecs, parentClass);
|
|
2522
|
+
}
|
|
2523
|
+
var _dec$6, _initClass$6;
|
|
2524
|
+
let _EndpointAdapterFactory;
|
|
2525
|
+
_dec$6 = Factory({ token: EndpointAdapterToken });
|
|
2526
|
+
var EndpointAdapterFactory = class {
|
|
2527
|
+
static {
|
|
2528
|
+
({c: [_EndpointAdapterFactory, _initClass$6]} = _apply_decs_2203_r$6(this, [], [_dec$6]));
|
|
2529
|
+
}
|
|
2530
|
+
environment = inject(_NaviosEnvironment);
|
|
2531
|
+
create(ctx) {
|
|
2532
|
+
const service = this.environment.getToken(EndpointAdapterToken);
|
|
2533
|
+
if (!service) throw new Error("EndpointAdapterToken service not found in environment");
|
|
2534
|
+
return ctx.inject(service);
|
|
2535
|
+
}
|
|
2536
|
+
static {
|
|
2537
|
+
_initClass$6();
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
|
|
2541
|
+
//#endregion
|
|
2542
|
+
//#region src/factories/http-adapter.factory.mts
|
|
2543
|
+
function applyDecs2203RFactory$5() {
|
|
2544
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
2545
|
+
return function addInitializer(initializer) {
|
|
2546
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
2547
|
+
assertCallable(initializer, "An initializer");
|
|
2548
|
+
initializers.push(initializer);
|
|
2549
|
+
};
|
|
2550
|
+
}
|
|
2551
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
2552
|
+
var kindStr;
|
|
2553
|
+
switch (kind) {
|
|
2554
|
+
case 1:
|
|
2555
|
+
kindStr = "accessor";
|
|
2556
|
+
break;
|
|
2557
|
+
case 2:
|
|
2558
|
+
kindStr = "method";
|
|
2559
|
+
break;
|
|
2560
|
+
case 3:
|
|
2561
|
+
kindStr = "getter";
|
|
2562
|
+
break;
|
|
2563
|
+
case 4:
|
|
2564
|
+
kindStr = "setter";
|
|
2565
|
+
break;
|
|
2566
|
+
default: kindStr = "field";
|
|
2567
|
+
}
|
|
2568
|
+
var ctx = {
|
|
2569
|
+
kind: kindStr,
|
|
2570
|
+
name: isPrivate ? "#" + name : name,
|
|
2571
|
+
static: isStatic,
|
|
2572
|
+
private: isPrivate,
|
|
2573
|
+
metadata
|
|
2574
|
+
};
|
|
2575
|
+
var decoratorFinishedRef = { v: false };
|
|
2576
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
2577
|
+
var get, set;
|
|
2578
|
+
if (kind === 0) if (isPrivate) {
|
|
2579
|
+
get = desc.get;
|
|
2580
|
+
set = desc.set;
|
|
2581
|
+
} else {
|
|
2582
|
+
get = function() {
|
|
2583
|
+
return this[name];
|
|
2584
|
+
};
|
|
2585
|
+
set = function(v) {
|
|
2586
|
+
this[name] = v;
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
else if (kind === 2) get = function() {
|
|
2590
|
+
return desc.value;
|
|
2591
|
+
};
|
|
2592
|
+
else {
|
|
2593
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
2594
|
+
return desc.get.call(this);
|
|
2595
|
+
};
|
|
2596
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
2597
|
+
desc.set.call(this, v);
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
ctx.access = get && set ? {
|
|
2601
|
+
get,
|
|
2602
|
+
set
|
|
2603
|
+
} : get ? { get } : { set };
|
|
2604
|
+
try {
|
|
2605
|
+
return dec(value, ctx);
|
|
2606
|
+
} finally {
|
|
2607
|
+
decoratorFinishedRef.v = true;
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
2611
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
2612
|
+
}
|
|
2613
|
+
function assertCallable(fn, hint) {
|
|
2614
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
2615
|
+
}
|
|
2616
|
+
function assertValidReturnValue(kind, value) {
|
|
2617
|
+
var type = typeof value;
|
|
2618
|
+
if (kind === 1) {
|
|
2619
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2620
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
2621
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
2622
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
2623
|
+
} else if (type !== "function") {
|
|
2624
|
+
var hint;
|
|
2625
|
+
if (kind === 0) hint = "field";
|
|
2626
|
+
else if (kind === 10) hint = "class";
|
|
2627
|
+
else hint = "method";
|
|
2628
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
2632
|
+
var decs = decInfo[0];
|
|
2633
|
+
var desc, init, value;
|
|
2634
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
2635
|
+
get: decInfo[3],
|
|
2636
|
+
set: decInfo[4]
|
|
2637
|
+
};
|
|
2638
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
2639
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
2640
|
+
else desc = { value: decInfo[3] };
|
|
2641
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
2642
|
+
if (kind === 1) value = {
|
|
2643
|
+
get: desc.get,
|
|
2644
|
+
set: desc.set
|
|
2645
|
+
};
|
|
2646
|
+
else if (kind === 2) value = desc.value;
|
|
2647
|
+
else if (kind === 3) value = desc.get;
|
|
2648
|
+
else if (kind === 4) value = desc.set;
|
|
2649
|
+
var newValue, get, set;
|
|
2650
|
+
if (typeof decs === "function") {
|
|
2651
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2652
|
+
if (newValue !== void 0) {
|
|
2653
|
+
assertValidReturnValue(kind, newValue);
|
|
2654
|
+
if (kind === 0) init = newValue;
|
|
2655
|
+
else if (kind === 1) {
|
|
2656
|
+
init = newValue.init;
|
|
2657
|
+
get = newValue.get || value.get;
|
|
2658
|
+
set = newValue.set || value.set;
|
|
2659
|
+
value = {
|
|
2660
|
+
get,
|
|
2661
|
+
set
|
|
2662
|
+
};
|
|
2663
|
+
} else value = newValue;
|
|
2664
|
+
}
|
|
2665
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
2666
|
+
var dec = decs[i];
|
|
2667
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2668
|
+
if (newValue !== void 0) {
|
|
2669
|
+
assertValidReturnValue(kind, newValue);
|
|
2670
|
+
var newInit;
|
|
2671
|
+
if (kind === 0) newInit = newValue;
|
|
2672
|
+
else if (kind === 1) {
|
|
2673
|
+
newInit = newValue.init;
|
|
2674
|
+
get = newValue.get || value.get;
|
|
2675
|
+
set = newValue.set || value.set;
|
|
2676
|
+
value = {
|
|
2677
|
+
get,
|
|
2678
|
+
set
|
|
2679
|
+
};
|
|
2680
|
+
} else value = newValue;
|
|
2681
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
2682
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
2683
|
+
else init.push(newInit);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
if (kind === 0 || kind === 1) {
|
|
2687
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
2688
|
+
return init$1;
|
|
2689
|
+
};
|
|
2690
|
+
else if (typeof init !== "function") {
|
|
2691
|
+
var ownInitializers = init;
|
|
2692
|
+
init = function(instance, init$1) {
|
|
2693
|
+
var value$1 = init$1;
|
|
2694
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
2695
|
+
return value$1;
|
|
2696
|
+
};
|
|
2697
|
+
} else {
|
|
2698
|
+
var originalInitializer = init;
|
|
2699
|
+
init = function(instance, init$1) {
|
|
2700
|
+
return originalInitializer.call(instance, init$1);
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
ret.push(init);
|
|
2704
|
+
}
|
|
2705
|
+
if (kind !== 0) {
|
|
2706
|
+
if (kind === 1) {
|
|
2707
|
+
desc.get = value.get;
|
|
2708
|
+
desc.set = value.set;
|
|
2709
|
+
} else if (kind === 2) desc.value = value;
|
|
2710
|
+
else if (kind === 3) desc.get = value;
|
|
2711
|
+
else if (kind === 4) desc.set = value;
|
|
2712
|
+
if (isPrivate) if (kind === 1) {
|
|
2713
|
+
ret.push(function(instance, args) {
|
|
2714
|
+
return value.get.call(instance, args);
|
|
2715
|
+
});
|
|
2716
|
+
ret.push(function(instance, args) {
|
|
2717
|
+
return value.set.call(instance, args);
|
|
2718
|
+
});
|
|
2719
|
+
} else if (kind === 2) ret.push(value);
|
|
2720
|
+
else ret.push(function(instance, args) {
|
|
2721
|
+
return value.call(instance, args);
|
|
2722
|
+
});
|
|
2723
|
+
else Object.defineProperty(base, name, desc);
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
2727
|
+
var ret = [];
|
|
2728
|
+
var protoInitializers;
|
|
2729
|
+
var staticInitializers;
|
|
2730
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
2731
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
2732
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
2733
|
+
var decInfo = decInfos[i];
|
|
2734
|
+
if (!Array.isArray(decInfo)) continue;
|
|
2735
|
+
var kind = decInfo[1];
|
|
2736
|
+
var name = decInfo[2];
|
|
2737
|
+
var isPrivate = decInfo.length > 3;
|
|
2738
|
+
var isStatic = kind >= 5;
|
|
2739
|
+
var base;
|
|
2740
|
+
var initializers;
|
|
2741
|
+
if (isStatic) {
|
|
2742
|
+
base = Class;
|
|
2743
|
+
kind = kind - 5;
|
|
2744
|
+
staticInitializers = staticInitializers || [];
|
|
2745
|
+
initializers = staticInitializers;
|
|
2746
|
+
} else {
|
|
2747
|
+
base = Class.prototype;
|
|
2748
|
+
protoInitializers = protoInitializers || [];
|
|
2749
|
+
initializers = protoInitializers;
|
|
2750
|
+
}
|
|
2751
|
+
if (kind !== 0 && !isPrivate) {
|
|
2752
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
2753
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
2754
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
2755
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
2756
|
+
else existingNonFields.set(name, true);
|
|
2757
|
+
}
|
|
2758
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
2759
|
+
}
|
|
2760
|
+
pushInitializers(ret, protoInitializers);
|
|
2761
|
+
pushInitializers(ret, staticInitializers);
|
|
2762
|
+
return ret;
|
|
2763
|
+
}
|
|
2764
|
+
function pushInitializers(ret, initializers) {
|
|
2765
|
+
if (initializers) ret.push(function(instance) {
|
|
2766
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
2767
|
+
return instance;
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
2771
|
+
if (classDecs.length > 0) {
|
|
2772
|
+
var initializers = [];
|
|
2773
|
+
var newClass = targetClass;
|
|
2774
|
+
var name = targetClass.name;
|
|
2775
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
2776
|
+
var decoratorFinishedRef = { v: false };
|
|
2777
|
+
try {
|
|
2778
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
2779
|
+
kind: "class",
|
|
2780
|
+
name,
|
|
2781
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
2782
|
+
metadata
|
|
2783
|
+
});
|
|
2784
|
+
} finally {
|
|
2785
|
+
decoratorFinishedRef.v = true;
|
|
2786
|
+
}
|
|
2787
|
+
if (nextNewClass !== void 0) {
|
|
2788
|
+
assertValidReturnValue(10, nextNewClass);
|
|
2789
|
+
newClass = nextNewClass;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
2793
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
2794
|
+
}];
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
function defineMetadata(Class, metadata) {
|
|
2798
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
2799
|
+
configurable: true,
|
|
2800
|
+
enumerable: true,
|
|
2801
|
+
value: metadata
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
2805
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2806
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
2807
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
2808
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
2809
|
+
return {
|
|
2810
|
+
e,
|
|
2811
|
+
get c() {
|
|
2812
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
};
|
|
2816
|
+
}
|
|
2817
|
+
function _apply_decs_2203_r$5(targetClass, memberDecs, classDecs, parentClass) {
|
|
2818
|
+
return (_apply_decs_2203_r$5 = applyDecs2203RFactory$5())(targetClass, memberDecs, classDecs, parentClass);
|
|
2819
|
+
}
|
|
2820
|
+
var _dec$5, _initClass$5;
|
|
2821
|
+
let _HttpAdapterFactory;
|
|
2822
|
+
_dec$5 = Factory({ token: HttpAdapterToken });
|
|
2823
|
+
var HttpAdapterFactory = class {
|
|
2824
|
+
static {
|
|
2825
|
+
({c: [_HttpAdapterFactory, _initClass$5]} = _apply_decs_2203_r$5(this, [], [_dec$5]));
|
|
2826
|
+
}
|
|
2827
|
+
environment = inject(_NaviosEnvironment);
|
|
2828
|
+
create(ctx) {
|
|
2829
|
+
const service = this.environment.getToken(HttpAdapterToken);
|
|
2830
|
+
if (!service) throw new Error("HttpAdapterToken service not found in environment");
|
|
2831
|
+
return ctx.inject(service);
|
|
2832
|
+
}
|
|
2833
|
+
static {
|
|
2834
|
+
_initClass$5();
|
|
2835
|
+
}
|
|
2836
|
+
};
|
|
2837
|
+
|
|
2838
|
+
//#endregion
|
|
2839
|
+
//#region src/factories/multipart-adapter.factory.mts
|
|
2840
|
+
function applyDecs2203RFactory$4() {
|
|
2841
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
2842
|
+
return function addInitializer(initializer) {
|
|
2843
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
2844
|
+
assertCallable(initializer, "An initializer");
|
|
2845
|
+
initializers.push(initializer);
|
|
2846
|
+
};
|
|
2847
|
+
}
|
|
2848
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
2849
|
+
var kindStr;
|
|
2850
|
+
switch (kind) {
|
|
2851
|
+
case 1:
|
|
2852
|
+
kindStr = "accessor";
|
|
2853
|
+
break;
|
|
2854
|
+
case 2:
|
|
2855
|
+
kindStr = "method";
|
|
2856
|
+
break;
|
|
2857
|
+
case 3:
|
|
2858
|
+
kindStr = "getter";
|
|
2859
|
+
break;
|
|
2860
|
+
case 4:
|
|
2861
|
+
kindStr = "setter";
|
|
2862
|
+
break;
|
|
2863
|
+
default: kindStr = "field";
|
|
2864
|
+
}
|
|
2865
|
+
var ctx = {
|
|
2866
|
+
kind: kindStr,
|
|
2867
|
+
name: isPrivate ? "#" + name : name,
|
|
2868
|
+
static: isStatic,
|
|
2869
|
+
private: isPrivate,
|
|
2870
|
+
metadata
|
|
2871
|
+
};
|
|
2872
|
+
var decoratorFinishedRef = { v: false };
|
|
2873
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
2874
|
+
var get, set;
|
|
2875
|
+
if (kind === 0) if (isPrivate) {
|
|
2876
|
+
get = desc.get;
|
|
2877
|
+
set = desc.set;
|
|
2878
|
+
} else {
|
|
2879
|
+
get = function() {
|
|
2880
|
+
return this[name];
|
|
2881
|
+
};
|
|
2882
|
+
set = function(v) {
|
|
2883
|
+
this[name] = v;
|
|
2884
|
+
};
|
|
2885
|
+
}
|
|
2886
|
+
else if (kind === 2) get = function() {
|
|
2887
|
+
return desc.value;
|
|
2888
|
+
};
|
|
2889
|
+
else {
|
|
2890
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
2891
|
+
return desc.get.call(this);
|
|
2892
|
+
};
|
|
2893
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
2894
|
+
desc.set.call(this, v);
|
|
2895
|
+
};
|
|
2896
|
+
}
|
|
2897
|
+
ctx.access = get && set ? {
|
|
2898
|
+
get,
|
|
2899
|
+
set
|
|
2900
|
+
} : get ? { get } : { set };
|
|
2901
|
+
try {
|
|
2902
|
+
return dec(value, ctx);
|
|
2903
|
+
} finally {
|
|
2904
|
+
decoratorFinishedRef.v = true;
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
2908
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
2909
|
+
}
|
|
2910
|
+
function assertCallable(fn, hint) {
|
|
2911
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
2912
|
+
}
|
|
2913
|
+
function assertValidReturnValue(kind, value) {
|
|
2914
|
+
var type = typeof value;
|
|
2915
|
+
if (kind === 1) {
|
|
2916
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2917
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
2918
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
2919
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
2920
|
+
} else if (type !== "function") {
|
|
2921
|
+
var hint;
|
|
2922
|
+
if (kind === 0) hint = "field";
|
|
2923
|
+
else if (kind === 10) hint = "class";
|
|
2924
|
+
else hint = "method";
|
|
2925
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
2929
|
+
var decs = decInfo[0];
|
|
2930
|
+
var desc, init, value;
|
|
2931
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
2932
|
+
get: decInfo[3],
|
|
2933
|
+
set: decInfo[4]
|
|
2934
|
+
};
|
|
2935
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
2936
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
2937
|
+
else desc = { value: decInfo[3] };
|
|
2938
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
2939
|
+
if (kind === 1) value = {
|
|
2940
|
+
get: desc.get,
|
|
2941
|
+
set: desc.set
|
|
2942
|
+
};
|
|
2943
|
+
else if (kind === 2) value = desc.value;
|
|
2944
|
+
else if (kind === 3) value = desc.get;
|
|
2945
|
+
else if (kind === 4) value = desc.set;
|
|
2946
|
+
var newValue, get, set;
|
|
2947
|
+
if (typeof decs === "function") {
|
|
2948
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2949
|
+
if (newValue !== void 0) {
|
|
2950
|
+
assertValidReturnValue(kind, newValue);
|
|
2951
|
+
if (kind === 0) init = newValue;
|
|
2952
|
+
else if (kind === 1) {
|
|
2953
|
+
init = newValue.init;
|
|
2954
|
+
get = newValue.get || value.get;
|
|
2955
|
+
set = newValue.set || value.set;
|
|
2956
|
+
value = {
|
|
2957
|
+
get,
|
|
2958
|
+
set
|
|
2959
|
+
};
|
|
2960
|
+
} else value = newValue;
|
|
2961
|
+
}
|
|
2962
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
2963
|
+
var dec = decs[i];
|
|
2964
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
2965
|
+
if (newValue !== void 0) {
|
|
2966
|
+
assertValidReturnValue(kind, newValue);
|
|
2967
|
+
var newInit;
|
|
2968
|
+
if (kind === 0) newInit = newValue;
|
|
2969
|
+
else if (kind === 1) {
|
|
2970
|
+
newInit = newValue.init;
|
|
2971
|
+
get = newValue.get || value.get;
|
|
2972
|
+
set = newValue.set || value.set;
|
|
2973
|
+
value = {
|
|
2974
|
+
get,
|
|
2975
|
+
set
|
|
2976
|
+
};
|
|
2977
|
+
} else value = newValue;
|
|
2978
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
2979
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
2980
|
+
else init.push(newInit);
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
if (kind === 0 || kind === 1) {
|
|
2984
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
2985
|
+
return init$1;
|
|
2986
|
+
};
|
|
2987
|
+
else if (typeof init !== "function") {
|
|
2988
|
+
var ownInitializers = init;
|
|
2989
|
+
init = function(instance, init$1) {
|
|
2990
|
+
var value$1 = init$1;
|
|
2991
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
2992
|
+
return value$1;
|
|
2993
|
+
};
|
|
2994
|
+
} else {
|
|
2995
|
+
var originalInitializer = init;
|
|
2996
|
+
init = function(instance, init$1) {
|
|
2997
|
+
return originalInitializer.call(instance, init$1);
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
ret.push(init);
|
|
3001
|
+
}
|
|
3002
|
+
if (kind !== 0) {
|
|
3003
|
+
if (kind === 1) {
|
|
3004
|
+
desc.get = value.get;
|
|
3005
|
+
desc.set = value.set;
|
|
3006
|
+
} else if (kind === 2) desc.value = value;
|
|
3007
|
+
else if (kind === 3) desc.get = value;
|
|
3008
|
+
else if (kind === 4) desc.set = value;
|
|
3009
|
+
if (isPrivate) if (kind === 1) {
|
|
3010
|
+
ret.push(function(instance, args) {
|
|
3011
|
+
return value.get.call(instance, args);
|
|
3012
|
+
});
|
|
3013
|
+
ret.push(function(instance, args) {
|
|
3014
|
+
return value.set.call(instance, args);
|
|
3015
|
+
});
|
|
3016
|
+
} else if (kind === 2) ret.push(value);
|
|
3017
|
+
else ret.push(function(instance, args) {
|
|
3018
|
+
return value.call(instance, args);
|
|
3019
|
+
});
|
|
3020
|
+
else Object.defineProperty(base, name, desc);
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
3024
|
+
var ret = [];
|
|
3025
|
+
var protoInitializers;
|
|
3026
|
+
var staticInitializers;
|
|
3027
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
3028
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
3029
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
3030
|
+
var decInfo = decInfos[i];
|
|
3031
|
+
if (!Array.isArray(decInfo)) continue;
|
|
3032
|
+
var kind = decInfo[1];
|
|
3033
|
+
var name = decInfo[2];
|
|
3034
|
+
var isPrivate = decInfo.length > 3;
|
|
3035
|
+
var isStatic = kind >= 5;
|
|
3036
|
+
var base;
|
|
3037
|
+
var initializers;
|
|
3038
|
+
if (isStatic) {
|
|
3039
|
+
base = Class;
|
|
3040
|
+
kind = kind - 5;
|
|
3041
|
+
staticInitializers = staticInitializers || [];
|
|
3042
|
+
initializers = staticInitializers;
|
|
3043
|
+
} else {
|
|
3044
|
+
base = Class.prototype;
|
|
3045
|
+
protoInitializers = protoInitializers || [];
|
|
3046
|
+
initializers = protoInitializers;
|
|
3047
|
+
}
|
|
3048
|
+
if (kind !== 0 && !isPrivate) {
|
|
3049
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
3050
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
3051
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
3052
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
3053
|
+
else existingNonFields.set(name, true);
|
|
3054
|
+
}
|
|
3055
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
3056
|
+
}
|
|
3057
|
+
pushInitializers(ret, protoInitializers);
|
|
3058
|
+
pushInitializers(ret, staticInitializers);
|
|
3059
|
+
return ret;
|
|
3060
|
+
}
|
|
3061
|
+
function pushInitializers(ret, initializers) {
|
|
3062
|
+
if (initializers) ret.push(function(instance) {
|
|
3063
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
3064
|
+
return instance;
|
|
3065
|
+
});
|
|
3066
|
+
}
|
|
3067
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
3068
|
+
if (classDecs.length > 0) {
|
|
3069
|
+
var initializers = [];
|
|
3070
|
+
var newClass = targetClass;
|
|
3071
|
+
var name = targetClass.name;
|
|
3072
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
3073
|
+
var decoratorFinishedRef = { v: false };
|
|
3074
|
+
try {
|
|
3075
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
3076
|
+
kind: "class",
|
|
3077
|
+
name,
|
|
3078
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
3079
|
+
metadata
|
|
3080
|
+
});
|
|
3081
|
+
} finally {
|
|
3082
|
+
decoratorFinishedRef.v = true;
|
|
3083
|
+
}
|
|
3084
|
+
if (nextNewClass !== void 0) {
|
|
3085
|
+
assertValidReturnValue(10, nextNewClass);
|
|
3086
|
+
newClass = nextNewClass;
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
3090
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
3091
|
+
}];
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
function defineMetadata(Class, metadata) {
|
|
3095
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
3096
|
+
configurable: true,
|
|
3097
|
+
enumerable: true,
|
|
3098
|
+
value: metadata
|
|
3099
|
+
});
|
|
3100
|
+
}
|
|
3101
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
3102
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
3103
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
3104
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
3105
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
3106
|
+
return {
|
|
3107
|
+
e,
|
|
3108
|
+
get c() {
|
|
3109
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
3110
|
+
}
|
|
3111
|
+
};
|
|
3112
|
+
};
|
|
3113
|
+
}
|
|
3114
|
+
function _apply_decs_2203_r$4(targetClass, memberDecs, classDecs, parentClass) {
|
|
3115
|
+
return (_apply_decs_2203_r$4 = applyDecs2203RFactory$4())(targetClass, memberDecs, classDecs, parentClass);
|
|
3116
|
+
}
|
|
3117
|
+
var _dec$4, _initClass$4;
|
|
3118
|
+
let _MultipartAdapterFactory;
|
|
3119
|
+
_dec$4 = Factory({ token: MultipartAdapterToken });
|
|
3120
|
+
var MultipartAdapterFactory = class {
|
|
3121
|
+
static {
|
|
3122
|
+
({c: [_MultipartAdapterFactory, _initClass$4]} = _apply_decs_2203_r$4(this, [], [_dec$4]));
|
|
3123
|
+
}
|
|
3124
|
+
environment = inject(_NaviosEnvironment);
|
|
3125
|
+
create(ctx) {
|
|
3126
|
+
const service = this.environment.getToken(MultipartAdapterToken);
|
|
3127
|
+
if (!service) throw new Error("MultipartAdapterToken service not found in environment");
|
|
3128
|
+
return ctx.inject(service);
|
|
3129
|
+
}
|
|
3130
|
+
static {
|
|
3131
|
+
_initClass$4();
|
|
3132
|
+
}
|
|
3133
|
+
};
|
|
3134
|
+
|
|
3135
|
+
//#endregion
|
|
3136
|
+
//#region src/factories/request.factory.mts
|
|
3137
|
+
function applyDecs2203RFactory$3() {
|
|
3138
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
3139
|
+
return function addInitializer(initializer) {
|
|
3140
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
3141
|
+
assertCallable(initializer, "An initializer");
|
|
3142
|
+
initializers.push(initializer);
|
|
3143
|
+
};
|
|
3144
|
+
}
|
|
3145
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
3146
|
+
var kindStr;
|
|
3147
|
+
switch (kind) {
|
|
3148
|
+
case 1:
|
|
3149
|
+
kindStr = "accessor";
|
|
3150
|
+
break;
|
|
3151
|
+
case 2:
|
|
3152
|
+
kindStr = "method";
|
|
3153
|
+
break;
|
|
3154
|
+
case 3:
|
|
3155
|
+
kindStr = "getter";
|
|
3156
|
+
break;
|
|
3157
|
+
case 4:
|
|
3158
|
+
kindStr = "setter";
|
|
3159
|
+
break;
|
|
3160
|
+
default: kindStr = "field";
|
|
3161
|
+
}
|
|
3162
|
+
var ctx = {
|
|
3163
|
+
kind: kindStr,
|
|
3164
|
+
name: isPrivate ? "#" + name : name,
|
|
3165
|
+
static: isStatic,
|
|
3166
|
+
private: isPrivate,
|
|
3167
|
+
metadata
|
|
3168
|
+
};
|
|
3169
|
+
var decoratorFinishedRef = { v: false };
|
|
3170
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
3171
|
+
var get, set;
|
|
3172
|
+
if (kind === 0) if (isPrivate) {
|
|
3173
|
+
get = desc.get;
|
|
3174
|
+
set = desc.set;
|
|
3175
|
+
} else {
|
|
3176
|
+
get = function() {
|
|
3177
|
+
return this[name];
|
|
3178
|
+
};
|
|
3179
|
+
set = function(v) {
|
|
3180
|
+
this[name] = v;
|
|
3181
|
+
};
|
|
3182
|
+
}
|
|
3183
|
+
else if (kind === 2) get = function() {
|
|
3184
|
+
return desc.value;
|
|
3185
|
+
};
|
|
3186
|
+
else {
|
|
3187
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
3188
|
+
return desc.get.call(this);
|
|
3189
|
+
};
|
|
3190
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
3191
|
+
desc.set.call(this, v);
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3194
|
+
ctx.access = get && set ? {
|
|
3195
|
+
get,
|
|
3196
|
+
set
|
|
3197
|
+
} : get ? { get } : { set };
|
|
3198
|
+
try {
|
|
3199
|
+
return dec(value, ctx);
|
|
3200
|
+
} finally {
|
|
3201
|
+
decoratorFinishedRef.v = true;
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
3205
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
3206
|
+
}
|
|
3207
|
+
function assertCallable(fn, hint) {
|
|
3208
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
3209
|
+
}
|
|
3210
|
+
function assertValidReturnValue(kind, value) {
|
|
3211
|
+
var type = typeof value;
|
|
3212
|
+
if (kind === 1) {
|
|
3213
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
3214
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
3215
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
3216
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
3217
|
+
} else if (type !== "function") {
|
|
3218
|
+
var hint;
|
|
3219
|
+
if (kind === 0) hint = "field";
|
|
3220
|
+
else if (kind === 10) hint = "class";
|
|
3221
|
+
else hint = "method";
|
|
3222
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
3226
|
+
var decs = decInfo[0];
|
|
3227
|
+
var desc, init, value;
|
|
3228
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
3229
|
+
get: decInfo[3],
|
|
3230
|
+
set: decInfo[4]
|
|
3231
|
+
};
|
|
3232
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
3233
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
3234
|
+
else desc = { value: decInfo[3] };
|
|
3235
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
3236
|
+
if (kind === 1) value = {
|
|
3237
|
+
get: desc.get,
|
|
3238
|
+
set: desc.set
|
|
3239
|
+
};
|
|
3240
|
+
else if (kind === 2) value = desc.value;
|
|
3241
|
+
else if (kind === 3) value = desc.get;
|
|
3242
|
+
else if (kind === 4) value = desc.set;
|
|
3243
|
+
var newValue, get, set;
|
|
3244
|
+
if (typeof decs === "function") {
|
|
3245
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3246
|
+
if (newValue !== void 0) {
|
|
3247
|
+
assertValidReturnValue(kind, newValue);
|
|
3248
|
+
if (kind === 0) init = newValue;
|
|
3249
|
+
else if (kind === 1) {
|
|
3250
|
+
init = newValue.init;
|
|
3251
|
+
get = newValue.get || value.get;
|
|
3252
|
+
set = newValue.set || value.set;
|
|
3253
|
+
value = {
|
|
3254
|
+
get,
|
|
3255
|
+
set
|
|
3256
|
+
};
|
|
3257
|
+
} else value = newValue;
|
|
3258
|
+
}
|
|
3259
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
3260
|
+
var dec = decs[i];
|
|
3261
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3262
|
+
if (newValue !== void 0) {
|
|
3263
|
+
assertValidReturnValue(kind, newValue);
|
|
3264
|
+
var newInit;
|
|
3265
|
+
if (kind === 0) newInit = newValue;
|
|
3266
|
+
else if (kind === 1) {
|
|
3267
|
+
newInit = newValue.init;
|
|
3268
|
+
get = newValue.get || value.get;
|
|
3269
|
+
set = newValue.set || value.set;
|
|
3270
|
+
value = {
|
|
3271
|
+
get,
|
|
3272
|
+
set
|
|
3273
|
+
};
|
|
3274
|
+
} else value = newValue;
|
|
3275
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
3276
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
3277
|
+
else init.push(newInit);
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
if (kind === 0 || kind === 1) {
|
|
3281
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
3282
|
+
return init$1;
|
|
3283
|
+
};
|
|
3284
|
+
else if (typeof init !== "function") {
|
|
3285
|
+
var ownInitializers = init;
|
|
3286
|
+
init = function(instance, init$1) {
|
|
3287
|
+
var value$1 = init$1;
|
|
3288
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
3289
|
+
return value$1;
|
|
3290
|
+
};
|
|
3291
|
+
} else {
|
|
3292
|
+
var originalInitializer = init;
|
|
3293
|
+
init = function(instance, init$1) {
|
|
3294
|
+
return originalInitializer.call(instance, init$1);
|
|
3295
|
+
};
|
|
3296
|
+
}
|
|
3297
|
+
ret.push(init);
|
|
3298
|
+
}
|
|
3299
|
+
if (kind !== 0) {
|
|
3300
|
+
if (kind === 1) {
|
|
3301
|
+
desc.get = value.get;
|
|
3302
|
+
desc.set = value.set;
|
|
3303
|
+
} else if (kind === 2) desc.value = value;
|
|
3304
|
+
else if (kind === 3) desc.get = value;
|
|
3305
|
+
else if (kind === 4) desc.set = value;
|
|
3306
|
+
if (isPrivate) if (kind === 1) {
|
|
3307
|
+
ret.push(function(instance, args) {
|
|
3308
|
+
return value.get.call(instance, args);
|
|
3309
|
+
});
|
|
3310
|
+
ret.push(function(instance, args) {
|
|
3311
|
+
return value.set.call(instance, args);
|
|
3312
|
+
});
|
|
3313
|
+
} else if (kind === 2) ret.push(value);
|
|
3314
|
+
else ret.push(function(instance, args) {
|
|
3315
|
+
return value.call(instance, args);
|
|
3316
|
+
});
|
|
3317
|
+
else Object.defineProperty(base, name, desc);
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
3321
|
+
var ret = [];
|
|
3322
|
+
var protoInitializers;
|
|
3323
|
+
var staticInitializers;
|
|
3324
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
3325
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
3326
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
3327
|
+
var decInfo = decInfos[i];
|
|
3328
|
+
if (!Array.isArray(decInfo)) continue;
|
|
3329
|
+
var kind = decInfo[1];
|
|
3330
|
+
var name = decInfo[2];
|
|
3331
|
+
var isPrivate = decInfo.length > 3;
|
|
3332
|
+
var isStatic = kind >= 5;
|
|
3333
|
+
var base;
|
|
3334
|
+
var initializers;
|
|
3335
|
+
if (isStatic) {
|
|
3336
|
+
base = Class;
|
|
3337
|
+
kind = kind - 5;
|
|
3338
|
+
staticInitializers = staticInitializers || [];
|
|
3339
|
+
initializers = staticInitializers;
|
|
3340
|
+
} else {
|
|
3341
|
+
base = Class.prototype;
|
|
3342
|
+
protoInitializers = protoInitializers || [];
|
|
3343
|
+
initializers = protoInitializers;
|
|
3344
|
+
}
|
|
3345
|
+
if (kind !== 0 && !isPrivate) {
|
|
3346
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
3347
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
3348
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
3349
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
3350
|
+
else existingNonFields.set(name, true);
|
|
3351
|
+
}
|
|
3352
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
3353
|
+
}
|
|
3354
|
+
pushInitializers(ret, protoInitializers);
|
|
3355
|
+
pushInitializers(ret, staticInitializers);
|
|
3356
|
+
return ret;
|
|
3357
|
+
}
|
|
3358
|
+
function pushInitializers(ret, initializers) {
|
|
3359
|
+
if (initializers) ret.push(function(instance) {
|
|
3360
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
3361
|
+
return instance;
|
|
3362
|
+
});
|
|
3363
|
+
}
|
|
3364
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
3365
|
+
if (classDecs.length > 0) {
|
|
3366
|
+
var initializers = [];
|
|
3367
|
+
var newClass = targetClass;
|
|
3368
|
+
var name = targetClass.name;
|
|
3369
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
3370
|
+
var decoratorFinishedRef = { v: false };
|
|
3371
|
+
try {
|
|
3372
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
3373
|
+
kind: "class",
|
|
3374
|
+
name,
|
|
3375
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
3376
|
+
metadata
|
|
3377
|
+
});
|
|
3378
|
+
} finally {
|
|
3379
|
+
decoratorFinishedRef.v = true;
|
|
3380
|
+
}
|
|
3381
|
+
if (nextNewClass !== void 0) {
|
|
3382
|
+
assertValidReturnValue(10, nextNewClass);
|
|
3383
|
+
newClass = nextNewClass;
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
3387
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
3388
|
+
}];
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
function defineMetadata(Class, metadata) {
|
|
3392
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
3393
|
+
configurable: true,
|
|
3394
|
+
enumerable: true,
|
|
3395
|
+
value: metadata
|
|
3396
|
+
});
|
|
3397
|
+
}
|
|
3398
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
3399
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
3400
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
3401
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
3402
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
3403
|
+
return {
|
|
3404
|
+
e,
|
|
3405
|
+
get c() {
|
|
3406
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
3407
|
+
}
|
|
3408
|
+
};
|
|
3409
|
+
};
|
|
3410
|
+
}
|
|
3411
|
+
function _apply_decs_2203_r$3(targetClass, memberDecs, classDecs, parentClass) {
|
|
3412
|
+
return (_apply_decs_2203_r$3 = applyDecs2203RFactory$3())(targetClass, memberDecs, classDecs, parentClass);
|
|
3413
|
+
}
|
|
3414
|
+
var _dec$3, _initClass$3;
|
|
3415
|
+
let _RequestFactory;
|
|
3416
|
+
_dec$3 = Factory({
|
|
3417
|
+
token: Request,
|
|
3418
|
+
scope: InjectableScope.Request
|
|
3419
|
+
});
|
|
3420
|
+
var RequestFactory = class {
|
|
3421
|
+
static {
|
|
3422
|
+
({c: [_RequestFactory, _initClass$3]} = _apply_decs_2203_r$3(this, [], [_dec$3]));
|
|
3423
|
+
}
|
|
3424
|
+
environment = inject(_NaviosEnvironment);
|
|
3425
|
+
create(ctx) {
|
|
3426
|
+
const service = this.environment.getToken(Request);
|
|
3427
|
+
if (!service) throw new Error("RequestToken service not found in environment");
|
|
3428
|
+
return ctx.inject(service);
|
|
3429
|
+
}
|
|
3430
|
+
static {
|
|
3431
|
+
_initClass$3();
|
|
3432
|
+
}
|
|
3433
|
+
};
|
|
3434
|
+
|
|
3435
|
+
//#endregion
|
|
3436
|
+
//#region src/factories/reply.factory.mts
|
|
3437
|
+
function applyDecs2203RFactory$2() {
|
|
3438
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
3439
|
+
return function addInitializer(initializer) {
|
|
3440
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
3441
|
+
assertCallable(initializer, "An initializer");
|
|
3442
|
+
initializers.push(initializer);
|
|
3443
|
+
};
|
|
3444
|
+
}
|
|
3445
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
3446
|
+
var kindStr;
|
|
3447
|
+
switch (kind) {
|
|
3448
|
+
case 1:
|
|
3449
|
+
kindStr = "accessor";
|
|
3450
|
+
break;
|
|
3451
|
+
case 2:
|
|
3452
|
+
kindStr = "method";
|
|
3453
|
+
break;
|
|
3454
|
+
case 3:
|
|
3455
|
+
kindStr = "getter";
|
|
3456
|
+
break;
|
|
3457
|
+
case 4:
|
|
3458
|
+
kindStr = "setter";
|
|
3459
|
+
break;
|
|
3460
|
+
default: kindStr = "field";
|
|
3461
|
+
}
|
|
3462
|
+
var ctx = {
|
|
3463
|
+
kind: kindStr,
|
|
3464
|
+
name: isPrivate ? "#" + name : name,
|
|
3465
|
+
static: isStatic,
|
|
3466
|
+
private: isPrivate,
|
|
3467
|
+
metadata
|
|
3468
|
+
};
|
|
3469
|
+
var decoratorFinishedRef = { v: false };
|
|
3470
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
3471
|
+
var get, set;
|
|
3472
|
+
if (kind === 0) if (isPrivate) {
|
|
3473
|
+
get = desc.get;
|
|
3474
|
+
set = desc.set;
|
|
3475
|
+
} else {
|
|
3476
|
+
get = function() {
|
|
3477
|
+
return this[name];
|
|
3478
|
+
};
|
|
3479
|
+
set = function(v) {
|
|
3480
|
+
this[name] = v;
|
|
3481
|
+
};
|
|
3482
|
+
}
|
|
3483
|
+
else if (kind === 2) get = function() {
|
|
3484
|
+
return desc.value;
|
|
3485
|
+
};
|
|
3486
|
+
else {
|
|
3487
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
3488
|
+
return desc.get.call(this);
|
|
3489
|
+
};
|
|
3490
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
3491
|
+
desc.set.call(this, v);
|
|
3492
|
+
};
|
|
3493
|
+
}
|
|
3494
|
+
ctx.access = get && set ? {
|
|
3495
|
+
get,
|
|
3496
|
+
set
|
|
3497
|
+
} : get ? { get } : { set };
|
|
3498
|
+
try {
|
|
3499
|
+
return dec(value, ctx);
|
|
3500
|
+
} finally {
|
|
3501
|
+
decoratorFinishedRef.v = true;
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
3505
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
3506
|
+
}
|
|
3507
|
+
function assertCallable(fn, hint) {
|
|
3508
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
3509
|
+
}
|
|
3510
|
+
function assertValidReturnValue(kind, value) {
|
|
3511
|
+
var type = typeof value;
|
|
3512
|
+
if (kind === 1) {
|
|
3513
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
3514
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
3515
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
3516
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
3517
|
+
} else if (type !== "function") {
|
|
3518
|
+
var hint;
|
|
3519
|
+
if (kind === 0) hint = "field";
|
|
3520
|
+
else if (kind === 10) hint = "class";
|
|
3521
|
+
else hint = "method";
|
|
3522
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
3526
|
+
var decs = decInfo[0];
|
|
3527
|
+
var desc, init, value;
|
|
3528
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
3529
|
+
get: decInfo[3],
|
|
3530
|
+
set: decInfo[4]
|
|
3531
|
+
};
|
|
3532
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
3533
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
3534
|
+
else desc = { value: decInfo[3] };
|
|
3535
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
3536
|
+
if (kind === 1) value = {
|
|
3537
|
+
get: desc.get,
|
|
3538
|
+
set: desc.set
|
|
3539
|
+
};
|
|
3540
|
+
else if (kind === 2) value = desc.value;
|
|
3541
|
+
else if (kind === 3) value = desc.get;
|
|
3542
|
+
else if (kind === 4) value = desc.set;
|
|
3543
|
+
var newValue, get, set;
|
|
3544
|
+
if (typeof decs === "function") {
|
|
3545
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3546
|
+
if (newValue !== void 0) {
|
|
3547
|
+
assertValidReturnValue(kind, newValue);
|
|
3548
|
+
if (kind === 0) init = newValue;
|
|
3549
|
+
else if (kind === 1) {
|
|
3550
|
+
init = newValue.init;
|
|
3551
|
+
get = newValue.get || value.get;
|
|
3552
|
+
set = newValue.set || value.set;
|
|
3553
|
+
value = {
|
|
3554
|
+
get,
|
|
3555
|
+
set
|
|
3556
|
+
};
|
|
3557
|
+
} else value = newValue;
|
|
3558
|
+
}
|
|
3559
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
3560
|
+
var dec = decs[i];
|
|
3561
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3562
|
+
if (newValue !== void 0) {
|
|
3563
|
+
assertValidReturnValue(kind, newValue);
|
|
3564
|
+
var newInit;
|
|
3565
|
+
if (kind === 0) newInit = newValue;
|
|
3566
|
+
else if (kind === 1) {
|
|
3567
|
+
newInit = newValue.init;
|
|
3568
|
+
get = newValue.get || value.get;
|
|
3569
|
+
set = newValue.set || value.set;
|
|
3570
|
+
value = {
|
|
3571
|
+
get,
|
|
3572
|
+
set
|
|
3573
|
+
};
|
|
3574
|
+
} else value = newValue;
|
|
3575
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
3576
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
3577
|
+
else init.push(newInit);
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
if (kind === 0 || kind === 1) {
|
|
3581
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
3582
|
+
return init$1;
|
|
3583
|
+
};
|
|
3584
|
+
else if (typeof init !== "function") {
|
|
3585
|
+
var ownInitializers = init;
|
|
3586
|
+
init = function(instance, init$1) {
|
|
3587
|
+
var value$1 = init$1;
|
|
3588
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
3589
|
+
return value$1;
|
|
3590
|
+
};
|
|
3591
|
+
} else {
|
|
3592
|
+
var originalInitializer = init;
|
|
3593
|
+
init = function(instance, init$1) {
|
|
3594
|
+
return originalInitializer.call(instance, init$1);
|
|
3595
|
+
};
|
|
3596
|
+
}
|
|
3597
|
+
ret.push(init);
|
|
3598
|
+
}
|
|
3599
|
+
if (kind !== 0) {
|
|
3600
|
+
if (kind === 1) {
|
|
3601
|
+
desc.get = value.get;
|
|
3602
|
+
desc.set = value.set;
|
|
3603
|
+
} else if (kind === 2) desc.value = value;
|
|
3604
|
+
else if (kind === 3) desc.get = value;
|
|
3605
|
+
else if (kind === 4) desc.set = value;
|
|
3606
|
+
if (isPrivate) if (kind === 1) {
|
|
3607
|
+
ret.push(function(instance, args) {
|
|
3608
|
+
return value.get.call(instance, args);
|
|
3609
|
+
});
|
|
3610
|
+
ret.push(function(instance, args) {
|
|
3611
|
+
return value.set.call(instance, args);
|
|
3612
|
+
});
|
|
3613
|
+
} else if (kind === 2) ret.push(value);
|
|
3614
|
+
else ret.push(function(instance, args) {
|
|
3615
|
+
return value.call(instance, args);
|
|
3616
|
+
});
|
|
3617
|
+
else Object.defineProperty(base, name, desc);
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
3621
|
+
var ret = [];
|
|
3622
|
+
var protoInitializers;
|
|
3623
|
+
var staticInitializers;
|
|
3624
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
3625
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
3626
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
3627
|
+
var decInfo = decInfos[i];
|
|
3628
|
+
if (!Array.isArray(decInfo)) continue;
|
|
3629
|
+
var kind = decInfo[1];
|
|
3630
|
+
var name = decInfo[2];
|
|
3631
|
+
var isPrivate = decInfo.length > 3;
|
|
3632
|
+
var isStatic = kind >= 5;
|
|
3633
|
+
var base;
|
|
3634
|
+
var initializers;
|
|
3635
|
+
if (isStatic) {
|
|
3636
|
+
base = Class;
|
|
3637
|
+
kind = kind - 5;
|
|
3638
|
+
staticInitializers = staticInitializers || [];
|
|
3639
|
+
initializers = staticInitializers;
|
|
3640
|
+
} else {
|
|
3641
|
+
base = Class.prototype;
|
|
3642
|
+
protoInitializers = protoInitializers || [];
|
|
3643
|
+
initializers = protoInitializers;
|
|
3644
|
+
}
|
|
3645
|
+
if (kind !== 0 && !isPrivate) {
|
|
3646
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
3647
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
3648
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
3649
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
3650
|
+
else existingNonFields.set(name, true);
|
|
3651
|
+
}
|
|
3652
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
3653
|
+
}
|
|
3654
|
+
pushInitializers(ret, protoInitializers);
|
|
3655
|
+
pushInitializers(ret, staticInitializers);
|
|
3656
|
+
return ret;
|
|
3657
|
+
}
|
|
3658
|
+
function pushInitializers(ret, initializers) {
|
|
3659
|
+
if (initializers) ret.push(function(instance) {
|
|
3660
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
3661
|
+
return instance;
|
|
3662
|
+
});
|
|
3663
|
+
}
|
|
3664
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
3665
|
+
if (classDecs.length > 0) {
|
|
3666
|
+
var initializers = [];
|
|
3667
|
+
var newClass = targetClass;
|
|
3668
|
+
var name = targetClass.name;
|
|
3669
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
3670
|
+
var decoratorFinishedRef = { v: false };
|
|
3671
|
+
try {
|
|
3672
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
3673
|
+
kind: "class",
|
|
3674
|
+
name,
|
|
3675
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
3676
|
+
metadata
|
|
3677
|
+
});
|
|
3678
|
+
} finally {
|
|
3679
|
+
decoratorFinishedRef.v = true;
|
|
3680
|
+
}
|
|
3681
|
+
if (nextNewClass !== void 0) {
|
|
3682
|
+
assertValidReturnValue(10, nextNewClass);
|
|
3683
|
+
newClass = nextNewClass;
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
3687
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
3688
|
+
}];
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
function defineMetadata(Class, metadata) {
|
|
3692
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
3693
|
+
configurable: true,
|
|
3694
|
+
enumerable: true,
|
|
3695
|
+
value: metadata
|
|
3696
|
+
});
|
|
3697
|
+
}
|
|
3698
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
3699
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
3700
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
3701
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
3702
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
3703
|
+
return {
|
|
3704
|
+
e,
|
|
3705
|
+
get c() {
|
|
3706
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
};
|
|
3710
|
+
}
|
|
3711
|
+
function _apply_decs_2203_r$2(targetClass, memberDecs, classDecs, parentClass) {
|
|
3712
|
+
return (_apply_decs_2203_r$2 = applyDecs2203RFactory$2())(targetClass, memberDecs, classDecs, parentClass);
|
|
3713
|
+
}
|
|
3714
|
+
var _dec$2, _initClass$2;
|
|
3715
|
+
let _ReplyFactory;
|
|
3716
|
+
_dec$2 = Factory({
|
|
3717
|
+
token: Reply,
|
|
3718
|
+
scope: InjectableScope.Request
|
|
3719
|
+
});
|
|
3720
|
+
var ReplyFactory = class {
|
|
3721
|
+
static {
|
|
3722
|
+
({c: [_ReplyFactory, _initClass$2]} = _apply_decs_2203_r$2(this, [], [_dec$2]));
|
|
3723
|
+
}
|
|
3724
|
+
environment = inject(_NaviosEnvironment);
|
|
3725
|
+
create(ctx) {
|
|
3726
|
+
const service = this.environment.getToken(Reply);
|
|
3727
|
+
if (!service) throw new Error("ReplyToken service not found in environment");
|
|
3728
|
+
return ctx.inject(service);
|
|
3729
|
+
}
|
|
3730
|
+
static {
|
|
3731
|
+
_initClass$2();
|
|
3732
|
+
}
|
|
3733
|
+
};
|
|
3734
|
+
|
|
3735
|
+
//#endregion
|
|
3736
|
+
//#region src/factories/stream-adapter.factory.mts
|
|
3737
|
+
function applyDecs2203RFactory$1() {
|
|
3738
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
3739
|
+
return function addInitializer(initializer) {
|
|
3740
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
3741
|
+
assertCallable(initializer, "An initializer");
|
|
3742
|
+
initializers.push(initializer);
|
|
3743
|
+
};
|
|
3744
|
+
}
|
|
3745
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
3746
|
+
var kindStr;
|
|
3747
|
+
switch (kind) {
|
|
3748
|
+
case 1:
|
|
3749
|
+
kindStr = "accessor";
|
|
3750
|
+
break;
|
|
3751
|
+
case 2:
|
|
3752
|
+
kindStr = "method";
|
|
3753
|
+
break;
|
|
3754
|
+
case 3:
|
|
3755
|
+
kindStr = "getter";
|
|
3756
|
+
break;
|
|
3757
|
+
case 4:
|
|
3758
|
+
kindStr = "setter";
|
|
3759
|
+
break;
|
|
3760
|
+
default: kindStr = "field";
|
|
3761
|
+
}
|
|
3762
|
+
var ctx = {
|
|
3763
|
+
kind: kindStr,
|
|
3764
|
+
name: isPrivate ? "#" + name : name,
|
|
3765
|
+
static: isStatic,
|
|
3766
|
+
private: isPrivate,
|
|
3767
|
+
metadata
|
|
3768
|
+
};
|
|
3769
|
+
var decoratorFinishedRef = { v: false };
|
|
3770
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
3771
|
+
var get, set;
|
|
3772
|
+
if (kind === 0) if (isPrivate) {
|
|
3773
|
+
get = desc.get;
|
|
3774
|
+
set = desc.set;
|
|
3775
|
+
} else {
|
|
3776
|
+
get = function() {
|
|
3777
|
+
return this[name];
|
|
3778
|
+
};
|
|
3779
|
+
set = function(v) {
|
|
3780
|
+
this[name] = v;
|
|
3781
|
+
};
|
|
3782
|
+
}
|
|
3783
|
+
else if (kind === 2) get = function() {
|
|
3784
|
+
return desc.value;
|
|
3785
|
+
};
|
|
3786
|
+
else {
|
|
3787
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
3788
|
+
return desc.get.call(this);
|
|
3789
|
+
};
|
|
3790
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
3791
|
+
desc.set.call(this, v);
|
|
3792
|
+
};
|
|
3793
|
+
}
|
|
3794
|
+
ctx.access = get && set ? {
|
|
3795
|
+
get,
|
|
3796
|
+
set
|
|
3797
|
+
} : get ? { get } : { set };
|
|
3798
|
+
try {
|
|
3799
|
+
return dec(value, ctx);
|
|
3800
|
+
} finally {
|
|
3801
|
+
decoratorFinishedRef.v = true;
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
3805
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
3806
|
+
}
|
|
3807
|
+
function assertCallable(fn, hint) {
|
|
3808
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
3809
|
+
}
|
|
3810
|
+
function assertValidReturnValue(kind, value) {
|
|
3811
|
+
var type = typeof value;
|
|
3812
|
+
if (kind === 1) {
|
|
3813
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
3814
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
3815
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
3816
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
3817
|
+
} else if (type !== "function") {
|
|
3818
|
+
var hint;
|
|
3819
|
+
if (kind === 0) hint = "field";
|
|
3820
|
+
else if (kind === 10) hint = "class";
|
|
3821
|
+
else hint = "method";
|
|
3822
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
3823
|
+
}
|
|
3824
|
+
}
|
|
3825
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
3826
|
+
var decs = decInfo[0];
|
|
3827
|
+
var desc, init, value;
|
|
3828
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
3829
|
+
get: decInfo[3],
|
|
3830
|
+
set: decInfo[4]
|
|
3831
|
+
};
|
|
3832
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
3833
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
3834
|
+
else desc = { value: decInfo[3] };
|
|
3835
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
3836
|
+
if (kind === 1) value = {
|
|
3837
|
+
get: desc.get,
|
|
3838
|
+
set: desc.set
|
|
3839
|
+
};
|
|
3840
|
+
else if (kind === 2) value = desc.value;
|
|
3841
|
+
else if (kind === 3) value = desc.get;
|
|
3842
|
+
else if (kind === 4) value = desc.set;
|
|
3843
|
+
var newValue, get, set;
|
|
3844
|
+
if (typeof decs === "function") {
|
|
3845
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3846
|
+
if (newValue !== void 0) {
|
|
3847
|
+
assertValidReturnValue(kind, newValue);
|
|
3848
|
+
if (kind === 0) init = newValue;
|
|
3849
|
+
else if (kind === 1) {
|
|
3850
|
+
init = newValue.init;
|
|
3851
|
+
get = newValue.get || value.get;
|
|
3852
|
+
set = newValue.set || value.set;
|
|
3853
|
+
value = {
|
|
3854
|
+
get,
|
|
3855
|
+
set
|
|
3856
|
+
};
|
|
3857
|
+
} else value = newValue;
|
|
3858
|
+
}
|
|
3859
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
3860
|
+
var dec = decs[i];
|
|
3861
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3862
|
+
if (newValue !== void 0) {
|
|
3863
|
+
assertValidReturnValue(kind, newValue);
|
|
3864
|
+
var newInit;
|
|
3865
|
+
if (kind === 0) newInit = newValue;
|
|
3866
|
+
else if (kind === 1) {
|
|
3867
|
+
newInit = newValue.init;
|
|
3868
|
+
get = newValue.get || value.get;
|
|
3869
|
+
set = newValue.set || value.set;
|
|
3870
|
+
value = {
|
|
3871
|
+
get,
|
|
3872
|
+
set
|
|
3873
|
+
};
|
|
3874
|
+
} else value = newValue;
|
|
3875
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
3876
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
3877
|
+
else init.push(newInit);
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
if (kind === 0 || kind === 1) {
|
|
3881
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
3882
|
+
return init$1;
|
|
3883
|
+
};
|
|
3884
|
+
else if (typeof init !== "function") {
|
|
3885
|
+
var ownInitializers = init;
|
|
3886
|
+
init = function(instance, init$1) {
|
|
3887
|
+
var value$1 = init$1;
|
|
3888
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
3889
|
+
return value$1;
|
|
3890
|
+
};
|
|
3891
|
+
} else {
|
|
3892
|
+
var originalInitializer = init;
|
|
3893
|
+
init = function(instance, init$1) {
|
|
3894
|
+
return originalInitializer.call(instance, init$1);
|
|
3895
|
+
};
|
|
3896
|
+
}
|
|
3897
|
+
ret.push(init);
|
|
3898
|
+
}
|
|
3899
|
+
if (kind !== 0) {
|
|
3900
|
+
if (kind === 1) {
|
|
3901
|
+
desc.get = value.get;
|
|
3902
|
+
desc.set = value.set;
|
|
3903
|
+
} else if (kind === 2) desc.value = value;
|
|
3904
|
+
else if (kind === 3) desc.get = value;
|
|
3905
|
+
else if (kind === 4) desc.set = value;
|
|
3906
|
+
if (isPrivate) if (kind === 1) {
|
|
3907
|
+
ret.push(function(instance, args) {
|
|
3908
|
+
return value.get.call(instance, args);
|
|
3909
|
+
});
|
|
3910
|
+
ret.push(function(instance, args) {
|
|
3911
|
+
return value.set.call(instance, args);
|
|
3912
|
+
});
|
|
3913
|
+
} else if (kind === 2) ret.push(value);
|
|
3914
|
+
else ret.push(function(instance, args) {
|
|
3915
|
+
return value.call(instance, args);
|
|
3916
|
+
});
|
|
3917
|
+
else Object.defineProperty(base, name, desc);
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
3921
|
+
var ret = [];
|
|
3922
|
+
var protoInitializers;
|
|
3923
|
+
var staticInitializers;
|
|
3924
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
3925
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
3926
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
3927
|
+
var decInfo = decInfos[i];
|
|
3928
|
+
if (!Array.isArray(decInfo)) continue;
|
|
3929
|
+
var kind = decInfo[1];
|
|
3930
|
+
var name = decInfo[2];
|
|
3931
|
+
var isPrivate = decInfo.length > 3;
|
|
3932
|
+
var isStatic = kind >= 5;
|
|
3933
|
+
var base;
|
|
3934
|
+
var initializers;
|
|
3935
|
+
if (isStatic) {
|
|
3936
|
+
base = Class;
|
|
3937
|
+
kind = kind - 5;
|
|
3938
|
+
staticInitializers = staticInitializers || [];
|
|
3939
|
+
initializers = staticInitializers;
|
|
3940
|
+
} else {
|
|
3941
|
+
base = Class.prototype;
|
|
3942
|
+
protoInitializers = protoInitializers || [];
|
|
3943
|
+
initializers = protoInitializers;
|
|
3944
|
+
}
|
|
3945
|
+
if (kind !== 0 && !isPrivate) {
|
|
3946
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
3947
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
3948
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
3949
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
3950
|
+
else existingNonFields.set(name, true);
|
|
3951
|
+
}
|
|
3952
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
3953
|
+
}
|
|
3954
|
+
pushInitializers(ret, protoInitializers);
|
|
3955
|
+
pushInitializers(ret, staticInitializers);
|
|
3956
|
+
return ret;
|
|
3957
|
+
}
|
|
3958
|
+
function pushInitializers(ret, initializers) {
|
|
3959
|
+
if (initializers) ret.push(function(instance) {
|
|
3960
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
3961
|
+
return instance;
|
|
3962
|
+
});
|
|
3963
|
+
}
|
|
3964
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
3965
|
+
if (classDecs.length > 0) {
|
|
3966
|
+
var initializers = [];
|
|
3967
|
+
var newClass = targetClass;
|
|
3968
|
+
var name = targetClass.name;
|
|
3969
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
3970
|
+
var decoratorFinishedRef = { v: false };
|
|
3971
|
+
try {
|
|
3972
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
3973
|
+
kind: "class",
|
|
3974
|
+
name,
|
|
3975
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
3976
|
+
metadata
|
|
3977
|
+
});
|
|
3978
|
+
} finally {
|
|
3979
|
+
decoratorFinishedRef.v = true;
|
|
3980
|
+
}
|
|
3981
|
+
if (nextNewClass !== void 0) {
|
|
3982
|
+
assertValidReturnValue(10, nextNewClass);
|
|
3983
|
+
newClass = nextNewClass;
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
3987
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
3988
|
+
}];
|
|
3989
|
+
}
|
|
3990
|
+
}
|
|
3991
|
+
function defineMetadata(Class, metadata) {
|
|
3992
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
3993
|
+
configurable: true,
|
|
3994
|
+
enumerable: true,
|
|
3995
|
+
value: metadata
|
|
3996
|
+
});
|
|
3997
|
+
}
|
|
3998
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
3999
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
4000
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
4001
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
4002
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
4003
|
+
return {
|
|
4004
|
+
e,
|
|
4005
|
+
get c() {
|
|
4006
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
4007
|
+
}
|
|
4008
|
+
};
|
|
4009
|
+
};
|
|
4010
|
+
}
|
|
4011
|
+
function _apply_decs_2203_r$1(targetClass, memberDecs, classDecs, parentClass) {
|
|
4012
|
+
return (_apply_decs_2203_r$1 = applyDecs2203RFactory$1())(targetClass, memberDecs, classDecs, parentClass);
|
|
4013
|
+
}
|
|
4014
|
+
var _dec$1, _initClass$1;
|
|
4015
|
+
let _StreamAdapterFactory;
|
|
4016
|
+
_dec$1 = Factory({ token: StreamAdapterToken });
|
|
4017
|
+
var StreamAdapterFactory = class {
|
|
4018
|
+
static {
|
|
4019
|
+
({c: [_StreamAdapterFactory, _initClass$1]} = _apply_decs_2203_r$1(this, [], [_dec$1]));
|
|
4020
|
+
}
|
|
4021
|
+
environment = inject(_NaviosEnvironment);
|
|
4022
|
+
create(ctx) {
|
|
4023
|
+
const service = this.environment.getToken(StreamAdapterToken);
|
|
4024
|
+
if (!service) throw new Error("StreamAdapterToken service not found in environment");
|
|
4025
|
+
return ctx.inject(service);
|
|
4026
|
+
}
|
|
4027
|
+
static {
|
|
4028
|
+
_initClass$1();
|
|
4029
|
+
}
|
|
4030
|
+
};
|
|
4031
|
+
|
|
4032
|
+
//#endregion
|
|
4033
|
+
//#region src/factories/xml-stream-adapter.factory.mts
|
|
4034
|
+
function applyDecs2203RFactory() {
|
|
4035
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
4036
|
+
return function addInitializer(initializer) {
|
|
4037
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
4038
|
+
assertCallable(initializer, "An initializer");
|
|
4039
|
+
initializers.push(initializer);
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
4043
|
+
var kindStr;
|
|
4044
|
+
switch (kind) {
|
|
4045
|
+
case 1:
|
|
4046
|
+
kindStr = "accessor";
|
|
4047
|
+
break;
|
|
4048
|
+
case 2:
|
|
4049
|
+
kindStr = "method";
|
|
4050
|
+
break;
|
|
4051
|
+
case 3:
|
|
4052
|
+
kindStr = "getter";
|
|
4053
|
+
break;
|
|
4054
|
+
case 4:
|
|
4055
|
+
kindStr = "setter";
|
|
4056
|
+
break;
|
|
4057
|
+
default: kindStr = "field";
|
|
4058
|
+
}
|
|
4059
|
+
var ctx = {
|
|
4060
|
+
kind: kindStr,
|
|
4061
|
+
name: isPrivate ? "#" + name : name,
|
|
4062
|
+
static: isStatic,
|
|
4063
|
+
private: isPrivate,
|
|
4064
|
+
metadata
|
|
4065
|
+
};
|
|
4066
|
+
var decoratorFinishedRef = { v: false };
|
|
4067
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
4068
|
+
var get, set;
|
|
4069
|
+
if (kind === 0) if (isPrivate) {
|
|
4070
|
+
get = desc.get;
|
|
4071
|
+
set = desc.set;
|
|
4072
|
+
} else {
|
|
4073
|
+
get = function() {
|
|
4074
|
+
return this[name];
|
|
4075
|
+
};
|
|
4076
|
+
set = function(v) {
|
|
4077
|
+
this[name] = v;
|
|
4078
|
+
};
|
|
4079
|
+
}
|
|
4080
|
+
else if (kind === 2) get = function() {
|
|
4081
|
+
return desc.value;
|
|
4082
|
+
};
|
|
4083
|
+
else {
|
|
4084
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
4085
|
+
return desc.get.call(this);
|
|
4086
|
+
};
|
|
4087
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
4088
|
+
desc.set.call(this, v);
|
|
4089
|
+
};
|
|
4090
|
+
}
|
|
4091
|
+
ctx.access = get && set ? {
|
|
4092
|
+
get,
|
|
4093
|
+
set
|
|
4094
|
+
} : get ? { get } : { set };
|
|
4095
|
+
try {
|
|
4096
|
+
return dec(value, ctx);
|
|
4097
|
+
} finally {
|
|
4098
|
+
decoratorFinishedRef.v = true;
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4101
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
4102
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
4103
|
+
}
|
|
4104
|
+
function assertCallable(fn, hint) {
|
|
4105
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
4106
|
+
}
|
|
4107
|
+
function assertValidReturnValue(kind, value) {
|
|
4108
|
+
var type = typeof value;
|
|
4109
|
+
if (kind === 1) {
|
|
4110
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
4111
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
4112
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
4113
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
4114
|
+
} else if (type !== "function") {
|
|
4115
|
+
var hint;
|
|
4116
|
+
if (kind === 0) hint = "field";
|
|
4117
|
+
else if (kind === 10) hint = "class";
|
|
4118
|
+
else hint = "method";
|
|
4119
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
4123
|
+
var decs = decInfo[0];
|
|
4124
|
+
var desc, init, value;
|
|
4125
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
4126
|
+
get: decInfo[3],
|
|
4127
|
+
set: decInfo[4]
|
|
4128
|
+
};
|
|
4129
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
4130
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
4131
|
+
else desc = { value: decInfo[3] };
|
|
4132
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
4133
|
+
if (kind === 1) value = {
|
|
4134
|
+
get: desc.get,
|
|
4135
|
+
set: desc.set
|
|
4136
|
+
};
|
|
4137
|
+
else if (kind === 2) value = desc.value;
|
|
4138
|
+
else if (kind === 3) value = desc.get;
|
|
4139
|
+
else if (kind === 4) value = desc.set;
|
|
4140
|
+
var newValue, get, set;
|
|
4141
|
+
if (typeof decs === "function") {
|
|
4142
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
4143
|
+
if (newValue !== void 0) {
|
|
4144
|
+
assertValidReturnValue(kind, newValue);
|
|
4145
|
+
if (kind === 0) init = newValue;
|
|
4146
|
+
else if (kind === 1) {
|
|
4147
|
+
init = newValue.init;
|
|
4148
|
+
get = newValue.get || value.get;
|
|
4149
|
+
set = newValue.set || value.set;
|
|
4150
|
+
value = {
|
|
4151
|
+
get,
|
|
4152
|
+
set
|
|
4153
|
+
};
|
|
4154
|
+
} else value = newValue;
|
|
4155
|
+
}
|
|
4156
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
4157
|
+
var dec = decs[i];
|
|
4158
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
4159
|
+
if (newValue !== void 0) {
|
|
4160
|
+
assertValidReturnValue(kind, newValue);
|
|
4161
|
+
var newInit;
|
|
4162
|
+
if (kind === 0) newInit = newValue;
|
|
4163
|
+
else if (kind === 1) {
|
|
4164
|
+
newInit = newValue.init;
|
|
4165
|
+
get = newValue.get || value.get;
|
|
4166
|
+
set = newValue.set || value.set;
|
|
4167
|
+
value = {
|
|
4168
|
+
get,
|
|
4169
|
+
set
|
|
4170
|
+
};
|
|
4171
|
+
} else value = newValue;
|
|
4172
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
4173
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
4174
|
+
else init.push(newInit);
|
|
4175
|
+
}
|
|
4176
|
+
}
|
|
4177
|
+
if (kind === 0 || kind === 1) {
|
|
4178
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
4179
|
+
return init$1;
|
|
4180
|
+
};
|
|
4181
|
+
else if (typeof init !== "function") {
|
|
4182
|
+
var ownInitializers = init;
|
|
4183
|
+
init = function(instance, init$1) {
|
|
4184
|
+
var value$1 = init$1;
|
|
4185
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
4186
|
+
return value$1;
|
|
4187
|
+
};
|
|
4188
|
+
} else {
|
|
4189
|
+
var originalInitializer = init;
|
|
4190
|
+
init = function(instance, init$1) {
|
|
4191
|
+
return originalInitializer.call(instance, init$1);
|
|
4192
|
+
};
|
|
4193
|
+
}
|
|
4194
|
+
ret.push(init);
|
|
4195
|
+
}
|
|
4196
|
+
if (kind !== 0) {
|
|
4197
|
+
if (kind === 1) {
|
|
4198
|
+
desc.get = value.get;
|
|
4199
|
+
desc.set = value.set;
|
|
4200
|
+
} else if (kind === 2) desc.value = value;
|
|
4201
|
+
else if (kind === 3) desc.get = value;
|
|
4202
|
+
else if (kind === 4) desc.set = value;
|
|
4203
|
+
if (isPrivate) if (kind === 1) {
|
|
4204
|
+
ret.push(function(instance, args) {
|
|
4205
|
+
return value.get.call(instance, args);
|
|
4206
|
+
});
|
|
4207
|
+
ret.push(function(instance, args) {
|
|
4208
|
+
return value.set.call(instance, args);
|
|
4209
|
+
});
|
|
4210
|
+
} else if (kind === 2) ret.push(value);
|
|
4211
|
+
else ret.push(function(instance, args) {
|
|
4212
|
+
return value.call(instance, args);
|
|
4213
|
+
});
|
|
4214
|
+
else Object.defineProperty(base, name, desc);
|
|
4215
|
+
}
|
|
4216
|
+
}
|
|
4217
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
4218
|
+
var ret = [];
|
|
4219
|
+
var protoInitializers;
|
|
4220
|
+
var staticInitializers;
|
|
4221
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
4222
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
4223
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
4224
|
+
var decInfo = decInfos[i];
|
|
4225
|
+
if (!Array.isArray(decInfo)) continue;
|
|
4226
|
+
var kind = decInfo[1];
|
|
4227
|
+
var name = decInfo[2];
|
|
4228
|
+
var isPrivate = decInfo.length > 3;
|
|
4229
|
+
var isStatic = kind >= 5;
|
|
4230
|
+
var base;
|
|
4231
|
+
var initializers;
|
|
4232
|
+
if (isStatic) {
|
|
4233
|
+
base = Class;
|
|
4234
|
+
kind = kind - 5;
|
|
4235
|
+
staticInitializers = staticInitializers || [];
|
|
4236
|
+
initializers = staticInitializers;
|
|
4237
|
+
} else {
|
|
4238
|
+
base = Class.prototype;
|
|
4239
|
+
protoInitializers = protoInitializers || [];
|
|
4240
|
+
initializers = protoInitializers;
|
|
4241
|
+
}
|
|
4242
|
+
if (kind !== 0 && !isPrivate) {
|
|
4243
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
4244
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
4245
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
4246
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
4247
|
+
else existingNonFields.set(name, true);
|
|
4248
|
+
}
|
|
4249
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
4250
|
+
}
|
|
4251
|
+
pushInitializers(ret, protoInitializers);
|
|
4252
|
+
pushInitializers(ret, staticInitializers);
|
|
4253
|
+
return ret;
|
|
4254
|
+
}
|
|
4255
|
+
function pushInitializers(ret, initializers) {
|
|
4256
|
+
if (initializers) ret.push(function(instance) {
|
|
4257
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
4258
|
+
return instance;
|
|
4259
|
+
});
|
|
4260
|
+
}
|
|
4261
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
4262
|
+
if (classDecs.length > 0) {
|
|
4263
|
+
var initializers = [];
|
|
4264
|
+
var newClass = targetClass;
|
|
4265
|
+
var name = targetClass.name;
|
|
4266
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
4267
|
+
var decoratorFinishedRef = { v: false };
|
|
4268
|
+
try {
|
|
4269
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
4270
|
+
kind: "class",
|
|
4271
|
+
name,
|
|
4272
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
4273
|
+
metadata
|
|
4274
|
+
});
|
|
4275
|
+
} finally {
|
|
4276
|
+
decoratorFinishedRef.v = true;
|
|
4277
|
+
}
|
|
4278
|
+
if (nextNewClass !== void 0) {
|
|
4279
|
+
assertValidReturnValue(10, nextNewClass);
|
|
4280
|
+
newClass = nextNewClass;
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
4284
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
4285
|
+
}];
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
function defineMetadata(Class, metadata) {
|
|
4289
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
4290
|
+
configurable: true,
|
|
4291
|
+
enumerable: true,
|
|
4292
|
+
value: metadata
|
|
4293
|
+
});
|
|
4294
|
+
}
|
|
4295
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
4296
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
4297
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
4298
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
4299
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
4300
|
+
return {
|
|
4301
|
+
e,
|
|
4302
|
+
get c() {
|
|
4303
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
4304
|
+
}
|
|
4305
|
+
};
|
|
4306
|
+
};
|
|
4307
|
+
}
|
|
4308
|
+
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
4309
|
+
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
4310
|
+
}
|
|
4311
|
+
var _dec, _initClass;
|
|
4312
|
+
let _XmlStreamAdapterFactory;
|
|
4313
|
+
_dec = Factory({ token: XmlStreamAdapterToken });
|
|
4314
|
+
var XmlStreamAdapterFactory = class {
|
|
4315
|
+
static {
|
|
4316
|
+
({c: [_XmlStreamAdapterFactory, _initClass]} = _apply_decs_2203_r(this, [], [_dec]));
|
|
4317
|
+
}
|
|
4318
|
+
environment = inject(_NaviosEnvironment);
|
|
4319
|
+
create(ctx) {
|
|
4320
|
+
const service = this.environment.getToken(XmlStreamAdapterToken);
|
|
4321
|
+
if (!service) throw new Error("XmlStreamAdapterToken service not found in environment");
|
|
4322
|
+
return ctx.inject(service);
|
|
4323
|
+
}
|
|
4324
|
+
static {
|
|
4325
|
+
_initClass();
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
|
|
4329
|
+
//#endregion
|
|
4330
|
+
export { AbstractHandlerAdapterService, _AdapterFactory as AdapterFactory, AdapterToken, AttributeFactory, BadRequestException, ConfigProviderOptions, _ConfigService as ConfigService, ConfigServiceOptionsSchema, ConfigServiceToken, ConflictException, _ConsoleLogger as ConsoleLogger, Controller, ControllerMetadataKey, ControllerResolverService, Endpoint, _EndpointAdapterFactory as EndpointAdapterFactory, EndpointAdapterToken, EndpointMetadataKey, EnvConfigProvider, _ErrorResponseProducerService as ErrorResponseProducerService, ExecutionContext, ExecutionContextInjectionToken, ForbiddenException, _ForbiddenResponderService as ForbiddenResponderService, ForbiddenResponderToken, FrameworkError, _GuardRunnerService as GuardRunnerService, Header, _HttpAdapterFactory as HttpAdapterFactory, HttpAdapterToken, HttpCode, HttpException, _InstanceResolverService as InstanceResolverService, InternalServerErrorException, _InternalServerErrorResponderService as InternalServerErrorResponderService, InternalServerErrorResponderToken, LOG_LEVELS, Logger, _LoggerInstance as LoggerInstance, LoggerOutput, Module, _ModuleLoaderService as ModuleLoaderService, ModuleMetadataKey, Multipart, _MultipartAdapterFactory as MultipartAdapterFactory, MultipartAdapterToken, _NaviosApplication as NaviosApplication, NaviosFactory, NaviosManagedMetadataKey, NaviosOptionsToken, NotFoundException, _NotFoundResponderService as NotFoundResponderService, NotFoundResponderToken, Reply, _ReplyFactory as ReplyFactory, Request, _RequestFactory as RequestFactory, Stream, _StreamAdapterFactory as StreamAdapterFactory, StreamAdapterToken, UnauthorizedException, UseGuards, _ValidationErrorResponderService as ValidationErrorResponderService, ValidationErrorResponderToken, _XmlStreamAdapterFactory as XmlStreamAdapterFactory, XmlStreamAdapterToken, adapterSupports, addLeadingSlash, assertAdapterSupports, clc, envInt, envString, extractControllerMetadata, extractModuleMetadata, filterLogLevels, generateRequestId, getAllEndpointMetadata, getControllerMetadata, getEndpointMetadata, getManagedMetadata, getModuleCustomEntry, getModuleMetadata, getRequestId, hasControllerMetadata, hasManagedMetadata, hasModuleMetadata, isConstructor, isEmpty, isFunction, isLogLevel, isLogLevelEnabled, isNil, isNumber, isObject, isPlainObject, isString, isSymbol, isUndefined, loggerOptionsSchema, normalizePath, provideConfig, runWithRequestId, setRequestIdEnabled, stripEndSlash, yellow };
|
|
4331
|
+
//# sourceMappingURL=index.mjs.map
|