@lokalise/expert-api-s2s-client 1.19.0 → 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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autopilotProjectUtils.d.ts","sourceRoot":"","sources":["../../src/utils/autopilotProjectUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAA;AAEjF;;;GAGG;AACH,wBAAgB,6CAA6C,CAC3D,cAAc,EAAE,iCAAiC,GAChD,gBAAgB,
|
|
1
|
+
{"version":3,"file":"autopilotProjectUtils.d.ts","sourceRoot":"","sources":["../../src/utils/autopilotProjectUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAA;AAEjF;;;GAGG;AACH,wBAAgB,6CAA6C,CAC3D,cAAc,EAAE,iCAAiC,GAChD,gBAAgB,CA6BlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProjectStatusEnum } from '@lokalise/workspaces-api-schemas';
|
|
1
|
+
import { PROJECT_TYPES_SCHEMA, ProjectStatusEnum } from '@lokalise/workspaces-api-schemas';
|
|
2
2
|
/**
|
|
3
3
|
* Although this is something that is not directly used by clients from this package, this mapping is likely to be needed in multiple services.
|
|
4
4
|
* It is therefore placed here to avoid code duplication.
|
|
@@ -9,6 +9,10 @@ export function mapExpertGetProjectResponseToAutopilotProject(expertResponse) {
|
|
|
9
9
|
if (!expertResponse.uuid) {
|
|
10
10
|
throw new Error(`Expert project ${expertResponse.project_id} is missing UUID and cannot be mapped to an Autopilot project`);
|
|
11
11
|
}
|
|
12
|
+
const projectType = PROJECT_TYPES_SCHEMA.safeParse(expertResponse.project_type);
|
|
13
|
+
if (!projectType.success) {
|
|
14
|
+
throw new Error(`Expert project ${expertResponse.project_id} has unknown project type "${expertResponse.project_type}" and cannot be mapped to an Autopilot project`);
|
|
15
|
+
}
|
|
12
16
|
return {
|
|
13
17
|
id: expertResponse.uuid,
|
|
14
18
|
externalId: expertResponse.project_id,
|
|
@@ -16,6 +20,7 @@ export function mapExpertGetProjectResponseToAutopilotProject(expertResponse) {
|
|
|
16
20
|
description: expertResponse.description,
|
|
17
21
|
name: expertResponse.name,
|
|
18
22
|
baseContentLanguageId: expertResponse.base_project_language_uuid,
|
|
23
|
+
projectType: projectType.data,
|
|
19
24
|
status: ProjectStatusEnum.ACTIVE, // Expert projects lack explicit status. Defaulting to ACTIVE. (FIXME: reference to a task to address it properly)
|
|
20
25
|
createdAt: new Date(expertResponse.created_at_timestamp * 1000).toISOString(),
|
|
21
26
|
updatedAt: null, // Expert API doesn't provide a last updated timestamp.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autopilotProjectUtils.js","sourceRoot":"","sources":["../../src/utils/autopilotProjectUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"autopilotProjectUtils.js","sourceRoot":"","sources":["../../src/utils/autopilotProjectUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAG1F;;;GAGG;AACH,MAAM,UAAU,6CAA6C,CAC3D,cAAiD;IAEjD,4EAA4E;IAC5E,mHAAmH;IACnH,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,kBAAkB,cAAc,CAAC,UAAU,+DAA+D,CAC3G,CAAA;IACH,CAAC;IAED,MAAM,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAC/E,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,kBAAkB,cAAc,CAAC,UAAU,8BAA8B,cAAc,CAAC,YAAY,gDAAgD,CACrJ,CAAA;IACH,CAAC;IAED,OAAO;QACL,EAAE,EAAE,cAAc,CAAC,IAAI;QACvB,UAAU,EAAE,cAAc,CAAC,UAAU;QACrC,WAAW,EAAE,cAAc,CAAC,SAAS;QACrC,WAAW,EAAE,cAAc,CAAC,WAAW;QACvC,IAAI,EAAE,cAAc,CAAC,IAAI;QACzB,qBAAqB,EAAE,cAAc,CAAC,0BAA0B;QAChE,WAAW,EAAE,WAAW,CAAC,IAAI;QAC7B,MAAM,EAAE,iBAAiB,CAAC,MAAM,EAAE,kHAAkH;QACpJ,SAAS,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE;QAC7E,SAAS,EAAE,IAAI,EAAE,uDAAuD;QACxE,SAAS,EAAE,IAAI,EAAE,yNAAyN;KAC3O,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokalise/expert-api-s2s-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"README.md"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@lokalise/common-api-schemas": "^2.5.0",
|
|
33
33
|
"@lokalise/id-utils": "^3.0.1",
|
|
34
34
|
"@lokalise/node-api": "^15.4.0",
|
|
35
|
-
"@lokalise/workspaces-api-schemas": "^
|
|
35
|
+
"@lokalise/workspaces-api-schemas": "^7.0.0",
|
|
36
36
|
"openid-client": "^6.3.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@biomejs/biome": "^2.0.0",
|
|
44
44
|
"@lokalise/biome-config": "^3.0.0",
|
|
45
|
-
"@lokalise/fastify-extras": "^
|
|
45
|
+
"@lokalise/fastify-extras": "^34.0.1",
|
|
46
46
|
"@lokalise/tsconfig": "^1.3.0",
|
|
47
47
|
"@vitest/coverage-v8": "^3.2.4",
|
|
48
48
|
"mockttp": "^4.1.0",
|