n8n-nodes-didar-crm 0.0.29 → 0.0.30
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.
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.caseSearch = caseSearch;
|
|
4
4
|
const http_1 = require("../../lib/http");
|
|
5
5
|
async function caseSearch(i, returnData) {
|
|
6
|
-
var _a, _b, _c;
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
7
|
// Helpers
|
|
8
8
|
const uniq = (arr) => Array.from(new Set(arr.map(s => s.trim()).filter(Boolean)));
|
|
9
9
|
const parseIdList = (input) => {
|
|
@@ -126,6 +126,7 @@ async function caseSearch(i, returnData) {
|
|
|
126
126
|
const searchFromTime = (_a = add.SearchFromTime) !== null && _a !== void 0 ? _a : '1000-01-01T00:00:00.000Z';
|
|
127
127
|
const searchToTime = (_b = add.SearchToTime) !== null && _b !== void 0 ? _b : '9999-12-01T00:00:00.000Z';
|
|
128
128
|
const customFields = parseJsonFlexible(add.CustomFields);
|
|
129
|
+
const dealId = (_c = add.DealId) !== null && _c !== void 0 ? _c : '00000000-0000-0000-0000-000000000000';
|
|
129
130
|
const limit = typeof add.Limit === 'number' ? add.Limit : 10;
|
|
130
131
|
const from = 0;
|
|
131
132
|
// Build Criteria with only provided filters
|
|
@@ -138,6 +139,9 @@ async function caseSearch(i, returnData) {
|
|
|
138
139
|
criteria['Keywords'] = keywords;
|
|
139
140
|
if (ownerId)
|
|
140
141
|
criteria['OwnerId'] = ownerId;
|
|
142
|
+
if (dealId && dealId !== '00000000-0000-0000-0000-000000000000' && dealId.trim()) {
|
|
143
|
+
criteria['DealId'] = dealId.trim();
|
|
144
|
+
}
|
|
141
145
|
if (contactIds.length)
|
|
142
146
|
criteria['ContactIds'] = contactIds;
|
|
143
147
|
if (customFields === null || customFields === void 0 ? void 0 : customFields.length)
|
|
@@ -149,7 +153,7 @@ async function caseSearch(i, returnData) {
|
|
|
149
153
|
path: '/api/Case/search',
|
|
150
154
|
body,
|
|
151
155
|
});
|
|
152
|
-
const out = ((
|
|
156
|
+
const out = ((_d = resp === null || resp === void 0 ? void 0 : resp.Response) !== null && _d !== void 0 ? _d : resp);
|
|
153
157
|
// Return with criteria for debugging
|
|
154
158
|
returnData.push({ json: { search_respons: out, criteria: body } });
|
|
155
159
|
return returnData;
|
|
@@ -81,6 +81,13 @@ exports.caseSearchProperties = [
|
|
|
81
81
|
default: '[]',
|
|
82
82
|
description: 'JSON array of custom field filters (optional).',
|
|
83
83
|
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Deal ID',
|
|
86
|
+
name: 'DealId',
|
|
87
|
+
type: 'string',
|
|
88
|
+
default: '00000000-0000-0000-0000-000000000000',
|
|
89
|
+
description: 'Deal ID to filter cases (optional). Default is empty GUID.',
|
|
90
|
+
},
|
|
84
91
|
{
|
|
85
92
|
displayName: 'Limit',
|
|
86
93
|
name: 'Limit',
|