@intlayer/cli 6.0.0 → 6.0.2-canary.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.
Files changed (86) hide show
  1. package/dist/cjs/cli.cjs +15 -1
  2. package/dist/cjs/cli.cjs.map +1 -1
  3. package/dist/cjs/fill/index.cjs +76 -84
  4. package/dist/cjs/fill/index.cjs.map +1 -1
  5. package/dist/cjs/{fill/getTargetDictionary.cjs → getTargetDictionary.cjs} +6 -15
  6. package/dist/cjs/getTargetDictionary.cjs.map +1 -0
  7. package/dist/cjs/listContentDeclaration.cjs +3 -12
  8. package/dist/cjs/listContentDeclaration.cjs.map +1 -1
  9. package/dist/cjs/liveSync.cjs +2 -2
  10. package/dist/cjs/liveSync.cjs.map +1 -1
  11. package/dist/cjs/pull.cjs +3 -6
  12. package/dist/cjs/pull.cjs.map +1 -1
  13. package/dist/cjs/push.cjs +13 -9
  14. package/dist/cjs/push.cjs.map +1 -1
  15. package/dist/cjs/pushConfig.cjs +3 -10
  16. package/dist/cjs/pushConfig.cjs.map +1 -1
  17. package/dist/cjs/reviewDoc.cjs +16 -11
  18. package/dist/cjs/reviewDoc.cjs.map +1 -1
  19. package/dist/cjs/test/index.cjs +1 -1
  20. package/dist/cjs/test/index.cjs.map +1 -1
  21. package/dist/cjs/test/listMissingTranslations.cjs +8 -16
  22. package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
  23. package/dist/cjs/translateDoc.cjs +15 -7
  24. package/dist/cjs/translateDoc.cjs.map +1 -1
  25. package/dist/cjs/utils/checkAccess.cjs +77 -0
  26. package/dist/cjs/utils/checkAccess.cjs.map +1 -0
  27. package/dist/cjs/utils/chunkInference.cjs +1 -2
  28. package/dist/cjs/utils/chunkInference.cjs.map +1 -1
  29. package/dist/esm/cli.mjs +15 -1
  30. package/dist/esm/cli.mjs.map +1 -1
  31. package/dist/esm/fill/index.mjs +83 -74
  32. package/dist/esm/fill/index.mjs.map +1 -1
  33. package/dist/esm/{fill/getTargetDictionary.mjs → getTargetDictionary.mjs} +4 -3
  34. package/dist/esm/getTargetDictionary.mjs.map +1 -0
  35. package/dist/esm/listContentDeclaration.mjs +2 -1
  36. package/dist/esm/listContentDeclaration.mjs.map +1 -1
  37. package/dist/esm/liveSync.mjs +2 -2
  38. package/dist/esm/liveSync.mjs.map +1 -1
  39. package/dist/esm/pull.mjs +3 -6
  40. package/dist/esm/pull.mjs.map +1 -1
  41. package/dist/esm/push.mjs +11 -7
  42. package/dist/esm/push.mjs.map +1 -1
  43. package/dist/esm/pushConfig.mjs +3 -10
  44. package/dist/esm/pushConfig.mjs.map +1 -1
  45. package/dist/esm/reviewDoc.mjs +16 -11
  46. package/dist/esm/reviewDoc.mjs.map +1 -1
  47. package/dist/esm/test/index.mjs +1 -1
  48. package/dist/esm/test/index.mjs.map +1 -1
  49. package/dist/esm/test/listMissingTranslations.mjs +8 -4
  50. package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
  51. package/dist/esm/translateDoc.mjs +15 -7
  52. package/dist/esm/translateDoc.mjs.map +1 -1
  53. package/dist/esm/utils/checkAccess.mjs +52 -0
  54. package/dist/esm/utils/checkAccess.mjs.map +1 -0
  55. package/dist/esm/utils/chunkInference.mjs +2 -6
  56. package/dist/esm/utils/chunkInference.mjs.map +1 -1
  57. package/dist/types/cli.d.ts.map +1 -1
  58. package/dist/types/fill/index.d.ts +3 -9
  59. package/dist/types/fill/index.d.ts.map +1 -1
  60. package/dist/types/getTargetDictionary.d.ts +15 -0
  61. package/dist/types/getTargetDictionary.d.ts.map +1 -0
  62. package/dist/types/listContentDeclaration.d.ts.map +1 -1
  63. package/dist/types/pull.d.ts.map +1 -1
  64. package/dist/types/push.d.ts.map +1 -1
  65. package/dist/types/pushConfig.d.ts.map +1 -1
  66. package/dist/types/reviewDoc.d.ts +2 -2
  67. package/dist/types/reviewDoc.d.ts.map +1 -1
  68. package/dist/types/test/listMissingTranslations.d.ts +4 -4
  69. package/dist/types/test/listMissingTranslations.d.ts.map +1 -1
  70. package/dist/types/translateDoc.d.ts +2 -2
  71. package/dist/types/translateDoc.d.ts.map +1 -1
  72. package/dist/types/utils/checkAccess.d.ts +5 -0
  73. package/dist/types/utils/checkAccess.d.ts.map +1 -0
  74. package/dist/types/utils/chunkInference.d.ts +2 -2
  75. package/dist/types/utils/chunkInference.d.ts.map +1 -1
  76. package/package.json +17 -17
  77. package/dist/cjs/fill/getTargetDictionary.cjs.map +0 -1
  78. package/dist/cjs/utils/checkAIAccess.cjs +0 -44
  79. package/dist/cjs/utils/checkAIAccess.cjs.map +0 -1
  80. package/dist/esm/fill/getTargetDictionary.mjs.map +0 -1
  81. package/dist/esm/utils/checkAIAccess.mjs +0 -20
  82. package/dist/esm/utils/checkAIAccess.mjs.map +0 -1
  83. package/dist/types/fill/getTargetDictionary.d.ts +0 -4
  84. package/dist/types/fill/getTargetDictionary.d.ts.map +0 -1
  85. package/dist/types/utils/checkAIAccess.d.ts +0 -4
  86. package/dist/types/utils/checkAIAccess.d.ts.map +0 -1
@@ -0,0 +1,15 @@
1
+ import { ListGitFilesOptions } from '@intlayer/chokidar';
2
+ import { GetConfigurationOptions } from '@intlayer/config';
3
+ import { Dictionary } from '@intlayer/core';
4
+ export declare const ensureArray: <T>(value: T | T[]) => T[];
5
+ export type GetTargetDictionaryOptions = {
6
+ file?: string | string[];
7
+ keys?: string | string[];
8
+ excludedKeys?: string | string[];
9
+ filter?: (entry: Dictionary) => boolean;
10
+ pathFilter?: string | string[];
11
+ gitOptions?: ListGitFilesOptions;
12
+ configOptions?: GetConfigurationOptions;
13
+ };
14
+ export declare const getTargetUnmergedDictionaries: (options: GetTargetDictionaryOptions) => Promise<Dictionary[]>;
15
+ //# sourceMappingURL=getTargetDictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTargetDictionary.d.ts","sourceRoot":"","sources":["../../src/getTargetDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,KAAG,CAAC,EAA2B,CAAC;AAG7E,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,SAAS,0BAA0B,KAClC,OAAO,CAAC,UAAU,EAAE,CA4DtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"listContentDeclaration.d.ts","sourceRoot":"","sources":["../../src/listContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAI1B,KAAK,6BAA6B,GAAG;IACnC,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,6BAA6B;;;GAWxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,UAAU,6BAA6B,SA+BxC,CAAC"}
1
+ {"version":3,"file":"listContentDeclaration.d.ts","sourceRoot":"","sources":["../../src/listContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAI1B,KAAK,6BAA6B,GAAG;IACnC,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,6BAA6B;;;GAaxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,UAAU,6BAA6B,SA+BxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/pull.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAM1B,KAAK,WAAW,GAAG;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AASF;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAU,UAAU,WAAW,KAAG,OAAO,CAAC,IAAI,CAoP9D,CAAC"}
1
+ {"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/pull.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAO1B,KAAK,WAAW,GAAG;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AASF;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAU,UAAU,WAAW,KAAG,OAAO,CAAC,IAAI,CAiP9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/push.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAO1B,KAAK,WAAW,GAAG;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,IAAI,GAAU,UAAU,WAAW,KAAG,OAAO,CAAC,IAAI,CAkM9D,CAAC"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/push.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAS1B,KAAK,WAAW,GAAG;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,IAAI,GAAU,UAAU,WAAW,KAAG,OAAO,CAAC,IAAI,CAuM9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pushConfig.d.ts","sourceRoot":"","sources":["../../src/pushConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,UAAU,WAAW,kBAiCrD,CAAC"}
1
+ {"version":3,"file":"pushConfig.d.ts","sourceRoot":"","sources":["../../src/pushConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAG1B,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,UAAU,WAAW,kBAyBrD,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { AIOptions } from '@intlayer/api';
2
2
  import { ListGitFilesOptions } from '@intlayer/chokidar';
3
- import { GetConfigurationOptions, Locales } from '@intlayer/config';
3
+ import { GetConfigurationOptions, IntlayerConfig, Locales } from '@intlayer/config';
4
4
  /**
5
5
  * Translate a single file for a given locale
6
6
  */
7
- export declare const reviewFile: (baseFilePath: string, outputFilePath: string, locale: Locales, baseLocale: Locales, aiOptions?: AIOptions, configOptions?: GetConfigurationOptions, customInstructions?: string, changedLines?: number[]) => Promise<void>;
7
+ export declare const reviewFile: (baseFilePath: string, outputFilePath: string, locale: Locales, baseLocale: Locales, aiOptions?: AIOptions, configuration?: IntlayerConfig, customInstructions?: string, changedLines?: number[]) => Promise<void>;
8
8
  type ReviewDocOptions = {
9
9
  docPattern: string[];
10
10
  locales: Locales[];
@@ -1 +1 @@
1
- {"version":3,"file":"reviewDoc.d.ts","sourceRoot":"","sources":["../../src/reviewDoc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAIL,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAOL,uBAAuB,EACvB,OAAO,EAER,MAAM,kBAAkB,CAAC;AAoB1B;;GAEG;AACH,eAAO,MAAM,UAAU,GACrB,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,QAAQ,OAAO,EACf,YAAY,OAAO,EACnB,YAAY,SAAS,EACrB,gBAAgB,uBAAuB,EACvC,qBAAqB,MAAM,EAC3B,eAAe,MAAM,EAAE,kBA4IxB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,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MAAM,GAAG,IAAI,CAAC;IAC9C,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAU,6LAY7B,gBAAgB,kBAuGlB,CAAC"}
@@ -1,8 +1,8 @@
1
- import type { Locales } from '@intlayer/config';
2
- import unmergedDictionariesRecord from '@intlayer/unmerged-dictionaries-entry';
3
- export declare const listMissingTranslations: (dictionariesRecord?: keyof typeof unmergedDictionariesRecord) => {
1
+ import { GetConfigurationOptions, type Locales } from '@intlayer/config';
2
+ import { type Dictionary } from '@intlayer/core';
3
+ export declare const listMissingTranslations: (dictionariesRecord?: Record<string, Dictionary[]>, configurationOptions?: GetConfigurationOptions) => {
4
4
  missingTranslations: {
5
- key: keyof typeof unmergedDictionariesRecord;
5
+ key: string;
6
6
  filePath?: string;
7
7
  locales: Locales[];
8
8
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"listMissingTranslations.d.ts","sourceRoot":"","sources":["../../../src/test/listMissingTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAE/E,eAAO,MAAM,uBAAuB,GAClC,qBAAoB,MAAM,OAAO,0BAAuD;;aAGjF,MAAM,OAAO,0BAA0B;mBACjC,MAAM;iBACR,OAAO,EAAE;;;;CAqCrB,CAAC"}
1
+ {"version":3,"file":"listMissingTranslations.d.ts","sourceRoot":"","sources":["../../../src/test/listMissingTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EACjD,uBAAuB,uBAAuB;;aAOvC,MAAM;mBACA,MAAM;iBACR,OAAO,EAAE;;;;CAqCrB,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { AIOptions } from '@intlayer/api';
2
2
  import { ListGitFilesOptions } from '@intlayer/chokidar';
3
- import { GetConfigurationOptions, Locales } from '@intlayer/config';
3
+ import { GetConfigurationOptions, IntlayerConfig, Locales } from '@intlayer/config';
4
4
  /**
5
5
  * Translate a single file for a given locale
6
6
  */
7
- export declare const translateFile: (baseFilePath: string, outputFilePath: string, locale: Locales, baseLocale: Locales, aiOptions?: AIOptions, configOptions?: GetConfigurationOptions, customInstructions?: string) => Promise<void>;
7
+ export declare const translateFile: (baseFilePath: string, outputFilePath: string, locale: Locales, baseLocale: Locales, aiOptions?: AIOptions, configuration?: IntlayerConfig, customInstructions?: string) => Promise<void>;
8
8
  type TranslateDocOptions = {
9
9
  docPattern: string[];
10
10
  locales: Locales[];
@@ -1 +1 @@
1
- {"version":3,"file":"translateDoc.d.ts","sourceRoot":"","sources":["../../src/translateDoc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAIL,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAOL,uBAAuB,EACvB,OAAO,EAER,MAAM,kBAAkB,CAAC;AAmB1B;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,QAAQ,OAAO,EACf,YAAY,OAAO,EACnB,YAAY,SAAS,EACrB,gBAAgB,uBAAuB,EACvC,qBAAqB,MAAM,kBAmH5B,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,SA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,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAU,6LAYhC,mBAAmB,kBAgGrB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { AIOptions } from '@intlayer/api';
2
+ import { type IntlayerConfig } from '@intlayer/config';
3
+ export declare const checkCMSAuth: (configuration: IntlayerConfig) => Promise<boolean>;
4
+ export declare const checkAIAccess: (configuration: IntlayerConfig, aiOptions?: AIOptions) => Promise<boolean>;
5
+ //# sourceMappingURL=checkAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkAccess.d.ts","sourceRoot":"","sources":["../../../src/utils/checkAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAErE,eAAO,MAAM,YAAY,GACvB,eAAe,cAAc,KAC5B,OAAO,CAAC,OAAO,CA8BjB,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,eAAe,cAAc,EAC7B,YAAY,SAAS,KACpB,OAAO,CAAC,OAAO,CA0BjB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type AIOptions, type Messages } from '@intlayer/api';
2
- import { type GetConfigurationOptions } from '@intlayer/config';
2
+ import { type IntlayerConfig } from '@intlayer/config';
3
3
  type ChunkInferenceResult = {
4
4
  fileContent: string;
5
5
  tokenUsed: number;
@@ -8,6 +8,6 @@ type ChunkInferenceResult = {
8
8
  * Translates a single chunk via the OpenAI API.
9
9
  * Includes retry logic if the call fails.
10
10
  */
11
- export declare const chunkInference: (messages: Messages, aiOptions?: AIOptions, configOptions?: GetConfigurationOptions) => Promise<ChunkInferenceResult>;
11
+ export declare const chunkInference: (messages: Messages, aiOptions?: AIOptions, configuration?: IntlayerConfig) => Promise<ChunkInferenceResult>;
12
12
  export {};
13
13
  //# sourceMappingURL=chunkInference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunkInference.d.ts","sourceRoot":"","sources":["../../../src/utils/chunkInference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,QAAQ,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,oBAAoB,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,QAAQ,EAClB,YAAY,SAAS,EACrB,gBAAgB,uBAAuB,KACtC,OAAO,CAAC,oBAAoB,CA0C9B,CAAC"}
1
+ {"version":3,"file":"chunkInference.d.ts","sourceRoot":"","sources":["../../../src/utils/chunkInference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,QAAQ,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAErE,KAAK,oBAAoB,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,QAAQ,EAClB,YAAY,SAAS,EACrB,gBAAgB,cAAc,KAC7B,OAAO,CAAC,oBAAoB,CA0C9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/cli",
3
- "version": "6.0.0",
3
+ "version": "6.0.2-canary.0",
4
4
  "private": false,
5
5
  "description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
6
6
  "keywords": [
@@ -53,12 +53,12 @@
53
53
  "eventsource": "^3.0.7",
54
54
  "fast-glob": "^3.3.3",
55
55
  "p-limit": "^3.1.0",
56
- "@intlayer/config": "6.0.0",
57
- "@intlayer/chokidar": "6.0.0",
58
- "@intlayer/dictionaries-entry": "6.0.0",
59
- "@intlayer/remote-dictionaries-entry": "6.0.0",
60
- "@intlayer/unmerged-dictionaries-entry": "6.0.0",
61
- "@intlayer/api": "6.0.0"
56
+ "@intlayer/chokidar": "6.0.2-canary.0",
57
+ "@intlayer/config": "6.0.2-canary.0",
58
+ "@intlayer/dictionaries-entry": "6.0.2-canary.0",
59
+ "@intlayer/unmerged-dictionaries-entry": "6.0.2-canary.0",
60
+ "@intlayer/api": "6.0.2-canary.0",
61
+ "@intlayer/remote-dictionaries-entry": "6.0.2-canary.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/node": "^24.2.1",
@@ -71,19 +71,19 @@
71
71
  "tsup": "^8.5.0",
72
72
  "typescript": "^5.9.2",
73
73
  "vitest": "^3.2.4",
74
- "@utils/eslint-config": "1.0.4",
74
+ "@intlayer/core": "6.0.2-canary.0",
75
75
  "@utils/ts-config": "1.0.4",
76
- "@utils/tsup-config": "1.0.4",
77
- "@intlayer/core": "6.0.0",
78
- "@utils/ts-config-types": "1.0.4"
76
+ "@utils/eslint-config": "1.0.4",
77
+ "@utils/ts-config-types": "1.0.4",
78
+ "@utils/tsup-config": "1.0.4"
79
79
  },
80
80
  "peerDependencies": {
81
- "@intlayer/chokidar": "6.0.0",
82
- "@intlayer/config": "6.0.0",
83
- "@intlayer/api": "6.0.0",
84
- "@intlayer/remote-dictionaries-entry": "6.0.0",
85
- "@intlayer/unmerged-dictionaries-entry": "6.0.0",
86
- "@intlayer/dictionaries-entry": "6.0.0"
81
+ "@intlayer/api": "6.0.2-canary.0",
82
+ "@intlayer/config": "6.0.2-canary.0",
83
+ "@intlayer/chokidar": "6.0.2-canary.0",
84
+ "@intlayer/dictionaries-entry": "6.0.2-canary.0",
85
+ "@intlayer/remote-dictionaries-entry": "6.0.2-canary.0",
86
+ "@intlayer/unmerged-dictionaries-entry": "6.0.2-canary.0"
87
87
  },
88
88
  "bug": {
89
89
  "url": "https://github.com/aymericzip/intlayer/issues"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/fill/getTargetDictionary.ts"],"sourcesContent":["import { listGitFiles } from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport unmergedDictionariesRecord from '@intlayer/unmerged-dictionaries-entry';\nimport { join } from 'path';\nimport type { FillOptions } from './index';\n\nexport const ensureArray = <T>(value: T | T[]): T[] => [value].flat() as T[];\n\nexport const getTargetDictionary = async (options: FillOptions) => {\n const configuration = getConfiguration(options.configOptions);\n\n const { baseDir } = configuration.content;\n\n let result = Object.values(unmergedDictionariesRecord).flat();\n\n // 1. if filePath not defined, list all content declaration files based on unmerged dictionaries list\n if (typeof options.file !== 'undefined') {\n const fileArray = ensureArray(options.file);\n const absoluteFilePaths = fileArray.map((file) => join(baseDir, file));\n\n result = result.filter(\n (dict) =>\n dict.filePath &&\n (absoluteFilePaths.includes(dict.filePath) ||\n absoluteFilePaths.includes(join(baseDir, dict.filePath)))\n );\n }\n\n if (typeof options.keys !== 'undefined') {\n result = result.filter((dict) =>\n ensureArray(options.keys)?.includes(dict.key)\n );\n }\n\n if (typeof options.excludedKeys !== 'undefined') {\n result = result.filter(\n (dict) => !ensureArray(options.excludedKeys)?.includes(dict.key)\n );\n }\n\n if (typeof options.pathFilter !== 'undefined') {\n result = result.filter((dict) =>\n ensureArray(options.pathFilter)?.includes(dict.filePath ?? '')\n );\n }\n\n if (typeof options.filter !== 'undefined') {\n result = result.filter(options.filter);\n }\n\n const gitOptions = options.gitOptions;\n if (gitOptions) {\n const gitChangedFiles = await listGitFiles(gitOptions);\n\n if (gitChangedFiles) {\n // Convert dictionary file paths to be relative to git root for comparison\n\n // Filter dictionaries based on git changed files\n result = result.filter((dict) => {\n if (!dict.filePath) return false;\n\n return gitChangedFiles.some((gitFile) => dict.filePath === gitFile);\n });\n }\n }\n\n return result.filter((dict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AEA,QAAM,aAAa,QAAQ;AAC3B,MAAI,YAAY;AACd,UAAM,kBAAkB,UAAM,8BAAa,UAAU;AAErD,QAAI,iBAAiB;AAInB,eAAS,OAAO,OAAO,CAAC,SAAS;AAC/B,YAAI,CAAC,KAAK,SAAU,QAAO;AAE3B,eAAO,gBAAgB,KAAK,CAAC,YAAY,KAAK,aAAa,OAAO;AAAA,MACpE,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,OAAO,OAAO,CAAC,SAAS,CAAC,KAAK,UAAU;AACjD;","names":["unmergedDictionariesRecord"]}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var checkAIAccess_exports = {};
20
- __export(checkAIAccess_exports, {
21
- checkAIAccess: () => checkAIAccess
22
- });
23
- module.exports = __toCommonJS(checkAIAccess_exports);
24
- var import_config = require("@intlayer/config");
25
- const checkAIAccess = (configuration, aiOptions) => {
26
- const appLogger = (0, import_config.getAppLogger)(configuration, {
27
- config: {
28
- prefix: ""
29
- }
30
- });
31
- if (!configuration.editor.clientId && !configuration.editor.clientSecret && !configuration.ai?.apiKey && !aiOptions?.apiKey) {
32
- appLogger("AI options or API key not provided. Skipping AI translation.", {
33
- level: "error"
34
- });
35
- throw new Error(
36
- "AI options or API key not provided. Skipping AI translation."
37
- );
38
- }
39
- };
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {
42
- checkAIAccess
43
- });
44
- //# sourceMappingURL=checkAIAccess.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/checkAIAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getAppLogger, type IntlayerConfig } from '@intlayer/config';\n\nexport const checkAIAccess = (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n) => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n if (\n !configuration.editor.clientId &&\n !configuration.editor.clientSecret &&\n !configuration.ai?.apiKey &&\n !aiOptions?.apiKey\n ) {\n appLogger('AI options or API key not provided. Skipping AI translation.', {\n level: 'error',\n });\n // Potentially handle this case differently, e.g., by using a different translation method or stopping.\n\n throw new Error(\n 'AI options or API key not provided. Skipping AI translation.'\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAkD;AAE3C,MAAM,gBAAgB,CAC3B,eACA,cACG;AACH,QAAM,gBAAY,4BAAa,eAAe;AAAA,IAC5C,QAAQ;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF,CAAC;AAED,MACE,CAAC,cAAc,OAAO,YACtB,CAAC,cAAc,OAAO,gBACtB,CAAC,cAAc,IAAI,UACnB,CAAC,WAAW,QACZ;AACA,cAAU,gEAAgE;AAAA,MACxE,OAAO;AAAA,IACT,CAAC;AAGD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/fill/getTargetDictionary.ts"],"sourcesContent":["import { listGitFiles } from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport unmergedDictionariesRecord from '@intlayer/unmerged-dictionaries-entry';\nimport { join } from 'path';\nimport type { FillOptions } from './index';\n\nexport const ensureArray = <T>(value: T | T[]): T[] => [value].flat() as T[];\n\nexport const getTargetDictionary = async (options: FillOptions) => {\n const configuration = getConfiguration(options.configOptions);\n\n const { baseDir } = configuration.content;\n\n let result = Object.values(unmergedDictionariesRecord).flat();\n\n // 1. if filePath not defined, list all content declaration files based on unmerged dictionaries list\n if (typeof options.file !== 'undefined') {\n const fileArray = ensureArray(options.file);\n const absoluteFilePaths = fileArray.map((file) => join(baseDir, file));\n\n result = result.filter(\n (dict) =>\n dict.filePath &&\n (absoluteFilePaths.includes(dict.filePath) ||\n absoluteFilePaths.includes(join(baseDir, dict.filePath)))\n );\n }\n\n if (typeof options.keys !== 'undefined') {\n result = result.filter((dict) =>\n ensureArray(options.keys)?.includes(dict.key)\n );\n }\n\n if (typeof options.excludedKeys !== 'undefined') {\n result = result.filter(\n (dict) => !ensureArray(options.excludedKeys)?.includes(dict.key)\n );\n }\n\n if (typeof options.pathFilter !== 'undefined') {\n result = result.filter((dict) =>\n ensureArray(options.pathFilter)?.includes(dict.filePath ?? '')\n );\n }\n\n if (typeof options.filter !== 'undefined') {\n result = result.filter(options.filter);\n }\n\n const gitOptions = options.gitOptions;\n if (gitOptions) {\n const gitChangedFiles = await listGitFiles(gitOptions);\n\n if (gitChangedFiles) {\n // Convert dictionary file paths to be relative to git root for comparison\n\n // Filter dictionaries based on git changed files\n result = result.filter((dict) => {\n if (!dict.filePath) return false;\n\n return gitChangedFiles.some((gitFile) => dict.filePath === gitFile);\n });\n }\n }\n\n return result.filter((dict) => !dict.autoFilled);\n};\n"],"mappings":"AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,OAAO,gCAAgC;AACvC,SAAS,YAAY;AAGd,MAAM,cAAc,CAAI,UAAwB,CAAC,KAAK,EAAE,KAAK;AAE7D,MAAM,sBAAsB,OAAO,YAAyB;AACjE,QAAM,gBAAgB,iBAAiB,QAAQ,aAAa;AAE5D,QAAM,EAAE,QAAQ,IAAI,cAAc;AAElC,MAA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20 +0,0 @@
1
- import { getAppLogger } from "@intlayer/config";
2
- const checkAIAccess = (configuration, aiOptions) => {
3
- const appLogger = getAppLogger(configuration, {
4
- config: {
5
- prefix: ""
6
- }
7
- });
8
- if (!configuration.editor.clientId && !configuration.editor.clientSecret && !configuration.ai?.apiKey && !aiOptions?.apiKey) {
9
- appLogger("AI options or API key not provided. Skipping AI translation.", {
10
- level: "error"
11
- });
12
- throw new Error(
13
- "AI options or API key not provided. Skipping AI translation."
14
- );
15
- }
16
- };
17
- export {
18
- checkAIAccess
19
- };
20
- //# sourceMappingURL=checkAIAccess.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/checkAIAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getAppLogger, type IntlayerConfig } from '@intlayer/config';\n\nexport const checkAIAccess = (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n) => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n if (\n !configuration.editor.clientId &&\n !configuration.editor.clientSecret &&\n !configuration.ai?.apiKey &&\n !aiOptions?.apiKey\n ) {\n appLogger('AI options or API key not provided. Skipping AI translation.', {\n level: 'error',\n });\n // Potentially handle this case differently, e.g., by using a different translation method or stopping.\n\n throw new Error(\n 'AI options or API key not provided. Skipping AI translation.'\n );\n }\n};\n"],"mappings":"AACA,SAAS,oBAAyC;AAE3C,MAAM,gBAAgB,CAC3B,eACA,cACG;AACH,QAAM,YAAY,aAAa,eAAe;AAAA,IAC5C,QAAQ;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF,CAAC;AAED,MACE,CAAC,cAAc,OAAO,YACtB,CAAC,cAAc,OAAO,gBACtB,CAAC,cAAc,IAAI,UACnB,CAAC,WAAW,QACZ;AACA,cAAU,gEAAgE;AAAA,MACxE,OAAO;AAAA,IACT,CAAC;AAGD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,4 +0,0 @@
1
- import type { FillOptions } from './index';
2
- export declare const ensureArray: <T>(value: T | T[]) => T[];
3
- export declare const getTargetDictionary: (options: FillOptions) => Promise<import("intlayer").Dictionary[]>;
4
- //# sourceMappingURL=getTargetDictionary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTargetDictionary.d.ts","sourceRoot":"","sources":["../../../src/fill/getTargetDictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,KAAG,CAAC,EAA2B,CAAC;AAE7E,eAAO,MAAM,mBAAmB,GAAU,SAAS,WAAW,6CA2D7D,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { AIOptions } from '@intlayer/api';
2
- import { type IntlayerConfig } from '@intlayer/config';
3
- export declare const checkAIAccess: (configuration: IntlayerConfig, aiOptions?: AIOptions) => void;
4
- //# sourceMappingURL=checkAIAccess.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkAIAccess.d.ts","sourceRoot":"","sources":["../../../src/utils/checkAIAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAErE,eAAO,MAAM,aAAa,GACxB,eAAe,cAAc,EAC7B,YAAY,SAAS,SAuBtB,CAAC"}