@lokalise/connector-api-contracts 1.26.0 → 1.27.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.
|
@@ -10,12 +10,57 @@ export declare const translateRequestBody: z.ZodObject<{
|
|
|
10
10
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
11
11
|
cursor: z.ZodOptional<z.ZodString>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
+
/**
|
|
14
|
+
* Represents an item group in the hierarchy chain for a content item.
|
|
15
|
+
* Used to provide the full folder/category path from the item to root.
|
|
16
|
+
* Each level in the hierarchy is represented as a separate entry.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* For a file at path "My Drive/Projects/Documents/file.docx":
|
|
20
|
+
* ```
|
|
21
|
+
* itemGroups: [
|
|
22
|
+
* { id: "docs-folder-id", name: "Documents", parentItemGroupId: "projects-folder-id", details: {} },
|
|
23
|
+
* { id: "projects-folder-id", name: "Projects", parentItemGroupId: "drive-id", details: {} },
|
|
24
|
+
* { id: "drive-id", name: "My Drive", parentItemGroupId: null, details: { type: "drive" } }
|
|
25
|
+
* ]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const TRANSLATE_ITEM_GROUP_SCHEMA: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
parentItemGroupId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
details: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type TranslateItemGroup = z.infer<typeof TRANSLATE_ITEM_GROUP_SCHEMA>;
|
|
35
|
+
/**
|
|
36
|
+
* Extended content item schema that includes hierarchy information.
|
|
37
|
+
* Each item can optionally include its folder/category hierarchy.
|
|
38
|
+
*/
|
|
39
|
+
export declare const TRANSLATE_CONTENT_ITEM_SCHEMA: z.ZodObject<{
|
|
40
|
+
uniqueId: z.ZodString;
|
|
41
|
+
groupId: z.ZodString;
|
|
42
|
+
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
43
|
+
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
44
|
+
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
parentItemGroupId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
48
|
+
details: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
49
|
+
}, z.core.$strip>>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type TranslateContentItem = z.infer<typeof TRANSLATE_CONTENT_ITEM_SCHEMA>;
|
|
13
52
|
export declare const translateResponseBody: z.ZodObject<{
|
|
14
53
|
items: z.ZodArray<z.ZodObject<{
|
|
15
54
|
uniqueId: z.ZodString;
|
|
16
55
|
groupId: z.ZodString;
|
|
17
56
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
18
57
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
58
|
+
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
parentItemGroupId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
62
|
+
details: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
19
64
|
}, z.core.$strip>>;
|
|
20
65
|
payload: z.ZodOptional<z.ZodObject<{
|
|
21
66
|
message: z.ZodString;
|
|
@@ -46,6 +91,12 @@ export declare const postTranslateContract: import("@lokalise/api-contracts").Pa
|
|
|
46
91
|
groupId: z.ZodString;
|
|
47
92
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
48
93
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
94
|
+
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
parentItemGroupId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
98
|
+
details: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
49
100
|
}, z.core.$strip>>;
|
|
50
101
|
payload: z.ZodOptional<z.ZodObject<{
|
|
51
102
|
message: z.ZodString;
|
|
@@ -69,6 +120,12 @@ export declare const postTranslateContract: import("@lokalise/api-contracts").Pa
|
|
|
69
120
|
groupId: z.ZodString;
|
|
70
121
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
71
122
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
123
|
+
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
parentItemGroupId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
127
|
+
details: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
72
129
|
}, z.core.$strip>>;
|
|
73
130
|
payload: z.ZodOptional<z.ZodObject<{
|
|
74
131
|
message: z.ZodString;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { buildPayloadRoute } from '@lokalise/api-contracts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { COMMON_ERROR_RESPONSE_SCHEMA_UNION, CONNECTOR_REQUEST_HEADERS_SCHEMA, CONTENT_ITEM_SCHEMA, ITEM_IDENTIFIER_SCHEMA, RATE_LIMIT_RESPONSE_HEADERS_SCHEMA, } from "./commonSchemas.js";
|
|
4
|
+
import { itemGroupEntry } from "./itemGroupContracts.js";
|
|
4
5
|
import { PAGINATION_REQUEST_PARAMS_SCHEMA, PAGINATION_RESPONSE_METADATA_SCHEMA, } from "./paginationSchemas.js";
|
|
5
6
|
export const translateRequestBody = z
|
|
6
7
|
.object({
|
|
@@ -9,9 +10,37 @@ export const translateRequestBody = z
|
|
|
9
10
|
defaultLocale: z.string(),
|
|
10
11
|
})
|
|
11
12
|
.extend(PAGINATION_REQUEST_PARAMS_SCHEMA.shape);
|
|
13
|
+
/**
|
|
14
|
+
* Represents an item group in the hierarchy chain for a content item.
|
|
15
|
+
* Used to provide the full folder/category path from the item to root.
|
|
16
|
+
* Each level in the hierarchy is represented as a separate entry.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* For a file at path "My Drive/Projects/Documents/file.docx":
|
|
20
|
+
* ```
|
|
21
|
+
* itemGroups: [
|
|
22
|
+
* { id: "docs-folder-id", name: "Documents", parentItemGroupId: "projects-folder-id", details: {} },
|
|
23
|
+
* { id: "projects-folder-id", name: "Projects", parentItemGroupId: "drive-id", details: {} },
|
|
24
|
+
* { id: "drive-id", name: "My Drive", parentItemGroupId: null, details: { type: "drive" } }
|
|
25
|
+
* ]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export const TRANSLATE_ITEM_GROUP_SCHEMA = itemGroupEntry;
|
|
29
|
+
/**
|
|
30
|
+
* Extended content item schema that includes hierarchy information.
|
|
31
|
+
* Each item can optionally include its folder/category hierarchy.
|
|
32
|
+
*/
|
|
33
|
+
export const TRANSLATE_CONTENT_ITEM_SCHEMA = CONTENT_ITEM_SCHEMA.extend({
|
|
34
|
+
/**
|
|
35
|
+
* Optional array of item groups representing the hierarchy chain from the item's immediate parent to root.
|
|
36
|
+
* Ordered from immediate parent (index 0) to root (last index).
|
|
37
|
+
* Only populated when the connector supports hierarchy information.
|
|
38
|
+
*/
|
|
39
|
+
itemGroups: z.array(TRANSLATE_ITEM_GROUP_SCHEMA).optional(),
|
|
40
|
+
});
|
|
12
41
|
export const translateResponseBody = z
|
|
13
42
|
.object({
|
|
14
|
-
items: z.array(
|
|
43
|
+
items: z.array(TRANSLATE_CONTENT_ITEM_SCHEMA),
|
|
15
44
|
payload: z
|
|
16
45
|
.object({
|
|
17
46
|
message: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateContracts.js","sourceRoot":"","sources":["../../src/contracts/translateContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,mBAAmB,EACnB,sBAAsB,EACtB,kCAAkC,GACnC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,wBAAwB,CAAA;AAE/B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC;IACtC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC;KACD,MAAM,CAAC,gCAAgC,CAAC,KAAK,CAAC,CAAA;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"translateContracts.js","sourceRoot":"","sources":["../../src/contracts/translateContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,mBAAmB,EACnB,sBAAsB,EACtB,kCAAkC,GACnC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EACL,gCAAgC,EAChC,mCAAmC,GACpC,MAA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