n8n-nodes-didar-crm 0.0.18 → 0.0.20
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/dist/nodes/DidarCrm.node.js +53 -0
- package/dist/nodes/activity/index.d.ts +2 -0
- package/dist/nodes/activity/index.js +5 -1
- package/dist/nodes/activity/search.operation.d.ts +2 -0
- package/dist/nodes/activity/search.operation.js +162 -0
- package/dist/nodes/activity/search.properties.d.ts +2 -0
- package/dist/nodes/activity/search.properties.js +193 -0
- package/dist/nodes/case/index.d.ts +2 -0
- package/dist/nodes/case/index.js +5 -1
- package/dist/nodes/case/search.operation.d.ts +2 -0
- package/dist/nodes/case/search.operation.js +156 -0
- package/dist/nodes/case/search.properties.d.ts +2 -0
- package/dist/nodes/case/search.properties.js +93 -0
- package/dist/nodes/company/index.d.ts +2 -0
- package/dist/nodes/company/index.js +5 -1
- package/dist/nodes/company/search.operation.d.ts +2 -0
- package/dist/nodes/company/search.operation.js +87 -0
- package/dist/nodes/company/search.properties.d.ts +2 -0
- package/dist/nodes/company/search.properties.js +136 -0
- package/dist/nodes/deal/search.operation.js +2 -1
- package/dist/nodes/person/index.d.ts +2 -0
- package/dist/nodes/person/index.js +5 -1
- package/dist/nodes/person/search.operation.d.ts +2 -0
- package/dist/nodes/person/search.operation.js +86 -0
- package/dist/nodes/person/search.properties.d.ts +2 -0
- package/dist/nodes/person/search.properties.js +136 -0
- package/dist/nodes/product/index.d.ts +2 -0
- package/dist/nodes/product/index.js +5 -1
- package/dist/nodes/product/search.operation.d.ts +2 -0
- package/dist/nodes/product/search.operation.js +30 -0
- package/dist/nodes/product/search.properties.d.ts +2 -0
- package/dist/nodes/product/search.properties.js +23 -0
- package/dist/nodes/supplementary/get-base-info.operation.d.ts +2 -0
- package/dist/nodes/supplementary/get-base-info.operation.js +26 -0
- package/dist/nodes/supplementary/get-base-info.properties.d.ts +2 -0
- package/dist/nodes/supplementary/get-base-info.properties.js +20 -0
- package/dist/nodes/supplementary/index.d.ts +2 -0
- package/dist/nodes/supplementary/index.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.personSearchProperties = void 0;
|
|
4
|
+
const showForPersonSearch = { show: { resource: ['person'], operation: ['search'] } };
|
|
5
|
+
exports.personSearchProperties = [
|
|
6
|
+
// ===== Main fields (ordered) =====
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Keywords',
|
|
9
|
+
name: 'Keywords',
|
|
10
|
+
type: 'string',
|
|
11
|
+
default: '',
|
|
12
|
+
required: false,
|
|
13
|
+
displayOptions: showForPersonSearch,
|
|
14
|
+
description: 'Free-text search (optional).',
|
|
15
|
+
},
|
|
16
|
+
// Owner (select/manual) — optional
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Owner Input Mode',
|
|
19
|
+
name: 'OwnerMode',
|
|
20
|
+
type: 'options',
|
|
21
|
+
options: [
|
|
22
|
+
{ name: 'Select from list', value: 'select' },
|
|
23
|
+
{ name: 'Enter ID manually', value: 'manual' },
|
|
24
|
+
],
|
|
25
|
+
default: 'select',
|
|
26
|
+
displayOptions: showForPersonSearch,
|
|
27
|
+
description: 'Choose how to set the owner filter (optional).',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Owner',
|
|
31
|
+
name: 'OwnerIdSelect',
|
|
32
|
+
type: 'options',
|
|
33
|
+
typeOptions: { loadOptionsMethod: 'getUsers' },
|
|
34
|
+
default: '',
|
|
35
|
+
displayOptions: { show: { ...showForPersonSearch.show, OwnerMode: ['select'] } },
|
|
36
|
+
description: 'Select the owner user (leave empty to ignore).',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Owner ID',
|
|
40
|
+
name: 'OwnerIdManual',
|
|
41
|
+
type: 'string',
|
|
42
|
+
default: '',
|
|
43
|
+
displayOptions: { show: { ...showForPersonSearch.show, OwnerMode: ['manual'] } },
|
|
44
|
+
description: 'Enter owner user ID manually (leave empty to ignore).',
|
|
45
|
+
},
|
|
46
|
+
// ===== Additional filters (collection) =====
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Additional Filters',
|
|
49
|
+
name: 'additionalFields',
|
|
50
|
+
type: 'collection',
|
|
51
|
+
placeholder: 'Add filter',
|
|
52
|
+
default: {},
|
|
53
|
+
displayOptions: showForPersonSearch,
|
|
54
|
+
options: [
|
|
55
|
+
// Time window (these three همیشه در بدنه میآیند با دیفالتها)
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Search From Time',
|
|
58
|
+
name: 'SearchFromTime',
|
|
59
|
+
type: 'dateTime',
|
|
60
|
+
default: '1000-01-01T00:00:00.000Z',
|
|
61
|
+
description: 'Lower bound for the selected time field.',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Search To Time',
|
|
65
|
+
name: 'SearchToTime',
|
|
66
|
+
type: 'dateTime',
|
|
67
|
+
default: '9999-12-01T00:00:00.000Z',
|
|
68
|
+
description: 'Upper bound for the selected time field.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Sort Order',
|
|
72
|
+
name: 'SortOrder',
|
|
73
|
+
type: 'options',
|
|
74
|
+
options: [
|
|
75
|
+
{ name: 'Alphabetical', value: 0 },
|
|
76
|
+
{ name: 'Newest First', value: 1 },
|
|
77
|
+
],
|
|
78
|
+
default: 0,
|
|
79
|
+
description: 'Sorting mode.',
|
|
80
|
+
},
|
|
81
|
+
// Flags (optional – با Not set)
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Is Deleted',
|
|
84
|
+
name: 'IsDeleted',
|
|
85
|
+
type: 'options',
|
|
86
|
+
options: [
|
|
87
|
+
{ name: 'Not set', value: '' },
|
|
88
|
+
{ name: 'No (0)', value: 0 },
|
|
89
|
+
{ name: 'Yes (1)', value: 1 },
|
|
90
|
+
],
|
|
91
|
+
default: '',
|
|
92
|
+
description: 'Filter by deletion flag (optional).',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Is Pinned',
|
|
96
|
+
name: 'IsPinned',
|
|
97
|
+
type: 'options',
|
|
98
|
+
options: [
|
|
99
|
+
{ name: 'Not set', value: '' },
|
|
100
|
+
{ name: 'True (1)', value: 1 },
|
|
101
|
+
{ name: 'False (-1)', value: -1 },
|
|
102
|
+
],
|
|
103
|
+
default: '',
|
|
104
|
+
description: 'Filter by pin flag (optional).',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Is VIP',
|
|
108
|
+
name: 'IsVIP',
|
|
109
|
+
type: 'options',
|
|
110
|
+
options: [
|
|
111
|
+
{ name: 'Not set', value: '' },
|
|
112
|
+
{ name: 'True (1)', value: 1 },
|
|
113
|
+
{ name: 'False (-1)', value: -1 },
|
|
114
|
+
],
|
|
115
|
+
default: '',
|
|
116
|
+
description: 'Filter by VIP flag (optional).',
|
|
117
|
+
},
|
|
118
|
+
// CustomFields as JSON (optional)
|
|
119
|
+
{
|
|
120
|
+
displayName: 'Custom Fields (JSON)',
|
|
121
|
+
name: 'CustomFields',
|
|
122
|
+
type: 'json',
|
|
123
|
+
default: '[]',
|
|
124
|
+
description: 'JSON array of custom field filters (optional).',
|
|
125
|
+
},
|
|
126
|
+
// Pagination (Limit only; From=0 hidden)
|
|
127
|
+
{
|
|
128
|
+
displayName: 'Limit',
|
|
129
|
+
name: 'Limit',
|
|
130
|
+
type: 'number',
|
|
131
|
+
default: 10,
|
|
132
|
+
description: 'Number of results to return.',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
];
|
|
@@ -4,3 +4,5 @@ export { productUpdate } from './update.operation';
|
|
|
4
4
|
export { productUpdateProperties } from './update.properties';
|
|
5
5
|
export { productGetByCodes } from './getByCodes.operation';
|
|
6
6
|
export { productGetByCodesProperties } from './getByCodes.properties';
|
|
7
|
+
export { productSearch } from './search.operation';
|
|
8
|
+
export { productSearchProperties } from './search.properties';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productGetByCodesProperties = exports.productGetByCodes = exports.productUpdateProperties = exports.productUpdate = exports.productCreateProperties = exports.productCreate = void 0;
|
|
3
|
+
exports.productSearchProperties = exports.productSearch = exports.productGetByCodesProperties = exports.productGetByCodes = exports.productUpdateProperties = exports.productUpdate = exports.productCreateProperties = exports.productCreate = void 0;
|
|
4
4
|
// nodes/product/index.ts
|
|
5
5
|
var create_operation_1 = require("./create.operation");
|
|
6
6
|
Object.defineProperty(exports, "productCreate", { enumerable: true, get: function () { return create_operation_1.productCreate; } });
|
|
@@ -14,3 +14,7 @@ var getByCodes_operation_1 = require("./getByCodes.operation");
|
|
|
14
14
|
Object.defineProperty(exports, "productGetByCodes", { enumerable: true, get: function () { return getByCodes_operation_1.productGetByCodes; } });
|
|
15
15
|
var getByCodes_properties_1 = require("./getByCodes.properties");
|
|
16
16
|
Object.defineProperty(exports, "productGetByCodesProperties", { enumerable: true, get: function () { return getByCodes_properties_1.productGetByCodesProperties; } });
|
|
17
|
+
var search_operation_1 = require("./search.operation");
|
|
18
|
+
Object.defineProperty(exports, "productSearch", { enumerable: true, get: function () { return search_operation_1.productSearch; } });
|
|
19
|
+
var search_properties_1 = require("./search.properties");
|
|
20
|
+
Object.defineProperty(exports, "productSearchProperties", { enumerable: true, get: function () { return search_properties_1.productSearchProperties; } });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productSearch = productSearch;
|
|
4
|
+
const http_1 = require("../../lib/http");
|
|
5
|
+
async function productSearch(i, returnData) {
|
|
6
|
+
var _a;
|
|
7
|
+
// پارامترها
|
|
8
|
+
const keywords = this.getNodeParameter('Keywords', i, '').trim();
|
|
9
|
+
const limit = this.getNodeParameter('Limit', i, 10);
|
|
10
|
+
const from = 0;
|
|
11
|
+
// بدنه
|
|
12
|
+
const criteria = {};
|
|
13
|
+
if (keywords)
|
|
14
|
+
criteria['Keywords'] = keywords;
|
|
15
|
+
const body = {
|
|
16
|
+
Criteria: criteria,
|
|
17
|
+
From: from,
|
|
18
|
+
Limit: limit,
|
|
19
|
+
};
|
|
20
|
+
// درخواست
|
|
21
|
+
const resp = await (0, http_1.didarRequest)(this, i, {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
path: '/api/product/search',
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
const out = ((_a = resp === null || resp === void 0 ? void 0 : resp.Response) !== null && _a !== void 0 ? _a : resp);
|
|
27
|
+
// خروجی
|
|
28
|
+
returnData.push({ json: { search_response: out, criteria: body } });
|
|
29
|
+
return returnData;
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productSearchProperties = void 0;
|
|
4
|
+
const showForProductSearch = { show: { resource: ['product'], operation: ['search'] } };
|
|
5
|
+
exports.productSearchProperties = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Keywords',
|
|
8
|
+
name: 'Keywords',
|
|
9
|
+
type: 'string',
|
|
10
|
+
default: '',
|
|
11
|
+
displayOptions: showForProductSearch,
|
|
12
|
+
description: 'Search term to match product fields.',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Limit',
|
|
16
|
+
name: 'Limit',
|
|
17
|
+
type: 'number',
|
|
18
|
+
typeOptions: { minValue: 1, maxValue: 100 },
|
|
19
|
+
default: 10,
|
|
20
|
+
displayOptions: showForProductSearch,
|
|
21
|
+
description: 'Maximum number of results to return.',
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBaseInfo = getBaseInfo;
|
|
4
|
+
const http_1 = require("../../lib/http");
|
|
5
|
+
async function getBaseInfo(i, returnData) {
|
|
6
|
+
var _a;
|
|
7
|
+
const dataset = this.getNodeParameter('dataset', i);
|
|
8
|
+
const map = {
|
|
9
|
+
pipelines: { path: '/api/pipeline/list/0', method: 'POST' },
|
|
10
|
+
activityTypes: { path: '/api/activity/GetActivityType', method: 'POST' },
|
|
11
|
+
customFields: { path: '/api/customfield/GetCustomfieldList', method: 'POST' },
|
|
12
|
+
productCategories: { path: '/api/product/categories', method: 'POST' },
|
|
13
|
+
};
|
|
14
|
+
const conf = map[dataset];
|
|
15
|
+
if (!conf)
|
|
16
|
+
throw new Error('Unsupported dataset.');
|
|
17
|
+
const resp = await (0, http_1.didarRequest)(this, i, {
|
|
18
|
+
method: conf.method || 'POST',
|
|
19
|
+
path: conf.path,
|
|
20
|
+
body: {}, // these endpoints are POST even if body is empty
|
|
21
|
+
});
|
|
22
|
+
// Always return full payload (no limiting)
|
|
23
|
+
const data = ((_a = resp === null || resp === void 0 ? void 0 : resp.Response) !== null && _a !== void 0 ? _a : resp);
|
|
24
|
+
returnData.push({ json: { dataset, data } });
|
|
25
|
+
return returnData;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBaseInfoProperties = void 0;
|
|
4
|
+
const showForGetBaseInfo = { show: { resource: ['supplementary'], operation: ['getBaseInfo'] } };
|
|
5
|
+
exports.getBaseInfoProperties = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Dataset',
|
|
8
|
+
name: 'dataset',
|
|
9
|
+
type: 'options',
|
|
10
|
+
options: [
|
|
11
|
+
{ name: 'Pipelines', value: 'pipelines' },
|
|
12
|
+
{ name: 'Activity Types', value: 'activityTypes' },
|
|
13
|
+
{ name: 'Custom Fields', value: 'customFields' },
|
|
14
|
+
{ name: 'Product Categories', value: 'productCategories' },
|
|
15
|
+
],
|
|
16
|
+
default: 'pipelines',
|
|
17
|
+
displayOptions: showForGetBaseInfo,
|
|
18
|
+
description: 'Choose which base information to fetch.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBaseInfoProperties = exports.getBaseInfo = void 0;
|
|
4
|
+
var get_base_info_operation_1 = require("./get-base-info.operation");
|
|
5
|
+
Object.defineProperty(exports, "getBaseInfo", { enumerable: true, get: function () { return get_base_info_operation_1.getBaseInfo; } });
|
|
6
|
+
var get_base_info_properties_1 = require("./get-base-info.properties");
|
|
7
|
+
Object.defineProperty(exports, "getBaseInfoProperties", { enumerable: true, get: function () { return get_base_info_properties_1.getBaseInfoProperties; } });
|