n8n-nodes-didar-crm 0.0.25 → 0.0.27

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.
@@ -70,6 +70,9 @@ class DidarCrm {
70
70
  version: 1,
71
71
  description: 'Actions for Didar CRM',
72
72
  defaults: { name: 'Didar CRM' },
73
+ usableAsTool: true,
74
+ // outputConnectionType: NodeConnectionType.AiTool,
75
+ // aiToolUseAsAiModel: true,
73
76
  inputs: ["main" /* NodeConnectionType.Main */],
74
77
  outputs: ["main" /* NodeConnectionType.Main */],
75
78
  credentials: [{ name: 'didarApi', required: true }],
@@ -115,7 +118,8 @@ class DidarCrm {
115
118
  { name: 'Create', value: 'create', action: 'Create a person' },
116
119
  { name: 'Update', value: 'update', action: 'Update a person by Id' },
117
120
  { name: 'Get', value: 'get', action: 'Get a person by Id' },
118
- { 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' }
119
123
  ],
120
124
  default: 'create',
121
125
  description: 'Select the action to perform on the selected resource.',
@@ -210,6 +214,7 @@ class DidarCrm {
210
214
  ...person_1.personUpdateProperties,
211
215
  ...person_1.personGetProperties,
212
216
  ...person_1.personSearchProperties,
217
+ ...person_1.personGetByPhoneProperties,
213
218
  // Company properties (imported)
214
219
  ...company_1.companyCreateProperties,
215
220
  ...company_1.companyUpdateProperties,
@@ -279,6 +284,10 @@ class DidarCrm {
279
284
  await PersonOps.personSearch.call(this, i, returnData);
280
285
  continue;
281
286
  }
287
+ if (operation === 'getByPhone') {
288
+ await PersonOps.personGetByPhone.call(this, i, returnData);
289
+ continue;
290
+ }
282
291
  }
283
292
  if (resource === 'company') {
284
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: '{{ $fromAI("mobilePhone", "Enter a mobile phone for lookup (e.g. 0939xxxxxxx)", "string") }}',
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.25",
3
+ "version": "0.0.27",
4
4
  "description": "Didar CRM nodes for n8n (Trigger + Deal.create)",
5
5
  "author": "You",
6
6
  "license": "MIT",