@lokalise/polyglot-sdk 5.3.0 → 5.4.1

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.
@@ -8,13 +8,21 @@ export type TranslateAsyncCallbackRequestBody = {
8
8
  errors: CommonErrorType[];
9
9
  };
10
10
  };
11
+ export type LqaAsyncCallbackData = {
12
+ contentUnitId: string;
13
+ translationId: string;
14
+ suggestion: string | null;
15
+ issues: LqaIssue[];
16
+ };
17
+ export type LqaAsyncCallbackError = {
18
+ contentUnitId: string;
19
+ translationId: string;
20
+ errorCode: string;
21
+ message: string;
22
+ details?: Record<string, unknown>;
23
+ };
11
24
  export type LqaAsyncCallbackRequestBody = {
12
25
  originCorrelationId: string;
13
- data: {
14
- contentUnitId: string;
15
- translationId: string;
16
- suggestion: string | null;
17
- issues: LqaIssue[];
18
- }[];
19
- errors: CommonErrorType[];
26
+ data: LqaAsyncCallbackData[];
27
+ errors: LqaAsyncCallbackError[];
20
28
  };
@@ -1,3 +1,4 @@
1
+ type ObjectValues<T> = T[keyof T];
1
2
  export type PolyglotClientSyncIterativeResponse<T extends ContentUnitLqaResponse | ContentUnitTranslationResponse> = {
2
3
  segmentIdsProcessedByContentUnitId: Record<string, string[]>;
3
4
  response: T[];
@@ -9,6 +10,11 @@ export type PolyglotSyncResponse<T extends object> = {
9
10
  errors?: CommonErrorType[];
10
11
  integration: string;
11
12
  };
13
+ export declare const ErrorCodeEnum: {
14
+ readonly EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT_ERROR";
15
+ readonly TRANSLATION_FAILED: "TRANSLATION_FAILED";
16
+ };
17
+ export type ErrorCode = ObjectValues<typeof ErrorCodeEnum>;
12
18
  export type CommonErrorType = {
13
19
  errorCode: string;
14
20
  message: string;
@@ -76,3 +82,4 @@ export type TranslateAsyncResponse = {
76
82
  expectedAt: string;
77
83
  };
78
84
  export type LqaAsyncResponse = TranslateAsyncResponse;
85
+ export {};
@@ -1,3 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorCodeEnum = void 0;
4
+ exports.ErrorCodeEnum = {
5
+ EDITED_NON_TRANSLATABLE_CONTENT: 'EDITED_NON_TRANSLATABLE_CONTENT_ERROR',
6
+ TRANSLATION_FAILED: 'TRANSLATION_FAILED',
7
+ };
3
8
  //# sourceMappingURL=responses.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/sdk/types/responses.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/sdk/types/responses.ts"],"names":[],"mappings":";;;AAiBa,QAAA,aAAa,GAAG;IAC3B,+BAA+B,EAAE,uCAAuC;IACxE,kBAAkB,EAAE,oBAAoB;CAChC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/polyglot-sdk",
3
- "version": "5.3.0",
3
+ "version": "5.4.1",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"