n8n-nodes-didar-crm 0.0.26 → 0.0.28

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.
@@ -118,7 +118,8 @@ class DidarCrm {
118
118
  { name: 'Create', value: 'create', action: 'Create a person' },
119
119
  { name: 'Update', value: 'update', action: 'Update a person by Id' },
120
120
  { name: 'Get', value: 'get', action: 'Get a person by Id' },
121
- { name: 'Search', value: 'search', action: 'Search persons' }
121
+ { name: 'Search', value: 'search', action: 'Search persons' },
122
+ { name: 'Get by Phone', value: 'getByPhone', action: 'Get a person by Phone' }
122
123
  ],
123
124
  default: 'create',
124
125
  description: 'Select the action to perform on the selected resource.',
@@ -213,6 +214,7 @@ class DidarCrm {
213
214
  ...person_1.personUpdateProperties,
214
215
  ...person_1.personGetProperties,
215
216
  ...person_1.personSearchProperties,
217
+ ...person_1.personGetByPhoneProperties,
216
218
  // Company properties (imported)
217
219
  ...company_1.companyCreateProperties,
218
220
  ...company_1.companyUpdateProperties,
@@ -282,6 +284,10 @@ class DidarCrm {
282
284
  await PersonOps.personSearch.call(this, i, returnData);
283
285
  continue;
284
286
  }
287
+ if (operation === 'getByPhone') {
288
+ await PersonOps.personGetByPhone.call(this, i, returnData);
289
+ continue;
290
+ }
285
291
  }
286
292
  if (resource === 'company') {
287
293
  if (operation === 'create') {
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function personGetByPhone(this: IExecuteFunctions, i: number, returnData: INodeExecutionData[]): Promise<void>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.personGetByPhone = personGetByPhone;
4
+ const http_1 = require("../../lib/http");
5
+ async function personGetByPhone(i, returnData) {
6
+ const mobilePhone = (this.getNodeParameter('MobilePhone', i, '') || '').trim();
7
+ if (!mobilePhone)
8
+ throw new Error('MobilePhone is required.');
9
+ const body = { MobilePhone: mobilePhone };
10
+ const resp = await (0, http_1.didarRequest)(this, i, {
11
+ method: 'POST',
12
+ path: '/api/contact/getbyphonenumber',
13
+ body,
14
+ });
15
+ // خروجی را به همان فرم پاسخ API پاس بده
16
+ returnData.push({ json: resp });
17
+ }
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const personGetByPhoneProperties: INodeProperties[];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.personGetByPhoneProperties = void 0;
4
+ const showForPersonGetByPhone = { show: { resource: ['person'], operation: ['getByPhone'] } };
5
+ exports.personGetByPhoneProperties = [
6
+ {
7
+ displayName: 'Mobile Phone',
8
+ name: 'MobilePhone',
9
+ type: 'string',
10
+ default: '',
11
+ required: true,
12
+ displayOptions: showForPersonGetByPhone,
13
+ description: 'The mobile phone number to look up (exact match).',
14
+ placeholder: 'Enter a mobile phone for lookup (e.g. 0939xxxxxxx)',
15
+ },
16
+ ];
@@ -6,3 +6,5 @@ export { personUpdateProperties } from './update.properties';
6
6
  export { personGetProperties } from './get.properties';
7
7
  export { personSearch } from './search.operation';
8
8
  export { personSearchProperties } from './search.properties';
9
+ export { personGetByPhone } from './getByPhone.operation';
10
+ export { personGetByPhoneProperties } from './getByPhone.properties';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.personSearchProperties = exports.personSearch = exports.personGetProperties = exports.personUpdateProperties = exports.personCreateProperties = exports.personGet = exports.personUpdate = exports.personCreate = void 0;
3
+ exports.personGetByPhoneProperties = exports.personGetByPhone = exports.personSearchProperties = exports.personSearch = exports.personGetProperties = exports.personUpdateProperties = exports.personCreateProperties = exports.personGet = exports.personUpdate = exports.personCreate = void 0;
4
4
  var create_operation_1 = require("./create.operation");
5
5
  Object.defineProperty(exports, "personCreate", { enumerable: true, get: function () { return create_operation_1.personCreate; } });
6
6
  var update_operation_1 = require("./update.operation");
@@ -17,3 +17,7 @@ var search_operation_1 = require("./search.operation");
17
17
  Object.defineProperty(exports, "personSearch", { enumerable: true, get: function () { return search_operation_1.personSearch; } });
18
18
  var search_properties_1 = require("./search.properties");
19
19
  Object.defineProperty(exports, "personSearchProperties", { enumerable: true, get: function () { return search_properties_1.personSearchProperties; } });
20
+ var getByPhone_operation_1 = require("./getByPhone.operation");
21
+ Object.defineProperty(exports, "personGetByPhone", { enumerable: true, get: function () { return getByPhone_operation_1.personGetByPhone; } });
22
+ var getByPhone_properties_1 = require("./getByPhone.properties");
23
+ Object.defineProperty(exports, "personGetByPhoneProperties", { enumerable: true, get: function () { return getByPhone_properties_1.personGetByPhoneProperties; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-didar-crm",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "Didar CRM nodes for n8n (Trigger + Deal.create)",
5
5
  "author": "You",
6
6
  "license": "MIT",