@panoptic-it-solutions/zoho-projects-client 0.1.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.
Files changed (50) hide show
  1. package/README.md +231 -0
  2. package/dist/auth/token-manager.d.ts +59 -0
  3. package/dist/auth/token-manager.d.ts.map +1 -0
  4. package/dist/auth/token-manager.js +120 -0
  5. package/dist/auth/token-manager.js.map +1 -0
  6. package/dist/client.d.ts +193 -0
  7. package/dist/client.d.ts.map +1 -0
  8. package/dist/client.js +357 -0
  9. package/dist/client.js.map +1 -0
  10. package/dist/errors.d.ts +61 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +113 -0
  13. package/dist/errors.js.map +1 -0
  14. package/dist/index.d.ts +7 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +11 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/types/common.d.ts +173 -0
  19. package/dist/types/common.d.ts.map +1 -0
  20. package/dist/types/common.js +56 -0
  21. package/dist/types/common.js.map +1 -0
  22. package/dist/types/index.d.ts +6 -0
  23. package/dist/types/index.d.ts.map +1 -0
  24. package/dist/types/index.js +11 -0
  25. package/dist/types/index.js.map +1 -0
  26. package/dist/types/projects.d.ts +3671 -0
  27. package/dist/types/projects.d.ts.map +1 -0
  28. package/dist/types/projects.js +94 -0
  29. package/dist/types/projects.js.map +1 -0
  30. package/dist/types/tasks.d.ts +2612 -0
  31. package/dist/types/tasks.d.ts.map +1 -0
  32. package/dist/types/tasks.js +127 -0
  33. package/dist/types/tasks.js.map +1 -0
  34. package/dist/types/timelogs.d.ts +13623 -0
  35. package/dist/types/timelogs.d.ts.map +1 -0
  36. package/dist/types/timelogs.js +115 -0
  37. package/dist/types/timelogs.js.map +1 -0
  38. package/dist/types/users.d.ts +695 -0
  39. package/dist/types/users.d.ts.map +1 -0
  40. package/dist/types/users.js +65 -0
  41. package/dist/types/users.js.map +1 -0
  42. package/dist/utils/pagination.d.ts +59 -0
  43. package/dist/utils/pagination.d.ts.map +1 -0
  44. package/dist/utils/pagination.js +84 -0
  45. package/dist/utils/pagination.js.map +1 -0
  46. package/dist/utils/rate-limiter.d.ts +33 -0
  47. package/dist/utils/rate-limiter.d.ts.map +1 -0
  48. package/dist/utils/rate-limiter.js +92 -0
  49. package/dist/utils/rate-limiter.js.map +1 -0
  50. package/package.json +53 -0
@@ -0,0 +1,173 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Common Zoho API response wrapper
4
+ * Zoho wraps responses in a resource-specific key (e.g., "projects", "tasks")
5
+ */
6
+ export declare const ZohoPageInfoSchema: z.ZodObject<{
7
+ page: z.ZodNumber;
8
+ per_page: z.ZodNumber;
9
+ total_count: z.ZodOptional<z.ZodNumber>;
10
+ has_more_page: z.ZodOptional<z.ZodBoolean>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ page: number;
13
+ per_page: number;
14
+ total_count?: number | undefined;
15
+ has_more_page?: boolean | undefined;
16
+ }, {
17
+ page: number;
18
+ per_page: number;
19
+ total_count?: number | undefined;
20
+ has_more_page?: boolean | undefined;
21
+ }>;
22
+ export type ZohoPageInfo = z.infer<typeof ZohoPageInfoSchema>;
23
+ /**
24
+ * Zoho error response format
25
+ */
26
+ export declare const ZohoErrorSchema: z.ZodObject<{
27
+ error: z.ZodObject<{
28
+ code: z.ZodNumber;
29
+ message: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ code: number;
32
+ message: string;
33
+ }, {
34
+ code: number;
35
+ message: string;
36
+ }>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ error: {
39
+ code: number;
40
+ message: string;
41
+ };
42
+ }, {
43
+ error: {
44
+ code: number;
45
+ message: string;
46
+ };
47
+ }>;
48
+ export type ZohoError = z.infer<typeof ZohoErrorSchema>;
49
+ /**
50
+ * Pagination parameters for list requests
51
+ */
52
+ export interface ListParams {
53
+ index?: number;
54
+ range?: number;
55
+ sort_column?: string;
56
+ sort_order?: "ascending" | "descending";
57
+ }
58
+ /**
59
+ * Custom fields that may appear on any resource
60
+ * Zoho allows custom fields which we type loosely
61
+ */
62
+ export declare const CustomFieldSchema: z.ZodObject<{
63
+ label_name: z.ZodString;
64
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ value: string | number | boolean | null;
67
+ label_name: string;
68
+ }, {
69
+ value: string | number | boolean | null;
70
+ label_name: string;
71
+ }>;
72
+ export type CustomField = z.infer<typeof CustomFieldSchema>;
73
+ /**
74
+ * Link object used throughout Zoho API responses
75
+ */
76
+ export declare const ZohoLinkSchema: z.ZodObject<{
77
+ self: z.ZodOptional<z.ZodObject<{
78
+ url: z.ZodString;
79
+ }, "strip", z.ZodTypeAny, {
80
+ url: string;
81
+ }, {
82
+ url: string;
83
+ }>>;
84
+ project: z.ZodOptional<z.ZodObject<{
85
+ url: z.ZodString;
86
+ }, "strip", z.ZodTypeAny, {
87
+ url: string;
88
+ }, {
89
+ url: string;
90
+ }>>;
91
+ task: z.ZodOptional<z.ZodObject<{
92
+ url: z.ZodString;
93
+ }, "strip", z.ZodTypeAny, {
94
+ url: string;
95
+ }, {
96
+ url: string;
97
+ }>>;
98
+ status: z.ZodOptional<z.ZodObject<{
99
+ url: z.ZodString;
100
+ }, "strip", z.ZodTypeAny, {
101
+ url: string;
102
+ }, {
103
+ url: string;
104
+ }>>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ status?: {
107
+ url: string;
108
+ } | undefined;
109
+ self?: {
110
+ url: string;
111
+ } | undefined;
112
+ project?: {
113
+ url: string;
114
+ } | undefined;
115
+ task?: {
116
+ url: string;
117
+ } | undefined;
118
+ }, {
119
+ status?: {
120
+ url: string;
121
+ } | undefined;
122
+ self?: {
123
+ url: string;
124
+ } | undefined;
125
+ project?: {
126
+ url: string;
127
+ } | undefined;
128
+ task?: {
129
+ url: string;
130
+ } | undefined;
131
+ }>;
132
+ export type ZohoLink = z.infer<typeof ZohoLinkSchema>;
133
+ /**
134
+ * Owner/User reference used in nested objects
135
+ */
136
+ export declare const OwnerRefSchema: z.ZodObject<{
137
+ id: z.ZodString;
138
+ name: z.ZodString;
139
+ email: z.ZodOptional<z.ZodString>;
140
+ zpuid: z.ZodOptional<z.ZodString>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ id: string;
143
+ name: string;
144
+ email?: string | undefined;
145
+ zpuid?: string | undefined;
146
+ }, {
147
+ id: string;
148
+ name: string;
149
+ email?: string | undefined;
150
+ zpuid?: string | undefined;
151
+ }>;
152
+ export type OwnerRef = z.infer<typeof OwnerRefSchema>;
153
+ /**
154
+ * Status reference object
155
+ */
156
+ export declare const StatusRefSchema: z.ZodObject<{
157
+ id: z.ZodString;
158
+ name: z.ZodString;
159
+ type: z.ZodOptional<z.ZodString>;
160
+ color_code: z.ZodOptional<z.ZodString>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ id: string;
163
+ name: string;
164
+ type?: string | undefined;
165
+ color_code?: string | undefined;
166
+ }, {
167
+ id: string;
168
+ name: string;
169
+ type?: string | undefined;
170
+ color_code?: string | undefined;
171
+ }>;
172
+ export type StatusRef = z.infer<typeof StatusRefSchema>;
173
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAK1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;CACzC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Common Zoho API response wrapper
4
+ * Zoho wraps responses in a resource-specific key (e.g., "projects", "tasks")
5
+ */
6
+ export const ZohoPageInfoSchema = z.object({
7
+ page: z.number(),
8
+ per_page: z.number(),
9
+ total_count: z.number().optional(),
10
+ has_more_page: z.boolean().optional(),
11
+ });
12
+ /**
13
+ * Zoho error response format
14
+ */
15
+ export const ZohoErrorSchema = z.object({
16
+ error: z.object({
17
+ code: z.number(),
18
+ message: z.string(),
19
+ }),
20
+ });
21
+ /**
22
+ * Custom fields that may appear on any resource
23
+ * Zoho allows custom fields which we type loosely
24
+ */
25
+ export const CustomFieldSchema = z.object({
26
+ label_name: z.string(),
27
+ value: z.union([z.string(), z.number(), z.boolean(), z.null()]),
28
+ });
29
+ /**
30
+ * Link object used throughout Zoho API responses
31
+ */
32
+ export const ZohoLinkSchema = z.object({
33
+ self: z.object({ url: z.string() }).optional(),
34
+ project: z.object({ url: z.string() }).optional(),
35
+ task: z.object({ url: z.string() }).optional(),
36
+ status: z.object({ url: z.string() }).optional(),
37
+ });
38
+ /**
39
+ * Owner/User reference used in nested objects
40
+ */
41
+ export const OwnerRefSchema = z.object({
42
+ id: z.string(),
43
+ name: z.string(),
44
+ email: z.string().optional(),
45
+ zpuid: z.string().optional(),
46
+ });
47
+ /**
48
+ * Status reference object
49
+ */
50
+ export const StatusRefSchema = z.object({
51
+ id: z.string(),
52
+ name: z.string(),
53
+ type: z.string().optional(),
54
+ color_code: z.string().optional(),
55
+ });
56
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC;CACH,CAAC,CAAC;AAcH;;;GAGG;AACH,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E,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { ZohoPageInfoSchema, ZohoErrorSchema, CustomFieldSchema, ZohoLinkSchema, OwnerRefSchema, StatusRefSchema, type ZohoPageInfo, type ZohoError, type CustomField, type ZohoLink, type OwnerRef, type StatusRef, type ListParams, } from "./common.js";
2
+ export { ProjectSchema, ProjectListResponseSchema, ProjectResponseSchema, CountObjectSchema, LayoutDetailsSchema, type Project, type ProjectListResponse, type ProjectResponse, } from "./projects.js";
3
+ export { TaskSchema, TaskListResponseSchema, TaskResponseSchema, TaskStatusSchema, TaskListRefSchema, TaskOwnerSchema, TaskDetailsSchema, LogHoursSchema, TaskTagSchema, type Task, type TaskListResponse, type TaskResponse, type TaskStatus, type TaskListRef, type TaskOwner, type TaskDetails, type LogHours, type TaskTag, } from "./tasks.js";
4
+ export { TimeLogSchema, TimeLogListResponseSchema, TimeLogDateGroupSchema, TimeLogTaskRefSchema, TimeLogProjectRefSchema, TimeLogBugRefSchema, type TimeLog, type TimeLogListResponse, type TimeLogDateGroup, type TimeLogTaskRef, type TimeLogProjectRef, type TimeLogBugRef, type TimeLogParams, } from "./timelogs.js";
5
+ export { UserSchema, UserListResponseSchema, UserResponseSchema, ProjectUserListResponseSchema, UserRoleSchema, type User, type UserListResponse, type UserResponse, type ProjectUserListResponse, type UserRole, } from "./users.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,OAAO,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACd,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ // Common types
2
+ export { ZohoPageInfoSchema, ZohoErrorSchema, CustomFieldSchema, ZohoLinkSchema, OwnerRefSchema, StatusRefSchema, } from "./common.js";
3
+ // Project types
4
+ export { ProjectSchema, ProjectListResponseSchema, ProjectResponseSchema, CountObjectSchema, LayoutDetailsSchema, } from "./projects.js";
5
+ // Task types
6
+ export { TaskSchema, TaskListResponseSchema, TaskResponseSchema, TaskStatusSchema, TaskListRefSchema, TaskOwnerSchema, TaskDetailsSchema, LogHoursSchema, TaskTagSchema, } from "./tasks.js";
7
+ // Time log types
8
+ export { TimeLogSchema, TimeLogListResponseSchema, TimeLogDateGroupSchema, TimeLogTaskRefSchema, TimeLogProjectRefSchema, TimeLogBugRefSchema, } from "./timelogs.js";
9
+ // User types
10
+ export { UserSchema, UserListResponseSchema, UserResponseSchema, ProjectUserListResponseSchema, UserRoleSchema, } from "./users.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,GAQhB,MAAM,aAAa,CAAC;AAErB,gBAAgB;AAChB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,GAIpB,MAAM,eAAe,CAAC;AAEvB,aAAa;AACb,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,GAUd,MAAM,YAAY,CAAC;AAEpB,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,GAQpB,MAAM,eAAe,CAAC;AAEvB,aAAa;AACb,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,GAMf,MAAM,YAAY,CAAC"}