@lokalise/harmony 1.22.1 → 1.23.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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Public API router definition for retrieving a project contributor
3
3
  */
4
- export declare const retrieveContributor: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
4
+ export declare const retrieveContributor: import('@lokalise/api-contracts').GetRouteDefinition<{
5
5
  project: {
6
6
  uuid: string;
7
7
  } | {
@@ -0,0 +1,21 @@
1
+ import { HeaderBuilder } from '../../node';
2
+ import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
3
+ import { Wretch } from 'wretch';
4
+ import { GetScoreRequestQuery, GetScoreResponseBody } from '../types/scoreTypes';
5
+ import { BaseApiEndpointHeader } from '../types/sharedTypes';
6
+ export declare const getScoreKey: {
7
+ paramsKey: (params: GetScoreRequestQuery) => readonly ["getScore", {
8
+ projectId: string;
9
+ translationId: number;
10
+ }];
11
+ };
12
+ export declare function useGetScoreQuery<T>(wretchClient: Wretch<T>, headers: HeaderBuilder<BaseApiEndpointHeader>, overrides: ApiQueryOverrides<GetScoreResponseBody, typeof getScoreKey>): import('@tanstack/react-query').UseQueryResult<{
13
+ issues: {
14
+ category: string;
15
+ comment: string;
16
+ severity: "critical" | "major" | "minor";
17
+ }[];
18
+ score: number;
19
+ hasMajorIssue: boolean;
20
+ hasCriticalIssue: boolean;
21
+ }, undefined>;
@@ -1,4 +1,4 @@
1
- export declare const listProjectLanguages: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
1
+ export declare const listProjectLanguages: import('@lokalise/api-contracts').GetRouteDefinition<{
2
2
  projectId: string;
3
3
  }, import('zod').ZodObject<{
4
4
  project_id: import('zod').ZodString;
@@ -113,7 +113,7 @@ export declare const listProjectLanguages: import('@lokalise/universal-ts-utils/
113
113
  }, {
114
114
  'X-LOKALISE-PLUGIN': string;
115
115
  }>]>>, false, false>;
116
- export declare const addLanguagesToProject: import('@lokalise/universal-ts-utils/node').PayloadRouteDefinition<{
116
+ export declare const addLanguagesToProject: import('@lokalise/api-contracts').PayloadRouteDefinition<{
117
117
  projectId: string;
118
118
  }, import('zod').ZodObject<{
119
119
  languages: import('zod').ZodArray<import('zod').ZodObject<{
@@ -282,7 +282,7 @@ export declare const addLanguagesToProject: import('@lokalise/universal-ts-utils
282
282
  }, {
283
283
  'X-LOKALISE-PLUGIN': string;
284
284
  }>]>>, false, false>;
285
- export declare const bulkUpdateProjectLanguages: import('@lokalise/universal-ts-utils/node').PayloadRouteDefinition<{
285
+ export declare const bulkUpdateProjectLanguages: import('@lokalise/api-contracts').PayloadRouteDefinition<{
286
286
  projectId: string;
287
287
  }, import('zod').ZodObject<{
288
288
  langs: import('zod').ZodArray<import('zod').ZodObject<{
@@ -9,6 +9,7 @@ export * from './types/teamRoleTypes';
9
9
  export * from './types/contributorTypes';
10
10
  export * from './types/teamUserTypes';
11
11
  export * from './types/userTokenTypes';
12
+ export * from './types/scoreTypes';
12
13
  export * from './hooks/useCreateProjectMutation';
13
14
  export * from './hooks/useGetTeamUsersQuery';
14
15
  export * from './hooks/useGetUserTokenQuery';
@@ -18,3 +19,4 @@ export * from './hooks/useRetrieveContributorQuery';
18
19
  export * from './hooks/useRetrieveProjectQuery';
19
20
  export * from './hooks/useUpdateProjectMutation';
20
21
  export * from './hooks/useBulkUpdateProjectLanguagesMutation';
22
+ export * from './hooks/useGetScoreQuery';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Public API router definition for creating a new project
3
3
  */
4
- export declare const createProject: import('@lokalise/universal-ts-utils/node').PayloadRouteDefinition<never, import('zod').ZodObject<{
4
+ export declare const createProject: import('@lokalise/api-contracts').PayloadRouteDefinition<never, import('zod').ZodObject<{
5
5
  name: import('zod').ZodString;
6
6
  team_id: import('zod').ZodString;
7
7
  base_lang_iso: import('zod').ZodString;
@@ -412,7 +412,7 @@ export declare const createProject: import('@lokalise/universal-ts-utils/node').
412
412
  /**
413
413
  * Public API router definition for listing all projects
414
414
  */
415
- export declare const listProjects: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<never, import('zod').ZodObject<{
415
+ export declare const listProjects: import('@lokalise/api-contracts').GetRouteDefinition<never, import('zod').ZodObject<{
416
416
  projects: import('zod').ZodArray<import('zod').ZodObject<{
417
417
  project_id: import('zod').ZodString;
418
418
  uuid: import('zod').ZodString;
@@ -939,7 +939,7 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
939
939
  /**
940
940
  * Public API router definition for retrieving a project
941
941
  */
942
- export declare const retrieveProject: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
942
+ export declare const retrieveProject: import('@lokalise/api-contracts').GetRouteDefinition<{
943
943
  project_id: string;
944
944
  }, import('zod').ZodObject<{
945
945
  project_id: import('zod').ZodString;
@@ -1322,7 +1322,7 @@ export declare const retrieveProject: import('@lokalise/universal-ts-utils/node'
1322
1322
  /**
1323
1323
  * Public API router definition for updating a project
1324
1324
  */
1325
- export declare const updateProject: import('@lokalise/universal-ts-utils/node').PayloadRouteDefinition<{
1325
+ export declare const updateProject: import('@lokalise/api-contracts').PayloadRouteDefinition<{
1326
1326
  project_id: string;
1327
1327
  }, import('zod').ZodObject<{
1328
1328
  name: import('zod').ZodString;
@@ -0,0 +1,102 @@
1
+ export declare const getScore: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
2
+ projectId: string;
3
+ translationId: number;
4
+ }, import('zod').ZodObject<{
5
+ score: import('zod').ZodNumber;
6
+ hasMajorIssue: import('zod').ZodBoolean;
7
+ hasCriticalIssue: import('zod').ZodBoolean;
8
+ issues: import('zod').ZodArray<import('zod').ZodObject<{
9
+ category: import('zod').ZodString;
10
+ comment: import('zod').ZodString;
11
+ severity: import('zod').ZodEnum<["critical", "major", "minor"]>;
12
+ }, "strip", import('zod').ZodTypeAny, {
13
+ category: string;
14
+ comment: string;
15
+ severity: "critical" | "major" | "minor";
16
+ }, {
17
+ category: string;
18
+ comment: string;
19
+ severity: "critical" | "major" | "minor";
20
+ }>, "many">;
21
+ }, "strip", import('zod').ZodTypeAny, {
22
+ issues: {
23
+ category: string;
24
+ comment: string;
25
+ severity: "critical" | "major" | "minor";
26
+ }[];
27
+ score: number;
28
+ hasMajorIssue: boolean;
29
+ hasCriticalIssue: boolean;
30
+ }, {
31
+ issues: {
32
+ category: string;
33
+ comment: string;
34
+ severity: "critical" | "major" | "minor";
35
+ }[];
36
+ score: number;
37
+ hasMajorIssue: boolean;
38
+ hasCriticalIssue: boolean;
39
+ }>, import('zod').ZodObject<{
40
+ projectId: import('zod').ZodString;
41
+ translationId: import('zod').ZodNumber;
42
+ }, "strip", import('zod').ZodTypeAny, {
43
+ projectId: string;
44
+ translationId: number;
45
+ }, {
46
+ projectId: string;
47
+ translationId: number;
48
+ }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
49
+ authorization: import('zod').ZodString;
50
+ }, "strip", import('zod').ZodTypeAny, {
51
+ authorization: string;
52
+ }, {
53
+ authorization: string;
54
+ }>, import('zod').ZodObject<{
55
+ AUTHORIZATION: import('zod').ZodString;
56
+ }, "strip", import('zod').ZodTypeAny, {
57
+ AUTHORIZATION: string;
58
+ }, {
59
+ AUTHORIZATION: string;
60
+ }>]>, import('zod').ZodUnion<[import('zod').ZodObject<{
61
+ 'X-API-Token': import('zod').ZodString;
62
+ }, "strip", import('zod').ZodTypeAny, {
63
+ 'X-API-Token': string;
64
+ }, {
65
+ 'X-API-Token': string;
66
+ }>, import('zod').ZodObject<{
67
+ 'X-Api-Token': import('zod').ZodString;
68
+ }, "strip", import('zod').ZodTypeAny, {
69
+ 'X-Api-Token': string;
70
+ }, {
71
+ 'X-Api-Token': string;
72
+ }>, import('zod').ZodObject<{
73
+ 'x-api-token': import('zod').ZodString;
74
+ }, "strip", import('zod').ZodTypeAny, {
75
+ 'x-api-token': string;
76
+ }, {
77
+ 'x-api-token': string;
78
+ }>, import('zod').ZodObject<{
79
+ 'X-API-TOKEN': import('zod').ZodString;
80
+ }, "strip", import('zod').ZodTypeAny, {
81
+ 'X-API-TOKEN': string;
82
+ }, {
83
+ 'X-API-TOKEN': string;
84
+ }>]>]>, import('zod').ZodUnion<[import('zod').ZodObject<{
85
+ 'X-Lokalise-Plugin': import('zod').ZodString;
86
+ }, "strip", import('zod').ZodTypeAny, {
87
+ 'X-Lokalise-Plugin': string;
88
+ }, {
89
+ 'X-Lokalise-Plugin': string;
90
+ }>, import('zod').ZodObject<{
91
+ 'x-lokalise-plugin': import('zod').ZodString;
92
+ }, "strip", import('zod').ZodTypeAny, {
93
+ 'x-lokalise-plugin': string;
94
+ }, {
95
+ 'x-lokalise-plugin': string;
96
+ }>, import('zod').ZodObject<{
97
+ 'X-LOKALISE-PLUGIN': import('zod').ZodString;
98
+ }, "strip", import('zod').ZodTypeAny, {
99
+ 'X-LOKALISE-PLUGIN': string;
100
+ }, {
101
+ 'X-LOKALISE-PLUGIN': string;
102
+ }>]>>, false, false>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Public API router definition for getting the details of a team user
3
3
  */
4
- export declare const getTeamUser: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
4
+ export declare const getTeamUser: import('@lokalise/api-contracts').GetRouteDefinition<{
5
5
  userId: number;
6
6
  teamId: number;
7
7
  }, import('zod').ZodObject<{
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ export declare const GET_SCORE_REQUEST_QUERY_SCHEMA: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ translationId: z.ZodNumber;
5
+ }, "strip", z.ZodTypeAny, {
6
+ projectId: string;
7
+ translationId: number;
8
+ }, {
9
+ projectId: string;
10
+ translationId: number;
11
+ }>;
12
+ export type GetScoreRequestQuery = z.infer<typeof GET_SCORE_REQUEST_QUERY_SCHEMA>;
13
+ export declare const SEVERITY_ENUM: z.ZodEnum<["critical", "major", "minor"]>;
14
+ export type Severity = z.infer<typeof SEVERITY_ENUM>;
15
+ export declare const ISSUE_SCHEMA: z.ZodObject<{
16
+ category: z.ZodString;
17
+ comment: z.ZodString;
18
+ severity: z.ZodEnum<["critical", "major", "minor"]>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ category: string;
21
+ comment: string;
22
+ severity: "critical" | "major" | "minor";
23
+ }, {
24
+ category: string;
25
+ comment: string;
26
+ severity: "critical" | "major" | "minor";
27
+ }>;
28
+ export type Issue = z.infer<typeof ISSUE_SCHEMA>;
29
+ export declare const GET_SCORE_RESPONSE_SCHEMA: z.ZodObject<{
30
+ score: z.ZodNumber;
31
+ hasMajorIssue: z.ZodBoolean;
32
+ hasCriticalIssue: z.ZodBoolean;
33
+ issues: z.ZodArray<z.ZodObject<{
34
+ category: z.ZodString;
35
+ comment: z.ZodString;
36
+ severity: z.ZodEnum<["critical", "major", "minor"]>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ category: string;
39
+ comment: string;
40
+ severity: "critical" | "major" | "minor";
41
+ }, {
42
+ category: string;
43
+ comment: string;
44
+ severity: "critical" | "major" | "minor";
45
+ }>, "many">;
46
+ }, "strip", z.ZodTypeAny, {
47
+ issues: {
48
+ category: string;
49
+ comment: string;
50
+ severity: "critical" | "major" | "minor";
51
+ }[];
52
+ score: number;
53
+ hasMajorIssue: boolean;
54
+ hasCriticalIssue: boolean;
55
+ }, {
56
+ issues: {
57
+ category: string;
58
+ comment: string;
59
+ severity: "critical" | "major" | "minor";
60
+ }[];
61
+ score: number;
62
+ hasMajorIssue: boolean;
63
+ hasCriticalIssue: boolean;
64
+ }>;
65
+ export type GetScoreResponseBody = z.infer<typeof GET_SCORE_RESPONSE_SCHEMA>;
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  * A method of getting a JWT token for a user.
4
4
  * You can call this with either a refresh token or from within the scope of a classic CSRF cookie session.
5
5
  */
6
- export declare const getUserToken: import('@lokalise/universal-ts-utils/node').PayloadRouteDefinition<{
6
+ export declare const getUserToken: import('@lokalise/api-contracts').PayloadRouteDefinition<{
7
7
  teamId: number;
8
8
  }, z.ZodUndefined, z.ZodObject<{
9
9
  accessToken: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/harmony",
3
- "version": "1.22.1",
3
+ "version": "1.23.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"
@@ -18,9 +18,7 @@
18
18
  "scripts": {
19
19
  "build": "rimraf dist && vite build",
20
20
  "bundle:size": "bundlesize",
21
- "test": "vitest",
22
- "test:coverage": "vitest --coverage",
23
- "test:ci": "npm run lint && npm run test:coverage",
21
+ "test": "vitest --coverage",
24
22
  "test:update-snapshots": "vitest -u",
25
23
  "lint": "biome check . && tsc --project tsconfig.lint.json --noEmit",
26
24
  "lint:fix": "biome check --write",
@@ -30,10 +28,10 @@
30
28
  "storybook:build": "storybook build"
31
29
  },
32
30
  "peerDependencies": {
31
+ "@lokalise/api-contracts": ">=4.3.0",
33
32
  "@lokalise/frontend-http-client": ">=3.2.1",
34
33
  "@lokalise/louis": ">=26.0.0",
35
34
  "@lokalise/token-dictionary": ">=2.42.1",
36
- "@lokalise/universal-ts-utils": ">=3.4.0",
37
35
  "@tanstack/react-query": ">=5.66.9",
38
36
  "date-fns": ">=4.1",
39
37
  "date-fns-tz": ">=3.2",
@@ -46,6 +44,7 @@
46
44
  "@biomejs/biome": "^1.9.4",
47
45
  "@chromatic-com/storybook": "^3.2.5",
48
46
  "@faker-js/faker": "^9.6.0",
47
+ "@lokalise/api-contracts": "^4.3.0",
49
48
  "@lokalise/biome-config": "^1.6.1",
50
49
  "@semantic-release/changelog": "^6.0.3",
51
50
  "@semantic-release/commit-analyzer": "^13.0.1",
@@ -69,7 +68,7 @@
69
68
  "@types/react-dom": "18.3.0",
70
69
  "@typescript-eslint/parser": "^8.26.1",
71
70
  "@vitejs/plugin-react": "^4.3.4",
72
- "@vitest/coverage-v8": "^3.0.8",
71
+ "@vitest/coverage-v8": "^3.1.1",
73
72
  "bundlesize2": "^0.0.34",
74
73
  "conventional-changelog-conventionalcommits": "^8.0.0",
75
74
  "eslint-plugin-i18next": "^6.0.9",
@@ -82,10 +81,10 @@
82
81
  "semantic-release": "^24.2.3",
83
82
  "storybook": "^8.6.0-alpha.1",
84
83
  "typescript": "^5.7.3",
85
- "vite": "^6.2.1",
84
+ "vite": "^6.3.2",
86
85
  "vite-plugin-dts": "^4.5.3",
87
86
  "vite-plugin-tsconfig-paths": "^1.4.1",
88
- "vitest": "^3.0.3"
87
+ "vitest": "^3.1.1"
89
88
  },
90
89
  "main": "dist/harmony.cjs",
91
90
  "module": "dist/harmony.mjs",