@xrystal/core 3.8.2 → 3.8.3

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,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.8.2",
4
+ "version": "3.8.3",
5
5
  "description": "Project core for xrystal",
6
6
  "publishConfig": {
7
7
  "access": "public",
package/source/index.js CHANGED
@@ -2,7 +2,7 @@ import coreLoader from "./project/index.js";
2
2
  let tmp;
3
3
  // => tmp project tool => xrystal
4
4
  await (async () => {
5
- tmp = await coreLoader();
5
+ tmp = await coreLoader({});
6
6
  })();
7
7
  //
8
8
  export default tmp;
@@ -1,4 +1,7 @@
1
- declare const coreLoader: () => Promise<{
1
+ export declare const coreInıt: ({ locales }: {
2
+ locales: Record<string, any>;
3
+ }) => Promise<void>;
4
+ declare const coreLoader: ({}: {}) => Promise<{
2
5
  _?: undefined;
3
6
  } | {
4
7
  _: any;
@@ -4,7 +4,10 @@ import { SystemService, ConfigsService, LoggerService, EventsService, Localizati
4
4
  import { packageName, tmpFileDefaultName, tmpFileDefaultExt, findFileRecursively, TmpFileLoader, x, kafkaBrokers, systemLoggerLayer, } from '../utils/index';
5
5
  //
6
6
  let coreHasRun = false;
7
- const coreLoader = async () => {
7
+ export const coreInıt = async ({ locales }) => {
8
+ globalThis.__LOCAL_MESSAGES__ = locales;
9
+ };
10
+ const coreLoader = async ({}) => {
8
11
  if (coreHasRun)
9
12
  return {};
10
13
  try {
@@ -32,7 +35,7 @@ const coreLoader = async () => {
32
35
  await system.load({
33
36
  tmp: { _: r }
34
37
  });
35
- await configService.load({
38
+ configService.load({
36
39
  tmp: r,
37
40
  systemService: system,
38
41
  ...(configs.loaders.configs.globalEnvFileName && { globalEnvFileName: configs.loaders.configs.globalEnvFileName })
@@ -1 +1,54 @@
1
- export declare const responseMessageHelper: any;
1
+ declare const coreMessages: {
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
+ };
53
+ export declare const responseMessageHelper: typeof coreMessages & Record<string, Function>;
54
+ export {};
@@ -159,8 +159,15 @@ const coreMessages = {
159
159
  return `${t && t('responseMessage.authenticationRequired')}.`;
160
160
  },
161
161
  };
162
- const globalExtra = globalThis.__EXTRA_LOCALE_MESSAGES__ || {};
163
- export const responseMessageHelper = {
164
- ...coreMessages,
165
- ...globalExtra
166
- };
162
+ export const responseMessageHelper = new Proxy(coreMessages, {
163
+ get(target, prop) {
164
+ if (prop in target) {
165
+ return target[prop];
166
+ }
167
+ const local = globalThis.__LOCAL_MESSAGES__;
168
+ if (local && prop in local) {
169
+ return local[prop];
170
+ }
171
+ return () => `[Message '${prop}' not found]`;
172
+ }
173
+ });