@xrystal/core 3.22.6 → 3.22.7
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const coreMessages: {
|
|
1
|
+
export declare const coreMessages: {
|
|
2
2
|
successfully: (p?: string, e?: string, t?: any) => string;
|
|
3
3
|
unsuccessful: (p?: string, e?: string, t?: any) => string;
|
|
4
4
|
notFound: (p?: string, e?: string, t?: any) => string;
|
|
@@ -15,15 +15,39 @@ declare const coreMessages: {
|
|
|
15
15
|
endpointNotWorking: (endpoint?: string, t?: any) => string;
|
|
16
16
|
schemaMissingDataChecks: (t?: any) => string;
|
|
17
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;
|
|
18
22
|
dbQueryError: (p?: string, e?: string, t?: any) => string;
|
|
19
23
|
unknowError: (p?: string, e?: string, t?: any) => string;
|
|
20
24
|
serverError: (p?: string, e?: string, t?: any) => string;
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
emailWelcomeTemplateTitle: (t?: any) => string;
|
|
26
|
+
emailWelcomeTemplateExplanation: (t?: any) => string;
|
|
27
|
+
emailForgotPasswordTemplateTitle: (t?: any) => string;
|
|
28
|
+
emailForgotPasswordTemplateExplanation: (t?: any) => string;
|
|
29
|
+
allRightsReserved: (e1?: string, e2?: 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;
|
|
23
35
|
notEnoughWalletBalance: (m?: string, c?: string, t?: any) => string;
|
|
36
|
+
openAuthConsumerOverhang: (p1?: string, p2?: string, t?: any) => string;
|
|
37
|
+
thirdPartySystemOverhang: (p1?: string, p2?: string, t?: any) => string;
|
|
38
|
+
deviceOverhang: (p1?: string, p2?: string, t?: any) => string;
|
|
39
|
+
provisionOverhang: (m?: string, c?: string, t?: any) => string;
|
|
40
|
+
balanceOverhang: (m?: string, c?: string, t?: any) => string;
|
|
41
|
+
debtOverhang: (m?: string, c?: string, t?: any) => string;
|
|
42
|
+
shipmentNotAccepted: (v1?: string, v2?: string, t?: any) => string;
|
|
43
|
+
optionsMethod: (m?: string, t?: any) => string;
|
|
44
|
+
notAllowedCORS: (m?: string, t?: any) => string;
|
|
45
|
+
missingCRSFToken: (t?: any) => string;
|
|
46
|
+
invalidCRSFToken: (t?: any) => string;
|
|
24
47
|
tooManyRequest: (t?: any) => string;
|
|
25
|
-
|
|
48
|
+
endpointNotFound: (t?: any) => string;
|
|
49
|
+
roleAccess: (error?: string, t?: any) => string;
|
|
50
|
+
authenticationRequiredTokenExpired: (t?: any) => string;
|
|
26
51
|
authenticationRequired: (t?: any) => string;
|
|
27
52
|
};
|
|
28
53
|
export declare const responseMessageHelper: typeof coreMessages & Record<string, Function>;
|
|
29
|
-
export {};
|
|
@@ -1,30 +1,55 @@
|
|
|
1
1
|
const f = (...args) => args.filter(item => item && typeof item === 'string' && item.trim() !== '').join(' ').trim();
|
|
2
|
-
const coreMessages = {
|
|
3
|
-
successfully: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.successfully')}.`.trim(),
|
|
4
|
-
unsuccessful: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.unsuccessful')}.`.trim(),
|
|
5
|
-
notFound: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.notFound')}.`.trim(),
|
|
6
|
-
notMatch: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.notMatch')}.`.trim(),
|
|
7
|
-
notUse: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.notUse')}.`.trim(),
|
|
8
|
-
invalid: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.invalid')}.`.trim(),
|
|
9
|
-
checked: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.checked')}.`.trim(),
|
|
10
|
-
process: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.process')}.`.trim(),
|
|
11
|
-
missingData: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.missingData')}.`.trim(),
|
|
12
|
-
allreadyHave: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.allreadyHave')}.`.trim(),
|
|
13
|
-
wrongFormat: (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.wrongFormat')}.`.trim(),
|
|
14
|
-
externalApiError: (p = '', e = '', t) => `${f(p, e)}, ${t && t('responseMessage.externalApiError')}.`.trim(),
|
|
15
|
-
unauthorizedUrl: (p = '', e = '', t) => `${f(p, e)}, ${t && t('responseMessage.unauthorizedUrl')}.`.trim(),
|
|
16
|
-
endpointNotWorking: (endpoint = '', t) => `${endpoint}, ${t && t('responseMessage.endpointNotWorking')}.`.trim(),
|
|
17
|
-
schemaMissingDataChecks: (t) => `${t && t('responseMessage.schemaMissingDataChecks')}.`.trim(),
|
|
18
|
-
schemaInvalidDataChecks: (t) => `${t && t('responseMessage.schemaInvalidDataChecks')}.`.trim(),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
export const coreMessages = {
|
|
3
|
+
'successfully': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.successfully')}.`.trim(),
|
|
4
|
+
'unsuccessful': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.unsuccessful')}.`.trim(),
|
|
5
|
+
'notFound': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.notFound')}.`.trim(),
|
|
6
|
+
'notMatch': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.notMatch')}.`.trim(),
|
|
7
|
+
'notUse': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.notUse')}.`.trim(),
|
|
8
|
+
'invalid': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.invalid')}.`.trim(),
|
|
9
|
+
'checked': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.checked')}.`.trim(),
|
|
10
|
+
'process': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.process')}.`.trim(),
|
|
11
|
+
'missingData': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.missingData')}.`.trim(),
|
|
12
|
+
'allreadyHave': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.allreadyHave')}.`.trim(),
|
|
13
|
+
'wrongFormat': (p = '', e = '', t) => `${f(p, e)} ${t && t('responseMessage.wrongFormat')}.`.trim(),
|
|
14
|
+
'externalApiError': (p = '', e = '', t) => `${f(p, e)}, ${t && t('responseMessage.externalApiError')}.`.trim(),
|
|
15
|
+
'unauthorizedUrl': (p = '', e = '', t) => `${f(p, e)}, ${t && t('responseMessage.unauthorizedUrl')}.`.trim(),
|
|
16
|
+
'endpointNotWorking': (endpoint = '', t) => `${endpoint}, ${t && t('responseMessage.endpointNotWorking')}.`.trim(),
|
|
17
|
+
'schemaMissingDataChecks': (t) => `${t && t('responseMessage.schemaMissingDataChecks')}.`.trim(),
|
|
18
|
+
'schemaInvalidDataChecks': (t) => `${t && t('responseMessage.schemaInvalidDataChecks')}.`.trim(),
|
|
19
|
+
'schemaUnknowErrorChecks': (a, b, t) => `${t && t('responseMessage.schemaUnknowErrorChecks')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`.trim(),
|
|
20
|
+
'schemaUnknowErrorLogic': (a, b, t) => `${t && t('responseMessage.schemaUnknowErrorLogic')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`.trim(),
|
|
21
|
+
'schemaUnknowErrorResponse': (a, b, t) => `${t && t('responseMessage.schemaUnknowErrorLogic')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`.trim(),
|
|
22
|
+
'schemaUnknowErrorMain': (a, b, t) => `${t && t('responseMessage.schemaUnknowErrorMain')}. ${a}. ${t('responseMessage.schemaErrorExtraExplanation')}: ${b}`.trim(),
|
|
23
|
+
'dbQueryError': (p = '', e = '', t) => `${t && t('responseMessage.dbQueryError')}. ${f(p, e)}`.trim(),
|
|
24
|
+
'unknowError': (p = '', e = '', t) => `${t && t('responseMessage.unknowError')}. ${f(p, e)}`.trim(),
|
|
25
|
+
'serverError': (p = '', e = '', t) => `${t && t('responseMessage.serverError')}. ${f(p, e)}`.trim(),
|
|
26
|
+
'emailWelcomeTemplateTitle': (t) => `${t && t('responseMessage.emailWelcomeTemplateTitle')}`.trim(),
|
|
27
|
+
'emailWelcomeTemplateExplanation': (t) => `${t && t('responseMessage.emailWelcomeTemplateExplanation')}.`.trim(),
|
|
28
|
+
'emailForgotPasswordTemplateTitle': (t) => `${t && t('responseMessage.emailForgotPasswordTemplateTitle')}`.trim(),
|
|
29
|
+
'emailForgotPasswordTemplateExplanation': (t) => `${t && t('responseMessage.emailForgotPasswordTemplateExplanation')}.`.trim(),
|
|
30
|
+
'allRightsReserved': (e1 = '', e2 = '', t) => `${f(e1, e2)}, ${t && t('responseMessage.allRightsReserved')}.`.trim(),
|
|
31
|
+
'emailButtonText': (t) => `${t && t('responseMessage.emailButtonText')}.`.trim(),
|
|
32
|
+
'emailIgnoreText': (t) => `${t && t('responseMessage.emailIgnoreText')}.`.trim(),
|
|
33
|
+
'welcomeMessage': (username = '', t) => `@${username} - ${t && t('responseMessage.welcome')}.`.trim(),
|
|
34
|
+
'userIsBlocked': (extra1 = '', t) => `${extra1}, ${t && t('responseMessage.userIsBlocked')}.`.trim(),
|
|
35
|
+
'passwordChangeCode': (username = '', t) => `@${username} - ${t && t('responseMessage.passwordChangeCode')}.`.trim(),
|
|
36
|
+
'notEnoughWalletBalance': (m = '', c = '', t) => `${f(m, c)}, ${t && t('responseMessage.notEnoughWalletBalance')}.`.trim(),
|
|
37
|
+
'openAuthConsumerOverhang': (p1 = '', p2 = '', t) => `${f(p1, p2)}, ${t && t('responseMessage.openAuthConsumerOverhang')}.`.trim(),
|
|
38
|
+
'thirdPartySystemOverhang': (p1 = '', p2 = '', t) => `${f(p1, p2)}, ${t && t('responseMessage.thirdPartySystems')}.`.trim(),
|
|
39
|
+
'deviceOverhang': (p1 = '', p2 = '', t) => `${f(p1, p2)}, ${t && t('responseMessage.deviceOverhang')}.`.trim(),
|
|
40
|
+
'provisionOverhang': (m = '', c = '', t) => `${f(m, c)}, ${t && t('responseMessage.provisionOverhang')}.`.trim(),
|
|
41
|
+
'balanceOverhang': (m = '', c = '', t) => `${f(m, c)}, ${t && t('responseMessage.balanceOverhang')}.`.trim(),
|
|
42
|
+
'debtOverhang': (m = '', c = '', t) => `${f(m, c)}, ${t && t('responseMessage.debtOverhang')}.`.trim(),
|
|
43
|
+
'shipmentNotAccepted': (v1 = '', v2 = '', t) => `${t && t('responseMessage.shipmentNotAccepted')}. ${f(v1, v2)}`.trim(),
|
|
44
|
+
'optionsMethod': (m = '', t) => `${t && t('responseMessage.optionsMethod')}. ${m}`.trim(),
|
|
45
|
+
'notAllowedCORS': (m = '', t) => `${t && t('responseMessage.notAllowedCORS')}. ${m}`.trim(),
|
|
46
|
+
'missingCRSFToken': (t) => `${t && t('responseMessage.missingCSRFToken')}.`.trim(),
|
|
47
|
+
'invalidCRSFToken': (t) => `${t && t('responseMessage.invalidCSRFToken')}.`.trim(),
|
|
48
|
+
'tooManyRequest': (t) => `${t && t('responseMessage.tooManyRequest')}.`.trim(),
|
|
49
|
+
'endpointNotFound': (t) => `${t && t('responseMessage.endpointNotFound')}.`.trim(),
|
|
50
|
+
'roleAccess': (error = '', t) => `${t && t('responseMessage.roleAccess')}. ${error}`.trim(),
|
|
51
|
+
'authenticationRequiredTokenExpired': (t) => `${t && t('responseMessage.authenticationRequiredTokenExpired')}.`.trim(),
|
|
52
|
+
'authenticationRequired': (t) => `${t && t('responseMessage.authenticationRequired')}.`.trim(),
|
|
28
53
|
};
|
|
29
54
|
export const responseMessageHelper = new Proxy(coreMessages, {
|
|
30
55
|
get(target, prop) {
|