@intlayer/config 5.4.2 → 5.5.0
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/dist/cjs/client.cjs +1 -4
- package/dist/cjs/client.cjs.map +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +85 -196
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +14 -3
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
- package/dist/cjs/defaultValues/content.cjs +27 -27
- package/dist/cjs/defaultValues/content.cjs.map +1 -1
- package/dist/cjs/defaultValues/editor.cjs +0 -9
- package/dist/cjs/defaultValues/editor.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs +14 -18
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +12 -16
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/types.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +12 -16
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +12 -16
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -1
- package/dist/cjs/envVariables/getConfiguration.cjs +13 -30
- package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
- package/dist/cjs/index.cjs +10 -8
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/logger.cjs +13 -6
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/{appLoggerClient.cjs → retryManager.cjs} +29 -10
- package/dist/cjs/retryManager.cjs.map +1 -0
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/esm/client.mjs +1 -3
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +101 -215
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +4 -3
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
- package/dist/esm/defaultValues/content.mjs +18 -18
- package/dist/esm/defaultValues/content.mjs.map +1 -1
- package/dist/esm/defaultValues/editor.mjs +0 -6
- package/dist/esm/defaultValues/editor.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/next.mjs +14 -18
- package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +12 -16
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +12 -16
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs +12 -16
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -1
- package/dist/esm/envVariables/getConfiguration.mjs +13 -30
- package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
- package/dist/esm/index.mjs +9 -8
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/logger.mjs +12 -6
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/retryManager.mjs +28 -0
- package/dist/esm/retryManager.mjs.map +1 -0
- package/dist/types/client.d.ts +3 -4
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts +2 -2
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/searchConfigurationFile.d.ts +1 -1
- package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
- package/dist/types/defaultValues/content.d.ts +9 -9
- package/dist/types/defaultValues/content.d.ts.map +1 -1
- package/dist/types/defaultValues/editor.d.ts +0 -3
- package/dist/types/defaultValues/editor.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/next.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/react_app.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/types.d.ts +1 -1
- package/dist/types/envVariables/extractEnvVariable/types.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/vite.d.ts.map +1 -1
- package/dist/types/envVariables/getConfiguration.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logger.d.ts +8 -2
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/retryManager.d.ts +17 -0
- package/dist/types/retryManager.d.ts.map +1 -0
- package/dist/types/types/config.d.ts +64 -106
- package/dist/types/types/config.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/cjs/appLoggerClient.cjs.map +0 -1
- package/dist/cjs/appLoggerServer.cjs +0 -34
- package/dist/cjs/appLoggerServer.cjs.map +0 -1
- package/dist/esm/appLoggerClient.mjs +0 -9
- package/dist/esm/appLoggerClient.mjs.map +0 -1
- package/dist/esm/appLoggerServer.mjs +0 -10
- package/dist/esm/appLoggerServer.mjs.map +0 -1
- package/dist/types/appLoggerClient.d.ts +0 -3
- package/dist/types/appLoggerClient.d.ts.map +0 -1
- package/dist/types/appLoggerServer.d.ts +0 -3
- package/dist/types/appLoggerServer.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n AiConfig,\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport {\n extractEnvVariable,\n type ExtractEnvVariableOptions,\n} from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (\n options?: ExtractEnvVariableOptions\n): IntlayerConfig => {\n const env = extractEnvVariable(options);\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n requiredLocales: getEnvValue<Locales>(\n env.internationalization.requiredLocales,\n 'array'\n )!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDir: getEnvValue<string>(env.content.contentDir, 'array')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n unmergedDictionariesDir: getEnvValue(\n env.content.unmergedDictionariesDir,\n 'string'\n )!,\n i18nextResourcesDir: getEnvValue(\n env.content.i18nextResourcesDir,\n 'string'\n )!,\n reactIntlMessagesDir: getEnvValue(\n env.content.reactIntlMessagesDir,\n 'string'\n )!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n configDir: getEnvValue(env.content.configDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n applicationURL: getEnvValue(env.editor.applicationURL, 'string')!,\n editorURL: getEnvValue(env.editor.editorURL, 'string')!,\n cmsURL: getEnvValue(env.editor.cmsURL, 'string')!,\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n port: getEnvValue(env.editor.port, 'number')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'local_first' | 'distant_first',\n hotReload: getEnvValue(env.editor.hotReload, 'boolean')!,\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const aiConfiguration: AiConfig = {\n provider: getEnvValue(env.ai?.provider, 'string')!,\n model: getEnvValue(env.ai?.model, 'string')!,\n temperature: getEnvValue(env.ai?.temperature, 'number')!,\n apiKey: getEnvValue(env.ai?.apiKey, 'string')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n ai: aiConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":"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","names":[]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfiguration
|
|
3
3
|
} from "./configFile/getConfiguration.mjs";
|
|
4
|
-
import { Locales } from "./types/locales.mjs";
|
|
5
4
|
import {
|
|
6
5
|
formatEnvVariable,
|
|
7
6
|
getConfiguration as getConfiguration2,
|
|
8
7
|
getEnvFilePath,
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
getPlatform,
|
|
9
|
+
loadEnvFile
|
|
11
10
|
} from "./envVariables/index.mjs";
|
|
12
|
-
import { ESMxCJSRequire } from "./utils/ESMxCJSRequire.mjs";
|
|
13
|
-
import { logger } from "./logger.mjs";
|
|
14
|
-
import { appLogger } from "./appLoggerServer.mjs";
|
|
15
11
|
import { getSandBoxContext } from "./getSandboxContext.mjs";
|
|
16
12
|
import { loadExternalFile } from "./loadExternalFile.mjs";
|
|
13
|
+
import { getAppLogger, logger } from "./logger.mjs";
|
|
14
|
+
import { retryManager } from "./retryManager.mjs";
|
|
15
|
+
import { Locales } from "./types/locales.mjs";
|
|
16
|
+
import { ESMxCJSRequire } from "./utils/ESMxCJSRequire.mjs";
|
|
17
17
|
export {
|
|
18
18
|
ESMxCJSRequire,
|
|
19
19
|
Locales,
|
|
20
|
-
appLogger,
|
|
21
20
|
formatEnvVariable,
|
|
21
|
+
getAppLogger,
|
|
22
22
|
getConfiguration2 as getClientConfiguration,
|
|
23
23
|
getConfiguration,
|
|
24
24
|
getEnvFilePath,
|
|
@@ -26,6 +26,7 @@ export {
|
|
|
26
26
|
getSandBoxContext,
|
|
27
27
|
loadEnvFile,
|
|
28
28
|
loadExternalFile,
|
|
29
|
-
logger
|
|
29
|
+
logger,
|
|
30
|
+
retryManager
|
|
30
31
|
};
|
|
31
32
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getConfiguration,\n type GetConfigurationOptions,\n} from './configFile/getConfiguration';\
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getConfiguration,\n type GetConfigurationOptions,\n} from './configFile/getConfiguration';\nexport {\n formatEnvVariable,\n getConfiguration as getClientConfiguration,\n getEnvFilePath,\n getPlatform,\n loadEnvFile,\n} from './envVariables/index';\nexport { getSandBoxContext } from './getSandboxContext';\nexport { loadExternalFile } from './loadExternalFile';\nexport { getAppLogger, logger, type Logger } from './logger';\nexport { retryManager } from './retryManager';\nexport type {\n BaseContentConfig,\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n ServerSetCookieRule,\n StrictMode,\n} from './types/config';\nexport { Locales } from './types/locales';\nexport type { LocalesValues } from './types/locales';\nexport { ESMxCJSRequire } from './utils/ESMxCJSRequire';\n"],"mappings":"AAAA;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACoB,oBAApBA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,cAAc,cAA2B;AAClD,SAAS,oBAAoB;AAe7B,SAAS,eAAe;AAExB,SAAS,sBAAsB;","names":["getConfiguration"]}
|
package/dist/esm/logger.mjs
CHANGED
|
@@ -4,24 +4,30 @@ const logger = (content, details = {
|
|
|
4
4
|
config: { mode: "default", prefix: "" }
|
|
5
5
|
}) => {
|
|
6
6
|
const mode = details.config?.mode ?? "default";
|
|
7
|
-
const prefix = details.config?.prefix
|
|
7
|
+
const prefix = Boolean(details.config?.prefix) ? details.config?.prefix : void 0;
|
|
8
8
|
if (mode === "disabled") return;
|
|
9
9
|
if (details.isVerbose && mode !== "verbose") return;
|
|
10
|
+
const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();
|
|
10
11
|
if (details.level === "debug") {
|
|
11
|
-
return console.debug(
|
|
12
|
+
return console.debug(...flatContent);
|
|
12
13
|
}
|
|
13
14
|
if (details.level === "info") {
|
|
14
|
-
return console.info(
|
|
15
|
+
return console.info(...flatContent);
|
|
15
16
|
}
|
|
16
17
|
if (details.level === "warn") {
|
|
17
|
-
return console.warn(
|
|
18
|
+
return console.warn(...flatContent);
|
|
18
19
|
}
|
|
19
20
|
if (details.level === "error") {
|
|
20
|
-
return console.error(
|
|
21
|
+
return console.error(...flatContent);
|
|
21
22
|
}
|
|
22
|
-
console.log(
|
|
23
|
+
console.log(...flatContent);
|
|
23
24
|
};
|
|
25
|
+
const getAppLogger = (configuration) => (content, details) => logger(content, {
|
|
26
|
+
...details ?? {},
|
|
27
|
+
config: { ...configuration?.log, ...details?.config ?? {} }
|
|
28
|
+
});
|
|
24
29
|
export {
|
|
30
|
+
getAppLogger,
|
|
25
31
|
logger
|
|
26
32
|
};
|
|
27
33
|
//# sourceMappingURL=logger.mjs.map
|
package/dist/esm/logger.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/logger.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../src/logger.ts"],"sourcesContent":["import type { CustomIntlayerConfig } from './types/config';\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: CustomIntlayerConfig['log'];\n};\n\nexport type Logger = (content: any, details?: Details) => void;\n\nexport const logger: Logger = (\n content,\n details = {\n isVerbose: false,\n level: undefined,\n config: { mode: 'default', prefix: '' },\n }\n) => {\n const mode = details.config?.mode ?? 'default';\n const prefix = Boolean(details.config?.prefix)\n ? details.config?.prefix\n : undefined;\n\n if (mode === 'disabled') return;\n\n if (details.isVerbose && mode !== 'verbose') return;\n\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n\n if (details.level === 'debug') {\n return console.debug(...flatContent);\n }\n\n if (details.level === 'info') {\n return console.info(...flatContent);\n }\n\n if (details.level === 'warn') {\n return console.warn(...flatContent);\n }\n\n if (details.level === 'error') {\n return console.error(...flatContent);\n }\n\n console.log(...flatContent);\n};\n\n/**\n * The appLogger function takes the logger and merges it with the configuration from the intlayer config file.\n * It allows overriding the default configuration by passing a config object in the details parameter.\n * The configuration is merged with the default configuration from the intlayer config file.\n */\nexport const getAppLogger =\n (configuration?: CustomIntlayerConfig) => (content: any, details?: Details) =>\n logger(content, {\n ...(details ?? {}),\n config: { ...configuration?.log, ...(details?.config ?? {}) },\n });\n"],"mappings":"AAUO,MAAM,SAAiB,CAC5B,SACA,UAAU;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ,EAAE,MAAM,WAAW,QAAQ,GAAG;AACxC,MACG;AACH,QAAM,OAAO,QAAQ,QAAQ,QAAQ;AACrC,QAAM,SAAS,QAAQ,QAAQ,QAAQ,MAAM,IACzC,QAAQ,QAAQ,SAChB;AAEJ,MAAI,SAAS,WAAY;AAEzB,MAAI,QAAQ,aAAa,SAAS,UAAW;AAE7C,QAAM,cAAc,SAAS,CAAC,QAAQ,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK;AAE5E,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,WAAW;AAAA,EACrC;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,WAAW;AAAA,EACpC;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,WAAW;AAAA,EACpC;AAEA,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,WAAW;AAAA,EACrC;AAEA,UAAQ,IAAI,GAAG,WAAW;AAC5B;AAOO,MAAM,eACX,CAAC,kBAAyC,CAAC,SAAc,YACvD,OAAO,SAAS;AAAA,EACd,GAAI,WAAW,CAAC;AAAA,EAChB,QAAQ,EAAE,GAAG,eAAe,KAAK,GAAI,SAAS,UAAU,CAAC,EAAG;AAC9D,CAAC;","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { logger } from "./logger.mjs";
|
|
2
|
+
const DEFAULT_MAX_RETRY = 3;
|
|
3
|
+
const DEFAULT_DELAY = 6e4;
|
|
4
|
+
const retryManager = (fn, {
|
|
5
|
+
maxRetry = DEFAULT_MAX_RETRY,
|
|
6
|
+
delay = DEFAULT_DELAY,
|
|
7
|
+
onError
|
|
8
|
+
} = {}) => (
|
|
9
|
+
// ───────────────────────────────^ returned wrapper function
|
|
10
|
+
async (...args) => {
|
|
11
|
+
for (let attempt = 0; ; attempt++) {
|
|
12
|
+
try {
|
|
13
|
+
return await fn(...args);
|
|
14
|
+
} catch (err) {
|
|
15
|
+
onError?.(err);
|
|
16
|
+
logger(["Request failed", err], {
|
|
17
|
+
level: "error"
|
|
18
|
+
});
|
|
19
|
+
if (attempt >= maxRetry) throw err;
|
|
20
|
+
if (delay > 0) await new Promise((res) => setTimeout(res, delay));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
export {
|
|
26
|
+
retryManager
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=retryManager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/retryManager.ts"],"sourcesContent":["import { logger } from './logger';\n\nexport type RetryManagerOptions = {\n /** maximum number of retries before giving up */\n maxRetry?: number;\n /** delay between attempts, in milliseconds */\n delay?: number;\n /** function to call when an error occurs */\n onError?: (err: Error) => void;\n};\n\nconst DEFAULT_MAX_RETRY = 3;\nconst DEFAULT_DELAY = 60_000; // 60 seconds\n\n/**\n * Wrap an async function `fn` so it’s retried on failure.\n *\n * @param fn The async function to wrap\n * @param options { maxRetry, delay }\n * @returns A new function with the same signature as `fn`\n */\nexport const retryManager =\n <Args extends any[], R>(\n fn: (...args: Args) => Promise<R>,\n {\n maxRetry = DEFAULT_MAX_RETRY,\n delay = DEFAULT_DELAY,\n onError,\n }: RetryManagerOptions = {}\n ): ((...args: Args) => Promise<R>) =>\n // ───────────────────────────────^ returned wrapper function\n async (...args: Args): Promise<R> => {\n for (let attempt = 0; ; attempt++) {\n try {\n return await fn(...args);\n } catch (err) {\n onError?.(err as Error);\n logger(['Request failed', err], {\n level: 'error',\n });\n if (attempt >= maxRetry) throw err; // out of retries\n if (delay > 0) await new Promise((res) => setTimeout(res, delay));\n }\n }\n };\n"],"mappings":"AAAA,SAAS,cAAc;AAWvB,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AASf,MAAM,eACX,CACE,IACA;AAAA,EACE,WAAW;AAAA,EACX,QAAQ;AAAA,EACR;AACF,IAAyB,CAAC;AAAA;AAAA,EAG5B,UAAU,SAA2B;AACnC,aAAS,UAAU,KAAK,WAAW;AACjC,UAAI;AACF,eAAO,MAAM,GAAG,GAAG,IAAI;AAAA,MACzB,SAAS,KAAK;AACZ,kBAAU,GAAY;AACtB,eAAO,CAAC,kBAAkB,GAAG,GAAG;AAAA,UAC9B,OAAO;AAAA,QACT,CAAC;AACD,YAAI,WAAW,SAAU,OAAM;AAC/B,YAAI,QAAQ,EAAG,OAAM,IAAI,QAAQ,CAAC,QAAQ,WAAW,KAAK,KAAK,CAAC;AAAA,MAClE;AAAA,IACF;AAAA,EACF;AAAA;","names":[]}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export type { CustomIntlayerConfig, PatternsContentConfig, IntlayerConfig, BaseContentConfig, BaseDerivedConfig, ResultDirDerivedConfig, } from './types/config';
|
|
2
|
-
export type { LocalesValues } from './types/locales';
|
|
3
|
-
export { Locales } from './types/locales';
|
|
4
1
|
export { logger } from './logger';
|
|
5
|
-
export {
|
|
2
|
+
export type { BaseContentConfig, BaseDerivedConfig, CustomIntlayerConfig, IntlayerConfig, PatternsContentConfig, ResultDirDerivedConfig, } from './types/config';
|
|
3
|
+
export { Locales } from './types/locales';
|
|
4
|
+
export type { LocalesValues } from './types/locales';
|
|
6
5
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAKV,oBAAoB,EAGpB,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAkjBzB;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,oBAAoB,EAC1C,UAAU,MAAM,KACf,cA8BF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LoadEnvFileOptions } from '../envVariables/loadEnvFile';
|
|
2
|
-
import type { IntlayerConfig } from '../types/config';
|
|
2
|
+
import type { CustomIntlayerConfig, IntlayerConfig } from '../types/config';
|
|
3
3
|
export type GetConfigurationOptions = {
|
|
4
4
|
baseDir?: string;
|
|
5
|
-
|
|
5
|
+
override?: CustomIntlayerConfig;
|
|
6
6
|
} & LoadEnvFileOptions;
|
|
7
7
|
/**
|
|
8
8
|
* Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/configFile/getConfiguration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/configFile/getConfiguration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAS5E,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,GAAG,kBAAkB,CAAC;AAIvB;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,uBAAuB,KAChC,cA0CF,CAAC"}
|
|
@@ -13,6 +13,6 @@ type SearchConfigurationFileResult = {
|
|
|
13
13
|
* - intlayer.config.mjs
|
|
14
14
|
* - .intlayerrc
|
|
15
15
|
*/
|
|
16
|
-
export declare const searchConfigurationFile: (configFilePath
|
|
16
|
+
export declare const searchConfigurationFile: (configFilePath?: string) => SearchConfigurationFileResult;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=searchConfigurationFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchConfigurationFile.d.ts","sourceRoot":"","sources":["../../../src/configFile/searchConfigurationFile.ts"],"names":[],"mappings":"AAcA,KAAK,6BAA6B,GAAG;IACnC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,
|
|
1
|
+
{"version":3,"file":"searchConfigurationFile.d.ts","sourceRoot":"","sources":["../../../src/configFile/searchConfigurationFile.ts"],"names":[],"mappings":"AAcA,KAAK,6BAA6B,GAAG;IACnC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,iBAAgB,MAAsB,KACrC,6BA2BF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { DictionaryOutput } from '../types/config';
|
|
2
2
|
export declare const FILE_EXTENSIONS: string[];
|
|
3
3
|
export declare const EXCLUDED_PATHS: string[];
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
4
|
+
export declare const CONTENT_DIR: string[];
|
|
5
|
+
export declare const MAIN_DIR = ".intlayer/main";
|
|
6
|
+
export declare const DICTIONARIES_DIR = ".intlayer/dictionary";
|
|
7
|
+
export declare const UNMERGED_DICTIONARIES_DIR = ".intlayer/unmerged_dictionary";
|
|
8
|
+
export declare const TYPES_DIR = ".intlayer/types";
|
|
9
|
+
export declare const MODULE_AUGMENTATION_DIR = ".intlayer/types";
|
|
7
10
|
export declare const DICTIONARY_OUTPUT: DictionaryOutput[];
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const TYPES_DIR_NAME = "types";
|
|
12
|
-
export declare const MAIN_DIR_NAME = "main";
|
|
13
|
-
export declare const CONFIG_DIR_NAME = "config";
|
|
11
|
+
export declare const I18NEXT_DICTIONARIES_DIR = "i18next_resources";
|
|
12
|
+
export declare const REACT_INTL_MESSAGES_DIR = "intl_messages";
|
|
13
|
+
export declare const CONFIG_DIR = ".intlayer/config";
|
|
14
14
|
export declare const WATCH: boolean;
|
|
15
15
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,eAAe,UAU3B,CAAC;AACF,eAAO,MAAM,cAAc,UAAmB,CAAC;AAE/C,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,eAAe,UAU3B,CAAC;AACF,eAAO,MAAM,cAAc,UAAmB,CAAC;AAE/C,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,eAAO,MAAM,QAAQ,mBAAmB,CAAC;AAEzC,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AAEzE,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAE3C,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAAiB,CAAC;AAElE,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAE7C,eAAO,MAAM,KAAK,SAAyC,CAAC"}
|
|
@@ -6,7 +6,4 @@ export declare const BACKEND_URL = "https://back.intlayer.org";
|
|
|
6
6
|
export declare const IS_ENABLED = true;
|
|
7
7
|
export declare const HOT_RELOAD = false;
|
|
8
8
|
export declare const DICTIONARY_PRIORITY_STRATEGY = "local_first";
|
|
9
|
-
export declare const OPEN_AI_API_KEY = "";
|
|
10
|
-
export declare const OPEN_AI_API_MODEL = "gpt-4o-2024-11-20";
|
|
11
|
-
export declare const OPEN_AI_API_TEMPERATURE = 0.1;
|
|
12
9
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/editor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,IAAI,OAAO,CAAC;AACzB,eAAO,MAAM,WAAW,8BAA8B,CAAC;AACvD,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,UAAU,QAAQ,CAAC;AAChC,eAAO,MAAM,4BAA4B,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/editor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,IAAI,OAAO,CAAC;AACzB,eAAO,MAAM,WAAW,8BAA8B,CAAC;AACvD,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,UAAU,QAAQ,CAAC;AAChC,eAAO,MAAM,4BAA4B,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,sBAAsB,QAAO,yBA6EzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react_app.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react_app.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,0BAA0B,QAAO,yBA6E7C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IntlayerConfig } from '../../client';
|
|
2
2
|
export type ReplaceValue<T> = {
|
|
3
|
-
[K in keyof T]: string | undefined;
|
|
3
|
+
[K in keyof T]: string | number | boolean | undefined;
|
|
4
4
|
};
|
|
5
5
|
export type IntlayerConfigEnvVariable = {
|
|
6
6
|
[K in keyof IntlayerConfig]: ReplaceValue<IntlayerConfig[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS;CACtD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;KACrC,CAAC,IAAI,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;CAC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undefined_platform.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"undefined_platform.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,uBAAuB,QAAO,yBA0E1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAGvE,eAAO,MAAM,sBAAsB,QAAO,yBAoFzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/envVariables/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/envVariables/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,yBAAyB,KAClC,cAiHF,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { getConfiguration, type GetConfigurationOptions, } from './configFile/getConfiguration';
|
|
2
|
-
export
|
|
3
|
-
export type { LocalesValues } from './types/locales';
|
|
4
|
-
export { Locales } from './types/locales';
|
|
5
|
-
export { formatEnvVariable, getConfiguration as getClientConfiguration, getEnvFilePath, loadEnvFile, getPlatform, } from './envVariables/index';
|
|
6
|
-
export { ESMxCJSRequire } from './utils/ESMxCJSRequire';
|
|
7
|
-
export { logger } from './logger';
|
|
8
|
-
export { appLogger } from './appLoggerServer';
|
|
2
|
+
export { formatEnvVariable, getConfiguration as getClientConfiguration, getEnvFilePath, getPlatform, loadEnvFile, } from './envVariables/index';
|
|
9
3
|
export { getSandBoxContext } from './getSandboxContext';
|
|
10
4
|
export { loadExternalFile } from './loadExternalFile';
|
|
5
|
+
export { getAppLogger, logger, type Logger } from './logger';
|
|
6
|
+
export { retryManager } from './retryManager';
|
|
7
|
+
export type { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, InternationalizationConfig, IntlayerConfig, LogConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule, StrictMode, } from './types/config';
|
|
8
|
+
export { Locales } from './types/locales';
|
|
9
|
+
export type { LocalesValues } from './types/locales';
|
|
10
|
+
export { ESMxCJSRequire } from './utils/ESMxCJSRequire';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,IAAI,sBAAsB,EAC1C,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/types/logger.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CustomIntlayerConfig } from './types/config';
|
|
2
2
|
export type Details = {
|
|
3
3
|
isVerbose?: boolean;
|
|
4
4
|
level?: 'info' | 'warn' | 'error' | 'debug';
|
|
5
|
-
config?:
|
|
5
|
+
config?: CustomIntlayerConfig['log'];
|
|
6
6
|
};
|
|
7
7
|
export type Logger = (content: any, details?: Details) => void;
|
|
8
8
|
export declare const logger: Logger;
|
|
9
|
+
/**
|
|
10
|
+
* The appLogger function takes the logger and merges it with the configuration from the intlayer config file.
|
|
11
|
+
* It allows overriding the default configuration by passing a config object in the details parameter.
|
|
12
|
+
* The configuration is merged with the default configuration from the intlayer config file.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getAppLogger: (configuration?: CustomIntlayerConfig) => (content: any, details?: Details) => void;
|
|
9
15
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAC5C,MAAM,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE/D,eAAO,MAAM,MAAM,EAAE,MAoCpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GACtB,gBAAgB,oBAAoB,MAAM,SAAS,GAAG,EAAE,UAAU,OAAO,SAItE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type RetryManagerOptions = {
|
|
2
|
+
/** maximum number of retries before giving up */
|
|
3
|
+
maxRetry?: number;
|
|
4
|
+
/** delay between attempts, in milliseconds */
|
|
5
|
+
delay?: number;
|
|
6
|
+
/** function to call when an error occurs */
|
|
7
|
+
onError?: (err: Error) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Wrap an async function `fn` so it’s retried on failure.
|
|
11
|
+
*
|
|
12
|
+
* @param fn The async function to wrap
|
|
13
|
+
* @param options { maxRetry, delay }
|
|
14
|
+
* @returns A new function with the same signature as `fn`
|
|
15
|
+
*/
|
|
16
|
+
export declare const retryManager: <Args extends any[], R>(fn: (...args: Args) => Promise<R>, { maxRetry, delay, onError, }?: RetryManagerOptions) => ((...args: Args) => Promise<R>);
|
|
17
|
+
//# sourceMappingURL=retryManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retryManager.d.ts","sourceRoot":"","sources":["../../src/retryManager.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG;IAChC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC,CAAC;AAKF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACtB,IAAI,SAAS,GAAG,EAAE,EAAE,CAAC,EACpB,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EACjC,gCAIG,mBAAwB,KAC1B,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAehC,CAAC"}
|