@panoptic-it-solutions/zoho-projects-client 0.2.0 → 0.2.1
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/__tests__/fixtures/clients.d.ts +4 -0
- package/dist/__tests__/fixtures/clients.d.ts.map +1 -0
- package/dist/__tests__/fixtures/clients.js +38 -0
- package/dist/__tests__/fixtures/clients.js.map +1 -0
- package/dist/__tests__/fixtures/contacts.d.ts +4 -0
- package/dist/__tests__/fixtures/contacts.d.ts.map +1 -0
- package/dist/__tests__/fixtures/contacts.js +40 -0
- package/dist/__tests__/fixtures/contacts.js.map +1 -0
- package/dist/__tests__/fixtures/dashboards.d.ts +4 -0
- package/dist/__tests__/fixtures/dashboards.d.ts.map +1 -0
- package/dist/__tests__/fixtures/dashboards.js +42 -0
- package/dist/__tests__/fixtures/dashboards.js.map +1 -0
- package/dist/__tests__/fixtures/followers.d.ts +4 -0
- package/dist/__tests__/fixtures/followers.d.ts.map +1 -0
- package/dist/__tests__/fixtures/followers.js +33 -0
- package/dist/__tests__/fixtures/followers.js.map +1 -0
- package/dist/__tests__/fixtures/index.d.ts +12 -0
- package/dist/__tests__/fixtures/index.d.ts.map +1 -1
- package/dist/__tests__/fixtures/index.js +12 -0
- package/dist/__tests__/fixtures/index.js.map +1 -1
- package/dist/__tests__/fixtures/leaves.d.ts +4 -0
- package/dist/__tests__/fixtures/leaves.d.ts.map +1 -0
- package/dist/__tests__/fixtures/leaves.js +45 -0
- package/dist/__tests__/fixtures/leaves.js.map +1 -0
- package/dist/__tests__/fixtures/profiles.d.ts +4 -0
- package/dist/__tests__/fixtures/profiles.d.ts.map +1 -0
- package/dist/__tests__/fixtures/profiles.js +35 -0
- package/dist/__tests__/fixtures/profiles.js.map +1 -0
- package/dist/__tests__/fixtures/reports.d.ts +5 -0
- package/dist/__tests__/fixtures/reports.d.ts.map +1 -0
- package/dist/__tests__/fixtures/reports.js +70 -0
- package/dist/__tests__/fixtures/reports.js.map +1 -0
- package/dist/__tests__/fixtures/roles.d.ts +4 -0
- package/dist/__tests__/fixtures/roles.d.ts.map +1 -0
- package/dist/__tests__/fixtures/roles.js +38 -0
- package/dist/__tests__/fixtures/roles.js.map +1 -0
- package/dist/__tests__/fixtures/search.d.ts +5 -0
- package/dist/__tests__/fixtures/search.d.ts.map +1 -0
- package/dist/__tests__/fixtures/search.js +61 -0
- package/dist/__tests__/fixtures/search.js.map +1 -0
- package/dist/__tests__/fixtures/teams.d.ts +5 -0
- package/dist/__tests__/fixtures/teams.d.ts.map +1 -0
- package/dist/__tests__/fixtures/teams.js +40 -0
- package/dist/__tests__/fixtures/teams.js.map +1 -0
- package/dist/__tests__/fixtures/trash.d.ts +5 -0
- package/dist/__tests__/fixtures/trash.d.ts.map +1 -0
- package/dist/__tests__/fixtures/trash.js +62 -0
- package/dist/__tests__/fixtures/trash.js.map +1 -0
- package/dist/__tests__/fixtures/widgets.d.ts +4 -0
- package/dist/__tests__/fixtures/widgets.d.ts.map +1 -0
- package/dist/__tests__/fixtures/widgets.js +51 -0
- package/dist/__tests__/fixtures/widgets.js.map +1 -0
- package/dist/__tests__/unit/client/clients.test.d.ts +2 -0
- package/dist/__tests__/unit/client/clients.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/clients.test.js +87 -0
- package/dist/__tests__/unit/client/clients.test.js.map +1 -0
- package/dist/__tests__/unit/client/contacts.test.d.ts +2 -0
- package/dist/__tests__/unit/client/contacts.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/contacts.test.js +89 -0
- package/dist/__tests__/unit/client/contacts.test.js.map +1 -0
- package/dist/__tests__/unit/client/dashboards.test.d.ts +2 -0
- package/dist/__tests__/unit/client/dashboards.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/dashboards.test.js +87 -0
- package/dist/__tests__/unit/client/dashboards.test.js.map +1 -0
- package/dist/__tests__/unit/client/followers.test.d.ts +2 -0
- package/dist/__tests__/unit/client/followers.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/followers.test.js +109 -0
- package/dist/__tests__/unit/client/followers.test.js.map +1 -0
- package/dist/__tests__/unit/client/leaves.test.d.ts +2 -0
- package/dist/__tests__/unit/client/leaves.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/leaves.test.js +91 -0
- package/dist/__tests__/unit/client/leaves.test.js.map +1 -0
- package/dist/__tests__/unit/client/profiles.test.d.ts +2 -0
- package/dist/__tests__/unit/client/profiles.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/profiles.test.js +86 -0
- package/dist/__tests__/unit/client/profiles.test.js.map +1 -0
- package/dist/__tests__/unit/client/reports.test.d.ts +2 -0
- package/dist/__tests__/unit/client/reports.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/reports.test.js +86 -0
- package/dist/__tests__/unit/client/reports.test.js.map +1 -0
- package/dist/__tests__/unit/client/roles.test.d.ts +2 -0
- package/dist/__tests__/unit/client/roles.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/roles.test.js +86 -0
- package/dist/__tests__/unit/client/roles.test.js.map +1 -0
- package/dist/__tests__/unit/client/search.test.d.ts +2 -0
- package/dist/__tests__/unit/client/search.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/search.test.js +106 -0
- package/dist/__tests__/unit/client/search.test.js.map +1 -0
- package/dist/__tests__/unit/client/teams.test.d.ts +2 -0
- package/dist/__tests__/unit/client/teams.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/teams.test.js +115 -0
- package/dist/__tests__/unit/client/teams.test.js.map +1 -0
- package/dist/__tests__/unit/client/timelogs.test.d.ts +2 -0
- package/dist/__tests__/unit/client/timelogs.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/timelogs.test.js +112 -0
- package/dist/__tests__/unit/client/timelogs.test.js.map +1 -0
- package/dist/__tests__/unit/client/trash.test.d.ts +2 -0
- package/dist/__tests__/unit/client/trash.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/trash.test.js +103 -0
- package/dist/__tests__/unit/client/trash.test.js.map +1 -0
- package/dist/__tests__/unit/client/widgets.test.d.ts +2 -0
- package/dist/__tests__/unit/client/widgets.test.d.ts.map +1 -0
- package/dist/__tests__/unit/client/widgets.test.js +91 -0
- package/dist/__tests__/unit/client/widgets.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const mockTeamMember = {
|
|
2
|
+
id: "user_001",
|
|
3
|
+
name: "John Doe",
|
|
4
|
+
email: "john@example.com",
|
|
5
|
+
zpuid: "zpuid_001",
|
|
6
|
+
};
|
|
7
|
+
export const mockTeam = {
|
|
8
|
+
id: "team_001",
|
|
9
|
+
id_string: "team_001",
|
|
10
|
+
name: "Engineering Team",
|
|
11
|
+
description: "Core engineering team",
|
|
12
|
+
members: [
|
|
13
|
+
mockTeamMember,
|
|
14
|
+
{ id: "user_002", name: "Jane Smith", email: "jane@example.com" },
|
|
15
|
+
{ id: "user_003", name: "Bob Wilson", email: "bob@example.com" },
|
|
16
|
+
],
|
|
17
|
+
members_count: 3,
|
|
18
|
+
lead_id: "user_001",
|
|
19
|
+
lead_name: "John Doe",
|
|
20
|
+
projects_count: 5,
|
|
21
|
+
created_time: "2024-01-01T00:00:00Z",
|
|
22
|
+
created_time_long: 1704067200000,
|
|
23
|
+
last_modified_time: "2024-01-15T12:00:00Z",
|
|
24
|
+
last_modified_time_long: 1705320000000,
|
|
25
|
+
};
|
|
26
|
+
export const mockTeams = [
|
|
27
|
+
mockTeam,
|
|
28
|
+
{
|
|
29
|
+
id: "team_002",
|
|
30
|
+
id_string: "team_002",
|
|
31
|
+
name: "Design Team",
|
|
32
|
+
description: "UX and UI design team",
|
|
33
|
+
members: [{ id: "user_004", name: "Alice Brown", email: "alice@example.com" }],
|
|
34
|
+
members_count: 1,
|
|
35
|
+
lead_id: "user_004",
|
|
36
|
+
lead_name: "Alice Brown",
|
|
37
|
+
projects_count: 3,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
//# sourceMapping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|
|
|
1
|
+
import type { TrashItem, TrashRestoreResponse } from "../../types/index.js";
|
|
2
|
+
export declare const mockTrashItem: TrashItem;
|
|
3
|
+
export declare const mockTrashItems: TrashItem[];
|
|
4
|
+
export declare const mockTrashRestoreResponse: TrashRestoreResponse;
|
|
5
|
+
//# sourceMappingURL=trash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trash.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/trash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,eAAO,MAAM,aAAa,EAAE,SAyB3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAAS,EA8BrC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,oBAGtC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const mockTrashItem = {
|
|
2
|
+
id: "task_deleted_001",
|
|
3
|
+
id_string: "task_deleted_001",
|
|
4
|
+
name: "Old Task",
|
|
5
|
+
title: "Old Task",
|
|
6
|
+
entity_type: "task",
|
|
7
|
+
module: "tasks",
|
|
8
|
+
description: "A task that was deleted",
|
|
9
|
+
project: {
|
|
10
|
+
id: 12345,
|
|
11
|
+
id_string: "12345",
|
|
12
|
+
name: "Test Project",
|
|
13
|
+
},
|
|
14
|
+
deleted_by: { id: "user_001", name: "John Doe" },
|
|
15
|
+
deleted_person: "John Doe",
|
|
16
|
+
deleted_time: "2024-01-10T14:30:00Z",
|
|
17
|
+
deleted_time_long: 1704896200000,
|
|
18
|
+
created_by: { id: "user_002", name: "Jane Smith" },
|
|
19
|
+
created_time: "2024-01-01T00:00:00Z",
|
|
20
|
+
created_time_long: 1704067200000,
|
|
21
|
+
days_remaining: 20,
|
|
22
|
+
link: {
|
|
23
|
+
self: { url: "https://projects.zoho.com/trash/task_deleted_001" },
|
|
24
|
+
restore: { url: "https://projects.zoho.com/trash/task_deleted_001/restore" },
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const mockTrashItems = [
|
|
28
|
+
mockTrashItem,
|
|
29
|
+
{
|
|
30
|
+
id: "bug_deleted_001",
|
|
31
|
+
id_string: "bug_deleted_001",
|
|
32
|
+
name: "Resolved Bug",
|
|
33
|
+
entity_type: "bug",
|
|
34
|
+
module: "bugs",
|
|
35
|
+
description: "A bug that was resolved and deleted",
|
|
36
|
+
project: {
|
|
37
|
+
id: 12345,
|
|
38
|
+
id_string: "12345",
|
|
39
|
+
name: "Test Project",
|
|
40
|
+
},
|
|
41
|
+
deleted_by: { id: "user_001", name: "John Doe" },
|
|
42
|
+
deleted_time: "2024-01-12T10:00:00Z",
|
|
43
|
+
deleted_time_long: 1705053600000,
|
|
44
|
+
days_remaining: 22,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "milestone_deleted_001",
|
|
48
|
+
id_string: "milestone_deleted_001",
|
|
49
|
+
name: "Q3 Milestone",
|
|
50
|
+
entity_type: "milestone",
|
|
51
|
+
module: "milestones",
|
|
52
|
+
deleted_by: { id: "user_002", name: "Jane Smith" },
|
|
53
|
+
deleted_time: "2024-01-14T16:00:00Z",
|
|
54
|
+
deleted_time_long: 1705248000000,
|
|
55
|
+
days_remaining: 24,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
export const mockTrashRestoreResponse = {
|
|
59
|
+
restored: true,
|
|
60
|
+
message: "Item restored successfully",
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=trash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trash.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/trash.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,EAAE,EAAE,kBAAkB;IACtB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,MAAM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E;QAClD,YAAY,EAAE,sBAAsB;QACpC,iBAAiB,EAAE,aAAa;QAChC,cAAc,EAAE,EAAE;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAyB;IAC5D,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,4BAA4B;CACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/widgets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,eAAO,MAAM,UAAU,EAAE,MA2BxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,EAqB/B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const mockWidget = {
|
|
2
|
+
id: 2001,
|
|
3
|
+
id_string: "2001",
|
|
4
|
+
name: "Task Progress Chart",
|
|
5
|
+
description: "Shows task completion progress",
|
|
6
|
+
type: "chart",
|
|
7
|
+
widget_type: "pie_chart",
|
|
8
|
+
position: {
|
|
9
|
+
row: 0,
|
|
10
|
+
col: 0,
|
|
11
|
+
width: 4,
|
|
12
|
+
height: 2,
|
|
13
|
+
},
|
|
14
|
+
config: {
|
|
15
|
+
chart_type: "pie",
|
|
16
|
+
data_source: "tasks",
|
|
17
|
+
filters: { status: "all" },
|
|
18
|
+
display_options: { show_legend: true },
|
|
19
|
+
},
|
|
20
|
+
dashboard_id: "1001",
|
|
21
|
+
link: {
|
|
22
|
+
self: { url: "https://projects.zoho.com/widget/2001" },
|
|
23
|
+
},
|
|
24
|
+
created_time: "2024-01-01T00:00:00Z",
|
|
25
|
+
created_time_long: 1704067200000,
|
|
26
|
+
last_modified_time: "2024-01-15T12:00:00Z",
|
|
27
|
+
last_modified_time_long: 1705320000000,
|
|
28
|
+
};
|
|
29
|
+
export const mockWidgets = [
|
|
30
|
+
mockWidget,
|
|
31
|
+
{
|
|
32
|
+
id: 2002,
|
|
33
|
+
id_string: "2002",
|
|
34
|
+
name: "Recent Activity",
|
|
35
|
+
description: "Shows recent project activity",
|
|
36
|
+
type: "list",
|
|
37
|
+
widget_type: "activity_feed",
|
|
38
|
+
position: {
|
|
39
|
+
row: 0,
|
|
40
|
+
col: 4,
|
|
41
|
+
width: 4,
|
|
42
|
+
height: 3,
|
|
43
|
+
},
|
|
44
|
+
config: {
|
|
45
|
+
data_source: "activity",
|
|
46
|
+
filters: { limit: 10 },
|
|
47
|
+
},
|
|
48
|
+
dashboard_id: "1001",
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
//# sourceMappingURL=widgets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgets.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/widgets.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAW;IAChC,EAAE,EAAE,IAAI;IACR,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,gCAAgC;IAC7C,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE;QACR,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV;IACD,MAAM,EAAE;QACN,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;QAC1B,eAAe,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;KACvC;IACD,YAAY,EAAE,MAAM;IACpB,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE,GAAG,EAAE,uCAAuC,EAAE;KACvD;IACD,YAAY,EAAE,sBAAsB;IACpC,iBAAiB,EAAE,aAAa;IAChC,kBAAkB,EAAE,sBAAsB;IAC1C,uBAAuB,EAAE,aAAa;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,UAAU;IACV;QACE,EAAE,EAAE,IAAI;QACR,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACV;QACD,MAAM,EAAE;YACN,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;SACvB;QACD,YAAY,EAAE,MAAM;KACrB;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/unit/client/clients.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for clients API
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
5
|
+
import { http, HttpResponse } from "msw";
|
|
6
|
+
import { server } from "../../mocks/server.js";
|
|
7
|
+
import { createZohoProjectsClient } from "../../../client.js";
|
|
8
|
+
import { mockClient, mockClients } from "../../fixtures/clients.js";
|
|
9
|
+
const TEST_PORTAL_ID = "12345";
|
|
10
|
+
const BASE_URL = `https://projectsapi.zoho.com/restapi/portal/${TEST_PORTAL_ID}`;
|
|
11
|
+
describe("clients", () => {
|
|
12
|
+
let client;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
client = createZohoProjectsClient({
|
|
15
|
+
clientId: "test-client-id",
|
|
16
|
+
clientSecret: "test-client-secret",
|
|
17
|
+
refreshToken: "test-refresh-token",
|
|
18
|
+
portalId: TEST_PORTAL_ID,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("list", () => {
|
|
22
|
+
it("should list all clients", async () => {
|
|
23
|
+
server.use(http.get(`${BASE_URL}/clients/`, () => {
|
|
24
|
+
return HttpResponse.json({
|
|
25
|
+
clients: mockClients,
|
|
26
|
+
page_info: { page: 1, per_page: 100, has_more_page: false },
|
|
27
|
+
});
|
|
28
|
+
}));
|
|
29
|
+
const result = await client.clients.list();
|
|
30
|
+
expect(result.data).toHaveLength(2);
|
|
31
|
+
expect(result.data[0]).toMatchObject({
|
|
32
|
+
id: expect.any(String),
|
|
33
|
+
name: expect.any(String),
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe("get", () => {
|
|
38
|
+
it("should get a single client by ID", async () => {
|
|
39
|
+
server.use(http.get(`${BASE_URL}/clients/client_001/`, () => {
|
|
40
|
+
return HttpResponse.json({ clients: [mockClient] });
|
|
41
|
+
}));
|
|
42
|
+
const result = await client.clients.get("client_001");
|
|
43
|
+
expect(result.id).toBe("client_001");
|
|
44
|
+
expect(result.name).toBe("Acme Corporation");
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe("create", () => {
|
|
48
|
+
it("should create a client", async () => {
|
|
49
|
+
let capturedBody;
|
|
50
|
+
server.use(http.post(`${BASE_URL}/clients/`, async ({ request }) => {
|
|
51
|
+
capturedBody = await request.json();
|
|
52
|
+
return HttpResponse.json({ clients: [mockClient] });
|
|
53
|
+
}));
|
|
54
|
+
const result = await client.clients.create({
|
|
55
|
+
name: "Acme Corporation",
|
|
56
|
+
email: "contact@acme.com",
|
|
57
|
+
phone: "+1-555-123-4567",
|
|
58
|
+
});
|
|
59
|
+
expect(capturedBody).toMatchObject({
|
|
60
|
+
name: "Acme Corporation",
|
|
61
|
+
email: "contact@acme.com",
|
|
62
|
+
});
|
|
63
|
+
expect(result.name).toBe("Acme Corporation");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe("update", () => {
|
|
67
|
+
it("should update a client", async () => {
|
|
68
|
+
const updatedClient = { ...mockClient, name: "Acme Inc" };
|
|
69
|
+
server.use(http.put(`${BASE_URL}/clients/client_001/`, () => {
|
|
70
|
+
return HttpResponse.json({ clients: [updatedClient] });
|
|
71
|
+
}));
|
|
72
|
+
const result = await client.clients.update("client_001", {
|
|
73
|
+
name: "Acme Inc",
|
|
74
|
+
});
|
|
75
|
+
expect(result.name).toBe("Acme Inc");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe("delete", () => {
|
|
79
|
+
it("should delete a client", async () => {
|
|
80
|
+
server.use(http.delete(`${BASE_URL}/clients/client_001/`, () => {
|
|
81
|
+
return new HttpResponse(null, { status: 204 });
|
|
82
|
+
}));
|
|
83
|
+
await expect(client.clients.delete("client_001")).resolves.toBeUndefined();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=clients.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.test.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/client/clients.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,MAAM,QAAQ,GAAG,+CAA+C,cAAc,EAAE,CAAC;AAEjF,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,MAAmD,CAAC;IAExD,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,GAAG,wBAAwB,CAAC;YAChC,QAAQ,EAAE,gBAAgB;YAC1B,YAAY,EAAE,oBAAoB;YAClC,Y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AI,EAAE,UAAU,EAAE,CAAC;YAE1D,MAAM,CAAC,GAAG,CACR,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,sBAAsB,EAAE,GAAG,EAAE;gBAC/C,OAAO,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;YACzD,CAAC,CAAC,CACH,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE;gBACvD,IAAI,EAAE,UAAU;aACjB,CAAC,CAAC;YAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;YACtC,MAAM,CAAC,GAAG,CACR,IAAI,CAAC,MAAM,CAAC,GAAG,QAAQ,sBAAsB,EAAE,GAAG,EAAE;gBAClD,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YACjD,CAAC,CAAC,CACH,CAAC;YAEF,MAAM,MAAM,CACV,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CACpC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/unit/client/contacts.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for contacts API
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
5
|
+
import { http, HttpResponse } from "msw";
|
|
6
|
+
import { server } from "../../mocks/server.js";
|
|
7
|
+
import { createZohoProjectsClient } from "../../../client.js";
|
|
8
|
+
import { mockContact, mockContacts } from "../../fixtures/contacts.js";
|
|
9
|
+
const TEST_PORTAL_ID = "12345";
|
|
10
|
+
const BASE_URL = `https://projectsapi.zoho.com/restapi/portal/${TEST_PORTAL_ID}`;
|
|
11
|
+
describe("contacts", () => {
|
|
12
|
+
let client;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
client = createZohoProjectsClient({
|
|
15
|
+
clientId: "test-client-id",
|
|
16
|
+
clientSecret: "test-client-secret",
|
|
17
|
+
refreshToken: "test-refresh-token",
|
|
18
|
+
portalId: TEST_PORTAL_ID,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("list", () => {
|
|
22
|
+
it("should list all contacts", async () => {
|
|
23
|
+
server.use(http.get(`${BASE_URL}/contacts/`, () => {
|
|
24
|
+
return HttpResponse.json({
|
|
25
|
+
contacts: mockContacts,
|
|
26
|
+
page_info: { page: 1, per_page: 100, has_more_page: false },
|
|
27
|
+
});
|
|
28
|
+
}));
|
|
29
|
+
const result = await client.contacts.list();
|
|
30
|
+
expect(result.data).toHaveLength(2);
|
|
31
|
+
expect(result.data[0]).toMatchObject({
|
|
32
|
+
id: expect.any(String),
|
|
33
|
+
first_name: expect.any(String),
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe("get", () => {
|
|
38
|
+
it("should get a single contact by ID", async () => {
|
|
39
|
+
server.use(http.get(`${BASE_URL}/contacts/contact_001/`, () => {
|
|
40
|
+
return HttpResponse.json({ contacts: [mockContact] });
|
|
41
|
+
}));
|
|
42
|
+
const result = await client.contacts.get("contact_001");
|
|
43
|
+
expect(result.id).toBe("contact_001");
|
|
44
|
+
expect(result.first_name).toBe("Jane");
|
|
45
|
+
expect(result.last_name).toBe("Smith");
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe("create", () => {
|
|
49
|
+
it("should create a contact", async () => {
|
|
50
|
+
let capturedBody;
|
|
51
|
+
server.use(http.post(`${BASE_URL}/contacts/`, async ({ request }) => {
|
|
52
|
+
capturedBody = await request.json();
|
|
53
|
+
return HttpResponse.json({ contacts: [mockContact] });
|
|
54
|
+
}));
|
|
55
|
+
const result = await client.contacts.create({
|
|
56
|
+
first_name: "Jane",
|
|
57
|
+
last_name: "Smith",
|
|
58
|
+
email: "jane.smith@acme.com",
|
|
59
|
+
});
|
|
60
|
+
expect(capturedBody).toMatchObject({
|
|
61
|
+
first_name: "Jane",
|
|
62
|
+
last_name: "Smith",
|
|
63
|
+
email: "jane.smith@acme.com",
|
|
64
|
+
});
|
|
65
|
+
expect(result.first_name).toBe("Jane");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("update", () => {
|
|
69
|
+
it("should update a contact", async () => {
|
|
70
|
+
const updatedContact = { ...mockContact, designation: "VP Engineering" };
|
|
71
|
+
server.use(http.put(`${BASE_URL}/contacts/contact_001/`, () => {
|
|
72
|
+
return HttpResponse.json({ contacts: [updatedContact] });
|
|
73
|
+
}));
|
|
74
|
+
const result = await client.contacts.update("contact_001", {
|
|
75
|
+
designation: "VP Engineering",
|
|
76
|
+
});
|
|
77
|
+
expect(result.designation).toBe("VP Engineering");
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
describe("delete", () => {
|
|
81
|
+
it("should delete a contact", async () => {
|
|
82
|
+
server.use(http.delete(`${BASE_URL}/contacts/contact_001/`, () => {
|
|
83
|
+
return new HttpResponse(null, { status: 204 });
|
|
84
|
+
}));
|
|
85
|
+
await expect(client.contacts.delete("contact_001")).resolves.toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=contacts.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.test.js","sourceRoot":"","sources":["../../../../src/__tests__/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AC,CAAC;IAEH,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;YACvC,MAAM,CAAC,GAAG,CACR,IAAI,CAAC,MAAM,CAAC,GAAG,QAAQ,wBAAwB,EAAE,GAAG,EAAE;gBACpD,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YACjD,CAAC,CAAC,CACH,CAAC;YAEF,MAAM,MAAM,CACV,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CACtC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboards.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/unit/client/dashboards.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for dashboards API
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
5
|
+
import { http, HttpResponse } from "msw";
|
|
6
|
+
import { server } from "../../mocks/server.js";
|
|
7
|
+
import { createZohoProjectsClient } from "../../../client.js";
|
|
8
|
+
import { mockDashboard, mockDashboards } from "../../fixtures/dashboards.js";
|
|
9
|
+
const TEST_PORTAL_ID = "12345";
|
|
10
|
+
const BASE_URL = `https://projectsapi.zoho.com/restapi/portal/${TEST_PORTAL_ID}`;
|
|
11
|
+
describe("dashboards", () => {
|
|
12
|
+
let client;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
client = createZohoProjectsClient({
|
|
15
|
+
clientId: "test-client-id",
|
|
16
|
+
clientSecret: "test-client-secret",
|
|
17
|
+
refreshToken: "test-refresh-token",
|
|
18
|
+
portalId: TEST_PORTAL_ID,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("list", () => {
|
|
22
|
+
it("should list all dashboards", async () => {
|
|
23
|
+
server.use(http.get(`${BASE_URL}/dashboards/`, () => {
|
|
24
|
+
return HttpResponse.json({
|
|
25
|
+
dashboards: mockDashboards,
|
|
26
|
+
page_info: { page: 1, per_page: 100, has_more_page: false },
|
|
27
|
+
});
|
|
28
|
+
}));
|
|
29
|
+
const result = await client.dashboards.list();
|
|
30
|
+
expect(result.data).toHaveLength(2);
|
|
31
|
+
expect(result.data[0]).toMatchObject({
|
|
32
|
+
id: expect.any(Number),
|
|
33
|
+
name: expect.any(String),
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe("get", () => {
|
|
38
|
+
it("should get a single dashboard by ID", async () => {
|
|
39
|
+
server.use(http.get(`${BASE_URL}/dashboards/1001/`, () => {
|
|
40
|
+
return HttpResponse.json({ dashboards: [mockDashboard] });
|
|
41
|
+
}));
|
|
42
|
+
const result = await client.dashboards.get("1001");
|
|
43
|
+
expect(result.id).toBe(1001);
|
|
44
|
+
expect(result.name).toBe("Project Overview");
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe("create", () => {
|
|
48
|
+
it("should create a dashboard", async () => {
|
|
49
|
+
let capturedBody;
|
|
50
|
+
server.use(http.post(`${BASE_URL}/dashboards/`, async ({ request }) => {
|
|
51
|
+
capturedBody = await request.json();
|
|
52
|
+
return HttpResponse.json({ dashboards: [mockDashboard] });
|
|
53
|
+
}));
|
|
54
|
+
const result = await client.dashboards.create({
|
|
55
|
+
name: "Project Overview",
|
|
56
|
+
description: "Main project dashboard",
|
|
57
|
+
type: "project",
|
|
58
|
+
});
|
|
59
|
+
expect(capturedBody).toMatchObject({
|
|
60
|
+
name: "Project Overview",
|
|
61
|
+
type: "project",
|
|
62
|
+
});
|
|
63
|
+
expect(result.name).toBe("Project Overview");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe("update", () => {
|
|
67
|
+
it("should update a dashboard", async () => {
|
|
68
|
+
const updatedDashboard = { ...mockDashboard, name: "Team Overview" };
|
|
69
|
+
server.use(http.put(`${BASE_URL}/dashboards/1001/`, () => {
|
|
70
|
+
return HttpResponse.json({ dashboards: [updatedDashboard] });
|
|
71
|
+
}));
|
|
72
|
+
const result = await client.dashboards.update("1001", {
|
|
73
|
+
name: "Team Overview",
|
|
74
|
+
});
|
|
75
|
+
expect(result.name).toBe("Team Overview");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe("delete", () => {
|
|
79
|
+
it("should delete a dashboard", async () => {
|
|
80
|
+
server.use(http.delete(`${BASE_URL}/dashboards/1001/`, () => {
|
|
81
|
+
return new HttpResponse(null, { status: 204 });
|
|
82
|
+
}));
|
|
83
|
+
await expect(client.dashboards.delete("1001")).resolves.toBeUndefined();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=dashboards.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboards.test.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/client/dashboards.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE7E,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,MAAM,QAAQ,GAAG,+CAA+C,cAAc,EAAE,CAAC;AAEjF,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,MAAmD,CAAC;IAExD,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@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for followers API
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
5
|
+
import { http, HttpResponse } from "msw";
|
|
6
|
+
import { server } from "../../mocks/server.js";
|
|
7
|
+
import { createZohoProjectsClient } from "../../../client.js";
|
|
8
|
+
import { mockFollowers } from "../../fixtures/followers.js";
|
|
9
|
+
const TEST_PORTAL_ID = "12345";
|
|
10
|
+
const BASE_URL = `https://projectsapi.zoho.com/restapi/portal/${TEST_PORTAL_ID}`;
|
|
11
|
+
describe("followers", () => {
|
|
12
|
+
let client;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
client = createZohoProjectsClient({
|
|
15
|
+
clientId: "test-client-id",
|
|
16
|
+
clientSecret: "test-client-secret",
|
|
17
|
+
refreshToken: "test-refresh-token",
|
|
18
|
+
portalId: TEST_PORTAL_ID,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("forTask", () => {
|
|
22
|
+
describe("list", () => {
|
|
23
|
+
it("should list followers for a task", async () => {
|
|
24
|
+
server.use(http.get(`${BASE_URL}/projects/proj_001/tasks/task_001/followers/`, () => {
|
|
25
|
+
return HttpResponse.json({
|
|
26
|
+
followers: mockFollowers,
|
|
27
|
+
page_info: { page: 1, per_page: 100, has_more_page: false },
|
|
28
|
+
});
|
|
29
|
+
}));
|
|
30
|
+
const taskFollowers = client.followers.forTask("proj_001", "task_001");
|
|
31
|
+
const result = await taskFollowers.list();
|
|
32
|
+
expect(result.data).toHaveLength(3);
|
|
33
|
+
expect(result.data[0]).toMatchObject({
|
|
34
|
+
id: expect.anything(),
|
|
35
|
+
name: expect.any(String),
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe("add", () => {
|
|
40
|
+
it("should add followers to a task", async () => {
|
|
41
|
+
let capturedBody;
|
|
42
|
+
server.use(http.post(`${BASE_URL}/projects/proj_001/tasks/task_001/followers/`, async ({ request }) => {
|
|
43
|
+
capturedBody = await request.json();
|
|
44
|
+
return HttpResponse.json({ followers: mockFollowers });
|
|
45
|
+
}));
|
|
46
|
+
const taskFollowers = client.followers.forTask("proj_001", "task_001");
|
|
47
|
+
const result = await taskFollowers.add({ followers: "user_001,user_002" });
|
|
48
|
+
expect(capturedBody).toMatchObject({
|
|
49
|
+
followers: "user_001,user_002",
|
|
50
|
+
});
|
|
51
|
+
expect(result).toHaveLength(3);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe("remove", () => {
|
|
55
|
+
it("should remove a follower from a task", async () => {
|
|
56
|
+
server.use(http.delete(`${BASE_URL}/projects/proj_001/tasks/task_001/followers/user_001/`, () => {
|
|
57
|
+
return new HttpResponse(null, { status: 204 });
|
|
58
|
+
}));
|
|
59
|
+
const taskFollowers = client.followers.forTask("proj_001", "task_001");
|
|
60
|
+
await expect(taskFollowers.remove("user_001")).resolves.toBeUndefined();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe("follow", () => {
|
|
64
|
+
it("should follow an entity (add current user)", async () => {
|
|
65
|
+
server.use(http.post(`${BASE_URL}/projects/proj_001/tasks/task_001/followers/me/`, () => {
|
|
66
|
+
return HttpResponse.json({});
|
|
67
|
+
}));
|
|
68
|
+
const taskFollowers = client.followers.forTask("proj_001", "task_001");
|
|
69
|
+
await expect(taskFollowers.follow()).resolves.toBeUndefined();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe("unfollow", () => {
|
|
73
|
+
it("should unfollow an entity (remove current user)", async () => {
|
|
74
|
+
server.use(http.delete(`${BASE_URL}/projects/proj_001/tasks/task_001/followers/me/`, () => {
|
|
75
|
+
return new HttpResponse(null, { status: 204 });
|
|
76
|
+
}));
|
|
77
|
+
const taskFollowers = client.followers.forTask("proj_001", "task_001");
|
|
78
|
+
await expect(taskFollowers.unfollow()).resolves.toBeUndefined();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
describe("forIssue", () => {
|
|
83
|
+
it("should list followers for an issue", async () => {
|
|
84
|
+
server.use(http.get(`${BASE_URL}/projects/proj_001/bugs/bug_001/followers/`, () => {
|
|
85
|
+
return HttpResponse.json({
|
|
86
|
+
followers: mockFollowers,
|
|
87
|
+
page_info: { page: 1, per_page: 100, has_more_page: false },
|
|
88
|
+
});
|
|
89
|
+
}));
|
|
90
|
+
const issueFollowers = client.followers.forIssue("proj_001", "bug_001");
|
|
91
|
+
const result = await issueFollowers.list();
|
|
92
|
+
expect(result.data).toHaveLength(3);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
describe("forForum", () => {
|
|
96
|
+
it("should list followers for a forum", async () => {
|
|
97
|
+
server.use(http.get(`${BASE_URL}/projects/proj_001/forums/forum_001/followers/`, () => {
|
|
98
|
+
return HttpResponse.json({
|
|
99
|
+
followers: mockFollowers,
|
|
100
|
+
page_info: { page: 1, per_page: 100, has_more_page: false },
|
|
101
|
+
});
|
|
102
|
+
}));
|
|
103
|
+
const forumFollowers = client.followers.forForum("proj_001", "forum_001");
|
|
104
|
+
const result = await forumFollowers.list();
|
|
105
|
+
expect(result.data).toHaveLength(3);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=followers.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followers.test.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/client/followers.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAgB,aAAa,EA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