@lokalise/connector-api-contracts 0.10.1 → 1.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
@@ -2,6 +2,7 @@ export * from './schemas/authSchemas.ts';
2
2
  export * from './schemas/cacheSchemas.ts';
3
3
  export * from './schemas/commonSchemas.ts';
4
4
  export * from './schemas/envSchemas.ts';
5
+ export * from './schemas/itemListContract.ts';
5
6
  export * from './schemas/publishSchemas.ts';
6
7
  export * from './schemas/translateSchemas.ts';
7
8
  export * from './utils/nextParamUtils.ts';
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./schemas/authSchemas.js";
2
2
  export * from "./schemas/cacheSchemas.js";
3
3
  export * from "./schemas/commonSchemas.js";
4
4
  export * from "./schemas/envSchemas.js";
5
+ export * from "./schemas/itemListContract.js";
5
6
  export * from "./schemas/publishSchemas.js";
6
7
  export * from "./schemas/translateSchemas.js";
7
8
  export * from "./utils/nextParamUtils.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
@@ -1,5 +1,8 @@
1
1
  import { z } from 'zod/v4';
2
2
  export declare const MAX_TITLE_LENGTH = 256;
3
+ /**
4
+ * @deprecated Use `getItemList` API instead
5
+ */
3
6
  export declare const cacheItem: z.ZodObject<{
4
7
  uniqueId: z.ZodString;
5
8
  groupId: z.ZodString;
@@ -8,6 +11,9 @@ export declare const cacheItem: z.ZodObject<{
8
11
  title: z.ZodString;
9
12
  groupTitle: z.ZodString;
10
13
  }, z.core.$strip>;
14
+ /**
15
+ * @deprecated Use `getItemList` API instead
16
+ */
11
17
  export declare const partialCacheItem: z.ZodObject<{
12
18
  uniqueId: z.ZodString;
13
19
  groupId: z.ZodString;
@@ -17,9 +23,15 @@ export declare const partialCacheItem: z.ZodObject<{
17
23
  groupTitle: z.ZodString;
18
24
  updatedAtTimestamp: z.ZodOptional<z.ZodNumber>;
19
25
  }, z.core.$strip>;
26
+ /**
27
+ * @deprecated Use `getItemList` API instead
28
+ */
20
29
  export declare const listCacheRequestQueryString: z.ZodObject<{
21
30
  next: z.ZodOptional<z.ZodString>;
22
31
  }, z.core.$strip>;
32
+ /**
33
+ * @deprecated Use `getItemList` API instead
34
+ */
23
35
  export declare const listCacheResponseBody: z.ZodObject<{
24
36
  items: z.ZodArray<z.ZodObject<{
25
37
  uniqueId: z.ZodString;
@@ -28,6 +40,9 @@ export declare const listCacheResponseBody: z.ZodObject<{
28
40
  }, z.core.$strip>>;
29
41
  next: z.ZodOptional<z.ZodString>;
30
42
  }, z.core.$strip>;
43
+ /**
44
+ * @deprecated Use `getItemList` API instead
45
+ */
31
46
  export declare const cacheResponseBody: z.ZodObject<{
32
47
  items: z.ZodArray<z.ZodObject<{
33
48
  uniqueId: z.ZodString;
@@ -38,6 +53,9 @@ export declare const cacheResponseBody: z.ZodObject<{
38
53
  groupTitle: z.ZodString;
39
54
  }, z.core.$strip>>;
40
55
  }, z.core.$strip>;
56
+ /**
57
+ * @deprecated Use `getItemList` API instead
58
+ */
41
59
  export declare const cacheRequestBody: z.ZodObject<{
42
60
  items: z.ZodArray<z.ZodObject<{
43
61
  uniqueId: z.ZodString;
@@ -45,14 +63,38 @@ export declare const cacheRequestBody: z.ZodObject<{
45
63
  metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
46
64
  }, z.core.$strip>>;
47
65
  }, z.core.$strip>;
66
+ /**
67
+ * @deprecated Use `getItemList` API instead
68
+ */
48
69
  export type CacheItem = z.infer<typeof cacheItem>;
70
+ /**
71
+ * @deprecated Use `getItemList` API instead
72
+ */
49
73
  export type PartialCacheItem = z.infer<typeof partialCacheItem>;
74
+ /**
75
+ * @deprecated Use `getItemList` API instead
76
+ */
50
77
  export declare const buildUniqueId: (entryId: string, fieldId: string) => string;
78
+ /**
79
+ * @deprecated Use `getItemList` API instead
80
+ */
51
81
  export declare const parseUniqueId: (uniqueId: string) => {
52
82
  entryId: string | undefined;
53
83
  fieldId: string | undefined;
54
84
  };
85
+ /**
86
+ * @deprecated Use `getItemList` API instead
87
+ */
55
88
  export type ListCacheRequestQueryString = z.infer<typeof listCacheRequestQueryString>;
89
+ /**
90
+ * @deprecated Use `getItemList` API instead
91
+ */
56
92
  export type ListCacheResponseBody = z.infer<typeof listCacheResponseBody>;
93
+ /**
94
+ * @deprecated Use `getItemList` API instead
95
+ */
57
96
  export type CacheRequestBody = z.infer<typeof cacheRequestBody>;
97
+ /**
98
+ * @deprecated Use `getItemList` API instead
99
+ */
58
100
  export type CacheResponseBody = z.infer<typeof cacheResponseBody>;
@@ -2,14 +2,23 @@ import { z } from 'zod/v4';
2
2
  import { isValidNextParam } from "../utils/nextParamUtils.js";
3
3
  import { itemIdentifier } from "./commonSchemas.js";
4
4
  export const MAX_TITLE_LENGTH = 256;
5
+ /**
6
+ * @deprecated Use `getItemList` API instead
7
+ */
5
8
  export const cacheItem = itemIdentifier.extend({
6
9
  fields: z.looseObject({}),
7
10
  title: z.string().max(MAX_TITLE_LENGTH),
8
11
  groupTitle: z.string().max(MAX_TITLE_LENGTH),
9
12
  });
13
+ /**
14
+ * @deprecated Use `getItemList` API instead
15
+ */
10
16
  export const partialCacheItem = cacheItem.extend({
11
17
  updatedAtTimestamp: z.number().optional(),
12
18
  });
19
+ /**
20
+ * @deprecated Use `getItemList` API instead
21
+ */
13
22
  export const listCacheRequestQueryString = z
14
23
  .object({
15
24
  next: z
@@ -22,17 +31,32 @@ export const listCacheRequestQueryString = z
22
31
  .refine(({ next }) => !next || isValidNextParam(next), {
23
32
  message: 'Must contain skip and limit numeric values divided by colon',
24
33
  });
34
+ /**
35
+ * @deprecated Use `getItemList` API instead
36
+ */
25
37
  export const listCacheResponseBody = z.object({
26
38
  items: z.array(itemIdentifier),
27
39
  next: z.string().optional(),
28
40
  });
41
+ /**
42
+ * @deprecated Use `getItemList` API instead
43
+ */
29
44
  export const cacheResponseBody = z.object({
30
45
  items: z.array(cacheItem),
31
46
  });
47
+ /**
48
+ * @deprecated Use `getItemList` API instead
49
+ */
32
50
  export const cacheRequestBody = z.object({
33
51
  items: z.array(itemIdentifier),
34
52
  });
53
+ /**
54
+ * @deprecated Use `getItemList` API instead
55
+ */
35
56
  export const buildUniqueId = (entryId, fieldId) => `${entryId}:${fieldId}`;
57
+ /**
58
+ * @deprecated Use `getItemList` API instead
59
+ */
36
60
  export const parseUniqueId = (uniqueId) => {
37
61
  const [entryId, fieldId] = uniqueId.split(':');
38
62
  return { entryId, fieldId };
@@ -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;AAEnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAEnC,MAAM,CAAC,MAAM,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,EA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CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;IACrD,OAAO,EAAE,6DAA6D;CACvE,CAAC,CAAA;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;CAC/B,CAAC,CAAA;AAWF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,OAAe,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,OAAO,EAAE,CAAA;AAC1F;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,EAAE;IAChD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;AAC7B,CAAC,CAAA"}
@@ -21,3 +21,22 @@ export declare const authError: z.ZodObject<{
21
21
  }, z.core.$strip>;
22
22
  export declare const integrationConfig: z.ZodObject<{}, z.core.$loose>;
23
23
  export declare const authConfig: z.ZodObject<{}, z.core.$loose>;
24
+ export declare const COMMON_ERROR_RESPONSE_SCHEMA: z.ZodObject<{
25
+ statusCode: z.ZodNumber;
26
+ payload: z.ZodObject<{
27
+ message: z.ZodString;
28
+ errorCode: z.ZodString;
29
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
30
+ }, z.core.$strip>;
31
+ }, z.core.$strip>;
32
+ export type CommonErrorResponse = z.infer<typeof COMMON_ERROR_RESPONSE_SCHEMA>;
33
+ /**
34
+ * These headers are used before the initial setup was established
35
+ */
36
+ export declare const CONNECTOR_REQUEST_HEADERS_SCHEMA_PRE_SETUP: z.ZodObject<{
37
+ 'CE-Config': z.ZodString;
38
+ }, z.core.$strip>;
39
+ export declare const CONNECTOR_REQUEST_HEADERS_SCHEMA: z.ZodObject<{
40
+ 'CE-Config': z.ZodString;
41
+ 'CE-Auth': z.ZodString;
42
+ }, z.core.$strip>;
@@ -18,4 +18,22 @@ export const authError = z.object({
18
18
  });
19
19
  export const integrationConfig = z.looseObject({});
20
20
  export const authConfig = z.looseObject({});
21
+ export const COMMON_ERROR_RESPONSE_SCHEMA = z.object({
22
+ statusCode: z.number(),
23
+ payload: z.object({
24
+ message: z.string(),
25
+ errorCode: z.string(),
26
+ details: z.record(z.string(), z.any()).optional(),
27
+ }),
28
+ });
29
+ /**
30
+ * These headers are used before the initial setup was established
31
+ */
32
+ export const CONNECTOR_REQUEST_HEADERS_SCHEMA_PRE_SETUP = z.object({
33
+ 'CE-Config': z.string(),
34
+ });
35
+ export const CONNECTOR_REQUEST_HEADERS_SCHEMA = z.object({
36
+ 'CE-Config': z.string(),
37
+ 'CE-Auth': z.string(),
38
+ });
21
39
  //# sourceMappingURL=commonSchemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commonSchemas.js","sourceRoot":"","sources":["../../src/schemas/commonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,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AAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA"}
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const itemListRequestQueryString: z.ZodObject<{
3
+ limit: z.ZodOptional<z.ZodString>;
4
+ cursor: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export declare const itemListEntry: z.ZodObject<{
7
+ uniqueId: z.ZodString;
8
+ groupId: z.ZodString;
9
+ metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
10
+ fields: z.ZodObject<{}, z.core.$loose>;
11
+ title: z.ZodString;
12
+ groupTitle: z.ZodString;
13
+ }, z.core.$strip>;
14
+ export declare const itemListResponseBody: z.ZodObject<{
15
+ data: z.ZodObject<{
16
+ items: z.ZodArray<z.ZodObject<{
17
+ uniqueId: z.ZodString;
18
+ groupId: z.ZodString;
19
+ metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>;
22
+ meta: z.ZodObject<{
23
+ hasMore: z.ZodBoolean;
24
+ totalResults: z.ZodOptional<z.ZodNumber>;
25
+ nextCursor: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ }, z.core.$strip>;
28
+ export declare const getItemListContract: import("@lokalise/api-contracts").GetRouteDefinition<z.ZodObject<{
29
+ data: z.ZodObject<{
30
+ items: z.ZodArray<z.ZodObject<{
31
+ uniqueId: z.ZodString;
32
+ groupId: z.ZodString;
33
+ metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip>;
36
+ meta: z.ZodObject<{
37
+ hasMore: z.ZodBoolean;
38
+ totalResults: z.ZodOptional<z.ZodNumber>;
39
+ nextCursor: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ }, z.core.$strip>, undefined, z.ZodObject<{
42
+ limit: z.ZodOptional<z.ZodString>;
43
+ cursor: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>, z.ZodObject<{
45
+ 'CE-Config': z.ZodString;
46
+ 'CE-Auth': z.ZodString;
47
+ }, z.core.$strip>, false, false>;
@@ -0,0 +1,50 @@
1
+ import { buildGetRoute } from '@lokalise/api-contracts';
2
+ import { z } from 'zod/v4';
3
+ import { MAX_TITLE_LENGTH } from './cacheSchemas.js';
4
+ import { COMMON_ERROR_RESPONSE_SCHEMA, CONNECTOR_REQUEST_HEADERS_SCHEMA, itemIdentifier, } from './commonSchemas.js';
5
+ export const itemListRequestQueryString = z.object({
6
+ /**
7
+ * If not specified, connector-specific default will be used
8
+ * If specified value exceeds connector-specific default, the default value will be used instead
9
+ */
10
+ limit: z.string().optional(),
11
+ /**
12
+ * Opaque connector-specific string that can be used to retrieve the next page of items.
13
+ * If not specified, the first page of items will be returned.
14
+ * For this param you are expected to pass the cursor value returned in the response to the last request.
15
+ */
16
+ cursor: z.string().optional(),
17
+ });
18
+ export const itemListEntry = itemIdentifier.extend({
19
+ fields: z.looseObject({}),
20
+ title: z.string().max(MAX_TITLE_LENGTH),
21
+ groupTitle: z.string().max(MAX_TITLE_LENGTH),
22
+ });
23
+ export const itemListResponseBody = z.object({
24
+ data: z.object({
25
+ items: z.array(itemIdentifier),
26
+ }),
27
+ meta: z.object({
28
+ hasMore: z.boolean(),
29
+ /**
30
+ * How many items exist overall. Only provided if connector supports it
31
+ */
32
+ totalResults: z.number().optional(),
33
+ /**
34
+ * Opaque connector-specific string that can be used to retrieve the next page of items.
35
+ */
36
+ nextCursor: z.string().optional(),
37
+ }),
38
+ });
39
+ export const getItemListContract = buildGetRoute({
40
+ pathResolver: () => `/v1/items`,
41
+ description: 'Get a list of project items',
42
+ requestQuerySchema: itemListRequestQueryString,
43
+ successResponseBodySchema: itemListResponseBody,
44
+ responseSchemasByStatusCode: {
45
+ 200: itemListResponseBody,
46
+ 401: COMMON_ERROR_RESPONSE_SCHEMA,
47
+ },
48
+ requestHeaderSchema: CONNECTOR_REQUEST_HEADERS_SCHEMA,
49
+ });
50
+ //# sourceMappingURL=itemListContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemListContract.js","sourceRoot":"","sources":["../../src/schemas/itemListContract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,cAAc,GACf,MAAM,oBAAoB,CAAA;AAE3B,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC;IACvC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC;CAC7C,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;KAC/B,CAAC;IACF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;QACpB;;WAEG;QACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACnC;;WAEG;QACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;IAC/C,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW;IAC/B,WAAW,EAAE,6BAA6B;IAC1C,kBAAkB,EAAE,0BAA0B;IAC9C,yBAAyB,EAAE,oBAAoB;IAC/C,2BAA2B,EAAE;QAC3B,GAAG,EAAE,oBAAoB;QACzB,GAAG,EAAE,4BAA4B;KAClC;IACD,mBAAmB,EAAE,gCAAgC;CACtD,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/connector-api-contracts",
3
- "version": "0.10.1",
3
+ "version": "1.0.0",
4
4
  "description": "Lokalise Connector API schemas and contracts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",