@adminforth/i18n 1.2.2 → 1.2.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/dist/index.js +2 -2
- package/index.ts +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -361,7 +361,7 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
361
361
|
// if optional `confirm` is provided, user will be asked to confirm action
|
|
362
362
|
confirm: 'Are you sure you want to translate selected items?',
|
|
363
363
|
allowed: (_a) => __awaiter(this, [_a], void 0, function* ({ resource, adminUser, selectedIds, allowedActions }) {
|
|
364
|
-
console.log('allowedActions', JSON.stringify(allowedActions));
|
|
364
|
+
process.env.HEAVY_DEBUG && console.log('allowedActions', JSON.stringify(allowedActions));
|
|
365
365
|
return allowedActions.edit;
|
|
366
366
|
}),
|
|
367
367
|
action: (_a) => __awaiter(this, [_a], void 0, function* ({ selectedIds, tr }) {
|
|
@@ -445,7 +445,7 @@ ${JSON.stringify(strings.reduce((acc, s) => {
|
|
|
445
445
|
`;
|
|
446
446
|
// call OpenAI
|
|
447
447
|
const resp = yield this.options.completeAdapter.complete(prompt, [], prompt.length * 2);
|
|
448
|
-
console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
448
|
+
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
449
449
|
if (resp.error) {
|
|
450
450
|
throw new AiTranslateError(resp.error);
|
|
451
451
|
}
|
package/index.ts
CHANGED
|
@@ -410,7 +410,7 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
410
410
|
// if optional `confirm` is provided, user will be asked to confirm action
|
|
411
411
|
confirm: 'Are you sure you want to translate selected items?',
|
|
412
412
|
allowed: async ({ resource, adminUser, selectedIds, allowedActions }) => {
|
|
413
|
-
console.log('allowedActions', JSON.stringify(allowedActions));
|
|
413
|
+
process.env.HEAVY_DEBUG && console.log('allowedActions', JSON.stringify(allowedActions));
|
|
414
414
|
return allowedActions.edit;
|
|
415
415
|
},
|
|
416
416
|
action: async ({ selectedIds, tr }) => {
|
|
@@ -509,8 +509,7 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
|
|
|
509
509
|
prompt.length * 2,
|
|
510
510
|
);
|
|
511
511
|
|
|
512
|
-
console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
513
|
-
|
|
512
|
+
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
514
513
|
|
|
515
514
|
if (resp.error) {
|
|
516
515
|
throw new AiTranslateError(resp.error);
|