@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.
- package/package.json +1 -1
- package/source/loader/logger/index.d.ts +1 -1
- package/source/loader/logger/index.js +31 -35
- package/x/docker/Dockerfile +1 -2
- package/x/dist/index.d.ts +0 -2
- package/x/dist/index.js +0 -8
- package/x/dist/loader/configs/index.d.ts +0 -13
- package/x/dist/loader/configs/index.js +0 -17
- package/x/dist/loader/events/index.d.ts +0 -6
- package/x/dist/loader/events/index.js +0 -25
- package/x/dist/loader/index.d.ts +0 -6
- package/x/dist/loader/index.js +0 -6
- package/x/dist/loader/localizations/index.d.ts +0 -14
- package/x/dist/loader/localizations/index.js +0 -32
- package/x/dist/loader/logger/index.d.ts +0 -28
- package/x/dist/loader/logger/index.js +0 -175
- package/x/dist/loader/system/index.d.ts +0 -8
- package/x/dist/loader/system/index.js +0 -14
- package/x/dist/project/index.d.ts +0 -6
- package/x/dist/project/index.js +0 -63
- package/x/dist/utils/constants/index.d.ts +0 -8
- package/x/dist/utils/constants/index.js +0 -10
- package/x/dist/utils/helpers/date/index.d.ts +0 -16
- package/x/dist/utils/helpers/date/index.js +0 -48
- package/x/dist/utils/helpers/filters/index.d.ts +0 -17
- package/x/dist/utils/helpers/filters/index.js +0 -44
- package/x/dist/utils/helpers/hash/crypto.d.ts +0 -3
- package/x/dist/utils/helpers/hash/crypto.js +0 -22
- package/x/dist/utils/helpers/id/index.d.ts +0 -13
- package/x/dist/utils/helpers/id/index.js +0 -24
- package/x/dist/utils/helpers/index.d.ts +0 -17
- package/x/dist/utils/helpers/index.js +0 -17
- package/x/dist/utils/helpers/ip/index.d.ts +0 -1
- package/x/dist/utils/helpers/ip/index.js +0 -3
- package/x/dist/utils/helpers/is/index.d.ts +0 -11
- package/x/dist/utils/helpers/is/index.js +0 -35
- package/x/dist/utils/helpers/locales/index.d.ts +0 -52
- package/x/dist/utils/helpers/locales/index.js +0 -161
- package/x/dist/utils/helpers/locales copy/index.d.ts +0 -52
- package/x/dist/utils/helpers/locales copy/index.js +0 -161
- package/x/dist/utils/helpers/math/index.d.ts +0 -2
- package/x/dist/utils/helpers/math/index.js +0 -14
- package/x/dist/utils/helpers/objects/index.d.ts +0 -1
- package/x/dist/utils/helpers/objects/index.js +0 -55
- package/x/dist/utils/helpers/path/index.d.ts +0 -2
- package/x/dist/utils/helpers/path/index.js +0 -4
- package/x/dist/utils/helpers/regex/checkSpecialRegexControl.d.ts +0 -1
- package/x/dist/utils/helpers/regex/checkSpecialRegexControl.js +0 -3
- package/x/dist/utils/helpers/string/index.d.ts +0 -1
- package/x/dist/utils/helpers/string/index.js +0 -9
- package/x/dist/utils/helpers/timer/index.d.ts +0 -3
- package/x/dist/utils/helpers/timer/index.js +0 -5
- package/x/dist/utils/helpers/tmp/index.d.ts +0 -8
- package/x/dist/utils/helpers/tmp/index.js +0 -109
- package/x/dist/utils/helpers/validates/index.d.ts +0 -5
- package/x/dist/utils/helpers/validates/index.js +0 -20
- package/x/dist/utils/index.d.ts +0 -3
- package/x/dist/utils/index.js +0 -3
- package/x/dist/utils/models/classes/class.controller.d.ts +0 -80
- package/x/dist/utils/models/classes/class.controller.js +0 -164
- package/x/dist/utils/models/classes/class.response.d.ts +0 -17
- package/x/dist/utils/models/classes/class.response.js +0 -37
- package/x/dist/utils/models/classes/class.services.d.ts +0 -129
- package/x/dist/utils/models/classes/class.services.js +0 -344
- package/x/dist/utils/models/classes/class.tmp-file-loader.d.ts +0 -8
- package/x/dist/utils/models/classes/class.tmp-file-loader.js +0 -38
- package/x/dist/utils/models/classes/class.x.d.ts +0 -12
- package/x/dist/utils/models/classes/class.x.js +0 -16
- package/x/dist/utils/models/enums/index.d.ts +0 -117
- package/x/dist/utils/models/enums/index.js +0 -133
- package/x/dist/utils/models/index.d.ts +0 -8
- package/x/dist/utils/models/index.js +0 -8
- package/x/dist/utils/models/types/index.d.ts +0 -3
- package/x/dist/utils/models/types/index.js +0 -2
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { PolarityTypeEnum } from "../../models";
|
|
2
|
-
export function dateZoneConverter({ polarity, date, zone, factor = 1000 }) {
|
|
3
|
-
let convertedZoneTime = null;
|
|
4
|
-
if (polarity === PolarityTypeEnum.NEGATIVE) {
|
|
5
|
-
convertedZoneTime = date.getTime() - factor * zone;
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
convertedZoneTime = date.getTime() + factor * zone;
|
|
9
|
-
}
|
|
10
|
-
return new Date(convertedZoneTime).toISOString();
|
|
11
|
-
}
|
|
12
|
-
export function convertDate(date, splitCharacter = '/', replaceCharacter = '-') {
|
|
13
|
-
const convertDate = date.split(splitCharacter).map((value, index) => index !== 2 ? replaceCharacter : value);
|
|
14
|
-
return convertDate;
|
|
15
|
-
}
|
|
16
|
-
export function convertTime(time, splitCharacter = ':', replaceCharacter = '-') {
|
|
17
|
-
const convertDate = time.split(splitCharacter).map((value, index) => index !== 2 ? replaceCharacter : value);
|
|
18
|
-
return convertDate;
|
|
19
|
-
}
|
|
20
|
-
export function getDateAndTime({ getDate = true, getTime = true, dateCharacter = '-', timeCharacter = ':', separatorCharacter = '&' }) {
|
|
21
|
-
const date = new Date();
|
|
22
|
-
let formattedDate = '';
|
|
23
|
-
if (!getDate && !getTime) {
|
|
24
|
-
throw new Error("Invalid options! Required one true value");
|
|
25
|
-
}
|
|
26
|
-
if (getDate) {
|
|
27
|
-
const day = date.getDate().toString().padStart(2, '0');
|
|
28
|
-
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
29
|
-
const year = date.getFullYear();
|
|
30
|
-
formattedDate = `${year}${dateCharacter}${month}${dateCharacter}${day}`;
|
|
31
|
-
}
|
|
32
|
-
if (getTime) {
|
|
33
|
-
const hours = date.getHours().toString().padStart(2, '0');
|
|
34
|
-
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
35
|
-
const seconds = date.getSeconds().toString().padStart(2, '0');
|
|
36
|
-
formattedDate = `${hours}${timeCharacter}${minutes}${timeCharacter}${seconds}`;
|
|
37
|
-
}
|
|
38
|
-
if (getDate && getTime) {
|
|
39
|
-
const day = date.getDate().toString().padStart(2, '0');
|
|
40
|
-
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
41
|
-
const year = date.getFullYear();
|
|
42
|
-
const hours = date.getHours().toString().padStart(2, '0');
|
|
43
|
-
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
44
|
-
const seconds = date.getSeconds().toString().padStart(2, '0');
|
|
45
|
-
formattedDate = `${year}${dateCharacter}${month}${dateCharacter}${day}${separatorCharacter}${hours}${timeCharacter}${minutes}${timeCharacter}${seconds}`;
|
|
46
|
-
}
|
|
47
|
-
return formattedDate;
|
|
48
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare function mongoFilter(start: any, end: any, objPath: string): any;
|
|
2
|
-
declare function filterUniqueOnce<T extends Record<string, any>>({ arr, key, uniqueOnceValues }: {
|
|
3
|
-
arr: T[];
|
|
4
|
-
key: keyof T;
|
|
5
|
-
uniqueOnceValues: (T[keyof T])[];
|
|
6
|
-
}): T[];
|
|
7
|
-
declare function filterSortByPropOrder<T extends Record<string, any>>({ arr, key, desiredOrder }: {
|
|
8
|
-
arr: T[];
|
|
9
|
-
key: keyof T;
|
|
10
|
-
desiredOrder: T[keyof T][];
|
|
11
|
-
}): T[];
|
|
12
|
-
declare function filterRemoveItemsByProps<T extends Record<string, any>>({ arr, key, valuesToRemove }: {
|
|
13
|
-
arr: T[];
|
|
14
|
-
key: keyof T;
|
|
15
|
-
valuesToRemove: (T[keyof T])[];
|
|
16
|
-
}): T[];
|
|
17
|
-
export { mongoFilter, filterUniqueOnce, filterSortByPropOrder, filterRemoveItemsByProps };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
function mongoFilter(start, end, objPath) {
|
|
2
|
-
const filter = {};
|
|
3
|
-
if (!objPath) {
|
|
4
|
-
throw new Error('MongoFilter helper property is required.');
|
|
5
|
-
}
|
|
6
|
-
filter[objPath] = filter[objPath] || {};
|
|
7
|
-
if (start && end) {
|
|
8
|
-
filter[objPath].$gte = start;
|
|
9
|
-
filter[objPath].$lte = end;
|
|
10
|
-
}
|
|
11
|
-
else if (start) {
|
|
12
|
-
filter[objPath].$gte = start;
|
|
13
|
-
}
|
|
14
|
-
else if (end) {
|
|
15
|
-
filter[objPath].$lte = end;
|
|
16
|
-
}
|
|
17
|
-
return filter;
|
|
18
|
-
}
|
|
19
|
-
function filterUniqueOnce({ arr, key, uniqueOnceValues }) {
|
|
20
|
-
const seen = new Set();
|
|
21
|
-
return arr.filter(item => {
|
|
22
|
-
const val = item[key];
|
|
23
|
-
if (uniqueOnceValues.includes(val)) {
|
|
24
|
-
if (seen.has(val))
|
|
25
|
-
return false;
|
|
26
|
-
seen.add(val);
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function filterSortByPropOrder({ arr, key, desiredOrder }) {
|
|
33
|
-
const orderMap = new Map();
|
|
34
|
-
desiredOrder.forEach((value, index) => orderMap.set(value, index));
|
|
35
|
-
return [...arr].sort((a, b) => {
|
|
36
|
-
const aIndex = orderMap.get(a[key]) ?? Infinity;
|
|
37
|
-
const bIndex = orderMap.get(b[key]) ?? Infinity;
|
|
38
|
-
return aIndex - bIndex;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function filterRemoveItemsByProps({ arr, key, valuesToRemove }) {
|
|
42
|
-
return arr.filter(item => !valuesToRemove.includes(item[key]));
|
|
43
|
-
}
|
|
44
|
-
export { mongoFilter, filterUniqueOnce, filterSortByPropOrder, filterRemoveItemsByProps };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
export function generateSHA256Hash(secret, payload) {
|
|
3
|
-
return crypto
|
|
4
|
-
.createHmac('sha256', secret)
|
|
5
|
-
.update(payload ? payload : '')
|
|
6
|
-
.digest('hex');
|
|
7
|
-
}
|
|
8
|
-
export function generateNumberAndLetter(length = 8) {
|
|
9
|
-
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
10
|
-
const array = new Uint8Array(length);
|
|
11
|
-
crypto.getRandomValues(array);
|
|
12
|
-
return Array.from(array, byte => charset[byte % charset.length]).join('');
|
|
13
|
-
}
|
|
14
|
-
export function generateCodeChallenge(codeVerifier) {
|
|
15
|
-
return crypto
|
|
16
|
-
.createHash('sha256')
|
|
17
|
-
.update(codeVerifier)
|
|
18
|
-
.digest('base64')
|
|
19
|
-
.replace(/\+/g, '-')
|
|
20
|
-
.replace(/\//g, '_')
|
|
21
|
-
.replace(/=+$/, '');
|
|
22
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const serverIdNameGenerator: ({ prefix, payload, suffix }: {
|
|
2
|
-
prefix?: string;
|
|
3
|
-
payload: any;
|
|
4
|
-
suffix?: string;
|
|
5
|
-
}) => string;
|
|
6
|
-
export declare function generateRandomKey(options: {
|
|
7
|
-
length?: number;
|
|
8
|
-
format?: 'hex' | 'base64';
|
|
9
|
-
prefix?: string;
|
|
10
|
-
suffix?: string;
|
|
11
|
-
separator?: string;
|
|
12
|
-
}): string;
|
|
13
|
-
export declare function generateReferenceCode(length: number, prefix?: string, middle?: string, suffix?: string): string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
export const serverIdNameGenerator = ({ prefix, payload, suffix }) => {
|
|
3
|
-
return `${prefix}-${payload.toString()}-${suffix}`;
|
|
4
|
-
};
|
|
5
|
-
export function generateRandomKey(options) {
|
|
6
|
-
const { length = 48, format = 'hex', prefix = '', suffix = '', separator = '-', } = options;
|
|
7
|
-
const randomPart = crypto.randomBytes(length).toString(format);
|
|
8
|
-
const parts = [prefix, randomPart, suffix].filter(Boolean);
|
|
9
|
-
return parts.join(separator);
|
|
10
|
-
}
|
|
11
|
-
export function generateReferenceCode(length, prefix = "", middle = "", suffix = "") {
|
|
12
|
-
const totalLength = prefix.length + length + middle.length + suffix.length;
|
|
13
|
-
if (totalLength <= 0) {
|
|
14
|
-
throw new Error("The total length (including prefix, middle, and suffix) must be greater than 0.");
|
|
15
|
-
}
|
|
16
|
-
let referenceCode = "";
|
|
17
|
-
for (let i = 0; i < length; i++) {
|
|
18
|
-
const randomDigit = Math.floor(Math.random() * 10);
|
|
19
|
-
referenceCode += randomDigit.toString();
|
|
20
|
-
}
|
|
21
|
-
const middleIndex = Math.floor(referenceCode.length / 2);
|
|
22
|
-
const referenceWithMiddle = referenceCode.slice(0, middleIndex) + middle + referenceCode.slice(middleIndex);
|
|
23
|
-
return `${prefix}${referenceWithMiddle}${suffix}`;
|
|
24
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export { default as pic } from "picocolors";
|
|
2
|
-
export * from './tmp/index';
|
|
3
|
-
export * from './path/index';
|
|
4
|
-
export * from './is/index';
|
|
5
|
-
export * from './id/index';
|
|
6
|
-
export * from './validates/index';
|
|
7
|
-
export * from './ip/index';
|
|
8
|
-
export * from './hash/crypto';
|
|
9
|
-
export * from './string/index';
|
|
10
|
-
export * from './objects/index';
|
|
11
|
-
export * from './locales/index';
|
|
12
|
-
export * from './timer/index';
|
|
13
|
-
export * from './date/index';
|
|
14
|
-
export * from './math/index';
|
|
15
|
-
export * from './regex/checkSpecialRegexControl';
|
|
16
|
-
export * from './filters/index';
|
|
17
|
-
export * from './locales/index';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export { default as pic } from "picocolors";
|
|
2
|
-
export * from './tmp/index';
|
|
3
|
-
export * from './path/index';
|
|
4
|
-
export * from './is/index';
|
|
5
|
-
export * from './id/index';
|
|
6
|
-
export * from './validates/index';
|
|
7
|
-
export * from './ip/index';
|
|
8
|
-
export * from './hash/crypto';
|
|
9
|
-
export * from './string/index';
|
|
10
|
-
export * from './objects/index';
|
|
11
|
-
export * from './locales/index';
|
|
12
|
-
export * from './timer/index';
|
|
13
|
-
export * from './date/index';
|
|
14
|
-
export * from './math/index';
|
|
15
|
-
export * from './regex/checkSpecialRegexControl';
|
|
16
|
-
export * from './filters/index';
|
|
17
|
-
export * from './locales/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getClientIp: (req: any) => any;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function isFalsy(value: unknown, options: {
|
|
2
|
-
ignoreFalse?: boolean;
|
|
3
|
-
ignoreZero?: boolean;
|
|
4
|
-
ignoreEmptyString?: boolean;
|
|
5
|
-
ignoreNull?: boolean;
|
|
6
|
-
ignoreUndefined?: boolean;
|
|
7
|
-
ignoreNaN?: boolean;
|
|
8
|
-
}): boolean;
|
|
9
|
-
export declare function isType(data: any, type: any): boolean;
|
|
10
|
-
export declare function isInstance(data: any, type: any): boolean;
|
|
11
|
-
export declare function isBcryptHash(value: string): boolean;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export function isFalsy(value, options) {
|
|
2
|
-
if (!options.ignoreFalse && value === false)
|
|
3
|
-
return true;
|
|
4
|
-
if (!options.ignoreZero && value === 0)
|
|
5
|
-
return true;
|
|
6
|
-
if (!options.ignoreEmptyString && value === '')
|
|
7
|
-
return true;
|
|
8
|
-
if (!options.ignoreNull && value === null)
|
|
9
|
-
return true;
|
|
10
|
-
if (!options.ignoreUndefined && value === undefined)
|
|
11
|
-
return true;
|
|
12
|
-
if (!options.ignoreNaN && typeof value === 'number' && isNaN(value))
|
|
13
|
-
return true;
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
export function isType(data, type) {
|
|
17
|
-
if (typeof data === type) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export function isInstance(data, type) {
|
|
25
|
-
if (data instanceof type) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export function isBcryptHash(value) {
|
|
33
|
-
const bcryptRegex = /^\$2[aby]\$\d{2}\$.{53}$/;
|
|
34
|
-
return bcryptRegex.test(value);
|
|
35
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export declare const responseMessageHelper: {
|
|
2
|
-
successFully: (process?: string, event?: string, t?: any) => string;
|
|
3
|
-
unsuccessful: (process?: string, event?: string, t?: any) => string;
|
|
4
|
-
notFound: (process?: string, event?: string, t?: any) => string;
|
|
5
|
-
notMatch: (process?: string, event?: string, t?: any) => string;
|
|
6
|
-
notUse: (process?: string, event?: string, t?: any) => string;
|
|
7
|
-
invalid: (process?: string, event?: string, t?: any) => string;
|
|
8
|
-
checked: (process?: string, event?: string, t?: any) => string;
|
|
9
|
-
process: (process?: string, event?: string, t?: any) => string;
|
|
10
|
-
missingData: (process?: string, event?: string, t?: any) => string;
|
|
11
|
-
allreadyHave: (process?: string, event?: string, t?: any) => string;
|
|
12
|
-
wrongFormat: (process?: string, event?: string, t?: any) => string;
|
|
13
|
-
externalApiError: (process?: string, event?: string, t?: any) => string;
|
|
14
|
-
unauthorizedUrl: (process?: string, event?: string, t?: any) => string;
|
|
15
|
-
endpointNotWorking: (endpoint?: string, t?: any) => string;
|
|
16
|
-
schemaMissingDataChecks: (t?: any) => string;
|
|
17
|
-
schemaInvalidDataChecks: (t?: any) => string;
|
|
18
|
-
schemaUnknowErrorChecks: (a: any, b: any, t?: any) => string;
|
|
19
|
-
schemaUnknowErrorLogic: (a: any, b: any, t?: any) => string;
|
|
20
|
-
schemaUnknowErrorResponse: (a: any, b: any, t?: any) => string;
|
|
21
|
-
schemaUnknowErrorMain: (a: any, b: any, t?: any) => string;
|
|
22
|
-
dbQueryError: (process?: string, event?: string, t?: any) => string;
|
|
23
|
-
unknowError: (process?: string, event?: string, t?: any) => string;
|
|
24
|
-
serverError: (process?: string, event?: string, t?: any) => string;
|
|
25
|
-
emailWelcomeTemplateTitle: (t?: any) => string;
|
|
26
|
-
emailWelcomeTemplateExplanation: (t?: any) => string;
|
|
27
|
-
emailForgotPasswordTemplateTitle: (t?: any) => string;
|
|
28
|
-
emailForgotPasswordTemplateExplanation: (t?: any) => string;
|
|
29
|
-
allRightsReserved: (extra1?: string, extra2?: string, t?: any) => string;
|
|
30
|
-
emailButtonText: (t?: any) => string;
|
|
31
|
-
emailIgnoreText: (t?: any) => string;
|
|
32
|
-
welcomeMessage: (username?: string, t?: any) => string;
|
|
33
|
-
userIsBlocked: (extra1?: string, t?: any) => string;
|
|
34
|
-
passwordChangeCode: (username?: string, t?: any) => string;
|
|
35
|
-
notEnoughWalletBalance: (money?: string, currency?: string, t?: any) => string;
|
|
36
|
-
openAuthConsumerOverhang: (param1?: string, param2?: string, t?: any) => string;
|
|
37
|
-
thirdPartySystemOverhang: (param1?: string, param2?: string, t?: any) => string;
|
|
38
|
-
deviceOverhang: (param1?: string, param2?: string, t?: any) => string;
|
|
39
|
-
provisionOverhang: (money?: string, currency?: string, t?: any) => string;
|
|
40
|
-
balanceOverhang: (money?: string, currency?: string, t?: any) => string;
|
|
41
|
-
debtOverhang: (money?: string, currency?: string, t?: any) => string;
|
|
42
|
-
shipmentNotAccepted: (value1?: string, value2?: string, t?: any) => string;
|
|
43
|
-
optionsMethod: (methods?: string, t?: any) => string;
|
|
44
|
-
notAllowedCORS: (methods?: string, t?: any) => string;
|
|
45
|
-
missingCRSFToken: (t?: any) => string;
|
|
46
|
-
invalidCRSFToken: (t?: any) => string;
|
|
47
|
-
tooManyRequest: (t?: any) => string;
|
|
48
|
-
endpointNotFound: (t?: any) => string;
|
|
49
|
-
roleAccess: (error?: string, t?: any) => string;
|
|
50
|
-
authenticationRequiredTokenExpired: (t?: any) => string;
|
|
51
|
-
authenticationRequired: (t?: any) => string;
|
|
52
|
-
};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
export const responseMessageHelper = {
|
|
2
|
-
'successFully': (process = '', event = '', t) => {
|
|
3
|
-
return `${process + ' ' + event} ${t && t('responseMessage.successfully')}.`;
|
|
4
|
-
},
|
|
5
|
-
'unsuccessful': (process = '', event = '', t) => {
|
|
6
|
-
return `${process + ' ' + event} ${t && t('responseMessage.unsuccessful')}.`;
|
|
7
|
-
},
|
|
8
|
-
'notFound': (process = '', event = '', t) => {
|
|
9
|
-
return `${process + ' ' + event} ${t && t('responseMessage.notFound')}.`;
|
|
10
|
-
},
|
|
11
|
-
'notMatch': (process = '', event = '', t) => {
|
|
12
|
-
return `${process + ' ' + event} ${t && t('responseMessage.notMatch')}.`;
|
|
13
|
-
},
|
|
14
|
-
'notUse': (process = '', event = '', t) => {
|
|
15
|
-
return `${process + ' ' + event} ${t && t('responseMessage.notUse')}.`;
|
|
16
|
-
},
|
|
17
|
-
'invalid': (process = '', event = '', t) => {
|
|
18
|
-
return `${process + ' ' + event} ${t && t('responseMessage.invalid')}.`;
|
|
19
|
-
},
|
|
20
|
-
'checked': (process = '', event = '', t) => {
|
|
21
|
-
return `${process + ' ' + event} ${t && t('responseMessage.checked')}.`;
|
|
22
|
-
},
|
|
23
|
-
'process': (process = '', event = '', t) => {
|
|
24
|
-
return `${process + ' ' + event} ${t && t('responseMessage.process')}.`;
|
|
25
|
-
},
|
|
26
|
-
'missingData': (process = '', event = '', t) => {
|
|
27
|
-
return `${process + ' ' + event} ${t && t('responseMessage.missingData')}.`;
|
|
28
|
-
},
|
|
29
|
-
'allreadyHave': (process = '', event = '', t) => {
|
|
30
|
-
return `${process + ' ' + event} ${t && t('responseMessage.allreadyHave')}.`;
|
|
31
|
-
},
|
|
32
|
-
'wrongFormat': (process = '', event = '', t) => {
|
|
33
|
-
return `${process + ' ' + event} ${t && t('responseMessage.wrongFormat')}.`;
|
|
34
|
-
},
|
|
35
|
-
'externalApiError': (process = '', event = '', t) => {
|
|
36
|
-
return `${process + ' ' + event}, ${t && t('responseMessage.externalApiError')}.`;
|
|
37
|
-
},
|
|
38
|
-
'unauthorizedUrl': (process = '', event = '', t) => {
|
|
39
|
-
return `${process + ' ' + event}, ${t && t('responseMessage.unauthorizedUrl')}.`;
|
|
40
|
-
},
|
|
41
|
-
'endpointNotWorking': (endpoint = '', t) => {
|
|
42
|
-
return `${endpoint}, ${t && t('responseMessage.endpointNotWorking')}.`;
|
|
43
|
-
},
|
|
44
|
-
// schema
|
|
45
|
-
// => special
|
|
46
|
-
'schemaMissingDataChecks': (t) => {
|
|
47
|
-
return `${t && t('responseMessage.schemaMissingDataChecks')}.`;
|
|
48
|
-
},
|
|
49
|
-
'schemaInvalidDataChecks': (t) => {
|
|
50
|
-
return `${t && t('responseMessage.schemaInvalidDataChecks')}.`;
|
|
51
|
-
},
|
|
52
|
-
'schemaUnknowErrorChecks': (a, b, t) => {
|
|
53
|
-
return `${t && t('responseMessage.schemaUnknowErrorChecks')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`;
|
|
54
|
-
},
|
|
55
|
-
'schemaUnknowErrorLogic': (a, b, t) => {
|
|
56
|
-
return `${t && t('responseMessage.schemaUnknowErrorLogic')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`;
|
|
57
|
-
},
|
|
58
|
-
'schemaUnknowErrorResponse': (a, b, t) => {
|
|
59
|
-
return `${t && t('responseMessage.schemaUnknowErrorLogic')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`;
|
|
60
|
-
},
|
|
61
|
-
'schemaUnknowErrorMain': (a, b, t) => {
|
|
62
|
-
return `${t && t('responseMessage.schemaUnknowErrorMain')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`;
|
|
63
|
-
},
|
|
64
|
-
//
|
|
65
|
-
'dbQueryError': (process = '', event = '', t) => {
|
|
66
|
-
return `${t && t('responseMessage.dbQueryError')}. ${process + ' ' + event}`;
|
|
67
|
-
},
|
|
68
|
-
'unknowError': (process = '', event = '', t) => {
|
|
69
|
-
return `${t && t('responseMessage.unknowError')}. ${process + ' ' + event}`;
|
|
70
|
-
},
|
|
71
|
-
'serverError': (process = '', event = '', t) => {
|
|
72
|
-
return `${t && t('responseMessage.serverError')}. ${process + ' ' + event}`;
|
|
73
|
-
},
|
|
74
|
-
// specific
|
|
75
|
-
// => email
|
|
76
|
-
// => templates
|
|
77
|
-
'emailWelcomeTemplateTitle': (t) => {
|
|
78
|
-
return `${t && t('responseMessage.emailWelcomeTemplateTitle')}`;
|
|
79
|
-
},
|
|
80
|
-
'emailWelcomeTemplateExplanation': (t) => {
|
|
81
|
-
return `${t && t('responseMessage.emailWelcomeTemplateExplanation')}.`;
|
|
82
|
-
},
|
|
83
|
-
'emailForgotPasswordTemplateTitle': (t) => {
|
|
84
|
-
return `${t && t('responseMessage.emailForgotPasswordTemplateTitle')}`;
|
|
85
|
-
},
|
|
86
|
-
'emailForgotPasswordTemplateExplanation': (t) => {
|
|
87
|
-
return `${t && t('responseMessage.emailForgotPasswordTemplateExplanation')}.`;
|
|
88
|
-
},
|
|
89
|
-
//
|
|
90
|
-
'allRightsReserved': (extra1 = '', extra2 = '', t) => {
|
|
91
|
-
return `${extra1 + ' ' + extra2}, ${t && t('responseMessage.allRightsReserved')}.`;
|
|
92
|
-
},
|
|
93
|
-
'emailButtonText': (t) => {
|
|
94
|
-
return `${t && t('responseMessage.emailButtonText')}.`;
|
|
95
|
-
},
|
|
96
|
-
'emailIgnoreText': (t) => {
|
|
97
|
-
return `${t && t('responseMessage.emailIgnoreText')}.`;
|
|
98
|
-
},
|
|
99
|
-
//
|
|
100
|
-
'welcomeMessage': (username = '', t) => {
|
|
101
|
-
return `@${username} - ${t && t('responseMessage.welcome')}.`;
|
|
102
|
-
},
|
|
103
|
-
'userIsBlocked': (extra1 = '', t) => {
|
|
104
|
-
return `${extra1}, ${t && t('responseMessage.userIsBlocked')}.`;
|
|
105
|
-
},
|
|
106
|
-
'passwordChangeCode': (username = '', t) => {
|
|
107
|
-
return `@${username} - ${t && t('responseMessage.passwordChangeCode')}.`;
|
|
108
|
-
},
|
|
109
|
-
'notEnoughWalletBalance': (money = '', currency = '', t) => {
|
|
110
|
-
return `${money + ' ' + currency}, ${t && t('responseMessage.notEnoughWalletBalance')}.`;
|
|
111
|
-
},
|
|
112
|
-
'openAuthConsumerOverhang': (param1 = '', param2 = '', t) => {
|
|
113
|
-
return `${param1 + ' ' + param2}, ${t && t('responseMessage.openAuthConsumerOverhang')}.`;
|
|
114
|
-
},
|
|
115
|
-
'thirdPartySystemOverhang': (param1 = '', param2 = '', t) => {
|
|
116
|
-
return `${param1 + ' ' + param2}, ${t && t('responseMessage.thirdPartySystems')}.`;
|
|
117
|
-
},
|
|
118
|
-
'deviceOverhang': (param1 = '', param2 = '', t) => {
|
|
119
|
-
return `${param1 + ' ' + param2}, ${t && t('responseMessage.deviceOverhang')}.`;
|
|
120
|
-
},
|
|
121
|
-
'provisionOverhang': (money = '', currency = '', t) => {
|
|
122
|
-
return `${money + ' ' + currency}, ${t && t('responseMessage.provisionOverhang')}.`;
|
|
123
|
-
},
|
|
124
|
-
'balanceOverhang': (money = '', currency = '', t) => {
|
|
125
|
-
return `${money + ' ' + currency}, ${t && t('responseMessage.balanceOverhang')}.`;
|
|
126
|
-
},
|
|
127
|
-
'debtOverhang': (money = '', currency = '', t) => {
|
|
128
|
-
return `${money + ' ' + currency}, ${t && t('responseMessage.debtOverhang')}.`;
|
|
129
|
-
},
|
|
130
|
-
'shipmentNotAccepted': (value1 = '', value2 = '', t) => {
|
|
131
|
-
return `${t && t('responseMessage.shipmentNotAccepted')}. ${value1} ${value2}`;
|
|
132
|
-
},
|
|
133
|
-
// system
|
|
134
|
-
'optionsMethod': (methods = '', t) => {
|
|
135
|
-
return `${t && t('responseMessage.optionsMethod')}. ${methods}`;
|
|
136
|
-
},
|
|
137
|
-
'notAllowedCORS': (methods = '', t) => {
|
|
138
|
-
return `${t && t('responseMessage.notAllowedCORS')}. ${methods}`;
|
|
139
|
-
},
|
|
140
|
-
'missingCRSFToken': (t) => {
|
|
141
|
-
return `${t && t('responseMessage.missingCSRFToken')}.`;
|
|
142
|
-
},
|
|
143
|
-
'invalidCRSFToken': (t) => {
|
|
144
|
-
return `${t && t('responseMessage.invalidCSRFToken')}.`;
|
|
145
|
-
},
|
|
146
|
-
'tooManyRequest': (t) => {
|
|
147
|
-
return `${t && t('responseMessage.tooManyRequest')}.`;
|
|
148
|
-
},
|
|
149
|
-
'endpointNotFound': (t) => {
|
|
150
|
-
return `${t && t('responseMessage.endpointNotFound')}.`;
|
|
151
|
-
},
|
|
152
|
-
'roleAccess': (error = '', t) => {
|
|
153
|
-
return `${t && t('responseMessage.roleAccess')}. ${error}`;
|
|
154
|
-
},
|
|
155
|
-
'authenticationRequiredTokenExpired': (t) => {
|
|
156
|
-
return `${t && t('responseMessage.authenticationRequiredTokenExpired')}.`;
|
|
157
|
-
},
|
|
158
|
-
'authenticationRequired': (t) => {
|
|
159
|
-
return `${t && t('responseMessage.authenticationRequired')}.`;
|
|
160
|
-
},
|
|
161
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export declare const responseMessageHelper: {
|
|
2
|
-
successFully: (process?: string, event?: string, t?: any) => string;
|
|
3
|
-
unsuccessful: (process?: string, event?: string, t?: any) => string;
|
|
4
|
-
notFound: (process?: string, event?: string, t?: any) => string;
|
|
5
|
-
notMatch: (process?: string, event?: string, t?: any) => string;
|
|
6
|
-
notUse: (process?: string, event?: string, t?: any) => string;
|
|
7
|
-
invalid: (process?: string, event?: string, t?: any) => string;
|
|
8
|
-
checked: (process?: string, event?: string, t?: any) => string;
|
|
9
|
-
process: (process?: string, event?: string, t?: any) => string;
|
|
10
|
-
missingData: (process?: string, event?: string, t?: any) => string;
|
|
11
|
-
allreadyHave: (process?: string, event?: string, t?: any) => string;
|
|
12
|
-
wrongFormat: (process?: string, event?: string, t?: any) => string;
|
|
13
|
-
externalApiError: (process?: string, event?: string, t?: any) => string;
|
|
14
|
-
unauthorizedUrl: (process?: string, event?: string, t?: any) => string;
|
|
15
|
-
endpointNotWorking: (endpoint?: string, t?: any) => string;
|
|
16
|
-
schemaMissingDataChecks: (t?: any) => string;
|
|
17
|
-
schemaInvalidDataChecks: (t?: any) => string;
|
|
18
|
-
schemaUnknowErrorChecks: (a: any, b: any, t?: any) => string;
|
|
19
|
-
schemaUnknowErrorLogic: (a: any, b: any, t?: any) => string;
|
|
20
|
-
schemaUnknowErrorResponse: (a: any, b: any, t?: any) => string;
|
|
21
|
-
schemaUnknowErrorMain: (a: any, b: any, t?: any) => string;
|
|
22
|
-
dbQueryError: (process?: string, event?: string, t?: any) => string;
|
|
23
|
-
unknowError: (process?: string, event?: string, t?: any) => string;
|
|
24
|
-
serverError: (process?: string, event?: string, t?: any) => string;
|
|
25
|
-
emailWelcomeTemplateTitle: (t?: any) => string;
|
|
26
|
-
emailWelcomeTemplateExplanation: (t?: any) => string;
|
|
27
|
-
emailForgotPasswordTemplateTitle: (t?: any) => string;
|
|
28
|
-
emailForgotPasswordTemplateExplanation: (t?: any) => string;
|
|
29
|
-
allRightsReserved: (extra1?: string, extra2?: string, t?: any) => string;
|
|
30
|
-
emailButtonText: (t?: any) => string;
|
|
31
|
-
emailIgnoreText: (t?: any) => string;
|
|
32
|
-
welcomeMessage: (username?: string, t?: any) => string;
|
|
33
|
-
userIsBlocked: (extra1?: string, t?: any) => string;
|
|
34
|
-
passwordChangeCode: (username?: string, t?: any) => string;
|
|
35
|
-
notEnoughWalletBalance: (money?: string, currency?: string, t?: any) => string;
|
|
36
|
-
openAuthConsumerOverhang: (param1?: string, param2?: string, t?: any) => string;
|
|
37
|
-
thirdPartySystemOverhang: (param1?: string, param2?: string, t?: any) => string;
|
|
38
|
-
deviceOverhang: (param1?: string, param2?: string, t?: any) => string;
|
|
39
|
-
provisionOverhang: (money?: string, currency?: string, t?: any) => string;
|
|
40
|
-
balanceOverhang: (money?: string, currency?: string, t?: any) => string;
|
|
41
|
-
debtOverhang: (money?: string, currency?: string, t?: any) => string;
|
|
42
|
-
shipmentNotAccepted: (value1?: string, value2?: string, t?: any) => string;
|
|
43
|
-
optionsMethod: (methods?: string, t?: any) => string;
|
|
44
|
-
notAllowedCORS: (methods?: string, t?: any) => string;
|
|
45
|
-
missingCRSFToken: (t?: any) => string;
|
|
46
|
-
invalidCRSFToken: (t?: any) => string;
|
|
47
|
-
tooManyRequest: (t?: any) => string;
|
|
48
|
-
endpointNotFound: (t?: any) => string;
|
|
49
|
-
roleAccess: (error?: string, t?: any) => string;
|
|
50
|
-
authenticationRequiredTokenExpired: (t?: any) => string;
|
|
51
|
-
authenticationRequired: (t?: any) => string;
|
|
52
|
-
};
|