n8n-nodes-zoho-books-community 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.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # n8n-nodes-zoho-books-community
2
+
3
+ Custom n8n community node for Zoho Books with OAuth2 support.
4
+
5
+ ## Features
6
+
7
+ - OAuth2 credential with selectable Zoho data center (.com, .eu, .in, .com.au, .jp, .ca, .com.cn, .sa) and sandbox toggle.
8
+ - Load organization list automatically via `GET /organizations`.
9
+ - Built-in operations: list organizations, get organization by ID.
10
+ - Generic "API Request" operation to hit any `/books/v3` endpoint with JSON query/body helpers and optional `organization_id` injection.
11
+
12
+ ## Setup
13
+
14
+ 1. Create a Zoho OAuth client (server-based) in the right data center. Use scope `ZohoBooks.fullaccess.all`.
15
+ Reference: [Zoho Books API – Organization ID & OAuth](https://www.zoho.com/books/api/v3/introduction/#organization-id).
16
+ 2. In n8n, add credentials using **Zoho Books OAuth2 API**:
17
+ - Set Client ID/Secret from Zoho.
18
+ - Choose the data center and environment (production/sandbox).
19
+ - Complete the OAuth flow.
20
+ 3. Install this package in your n8n instance (e.g. `npm i n8n-community-zoho-books` in the n8n user folder or use the UI custom nodes installer).
21
+
22
+ ## Usage
23
+
24
+ - **Organization → List/Get**: quickly fetch available organizations.
25
+ - **API Request (Generic)**:
26
+ - Set the HTTP method and endpoint (e.g. `/invoices`).
27
+ - Provide query/body as JSON strings. Optional `organization_id` field can be set directly on the node.
28
+
29
+ ## Build
30
+
31
+ ```bash
32
+ npm install
33
+ npm run build
34
+ ```
35
+
36
+ The compiled files will be placed in `dist/` as required by n8n.
37
+
38
+ ## Notes
39
+
40
+ - `organization_id` is required by most Zoho Books endpoints; provide it either via the dedicated field or inside the query JSON.
41
+ - Respect Zoho Books rate limits (per plan and per minute) to avoid HTTP 429 responses.
42
+
@@ -0,0 +1,9 @@
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class ZohoBooksOAuth2Api implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ extends: string[];
7
+ properties: INodeProperties[];
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZohoBooksOAuth2Api = void 0;
4
+ class ZohoBooksOAuth2Api {
5
+ name = 'zohoBooksOAuth2Api';
6
+ displayName = 'Zoho Books OAuth2 API';
7
+ documentationUrl = 'https://www.zoho.com/books/api/v3/introduction/#organization-id';
8
+ extends = ['oAuth2Api'];
9
+ properties = [
10
+ {
11
+ displayName: 'Data Center',
12
+ name: 'dataCenter',
13
+ type: 'options',
14
+ default: 'com',
15
+ description: 'Zoho data center to use for authentication and API calls',
16
+ options: [
17
+ { name: 'United States (.com)', value: 'com' },
18
+ { name: 'Europe (.eu)', value: 'eu' },
19
+ { name: 'India (.in)', value: 'in' },
20
+ { name: 'Australia (.com.au)', value: 'com.au' },
21
+ { name: 'Japan (.jp)', value: 'jp' },
22
+ { name: 'Canada (.ca)', value: 'ca' },
23
+ { name: 'China (.com.cn)', value: 'com.cn' },
24
+ { name: 'Saudi Arabia (.sa)', value: 'sa' }
25
+ ]
26
+ },
27
+ {
28
+ displayName: 'Environment',
29
+ name: 'environment',
30
+ type: 'options',
31
+ default: 'production',
32
+ options: [
33
+ { name: 'Production', value: 'production' },
34
+ { name: 'Sandbox', value: 'sandbox' }
35
+ ],
36
+ description: 'Use sandbox when your Zoho Books account is set up in the sandbox environment'
37
+ },
38
+ {
39
+ displayName: 'Scope',
40
+ name: 'scope',
41
+ type: 'hidden',
42
+ default: 'ZohoBooks.fullaccess.all',
43
+ description: 'Default OAuth scope for Zoho Books'
44
+ },
45
+ {
46
+ displayName: 'Auth URL',
47
+ name: 'authUrl',
48
+ type: 'hidden',
49
+ default: '={{"https://accounts.zoho." + $self.dataCenter + "/oauth/v2/auth"}}',
50
+ description: 'Zoho authorization URL (auto-derived from data center)'
51
+ },
52
+ {
53
+ displayName: 'Token URL',
54
+ name: 'accessTokenUrl',
55
+ type: 'hidden',
56
+ default: '={{"https://accounts.zoho." + $self.dataCenter + "/oauth/v2/token"}}',
57
+ description: 'Zoho token URL (auto-derived from data center)'
58
+ },
59
+ {
60
+ displayName: 'Sandbox Base URL',
61
+ name: 'sandboxBaseUrl',
62
+ type: 'hidden',
63
+ default: '={{"https://sandbox.zohoapis." + $self.dataCenter + "/books/v3"}}',
64
+ description: 'Base URL used when environment is set to sandbox'
65
+ },
66
+ {
67
+ displayName: 'Production Base URL',
68
+ name: 'baseUrl',
69
+ type: 'hidden',
70
+ default: '={{"https://www.zohoapis." + $self.dataCenter + "/books/v3"}}',
71
+ description: 'Base URL used for production calls'
72
+ }
73
+ ];
74
+ test = {
75
+ request: {
76
+ method: 'GET',
77
+ url: '={{$self.environment === "sandbox" ? $self.sandboxBaseUrl : $self.baseUrl}}/organizations'
78
+ }
79
+ };
80
+ }
81
+ exports.ZohoBooksOAuth2Api = ZohoBooksOAuth2Api;
82
+ //# sourceMappingURL=ZohoBooksOAuth2Api.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZohoBooksOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/ZohoBooksOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,kBAAkB;IAC9B,IAAI,GAAG,oBAAoB,CAAC;IAE5B,WAAW,GAAG,uBAAuB,CAAC;IAEtC,gBAAgB,GAAG,iEAAiE,CAAC;IAErF,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;IAExB,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,0DAA0D;YACvE,OAAO,EAAE;gBACR,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,KAAK,EAAE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,mEAAmE;YACpE,WAAW,EAAE,kDAAkD;SAC/D;QACD;YACC,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,+DAA+D;YACxE,WAAW,EAAE,oCAAoC;SACjD;KACD,CAAC;IAEF,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,2FAA2F;SAChG;KACD,CAAC;CACF;AArFD,gDAqFC"}
@@ -0,0 +1,5 @@
1
+ import { ZohoBooks } from './nodes/ZohoBooks.node';
2
+ import { ZohoBooksOAuth2Api } from './credentials/ZohoBooksOAuth2Api.credentials';
3
+ export { ZohoBooks, ZohoBooksOAuth2Api };
4
+ export declare const nodes: (typeof ZohoBooks)[];
5
+ export declare const credentials: (typeof ZohoBooksOAuth2Api)[];
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.credentials = exports.nodes = exports.ZohoBooksOAuth2Api = exports.ZohoBooks = void 0;
4
+ const ZohoBooks_node_1 = require("./nodes/ZohoBooks.node");
5
+ Object.defineProperty(exports, "ZohoBooks", { enumerable: true, get: function () { return ZohoBooks_node_1.ZohoBooks; } });
6
+ const ZohoBooksOAuth2Api_credentials_1 = require("./credentials/ZohoBooksOAuth2Api.credentials");
7
+ Object.defineProperty(exports, "ZohoBooksOAuth2Api", { enumerable: true, get: function () { return ZohoBooksOAuth2Api_credentials_1.ZohoBooksOAuth2Api; } });
8
+ exports.nodes = [ZohoBooks_node_1.ZohoBooks];
9
+ exports.credentials = [ZohoBooksOAuth2Api_credentials_1.ZohoBooksOAuth2Api];
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AAG1C,0FAHA,0BAAS,OAGA;AAFlB,iGAAkF;AAE9D,mGAFX,mDAAkB,OAEW;AAEzB,QAAA,KAAK,GAAG,CAAC,0BAAS,CAAC,CAAC;AACpB,QAAA,WAAW,GAAG,CAAC,mDAAkB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class ZohoBooks implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getOrganizations(this: ILoadOptionsFunctions): Promise<{
7
+ name: string;
8
+ value: string;
9
+ }[]>;
10
+ };
11
+ };
12
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
13
+ }
@@ -0,0 +1,308 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZohoBooks = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const SUPPORTED_DATA_CENTERS = [
6
+ 'com',
7
+ 'eu',
8
+ 'in',
9
+ 'com.au',
10
+ 'jp',
11
+ 'ca',
12
+ 'com.cn',
13
+ 'sa'
14
+ ];
15
+ function ensureEndpoint(endpoint) {
16
+ if (!endpoint.startsWith('/')) {
17
+ return `/${endpoint}`;
18
+ }
19
+ return endpoint;
20
+ }
21
+ function parseJsonParameter(parameter, name, context) {
22
+ if (!parameter)
23
+ return {};
24
+ try {
25
+ const value = JSON.parse(parameter);
26
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) {
27
+ throw new Error(`${name} must be a JSON object`);
28
+ }
29
+ return value;
30
+ }
31
+ catch (error) {
32
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Invalid JSON in ${name}: ${error.message}`);
33
+ }
34
+ }
35
+ async function zohoBooksApiRequest(method, endpoint, body = {}, qs = {}) {
36
+ const credentials = (await this.getCredentials('zohoBooksOAuth2Api'));
37
+ const dataCenter = credentials.dataCenter || 'com';
38
+ if (!SUPPORTED_DATA_CENTERS.includes(dataCenter)) {
39
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Zoho data center "${dataCenter}". Update credentials.`);
40
+ }
41
+ const baseUrl = credentials.environment === 'sandbox'
42
+ ? credentials.sandboxBaseUrl
43
+ : credentials.baseUrl;
44
+ const options = {
45
+ method,
46
+ body: Object.keys(body).length ? body : undefined,
47
+ qs: Object.keys(qs).length ? qs : undefined,
48
+ uri: `${baseUrl}${ensureEndpoint(endpoint)}`,
49
+ json: true
50
+ };
51
+ try {
52
+ return await this.helpers.requestOAuth2.call(this, 'zohoBooksOAuth2Api', options);
53
+ }
54
+ catch (error) {
55
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
56
+ }
57
+ }
58
+ class ZohoBooks {
59
+ description = {
60
+ displayName: 'Zoho Books',
61
+ name: 'zohoBooks',
62
+ icon: 'file:zohoBooks.svg',
63
+ group: ['transform'],
64
+ version: 1,
65
+ description: 'Interact with Zoho Books API',
66
+ defaults: {
67
+ name: 'Zoho Books'
68
+ },
69
+ inputs: ['main'],
70
+ outputs: ['main'],
71
+ credentials: [
72
+ {
73
+ name: 'zohoBooksOAuth2Api',
74
+ required: true
75
+ }
76
+ ],
77
+ properties: [
78
+ {
79
+ displayName: 'Resource',
80
+ name: 'resource',
81
+ type: 'options',
82
+ noDataExpression: true,
83
+ options: [
84
+ {
85
+ name: 'Organization',
86
+ value: 'organization'
87
+ },
88
+ {
89
+ name: 'API Request (Generic)',
90
+ value: 'apiRequest'
91
+ }
92
+ ],
93
+ default: 'organization'
94
+ },
95
+ // Organization operations
96
+ {
97
+ displayName: 'Operation',
98
+ name: 'operation',
99
+ type: 'options',
100
+ displayOptions: {
101
+ show: {
102
+ resource: ['organization']
103
+ }
104
+ },
105
+ options: [
106
+ {
107
+ name: 'List Organizations',
108
+ value: 'list',
109
+ description: 'List all organizations available to the token'
110
+ },
111
+ {
112
+ name: 'Get Organization',
113
+ value: 'get',
114
+ description: 'Get a single organization by ID'
115
+ }
116
+ ],
117
+ default: 'list'
118
+ },
119
+ {
120
+ displayName: 'Organization',
121
+ name: 'organizationId',
122
+ type: 'options',
123
+ typeOptions: {
124
+ loadOptionsMethod: 'getOrganizations'
125
+ },
126
+ displayOptions: {
127
+ show: {
128
+ resource: ['organization'],
129
+ operation: ['get']
130
+ }
131
+ },
132
+ default: '',
133
+ description: 'Choose an organization from your Zoho Books account'
134
+ },
135
+ // Generic API request
136
+ {
137
+ displayName: 'Operation',
138
+ name: 'apiOperation',
139
+ type: 'options',
140
+ displayOptions: {
141
+ show: {
142
+ resource: ['apiRequest']
143
+ }
144
+ },
145
+ options: [
146
+ {
147
+ name: 'Raw API Request',
148
+ value: 'request',
149
+ description: 'Send a custom request to any Zoho Books endpoint'
150
+ }
151
+ ],
152
+ default: 'request'
153
+ },
154
+ {
155
+ displayName: 'HTTP Method',
156
+ name: 'method',
157
+ type: 'options',
158
+ displayOptions: {
159
+ show: {
160
+ resource: ['apiRequest'],
161
+ apiOperation: ['request']
162
+ }
163
+ },
164
+ options: [
165
+ { name: 'GET', value: 'GET' },
166
+ { name: 'POST', value: 'POST' },
167
+ { name: 'PUT', value: 'PUT' },
168
+ { name: 'PATCH', value: 'PATCH' },
169
+ { name: 'DELETE', value: 'DELETE' }
170
+ ],
171
+ default: 'GET'
172
+ },
173
+ {
174
+ displayName: 'Endpoint',
175
+ name: 'endpoint',
176
+ type: 'string',
177
+ required: true,
178
+ placeholder: '/invoices',
179
+ displayOptions: {
180
+ show: {
181
+ resource: ['apiRequest'],
182
+ apiOperation: ['request']
183
+ }
184
+ },
185
+ default: '',
186
+ description: 'Path after /books/v3 (e.g. /invoices)'
187
+ },
188
+ {
189
+ displayName: 'Organization ID',
190
+ name: 'organizationIdApi',
191
+ type: 'string',
192
+ displayOptions: {
193
+ show: {
194
+ resource: ['apiRequest'],
195
+ apiOperation: ['request']
196
+ }
197
+ },
198
+ default: '',
199
+ description: 'Optional organization_id query param; leave blank to supply it in the query JSON'
200
+ },
201
+ {
202
+ displayName: 'Query (JSON)',
203
+ name: 'query',
204
+ type: 'string',
205
+ typeOptions: { rows: 3 },
206
+ displayOptions: {
207
+ show: {
208
+ resource: ['apiRequest'],
209
+ apiOperation: ['request']
210
+ }
211
+ },
212
+ default: '',
213
+ description: 'Key-value pairs as JSON (e.g. {"status":"sent"})'
214
+ },
215
+ {
216
+ displayName: 'Send Body',
217
+ name: 'sendBody',
218
+ type: 'boolean',
219
+ displayOptions: {
220
+ show: {
221
+ resource: ['apiRequest'],
222
+ apiOperation: ['request']
223
+ }
224
+ },
225
+ default: false
226
+ },
227
+ {
228
+ displayName: 'Body (JSON)',
229
+ name: 'body',
230
+ type: 'string',
231
+ typeOptions: { rows: 5 },
232
+ displayOptions: {
233
+ show: {
234
+ resource: ['apiRequest'],
235
+ apiOperation: ['request'],
236
+ sendBody: [true]
237
+ }
238
+ },
239
+ default: '',
240
+ description: 'JSON payload for POST/PUT/PATCH operations'
241
+ }
242
+ ]
243
+ };
244
+ methods = {
245
+ loadOptions: {
246
+ async getOrganizations() {
247
+ const response = await zohoBooksApiRequest.call(this, 'GET', '/organizations');
248
+ const organizations = (response.organizations || []);
249
+ return organizations.map((org) => ({
250
+ name: org.name,
251
+ value: org.organization_id
252
+ }));
253
+ }
254
+ }
255
+ };
256
+ async execute() {
257
+ const items = this.getInputData();
258
+ const returnData = [];
259
+ for (let i = 0; i < items.length; i++) {
260
+ try {
261
+ const resource = this.getNodeParameter('resource', i);
262
+ if (resource === 'organization') {
263
+ const operation = this.getNodeParameter('operation', i);
264
+ if (operation === 'list') {
265
+ const response = await zohoBooksApiRequest.call(this, 'GET', '/organizations');
266
+ const organizations = response.organizations || [];
267
+ returnData.push(...this.helpers.returnJsonArray(organizations));
268
+ }
269
+ if (operation === 'get') {
270
+ const organizationId = this.getNodeParameter('organizationId', i);
271
+ const response = await zohoBooksApiRequest.call(this, 'GET', `/organizations/${organizationId}`);
272
+ const organization = response.organization || response;
273
+ returnData.push({ json: organization });
274
+ }
275
+ }
276
+ else if (resource === 'apiRequest') {
277
+ const method = this.getNodeParameter('method', i);
278
+ const endpoint = this.getNodeParameter('endpoint', i);
279
+ const rawQuery = this.getNodeParameter('query', i, '');
280
+ const sendBody = this.getNodeParameter('sendBody', i, false);
281
+ const rawBody = this.getNodeParameter('body', i, '');
282
+ const organizationId = this.getNodeParameter('organizationIdApi', i, '');
283
+ const qs = parseJsonParameter(rawQuery, 'Query', this);
284
+ if (organizationId) {
285
+ qs.organization_id = organizationId;
286
+ }
287
+ const body = sendBody
288
+ ? parseJsonParameter(rawBody, 'Body', this)
289
+ : {};
290
+ const response = await zohoBooksApiRequest.call(this, method, endpoint, body, qs);
291
+ returnData.push({ json: response });
292
+ }
293
+ }
294
+ catch (error) {
295
+ if (this.continueOnFail()) {
296
+ returnData.push({
297
+ json: { error: error.message }
298
+ });
299
+ continue;
300
+ }
301
+ throw error;
302
+ }
303
+ }
304
+ return [returnData];
305
+ }
306
+ }
307
+ exports.ZohoBooks = ZohoBooks;
308
+ //# sourceMappingURL=ZohoBooks.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZohoBooks.node.js","sourceRoot":"","sources":["../../nodes/ZohoBooks.node.ts"],"names":[],"mappings":";;;AAWA,+CAAgE;AAIhE,MAAM,sBAAsB,GAAG;IAC9B,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,IAAI;CACJ,CAAC;AAEF,SAAS,cAAc,CAAC,QAAgB;IACvC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,QAAQ,EAAE,CAAC;IACvB,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,SAAS,kBAAkB,CAC1B,SAAiB,EACjB,IAAY,EACZ,OAA0B;IAE1B,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK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n community node for Zoho Books (custom, OAuth2-ready)",
5
+ "author": "",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "prepare": "npm run build"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "keywords": [
16
+ "n8n-community-node",
17
+ "n8n-nodes",
18
+ "zoho",
19
+ "zoho-books",
20
+ "api"
21
+ ],
22
+ "dependencies": {
23
+ "n8n-core": "^1.72.0",
24
+ "n8n-workflow": "^1.72.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node": "^18.19.0",
28
+ "@types/express": "^4.17.21",
29
+ "@types/ssh2": "^1.11.13",
30
+ "nock": "^13.4.0",
31
+ "typescript": "^5.3.3"
32
+ },
33
+ "n8n": {
34
+ "credentials": [
35
+ "dist/credentials/ZohoBooksOAuth2Api.credentials.js"
36
+ ],
37
+ "nodes": [
38
+ "dist/nodes/ZohoBooks.node.js"
39
+ ]
40
+ }
41
+ }
42
+