n8n-nodes-pragma-bitrix24 1.0.0

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.
Files changed (51) hide show
  1. package/LICENSE +51 -0
  2. package/README.md +340 -0
  3. package/dist/credentials/Bitrix24Api.credentials.js +55 -0
  4. package/dist/nodes/Bitrix24/Bitrix24.node.js +1410 -0
  5. package/dist/nodes/Bitrix24/Company.js +17 -0
  6. package/dist/nodes/Bitrix24/Contact.js +31 -0
  7. package/dist/nodes/Bitrix24/Deal.js +17 -0
  8. package/dist/nodes/Bitrix24/Helpers.js +300 -0
  9. package/dist/nodes/Bitrix24/Lead.js +17 -0
  10. package/dist/nodes/Bitrix24/SmartProcess.js +1 -0
  11. package/dist/nodes/Bitrix24/bitrix24.svg +7 -0
  12. package/dist/nodes/Bitrix24/types.js +58 -0
  13. package/dist/nodes/Bitrix24AI/Bitrix24AI.node.js +205 -0
  14. package/dist/nodes/Bitrix24App/Bitrix24App.node.js +179 -0
  15. package/dist/nodes/Bitrix24Auxiliary/Bitrix24Auxiliary.node.js +566 -0
  16. package/dist/nodes/Bitrix24Booking/Bitrix24Booking.node.js +871 -0
  17. package/dist/nodes/Bitrix24Calendar/Bitrix24Calendar.node.js +471 -0
  18. package/dist/nodes/Bitrix24ChatBot/Bitrix24ChatBot.node.js +522 -0
  19. package/dist/nodes/Bitrix24Commerce/Bitrix24Commerce.node.js +431 -0
  20. package/dist/nodes/Bitrix24Department/Bitrix24Department.node.js +317 -0
  21. package/dist/nodes/Bitrix24Disk/Bitrix24Disk.node.js +334 -0
  22. package/dist/nodes/Bitrix24Document/Bitrix24Document.node.js +280 -0
  23. package/dist/nodes/Bitrix24Entity/Bitrix24Entity.node.js +263 -0
  24. package/dist/nodes/Bitrix24Group/Bitrix24Group.node.js +327 -0
  25. package/dist/nodes/Bitrix24Lists/Bitrix24Lists.node.js +406 -0
  26. package/dist/nodes/Bitrix24Log/Bitrix24Log.node.js +309 -0
  27. package/dist/nodes/Bitrix24Mail/Bitrix24Mail.node.js +109 -0
  28. package/dist/nodes/Bitrix24MessageService/Bitrix24MessageService.node.js +218 -0
  29. package/dist/nodes/Bitrix24OpenChannels/Bitrix24OpenChannels.node.js +379 -0
  30. package/dist/nodes/Bitrix24PaySystem/Bitrix24PaySystem.node.js +241 -0
  31. package/dist/nodes/Bitrix24Pipeline/Bitrix24Pipeline.node.js +553 -0
  32. package/dist/nodes/Bitrix24Pipeline/bitrix24.svg +7 -0
  33. package/dist/nodes/Bitrix24Sale/Bitrix24Sale.node.js +391 -0
  34. package/dist/nodes/Bitrix24Scrum/Bitrix24Scrum.node.js +555 -0
  35. package/dist/nodes/Bitrix24Scrum/bitrix24.svg +7 -0
  36. package/dist/nodes/Bitrix24Sign/Bitrix24Sign.node.js +132 -0
  37. package/dist/nodes/Bitrix24Social/Bitrix24Social.node.js +224 -0
  38. package/dist/nodes/Bitrix24Task/Bitrix24Task.node.js +444 -0
  39. package/dist/nodes/Bitrix24Telephony/Bitrix24Telephony.node.js +511 -0
  40. package/dist/nodes/Bitrix24Timeman/Bitrix24Timeman.node.js +196 -0
  41. package/dist/nodes/Bitrix24Tool/Bitrix24Tool.node.js +1035 -0
  42. package/dist/nodes/Bitrix24Tool/bitrix24.svg +7 -0
  43. package/dist/nodes/Bitrix24Trigger/Bitrix24Trigger.node.js +184 -0
  44. package/dist/nodes/Bitrix24User/Bitrix24User.node.js +351 -0
  45. package/dist/nodes/Bitrix24UserField/Bitrix24UserField.node.js +386 -0
  46. package/dist/nodes/Bitrix24UserField/bitrix24.svg +7 -0
  47. package/dist/nodes/shared/bitrix24.svg +7 -0
  48. package/dist/nodes/shared/localization.js +189 -0
  49. package/dist/nodes/shared/types.js +22 -0
  50. package/index.js +10 -0
  51. package/package.json +108 -0
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ /**
3
+ * Bitrix24 Timeman — Нода учёта рабочего времени
4
+ *
5
+ * Bitrix24 PRAGMA.by nodes for n8n
6
+ * Профессиональная интеграция с Битрикс24.
7
+ *
8
+ * @author PRAGMA & Азбука Решений
9
+ * @copyright 2026 PRAGMA (https://pragma.by/) & Азбука Решений (https://abc-solution.ru/)
10
+ *
11
+ * Контакты:
12
+ * 🇧🇾 PRAGMA: +375 (44) 702-70-90 | https://pragma.by/
13
+ * 🇷🇺 Азбука Решений: +7 (939) 555-19-60 | https://abc-solution.ru/
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Bitrix24Timeman = void 0;
17
+ const Helpers_1 = require("../Bitrix24/Helpers");
18
+ class Bitrix24Timeman {
19
+ constructor() {
20
+ this.description = {
21
+ displayName: 'Bitrix24 Учёт времени',
22
+ name: 'bitrix24Timeman',
23
+ icon: 'file:bitrix24.svg',
24
+ group: ['transform'],
25
+ version: 1,
26
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
27
+ description: 'Учёт рабочего времени: начало/конец дня, отчёты',
28
+ defaults: {
29
+ name: 'Bitrix24 Учёт времени',
30
+ },
31
+ inputs: ['main'],
32
+ outputs: ['main'],
33
+ credentials: [
34
+ {
35
+ name: 'bitrix24Api',
36
+ required: true,
37
+ },
38
+ ],
39
+ properties: [
40
+ {
41
+ displayName: 'Resource',
42
+ name: 'resource',
43
+ type: 'options',
44
+ noDataExpression: true,
45
+ options: [
46
+ {
47
+ name: 'Workday',
48
+ value: 'workday',
49
+ description: 'Manage working day status',
50
+ },
51
+ {
52
+ name: 'Report',
53
+ value: 'report',
54
+ description: 'Get daily reports',
55
+ },
56
+ ],
57
+ default: 'workday',
58
+ required: true,
59
+ },
60
+ {
61
+ displayName: 'Operation',
62
+ name: 'operation',
63
+ type: 'options',
64
+ noDataExpression: true,
65
+ options: [
66
+ // Workday
67
+ {
68
+ name: 'Status',
69
+ value: 'status',
70
+ action: 'Get current status (Open/Closed)',
71
+ displayOptions: { show: { resource: ['workday'] } },
72
+ },
73
+ {
74
+ name: 'Start',
75
+ value: 'open',
76
+ action: 'Start working day',
77
+ displayOptions: { show: { resource: ['workday'] } },
78
+ },
79
+ {
80
+ name: 'Pause',
81
+ value: 'pause',
82
+ action: 'Pause working day',
83
+ displayOptions: { show: { resource: ['workday'] } },
84
+ },
85
+ {
86
+ name: 'Finish',
87
+ value: 'close',
88
+ action: 'Finish working day',
89
+ displayOptions: { show: { resource: ['workday'] } },
90
+ },
91
+ // Report
92
+ {
93
+ name: 'Get',
94
+ value: 'get',
95
+ action: 'Get user reports',
96
+ displayOptions: { show: { resource: ['report'] } },
97
+ },
98
+ ],
99
+ default: 'status',
100
+ required: true,
101
+ },
102
+ // ----------------------------------
103
+ // Fields
104
+ // ----------------------------------
105
+ {
106
+ displayName: 'User ID',
107
+ name: 'userId',
108
+ type: 'string',
109
+ default: '',
110
+ displayOptions: { show: { resource: ['workday', 'report'], operation: ['status', 'get'] } }, // Status can check other user? Usually self. timeman.status sometimes allows userId. But main methods are self.
111
+ // timeman.status -> gets status of CURRENT user (token owner) or specified user if admin?
112
+ // Docs say timeman.status is for current user usually.
113
+ // However, timeman.report.get allows filter by user.
114
+ description: 'User ID (Leave empty for current user token)',
115
+ },
116
+ {
117
+ displayName: 'Report Reason',
118
+ name: 'report',
119
+ type: 'string',
120
+ default: '',
121
+ displayOptions: { show: { resource: ['workday'], operation: ['close'] } },
122
+ description: 'Reason or summary for closing the day',
123
+ },
124
+ {
125
+ displayName: 'Time (HH:MM)',
126
+ name: 'time',
127
+ type: 'string', // Bitrix might accept timestamp or string
128
+ default: '',
129
+ displayOptions: { show: { resource: ['workday'], operation: ['open', 'close'] } },
130
+ description: 'Explicit time to set (Optional)',
131
+ },
132
+ {
133
+ displayName: 'Month (YYYY-MM)',
134
+ name: 'month',
135
+ type: 'string',
136
+ default: '',
137
+ displayOptions: { show: { resource: ['report'], operation: ['get'] } },
138
+ description: 'Filter by month (e.g. 2026-01)',
139
+ },
140
+ ],
141
+ };
142
+ }
143
+ async execute() {
144
+ const items = this.getInputData();
145
+ const returnData = [];
146
+ const resource = this.getNodeParameter('resource', 0);
147
+ const operation = this.getNodeParameter('operation', 0);
148
+ for (let i = 0; i < items.length; i++) {
149
+ try {
150
+ let endpoint = '';
151
+ let body = {};
152
+ if (resource === 'workday') {
153
+ endpoint = `timeman.${operation}`; // timeman.status, timeman.open, timeman.close, timeman.pause
154
+ const userId = this.getNodeParameter('userId', i, '');
155
+ if (userId)
156
+ body.USER_ID = userId;
157
+ if (operation === 'close') {
158
+ const report = this.getNodeParameter('report', i, '');
159
+ if (report)
160
+ body.REPORT = report;
161
+ }
162
+ const time = this.getNodeParameter('time', i, '');
163
+ if (time)
164
+ body.TIME = time; // Check API if it supports TIME param. Some methods allow overriding time.
165
+ }
166
+ else if (resource === 'report') {
167
+ if (operation === 'get') {
168
+ endpoint = 'timeman.report.get'; // timeman.report.get usually returns daily reports list
169
+ const month = this.getNodeParameter('month', i, '');
170
+ // API expects REPORT_DATE usually? or just defaults to current month.
171
+ // Docs are sparse. Passing basic filters.
172
+ // If month provided (2026-01), maybe parse?
173
+ // For V21, basic call.
174
+ }
175
+ }
176
+ const response = await Helpers_1.bitrixRequestWithRetry.call(this, 'POST', endpoint, body);
177
+ let result = response.result;
178
+ if (Array.isArray(result)) {
179
+ result.forEach((item) => returnData.push({ json: item, pairedItem: { item: i } }));
180
+ }
181
+ else {
182
+ returnData.push({ json: result, pairedItem: { item: i } });
183
+ }
184
+ }
185
+ catch (error) {
186
+ if (this.continueOnFail()) {
187
+ returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
188
+ continue;
189
+ }
190
+ throw error;
191
+ }
192
+ }
193
+ return [returnData];
194
+ }
195
+ }
196
+ exports.Bitrix24Timeman = Bitrix24Timeman;