@crowdin/app-project-module 0.96.2 → 0.97.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.
@@ -104,7 +104,7 @@ function runAsJob({ integrationId, crowdinId, type, title, payload, res, project
104
104
  });
105
105
  },
106
106
  type: jobType,
107
- fetchTranslation: ({ fileId, languageId }) => __awaiter(this, void 0, void 0, function* () {
107
+ fetchTranslation: ({ fileId, languageId, params }) => __awaiter(this, void 0, void 0, function* () {
108
108
  var _a, _b, _c;
109
109
  const translationCache = isDbStore
110
110
  ? yield storage.getFileTranslationCacheByLanguage({
@@ -140,9 +140,7 @@ function runAsJob({ integrationId, crowdinId, type, title, payload, res, project
140
140
  let translation = null;
141
141
  try {
142
142
  (0, logger_1.log)(`Receiving translation for file ${fileId} in language ${languageId}`);
143
- translation = yield client.translationsApi.buildProjectFileTranslation(projectId, fileId, {
144
- targetLanguageId: languageId,
145
- }, (translationCache === null || translationCache === void 0 ? void 0 : translationCache.etag) && !forcePushTranslations ? translationCache === null || translationCache === void 0 ? void 0 : translationCache.etag : undefined);
143
+ translation = yield client.translationsApi.buildProjectFileTranslation(projectId, fileId, Object.assign({ targetLanguageId: languageId }, (params !== null && params !== void 0 ? params : {})), (translationCache === null || translationCache === void 0 ? void 0 : translationCache.etag) && !forcePushTranslations ? translationCache === null || translationCache === void 0 ? void 0 : translationCache.etag : undefined);
146
144
  return translation;
147
145
  }
148
146
  catch (e) {
@@ -84,9 +84,10 @@ export type SaveUploadedFileTranslation = ({ fileId, translationParams, }: {
84
84
  etag: string;
85
85
  }[];
86
86
  }) => Promise<void>;
87
- export type FetchTranslation = ({ fileId, languageId, }: {
87
+ export type FetchTranslation = ({ fileId, languageId, params, }: {
88
88
  fileId: number;
89
89
  languageId: string;
90
+ params?: Omit<TranslationsModel.BuildProjectFileTranslationRequest, 'targetLanguageId'>;
90
91
  }) => Promise<ResponseObject<TranslationsModel.BuildProjectFileTranslationResponse> | null>;
91
92
  export interface TranslationCache {
92
93
  integrationId: string;