n8n-nodes-didar-crm 0.0.19 → 0.0.21
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 +38 -12
- 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/deal/_shared.fields.js +8 -0
- package/dist/nodes/deal/create.operation.js +44 -1
- package/dist/nodes/deal/update.operation.js +41 -1
- 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/didaryab-search.operation.d.ts +2 -0
- package/dist/nodes/supplementary/didaryab-search.operation.js +27 -0
- package/dist/nodes/supplementary/didaryab-search.properties.d.ts +2 -0
- package/dist/nodes/supplementary/didaryab-search.properties.js +32 -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 +6 -0
- package/dist/nodes/supplementary/index.js +16 -0
- package/dist/nodes/supplementary/popup-callerid.operation.d.ts +2 -0
- package/dist/nodes/supplementary/popup-callerid.operation.js +40 -0
- package/dist/nodes/supplementary/popup-callerid.properties.d.ts +2 -0
- package/dist/nodes/supplementary/popup-callerid.properties.js +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.popupCallerId = popupCallerId;
|
|
4
|
+
async function popupCallerId(i, returnData) {
|
|
5
|
+
var _a;
|
|
6
|
+
const callerIdApiKey = this.getNodeParameter('callerIdApiKey', i, '');
|
|
7
|
+
const number = this.getNodeParameter('number', i, '');
|
|
8
|
+
const internal = this.getNodeParameter('internalnumber', i, '');
|
|
9
|
+
if (!callerIdApiKey)
|
|
10
|
+
throw new Error("CallerId's APIKey is required.");
|
|
11
|
+
if (!number)
|
|
12
|
+
throw new Error('Phone Number is required.');
|
|
13
|
+
if (!internal)
|
|
14
|
+
throw new Error('User Extension is required.');
|
|
15
|
+
// Use baseUrl & optional cookie from credentials, but DO NOT use the main apiKey.
|
|
16
|
+
const creds = await this.getCredentials('didarApi');
|
|
17
|
+
const baseUrl = creds.baseUrl;
|
|
18
|
+
const useCookie = creds.useCookie;
|
|
19
|
+
const cookie = creds.cookie;
|
|
20
|
+
const urlBase = (baseUrl || '').replace(/\/+$/, '');
|
|
21
|
+
const url = `${urlBase}/api/calllog/insert`
|
|
22
|
+
+ `?apikey=${encodeURIComponent(callerIdApiKey)}`
|
|
23
|
+
+ `&number=${encodeURIComponent(number)}`
|
|
24
|
+
+ `&internalnumber=${encodeURIComponent(internal)}`;
|
|
25
|
+
const options = {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
url,
|
|
28
|
+
json: true,
|
|
29
|
+
headers: { 'Content-Type': 'application/json' },
|
|
30
|
+
};
|
|
31
|
+
if (useCookie && cookie)
|
|
32
|
+
options.headers.Cookie = cookie;
|
|
33
|
+
const resp = await this.helpers.httpRequest(options);
|
|
34
|
+
const out = ((_a = resp === null || resp === void 0 ? void 0 : resp.Response) !== null && _a !== void 0 ? _a : resp);
|
|
35
|
+
returnData.push({
|
|
36
|
+
// json: { popup_callerid_response: out, query: { apikey: callerIdApiKey, number, internalnumber: internal } },
|
|
37
|
+
json: out,
|
|
38
|
+
});
|
|
39
|
+
return returnData;
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.popupCallerIdProperties = void 0;
|
|
4
|
+
const showForPopupCallerId = { show: { resource: ['supplementary'], operation: ['popupCallerId'] } };
|
|
5
|
+
exports.popupCallerIdProperties = [
|
|
6
|
+
// NEW: dedicated key for Caller ID endpoint
|
|
7
|
+
{
|
|
8
|
+
displayName: "CallerId's APIKey",
|
|
9
|
+
name: 'callerIdApiKey',
|
|
10
|
+
type: 'string',
|
|
11
|
+
default: '',
|
|
12
|
+
required: true,
|
|
13
|
+
displayOptions: showForPopupCallerId,
|
|
14
|
+
description: 'Dedicated API key for the Caller ID popup endpoint (NOT the main Didar API key).',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Phone Number',
|
|
18
|
+
name: 'number',
|
|
19
|
+
type: 'string',
|
|
20
|
+
default: '',
|
|
21
|
+
required: true,
|
|
22
|
+
displayOptions: showForPopupCallerId,
|
|
23
|
+
description: 'Caller phone number to look up.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'User Extension',
|
|
27
|
+
name: 'internalnumber',
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: '',
|
|
30
|
+
required: true,
|
|
31
|
+
displayOptions: showForPopupCallerId,
|
|
32
|
+
description: 'Internal extension number of the user receiving the call.',
|
|
33
|
+
},
|
|
34
|
+
];
|