@adminforth/i18n 2.0.11 → 2.0.13

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 CHANGED
@@ -459,14 +459,13 @@ export default class I18nPlugin extends AdminForthPlugin {
459
459
  const jsonSchemaRequired = strings.map(s => s.en_string);
460
460
  const dedupRequired = Array.from(new Set(jsonSchemaRequired));
461
461
  // call OpenAI
462
- const resp = yield this.options.completeAdapter.complete(prompt, [], prompt.length * 2, {
463
- json_schema: {
464
- name: "translation_response",
465
- schema: {
466
- type: "object",
467
- properties: jsonSchemaProperties,
468
- required: dedupRequired,
469
- },
462
+ const resp = yield this.options.completeAdapter.complete(prompt, prompt.length * 2, {
463
+ name: "translation_response",
464
+ schema: {
465
+ type: "object",
466
+ properties: jsonSchemaProperties,
467
+ required: dedupRequired,
468
+ additionalProperties: false,
470
469
  },
471
470
  });
472
471
  process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
package/index.ts CHANGED
@@ -538,17 +538,15 @@ export default class I18nPlugin extends AdminForthPlugin {
538
538
  // call OpenAI
539
539
  const resp = await this.options.completeAdapter.complete(
540
540
  prompt,
541
- [],
542
541
  prompt.length * 2,
543
542
  {
544
- json_schema: {
545
543
  name: "translation_response",
546
544
  schema: {
547
545
  type: "object",
548
546
  properties: jsonSchemaProperties,
549
547
  required: dedupRequired,
548
+ additionalProperties: false,
550
549
  },
551
- },
552
550
  }
553
551
  );
554
552
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -38,10 +38,11 @@
38
38
  "p-limit": "^7.3.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "adminforth": "^2.24.0"
41
+ "adminforth": "^2.35.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.10.7",
45
+ "adminforth": "^2.35.0",
45
46
  "i18n-iso-countries": "^7.13.0",
46
47
  "semantic-release": "^24.2.1",
47
48
  "semantic-release-slack-bot": "^4.0.2",
package/types.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { CompletionAdapter, EmailAdapter } from 'adminforth';
2
2
  import type { LanguageCode } from 'iso-639-1';
3
3
  import { iso31661Alpha2ToAlpha3 } from 'iso-3166';
4
-
4
+ import {type PluginsCommonOptions } from "adminforth";
5
5
 
6
6
  // BCP-47 support for types only: primary subtag is ISO 639-1, optional region
7
7
  type Alpha2Code = keyof typeof iso31661Alpha2ToAlpha3;
8
8
  type Bcp47LanguageTag = `${LanguageCode}-${Alpha2Code}`;
9
9
  export type SupportedLanguage = LanguageCode | Bcp47LanguageTag;
10
10
 
11
- export interface PluginOptions {
11
+ export interface PluginOptions extends PluginsCommonOptions {
12
12
 
13
13
  /* List of language codes which you want to support. Can be either short ISO 639-1 language codes or/and BCP47 tags */
14
14
  supportedLanguages: SupportedLanguage[];