@lokalise/connector-api-contracts 2.2.0 → 2.4.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/contracts/envContracts.d.ts +7 -25
- package/dist/contracts/envContracts.js +1 -6
- package/dist/contracts/envContracts.js.map +1 -1
- package/dist/contracts/publishContracts.d.ts +0 -23
- package/dist/contracts/publishContracts.js +0 -10
- package/dist/contracts/publishContracts.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,11 +39,18 @@ export declare const METADATA_TYPE_SCHEMAS: z.ZodObject<{
|
|
|
39
39
|
name: z.ZodString;
|
|
40
40
|
}, z.core.$strip>>;
|
|
41
41
|
}, z.core.$strip>;
|
|
42
|
+
export declare const OPTIONAL_METADATA_TYPE_SCHEMAS: z.ZodObject<{
|
|
43
|
+
FOLDER_HIERARCHY: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
42
48
|
export declare const METADATA_FIELDS: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
43
49
|
type: z.ZodEnum<{
|
|
44
50
|
FOLDER_HIERARCHY: "FOLDER_HIERARCHY";
|
|
45
51
|
}>;
|
|
46
52
|
}, z.core.$strip>>;
|
|
53
|
+
export type OptionalMetadataTypeSchemas = z.infer<typeof OPTIONAL_METADATA_TYPE_SCHEMAS>;
|
|
47
54
|
export type MetadataTypeSchemas = z.infer<typeof METADATA_TYPE_SCHEMAS>;
|
|
48
55
|
export type MetadataTypeValues = MetadataTypeSchemas[keyof MetadataTypeSchemas];
|
|
49
56
|
export type MetadataFields = z.infer<typeof METADATA_FIELDS>;
|
|
@@ -70,13 +77,6 @@ export declare const FIELD_DEFINITIONS: z.ZodArray<z.ZodObject<{
|
|
|
70
77
|
}, z.core.$strip>>;
|
|
71
78
|
export type SupportedFieldTypes = z.infer<typeof SUPPORTED_FIELD_TYPES>;
|
|
72
79
|
export type FieldDefinitions = z.infer<typeof FIELD_DEFINITIONS>;
|
|
73
|
-
export declare const SUPPORTED_EXPORT_OPTION_SCHEMA: z.ZodObject<{
|
|
74
|
-
name: z.ZodEnum<{
|
|
75
|
-
languageFolders: "languageFolders";
|
|
76
|
-
}>;
|
|
77
|
-
required: z.ZodBoolean;
|
|
78
|
-
}, z.core.$strip>;
|
|
79
|
-
export type SupportedExportOption = z.infer<typeof SUPPORTED_EXPORT_OPTION_SCHEMA>;
|
|
80
80
|
export declare const envResponseBody: z.ZodObject<{
|
|
81
81
|
defaultLocale: z.ZodString;
|
|
82
82
|
locales: z.ZodArray<z.ZodObject<{
|
|
@@ -105,12 +105,6 @@ export declare const envResponseBody: z.ZodObject<{
|
|
|
105
105
|
DATE: "DATE";
|
|
106
106
|
}>;
|
|
107
107
|
}, z.core.$strip>>>;
|
|
108
|
-
supportedExportOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
-
name: z.ZodEnum<{
|
|
110
|
-
languageFolders: "languageFolders";
|
|
111
|
-
}>;
|
|
112
|
-
required: z.ZodBoolean;
|
|
113
|
-
}, z.core.$strip>>>;
|
|
114
108
|
}, z.core.$strip>;
|
|
115
109
|
export type EnvCacheItemStructure = {
|
|
116
110
|
id: string;
|
|
@@ -147,12 +141,6 @@ export declare const getEnvContract: import("@lokalise/api-contracts").GetRouteD
|
|
|
147
141
|
DATE: "DATE";
|
|
148
142
|
}>;
|
|
149
143
|
}, z.core.$strip>>>;
|
|
150
|
-
supportedExportOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
151
|
-
name: z.ZodEnum<{
|
|
152
|
-
languageFolders: "languageFolders";
|
|
153
|
-
}>;
|
|
154
|
-
required: z.ZodBoolean;
|
|
155
|
-
}, z.core.$strip>>>;
|
|
156
144
|
}, z.core.$strip>, undefined, z.ZodObject<{
|
|
157
145
|
defaultLocale: z.ZodOptional<z.ZodString>;
|
|
158
146
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -188,12 +176,6 @@ export declare const getEnvContract: import("@lokalise/api-contracts").GetRouteD
|
|
|
188
176
|
DATE: "DATE";
|
|
189
177
|
}>;
|
|
190
178
|
}, z.core.$strip>>>;
|
|
191
|
-
supportedExportOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
192
|
-
name: z.ZodEnum<{
|
|
193
|
-
languageFolders: "languageFolders";
|
|
194
|
-
}>;
|
|
195
|
-
required: z.ZodBoolean;
|
|
196
|
-
}, z.core.$strip>>>;
|
|
197
179
|
}, z.core.$strip>;
|
|
198
180
|
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
199
181
|
statusCode: z.ZodNumber;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { buildGetRoute } from '@lokalise/api-contracts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { COMMON_ERROR_RESPONSE_SCHEMA_UNION, CONNECTOR_REQUEST_HEADERS_SCHEMA, } from "./commonSchemas.js";
|
|
4
|
-
import { EXPORT_OPTION_NAME } from "./publishContracts.js";
|
|
5
4
|
export const envRequestQueryString = z.object({
|
|
6
5
|
defaultLocale: z.string().optional(),
|
|
7
6
|
});
|
|
@@ -34,6 +33,7 @@ export const METADATA_TYPE_SCHEMAS = z.object({
|
|
|
34
33
|
name: z.string(),
|
|
35
34
|
})),
|
|
36
35
|
});
|
|
36
|
+
export const OPTIONAL_METADATA_TYPE_SCHEMAS = METADATA_TYPE_SCHEMAS.partial();
|
|
37
37
|
export const METADATA_FIELDS = z.record(z.string(), z.object({
|
|
38
38
|
type: FIELD_TYPES,
|
|
39
39
|
}));
|
|
@@ -44,15 +44,10 @@ export const FIELD_DEFINITION_SCHEMA = z.object({
|
|
|
44
44
|
type: SUPPORTED_FIELD_TYPES,
|
|
45
45
|
});
|
|
46
46
|
export const FIELD_DEFINITIONS = z.array(FIELD_DEFINITION_SCHEMA);
|
|
47
|
-
export const SUPPORTED_EXPORT_OPTION_SCHEMA = z.object({
|
|
48
|
-
name: EXPORT_OPTION_NAME,
|
|
49
|
-
required: z.boolean(),
|
|
50
|
-
});
|
|
51
47
|
export const envResponseBody = localeDefinition.extend({
|
|
52
48
|
cacheItemStructure: z.record(z.string(), z.string()),
|
|
53
49
|
metadataFields: METADATA_FIELDS.optional(),
|
|
54
50
|
fieldDefinitions: FIELD_DEFINITIONS.optional(),
|
|
55
|
-
supportedExportOptions: z.array(SUPPORTED_EXPORT_OPTION_SCHEMA).optional(),
|
|
56
51
|
});
|
|
57
52
|
export const getEnvContract = buildGetRoute({
|
|
58
53
|
pathResolver: () => `/env`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envContracts.js","sourceRoot":"","sources":["../../src/contracts/envContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EACL,kCAAkC,EAClC,gCAAgC,GACjC,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"envContracts.js","sourceRoot":"","sources":["../../src/contracts/envContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EACL,kCAAkC,EAClC,gCAAgC,GACjC,MAAM,oBAAoB,CAAA;AAE3B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,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AC1B,WAAW,EACT,uIAAuI;IACzI,yBAAyB,EAAE,eAAe;IAC1C,kBAAkB,EAAE,qBAAqB;IACzC,2BAA2B,EAAE;QAC3B,GAAG,EAAE,eAAe;QACpB,GAAG,EAAE,kCAAkC;KACxC;IACD,mBAAmB,EAAE,gCAAgC;CACtD,CAAC,CAAA"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
export declare const EXPORT_OPTIONS: z.ZodObject<{
|
|
3
|
-
languageFolders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4
|
-
id: z.ZodString;
|
|
5
|
-
slug: z.ZodString;
|
|
6
|
-
}, z.core.$strip>>>;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export declare const EXPORT_OPTION_NAME: z.ZodEnum<{
|
|
9
|
-
languageFolders: "languageFolders";
|
|
10
|
-
}>;
|
|
11
|
-
export type ExportOptionName = z.infer<typeof EXPORT_OPTION_NAME>;
|
|
12
|
-
export type ExportOptions = z.infer<typeof EXPORT_OPTIONS>;
|
|
13
2
|
export declare const publishRequestBody: z.ZodObject<{
|
|
14
3
|
items: z.ZodArray<z.ZodObject<{
|
|
15
4
|
uniqueId: z.ZodString;
|
|
@@ -29,12 +18,6 @@ export declare const publishRequestBody: z.ZodObject<{
|
|
|
29
18
|
}, z.core.$strip>]>>>;
|
|
30
19
|
}, z.core.$strip>>;
|
|
31
20
|
defaultLocale: z.ZodString;
|
|
32
|
-
exportOptions: z.ZodOptional<z.ZodObject<{
|
|
33
|
-
languageFolders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
slug: z.ZodString;
|
|
36
|
-
}, z.core.$strip>>>;
|
|
37
|
-
}, z.core.$strip>>;
|
|
38
21
|
}, z.core.$strip>;
|
|
39
22
|
export declare const publishResponseBody: z.ZodObject<{
|
|
40
23
|
statusCode: z.ZodNumber;
|
|
@@ -68,12 +51,6 @@ export declare const postPublishContract: import("@lokalise/api-contracts").Payl
|
|
|
68
51
|
}, z.core.$strip>]>>>;
|
|
69
52
|
}, z.core.$strip>>;
|
|
70
53
|
defaultLocale: z.ZodString;
|
|
71
|
-
exportOptions: z.ZodOptional<z.ZodObject<{
|
|
72
|
-
languageFolders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
73
|
-
id: z.ZodString;
|
|
74
|
-
slug: z.ZodString;
|
|
75
|
-
}, z.core.$strip>>>;
|
|
76
|
-
}, z.core.$strip>>;
|
|
77
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
78
55
|
statusCode: z.ZodNumber;
|
|
79
56
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { buildPayloadRoute } from '@lokalise/api-contracts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { CONNECTOR_REQUEST_HEADERS_SCHEMA, CONTENT_ITEM_SCHEMA, RATE_LIMIT_RESPONSE_HEADERS_SCHEMA, } from "./commonSchemas.js";
|
|
4
|
-
export const EXPORT_OPTIONS = z.object({
|
|
5
|
-
languageFolders: z
|
|
6
|
-
.record(z.string().describe('Language iso'), z.object({
|
|
7
|
-
id: z.string(),
|
|
8
|
-
slug: z.string(),
|
|
9
|
-
}))
|
|
10
|
-
.optional(),
|
|
11
|
-
});
|
|
12
|
-
export const EXPORT_OPTION_NAME = EXPORT_OPTIONS.keyof();
|
|
13
4
|
export const publishRequestBody = z.object({
|
|
14
5
|
items: z.array(CONTENT_ITEM_SCHEMA),
|
|
15
6
|
defaultLocale: z.string(),
|
|
16
|
-
exportOptions: EXPORT_OPTIONS.optional(),
|
|
17
7
|
});
|
|
18
8
|
export const publishResponseBody = z.object({
|
|
19
9
|
statusCode: z.number(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishContracts.js","sourceRoot":"","sources":["../../src/contracts/publishContracts.ts"],"names":[],"mappings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