@xrystal/core 3.51.6 → 3.52.1
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/README.md +35 -1
- package/package.json +2 -1
- package/x/bin/commands/create.mjs +44 -0
- package/x/bin/commands/projects.mjs +53 -0
- package/x/bin/commands/sync.mjs +49 -1
- package/x/bin/commands/tmp.mjs +1 -1
- package/x/bin/helpers/.generated/.generated-from +2 -0
- package/x/bin/helpers/.generated/seed-from-tmp.mjs +25 -31
- package/x/bin/helpers/.generated/tmp-schema.mjs +156 -96
- package/x/bin/helpers/.generated/workspace.mjs +402 -0
- package/x/bin/helpers/.generated/xrystal-home-registry.mjs +310 -0
- package/x/bin/helpers/build-config.mjs +3 -2
- package/x/bin/helpers/cli-help.mjs +3 -1
- package/x/bin/helpers/project-artifacts.mjs +10 -0
- package/x/bin/helpers/tmp-config.mjs +13 -12
- package/x/bin/helpers/tmp-layout.mjs +28 -52
- package/x/bin/helpers/tmp-schema.mjs +9 -3
- package/x/bin/helpers/workspace-resolve.mjs +11 -0
- package/x/bin/helpers/workspace-scaffold.mjs +23 -0
- package/x/bin/helpers/xrystal-registry.mjs +13 -0
- package/x/bin/main-cli.js +2 -0
- package/x/dist/index.js +5 -1
- package/x/dist/loader/clients/index.js +22 -1
- package/x/dist/loader/configs/index.js +97 -1
- package/x/dist/loader/controller/index.js +267 -1
- package/x/dist/loader/dto/index.js +92 -1
- package/x/dist/loader/events/index.js +39 -1
- package/x/dist/loader/index.js +13 -1
- package/x/dist/loader/kafka/index.js +142 -1
- package/x/dist/loader/kafka/resolve-ssl.js +23 -1
- package/x/dist/loader/localizations/index.js +46 -1
- package/x/dist/loader/logger/index.js +229 -2
- package/x/dist/loader/mongo/index.js +52 -1
- package/x/dist/loader/mongo/resolve-connect.js +16 -1
- package/x/dist/loader/redis/index.js +57 -1
- package/x/dist/loader/redis/resolve-socket.js +31 -1
- package/x/dist/loader/registry/index.js +1 -1
- package/x/dist/loader/service/index.js +7 -1
- package/x/dist/loader/system/index.js +26 -1
- package/x/dist/project/index.js +51 -1
- package/x/dist/utils/constants/defaults.json +3 -1
- package/x/dist/utils/constants/index.d.ts +1 -0
- package/x/dist/utils/constants/index.js +42 -1
- package/x/dist/utils/constants/package-root.js +6 -1
- package/x/dist/utils/helpers/configs/index.js +1 -1
- package/x/dist/utils/helpers/context/controller-store.js +12 -1
- package/x/dist/utils/helpers/context/index.js +24 -1
- package/x/dist/utils/helpers/core/handlebars-resolve.js +15 -1
- package/x/dist/utils/helpers/core/index.js +46 -1
- package/x/dist/utils/helpers/core/paths.js +78 -1
- package/x/dist/utils/helpers/core/tmp-layout.d.ts +4 -4
- package/x/dist/utils/helpers/core/tmp-layout.js +229 -1
- package/x/dist/utils/helpers/date/index.js +48 -1
- package/x/dist/utils/helpers/dispatch/index.js +53 -1
- package/x/dist/utils/helpers/dto/index.js +10 -1
- package/x/dist/utils/helpers/filters/index.js +44 -1
- package/x/dist/utils/helpers/framework/index.js +18 -1
- package/x/dist/utils/helpers/handlers/adapters.js +41 -1
- package/x/dist/utils/helpers/handlers/execute.js +82 -1
- package/x/dist/utils/helpers/handlers/index.js +31 -1
- package/x/dist/utils/helpers/hash/crypto.js +22 -1
- package/x/dist/utils/helpers/id/index.js +24 -1
- package/x/dist/utils/helpers/index.d.ts +1 -0
- package/x/dist/utils/helpers/index.js +28 -1
- package/x/dist/utils/helpers/ip/index.js +21 -1
- package/x/dist/utils/helpers/is/index.js +35 -1
- package/x/dist/utils/helpers/kafka-loader-options/index.js +14 -1
- package/x/dist/utils/helpers/locales/index.js +82 -1
- package/x/dist/utils/helpers/logger-layer/index.js +33 -1
- package/x/dist/utils/helpers/math/index.js +14 -1
- package/x/dist/utils/helpers/middleware/index.js +36 -1
- package/x/dist/utils/helpers/node-env/index.js +20 -1
- package/x/dist/utils/helpers/objects/index.js +55 -1
- package/x/dist/utils/helpers/path/index.js +5 -1
- package/x/dist/utils/helpers/path/resolve-alias-path.d.ts +1 -1
- package/x/dist/utils/helpers/path/resolve-alias-path.js +62 -1
- package/x/dist/utils/helpers/protocol/index.d.ts +1 -1
- package/x/dist/utils/helpers/protocol/index.js +100 -1
- package/x/dist/utils/helpers/protocol/options.js +13 -1
- package/x/dist/utils/helpers/regex/checkSpecialRegexControl.js +3 -1
- package/x/dist/utils/helpers/registry/index.js +103 -1
- package/x/dist/utils/helpers/runtime/dto-access.js +5 -1
- package/x/dist/utils/helpers/runtime/dto-types.js +1 -1
- package/x/dist/utils/helpers/runtime/index.js +2 -1
- package/x/dist/utils/helpers/runtime/shutdown.js +36 -1
- package/x/dist/utils/helpers/state/index.js +185 -1
- package/x/dist/utils/helpers/state/props-from-tmp.js +46 -1
- package/x/dist/utils/helpers/state/request-key-guard.js +43 -1
- package/x/dist/utils/helpers/state/scopes.js +69 -1
- package/x/dist/utils/helpers/string/index.js +9 -1
- package/x/dist/utils/helpers/timer/index.js +5 -1
- package/x/dist/utils/helpers/tmp/index.d.ts +2 -2
- package/x/dist/utils/helpers/tmp/index.js +8 -1
- package/x/dist/utils/helpers/tmp/loader-tmp-sync.js +14 -1
- package/x/dist/utils/helpers/tmp/path-normalize.js +27 -1
- package/x/dist/utils/helpers/tmp/runtime-tmp.js +42 -1
- package/x/dist/utils/helpers/tmp/seed-from-tmp.d.ts +2 -2
- package/x/dist/utils/helpers/tmp/seed-from-tmp.js +62 -1
- package/x/dist/utils/helpers/tmp/tmp-interpolate.js +22 -1
- package/x/dist/utils/helpers/tmp/tmp-loader.js +56 -1
- package/x/dist/utils/helpers/tmp/tmp-schema.d.ts +35 -23
- package/x/dist/utils/helpers/tmp/tmp-schema.js +211 -1
- package/x/dist/utils/helpers/tmp/tmp-watch.js +23 -1
- package/x/dist/utils/helpers/tmp/toolchain-heal.js +157 -2
- package/x/dist/utils/helpers/validates/index.js +20 -1
- package/x/dist/utils/helpers/workspace/index.d.ts +42 -0
- package/x/dist/utils/helpers/workspace/index.js +222 -0
- package/x/dist/utils/helpers/xrystal-home/registry.d.ts +32 -0
- package/x/dist/utils/helpers/xrystal-home/registry.js +92 -0
- package/x/dist/utils/index.js +3 -1
- package/x/dist/utils/models/classes/class.clients.js +142 -1
- package/x/dist/utils/models/classes/class.interfaces.js +10 -1
- package/x/dist/utils/models/classes/class.service-locator.js +16 -1
- package/x/dist/utils/models/classes/class.tmp-file-loader.js +61 -1
- package/x/dist/utils/models/classes/class.x.js +181 -1
- package/x/dist/utils/models/enums/index.d.ts +9 -1
- package/x/dist/utils/models/enums/index.js +169 -1
- package/x/dist/utils/models/index.js +9 -1
- package/x/dist/utils/models/types/index.js +2 -1
- package/x/templates/api-service/tmp.yml +59 -0
- package/x/tmp.yml +7 -50
|
@@ -1 +1,181 @@
|
|
|
1
|
-
|
|
1
|
+
import { createContainer, asClass, asValue, InjectionMode, listModules, Lifetime } from 'awilix';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import defaults from '../../../utils/constants/defaults.json' with { type: 'json' };
|
|
5
|
+
export const xSymbol = Symbol.for(`${defaults.packageName}/di-container`);
|
|
6
|
+
class X {
|
|
7
|
+
checkRegistration(container, name) {
|
|
8
|
+
return !!container.registrations[name];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class DIM extends X {
|
|
12
|
+
container;
|
|
13
|
+
initializedNames = new Set();
|
|
14
|
+
loadedPaths = new Set();
|
|
15
|
+
registeredClasses = new Set();
|
|
16
|
+
isInitializing = false;
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.container = createContainer({
|
|
20
|
+
injectionMode: InjectionMode.PROXY,
|
|
21
|
+
strict: true
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getName(target) {
|
|
25
|
+
if (typeof target === 'string')
|
|
26
|
+
return target.charAt(0).toLowerCase() + target.slice(1);
|
|
27
|
+
if (typeof target === 'function' && target.name)
|
|
28
|
+
return target.name.charAt(0).toLowerCase() + target.name.slice(1);
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
async load(patterns, options = {}) {
|
|
32
|
+
const { verbose = false, exclude = [], lifetime = Lifetime.SINGLETON } = options;
|
|
33
|
+
const cwd = process.cwd();
|
|
34
|
+
const resolvedPatterns = (Array.isArray(patterns) ? patterns : [patterns]).map(p => {
|
|
35
|
+
const resolved = path.isAbsolute(p) ? p : path.resolve(cwd, p);
|
|
36
|
+
return resolved.replace(/\\/g, '/').toLowerCase();
|
|
37
|
+
});
|
|
38
|
+
let modules = [];
|
|
39
|
+
try {
|
|
40
|
+
modules = listModules(resolvedPatterns);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
for (const m of modules) {
|
|
46
|
+
const normalizedMPath = m.path.replace(/\\/g, '/').toLowerCase();
|
|
47
|
+
if (this.loadedPaths.has(normalizedMPath))
|
|
48
|
+
continue;
|
|
49
|
+
if (normalizedMPath === __filename.replace(/\\/g, '/').toLowerCase() || normalizedMPath.endsWith('.d.ts'))
|
|
50
|
+
continue;
|
|
51
|
+
try {
|
|
52
|
+
const fileUrl = pathToFileURL(m.path).href;
|
|
53
|
+
const loaded = await import(fileUrl);
|
|
54
|
+
let dependency = loaded.default;
|
|
55
|
+
if (!dependency) {
|
|
56
|
+
dependency = Object.values(loaded).find(val => typeof val === 'function' && !!val.prototype && !!val.name);
|
|
57
|
+
}
|
|
58
|
+
if (typeof dependency === 'function' && !!dependency.prototype && !!dependency.name) {
|
|
59
|
+
if (this.registeredClasses.has(dependency))
|
|
60
|
+
continue;
|
|
61
|
+
const name = this.getName(dependency);
|
|
62
|
+
if (name && !this.checkRegistration(this.container, name)) {
|
|
63
|
+
this.container.register({
|
|
64
|
+
[name]: asClass(dependency).setLifetime(lifetime)
|
|
65
|
+
});
|
|
66
|
+
this.loadedPaths.add(normalizedMPath);
|
|
67
|
+
this.registeredClasses.add(dependency);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (verbose)
|
|
73
|
+
console.error(`[DI] Load Error:`, err.message);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
register(Dependency, lifetime = Lifetime.SINGLETON) {
|
|
79
|
+
const name = this.getName(Dependency);
|
|
80
|
+
if (!name || this.registeredClasses.has(Dependency))
|
|
81
|
+
return this;
|
|
82
|
+
if (this.checkRegistration(this.container, name))
|
|
83
|
+
return this;
|
|
84
|
+
this.container.register({ [name]: asClass(Dependency).setLifetime(lifetime) });
|
|
85
|
+
this.registeredClasses.add(Dependency);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
registerInstance(name, instance) {
|
|
89
|
+
if (!name)
|
|
90
|
+
return this;
|
|
91
|
+
const formattedName = this.getName(name);
|
|
92
|
+
this.container.register({ [formattedName]: asValue(instance) });
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
async initialize(input, verbose = false) {
|
|
96
|
+
if (this.isInitializing)
|
|
97
|
+
return this;
|
|
98
|
+
this.isInitializing = true;
|
|
99
|
+
try {
|
|
100
|
+
const inputList = input ? (Array.isArray(input) ? input : [input]) : [];
|
|
101
|
+
for (const item of inputList) {
|
|
102
|
+
const name = this.getName(item.service);
|
|
103
|
+
if (!name || this.initializedNames.has(name))
|
|
104
|
+
continue;
|
|
105
|
+
const reg = this.container.registrations[name];
|
|
106
|
+
if (!reg || reg.lifetime !== Lifetime.SINGLETON)
|
|
107
|
+
continue;
|
|
108
|
+
try {
|
|
109
|
+
const instance = this.container.cradle[name];
|
|
110
|
+
if (instance && typeof instance.onInit === 'function') {
|
|
111
|
+
await instance.onInit(item.props || {});
|
|
112
|
+
}
|
|
113
|
+
this.initializedNames.add(name);
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
if (verbose)
|
|
117
|
+
console.error(`[DI] Priority onInit Failed (${name}):`, err.message);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const allKeys = Object.keys(this.container.registrations);
|
|
121
|
+
for (const key of allKeys) {
|
|
122
|
+
if (this.initializedNames.has(key))
|
|
123
|
+
continue;
|
|
124
|
+
const reg = this.container.registrations[key];
|
|
125
|
+
if (reg.lifetime !== Lifetime.SINGLETON)
|
|
126
|
+
continue;
|
|
127
|
+
try {
|
|
128
|
+
const instance = this.container.cradle[key];
|
|
129
|
+
if (instance && typeof instance.onInit === 'function') {
|
|
130
|
+
await instance.onInit({});
|
|
131
|
+
}
|
|
132
|
+
this.initializedNames.add(key);
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
if (verbose)
|
|
136
|
+
console.error(`[DI] Auto onInit Failed (${key}):`, err.message);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
for (const name of this.initializedNames) {
|
|
140
|
+
try {
|
|
141
|
+
const instance = this.container.cradle[name];
|
|
142
|
+
if (instance && typeof instance.onAfterInit === 'function') {
|
|
143
|
+
await instance.onAfterInit();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
if (verbose)
|
|
148
|
+
console.error(`[DI] onAfterInit Failed (${name}):`, err.message);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
this.isInitializing = false;
|
|
154
|
+
}
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
get(target) {
|
|
158
|
+
const resolveName = this.getName(target);
|
|
159
|
+
return this.container.resolve(resolveName);
|
|
160
|
+
}
|
|
161
|
+
async shutdown() {
|
|
162
|
+
for (const name of this.initializedNames) {
|
|
163
|
+
try {
|
|
164
|
+
const instance = this.container.cradle[name];
|
|
165
|
+
if (instance && typeof instance.onDispose === 'function') {
|
|
166
|
+
await instance.onDispose();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
console.error(`[DI] onDispose Failed (${name})`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
await this.container.dispose();
|
|
174
|
+
}
|
|
175
|
+
get cradle() { return this.container.cradle; }
|
|
176
|
+
}
|
|
177
|
+
const globalStore = globalThis;
|
|
178
|
+
if (!globalStore[xSymbol]) {
|
|
179
|
+
globalStore[xSymbol] = new DIM();
|
|
180
|
+
}
|
|
181
|
+
export default globalStore[xSymbol];
|
|
@@ -16,7 +16,15 @@ export declare enum FrameworkEnum {
|
|
|
16
16
|
NODE = "node",
|
|
17
17
|
FETCH = "fetch",
|
|
18
18
|
WEBSOCKET = "websocket",
|
|
19
|
-
SOCKETIO = "socketio"
|
|
19
|
+
SOCKETIO = "socketio",
|
|
20
|
+
NEXT = "next",
|
|
21
|
+
ANGULAR = "angular",
|
|
22
|
+
NESTJS = "nestjs"
|
|
23
|
+
}
|
|
24
|
+
export declare enum GlobalTypeEnum {
|
|
25
|
+
WORKSPACE = "workspace",
|
|
26
|
+
API_SERVICE = "api-service",
|
|
27
|
+
FRONTEND = "frontend"
|
|
20
28
|
}
|
|
21
29
|
export declare enum RuntimeEnum {
|
|
22
30
|
BUN = "bun",
|
|
@@ -1 +1,169 @@
|
|
|
1
|
-
export var NodeEnvEnum;
|
|
1
|
+
export var NodeEnvEnum;
|
|
2
|
+
(function (NodeEnvEnum) {
|
|
3
|
+
NodeEnvEnum["DEV"] = "dev";
|
|
4
|
+
NodeEnvEnum["TEST"] = "test";
|
|
5
|
+
NodeEnvEnum["PROD"] = "prod";
|
|
6
|
+
})(NodeEnvEnum || (NodeEnvEnum = {}));
|
|
7
|
+
export var ProtocolEnum;
|
|
8
|
+
(function (ProtocolEnum) {
|
|
9
|
+
ProtocolEnum["HTTP"] = "http";
|
|
10
|
+
ProtocolEnum["HTTPS"] = "https";
|
|
11
|
+
ProtocolEnum["WEBSOCKET"] = "ws";
|
|
12
|
+
ProtocolEnum["SOCKETIO"] = "socketio";
|
|
13
|
+
ProtocolEnum["NONE"] = "none";
|
|
14
|
+
})(ProtocolEnum || (ProtocolEnum = {}));
|
|
15
|
+
export var FrameworkEnum;
|
|
16
|
+
(function (FrameworkEnum) {
|
|
17
|
+
FrameworkEnum["EXPRESS"] = "express";
|
|
18
|
+
FrameworkEnum["ELYSIA"] = "elysia";
|
|
19
|
+
FrameworkEnum["NODE"] = "node";
|
|
20
|
+
FrameworkEnum["FETCH"] = "fetch";
|
|
21
|
+
FrameworkEnum["WEBSOCKET"] = "websocket";
|
|
22
|
+
FrameworkEnum["SOCKETIO"] = "socketio";
|
|
23
|
+
FrameworkEnum["NEXT"] = "next";
|
|
24
|
+
FrameworkEnum["ANGULAR"] = "angular";
|
|
25
|
+
FrameworkEnum["NESTJS"] = "nestjs";
|
|
26
|
+
})(FrameworkEnum || (FrameworkEnum = {}));
|
|
27
|
+
export var GlobalTypeEnum;
|
|
28
|
+
(function (GlobalTypeEnum) {
|
|
29
|
+
GlobalTypeEnum["WORKSPACE"] = "workspace";
|
|
30
|
+
GlobalTypeEnum["API_SERVICE"] = "api-service";
|
|
31
|
+
GlobalTypeEnum["FRONTEND"] = "frontend";
|
|
32
|
+
})(GlobalTypeEnum || (GlobalTypeEnum = {}));
|
|
33
|
+
export var RuntimeEnum;
|
|
34
|
+
(function (RuntimeEnum) {
|
|
35
|
+
RuntimeEnum["BUN"] = "bun";
|
|
36
|
+
RuntimeEnum["NODE"] = "node";
|
|
37
|
+
})(RuntimeEnum || (RuntimeEnum = {}));
|
|
38
|
+
export var BundlerEnum;
|
|
39
|
+
(function (BundlerEnum) {
|
|
40
|
+
BundlerEnum["AUTO"] = "auto";
|
|
41
|
+
BundlerEnum["BUN"] = "bun";
|
|
42
|
+
BundlerEnum["TSC"] = "tsc";
|
|
43
|
+
BundlerEnum["ESBUILD"] = "esbuild";
|
|
44
|
+
})(BundlerEnum || (BundlerEnum = {}));
|
|
45
|
+
export var PolarityTypeEnum;
|
|
46
|
+
(function (PolarityTypeEnum) {
|
|
47
|
+
PolarityTypeEnum[PolarityTypeEnum["NOTR"] = 0] = "NOTR";
|
|
48
|
+
PolarityTypeEnum[PolarityTypeEnum["POSITIVE"] = 1] = "POSITIVE";
|
|
49
|
+
PolarityTypeEnum[PolarityTypeEnum["NEGATIVE"] = -1] = "NEGATIVE";
|
|
50
|
+
})(PolarityTypeEnum || (PolarityTypeEnum = {}));
|
|
51
|
+
export var LoggerLayerEnum;
|
|
52
|
+
(function (LoggerLayerEnum) {
|
|
53
|
+
LoggerLayerEnum[LoggerLayerEnum["CRITICAL"] = 0] = "CRITICAL";
|
|
54
|
+
LoggerLayerEnum[LoggerLayerEnum["ERROR"] = 1] = "ERROR";
|
|
55
|
+
LoggerLayerEnum[LoggerLayerEnum["WARN"] = 2] = "WARN";
|
|
56
|
+
LoggerLayerEnum[LoggerLayerEnum["INFO"] = 3] = "INFO";
|
|
57
|
+
LoggerLayerEnum[LoggerLayerEnum["HTTP"] = 4] = "HTTP";
|
|
58
|
+
LoggerLayerEnum[LoggerLayerEnum["DEBUG"] = 5] = "DEBUG";
|
|
59
|
+
})(LoggerLayerEnum || (LoggerLayerEnum = {}));
|
|
60
|
+
export var CountryCodeEnum;
|
|
61
|
+
(function (CountryCodeEnum) {
|
|
62
|
+
CountryCodeEnum["EN"] = "en";
|
|
63
|
+
CountryCodeEnum["TR"] = "tr";
|
|
64
|
+
})(CountryCodeEnum || (CountryCodeEnum = {}));
|
|
65
|
+
export var CurrencyCodeEnum;
|
|
66
|
+
(function (CurrencyCodeEnum) {
|
|
67
|
+
CurrencyCodeEnum["USD"] = "usd";
|
|
68
|
+
CurrencyCodeEnum["EUR"] = "eur";
|
|
69
|
+
CurrencyCodeEnum["TRY"] = "try";
|
|
70
|
+
})(CurrencyCodeEnum || (CurrencyCodeEnum = {}));
|
|
71
|
+
export var HttpMethodEnum;
|
|
72
|
+
(function (HttpMethodEnum) {
|
|
73
|
+
HttpMethodEnum["POST"] = "post";
|
|
74
|
+
HttpMethodEnum["GET"] = "get";
|
|
75
|
+
HttpMethodEnum["PUT"] = "put";
|
|
76
|
+
HttpMethodEnum["DELETE"] = "delete";
|
|
77
|
+
})(HttpMethodEnum || (HttpMethodEnum = {}));
|
|
78
|
+
export var ContentTypeEnum;
|
|
79
|
+
(function (ContentTypeEnum) {
|
|
80
|
+
ContentTypeEnum["applicationJson"] = "application/json";
|
|
81
|
+
ContentTypeEnum["applicationXWwwFormUrlencoded"] = "application/x-www-form-urlencoded";
|
|
82
|
+
})(ContentTypeEnum || (ContentTypeEnum = {}));
|
|
83
|
+
export var DeviceStatusEnum;
|
|
84
|
+
(function (DeviceStatusEnum) {
|
|
85
|
+
DeviceStatusEnum[DeviceStatusEnum["PENDING"] = 0] = "PENDING";
|
|
86
|
+
DeviceStatusEnum[DeviceStatusEnum["OFFLINE"] = 1] = "OFFLINE";
|
|
87
|
+
DeviceStatusEnum[DeviceStatusEnum["ONLINE"] = 2] = "ONLINE";
|
|
88
|
+
DeviceStatusEnum[DeviceStatusEnum["CONNECTING"] = 3] = "CONNECTING";
|
|
89
|
+
DeviceStatusEnum[DeviceStatusEnum["CONNECTED"] = 4] = "CONNECTED";
|
|
90
|
+
})(DeviceStatusEnum || (DeviceStatusEnum = {}));
|
|
91
|
+
export var DevicePlatformEnum;
|
|
92
|
+
(function (DevicePlatformEnum) {
|
|
93
|
+
DevicePlatformEnum["WEB"] = "web";
|
|
94
|
+
DevicePlatformEnum["NATIVE"] = "native";
|
|
95
|
+
DevicePlatformEnum["OTHER"] = "other";
|
|
96
|
+
})(DevicePlatformEnum || (DevicePlatformEnum = {}));
|
|
97
|
+
export var DeviceOSEnum;
|
|
98
|
+
(function (DeviceOSEnum) {
|
|
99
|
+
DeviceOSEnum["ANDROID"] = "android";
|
|
100
|
+
DeviceOSEnum["IOS"] = "ios";
|
|
101
|
+
DeviceOSEnum["WINDOWS"] = "windows";
|
|
102
|
+
DeviceOSEnum["MACOS"] = "macos";
|
|
103
|
+
DeviceOSEnum["MACOSX"] = "macosx";
|
|
104
|
+
DeviceOSEnum["OTHER"] = "other";
|
|
105
|
+
})(DeviceOSEnum || (DeviceOSEnum = {}));
|
|
106
|
+
export var PriorityEnum;
|
|
107
|
+
(function (PriorityEnum) {
|
|
108
|
+
PriorityEnum[PriorityEnum["HIGH"] = 0] = "HIGH";
|
|
109
|
+
PriorityEnum[PriorityEnum["MEDIUM"] = 1] = "MEDIUM";
|
|
110
|
+
PriorityEnum[PriorityEnum["LOW"] = 2] = "LOW";
|
|
111
|
+
})(PriorityEnum || (PriorityEnum = {}));
|
|
112
|
+
export var PrivacyEnum;
|
|
113
|
+
(function (PrivacyEnum) {
|
|
114
|
+
PrivacyEnum[PrivacyEnum["PRIVATE"] = 0] = "PRIVATE";
|
|
115
|
+
PrivacyEnum[PrivacyEnum["PUBLIC"] = 1] = "PUBLIC";
|
|
116
|
+
PrivacyEnum[PrivacyEnum["ONLY_FRIENDS"] = 2] = "ONLY_FRIENDS";
|
|
117
|
+
})(PrivacyEnum || (PrivacyEnum = {}));
|
|
118
|
+
export var TimezoneEnum;
|
|
119
|
+
(function (TimezoneEnum) {
|
|
120
|
+
TimezoneEnum["UTC"] = "UTC";
|
|
121
|
+
TimezoneEnum["EtcUTC"] = "Etc/UTC";
|
|
122
|
+
TimezoneEnum["EtcGMT"] = "Etc/GMT";
|
|
123
|
+
})(TimezoneEnum || (TimezoneEnum = {}));
|
|
124
|
+
export var ModeEnum;
|
|
125
|
+
(function (ModeEnum) {
|
|
126
|
+
ModeEnum["MONOLITIC"] = "monolitic";
|
|
127
|
+
ModeEnum["MICRO_SERVICE"] = "micro_service";
|
|
128
|
+
})(ModeEnum || (ModeEnum = {}));
|
|
129
|
+
export var TokensEnum;
|
|
130
|
+
(function (TokensEnum) {
|
|
131
|
+
TokensEnum["INTERNAL_API_TOKEN"] = "internal_api_key";
|
|
132
|
+
TokensEnum["CSRF_TOKEN"] = "csrf_token";
|
|
133
|
+
TokensEnum["ACCESS_TOKEN"] = "access_token";
|
|
134
|
+
TokensEnum["REFRESH_TOKEN"] = "refresh_token";
|
|
135
|
+
TokensEnum["REFERENCE_TOKEN"] = "reference_token";
|
|
136
|
+
TokensEnum["PERSONAL_ACCESS_TOKEN"] = "personal_access_token";
|
|
137
|
+
})(TokensEnum || (TokensEnum = {}));
|
|
138
|
+
export var CoreClientsEnum;
|
|
139
|
+
(function (CoreClientsEnum) {
|
|
140
|
+
CoreClientsEnum["BASE_API_CLIENT"] = "base_client_name";
|
|
141
|
+
CoreClientsEnum["SOAP_API_CLIENT"] = "soap_api_client";
|
|
142
|
+
})(CoreClientsEnum || (CoreClientsEnum = {}));
|
|
143
|
+
export var GStoreScopeEnum;
|
|
144
|
+
(function (GStoreScopeEnum) {
|
|
145
|
+
GStoreScopeEnum["GLOBAL"] = "global";
|
|
146
|
+
GStoreScopeEnum["RUN"] = "run";
|
|
147
|
+
GStoreScopeEnum["CONTROLLER"] = "controller";
|
|
148
|
+
})(GStoreScopeEnum || (GStoreScopeEnum = {}));
|
|
149
|
+
export var EndpointResourceEnum;
|
|
150
|
+
(function (EndpointResourceEnum) {
|
|
151
|
+
EndpointResourceEnum["EXAMPLE"] = "example";
|
|
152
|
+
EndpointResourceEnum["FULL"] = "full";
|
|
153
|
+
EndpointResourceEnum["SYSTEM"] = "system";
|
|
154
|
+
EndpointResourceEnum["CLIENTS"] = "clients";
|
|
155
|
+
EndpointResourceEnum["AUTH"] = "auth";
|
|
156
|
+
EndpointResourceEnum["ACCOUNTS"] = "accounts";
|
|
157
|
+
EndpointResourceEnum["USERS"] = "users";
|
|
158
|
+
EndpointResourceEnum["TRANSACTIONS"] = "transactions";
|
|
159
|
+
EndpointResourceEnum["NOTIFICATIONS"] = "notifications";
|
|
160
|
+
EndpointResourceEnum["ADDRESSES"] = "addresses";
|
|
161
|
+
EndpointResourceEnum["PAYMENTS"] = "payments";
|
|
162
|
+
EndpointResourceEnum["COMMISSIONS_AND_TAXES"] = "commissions-and-taxes";
|
|
163
|
+
EndpointResourceEnum["SUPPORTS"] = "supports";
|
|
164
|
+
EndpointResourceEnum["INVOICES"] = "invoices";
|
|
165
|
+
EndpointResourceEnum["FILES"] = "files";
|
|
166
|
+
EndpointResourceEnum["TOKENS"] = "tokens";
|
|
167
|
+
EndpointResourceEnum["WEBHOOKS"] = "webhooks";
|
|
168
|
+
EndpointResourceEnum["OTHERS"] = "others";
|
|
169
|
+
})(EndpointResourceEnum || (EndpointResourceEnum = {}));
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
import _ from
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import x from '../../utils/models/classes/class.x.js';
|
|
3
|
+
import locator from '../../utils/models/classes/class.service-locator.js';
|
|
4
|
+
export * from '../../utils/models/classes/class.tmp-file-loader.js';
|
|
5
|
+
export * from '../../utils/models/classes/class.interfaces.js';
|
|
6
|
+
export * from '../../utils/models/classes/class.clients.js';
|
|
7
|
+
export * from '../../utils/models/types/index.js';
|
|
8
|
+
export * from '../../utils/models/enums/index.js';
|
|
9
|
+
export { x, locator, _ };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export {};
|
|
2
|
+
/** Ambient module shims: `@xrystal/dto/*`, `qs` — see `./shims.d.ts` */
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
project:
|
|
2
|
+
name: "{{xry}}"
|
|
3
|
+
|
|
4
|
+
configs:
|
|
5
|
+
global:
|
|
6
|
+
type: api-service
|
|
7
|
+
runtime: bun
|
|
8
|
+
framework: elysia
|
|
9
|
+
paths:
|
|
10
|
+
root: ./x
|
|
11
|
+
tmp: tmp.yml
|
|
12
|
+
source: ./source
|
|
13
|
+
special:
|
|
14
|
+
tests: tests
|
|
15
|
+
environments: environments
|
|
16
|
+
dist: dist
|
|
17
|
+
vars:
|
|
18
|
+
xry: xry
|
|
19
|
+
build:
|
|
20
|
+
bundler: auto
|
|
21
|
+
typecheck: false
|
|
22
|
+
tscLenient: true
|
|
23
|
+
options:
|
|
24
|
+
fileWatchIntervalMs: 500
|
|
25
|
+
|
|
26
|
+
depends:
|
|
27
|
+
protocols:
|
|
28
|
+
- http
|
|
29
|
+
- ws
|
|
30
|
+
loaders:
|
|
31
|
+
configs:
|
|
32
|
+
loadPath: '@/utils/helpers/configs/index'
|
|
33
|
+
system:
|
|
34
|
+
gStore:
|
|
35
|
+
options:
|
|
36
|
+
bootstrap: true
|
|
37
|
+
autoCreateProps: true
|
|
38
|
+
vars:
|
|
39
|
+
test: false
|
|
40
|
+
kafka:
|
|
41
|
+
options:
|
|
42
|
+
enabled: true
|
|
43
|
+
queueLogEnabled: true
|
|
44
|
+
loggers:
|
|
45
|
+
loadPath: logs
|
|
46
|
+
logLevel: debug
|
|
47
|
+
queueLogLevel: warn
|
|
48
|
+
localization:
|
|
49
|
+
loadPath: assets/langs
|
|
50
|
+
fallbackLang: en
|
|
51
|
+
preloadLangs:
|
|
52
|
+
- en
|
|
53
|
+
- tr
|
|
54
|
+
dto:
|
|
55
|
+
withDefaultHeaders: true
|
|
56
|
+
controller:
|
|
57
|
+
|
|
58
|
+
end:
|
|
59
|
+
version: 1
|
package/x/tmp.yml
CHANGED
|
@@ -3,67 +3,24 @@ project:
|
|
|
3
3
|
|
|
4
4
|
configs:
|
|
5
5
|
global:
|
|
6
|
+
type: api-service
|
|
6
7
|
runtime: bun
|
|
7
|
-
vars:
|
|
8
|
-
xry: xry
|
|
9
|
-
|
|
10
|
-
service:
|
|
11
|
-
name: "{{xry}}-service"
|
|
12
8
|
framework: elysia
|
|
13
|
-
|
|
14
9
|
paths:
|
|
15
10
|
root: ./x
|
|
11
|
+
tmp: tmp.yml
|
|
16
12
|
source: ./source
|
|
17
13
|
special:
|
|
18
14
|
tests: tests
|
|
19
15
|
environments: environments
|
|
20
16
|
dist: dist
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- http
|
|
24
|
-
- ws
|
|
25
|
-
|
|
26
|
-
loaders:
|
|
27
|
-
configs:
|
|
28
|
-
loadPath: '@/utils/helpers/configs/index'
|
|
29
|
-
|
|
30
|
-
system:
|
|
31
|
-
gStore:
|
|
32
|
-
options:
|
|
33
|
-
bootstrap: true
|
|
34
|
-
autoCreateProps: true
|
|
35
|
-
vars:
|
|
36
|
-
test: false
|
|
37
|
-
|
|
38
|
-
kafka:
|
|
39
|
-
options:
|
|
40
|
-
enabled: true
|
|
41
|
-
queueLogEnabled: true
|
|
42
|
-
|
|
43
|
-
loggers:
|
|
44
|
-
loadPath: logs
|
|
45
|
-
logLevel: debug
|
|
46
|
-
queueLogLevel: warn
|
|
47
|
-
|
|
48
|
-
localization:
|
|
49
|
-
loadPath: assets/langs
|
|
50
|
-
fallbackLang: en
|
|
51
|
-
preloadLangs:
|
|
52
|
-
- en
|
|
53
|
-
- tr
|
|
54
|
-
|
|
55
|
-
dto:
|
|
56
|
-
withDefaultHeaders: true
|
|
57
|
-
|
|
58
|
-
controller:
|
|
59
|
-
|
|
17
|
+
vars:
|
|
18
|
+
xry: xry
|
|
60
19
|
build:
|
|
61
20
|
bundler: auto
|
|
62
|
-
typecheck:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
core:
|
|
66
|
-
tmp:
|
|
21
|
+
typecheck: false
|
|
22
|
+
tscLenient: true
|
|
23
|
+
options:
|
|
67
24
|
fileWatchIntervalMs: 500
|
|
68
25
|
|
|
69
26
|
end:
|