n8n-nodes-imobzi 0.3.46 → 0.3.47
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/credentials/ImobziApi.credentials.d.ts +2 -1
- package/dist/credentials/ImobziApi.credentials.js +11 -2
- package/dist/credentials/ImobziApi.credentials.js.map +1 -1
- package/dist/nodes/Imobzi/Imobzi.node.js +381 -119
- package/dist/nodes/Imobzi/Imobzi.node.js.map +1 -1
- package/dist/nodes/ImobziWebhook/ImobziWebhook.node.js +26 -22
- package/dist/nodes/ImobziWebhook/ImobziWebhook.node.js.map +1 -1
- package/dist/nodes/ImobziWebhook/ImobziWebhook.node.json +12 -43
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -3,46 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Imobzi = void 0;
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
5
5
|
const resourceEndpoint = {
|
6
|
-
lead: 'leads',
|
7
|
-
property: 'properties',
|
8
|
-
contact: 'contacts',
|
9
|
-
contrato: 'contracts',
|
10
|
-
financeiro: 'financial/accounts',
|
11
|
-
locacao: 'rentals',
|
12
|
-
documento: 'documents',
|
13
|
-
tarefa: 'tasks',
|
14
|
-
agenda: 'agendas',
|
15
|
-
evento: 'events',
|
16
|
-
integracao: 'integrations',
|
17
|
-
usuario: 'users',
|
18
|
-
account: 'account',
|
6
|
+
lead: 'v1/leads',
|
7
|
+
property: 'v1/properties',
|
8
|
+
contact: 'v1/contacts',
|
9
|
+
contrato: 'v1/contracts',
|
10
|
+
financeiro: 'v1/financial/accounts',
|
11
|
+
locacao: 'v1/rentals',
|
12
|
+
documento: 'v1/documents',
|
13
|
+
tarefa: 'v1/tasks',
|
14
|
+
agenda: 'v1/agendas',
|
15
|
+
evento: 'v1/events',
|
16
|
+
integracao: 'v1/integrations',
|
17
|
+
usuario: 'v1/users',
|
18
|
+
account: 'v1/account',
|
19
19
|
};
|
20
|
-
const createCreateFieldsProperty = (resourceName) =>
|
21
|
-
|
22
|
-
name: 'createFields',
|
23
|
-
type: 'collection',
|
24
|
-
placeholder: 'Add Field',
|
25
|
-
default: {},
|
26
|
-
displayOptions: {
|
27
|
-
show: {
|
28
|
-
resource: [resourceName],
|
29
|
-
operation: ['create'],
|
30
|
-
},
|
31
|
-
},
|
32
|
-
options: [
|
33
|
-
{
|
34
|
-
displayName: 'Date',
|
35
|
-
name: 'date',
|
36
|
-
type: 'string',
|
37
|
-
default: '',
|
38
|
-
description: 'Date of the item',
|
39
|
-
},
|
20
|
+
const createCreateFieldsProperty = (resourceName) => {
|
21
|
+
const baseOptions = [
|
40
22
|
{
|
41
|
-
displayName: '
|
42
|
-
name: '
|
23
|
+
displayName: 'Name',
|
24
|
+
name: 'name',
|
43
25
|
type: 'string',
|
44
26
|
default: '',
|
45
|
-
description: '
|
27
|
+
description: 'Name of the item',
|
46
28
|
},
|
47
29
|
{
|
48
30
|
displayName: 'Email',
|
@@ -52,13 +34,6 @@ const createCreateFieldsProperty = (resourceName) => ({
|
|
52
34
|
default: '',
|
53
35
|
description: 'Email address',
|
54
36
|
},
|
55
|
-
{
|
56
|
-
displayName: 'Name',
|
57
|
-
name: 'name',
|
58
|
-
type: 'string',
|
59
|
-
default: '',
|
60
|
-
description: 'Name of the item',
|
61
|
-
},
|
62
37
|
{
|
63
38
|
displayName: 'Phone',
|
64
39
|
name: 'phone',
|
@@ -67,47 +42,185 @@ const createCreateFieldsProperty = (resourceName) => ({
|
|
67
42
|
description: 'Phone number',
|
68
43
|
},
|
69
44
|
{
|
70
|
-
displayName: '
|
71
|
-
name: '
|
45
|
+
displayName: 'Description',
|
46
|
+
name: 'description',
|
72
47
|
type: 'string',
|
73
48
|
default: '',
|
74
|
-
description: '
|
75
|
-
},
|
76
|
-
{
|
77
|
-
displayName: 'Value',
|
78
|
-
name: 'value',
|
79
|
-
type: 'number',
|
80
|
-
default: 0,
|
81
|
-
description: 'Value of the item',
|
82
|
-
},
|
83
|
-
],
|
84
|
-
});
|
85
|
-
const createUpdateFieldsProperty = (resourceName) => ({
|
86
|
-
displayName: 'Update Fields',
|
87
|
-
name: 'updateFields',
|
88
|
-
type: 'collection',
|
89
|
-
placeholder: 'Add Field',
|
90
|
-
default: {},
|
91
|
-
displayOptions: {
|
92
|
-
show: {
|
93
|
-
resource: [resourceName],
|
94
|
-
operation: ['update'],
|
49
|
+
description: 'Description of the item',
|
95
50
|
},
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
51
|
+
];
|
52
|
+
const resourceSpecificOptions = {
|
53
|
+
lead: [
|
54
|
+
...baseOptions,
|
55
|
+
{
|
56
|
+
displayName: 'Source',
|
57
|
+
name: 'source',
|
58
|
+
type: 'string',
|
59
|
+
default: '',
|
60
|
+
description: 'Lead source',
|
61
|
+
},
|
62
|
+
{
|
63
|
+
displayName: 'Status',
|
64
|
+
name: 'status',
|
65
|
+
type: 'string',
|
66
|
+
default: '',
|
67
|
+
description: 'Lead status',
|
68
|
+
},
|
69
|
+
],
|
70
|
+
property: [
|
71
|
+
{
|
72
|
+
displayName: 'Title',
|
73
|
+
name: 'title',
|
74
|
+
type: 'string',
|
75
|
+
default: '',
|
76
|
+
description: 'Property title',
|
77
|
+
},
|
78
|
+
{
|
79
|
+
displayName: 'Type',
|
80
|
+
name: 'type',
|
81
|
+
type: 'string',
|
82
|
+
default: '',
|
83
|
+
description: 'Property type (house, apartment, etc.)',
|
84
|
+
},
|
85
|
+
{
|
86
|
+
displayName: 'Price',
|
87
|
+
name: 'price',
|
88
|
+
type: 'number',
|
89
|
+
default: 0,
|
90
|
+
description: 'Property price',
|
91
|
+
},
|
92
|
+
{
|
93
|
+
displayName: 'Address',
|
94
|
+
name: 'address',
|
95
|
+
type: 'string',
|
96
|
+
default: '',
|
97
|
+
description: 'Property address',
|
98
|
+
},
|
99
|
+
{
|
100
|
+
displayName: 'City',
|
101
|
+
name: 'city',
|
102
|
+
type: 'string',
|
103
|
+
default: '',
|
104
|
+
description: 'Property city',
|
105
|
+
},
|
106
|
+
{
|
107
|
+
displayName: 'State',
|
108
|
+
name: 'state',
|
109
|
+
type: 'string',
|
110
|
+
default: '',
|
111
|
+
description: 'Property state',
|
112
|
+
},
|
113
|
+
],
|
114
|
+
contact: [
|
115
|
+
...baseOptions,
|
116
|
+
{
|
117
|
+
displayName: 'Company',
|
118
|
+
name: 'company',
|
119
|
+
type: 'string',
|
120
|
+
default: '',
|
121
|
+
description: 'Company name',
|
122
|
+
},
|
123
|
+
],
|
124
|
+
tarefa: [
|
125
|
+
{
|
126
|
+
displayName: 'Title',
|
127
|
+
name: 'title',
|
128
|
+
type: 'string',
|
129
|
+
default: '',
|
130
|
+
description: 'Task title',
|
131
|
+
},
|
132
|
+
{
|
133
|
+
displayName: 'Description',
|
134
|
+
name: 'description',
|
135
|
+
type: 'string',
|
136
|
+
default: '',
|
137
|
+
description: 'Task description',
|
138
|
+
},
|
139
|
+
{
|
140
|
+
displayName: 'Due Date',
|
141
|
+
name: 'dueDate',
|
142
|
+
type: 'string',
|
143
|
+
default: '',
|
144
|
+
description: 'Task due date',
|
145
|
+
},
|
146
|
+
{
|
147
|
+
displayName: 'Priority',
|
148
|
+
name: 'priority',
|
149
|
+
type: 'string',
|
150
|
+
default: '',
|
151
|
+
description: 'Task priority',
|
152
|
+
},
|
153
|
+
],
|
154
|
+
agenda: [
|
155
|
+
{
|
156
|
+
displayName: 'Title',
|
157
|
+
name: 'title',
|
158
|
+
type: 'string',
|
159
|
+
default: '',
|
160
|
+
description: 'Agenda title',
|
161
|
+
},
|
162
|
+
{
|
163
|
+
displayName: 'Description',
|
164
|
+
name: 'description',
|
165
|
+
type: 'string',
|
166
|
+
default: '',
|
167
|
+
description: 'Agenda description',
|
168
|
+
},
|
169
|
+
],
|
170
|
+
evento: [
|
171
|
+
{
|
172
|
+
displayName: 'Title',
|
173
|
+
name: 'title',
|
174
|
+
type: 'string',
|
175
|
+
default: '',
|
176
|
+
description: 'Event title',
|
177
|
+
},
|
178
|
+
{
|
179
|
+
displayName: 'Description',
|
180
|
+
name: 'description',
|
181
|
+
type: 'string',
|
182
|
+
default: '',
|
183
|
+
description: 'Event description',
|
184
|
+
},
|
185
|
+
{
|
186
|
+
displayName: 'Start Date',
|
187
|
+
name: 'startDate',
|
188
|
+
type: 'string',
|
189
|
+
default: '',
|
190
|
+
description: 'Event start date',
|
191
|
+
},
|
192
|
+
{
|
193
|
+
displayName: 'End Date',
|
194
|
+
name: 'endDate',
|
195
|
+
type: 'string',
|
196
|
+
default: '',
|
197
|
+
description: 'Event end date',
|
198
|
+
},
|
199
|
+
],
|
200
|
+
};
|
201
|
+
return {
|
202
|
+
displayName: 'Create Fields',
|
203
|
+
name: 'createFields',
|
204
|
+
type: 'collection',
|
205
|
+
placeholder: 'Add Field',
|
206
|
+
default: {},
|
207
|
+
displayOptions: {
|
208
|
+
show: {
|
209
|
+
resource: [resourceName],
|
210
|
+
operation: ['create'],
|
211
|
+
},
|
104
212
|
},
|
213
|
+
options: resourceSpecificOptions[resourceName] || baseOptions,
|
214
|
+
};
|
215
|
+
};
|
216
|
+
const createUpdateFieldsProperty = (resourceName) => {
|
217
|
+
const baseOptions = [
|
105
218
|
{
|
106
|
-
displayName: '
|
107
|
-
name: '
|
219
|
+
displayName: 'Name',
|
220
|
+
name: 'name',
|
108
221
|
type: 'string',
|
109
222
|
default: '',
|
110
|
-
description: '
|
223
|
+
description: 'Name of the item',
|
111
224
|
},
|
112
225
|
{
|
113
226
|
displayName: 'Email',
|
@@ -117,13 +230,6 @@ const createUpdateFieldsProperty = (resourceName) => ({
|
|
117
230
|
default: '',
|
118
231
|
description: 'Email address',
|
119
232
|
},
|
120
|
-
{
|
121
|
-
displayName: 'Name',
|
122
|
-
name: 'name',
|
123
|
-
type: 'string',
|
124
|
-
default: '',
|
125
|
-
description: 'Name of the item',
|
126
|
-
},
|
127
233
|
{
|
128
234
|
displayName: 'Phone',
|
129
235
|
name: 'phone',
|
@@ -132,34 +238,190 @@ const createUpdateFieldsProperty = (resourceName) => ({
|
|
132
238
|
description: 'Phone number',
|
133
239
|
},
|
134
240
|
{
|
135
|
-
displayName: '
|
136
|
-
name: '
|
241
|
+
displayName: 'Description',
|
242
|
+
name: 'description',
|
137
243
|
type: 'string',
|
138
244
|
default: '',
|
139
|
-
description: '
|
245
|
+
description: 'Description of the item',
|
140
246
|
},
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
247
|
+
];
|
248
|
+
const resourceSpecificOptions = {
|
249
|
+
lead: [
|
250
|
+
...baseOptions,
|
251
|
+
{
|
252
|
+
displayName: 'Source',
|
253
|
+
name: 'source',
|
254
|
+
type: 'string',
|
255
|
+
default: '',
|
256
|
+
description: 'Lead source',
|
257
|
+
},
|
258
|
+
{
|
259
|
+
displayName: 'Status',
|
260
|
+
name: 'status',
|
261
|
+
type: 'string',
|
262
|
+
default: '',
|
263
|
+
description: 'Lead status',
|
264
|
+
},
|
265
|
+
],
|
266
|
+
property: [
|
267
|
+
{
|
268
|
+
displayName: 'Title',
|
269
|
+
name: 'title',
|
270
|
+
type: 'string',
|
271
|
+
default: '',
|
272
|
+
description: 'Property title',
|
273
|
+
},
|
274
|
+
{
|
275
|
+
displayName: 'Type',
|
276
|
+
name: 'type',
|
277
|
+
type: 'string',
|
278
|
+
default: '',
|
279
|
+
description: 'Property type (house, apartment, etc.)',
|
280
|
+
},
|
281
|
+
{
|
282
|
+
displayName: 'Price',
|
283
|
+
name: 'price',
|
284
|
+
type: 'number',
|
285
|
+
default: 0,
|
286
|
+
description: 'Property price',
|
287
|
+
},
|
288
|
+
{
|
289
|
+
displayName: 'Address',
|
290
|
+
name: 'address',
|
291
|
+
type: 'string',
|
292
|
+
default: '',
|
293
|
+
description: 'Property address',
|
294
|
+
},
|
295
|
+
{
|
296
|
+
displayName: 'City',
|
297
|
+
name: 'city',
|
298
|
+
type: 'string',
|
299
|
+
default: '',
|
300
|
+
description: 'Property city',
|
301
|
+
},
|
302
|
+
{
|
303
|
+
displayName: 'State',
|
304
|
+
name: 'state',
|
305
|
+
type: 'string',
|
306
|
+
default: '',
|
307
|
+
description: 'Property state',
|
308
|
+
},
|
309
|
+
],
|
310
|
+
contact: [
|
311
|
+
...baseOptions,
|
312
|
+
{
|
313
|
+
displayName: 'Company',
|
314
|
+
name: 'company',
|
315
|
+
type: 'string',
|
316
|
+
default: '',
|
317
|
+
description: 'Company name',
|
318
|
+
},
|
319
|
+
],
|
320
|
+
tarefa: [
|
321
|
+
{
|
322
|
+
displayName: 'Title',
|
323
|
+
name: 'title',
|
324
|
+
type: 'string',
|
325
|
+
default: '',
|
326
|
+
description: 'Task title',
|
327
|
+
},
|
328
|
+
{
|
329
|
+
displayName: 'Description',
|
330
|
+
name: 'description',
|
331
|
+
type: 'string',
|
332
|
+
default: '',
|
333
|
+
description: 'Task description',
|
334
|
+
},
|
335
|
+
{
|
336
|
+
displayName: 'Due Date',
|
337
|
+
name: 'dueDate',
|
338
|
+
type: 'string',
|
339
|
+
default: '',
|
340
|
+
description: 'Task due date',
|
341
|
+
},
|
342
|
+
{
|
343
|
+
displayName: 'Priority',
|
344
|
+
name: 'priority',
|
345
|
+
type: 'string',
|
346
|
+
default: '',
|
347
|
+
description: 'Task priority',
|
348
|
+
},
|
349
|
+
],
|
350
|
+
agenda: [
|
351
|
+
{
|
352
|
+
displayName: 'Title',
|
353
|
+
name: 'title',
|
354
|
+
type: 'string',
|
355
|
+
default: '',
|
356
|
+
description: 'Agenda title',
|
357
|
+
},
|
358
|
+
{
|
359
|
+
displayName: 'Description',
|
360
|
+
name: 'description',
|
361
|
+
type: 'string',
|
362
|
+
default: '',
|
363
|
+
description: 'Agenda description',
|
364
|
+
},
|
365
|
+
],
|
366
|
+
evento: [
|
367
|
+
{
|
368
|
+
displayName: 'Title',
|
369
|
+
name: 'title',
|
370
|
+
type: 'string',
|
371
|
+
default: '',
|
372
|
+
description: 'Event title',
|
373
|
+
},
|
374
|
+
{
|
375
|
+
displayName: 'Description',
|
376
|
+
name: 'description',
|
377
|
+
type: 'string',
|
378
|
+
default: '',
|
379
|
+
description: 'Event description',
|
380
|
+
},
|
381
|
+
{
|
382
|
+
displayName: 'Start Date',
|
383
|
+
name: 'startDate',
|
384
|
+
type: 'string',
|
385
|
+
default: '',
|
386
|
+
description: 'Event start date',
|
387
|
+
},
|
388
|
+
{
|
389
|
+
displayName: 'End Date',
|
390
|
+
name: 'endDate',
|
391
|
+
type: 'string',
|
392
|
+
default: '',
|
393
|
+
description: 'Event end date',
|
394
|
+
},
|
395
|
+
],
|
396
|
+
};
|
397
|
+
return {
|
398
|
+
displayName: 'Update Fields',
|
399
|
+
name: 'updateFields',
|
400
|
+
type: 'collection',
|
401
|
+
placeholder: 'Add Field',
|
402
|
+
default: {},
|
403
|
+
displayOptions: {
|
404
|
+
show: {
|
405
|
+
resource: [resourceName],
|
406
|
+
operation: ['update'],
|
407
|
+
},
|
147
408
|
},
|
148
|
-
|
149
|
-
}
|
409
|
+
options: resourceSpecificOptions[resourceName] || baseOptions,
|
410
|
+
};
|
411
|
+
};
|
150
412
|
class Imobzi {
|
151
413
|
constructor() {
|
152
414
|
this.methods = {
|
153
415
|
loadOptions: {
|
154
416
|
async getLeads() {
|
155
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/leads' });
|
417
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/leads' });
|
156
418
|
return (response.data || []).map((item) => ({
|
157
419
|
name: item.name || `ID ${item.id}`,
|
158
420
|
value: item.id,
|
159
421
|
}));
|
160
422
|
},
|
161
423
|
async getLeadFields() {
|
162
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/leads', qs: { limit: 1 } });
|
424
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/leads', qs: { limit: 1 } });
|
163
425
|
const item = (response.data || [])[0] || {};
|
164
426
|
return Object.keys(item).map(key => ({
|
165
427
|
name: key,
|
@@ -167,14 +429,14 @@ class Imobzi {
|
|
167
429
|
}));
|
168
430
|
},
|
169
431
|
async getProperties() {
|
170
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/properties' });
|
432
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/properties' });
|
171
433
|
return (response.data || []).map((item) => ({
|
172
434
|
name: item.title || item.titulo || `ID ${item.id}`,
|
173
435
|
value: item.id,
|
174
436
|
}));
|
175
437
|
},
|
176
438
|
async getPropertyFields() {
|
177
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/properties', qs: { limit: 1 } });
|
439
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/properties', qs: { limit: 1 } });
|
178
440
|
const item = (response.data || [])[0] || {};
|
179
441
|
return Object.keys(item).map(key => ({
|
180
442
|
name: key,
|
@@ -182,14 +444,14 @@ class Imobzi {
|
|
182
444
|
}));
|
183
445
|
},
|
184
446
|
async getContacts() {
|
185
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contacts' });
|
447
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/contacts' });
|
186
448
|
return (response.data || []).map((item) => ({
|
187
449
|
name: item.name || `ID ${item.id}`,
|
188
450
|
value: item.id,
|
189
451
|
}));
|
190
452
|
},
|
191
453
|
async getContactFields() {
|
192
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contacts', qs: { limit: 1 } });
|
454
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/contacts', qs: { limit: 1 } });
|
193
455
|
const item = (response.data || [])[0] || {};
|
194
456
|
return Object.keys(item).map(key => ({
|
195
457
|
name: key,
|
@@ -197,14 +459,14 @@ class Imobzi {
|
|
197
459
|
}));
|
198
460
|
},
|
199
461
|
async getContracts() {
|
200
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contracts' });
|
462
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/contracts' });
|
201
463
|
return (response.data || []).map((item) => ({
|
202
464
|
name: item.client || item.cliente || `ID ${item.id}`,
|
203
465
|
value: item.id,
|
204
466
|
}));
|
205
467
|
},
|
206
468
|
async getContractFields() {
|
207
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contracts', qs: { limit: 1 } });
|
469
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/contracts', qs: { limit: 1 } });
|
208
470
|
const item = (response.data || [])[0] || {};
|
209
471
|
return Object.keys(item).map(key => ({
|
210
472
|
name: key,
|
@@ -212,14 +474,14 @@ class Imobzi {
|
|
212
474
|
}));
|
213
475
|
},
|
214
476
|
async getFinancialAccounts() {
|
215
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/financial/accounts' });
|
477
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/financial/accounts' });
|
216
478
|
return (response.data || []).map((item) => ({
|
217
479
|
name: item.description || item.descricao || `ID ${item.id}`,
|
218
480
|
value: item.id,
|
219
481
|
}));
|
220
482
|
},
|
221
483
|
async getFinancialAccountFields() {
|
222
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/financial/accounts', qs: { limit: 1 } });
|
484
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/financial/accounts', qs: { limit: 1 } });
|
223
485
|
const item = (response.data || [])[0] || {};
|
224
486
|
return Object.keys(item).map(key => ({
|
225
487
|
name: key,
|
@@ -227,14 +489,14 @@ class Imobzi {
|
|
227
489
|
}));
|
228
490
|
},
|
229
491
|
async getRentals() {
|
230
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/rentals' });
|
492
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/rentals' });
|
231
493
|
return (response.data || []).map((item) => ({
|
232
494
|
name: item.tenant || item.inquilino || `ID ${item.id}`,
|
233
495
|
value: item.id,
|
234
496
|
}));
|
235
497
|
},
|
236
498
|
async getRentalFields() {
|
237
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/rentals', qs: { limit: 1 } });
|
499
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/rentals', qs: { limit: 1 } });
|
238
500
|
const item = (response.data || [])[0] || {};
|
239
501
|
return Object.keys(item).map(key => ({
|
240
502
|
name: key,
|
@@ -242,14 +504,14 @@ class Imobzi {
|
|
242
504
|
}));
|
243
505
|
},
|
244
506
|
async getDocuments() {
|
245
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/documents' });
|
507
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/documents' });
|
246
508
|
return (response.data || []).map((item) => ({
|
247
509
|
name: item.filename || item.nomeArquivo || `ID ${item.id}`,
|
248
510
|
value: item.id,
|
249
511
|
}));
|
250
512
|
},
|
251
513
|
async getDocumentFields() {
|
252
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/documents', qs: { limit: 1 } });
|
514
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/documents', qs: { limit: 1 } });
|
253
515
|
const item = (response.data || [])[0] || {};
|
254
516
|
return Object.keys(item).map(key => ({
|
255
517
|
name: key,
|
@@ -257,14 +519,14 @@ class Imobzi {
|
|
257
519
|
}));
|
258
520
|
},
|
259
521
|
async getTasks() {
|
260
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/tasks' });
|
522
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/tasks' });
|
261
523
|
return (response.data || []).map((item) => ({
|
262
524
|
name: item.title || item.titulo || `ID ${item.id}`,
|
263
525
|
value: item.id,
|
264
526
|
}));
|
265
527
|
},
|
266
528
|
async getTaskFields() {
|
267
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/tasks', qs: { limit: 1 } });
|
529
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/tasks', qs: { limit: 1 } });
|
268
530
|
const item = (response.data || [])[0] || {};
|
269
531
|
return Object.keys(item).map(key => ({
|
270
532
|
name: key,
|
@@ -272,14 +534,14 @@ class Imobzi {
|
|
272
534
|
}));
|
273
535
|
},
|
274
536
|
async getAgendas() {
|
275
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/agendas' });
|
537
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/agendas' });
|
276
538
|
return (response.data || []).map((item) => ({
|
277
539
|
name: item.title || item.titulo || `ID ${item.id}`,
|
278
540
|
value: item.id,
|
279
541
|
}));
|
280
542
|
},
|
281
543
|
async getAgendaFields() {
|
282
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/agendas', qs: { limit: 1 } });
|
544
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/agendas', qs: { limit: 1 } });
|
283
545
|
const item = (response.data || [])[0] || {};
|
284
546
|
return Object.keys(item).map(key => ({
|
285
547
|
name: key,
|
@@ -287,14 +549,14 @@ class Imobzi {
|
|
287
549
|
}));
|
288
550
|
},
|
289
551
|
async getEvents() {
|
290
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/events' });
|
552
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/events' });
|
291
553
|
return (response.data || []).map((item) => ({
|
292
554
|
name: item.title || item.titulo || `ID ${item.id}`,
|
293
555
|
value: item.id,
|
294
556
|
}));
|
295
557
|
},
|
296
558
|
async getEventFields() {
|
297
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/events', qs: { limit: 1 } });
|
559
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/events', qs: { limit: 1 } });
|
298
560
|
const item = (response.data || [])[0] || {};
|
299
561
|
return Object.keys(item).map(key => ({
|
300
562
|
name: key,
|
@@ -302,14 +564,14 @@ class Imobzi {
|
|
302
564
|
}));
|
303
565
|
},
|
304
566
|
async getIntegrations() {
|
305
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/integrations' });
|
567
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/integrations' });
|
306
568
|
return (response.data || []).map((item) => ({
|
307
569
|
name: item.name || item.nome || `ID ${item.id}`,
|
308
570
|
value: item.id,
|
309
571
|
}));
|
310
572
|
},
|
311
573
|
async getIntegrationFields() {
|
312
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/integrations', qs: { limit: 1 } });
|
574
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/integrations', qs: { limit: 1 } });
|
313
575
|
const item = (response.data || [])[0] || {};
|
314
576
|
return Object.keys(item).map(key => ({
|
315
577
|
name: key,
|
@@ -317,14 +579,14 @@ class Imobzi {
|
|
317
579
|
}));
|
318
580
|
},
|
319
581
|
async getUsers() {
|
320
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/users' });
|
582
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/users' });
|
321
583
|
return (response.data || []).map((item) => ({
|
322
584
|
name: item.name || item.nome || `ID ${item.id}`,
|
323
585
|
value: item.id,
|
324
586
|
}));
|
325
587
|
},
|
326
588
|
async getUserFields() {
|
327
|
-
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/users', qs: { limit: 1 } });
|
589
|
+
const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/v1/users', qs: { limit: 1 } });
|
328
590
|
const item = (response.data || [])[0] || {};
|
329
591
|
return Object.keys(item).map(key => ({
|
330
592
|
name: key,
|