@lokalise/connector-api-contracts 1.1.0 → 1.2.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.
@@ -12,31 +12,37 @@ export declare const itemListEntry: z.ZodObject<{
12
12
  groupTitle: z.ZodString;
13
13
  }, z.core.$strip>;
14
14
  export declare const itemListResponseBody: z.ZodObject<{
15
- data: z.ZodObject<{
15
+ data: z.ZodArray<z.ZodObject<{
16
16
  items: z.ZodArray<z.ZodObject<{
17
17
  uniqueId: z.ZodString;
18
18
  groupId: z.ZodString;
19
19
  metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
20
+ fields: z.ZodObject<{}, z.core.$loose>;
21
+ title: z.ZodString;
22
+ groupTitle: z.ZodString;
20
23
  }, z.core.$strip>>;
21
- }, z.core.$strip>;
24
+ }, z.core.$strip>>;
22
25
  meta: z.ZodObject<{
23
- hasMore: z.ZodBoolean;
24
- totalResults: z.ZodOptional<z.ZodNumber>;
25
- nextCursor: z.ZodOptional<z.ZodString>;
26
+ count: z.ZodNumber;
27
+ cursor: z.ZodOptional<z.ZodString>;
28
+ hasMore: z.ZodOptional<z.ZodBoolean>;
26
29
  }, z.core.$strip>;
27
30
  }, z.core.$strip>;
28
31
  export declare const getItemListContract: import("@lokalise/api-contracts").GetRouteDefinition<z.ZodObject<{
29
- data: z.ZodObject<{
32
+ data: z.ZodArray<z.ZodObject<{
30
33
  items: z.ZodArray<z.ZodObject<{
31
34
  uniqueId: z.ZodString;
32
35
  groupId: z.ZodString;
33
36
  metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
37
+ fields: z.ZodObject<{}, z.core.$loose>;
38
+ title: z.ZodString;
39
+ groupTitle: z.ZodString;
34
40
  }, z.core.$strip>>;
35
- }, z.core.$strip>;
41
+ }, z.core.$strip>>;
36
42
  meta: z.ZodObject<{
37
- hasMore: z.ZodBoolean;
38
- totalResults: z.ZodOptional<z.ZodNumber>;
39
- nextCursor: z.ZodOptional<z.ZodString>;
43
+ count: z.ZodNumber;
44
+ cursor: z.ZodOptional<z.ZodString>;
45
+ hasMore: z.ZodOptional<z.ZodBoolean>;
40
46
  }, z.core.$strip>;
41
47
  }, z.core.$strip>, undefined, z.ZodObject<{
42
48
  limit: z.ZodOptional<z.ZodString>;
@@ -1,3 +1,4 @@
1
+ import { paginatedResponseSchema } from '@lokalise/api-common';
1
2
  import { buildGetRoute } from '@lokalise/api-contracts';
2
3
  import { z } from 'zod/v4';
3
4
  import { MAX_TITLE_LENGTH } from "./cacheSchemas.js";
@@ -20,22 +21,9 @@ export const itemListEntry = itemIdentifier.extend({
20
21
  title: z.string().max(MAX_TITLE_LENGTH),
21
22
  groupTitle: z.string().max(MAX_TITLE_LENGTH),
22
23
  });
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
- });
24
+ export const itemListResponseBody = paginatedResponseSchema(z.object({
25
+ items: z.array(itemListEntry),
26
+ }));
39
27
  export const getItemListContract = buildGetRoute({
40
28
  pathResolver: () => `/v1/items`,
41
29
  description: 'Get a list of project items',
@@ -1 +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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B;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": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Lokalise Connector API schemas and contracts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,17 +29,22 @@
29
29
  "url": "https://github.com/lokalise/service-contracts.git"
30
30
  },
31
31
  "dependencies": {
32
- "@lokalise/api-contracts": "^5.0.0",
33
- "zod": "^3.25.76"
32
+ "@lokalise/api-contracts": "^5.0.0"
33
+ },
34
+ "peerDependencies": {
35
+ "@lokalise/api-common": ">=6.1.0",
36
+ "zod": ">=3.25.76 <5.0.0"
34
37
  },
35
38
  "devDependencies": {
36
39
  "@types/node": "^22.17.2",
37
40
  "@biomejs/biome": "^2.2.0",
41
+ "@lokalise/api-common": "^6.1.0",
38
42
  "@lokalise/biome-config": "^3.1.0",
39
43
  "@lokalise/tsconfig": "^2.0.0",
40
44
  "@vitest/coverage-v8": "^3.2.4",
41
45
  "rimraf": "^6.0.1",
42
46
  "typescript": "^5.9.2",
43
- "vitest": "^3.2.4"
47
+ "vitest": "^3.2.4",
48
+ "zod": "^3.25.76"
44
49
  }
45
50
  }