@xrystal/core 3.5.8 → 3.6.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.
Files changed (74) hide show
  1. package/package.json +1 -1
  2. package/source/loader/logger/index.d.ts +1 -1
  3. package/source/loader/logger/index.js +31 -35
  4. package/x/docker/Dockerfile +1 -2
  5. package/x/dist/index.d.ts +0 -2
  6. package/x/dist/index.js +0 -8
  7. package/x/dist/loader/configs/index.d.ts +0 -13
  8. package/x/dist/loader/configs/index.js +0 -17
  9. package/x/dist/loader/events/index.d.ts +0 -6
  10. package/x/dist/loader/events/index.js +0 -25
  11. package/x/dist/loader/index.d.ts +0 -6
  12. package/x/dist/loader/index.js +0 -6
  13. package/x/dist/loader/localizations/index.d.ts +0 -14
  14. package/x/dist/loader/localizations/index.js +0 -32
  15. package/x/dist/loader/logger/index.d.ts +0 -28
  16. package/x/dist/loader/logger/index.js +0 -175
  17. package/x/dist/loader/system/index.d.ts +0 -8
  18. package/x/dist/loader/system/index.js +0 -14
  19. package/x/dist/project/index.d.ts +0 -6
  20. package/x/dist/project/index.js +0 -63
  21. package/x/dist/utils/constants/index.d.ts +0 -8
  22. package/x/dist/utils/constants/index.js +0 -10
  23. package/x/dist/utils/helpers/date/index.d.ts +0 -16
  24. package/x/dist/utils/helpers/date/index.js +0 -48
  25. package/x/dist/utils/helpers/filters/index.d.ts +0 -17
  26. package/x/dist/utils/helpers/filters/index.js +0 -44
  27. package/x/dist/utils/helpers/hash/crypto.d.ts +0 -3
  28. package/x/dist/utils/helpers/hash/crypto.js +0 -22
  29. package/x/dist/utils/helpers/id/index.d.ts +0 -13
  30. package/x/dist/utils/helpers/id/index.js +0 -24
  31. package/x/dist/utils/helpers/index.d.ts +0 -17
  32. package/x/dist/utils/helpers/index.js +0 -17
  33. package/x/dist/utils/helpers/ip/index.d.ts +0 -1
  34. package/x/dist/utils/helpers/ip/index.js +0 -3
  35. package/x/dist/utils/helpers/is/index.d.ts +0 -11
  36. package/x/dist/utils/helpers/is/index.js +0 -35
  37. package/x/dist/utils/helpers/locales/index.d.ts +0 -52
  38. package/x/dist/utils/helpers/locales/index.js +0 -161
  39. package/x/dist/utils/helpers/locales copy/index.d.ts +0 -52
  40. package/x/dist/utils/helpers/locales copy/index.js +0 -161
  41. package/x/dist/utils/helpers/math/index.d.ts +0 -2
  42. package/x/dist/utils/helpers/math/index.js +0 -14
  43. package/x/dist/utils/helpers/objects/index.d.ts +0 -1
  44. package/x/dist/utils/helpers/objects/index.js +0 -55
  45. package/x/dist/utils/helpers/path/index.d.ts +0 -2
  46. package/x/dist/utils/helpers/path/index.js +0 -4
  47. package/x/dist/utils/helpers/regex/checkSpecialRegexControl.d.ts +0 -1
  48. package/x/dist/utils/helpers/regex/checkSpecialRegexControl.js +0 -3
  49. package/x/dist/utils/helpers/string/index.d.ts +0 -1
  50. package/x/dist/utils/helpers/string/index.js +0 -9
  51. package/x/dist/utils/helpers/timer/index.d.ts +0 -3
  52. package/x/dist/utils/helpers/timer/index.js +0 -5
  53. package/x/dist/utils/helpers/tmp/index.d.ts +0 -8
  54. package/x/dist/utils/helpers/tmp/index.js +0 -109
  55. package/x/dist/utils/helpers/validates/index.d.ts +0 -5
  56. package/x/dist/utils/helpers/validates/index.js +0 -20
  57. package/x/dist/utils/index.d.ts +0 -3
  58. package/x/dist/utils/index.js +0 -3
  59. package/x/dist/utils/models/classes/class.controller.d.ts +0 -80
  60. package/x/dist/utils/models/classes/class.controller.js +0 -164
  61. package/x/dist/utils/models/classes/class.response.d.ts +0 -17
  62. package/x/dist/utils/models/classes/class.response.js +0 -37
  63. package/x/dist/utils/models/classes/class.services.d.ts +0 -129
  64. package/x/dist/utils/models/classes/class.services.js +0 -344
  65. package/x/dist/utils/models/classes/class.tmp-file-loader.d.ts +0 -8
  66. package/x/dist/utils/models/classes/class.tmp-file-loader.js +0 -38
  67. package/x/dist/utils/models/classes/class.x.d.ts +0 -12
  68. package/x/dist/utils/models/classes/class.x.js +0 -16
  69. package/x/dist/utils/models/enums/index.d.ts +0 -117
  70. package/x/dist/utils/models/enums/index.js +0 -133
  71. package/x/dist/utils/models/index.d.ts +0 -8
  72. package/x/dist/utils/models/index.js +0 -8
  73. package/x/dist/utils/models/types/index.d.ts +0 -3
  74. package/x/dist/utils/models/types/index.js +0 -2
@@ -1,38 +0,0 @@
1
- import { EventEmitter } from "node:events";
2
- import { resolve } from "node:path";
3
- import { readFileSync, watchFile } from "node:fs";
4
- import { parse } from "yaml";
5
- import { resolveObjWithHandlebars } from "../../helpers";
6
- export class TmpFileLoader extends EventEmitter {
7
- #tmpFileJson = {};
8
- #filePath;
9
- constructor({ filePath }) {
10
- super();
11
- this.#filePath = resolve(filePath);
12
- this.#loadSync();
13
- this.#initWatcher();
14
- }
15
- #loadSync() {
16
- try {
17
- const content = readFileSync(this.#filePath, "utf8");
18
- this.#tmpFileJson = parse(content);
19
- this.emit("reload", this.#tmpFileJson);
20
- }
21
- catch (err) {
22
- console.error(`[TmpFileLoader] Error: ${err}`);
23
- }
24
- }
25
- #initWatcher() {
26
- watchFile(this.#filePath, { interval: 500 }, (curr, prev) => {
27
- if (curr.mtimeMs !== prev.mtimeMs) {
28
- this.#loadSync();
29
- }
30
- });
31
- }
32
- getResolvedTmpFile() {
33
- const data = Object.keys(this.#tmpFileJson).length > 0
34
- ? this.#tmpFileJson
35
- : (this.#loadSync(), this.#tmpFileJson);
36
- return resolveObjWithHandlebars(data, data);
37
- }
38
- }
@@ -1,12 +0,0 @@
1
- export declare class X {
2
- private _context;
3
- constructor({}: {});
4
- set: <T extends new (...args: any[]) => any>({ service, reference, args }: {
5
- service: T;
6
- reference: T;
7
- args?: ConstructorParameters<T>;
8
- }) => void;
9
- get: <T>(service: new (...args: any) => T) => T;
10
- }
11
- declare const _default: X;
12
- export default _default;
@@ -1,16 +0,0 @@
1
- // => // X Service Locator
2
- export class X {
3
- _context = new Map();
4
- constructor({}) {
5
- }
6
- set = ({ service, reference, args }) => {
7
- this._context.set(service, new reference(...(args || [])));
8
- };
9
- get = (service) => {
10
- if (!this._context.has(service)) {
11
- throw new Error(`${service} not found in context.`);
12
- }
13
- return this._context.get(service);
14
- };
15
- }
16
- export default new X({});
@@ -1,117 +0,0 @@
1
- export declare enum NodeEnvEnum {
2
- DEV = "dev",
3
- TEST = "test",
4
- PROD = "prod"
5
- }
6
- export declare enum ProtocolEnum {
7
- HTTP = "http",
8
- HTTPS = "https",
9
- WEBSOCKET = "ws",
10
- SOCKETIO = "ws",
11
- NONE = "none"
12
- }
13
- export declare enum PolarityTypeEnum {
14
- NOTR = 0,
15
- POSITIVE = 1,
16
- NEGATIVE = -1
17
- }
18
- export declare enum LoggerLayerEnum {
19
- CRITICAL = 0,
20
- ERROR = 1,
21
- INFO = 2,
22
- HTTP = 4,
23
- DEBUG = 5
24
- }
25
- export declare enum CountryCodeEnum {
26
- EN = "en",
27
- TR = "tr"
28
- }
29
- export declare enum CurrencyCodeEnum {
30
- USD = "usd",
31
- EUR = "eur",
32
- TRY = "try"
33
- }
34
- export declare enum HttpMethodEnum {
35
- POST = "post",
36
- GET = "get",
37
- PUT = "put",
38
- DELETE = "delete"
39
- }
40
- export declare enum ContentTypeEnum {
41
- applicationJson = "application/json",
42
- applicationXWwwFormUrlencoded = "application/x-www-form-urlencoded"
43
- }
44
- export declare enum DevicePlatformEnum {
45
- WEB = "web",
46
- NATIVE = "native",
47
- OTHER = "other"
48
- }
49
- export declare enum DeviceOSEnum {
50
- ANDROID = "android",
51
- IOS = "ios",
52
- WINDOWS = "windows",
53
- MACOS = "macos",
54
- MACOSX = "macosx",
55
- OTHER = "other"
56
- }
57
- export declare enum PriorityEnum {
58
- HIGH = 0,
59
- MEDIUM = 1,
60
- LOW = 2
61
- }
62
- export declare enum PrivacyEnum {
63
- PRIVATE = 0,
64
- PUBLIC = 1,
65
- ONLY_FRIENDS = 2
66
- }
67
- export declare enum TimezoneEnum {
68
- UTC = "UTC",
69
- EtcUTC = "Etc/UTC",
70
- EtcGMT = "Etc/GMT"
71
- }
72
- export declare enum TokensEnum {
73
- CSRF_TOKEN = "csrf_token",
74
- ACCESS_TOKEN = "access_token",
75
- REFRESH_TOKEN = "refresh_token",
76
- REFERENCE_TOKEN = "reference_token",
77
- PERSONAL_ACCESS_TOKEN = "personal_access_token"
78
- }
79
- export declare enum EndpointResourceEnum {
80
- EXAMPLE = "example",
81
- FULL = "full",
82
- SYSTEM = "system",
83
- CLIENTS = "clients",
84
- AUTH = "auth",
85
- ACCOUNTS = "accounts",
86
- USERS = "users",
87
- TRANSACTIONS = "transactions",
88
- NOTIFICATIONS = "notifications",
89
- ADDRESSES = "addresses",
90
- PAYMENTS = "payments",
91
- COMMISSIONS_AND_TAXES = "commissions-and-taxes",
92
- SUPPORTS = "supports",
93
- INVOICES = "invoices",
94
- FILES = "files",
95
- TOKENS = "tokens",
96
- WEBHOOKS = "webhooks",
97
- OTHERS = "others"
98
- }
99
- export declare enum SupportFileExtensionsEnum {
100
- 'HTML' = "html",
101
- 'EJS' = "ejs",
102
- 'HBS' = "hbs",
103
- "TS" = "",
104
- "JS" = ".js",
105
- "TSX" = "x",
106
- "JSX" = ".jsx",
107
- "TTF" = ".ttf",
108
- "EOT" = ".eot",
109
- "OTF" = ".otf",
110
- "SVG" = ".svg",
111
- "PNG" = ".png",
112
- "WOFF" = ".woff",
113
- "WOFF2" = ".woff2",
114
- "CSS" = ".css",
115
- "SCSS" = ".scss",
116
- "SASS" = ".sass"
117
- }
@@ -1,133 +0,0 @@
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"] = "ws";
13
- ProtocolEnum["NONE"] = "none";
14
- })(ProtocolEnum || (ProtocolEnum = {}));
15
- export var PolarityTypeEnum;
16
- (function (PolarityTypeEnum) {
17
- PolarityTypeEnum[PolarityTypeEnum["NOTR"] = 0] = "NOTR";
18
- PolarityTypeEnum[PolarityTypeEnum["POSITIVE"] = 1] = "POSITIVE";
19
- PolarityTypeEnum[PolarityTypeEnum["NEGATIVE"] = -1] = "NEGATIVE";
20
- })(PolarityTypeEnum || (PolarityTypeEnum = {}));
21
- export var LoggerLayerEnum;
22
- (function (LoggerLayerEnum) {
23
- LoggerLayerEnum[LoggerLayerEnum["CRITICAL"] = 0] = "CRITICAL";
24
- LoggerLayerEnum[LoggerLayerEnum["ERROR"] = 1] = "ERROR";
25
- LoggerLayerEnum[LoggerLayerEnum["INFO"] = 2] = "INFO";
26
- LoggerLayerEnum[LoggerLayerEnum["HTTP"] = 4] = "HTTP";
27
- LoggerLayerEnum[LoggerLayerEnum["DEBUG"] = 5] = "DEBUG";
28
- })(LoggerLayerEnum || (LoggerLayerEnum = {}));
29
- export var CountryCodeEnum;
30
- (function (CountryCodeEnum) {
31
- CountryCodeEnum["EN"] = "en";
32
- CountryCodeEnum["TR"] = "tr";
33
- })(CountryCodeEnum || (CountryCodeEnum = {}));
34
- export var CurrencyCodeEnum;
35
- (function (CurrencyCodeEnum) {
36
- CurrencyCodeEnum["USD"] = "usd";
37
- CurrencyCodeEnum["EUR"] = "eur";
38
- CurrencyCodeEnum["TRY"] = "try";
39
- })(CurrencyCodeEnum || (CurrencyCodeEnum = {}));
40
- export var HttpMethodEnum;
41
- (function (HttpMethodEnum) {
42
- HttpMethodEnum["POST"] = "post";
43
- HttpMethodEnum["GET"] = "get";
44
- HttpMethodEnum["PUT"] = "put";
45
- HttpMethodEnum["DELETE"] = "delete";
46
- })(HttpMethodEnum || (HttpMethodEnum = {}));
47
- export var ContentTypeEnum;
48
- (function (ContentTypeEnum) {
49
- ContentTypeEnum["applicationJson"] = "application/json";
50
- ContentTypeEnum["applicationXWwwFormUrlencoded"] = "application/x-www-form-urlencoded";
51
- })(ContentTypeEnum || (ContentTypeEnum = {}));
52
- export var DevicePlatformEnum;
53
- (function (DevicePlatformEnum) {
54
- DevicePlatformEnum["WEB"] = "web";
55
- DevicePlatformEnum["NATIVE"] = "native";
56
- DevicePlatformEnum["OTHER"] = "other";
57
- })(DevicePlatformEnum || (DevicePlatformEnum = {}));
58
- export var DeviceOSEnum;
59
- (function (DeviceOSEnum) {
60
- DeviceOSEnum["ANDROID"] = "android";
61
- DeviceOSEnum["IOS"] = "ios";
62
- DeviceOSEnum["WINDOWS"] = "windows";
63
- DeviceOSEnum["MACOS"] = "macos";
64
- DeviceOSEnum["MACOSX"] = "macosx";
65
- DeviceOSEnum["OTHER"] = "other";
66
- })(DeviceOSEnum || (DeviceOSEnum = {}));
67
- export var PriorityEnum;
68
- (function (PriorityEnum) {
69
- PriorityEnum[PriorityEnum["HIGH"] = 0] = "HIGH";
70
- PriorityEnum[PriorityEnum["MEDIUM"] = 1] = "MEDIUM";
71
- PriorityEnum[PriorityEnum["LOW"] = 2] = "LOW";
72
- })(PriorityEnum || (PriorityEnum = {}));
73
- export var PrivacyEnum;
74
- (function (PrivacyEnum) {
75
- PrivacyEnum[PrivacyEnum["PRIVATE"] = 0] = "PRIVATE";
76
- PrivacyEnum[PrivacyEnum["PUBLIC"] = 1] = "PUBLIC";
77
- PrivacyEnum[PrivacyEnum["ONLY_FRIENDS"] = 2] = "ONLY_FRIENDS";
78
- })(PrivacyEnum || (PrivacyEnum = {}));
79
- export var TimezoneEnum;
80
- (function (TimezoneEnum) {
81
- TimezoneEnum["UTC"] = "UTC";
82
- TimezoneEnum["EtcUTC"] = "Etc/UTC";
83
- TimezoneEnum["EtcGMT"] = "Etc/GMT";
84
- })(TimezoneEnum || (TimezoneEnum = {}));
85
- export var TokensEnum;
86
- (function (TokensEnum) {
87
- TokensEnum["CSRF_TOKEN"] = "csrf_token";
88
- TokensEnum["ACCESS_TOKEN"] = "access_token";
89
- TokensEnum["REFRESH_TOKEN"] = "refresh_token";
90
- TokensEnum["REFERENCE_TOKEN"] = "reference_token";
91
- TokensEnum["PERSONAL_ACCESS_TOKEN"] = "personal_access_token";
92
- })(TokensEnum || (TokensEnum = {}));
93
- export var EndpointResourceEnum;
94
- (function (EndpointResourceEnum) {
95
- EndpointResourceEnum["EXAMPLE"] = "example";
96
- EndpointResourceEnum["FULL"] = "full";
97
- EndpointResourceEnum["SYSTEM"] = "system";
98
- EndpointResourceEnum["CLIENTS"] = "clients";
99
- EndpointResourceEnum["AUTH"] = "auth";
100
- EndpointResourceEnum["ACCOUNTS"] = "accounts";
101
- EndpointResourceEnum["USERS"] = "users";
102
- EndpointResourceEnum["TRANSACTIONS"] = "transactions";
103
- EndpointResourceEnum["NOTIFICATIONS"] = "notifications";
104
- EndpointResourceEnum["ADDRESSES"] = "addresses";
105
- EndpointResourceEnum["PAYMENTS"] = "payments";
106
- EndpointResourceEnum["COMMISSIONS_AND_TAXES"] = "commissions-and-taxes";
107
- EndpointResourceEnum["SUPPORTS"] = "supports";
108
- EndpointResourceEnum["INVOICES"] = "invoices";
109
- EndpointResourceEnum["FILES"] = "files";
110
- EndpointResourceEnum["TOKENS"] = "tokens";
111
- EndpointResourceEnum["WEBHOOKS"] = "webhooks";
112
- EndpointResourceEnum["OTHERS"] = "others";
113
- })(EndpointResourceEnum || (EndpointResourceEnum = {}));
114
- export var SupportFileExtensionsEnum;
115
- (function (SupportFileExtensionsEnum) {
116
- SupportFileExtensionsEnum["HTML"] = "html";
117
- SupportFileExtensionsEnum["EJS"] = "ejs";
118
- SupportFileExtensionsEnum["HBS"] = "hbs";
119
- SupportFileExtensionsEnum["TS"] = "";
120
- SupportFileExtensionsEnum["JS"] = ".js";
121
- SupportFileExtensionsEnum["TSX"] = "x";
122
- SupportFileExtensionsEnum["JSX"] = ".jsx";
123
- SupportFileExtensionsEnum["TTF"] = ".ttf";
124
- SupportFileExtensionsEnum["EOT"] = ".eot";
125
- SupportFileExtensionsEnum["OTF"] = ".otf";
126
- SupportFileExtensionsEnum["SVG"] = ".svg";
127
- SupportFileExtensionsEnum["PNG"] = ".png";
128
- SupportFileExtensionsEnum["WOFF"] = ".woff";
129
- SupportFileExtensionsEnum["WOFF2"] = ".woff2";
130
- SupportFileExtensionsEnum["CSS"] = ".css";
131
- SupportFileExtensionsEnum["SCSS"] = ".scss";
132
- SupportFileExtensionsEnum["SASS"] = ".sass";
133
- })(SupportFileExtensionsEnum || (SupportFileExtensionsEnum = {}));
@@ -1,8 +0,0 @@
1
- import x, { X } from './classes/class.x';
2
- export * from './classes/class.tmp-file-loader';
3
- export * from './classes/class.controller';
4
- export * from './classes/class.response';
5
- export * from './classes/class.services';
6
- export * from './types';
7
- export * from './enums';
8
- export { x, X };
@@ -1,8 +0,0 @@
1
- import x, { X } from './classes/class.x';
2
- export * from './classes/class.tmp-file-loader';
3
- export * from './classes/class.controller';
4
- export * from './classes/class.response';
5
- export * from './classes/class.services';
6
- export * from './types';
7
- export * from './enums';
8
- export { x, X };
@@ -1,3 +0,0 @@
1
- export interface ICustomError extends Error {
2
- status?: number;
3
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //end