n8n-nodes-indiamart 1.0.4 → 1.0.6
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 +99 -24
- package/dist/credentials/IndiaMartApi.credentials.d.ts +12 -0
- package/dist/credentials/IndiaMartApi.credentials.js +51 -0
- package/dist/credentials/IndiaMartApi.credentials.js.map +1 -0
- package/dist/nodes/IndiaMArtPostRequirement/IndiaMArtPostRequirement.node.d.ts +5 -0
- package/dist/nodes/IndiaMArtPostRequirement/IndiaMArtPostRequirement.node.js +162 -0
- package/dist/nodes/IndiaMArtPostRequirement/IndiaMArtPostRequirement.node.js.map +1 -0
- package/dist/nodes/IndiaMArtPostRequirement/IndiaMArtPostRequirement.node.json +6 -0
- package/dist/nodes/IndiaMArtSearch/IndiaMArtSearch.node.js +13 -7
- package/dist/nodes/IndiaMArtSearch/IndiaMArtSearch.node.js.map +1 -1
- package/dist/nodes/{IndiaMArtSearch/icon.svg → icon.svg} +93 -93
- package/dist/package.json +6 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
# n8n-nodes-indiamart
|
|
4
4
|
|
|
5
|
-
This is an n8n community node
|
|
5
|
+
This is an n8n community node that enables seamless integration with IndiaMART for product sourcing and purchasing workflows.
|
|
6
|
+
|
|
7
|
+
IndiaMART is India's largest B2B marketplace, connecting buyers and suppliers across industries.
|
|
6
8
|
|
|
7
|
-
IndiaMART is India's largest B2B marketplace, connecting buyers and suppliers across industries. This node allows you to search for products and integrate them directly into your automation workflows.
|
|
8
9
|
|
|
9
10
|
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
10
11
|
|
|
11
12
|
[Installation](#installation)
|
|
13
|
+
[Credentials](#credentials)
|
|
12
14
|
[Operations](#operations)
|
|
13
15
|
[Compatibility](#compatibility)
|
|
14
16
|
[Usage](#usage)
|
|
@@ -18,12 +20,24 @@ IndiaMART is India's largest B2B marketplace, connecting buyers and suppliers ac
|
|
|
18
20
|
|
|
19
21
|
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
20
22
|
|
|
23
|
+
## Credentials
|
|
24
|
+
|
|
25
|
+
To power your IndiaMART n8n node, you need an API key. Follow these simple steps to get your credentials:
|
|
26
|
+
|
|
27
|
+
1. **Visit the Credentials Page**: Go to [indiamart.com/new/gamma/n8n_index.php](https://www.indiamart.com/new/gamma/n8n_index.php).
|
|
28
|
+
2. **Enter Details**: Provide your registered mobile number or email address.
|
|
29
|
+
3. **Verify OTP**: Enter the one-time password (OTP) sent to your registered contact.
|
|
30
|
+
4. **Get Credentials**: Copy your unique key and use it to authenticate your n8n node.
|
|
31
|
+
|
|
21
32
|
## Operations
|
|
22
33
|
|
|
23
|
-
This
|
|
34
|
+
This package includes the following nodes:
|
|
24
35
|
|
|
25
36
|
### Search
|
|
26
|
-
|
|
37
|
+
Search for products on IndiaMART by keyword and retrieve a list of matching product names
|
|
38
|
+
|
|
39
|
+
### Post Requirement
|
|
40
|
+
Post a product requirement on IndiaMART using the saveEnrichment API to generate sourcing requests
|
|
27
41
|
|
|
28
42
|
## Compatibility
|
|
29
43
|
|
|
@@ -31,7 +45,9 @@ Tested locally against n8n v1.104.2.
|
|
|
31
45
|
|
|
32
46
|
## Usage
|
|
33
47
|
|
|
34
|
-
### Node
|
|
48
|
+
### IndiaMART Search Node
|
|
49
|
+
|
|
50
|
+
#### Node Configuration
|
|
35
51
|
|
|
36
52
|
The IndiaMART Search node requires a single parameter:
|
|
37
53
|
|
|
@@ -39,47 +55,106 @@ The IndiaMART Search node requires a single parameter:
|
|
|
39
55
|
- The search term to query on IndiaMART
|
|
40
56
|
- Examples: "school bags", "office supplies", "women's clothing"
|
|
41
57
|
|
|
42
|
-
|
|
58
|
+
#### Output
|
|
43
59
|
|
|
44
60
|
The node returns an object with:
|
|
45
61
|
|
|
46
62
|
```json
|
|
47
63
|
{
|
|
48
64
|
"products": [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
{
|
|
66
|
+
"name": "Plastic Dancing Cactus Toy",
|
|
67
|
+
"number": "8044562706",
|
|
68
|
+
"companyname": "Shree Lalankrupa Enterprise",
|
|
69
|
+
"image": "http://5.imimg.com/data5/SELLER/Default/2024/3/405052888/TF/TX/ZQ/214979800/dancing-cactus-toy-500x500.jpeg"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "Multicolor Tk Candy Flower Toy For Kids",
|
|
73
|
+
"number": "8047668613",
|
|
74
|
+
"companyname": "Arora Toys",
|
|
75
|
+
"image": "http://5.imimg.com/data5/SELLER/Default/2025/3/497677672/FU/SX/TI/81433069/whatsapp-image-2025-03-23-at-9-01-54-pm-500x500.jpeg"
|
|
76
|
+
}
|
|
54
77
|
],
|
|
55
|
-
"keyword": "
|
|
78
|
+
"keyword": "toys"
|
|
56
79
|
}
|
|
57
80
|
```
|
|
58
81
|
|
|
59
|
-
- **products**: Array of product
|
|
82
|
+
- **products**: Array of product objects with details
|
|
83
|
+
- **name**: Product name
|
|
84
|
+
- **number**: Mobile number of the company/supplier
|
|
85
|
+
- **companyname**: Company/supplier name
|
|
86
|
+
- **image**: Product image URL
|
|
60
87
|
- **keyword**: The search keyword used
|
|
61
88
|
|
|
62
|
-
###
|
|
89
|
+
### IndiaMART Post Requirement Node
|
|
90
|
+
|
|
91
|
+
#### Node Configuration
|
|
92
|
+
|
|
93
|
+
The IndiaMART Post Requirement node requires the following parameters:
|
|
94
|
+
|
|
95
|
+
**Product Name** (required)
|
|
96
|
+
- The name of the product for which you're posting a requirement
|
|
97
|
+
- Examples: "Pave Diamond Pendant", "Office Chairs", "Electronics"
|
|
98
|
+
|
|
99
|
+
**Quantity** (required)
|
|
100
|
+
- The quantity of the product required
|
|
101
|
+
- Example: 10
|
|
102
|
+
|
|
103
|
+
**Quantity Unit** (required)
|
|
104
|
+
- The unit of measurement for the quantity
|
|
105
|
+
- Examples: "Piece", "Kg", "Ton", "Box"
|
|
106
|
+
|
|
107
|
+
**Additional Requirements** (optional)
|
|
108
|
+
- Any specific requirements, preferences, or details
|
|
109
|
+
- Example: "Need high quality finish"
|
|
110
|
+
|
|
111
|
+
#### Output
|
|
112
|
+
|
|
113
|
+
The node returns an object with:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"message": "Successfully posted requirement on IndiaMART",
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- **message**: Success or error message
|
|
122
|
+
|
|
123
|
+
### Using the IndiaMART Nodes
|
|
63
124
|
|
|
64
125
|
Once installed:
|
|
65
126
|
|
|
66
127
|
1. **Create a new workflow** or open an existing one
|
|
67
|
-
2. **Add
|
|
68
|
-
3. **Configure parameters**: Enter
|
|
69
|
-
4. **Execute the workflow**: Test your workflow to retrieve
|
|
128
|
+
2. **Add IndiaMART nodes**: Search for "IndiaMART" in the node panel and drag nodes into your workflow
|
|
129
|
+
3. **Configure parameters**: Enter required parameters for each node
|
|
130
|
+
4. **Execute the workflow**: Test your workflow to retrieve results
|
|
70
131
|
5. **Use the output**: Connect to other nodes to process, filter, or store the results
|
|
71
132
|
|
|
72
|
-
###
|
|
133
|
+
### Workflow Examples
|
|
134
|
+
|
|
135
|
+
#### Automated Lead-to-Post
|
|
136
|
+
**Scenario:** A customer emails you asking for a specific bulk item.
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
[Gmail Trigger] → [AI Agent] → [IndiaMART Search] → [IndiaMART Post Requirement] → [Log Output]
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
1. **Gmail receives an email:** "I need 500 wooden toy cars."
|
|
143
|
+
2. **AI Agent:** Extracts the keyword "wooden toy cars".
|
|
144
|
+
3. **IndiaMART Search:** Scans for existing suppliers to check market prices.
|
|
145
|
+
4. **IndiaMART Post Requirement:** Automatically posts requirement on Indiamart so suppliers for wooden toy cars contact you directly.
|
|
146
|
+
|
|
147
|
+
#### Spreadsheet Batch Sourcing
|
|
148
|
+
**Scenario:** You have a list of products in a Google Sheet that you need to source.
|
|
73
149
|
|
|
74
|
-
#### Basic Product Search
|
|
75
150
|
```
|
|
76
|
-
[Trigger] → [IndiaMART Search] → [
|
|
151
|
+
[Google Sheets Trigger] → [AI Agent] → [IndiaMART Search] → [IndiaMART Post Requirement] → [Update Sheet]
|
|
77
152
|
```
|
|
78
153
|
|
|
79
|
-
1.
|
|
80
|
-
2.
|
|
81
|
-
3.
|
|
82
|
-
4.
|
|
154
|
+
1. **New row added to Google Sheets:** "Product: LED Lights".
|
|
155
|
+
2. **AI Agent:** Extracts the product keyword to search.
|
|
156
|
+
3. **IndiaMART Search:** Finds the top 10 current listings for LED Lights.
|
|
157
|
+
4. **IndiaMART Post Requirement:** Post requirement on Indiamart to connect with verified suppliers.
|
|
83
158
|
|
|
84
159
|
## Author
|
|
85
160
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ICredentialType, INodeProperties, ICredentialTestRequest } from 'n8n-workflow';
|
|
2
|
+
export declare class IndiaMartApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:indiamart.svg";
|
|
8
|
+
readonly dark: "file:indiamart.svg";
|
|
9
|
+
};
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
test: ICredentialTestRequest;
|
|
12
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndiaMartApi = void 0;
|
|
4
|
+
class IndiaMartApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'indiaMartApi';
|
|
7
|
+
this.displayName = 'IndiaMART API';
|
|
8
|
+
this.documentationUrl = 'https://github.com/Gyaneshwar-Mongha/n8n-indiamart';
|
|
9
|
+
this.icon = { light: 'file:indiamart.svg', dark: 'file:indiamart.svg' };
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Secret Key',
|
|
13
|
+
name: 'secretKey',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: {
|
|
16
|
+
password: true,
|
|
17
|
+
},
|
|
18
|
+
default: '',
|
|
19
|
+
required: true,
|
|
20
|
+
description: 'The secret key for IndiaMART API',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
this.test = {
|
|
24
|
+
request: {
|
|
25
|
+
baseURL: 'https://export.indiamart.com',
|
|
26
|
+
url: '/api/credGenRead/',
|
|
27
|
+
method: 'POST',
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/json',
|
|
30
|
+
},
|
|
31
|
+
body: {
|
|
32
|
+
secretkey: '={{$credentials.secretKey}}',
|
|
33
|
+
},
|
|
34
|
+
json: true,
|
|
35
|
+
returnFullResponse: true,
|
|
36
|
+
},
|
|
37
|
+
rules: [
|
|
38
|
+
{
|
|
39
|
+
type: 'responseSuccessBody',
|
|
40
|
+
properties: {
|
|
41
|
+
key: 'glid',
|
|
42
|
+
message: 'Secret key verified successfully!',
|
|
43
|
+
value: 'glid',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.IndiaMartApi = IndiaMartApi;
|
|
51
|
+
//# sourceMappingURL=IndiaMartApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndiaMartApi.credentials.js","sourceRoot":"","sources":["../../credentials/IndiaMartApi.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,YAAY;IAAzB;QACI,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,eAAe,CAAC;QAC9B,qBAAgB,GAAG,oDAAoD,CAAC;QACxE,SAAI,GAAG,EAAE,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,EAAW,CAAC;QAC5E,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,kCAAkC;aAClD;SACJ,CAAC;QAGF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,8BAA8B;gBACvC,GAAG,EAAE,mBAAmB;gBACxB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE;oBACF,SAAS,EAAE,6BAA6B;iBAC3C;gBACD,IAAI,EAAE,IAAI;gBAEV,kBAAkB,EAAE,IAAI;aAC3B;YAED,KAAK,EAAE;gBACH;oBACI,IAAI,EAAE,qBAAqB;oBAC3B,UAAU,EAAE;wBACR,GAAG,EAAE,MAAM;wBACX,OAAO,EAAE,mCAAmC;wBAC5C,KAAK,EAAE,MAAM;qBAChB;iBACJ;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AA/CD,oCA+CC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class IndiaMArtPostRequirement implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndiaMArtPostRequirement = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class IndiaMArtPostRequirement {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'IndiaMART Post Requirement',
|
|
9
|
+
name: 'indiaMArtPostRequirement',
|
|
10
|
+
icon: 'file:../icon.svg',
|
|
11
|
+
group: ['output'],
|
|
12
|
+
version: 1,
|
|
13
|
+
description: 'Post a product requirement on IndiaMART',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'IndiaMART Post Requirement',
|
|
16
|
+
},
|
|
17
|
+
credentials: [
|
|
18
|
+
{
|
|
19
|
+
name: 'indiaMartApi',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
24
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
25
|
+
usableAsTool: true,
|
|
26
|
+
properties: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Product Name',
|
|
29
|
+
name: 'productName',
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: '',
|
|
32
|
+
placeholder: 'water purifier, office chair',
|
|
33
|
+
description: 'Product name for the requirement',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Quantity',
|
|
38
|
+
name: 'quantity',
|
|
39
|
+
type: 'number',
|
|
40
|
+
default: 1,
|
|
41
|
+
placeholder: '10',
|
|
42
|
+
description: 'Quantity required (must be greater than 0)',
|
|
43
|
+
required: true,
|
|
44
|
+
typeOptions: {
|
|
45
|
+
minValue: 1,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Quantity Unit',
|
|
50
|
+
name: 'quantityUnit',
|
|
51
|
+
type: 'string',
|
|
52
|
+
default: 'Piece',
|
|
53
|
+
placeholder: 'Piece, Kg, Ton, Box',
|
|
54
|
+
description: 'Unit of measurement for the quantity',
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
displayName: 'Additional Requirements',
|
|
59
|
+
name: 'additionalRequirements',
|
|
60
|
+
type: 'string',
|
|
61
|
+
typeOptions: {
|
|
62
|
+
rows: 4,
|
|
63
|
+
},
|
|
64
|
+
default: '',
|
|
65
|
+
placeholder: 'Any specific requirements, preferences, or details...',
|
|
66
|
+
description: 'Additional information about your requirement',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async execute() {
|
|
72
|
+
const items = this.getInputData();
|
|
73
|
+
let item;
|
|
74
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
75
|
+
try {
|
|
76
|
+
const productName = this.getNodeParameter('productName', itemIndex, '');
|
|
77
|
+
const credentials = await this.getCredentials('indiaMartApi');
|
|
78
|
+
const secretKey = credentials.secretKey;
|
|
79
|
+
const quantity = this.getNodeParameter('quantity', itemIndex, 1);
|
|
80
|
+
const quantityUnit = this.getNodeParameter('quantityUnit', itemIndex, 'Piece');
|
|
81
|
+
const additionalRequirements = this.getNodeParameter('additionalRequirements', itemIndex, '');
|
|
82
|
+
item = items[itemIndex];
|
|
83
|
+
if (quantity <= 0) {
|
|
84
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Quantity must be greater than 0', { itemIndex });
|
|
85
|
+
}
|
|
86
|
+
if (quantityUnit && !/^[a-zA-Z\s]+$/.test(quantityUnit)) {
|
|
87
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Quantity unit must contain only alphabets (a-z, A-Z) and spaces', { itemIndex });
|
|
88
|
+
}
|
|
89
|
+
const apiUrl = 'https://export.indiamart.com/cgi/postRequirement.php';
|
|
90
|
+
const payload = {
|
|
91
|
+
productName,
|
|
92
|
+
secretKey,
|
|
93
|
+
quantity,
|
|
94
|
+
quantityUnit,
|
|
95
|
+
additionalRequirements,
|
|
96
|
+
};
|
|
97
|
+
try {
|
|
98
|
+
const response = await this.helpers.httpRequest({
|
|
99
|
+
method: 'POST',
|
|
100
|
+
url: apiUrl,
|
|
101
|
+
body: payload,
|
|
102
|
+
headers: {
|
|
103
|
+
'Content-Type': 'application/json',
|
|
104
|
+
},
|
|
105
|
+
json: true,
|
|
106
|
+
returnFullResponse: true,
|
|
107
|
+
ignoreHttpStatusErrors: true,
|
|
108
|
+
});
|
|
109
|
+
const responseBody = response.body;
|
|
110
|
+
const bodyString = typeof responseBody === 'string' ? responseBody : JSON.stringify(responseBody);
|
|
111
|
+
if (bodyString.includes('Invalid or expired secret key')) {
|
|
112
|
+
item.json = {
|
|
113
|
+
message: 'Invalid or expired secret key',
|
|
114
|
+
};
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (response.statusCode >= 400) {
|
|
118
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Post Requirement failed: ${JSON.stringify(response.body)}`, {
|
|
119
|
+
itemIndex,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Post Requirement failed: ${error.message}`, {
|
|
128
|
+
itemIndex,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
item.json = {
|
|
132
|
+
message: 'Successfully posted requirement on IndiaMART',
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
if (this.continueOnFail()) {
|
|
137
|
+
items.push({
|
|
138
|
+
json: {
|
|
139
|
+
...this.getInputData(itemIndex)[0].json,
|
|
140
|
+
success: false,
|
|
141
|
+
error: error.message,
|
|
142
|
+
},
|
|
143
|
+
error,
|
|
144
|
+
pairedItem: itemIndex
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (error.context) {
|
|
149
|
+
error.context.itemIndex = itemIndex;
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
|
|
153
|
+
itemIndex,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return [items];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.IndiaMArtPostRequirement = IndiaMArtPostRequirement;
|
|
162
|
+
//# sourceMappingURL=IndiaMArtPostRequirement.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndiaMArtPostRequirement.node.js","sourceRoot":"","sources":["../../../nodes/IndiaMArtPostRequirement/IndiaMArtPostRequirement.node.ts"],"names":[],"mappings":";;;AAOA,+CAAuE;AAGvE,MAAa,wBAAwB;IAArC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,0BAA0B;YAChC,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE;gBACT,IAAI,EAAE,4BAA4B;aAClC;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,cAAc;oBAC3B,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,8BAA8B;oBAC3C,WAAW,EAAE,kCAAkC;oBAC/C,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,I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,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE;wBACnD,SAAS;qBACT,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC;CACD;AAlLD,4DAkLC"}
|
|
@@ -7,7 +7,7 @@ class IndiaMArtSearch {
|
|
|
7
7
|
this.description = {
|
|
8
8
|
displayName: 'IndiaMART Search',
|
|
9
9
|
name: 'indiaMArtSearch',
|
|
10
|
-
icon: 'file
|
|
10
|
+
icon: 'file:../icon.svg',
|
|
11
11
|
group: ['input'],
|
|
12
12
|
version: 1,
|
|
13
13
|
description: 'Search IndiaMART for products by keyword and return product names',
|
|
@@ -43,7 +43,7 @@ class IndiaMArtSearch {
|
|
|
43
43
|
itemIndex,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
const url = `https://
|
|
46
|
+
const url = `https://dir.indiamart.com/api/n8nreq.rp?q=${encodeURIComponent(keyword)}&source=dir.search`;
|
|
47
47
|
const response = await this.helpers.httpRequest({
|
|
48
48
|
method: 'GET',
|
|
49
49
|
url: url,
|
|
@@ -60,7 +60,7 @@ class IndiaMArtSearch {
|
|
|
60
60
|
itemIndex,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const productArray = [];
|
|
64
64
|
if (parsedData && typeof parsedData === 'object' && 'results' in parsedData) {
|
|
65
65
|
const results = parsedData.results;
|
|
66
66
|
if (Array.isArray(results)) {
|
|
@@ -69,15 +69,21 @@ class IndiaMArtSearch {
|
|
|
69
69
|
const fields = result.fields;
|
|
70
70
|
if (fields && typeof fields === 'object') {
|
|
71
71
|
const title = fields.title;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
const pns = fields.pns;
|
|
73
|
+
const companyname = fields.companyname;
|
|
74
|
+
const zoomed_image = fields.zoomed_image;
|
|
75
|
+
productArray.push({
|
|
76
|
+
name: title,
|
|
77
|
+
number: pns,
|
|
78
|
+
companyname: companyname,
|
|
79
|
+
image: zoomed_image
|
|
80
|
+
});
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
|
-
item.json.products =
|
|
86
|
+
item.json.products = productArray;
|
|
81
87
|
item.json.keyword = keyword;
|
|
82
88
|
}
|
|
83
89
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndiaMArtSearch.node.js","sourceRoot":"","sources":["../../../nodes/IndiaMArtSearch/IndiaMArtSearch.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AAEvE,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"IndiaMArtSearch.node.js","sourceRoot":"","sources":["../../../nodes/IndiaMArtSearch/IndiaMArtSearch.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AAEvE,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,mEAAmE;YAChF,QAAQ,EAAE;gBACT,IAAI,EAAE,kBAAkB;aACxB;YACD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE;gBAGX;oBACC,WAAW,EAAE,SAAS;oBACtB,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,qBAAqB;oBAClC,WAAW,EAAE,6BAA6B;oBAC1C,QAAQ,EAAE,IAAI;iBACd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