n8n-nodes-shiprocket 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mangal Soren
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # n8n-nodes-shiprocket
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Unofficial open-source **n8n** community node for the [Shiprocket](https://apidocs.shiprocket.in/) shipping and logistics API.
4
+
5
+ ## Implemented Operations
6
+
7
+ - **Order:**
8
+ - `Create Adhoc Order` (`POST /v1/external/orders/create/adhoc`)
9
+ - `Get` (`GET /v1/external/orders/show/{id}`)
10
+ - `Get Many` (`GET /v1/external/orders` with `page` / `per_page` pagination)
11
+ - **Courier:**
12
+ - `Check Serviceability` (`GET /v1/external/courier/serviceability/`)
13
+ - `Track by AWB` (`GET /v1/external/courier/track/awb/{awb}`)
14
+
15
+ ## Authentication
16
+
17
+ Create an **API User** in your Shiprocket panel (**Settings → API → Add New API User**) and configure the **Shiprocket API** credential in n8n with that API user's email and password.
18
+
19
+ ## Testing & Verification
20
+
21
+ - **Unit tests (mocked):** Run `npm test` — all operations and pagination are verified against mocked Shiprocket API responses.
22
+ - **Live API testing:** Not yet performed (requires a live Shiprocket API user account).
23
+
24
+ ## Example Workflow
25
+
26
+ See [`examples/check-serviceability-workflow.json`](./examples/check-serviceability-workflow.json).
27
+
28
+ ## License
29
+
30
+ [MIT](./LICENSE)
@@ -0,0 +1,8 @@
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class ShiprocketApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ test: ICredentialTestRequest;
8
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShiprocketApi = void 0;
4
+ class ShiprocketApi {
5
+ name = 'shiprocketApi';
6
+ displayName = 'Shiprocket API';
7
+ documentationUrl = 'https://apidocs.shiprocket.in/';
8
+ properties = [
9
+ {
10
+ displayName: 'API User Email',
11
+ name: 'email',
12
+ type: 'string',
13
+ default: '',
14
+ required: true,
15
+ placeholder: 'api-user@example.com',
16
+ description: 'Email of the Shiprocket API user (not your main dashboard login).',
17
+ },
18
+ {
19
+ displayName: 'API User Password',
20
+ name: 'password',
21
+ type: 'string',
22
+ typeOptions: { password: true },
23
+ default: '',
24
+ required: true,
25
+ description: 'Password for the Shiprocket API user.',
26
+ },
27
+ ];
28
+ test = {
29
+ request: {
30
+ baseURL: 'https://apiv2.shiprocket.in/v1/external',
31
+ url: '/auth/login',
32
+ method: 'POST',
33
+ body: {
34
+ email: '={{$credentials.email}}',
35
+ password: '={{$credentials.password}}',
36
+ },
37
+ },
38
+ };
39
+ }
40
+ exports.ShiprocketApi = ShiprocketApi;
41
+ //# sourceMappingURL=ShiprocketApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShiprocketApi.credentials.js","sourceRoot":"","sources":["../../credentials/ShiprocketApi.credentials.ts"],"names":[],"mappings":";;;AAWA,MAAa,aAAa;IACxB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,gBAAgB,CAAC;IAC/B,gBAAgB,GAAG,gCAAgC,CAAC;IAEpD,UAAU,GAAsB;QAC9B;YACE,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,sBAAsB;YACnC,WAAW,EAAE,mEAAmE;SACjF;QACD;YACE,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,uCAAuC;SACrD;KACF,CAAC;IAEF,IAAI,GAA2B;QAC7B,OAAO,EAAE;YACP,OAAO,EAAE,yCAAyC;YAClD,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,KAAK,EAAE,yBAAyB;gBAChC,QAAQ,EAAE,4BAA4B;aACvC;SACF;KACF,CAAC;CACH;AArCD,sCAqCC"}
@@ -0,0 +1,3 @@
1
+ import type { IDataObject, IExecuteFunctions, IHttpRequestMethods } from 'n8n-workflow';
2
+ export declare function shiprocketApiRequest(this: IExecuteFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject>;
3
+ export declare function shiprocketApiRequestAllItems(this: IExecuteFunctions, endpoint: string, qs?: IDataObject, returnAll?: boolean, limit?: number): Promise<IDataObject[]>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shiprocketApiRequest = shiprocketApiRequest;
4
+ exports.shiprocketApiRequestAllItems = shiprocketApiRequestAllItems;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const SHIPROCKET_BASE_URL = 'https://apiv2.shiprocket.in/v1/external';
7
+ async function getShiprocketToken() {
8
+ const credentials = await this.getCredentials('shiprocketApi');
9
+ const options = {
10
+ method: 'POST',
11
+ url: `${SHIPROCKET_BASE_URL}/auth/login`,
12
+ body: {
13
+ email: credentials.email,
14
+ password: credentials.password,
15
+ },
16
+ json: true,
17
+ };
18
+ try {
19
+ const response = (await this.helpers.httpRequest(options));
20
+ if (!response?.token) {
21
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), response, {
22
+ message: 'Shiprocket authentication failed: no token returned',
23
+ });
24
+ }
25
+ return response.token;
26
+ }
27
+ catch (error) {
28
+ if (error instanceof n8n_workflow_1.NodeApiError)
29
+ throw error;
30
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
31
+ }
32
+ }
33
+ async function shiprocketApiRequest(method, endpoint, body = {}, qs = {}) {
34
+ const token = await getShiprocketToken.call(this);
35
+ const options = {
36
+ method,
37
+ url: `${SHIPROCKET_BASE_URL}/${endpoint}`,
38
+ headers: {
39
+ Authorization: `Bearer ${token}`,
40
+ },
41
+ qs,
42
+ json: true,
43
+ };
44
+ if (method !== 'GET' && Object.keys(body).length > 0) {
45
+ options.body = body;
46
+ }
47
+ try {
48
+ return (await this.helpers.httpRequest(options));
49
+ }
50
+ catch (error) {
51
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
52
+ }
53
+ }
54
+ async function shiprocketApiRequestAllItems(endpoint, qs = {}, returnAll = false, limit = 20) {
55
+ const results = [];
56
+ let page = 1;
57
+ const perPage = returnAll ? 50 : Math.min(limit, 50);
58
+ let hasMore = true;
59
+ while (hasMore) {
60
+ const response = await shiprocketApiRequest.call(this, 'GET', endpoint, {}, {
61
+ ...qs,
62
+ page,
63
+ per_page: perPage,
64
+ });
65
+ const items = Array.isArray(response.data) ? response.data : [];
66
+ results.push(...items);
67
+ if (!returnAll && results.length >= limit) {
68
+ return results.slice(0, limit);
69
+ }
70
+ const meta = response.meta;
71
+ const currentPage = meta?.pagination?.current_page ?? page;
72
+ const totalPages = meta?.pagination?.total_pages ?? page;
73
+ if (items.length === 0 || currentPage >= totalPages) {
74
+ hasMore = false;
75
+ }
76
+ page += 1;
77
+ }
78
+ return results;
79
+ }
80
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Shiprocket/GenericFunctions.ts"],"names":[],"mappings":";;AA4CA,oDA4BC;AAKD,oEAsCC;AA5GD,+CAA4C;AAE5C,MAAM,mBAAmB,GAAG,yCAAyC,CAAC;AAMtE,KAAK,UAAU,kBAAkB;IAC/B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAwB;QACnC,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,GAAG,mBAAmB,aAAa;QACxC,IAAI,EAAE;YACJ,KAAK,EAAE,WAAW,CAAC,KAAK;YACxB,QAAQ,EAAE,WAAW,CAAC,QAAQ;SAC/B;QACD,IAAI,EAAE,IAAI;KACX,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAuB,CAAC;QACjF,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;YACrB,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAsB,EAAE;gBAC7D,OAAO,EAAE,qDAAqD;aAC/D,CAAC,CAA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AAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAErD,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,OAAO,OAAO,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC1E,GAAG,EAAE;YACL,IAAI;YACJ,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,QAAQ,CAAC,IAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAEvB,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;YAC1C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAoF,CAAC;QAC3G,MAAM,WAAW,GAAG,IAAI,EAAE,UAAU,EAAE,YAAY,IAAI,IAAI,CAAC;QAC3D,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,EAAE,WAAW,IAAI,IAAI,CAAC;QAEzD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,IAAI,UAAU,EAAE,CAAC;YACpD,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;QACD,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Shiprocket implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Shiprocket = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const GenericFunctions_1 = require("./GenericFunctions");
6
+ class Shiprocket {
7
+ description = {
8
+ displayName: 'Shiprocket',
9
+ name: 'shiprocket',
10
+ group: ['transform'],
11
+ version: 1,
12
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
13
+ description: 'Interact with the Shiprocket shipping API (unofficial community node)',
14
+ defaults: {
15
+ name: 'Shiprocket',
16
+ },
17
+ inputs: ['main'],
18
+ outputs: ['main'],
19
+ credentials: [
20
+ {
21
+ name: 'shiprocketApi',
22
+ required: true,
23
+ },
24
+ ],
25
+ properties: [
26
+ {
27
+ displayName: 'Resource',
28
+ name: 'resource',
29
+ type: 'options',
30
+ noDataExpression: true,
31
+ options: [
32
+ { name: 'Courier', value: 'courier' },
33
+ { name: 'Order', value: 'order' },
34
+ ],
35
+ default: 'order',
36
+ },
37
+ {
38
+ displayName: 'Operation',
39
+ name: 'operation',
40
+ type: 'options',
41
+ noDataExpression: true,
42
+ displayOptions: { show: { resource: ['order'] } },
43
+ options: [
44
+ { name: 'Create Adhoc Order', value: 'createAdhoc', action: 'Create an adhoc order' },
45
+ { name: 'Get', value: 'get', action: 'Get an order' },
46
+ { name: 'Get Many', value: 'getMany', action: 'Get many orders' },
47
+ ],
48
+ default: 'getMany',
49
+ },
50
+ {
51
+ displayName: 'Operation',
52
+ name: 'operation',
53
+ type: 'options',
54
+ noDataExpression: true,
55
+ displayOptions: { show: { resource: ['courier'] } },
56
+ options: [
57
+ {
58
+ name: 'Check Serviceability',
59
+ value: 'checkServiceability',
60
+ action: 'Check courier serviceability',
61
+ },
62
+ { name: 'Track by AWB', value: 'trackByAwb', action: 'Track shipment by AWB' },
63
+ ],
64
+ default: 'checkServiceability',
65
+ },
66
+ {
67
+ displayName: 'Order ID',
68
+ name: 'orderId',
69
+ type: 'string',
70
+ required: true,
71
+ default: '',
72
+ displayOptions: { show: { resource: ['order'], operation: ['get'] } },
73
+ description: 'Shiprocket Order ID',
74
+ },
75
+ {
76
+ displayName: 'Return All',
77
+ name: 'returnAll',
78
+ type: 'boolean',
79
+ default: false,
80
+ displayOptions: { show: { resource: ['order'], operation: ['getMany'] } },
81
+ },
82
+ {
83
+ displayName: 'Limit',
84
+ name: 'limit',
85
+ type: 'number',
86
+ typeOptions: { minValue: 1, maxValue: 50 },
87
+ default: 20,
88
+ displayOptions: { show: { resource: ['order'], operation: ['getMany'], returnAll: [false] } },
89
+ },
90
+ {
91
+ displayName: 'Order Payload (JSON)',
92
+ name: 'orderPayload',
93
+ type: 'json',
94
+ required: true,
95
+ default: '{}',
96
+ displayOptions: { show: { resource: ['order'], operation: ['createAdhoc'] } },
97
+ description: 'JSON payload for /orders/create/adhoc per Shiprocket API docs',
98
+ },
99
+ {
100
+ displayName: 'Pickup Postcode',
101
+ name: 'pickupPostcode',
102
+ type: 'string',
103
+ required: true,
104
+ default: '',
105
+ displayOptions: { show: { resource: ['courier'], operation: ['checkServiceability'] } },
106
+ },
107
+ {
108
+ displayName: 'Delivery Postcode',
109
+ name: 'deliveryPostcode',
110
+ type: 'string',
111
+ required: true,
112
+ default: '',
113
+ displayOptions: { show: { resource: ['courier'], operation: ['checkServiceability'] } },
114
+ },
115
+ {
116
+ displayName: 'Weight (kg)',
117
+ name: 'weight',
118
+ type: 'number',
119
+ default: 0.5,
120
+ displayOptions: { show: { resource: ['courier'], operation: ['checkServiceability'] } },
121
+ },
122
+ {
123
+ displayName: 'Cash on Delivery (COD)',
124
+ name: 'cod',
125
+ type: 'boolean',
126
+ default: false,
127
+ displayOptions: { show: { resource: ['courier'], operation: ['checkServiceability'] } },
128
+ },
129
+ {
130
+ displayName: 'AWB Code',
131
+ name: 'awbCode',
132
+ type: 'string',
133
+ required: true,
134
+ default: '',
135
+ displayOptions: { show: { resource: ['courier'], operation: ['trackByAwb'] } },
136
+ },
137
+ ],
138
+ };
139
+ async execute() {
140
+ const items = this.getInputData();
141
+ const returnData = [];
142
+ for (let i = 0; i < items.length; i++) {
143
+ try {
144
+ const resource = this.getNodeParameter('resource', i);
145
+ const operation = this.getNodeParameter('operation', i);
146
+ let responseData;
147
+ if (resource === 'order' && operation === 'get') {
148
+ const orderId = this.getNodeParameter('orderId', i);
149
+ const res = await GenericFunctions_1.shiprocketApiRequest.call(this, 'GET', `orders/show/${orderId}`);
150
+ responseData = res.data ?? res;
151
+ }
152
+ else if (resource === 'order' && operation === 'getMany') {
153
+ const returnAll = this.getNodeParameter('returnAll', i, false);
154
+ const limit = returnAll ? 50 : this.getNodeParameter('limit', i, 20);
155
+ responseData = await GenericFunctions_1.shiprocketApiRequestAllItems.call(this, 'orders', {}, returnAll, limit);
156
+ }
157
+ else if (resource === 'order' && operation === 'createAdhoc') {
158
+ const rawPayload = this.getNodeParameter('orderPayload', i);
159
+ const body = typeof rawPayload === 'string' ? JSON.parse(rawPayload) : rawPayload;
160
+ responseData = await GenericFunctions_1.shiprocketApiRequest.call(this, 'POST', 'orders/create/adhoc', body);
161
+ }
162
+ else if (resource === 'courier' && operation === 'checkServiceability') {
163
+ const pickupPostcode = this.getNodeParameter('pickupPostcode', i);
164
+ const deliveryPostcode = this.getNodeParameter('deliveryPostcode', i);
165
+ const weight = this.getNodeParameter('weight', i, 0.5);
166
+ const cod = this.getNodeParameter('cod', i, false);
167
+ responseData = await GenericFunctions_1.shiprocketApiRequest.call(this, 'GET', 'courier/serviceability/', {}, {
168
+ pickup_postcode: pickupPostcode,
169
+ delivery_postcode: deliveryPostcode,
170
+ weight,
171
+ cod: cod ? 1 : 0,
172
+ });
173
+ }
174
+ else if (resource === 'courier' && operation === 'trackByAwb') {
175
+ const awbCode = this.getNodeParameter('awbCode', i);
176
+ responseData = await GenericFunctions_1.shiprocketApiRequest.call(this, 'GET', `courier/track/awb/${awbCode}`);
177
+ }
178
+ else {
179
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported operation "${resource}.${operation}"`, { itemIndex: i });
180
+ }
181
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
182
+ returnData.push(...executionData);
183
+ }
184
+ catch (error) {
185
+ if (this.continueOnFail()) {
186
+ returnData.push({
187
+ json: { error: error.message },
188
+ pairedItem: { item: i },
189
+ });
190
+ continue;
191
+ }
192
+ throw error;
193
+ }
194
+ }
195
+ return [returnData];
196
+ }
197
+ }
198
+ exports.Shiprocket = Shiprocket;
199
+ //# sourceMappingURL=Shiprocket.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shiprocket.node.js","sourceRoot":"","sources":["../../../nodes/Shiprocket/Shiprocket.node.ts"],"names":[],"mappings":";;;AAOA,+CAAkD;AAClD,yDAAwF;AAKxF,MAAa,UAAU;IACrB,WAAW,GAAyB;QAClC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,8DAA8D;QACxE,WAAW,EAAE,uEAAuE;QACpF,QAAQ,EAAE;YACR,IAAI,EAAE,YAAY;SACnB;QACD,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE;YACX;gBACE,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,UAAU,EAAE;YACV;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;gBACf,gBAAgB,EAAE,IAAI;gBACtB,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACrC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;iBAClC;gBACD,OAAO,E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BAED,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAC3D,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,EAC1C,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAC1B,CAAC;gBACF,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC1B,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;wBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACxB,CAAC,CAAC;oBACH,SAAS;gBACX,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;CACF;AA5MD,gCA4MC"}
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "n8n-nodes-shiprocket",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Unofficial n8n community node for the Shiprocket shipping and logistics API",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n",
8
+ "shiprocket",
9
+ "shipping",
10
+ "logistics",
11
+ "ecommerce",
12
+ "india"
13
+ ],
14
+ "license": "MIT",
15
+ "homepage": "https://github.com/mangalbuilds/n8n-nodes-shiprocket",
16
+ "author": {
17
+ "name": "Mangal Soren",
18
+ "email": "mangal@usevance.com"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/mangalbuilds/n8n-nodes-shiprocket.git"
23
+ },
24
+ "main": "index.js",
25
+ "scripts": {
26
+ "build": "tsc && gulp build:icons",
27
+ "dev": "tsc --watch",
28
+ "format": "prettier --write nodes credentials test",
29
+ "lint": "eslint nodes credentials test --ext .ts",
30
+ "test": "jest",
31
+ "prepublishOnly": "npm run lint && npm run test && npm run build"
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "n8n": {
37
+ "n8nNodesApiVersion": 1,
38
+ "credentials": [
39
+ "dist/credentials/ShiprocketApi.credentials.js"
40
+ ],
41
+ "nodes": [
42
+ "dist/nodes/Shiprocket/Shiprocket.node.js"
43
+ ]
44
+ },
45
+ "devDependencies": {
46
+ "@types/jest": "^29.5.14",
47
+ "@types/node": "^20.17.19",
48
+ "@typescript-eslint/eslint-plugin": "^8.24.0",
49
+ "@typescript-eslint/parser": "^8.24.0",
50
+ "eslint": "^8.57.1",
51
+ "gulp": "^5.0.0",
52
+ "jest": "^29.7.0",
53
+ "n8n-workflow": "^1.82.0",
54
+ "prettier": "^3.5.1",
55
+ "ts-jest": "^29.2.6",
56
+ "typescript": "^5.7.3"
57
+ },
58
+ "peerDependencies": {
59
+ "n8n-workflow": "*"
60
+ }
61
+ }