@lokalise/harmony 1.22.2 → 1.24.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.
@@ -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>;
@@ -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';
@@ -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>;
@@ -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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/harmony",
3
- "version": "1.22.2",
3
+ "version": "1.24.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"