@elobdev/zoho-projects-wrapper 0.1.0 → 0.1.2

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.
Files changed (120) hide show
  1. package/README.md +28 -8
  2. package/dist/client.d.ts +35 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +66 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/errors.d.ts +22 -0
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/errors.js +42 -0
  9. package/dist/errors.js.map +1 -0
  10. package/dist/http.d.ts +14 -0
  11. package/dist/http.d.ts.map +1 -0
  12. package/dist/http.js +136 -0
  13. package/dist/http.js.map +1 -0
  14. package/dist/index.d.ts +20 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +20 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/oauth.d.ts +20 -0
  19. package/dist/oauth.d.ts.map +1 -0
  20. package/dist/oauth.js +103 -0
  21. package/dist/oauth.js.map +1 -0
  22. package/dist/query.d.ts +5 -0
  23. package/dist/query.d.ts.map +1 -0
  24. package/dist/query.js +47 -0
  25. package/dist/query.js.map +1 -0
  26. package/dist/resource-base.d.ts +18 -0
  27. package/dist/resource-base.d.ts.map +1 -0
  28. package/dist/resource-base.js +46 -0
  29. package/dist/resource-base.js.map +1 -0
  30. package/dist/resources/custom-fields.d.ts +17 -0
  31. package/dist/resources/custom-fields.d.ts.map +1 -0
  32. package/dist/resources/custom-fields.js +11 -0
  33. package/dist/resources/custom-fields.js.map +1 -0
  34. package/dist/resources/issues.d.ts +67 -0
  35. package/dist/resources/issues.d.ts.map +1 -0
  36. package/dist/resources/issues.js +107 -0
  37. package/dist/resources/issues.js.map +1 -0
  38. package/dist/resources/module-meta.d.ts +2 -0
  39. package/dist/resources/module-meta.d.ts.map +1 -0
  40. package/dist/resources/module-meta.js +2 -0
  41. package/dist/resources/module-meta.js.map +1 -0
  42. package/dist/resources/phases.d.ts +46 -0
  43. package/dist/resources/phases.d.ts.map +1 -0
  44. package/dist/resources/phases.js +52 -0
  45. package/dist/resources/phases.js.map +1 -0
  46. package/dist/resources/portals.d.ts +15 -0
  47. package/dist/resources/portals.d.ts.map +1 -0
  48. package/dist/resources/portals.js +36 -0
  49. package/dist/resources/portals.js.map +1 -0
  50. package/dist/resources/project-groups.d.ts +18 -0
  51. package/dist/resources/project-groups.d.ts.map +1 -0
  52. package/dist/resources/project-groups.js +19 -0
  53. package/dist/resources/project-groups.js.map +1 -0
  54. package/dist/resources/projects.d.ts +33 -0
  55. package/dist/resources/projects.d.ts.map +1 -0
  56. package/dist/resources/projects.js +40 -0
  57. package/dist/resources/projects.js.map +1 -0
  58. package/dist/resources/records.d.ts +21 -0
  59. package/dist/resources/records.d.ts.map +1 -0
  60. package/dist/resources/records.js +31 -0
  61. package/dist/resources/records.js.map +1 -0
  62. package/dist/resources/settings.d.ts +46 -0
  63. package/dist/resources/settings.d.ts.map +1 -0
  64. package/dist/resources/settings.js +100 -0
  65. package/dist/resources/settings.js.map +1 -0
  66. package/dist/resources/tasklists.d.ts +38 -0
  67. package/dist/resources/tasklists.d.ts.map +1 -0
  68. package/dist/resources/tasklists.js +52 -0
  69. package/dist/resources/tasklists.js.map +1 -0
  70. package/dist/resources/tasks.d.ts +26 -0
  71. package/dist/resources/tasks.d.ts.map +1 -0
  72. package/dist/resources/tasks.js +34 -0
  73. package/dist/resources/tasks.js.map +1 -0
  74. package/dist/resources/time-logs.d.ts +56 -0
  75. package/dist/resources/time-logs.d.ts.map +1 -0
  76. package/dist/resources/time-logs.js +209 -0
  77. package/dist/resources/time-logs.js.map +1 -0
  78. package/dist/tools.d.ts +20 -0
  79. package/dist/tools.d.ts.map +1 -0
  80. package/dist/tools.js +652 -0
  81. package/dist/tools.js.map +1 -0
  82. package/dist/types.d.ts +532 -0
  83. package/dist/types.d.ts.map +1 -0
  84. package/dist/types.js +2 -0
  85. package/dist/types.js.map +1 -0
  86. package/package.json +19 -1
  87. package/.codex +0 -0
  88. package/docs/zoho- +0 -0
  89. package/docs/zoho-projects-api-matrix.md +0 -368
  90. package/src/client.ts +0 -75
  91. package/src/errors.ts +0 -34
  92. package/src/http.ts +0 -166
  93. package/src/index.ts +0 -19
  94. package/src/oauth.ts +0 -121
  95. package/src/query.ts +0 -51
  96. package/src/resource-base.ts +0 -59
  97. package/src/resources/custom-fields.ts +0 -27
  98. package/src/resources/issues.ts +0 -166
  99. package/src/resources/module-meta.ts +0 -1
  100. package/src/resources/phases.ts +0 -68
  101. package/src/resources/portals.ts +0 -46
  102. package/src/resources/project-groups.ts +0 -24
  103. package/src/resources/projects.ts +0 -56
  104. package/src/resources/records.ts +0 -40
  105. package/src/resources/settings.ts +0 -132
  106. package/src/resources/tasklists.ts +0 -94
  107. package/src/resources/tasks.ts +0 -43
  108. package/src/resources/time-logs.ts +0 -274
  109. package/src/tools.ts +0 -741
  110. package/src/types.ts +0 -546
  111. package/test/helpers.ts +0 -28
  112. package/test/http.test.ts +0 -49
  113. package/test/node-shims.d.ts +0 -9
  114. package/test/oauth.test.ts +0 -72
  115. package/test/path-alias-hooks.js +0 -10
  116. package/test/query.test.ts +0 -46
  117. package/test/register-path-alias.js +0 -3
  118. package/test/resources.test.ts +0 -504
  119. package/test/tools.test.ts +0 -30
  120. package/tsconfig.json +0 -20
@@ -1,68 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ZohoFilter, ZohoListResponse, ZohoPageParams } from '@/types.ts';
3
-
4
- export class PhasesResource extends ResourceBase {
5
- listAll(portalId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; milestone_ids?: string; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<Record<string, unknown>>> {
6
- return this.get(this.portalPath(portalId, 'phases'), this.withFilter(params, params.filter));
7
- }
8
-
9
- list(portalId: string | number, projectId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; milestone_ids?: string; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<Record<string, unknown>>> {
10
- return this.get(this.projectPath(portalId, projectId, 'phases'), this.withFilter(params, params.filter));
11
- }
12
-
13
- getById(portalId: string | number, projectId: string | number, phaseId: string | number): Promise<Record<string, unknown>> {
14
- return this.get(this.projectPath(portalId, projectId, 'phases', phaseId));
15
- }
16
-
17
- create(portalId: string | number, projectId: string | number, body: Record<string, unknown>): Promise<Record<string, unknown>> {
18
- return this.post(this.projectPath(portalId, projectId, 'phases'), body);
19
- }
20
-
21
- update(portalId: string | number, projectId: string | number, phaseId: string | number, body: Record<string, unknown>): Promise<Record<string, unknown>> {
22
- return this.patch(this.projectPath(portalId, projectId, 'phases', phaseId), body);
23
- }
24
-
25
- deleteById(portalId: string | number, projectId: string | number, phaseId: string | number): Promise<unknown> {
26
- return this.delete(this.projectPath(portalId, projectId, 'phases', phaseId));
27
- }
28
-
29
- statusTimeline(portalId: string | number, projectId: string | number, phaseId: string | number): Promise<unknown> {
30
- return this.get(this.projectPath(portalId, projectId, 'phases', phaseId, 'status-timeline'));
31
- }
32
-
33
- move(portalId: string | number, projectId: string | number, phaseId: string | number, body: { to_project: string | number }): Promise<unknown> {
34
- return this.patch(this.projectPath(portalId, projectId, 'phases', phaseId, 'move'), body);
35
- }
36
-
37
- getFollowers(portalId: string | number, projectId: string | number, phaseId: string | number, query?: Record<string, unknown>): Promise<unknown> {
38
- return this.get(this.projectPath(portalId, projectId, 'phases', phaseId, 'followers'), query);
39
- }
40
-
41
- addFollowers(portalId: string | number, projectId: string | number, phaseId: string | number, body: { followers: Array<string | number> }): Promise<unknown> {
42
- return this.post(this.projectPath(portalId, projectId, 'phases', phaseId, 'follow'), body);
43
- }
44
-
45
- removeFollowers(portalId: string | number, projectId: string | number, phaseId: string | number, body: { follower_ids: Array<string | number> }): Promise<unknown> {
46
- return this.delete(this.projectPath(portalId, projectId, 'phases', phaseId, 'unfollow'), body);
47
- }
48
-
49
- listComments(portalId: string | number, projectId: string | number, phaseId: string | number, params: ZohoPageParams & { sort_by?: string; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<Record<string, unknown>>> {
50
- return this.get(this.projectPath(portalId, projectId, 'phases', phaseId, 'comments'), this.withFilter(params, params.filter));
51
- }
52
-
53
- getComment(portalId: string | number, projectId: string | number, phaseId: string | number, commentId: string | number): Promise<Record<string, unknown>> {
54
- return this.get(this.projectPath(portalId, projectId, 'phases', phaseId, 'comments', commentId));
55
- }
56
-
57
- addComment(portalId: string | number, projectId: string | number, phaseId: string | number, body: { content: string; attachments?: Array<string | number> }): Promise<Record<string, unknown>> {
58
- return this.post(this.projectPath(portalId, projectId, 'phases', phaseId, 'comments'), body);
59
- }
60
-
61
- updateComment(portalId: string | number, projectId: string | number, phaseId: string | number, commentId: string | number, body: { content: string; attachments?: Array<string | number> }): Promise<Record<string, unknown>> {
62
- return this.patch(this.projectPath(portalId, projectId, 'phases', phaseId, 'comments', commentId), body);
63
- }
64
-
65
- deleteComment(portalId: string | number, projectId: string | number, phaseId: string | number, commentId: string | number): Promise<unknown> {
66
- return this.delete(this.projectPath(portalId, projectId, 'phases', phaseId, 'comments', commentId));
67
- }
68
- }
@@ -1,46 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { PortalTrashRequest, ZohoListResponse, ZohoPortal, ZohoPortalDetails, ZohoPortalExportStatus } from '@/types.ts';
3
-
4
- export class PortalsResource extends ResourceBase {
5
- listPortals(): Promise<ZohoListResponse<ZohoPortal>> {
6
- return this.get('portal');
7
- }
8
-
9
- getPortalDetails(portalId: string | number): Promise<ZohoPortalDetails> {
10
- return this.get(this.portalPath(portalId));
11
- }
12
-
13
- scheduleDataBackup(portalId: string | number, accessCode: string): Promise<ZohoPortalExportStatus> {
14
- const form = new FormData();
15
- form.set('access_code', accessCode);
16
- return this.request(this.portalPath(portalId, 'portal_export'), { method: 'POST', formData: form });
17
- }
18
-
19
- getDataBackupStatus(portalId: string | number, exportId: string | number): Promise<ZohoPortalExportStatus> {
20
- return this.get(this.portalPath(portalId, 'portal_export', exportId, 'status'));
21
- }
22
-
23
- getDataBackupHistory(portalId: string | number): Promise<ZohoListResponse<ZohoPortalExportStatus>> {
24
- return this.get(this.portalPath(portalId, 'portal_export', 'history'));
25
- }
26
-
27
- getTrashedRecords(portalId: string | number, query?: Record<string, unknown>): Promise<unknown> {
28
- return this.get(this.portalPath(portalId, 'bin'), query);
29
- }
30
-
31
- moveRecordsToTrash(portalId: string | number, body: PortalTrashRequest): Promise<unknown> {
32
- return this.post(this.portalPath(portalId, 'trash'), body);
33
- }
34
-
35
- deleteRecords(portalId: string | number, body: PortalTrashRequest | PortalTrashRequest[]): Promise<unknown> {
36
- return this.delete(this.portalPath(portalId, 'bin'), body);
37
- }
38
-
39
- restoreRecordsFromTrash(portalId: string | number, body: PortalTrashRequest | PortalTrashRequest[]): Promise<unknown> {
40
- return this.post(this.portalPath(portalId, 'bin', 'restore'), body);
41
- }
42
-
43
- emptyRecycleBin(portalId: string | number): Promise<unknown> {
44
- return this.delete(this.portalPath(portalId, 'bin'));
45
- }
46
- }
@@ -1,24 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ZohoListResponse, ZohoPageParams, ZohoProjectGroup } from '@/types.ts';
3
-
4
- export class ProjectGroupsResource extends ResourceBase {
5
- list(portalId: string | number, params: ZohoPageParams = {}): Promise<ZohoListResponse<ZohoProjectGroup>> {
6
- return this.get(this.portalPath(portalId, 'project-groups'), params);
7
- }
8
-
9
- listMine(portalId: string | number, params: ZohoPageParams = {}): Promise<ZohoListResponse<ZohoProjectGroup>> {
10
- return this.get(this.portalPath(portalId, 'my-project-groups'), params);
11
- }
12
-
13
- create(portalId: string | number, body: { name: string; type: 'public' | 'private'; prefix?: string }): Promise<ZohoProjectGroup> {
14
- return this.post(this.portalPath(portalId, 'project-groups'), body);
15
- }
16
-
17
- update(portalId: string | number, groupId: string | number, body: { name?: string; type?: 'public' | 'private'; prefix?: string }): Promise<ZohoProjectGroup> {
18
- return this.patch(this.portalPath(portalId, 'project-groups', groupId), body);
19
- }
20
-
21
- deleteById(portalId: string | number, groupId: string | number): Promise<unknown> {
22
- return this.delete(this.portalPath(portalId, 'project-groups', groupId));
23
- }
24
- }
@@ -1,56 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ZohoFilter, ZohoListResponse, ZohoPageParams, ZohoProject } from '@/types.ts';
3
-
4
- export class ProjectsResource extends ResourceBase {
5
- list(portalId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; milestone_ids?: string; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<ZohoProject>> {
6
- return this.get(this.portalPath(portalId, 'projects'), this.withFilter(params, params.filter));
7
- }
8
-
9
- getById(portalId: string | number, projectId: string | number): Promise<ZohoProject> {
10
- return this.get(this.portalPath(portalId, 'projects', projectId));
11
- }
12
-
13
- create(portalId: string | number, body: Partial<ZohoProject>): Promise<ZohoProject> {
14
- return this.post(this.portalPath(portalId, 'projects'), body);
15
- }
16
-
17
- update(portalId: string | number, projectId: string | number, body: Partial<ZohoProject>): Promise<ZohoProject> {
18
- return this.patch(this.portalPath(portalId, 'projects', projectId), body);
19
- }
20
-
21
- deleteById(portalId: string | number, projectId: string | number): Promise<unknown> {
22
- return this.delete(this.portalPath(portalId, 'projects', projectId));
23
- }
24
-
25
- trash(portalId: string | number, projectId: string | number): Promise<unknown> {
26
- return this.post(this.projectPath(portalId, projectId, 'trash'));
27
- }
28
-
29
- markFavouriteCustomView(portalId: string | number, customViewId: string | number): Promise<unknown> {
30
- return this.post(this.buildPath(['portal', portalId, 'projects', 'customview', customViewId, 'markfavourite']));
31
- }
32
-
33
- listComments(
34
- portalId: string | number,
35
- projectId: string | number,
36
- params: ZohoPageParams & { sort_by?: string; view_id?: string | number; milestone_ids?: string; filter?: ZohoFilter } = {},
37
- ): Promise<ZohoListResponse<Record<string, unknown>>> {
38
- return this.get(this.projectPath(portalId, projectId, 'comments'), this.withFilter(params, params.filter));
39
- }
40
-
41
- getComment(portalId: string | number, projectId: string | number, commentId: string | number): Promise<Record<string, unknown>> {
42
- return this.get(this.projectPath(portalId, projectId, 'comments', commentId));
43
- }
44
-
45
- addComment(portalId: string | number, projectId: string | number, body: { content: string; attachments?: Array<string | number> }): Promise<Record<string, unknown>> {
46
- return this.post(this.projectPath(portalId, projectId, 'comments'), body);
47
- }
48
-
49
- updateComment(portalId: string | number, projectId: string | number, commentId: string | number, body: { content: string; attachments?: Array<string | number> }): Promise<Record<string, unknown>> {
50
- return this.patch(this.projectPath(portalId, projectId, 'comments', commentId), body);
51
- }
52
-
53
- deleteComment(portalId: string | number, projectId: string | number, commentId: string | number): Promise<unknown> {
54
- return this.delete(this.projectPath(portalId, projectId, 'comments', commentId));
55
- }
56
- }
@@ -1,40 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ZohoFollower } from '@/types.ts';
3
-
4
- export class RecordsResource extends ResourceBase {
5
- createRecord(portalId: string | number, moduleName: string, body: Record<string, unknown>): Promise<unknown> {
6
- return this.post(this.buildPath(['portal', portalId, 'module', moduleName, 'entities']), body);
7
- }
8
-
9
- listEntityEdits(portalId: string | number, moduleName: string, entityId: string | number, query?: Record<string, unknown>): Promise<unknown> {
10
- return this.get(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'edits']), query);
11
- }
12
-
13
- getEditsByAuditId(portalId: string | number, moduleName: string, entityId: string | number, editId: string | number): Promise<unknown> {
14
- return this.get(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'edits', editId]));
15
- }
16
-
17
- getAttachmentCount(portalId: string | number, moduleName: string, entityId: string | number): Promise<{ attachment_count?: string | number }> {
18
- return this.get(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'attachmentcount']));
19
- }
20
-
21
- getFollowers(portalId: string | number, moduleName: string, entityId: string | number, query?: Record<string, unknown>): Promise<{ followers?: ZohoFollower[] }> {
22
- return this.get(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'followers']), query);
23
- }
24
-
25
- addFollower(portalId: string | number, moduleName: string, entityId: string | number): Promise<unknown> {
26
- return this.post(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'follow']));
27
- }
28
-
29
- addOrRemoveFollowers(portalId: string | number, moduleName: string, entityId: string | number, body: Record<string, unknown>): Promise<unknown> {
30
- return this.post(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'followers']), body);
31
- }
32
-
33
- removeFollower(portalId: string | number, moduleName: string, entityId: string | number): Promise<unknown> {
34
- return this.delete(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'unfollow']));
35
- }
36
-
37
- addComment(portalId: string | number, moduleName: string, entityId: string | number, body: { content: string; attachments?: Array<Record<string, unknown>> }): Promise<unknown> {
38
- return this.post(this.buildPath(['portal', portalId, 'module', moduleName, 'entity', entityId, 'comment']), body);
39
- }
40
- }
@@ -1,132 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ModuleBulkOptionsRequest, ZohoCustomField, ZohoListResponse, ZohoModule } from '@/types.ts';
3
-
4
- export class SettingsResource extends ResourceBase {
5
- listModules(portalId: string | number, query?: Record<string, unknown>): Promise<ZohoListResponse<ZohoModule>> {
6
- return this.get(this.portalPath(portalId, 'settings', 'modules'), query);
7
- }
8
-
9
- getModule(portalId: string | number, moduleName: string): Promise<ZohoModule> {
10
- return this.get(this.portalPath(portalId, 'settings', 'modules', moduleName));
11
- }
12
-
13
- createModule(portalId: string | number, body: Record<string, unknown>): Promise<ZohoModule> {
14
- return this.post(this.portalPath(portalId, 'settings', 'modules'), body);
15
- }
16
-
17
- updateModule(portalId: string | number, moduleName: string, body: Record<string, unknown>): Promise<ZohoModule> {
18
- return this.patch(this.portalPath(portalId, 'settings', 'modules', moduleName), body);
19
- }
20
-
21
- updateModuleStatus(portalId: string | number, moduleName: string, body: Record<string, unknown>): Promise<unknown> {
22
- return this.post(this.portalPath(portalId, 'settings', 'modules', moduleName, 'status'), body);
23
- }
24
-
25
- activateModule(portalId: string | number, moduleName: string): Promise<unknown> {
26
- return this.patch(this.portalPath(portalId, 'settings', 'modules', moduleName, 'activate'));
27
- }
28
-
29
- deactivateModule(portalId: string | number, moduleName: string): Promise<unknown> {
30
- return this.patch(this.portalPath(portalId, 'settings', 'modules', moduleName, 'deactivate'));
31
- }
32
-
33
- trashModule(portalId: string | number, moduleName: string, body: Record<string, unknown>): Promise<unknown> {
34
- return this.post(this.portalPath(portalId, 'settings', 'modules', moduleName, 'trash'), body);
35
- }
36
-
37
- deleteModule(portalId: string | number, moduleName: string): Promise<unknown> {
38
- return this.delete(this.portalPath(portalId, 'settings', 'modules', moduleName));
39
- }
40
-
41
- restoreModule(portalId: string | number, moduleName: string, body: Record<string, unknown>): Promise<unknown> {
42
- return this.post(this.portalPath(portalId, 'settings', 'modules', moduleName, 'restore'), body);
43
- }
44
-
45
- getModuleConfiguration(portalId: string | number, moduleName: string): Promise<unknown> {
46
- return this.get(this.portalPath(portalId, 'settings', 'modules', moduleName, 'configuration'));
47
- }
48
-
49
- listLayouts(portalId: string | number, query?: Record<string, unknown>): Promise<ZohoListResponse<Record<string, unknown>>> {
50
- return this.get(this.portalPath(portalId, 'settings', 'layouts'), query);
51
- }
52
-
53
- getDefaultLayout(portalId: string | number, query?: Record<string, unknown>): Promise<Record<string, unknown>> {
54
- return this.get(this.portalPath(portalId, 'settings', 'layouts', 'default-layout'), query);
55
- }
56
-
57
- getLayoutDetails(portalId: string | number, layoutId: string | number): Promise<Record<string, unknown>> {
58
- return this.get(this.portalPath(portalId, 'settings', 'layouts', layoutId));
59
- }
60
-
61
- createLayout(portalId: string | number, body: Record<string, unknown>): Promise<Record<string, unknown>> {
62
- return this.post(this.portalPath(portalId, 'settings', 'layouts'), body);
63
- }
64
-
65
- updateLayout(portalId: string | number, layoutId: string | number, body: Record<string, unknown>): Promise<Record<string, unknown>> {
66
- return this.patch(this.portalPath(portalId, 'settings', 'layouts', layoutId), body);
67
- }
68
-
69
- deleteLayout(portalId: string | number, layoutId: string | number): Promise<unknown> {
70
- return this.delete(this.portalPath(portalId, 'settings', 'layouts', layoutId));
71
- }
72
-
73
- disassociateFieldFromLayout(portalId: string | number, layoutId: string | number, fieldId: string | number, body?: Record<string, unknown>): Promise<unknown> {
74
- return this.delete(this.portalPath(portalId, 'settings', 'layouts', layoutId, 'fields', fieldId), body);
75
- }
76
-
77
- getAssociatedEntitiesOfLayout(portalId: string | number, layoutId: string | number, query?: Record<string, unknown>): Promise<unknown> {
78
- return this.get(this.portalPath(portalId, 'settings', 'layouts', layoutId, 'entities'), query);
79
- }
80
-
81
- createOrUpdateSection(portalId: string | number, layoutId: string | number, body: Record<string, unknown>): Promise<unknown> {
82
- return this.put(this.portalPath(portalId, 'settings', 'layouts', layoutId, 'sections'), body);
83
- }
84
-
85
- deleteSection(portalId: string | number, layoutId: string | number, body?: Record<string, unknown>): Promise<unknown> {
86
- return this.delete(this.portalPath(portalId, 'settings', 'layouts', layoutId, 'sections'), body);
87
- }
88
-
89
- listFields(portalId: string | number, query: Record<string, unknown> & { module: string }): Promise<ZohoListResponse<ZohoCustomField>> {
90
- return this.get(this.portalPath(portalId, 'settings', 'fields'), query);
91
- }
92
-
93
- createOrUpdateField(portalId: string | number, body: Record<string, unknown>): Promise<unknown> {
94
- return this.put(this.portalPath(portalId, 'settings', 'fields'), body);
95
- }
96
-
97
- deleteField(portalId: string | number, body: Record<string, unknown>): Promise<unknown> {
98
- return this.delete(this.portalPath(portalId, 'settings', 'fields'), body);
99
- }
100
-
101
- getAssociatedLayouts(portalId: string | number, fieldId: string | number, query: Record<string, unknown> & { module: string }): Promise<unknown> {
102
- return this.get(this.portalPath(portalId, 'settings', 'fields', fieldId, 'associated-layouts'), query);
103
- }
104
-
105
- getOptionsListForField(portalId: string | number, query: Record<string, unknown> & { module: string; field: string | number }): Promise<ZohoListResponse<Record<string, unknown>>> {
106
- return this.get(this.portalPath(portalId, 'settings', 'options'), query);
107
- }
108
-
109
- createBulkOptions(portalId: string | number, body: ModuleBulkOptionsRequest): Promise<unknown> {
110
- return this.post(this.portalPath(portalId, 'settings', 'options'), body);
111
- }
112
-
113
- deleteOrDisassociateBulkOptions(portalId: string | number, body: ModuleBulkOptionsRequest): Promise<unknown> {
114
- return this.delete(this.portalPath(portalId, 'settings', 'options'), body);
115
- }
116
-
117
- updateBulkOptions(portalId: string | number, body: ModuleBulkOptionsRequest): Promise<unknown> {
118
- return this.patch(this.portalPath(portalId, 'settings', 'options'), body);
119
- }
120
-
121
- getModuleIntegrationField(portalId: string | number, serviceId: string | number, moduleId: string | number): Promise<unknown> {
122
- return this.get(this.buildPath(['portal', portalId, 'integration-field', 'service', serviceId, 'module', moduleId, 'fields']));
123
- }
124
-
125
- getViews(portalId: string | number, viewId: string | number, query?: Record<string, unknown>): Promise<unknown> {
126
- return this.get(this.portalPath(portalId, 'views', viewId), query);
127
- }
128
-
129
- getFieldInfoForModule(portalId: string | number, query: Record<string, unknown> & { module: string }): Promise<ZohoListResponse<ZohoCustomField>> {
130
- return this.get(this.portalPath(portalId, 'settings', 'fields'), query);
131
- }
132
- }
@@ -1,94 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ZohoCommentPage, ZohoFilter, ZohoListResponse, ZohoPageParams, ZohoTaskList } from '@/types.ts';
3
-
4
- export class TasklistsResource extends ResourceBase {
5
- list(portalId: string | number, projectId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<ZohoTaskList>> {
6
- return this.get(this.projectPath(portalId, projectId, 'tasklists'), this.withFilter(params, params.filter));
7
- }
8
-
9
- getById(portalId: string | number, projectId: string | number, tasklistId: string | number): Promise<ZohoTaskList> {
10
- return this.get(this.projectPath(portalId, projectId, 'tasklists', tasklistId));
11
- }
12
-
13
- create(portalId: string | number, projectId: string | number, body: Partial<ZohoTaskList>): Promise<ZohoTaskList> {
14
- return this.post(this.projectPath(portalId, projectId, 'tasklists'), body);
15
- }
16
-
17
- createDefault(portalId: string | number, projectId: string | number, flag: 'internal' | 'external'): Promise<ZohoTaskList> {
18
- return this.post(this.projectPath(portalId, projectId, 'default-tasklists'), { flag });
19
- }
20
-
21
- update(portalId: string | number, projectId: string | number, tasklistId: string | number, body: Partial<ZohoTaskList>): Promise<ZohoTaskList> {
22
- return this.patch(this.projectPath(portalId, projectId, 'tasklists', tasklistId), body);
23
- }
24
-
25
- deleteById(portalId: string | number, projectId: string | number, tasklistId: string | number): Promise<unknown> {
26
- return this.delete(this.projectPath(portalId, projectId, 'tasklists', tasklistId));
27
- }
28
-
29
- updateComment(
30
- portalId: string | number,
31
- projectId: string | number,
32
- tasklistId: string | number,
33
- commentId: string | number,
34
- body: { comment: string; attachments?: Array<string | number> },
35
- ): Promise<unknown> {
36
- return this.patch(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'comments', commentId), body);
37
- }
38
-
39
- listAll(portalId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<ZohoTaskList>> {
40
- return this.get(this.portalPath(portalId, 'all-tasklists'), this.withFilter(params, params.filter));
41
- }
42
-
43
- getComments(
44
- portalId: string | number,
45
- projectId: string | number,
46
- tasklistId: string | number,
47
- params: ZohoPageParams & { sort_by?: string; filter?: ZohoFilter } = {},
48
- ): Promise<ZohoCommentPage<Record<string, unknown>>> {
49
- return this.get(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'comments'), this.withFilter(params, params.filter));
50
- }
51
-
52
- getComment(
53
- portalId: string | number,
54
- projectId: string | number,
55
- tasklistId: string | number,
56
- commentId: string | number,
57
- ): Promise<Record<string, unknown>> {
58
- return this.get(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'comments', commentId));
59
- }
60
-
61
- addComment(
62
- portalId: string | number,
63
- projectId: string | number,
64
- tasklistId: string | number,
65
- body: { content: string; attachments?: Array<string | number> },
66
- ): Promise<unknown> {
67
- return this.post(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'comments'), body);
68
- }
69
-
70
- deleteComment(
71
- portalId: string | number,
72
- projectId: string | number,
73
- tasklistId: string | number,
74
- commentId: string | number,
75
- ): Promise<unknown> {
76
- return this.delete(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'comments', commentId));
77
- }
78
-
79
- makeAsTemplate(portalId: string | number, projectId: string | number, tasklistId: string | number): Promise<unknown> {
80
- return this.post(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'make-as-template'));
81
- }
82
-
83
- getFollowers(portalId: string | number, projectId: string | number, tasklistId: string | number, query?: Record<string, unknown>): Promise<unknown> {
84
- return this.get(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'followers'), query);
85
- }
86
-
87
- addFollowers(portalId: string | number, projectId: string | number, tasklistId: string | number, body: Record<string, unknown>): Promise<unknown> {
88
- return this.post(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'follow'), body);
89
- }
90
-
91
- removeFollowers(portalId: string | number, projectId: string | number, tasklistId: string | number, body: Record<string, unknown>): Promise<unknown> {
92
- return this.delete(this.projectPath(portalId, projectId, 'tasklists', tasklistId, 'unfollow'), body);
93
- }
94
- }
@@ -1,43 +0,0 @@
1
- import { ResourceBase } from '@/resource-base.ts';
2
- import type { ZohoFilter, ZohoListResponse, ZohoPageParams, ZohoTask, ZohoTaskUpsertBody } from '@/types.ts';
3
-
4
- export class TasksResource extends ResourceBase {
5
- listAll(portalId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<ZohoTask>> {
6
- return this.get(this.portalPath(portalId, 'tasks'), this.withFilter(params, params.filter));
7
- }
8
-
9
- listMyTasks(portalId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<ZohoTask>> {
10
- return this.get(this.portalPath(portalId, 'mytasks'), this.withFilter(params, params.filter));
11
- }
12
-
13
- list(portalId: string | number, projectId: string | number, params: ZohoPageParams & { sort_by?: string; view_id?: string | number; filter?: ZohoFilter } = {}): Promise<ZohoListResponse<ZohoTask>> {
14
- return this.get(this.projectPath(portalId, projectId, 'tasks'), this.withFilter(params, params.filter));
15
- }
16
-
17
- getById(portalId: string | number, projectId: string | number, taskId: string | number): Promise<ZohoTask> {
18
- return this.get(this.projectPath(portalId, projectId, 'tasks', taskId));
19
- }
20
-
21
- create(portalId: string | number, projectId: string | number, body: ZohoTaskUpsertBody): Promise<ZohoTask> {
22
- return this.post(this.projectPath(portalId, projectId, 'tasks'), body);
23
- }
24
-
25
- update(portalId: string | number, projectId: string | number, taskId: string | number, body: ZohoTaskUpsertBody): Promise<ZohoTask> {
26
- return this.patch(this.projectPath(portalId, projectId, 'tasks', taskId), body);
27
- }
28
-
29
- deleteById(portalId: string | number, projectId: string | number, taskId: string | number): Promise<unknown> {
30
- return this.delete(this.projectPath(portalId, projectId, 'tasks', taskId));
31
- }
32
-
33
- getStatusHistory(portalId: string | number, projectId: string | number, query?: Record<string, unknown>): Promise<unknown> {
34
- return this.get(this.projectPath(portalId, projectId, 'taskstatushistory'), query);
35
- }
36
-
37
- getAssociatedTasksByIssues(portalId: string | number, issueIds: Array<string | number>, query?: Record<string, unknown>): Promise<unknown> {
38
- return this.get(this.buildPath(['portal', portalId, 'issues', 'associated-tasks']), {
39
- ...query,
40
- issue_ids: issueIds,
41
- });
42
- }
43
- }