@lokalise/polyglot-sdk 1.0.1 → 2.0.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.
package/dist/index.d.ts CHANGED
@@ -1 +1,5 @@
1
- export declare function add(a: number, b: number): number;
1
+ export { PolyglotClient } from './sdk/PolyglotClient';
2
+ export { PolyglotError } from './sdk/errors/PolyglotError';
3
+ export * from './sdk/types/client';
4
+ export * from './sdk/types/requests';
5
+ export * from './sdk/types/responses';
package/dist/index.js CHANGED
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.add = void 0;
4
- function add(a, b) {
5
- return a + b;
6
- }
7
- exports.add = add;
3
+ exports.PolyglotError = exports.PolyglotClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var PolyglotClient_1 = require("./sdk/PolyglotClient");
6
+ Object.defineProperty(exports, "PolyglotClient", { enumerable: true, get: function () { return PolyglotClient_1.PolyglotClient; } });
7
+ var PolyglotError_1 = require("./sdk/errors/PolyglotError");
8
+ Object.defineProperty(exports, "PolyglotError", { enumerable: true, get: function () { return PolyglotError_1.PolyglotError; } });
9
+ tslib_1.__exportStar(require("./sdk/types/client"), exports);
10
+ tslib_1.__exportStar(require("./sdk/types/requests"), exports);
11
+ tslib_1.__exportStar(require("./sdk/types/responses"), exports);
8
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,SAAgB,GAAG,CAAC,CAAS,EAAE,CAAS;IACtC,OAAO,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAFD,kBAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uDAAqD;AAA5C,gHAAA,cAAc,OAAA;AACvB,4DAA0D;AAAjD,8GAAA,aAAa,OAAA;AACtB,6DAAkC;AAClC,+DAAoC;AACpC,gEAAqC"}
@@ -3,6 +3,7 @@ export type TranslateSyncRequest = {
3
3
  targetLocale: string;
4
4
  contentUnits: TranslateSyncContentUnits[];
5
5
  context?: PolyglotAssetsRequest;
6
+ integration?: IntegrationKind;
6
7
  };
7
8
  export type TranslateSyncContentUnits = {
8
9
  id: string;
@@ -16,6 +17,7 @@ export type LqaSyncRequest = {
16
17
  sourceLocale: string;
17
18
  assets?: Omit<PolyglotAssetsRequest, 'styleGuide'>;
18
19
  contentUnits: LqaContentUnit[];
20
+ integration?: IntegrationKind;
19
21
  };
20
22
  export type LqaContentUnit = {
21
23
  id: string;
@@ -44,7 +46,9 @@ export type GenerateVariantsRequest = {
44
46
  targetValue: string;
45
47
  history?: SegmentVariantsHistory[];
46
48
  assets?: PolyglotAssetsRequest;
49
+ integration?: IntegrationKind;
47
50
  };
51
+ export type IntegrationKind = 'Fake' | 'Claude-2' | 'ChatGPT-4' | 'DeepL' | 'GoogleTranslate';
48
52
  export type StyleGuideAnswers = {
49
53
  targetAudience: string;
50
54
  toneOfVoice: string;
@@ -6,6 +6,7 @@ export type PolyglotSyncResponse<T extends object> = {
6
6
  generatedAt: string;
7
7
  sourceLocale: string;
8
8
  contentUnits: T[];
9
+ integration: string;
9
10
  };
10
11
  export type ContentUnitTranslationResponse = {
11
12
  id: string;
@@ -35,4 +36,5 @@ export type SegmentLqaResponse = {
35
36
  };
36
37
  export type PolyglotGenerateVariantsResponse = {
37
38
  variants: string[];
39
+ integration: string;
38
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/polyglot-sdk",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"
@@ -28,15 +28,16 @@
28
28
  "test": "vitest",
29
29
  "test:coverage": "npm test -- --coverage",
30
30
  "test:ci": "npm run test:coverage",
31
+ "package-version": "echo $npm_package_version",
31
32
  "prepublishOnly": "npm run build:publish"
32
33
  },
33
34
  "dependencies": {
34
35
  "@amplitude/analytics-types": "^2.5.0",
35
- "@lokalise/fastify-extras": "^16.5.0",
36
+ "@lokalise/fastify-extras": "^16.6.0",
36
37
  "@lokalise/id-utils": "^1.0.0",
37
38
  "@lokalise/node-core": "^9.10.1",
38
39
  "@lokalise/zod-extras": "^2.0.1",
39
- "undici": "^6.6.2",
40
+ "undici": "^6.7.0",
40
41
  "undici-retry": "^5.0.2",
41
42
  "zod": "^3.22.4"
42
43
  },