@vtex/api 7.2.6-beta.0 → 7.2.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.
|
@@ -17,8 +17,8 @@ class TelemetryClientSingleton {
|
|
|
17
17
|
this.initializeMetricsClient = async (telemetryClient) => await telemetryClient.newMetricsClient({
|
|
18
18
|
exporter: diagnostics_nodejs_1.Exporters.CreateExporter(diagnostics_nodejs_1.Exporters.CreateMetricsExporterConfig({
|
|
19
19
|
endpoint: constants_1.OTEL_EXPORTER_OTLP_ENDPOINT,
|
|
20
|
-
interval:
|
|
21
|
-
timeoutSeconds:
|
|
20
|
+
interval: 60,
|
|
21
|
+
timeoutSeconds: 60,
|
|
22
22
|
}), 'otlp'),
|
|
23
23
|
});
|
|
24
24
|
this.initializeLogsClient = async (telemetryClient) => await telemetryClient.newLogsClient({
|
|
@@ -31,13 +31,13 @@ const handleSingleString = (ctx, loader, behavior, directiveName) => async (rawM
|
|
|
31
31
|
if (content == null) {
|
|
32
32
|
throw new Error(`@${directiveName} directive needs a content to translate, but received ${JSON.stringify(rawMessage)}`);
|
|
33
33
|
}
|
|
34
|
+
if (state === 'translated') {
|
|
35
|
+
return content;
|
|
36
|
+
}
|
|
34
37
|
const from = maybeFrom || (binding === null || binding === void 0 ? void 0 : binding.locale) || (tenant === null || tenant === void 0 ? void 0 : tenant.locale);
|
|
35
38
|
if (from == null) {
|
|
36
39
|
throw new Error(`@${directiveName} directive needs a source language to translate from. You can do this by either setting ${'`ctx.vtex.tenant`'} variable, call this app with the header ${'`x-vtex-tenant`'} or format the string with the ${'`formatTranslatableStringV2`'} function with the ${'`from`'} option set`);
|
|
37
40
|
}
|
|
38
|
-
if (state === 'translated') {
|
|
39
|
-
return content;
|
|
40
|
-
}
|
|
41
41
|
return loader.load({
|
|
42
42
|
behavior,
|
|
43
43
|
content,
|