@lokalise/connector-api-contracts 1.2.3 → 1.3.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.
|
@@ -98,3 +98,54 @@ export type CacheRequestBody = z.infer<typeof cacheRequestBody>;
|
|
|
98
98
|
* @deprecated Use `getItemList` API instead
|
|
99
99
|
*/
|
|
100
100
|
export type CacheResponseBody = z.infer<typeof cacheResponseBody>;
|
|
101
|
+
export declare const getCacheContract: import("@lokalise/api-contracts").GetRouteDefinition<z.ZodObject<{
|
|
102
|
+
items: z.ZodArray<z.ZodObject<{
|
|
103
|
+
uniqueId: z.ZodString;
|
|
104
|
+
groupId: z.ZodString;
|
|
105
|
+
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
}, z.core.$strip>, undefined, z.ZodObject<{
|
|
108
|
+
next: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
+
'ce-config': z.ZodString;
|
|
111
|
+
'ce-auth': z.ZodString;
|
|
112
|
+
}, z.core.$strip>, false, false, {
|
|
113
|
+
200: z.ZodObject<{
|
|
114
|
+
items: z.ZodArray<z.ZodObject<{
|
|
115
|
+
uniqueId: z.ZodString;
|
|
116
|
+
groupId: z.ZodString;
|
|
117
|
+
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
next: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const postCacheItemsContract: import("@lokalise/api-contracts").PayloadRouteDefinition<z.ZodObject<{
|
|
123
|
+
items: z.ZodArray<z.ZodObject<{
|
|
124
|
+
uniqueId: z.ZodString;
|
|
125
|
+
groupId: z.ZodString;
|
|
126
|
+
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
129
|
+
items: z.ZodArray<z.ZodObject<{
|
|
130
|
+
uniqueId: z.ZodString;
|
|
131
|
+
groupId: z.ZodString;
|
|
132
|
+
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
133
|
+
fields: z.ZodObject<{}, z.core.$loose>;
|
|
134
|
+
title: z.ZodString;
|
|
135
|
+
groupTitle: z.ZodString;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
}, z.core.$strip>, undefined, undefined, z.ZodObject<{
|
|
138
|
+
'ce-config': z.ZodString;
|
|
139
|
+
'ce-auth': z.ZodString;
|
|
140
|
+
}, z.core.$strip>, false, false, {
|
|
141
|
+
200: z.ZodObject<{
|
|
142
|
+
items: z.ZodArray<z.ZodObject<{
|
|
143
|
+
uniqueId: z.ZodString;
|
|
144
|
+
groupId: z.ZodString;
|
|
145
|
+
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
146
|
+
fields: z.ZodObject<{}, z.core.$loose>;
|
|
147
|
+
title: z.ZodString;
|
|
148
|
+
groupTitle: z.ZodString;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { buildGetRoute, buildPayloadRoute } from '@lokalise/api-contracts';
|
|
1
2
|
import { z } from 'zod/v4';
|
|
2
3
|
import { isValidNextParam } from "../utils/nextParamUtils.js";
|
|
3
|
-
import { itemIdentifier } from "./commonSchemas.js";
|
|
4
|
+
import { CONNECTOR_REQUEST_HEADERS_SCHEMA, itemIdentifier } from "./commonSchemas.js";
|
|
4
5
|
export const MAX_TITLE_LENGTH = 256;
|
|
5
6
|
/**
|
|
6
7
|
* @deprecated Use `getItemList` API instead
|
|
@@ -61,4 +62,25 @@ export const parseUniqueId = (uniqueId) => {
|
|
|
61
62
|
const [entryId, fieldId] = uniqueId.split(':');
|
|
62
63
|
return { entryId, fieldId };
|
|
63
64
|
};
|
|
65
|
+
export const getCacheContract = buildGetRoute({
|
|
66
|
+
pathResolver: () => `/cache`,
|
|
67
|
+
description: 'Get the identifiers of translatable items',
|
|
68
|
+
successResponseBodySchema: cacheRequestBody,
|
|
69
|
+
requestQuerySchema: listCacheRequestQueryString,
|
|
70
|
+
responseSchemasByStatusCode: {
|
|
71
|
+
200: listCacheResponseBody,
|
|
72
|
+
},
|
|
73
|
+
requestHeaderSchema: CONNECTOR_REQUEST_HEADERS_SCHEMA,
|
|
74
|
+
});
|
|
75
|
+
export const postCacheItemsContract = buildPayloadRoute({
|
|
76
|
+
method: 'post',
|
|
77
|
+
pathResolver: () => `/cache/items`,
|
|
78
|
+
description: 'Get the translatable items using their identifiers',
|
|
79
|
+
requestBodySchema: cacheRequestBody,
|
|
80
|
+
successResponseBodySchema: cacheResponseBody,
|
|
81
|
+
responseSchemasByStatusCode: {
|
|
82
|
+
200: cacheResponseBody,
|
|
83
|
+
},
|
|
84
|
+
requestHeaderSchema: CONNECTOR_REQUEST_HEADERS_SCHEMA,
|
|
85
|
+
});
|
|
64
86
|
//# sourceMappingURL=cacheSchemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheSchemas.js","sourceRoot":"","sources":["../../src/schemas/cacheSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"cacheSchemas.js","sourceRoot":"","sources":["../../src/schemas/cacheSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4B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