@weslink/n8n-nodes-kibi-connect 0.1.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 (53) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +38 -0
  3. package/dist/credentials/KibiConnectApi.credentials.d.ts +10 -0
  4. package/dist/credentials/KibiConnectApi.credentials.js +85 -0
  5. package/dist/credentials/KibiConnectApi.credentials.js.map +1 -0
  6. package/dist/icons/kibiConnect.dark.svg +37 -0
  7. package/dist/icons/kibiConnect.svg +37 -0
  8. package/dist/nodes/KibiConnect/KibiConnect.node.d.ts +12 -0
  9. package/dist/nodes/KibiConnect/KibiConnect.node.js +109 -0
  10. package/dist/nodes/KibiConnect/KibiConnect.node.js.map +1 -0
  11. package/dist/nodes/KibiConnect/KibiConnect.node.json +18 -0
  12. package/dist/nodes/KibiConnect/listSearch/getConversations.d.ts +2 -0
  13. package/dist/nodes/KibiConnect/listSearch/getConversations.js +33 -0
  14. package/dist/nodes/KibiConnect/listSearch/getConversations.js.map +1 -0
  15. package/dist/nodes/KibiConnect/listSearch/getUsers.d.ts +2 -0
  16. package/dist/nodes/KibiConnect/listSearch/getUsers.js +26 -0
  17. package/dist/nodes/KibiConnect/listSearch/getUsers.js.map +1 -0
  18. package/dist/nodes/KibiConnect/resources/calendarEvent/index.d.ts +2 -0
  19. package/dist/nodes/KibiConnect/resources/calendarEvent/index.js +236 -0
  20. package/dist/nodes/KibiConnect/resources/calendarEvent/index.js.map +1 -0
  21. package/dist/nodes/KibiConnect/resources/chat/index.d.ts +2 -0
  22. package/dist/nodes/KibiConnect/resources/chat/index.js +221 -0
  23. package/dist/nodes/KibiConnect/resources/chat/index.js.map +1 -0
  24. package/dist/nodes/KibiConnect/resources/notification/index.d.ts +2 -0
  25. package/dist/nodes/KibiConnect/resources/notification/index.js +131 -0
  26. package/dist/nodes/KibiConnect/resources/notification/index.js.map +1 -0
  27. package/dist/nodes/KibiConnect/resources/post/index.d.ts +2 -0
  28. package/dist/nodes/KibiConnect/resources/post/index.js +176 -0
  29. package/dist/nodes/KibiConnect/resources/post/index.js.map +1 -0
  30. package/dist/nodes/KibiConnect/resources/task/index.d.ts +2 -0
  31. package/dist/nodes/KibiConnect/resources/task/index.js +229 -0
  32. package/dist/nodes/KibiConnect/resources/task/index.js.map +1 -0
  33. package/dist/nodes/KibiConnect/resources/user/index.d.ts +2 -0
  34. package/dist/nodes/KibiConnect/resources/user/index.js +91 -0
  35. package/dist/nodes/KibiConnect/resources/user/index.js.map +1 -0
  36. package/dist/nodes/KibiConnect/resources/wiki/index.d.ts +2 -0
  37. package/dist/nodes/KibiConnect/resources/wiki/index.js +167 -0
  38. package/dist/nodes/KibiConnect/resources/wiki/index.js.map +1 -0
  39. package/dist/nodes/KibiConnect/shared/descriptions.d.ts +3 -0
  40. package/dist/nodes/KibiConnect/shared/descriptions.js +52 -0
  41. package/dist/nodes/KibiConnect/shared/descriptions.js.map +1 -0
  42. package/dist/nodes/KibiConnect/shared/errors.d.ts +6 -0
  43. package/dist/nodes/KibiConnect/shared/errors.js +42 -0
  44. package/dist/nodes/KibiConnect/shared/errors.js.map +1 -0
  45. package/dist/nodes/KibiConnect/shared/fields.d.ts +7 -0
  46. package/dist/nodes/KibiConnect/shared/fields.js +120 -0
  47. package/dist/nodes/KibiConnect/shared/fields.js.map +1 -0
  48. package/dist/nodes/KibiConnect/shared/transport.d.ts +13 -0
  49. package/dist/nodes/KibiConnect/shared/transport.js +39 -0
  50. package/dist/nodes/KibiConnect/shared/transport.js.map +1 -0
  51. package/dist/package.json +66 -0
  52. package/dist/tsconfig.tsbuildinfo +1 -0
  53. package/package.json +66 -0
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calendarEventDescription = void 0;
4
+ const descriptions_1 = require("../../shared/descriptions");
5
+ const fields_1 = require("../../shared/fields");
6
+ const R = 'calendarEvent';
7
+ const show = { resource: [R] };
8
+ const writeOps = ['create', 'update', 'upsertByExternalId'];
9
+ exports.calendarEventDescription = [
10
+ {
11
+ displayName: 'Operation',
12
+ name: 'operation',
13
+ type: 'options',
14
+ noDataExpression: true,
15
+ displayOptions: { show },
16
+ options: [
17
+ {
18
+ name: 'Create',
19
+ value: 'create',
20
+ action: 'Create a calendar event',
21
+ description: 'Add an event. Calling this twice creates two events.',
22
+ routing: {
23
+ request: { method: 'POST', url: '/calendar/events' },
24
+ output: { postReceive: descriptions_1.unwrapData },
25
+ },
26
+ },
27
+ {
28
+ name: 'Delete',
29
+ value: 'delete',
30
+ action: 'Delete a calendar event',
31
+ description: 'Remove an event permanently. There is no bin for these.',
32
+ routing: {
33
+ request: { method: 'DELETE', url: '=/calendar/events/{{$parameter.eventId}}' },
34
+ output: { postReceive: descriptions_1.unwrapData },
35
+ },
36
+ },
37
+ {
38
+ name: 'Get',
39
+ value: 'get',
40
+ action: 'Get a calendar event',
41
+ description: 'Read one event',
42
+ routing: {
43
+ request: { method: 'GET', url: '=/calendar/events/{{$parameter.eventId}}' },
44
+ output: { postReceive: descriptions_1.unwrapData },
45
+ },
46
+ },
47
+ {
48
+ name: 'Get Many',
49
+ value: 'getAll',
50
+ action: 'Get many calendar events',
51
+ description: 'Read the events visible to the token owner',
52
+ routing: {
53
+ request: { method: 'GET', url: '/calendar/events' },
54
+ output: { postReceive: descriptions_1.unwrapData },
55
+ },
56
+ },
57
+ {
58
+ name: 'Update',
59
+ value: 'update',
60
+ action: 'Update a calendar event',
61
+ description: 'Change an event the token owner created',
62
+ routing: {
63
+ request: { method: 'PUT', url: '=/calendar/events/{{$parameter.eventId}}' },
64
+ output: { postReceive: descriptions_1.unwrapData },
65
+ },
66
+ },
67
+ {
68
+ name: 'Upsert by External ID',
69
+ value: 'upsertByExternalId',
70
+ action: 'Create or update a calendar event by external ID',
71
+ description: 'Create the event, or update the one already mapped to this ID',
72
+ routing: {
73
+ request: { method: 'PUT', url: '/calendar/events/by-external-id' },
74
+ output: { postReceive: descriptions_1.unwrapData },
75
+ },
76
+ },
77
+ ],
78
+ default: 'upsertByExternalId',
79
+ },
80
+ {
81
+ displayName: 'An event without a Visibility is created as Personal — visible to its creator and invited participants only. A workflow mirroring a team calendar that leaves this alone therefore writes every event into the token owner\'s private calendar and nobody else ever sees them. No error, no warning, just an empty shared calendar. Set General for something everyone should see, or Group together with a Group ID.',
82
+ name: 'visibilityNotice',
83
+ type: 'notice',
84
+ default: '',
85
+ displayOptions: { show: { ...show, operation: ['create', 'upsertByExternalId'] } },
86
+ },
87
+ {
88
+ displayName: 'Only the account that created an event may change it. A sync can update the events it imported itself, never one a person made in Kibi.',
89
+ name: 'ownershipNotice',
90
+ type: 'notice',
91
+ default: '',
92
+ displayOptions: { show: { ...show, operation: ['update', 'upsertByExternalId'] } },
93
+ },
94
+ {
95
+ displayName: 'Deleting an event is final — unlike posts, tasks and wiki pages it has no bin, so its external ID is released immediately and can be reused.',
96
+ name: 'deleteNotice',
97
+ type: 'notice',
98
+ default: '',
99
+ displayOptions: { show: { ...show, operation: ['delete'] } },
100
+ },
101
+ (0, fields_1.ulidField)('Event ID', 'eventId', R, ['get', 'update', 'delete'], 'The event to act on.'),
102
+ (0, fields_1.externalIdField)(R, ['upsertByExternalId']),
103
+ {
104
+ displayName: 'Title',
105
+ name: 'name',
106
+ type: 'string',
107
+ required: true,
108
+ default: '',
109
+ placeholder: 'Sprint review',
110
+ description: 'The event title. Required on every write, updates included — a calendar upsert always carries the full schedule.',
111
+ displayOptions: { show: { ...show, operation: writeOps } },
112
+ routing: { request: { body: { name: '={{ $value }}' } } },
113
+ },
114
+ {
115
+ displayName: 'Date',
116
+ name: 'day',
117
+ type: 'dateTime',
118
+ required: true,
119
+ default: '',
120
+ description: 'The day the event falls on. Required on every write, updates included, just like the title.',
121
+ displayOptions: { show: { ...show, operation: writeOps } },
122
+ routing: {
123
+ request: { body: { day: '={{ new Date($value).toISOString().slice(0, 10) }}' } },
124
+ },
125
+ },
126
+ {
127
+ displayName: 'All Day',
128
+ name: 'fullDay',
129
+ type: 'boolean',
130
+ default: false,
131
+ description: 'Whether the event covers the whole day rather than a time range',
132
+ hint: 'Either this or a Start Time is required — an event with neither is refused.',
133
+ displayOptions: { show: { ...show, operation: writeOps } },
134
+ routing: { request: { body: { full_day: '={{ $value }}' } } },
135
+ },
136
+ {
137
+ displayName: 'Start Time',
138
+ name: 'startTime',
139
+ type: 'string',
140
+ default: '',
141
+ placeholder: '09:30',
142
+ description: 'When the event starts, as HH:MM. Required unless All Day is set.',
143
+ displayOptions: { show: { ...show, operation: writeOps, fullDay: [false] } },
144
+ routing: { request: { body: { start_time: '={{ $value || undefined }}' } } },
145
+ },
146
+ {
147
+ displayName: 'End Time',
148
+ name: 'endTime',
149
+ type: 'string',
150
+ default: '',
151
+ placeholder: '10:30',
152
+ description: 'When the event ends, as HH:MM',
153
+ displayOptions: { show: { ...show, operation: writeOps, fullDay: [false] } },
154
+ routing: { request: { body: { end_time: '={{ $value || undefined }}' } } },
155
+ },
156
+ {
157
+ displayName: 'Visibility',
158
+ name: 'type',
159
+ type: 'options',
160
+ default: 'general',
161
+ description: 'Who can see the event. General means everyone; Personal means the creator and invited participants only; Group restricts it to one group and needs a Group ID.',
162
+ options: [
163
+ { name: 'General', value: 'general', description: 'Everyone in the tenant' },
164
+ { name: 'Group', value: 'group', description: 'One group — set the Group ID as well' },
165
+ { name: 'Personal', value: 'personal', description: 'The creator and invited people only' },
166
+ { name: 'Resource', value: 'resource', description: 'A bookable resource such as a room' },
167
+ ],
168
+ displayOptions: { show: { ...show, operation: writeOps } },
169
+ routing: { request: { body: { type: '={{ $value }}' } } },
170
+ },
171
+ {
172
+ displayName: 'Group ID',
173
+ name: 'groupId',
174
+ type: 'string',
175
+ default: '',
176
+ placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
177
+ description: 'The group the event belongs to. Required when Visibility is Group.',
178
+ displayOptions: { show: { ...show, operation: writeOps, type: ['group'] } },
179
+ routing: { request: { body: { group_id: '={{ $value || undefined }}' } } },
180
+ },
181
+ {
182
+ displayName: 'Description',
183
+ name: 'description',
184
+ type: 'string',
185
+ typeOptions: { rows: 3 },
186
+ default: '',
187
+ description: 'Plain text. Calendar descriptions are not rich text.',
188
+ displayOptions: { show: { ...show, operation: writeOps } },
189
+ routing: { request: { body: { description: '={{ $value || undefined }}' } } },
190
+ },
191
+ {
192
+ displayName: 'Location',
193
+ name: 'location',
194
+ type: 'string',
195
+ default: '',
196
+ placeholder: 'Meeting room 2',
197
+ description: 'Where the event takes place',
198
+ displayOptions: { show: { ...show, operation: writeOps } },
199
+ routing: { request: { body: { location: '={{ $value || undefined }}' } } },
200
+ },
201
+ {
202
+ displayName: 'From Date',
203
+ name: 'startDate',
204
+ type: 'dateTime',
205
+ default: '',
206
+ description: 'Only return events on or after this date',
207
+ displayOptions: { show: { ...show, operation: ['getAll'] } },
208
+ routing: {
209
+ request: { qs: { start_date: '={{ $value ? new Date($value).toISOString().slice(0, 10) : undefined }}' } },
210
+ },
211
+ },
212
+ {
213
+ displayName: 'To Date',
214
+ name: 'endDate',
215
+ type: 'dateTime',
216
+ default: '',
217
+ description: 'Only return events on or before this date',
218
+ displayOptions: { show: { ...show, operation: ['getAll'] } },
219
+ routing: {
220
+ request: { qs: { end_date: '={{ $value ? new Date($value).toISOString().slice(0, 10) : undefined }}' } },
221
+ },
222
+ },
223
+ {
224
+ displayName: 'Filter by External ID',
225
+ name: 'filterExternalId',
226
+ type: 'string',
227
+ default: '',
228
+ description: 'Return only the event mapped to this external ID. The answer stays a list holding one entry or none.',
229
+ displayOptions: { show: { ...show, operation: ['getAll'] } },
230
+ routing: { request: { qs: { external_id: '={{ $value || undefined }}' } } },
231
+ },
232
+ (0, fields_1.conditionalWriteField)(R, ['update', 'upsertByExternalId']),
233
+ ...(0, fields_1.changeScanFields)(R, 'getAll'),
234
+ ...(0, descriptions_1.returnAll)(R, 'getAll'),
235
+ ];
236
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1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AO,EAAE,EAAE;QACX,WAAW,EACV,sGAAsG;QACvG,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC5D,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,EAAE,EAAE;KAC3E;IAED,IAAA,8BAAqB,EAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IAC1D,GAAG,IAAA,yBAAgB,EAAC,CAAC,EAAE,QAAQ,CAAC;IAChC,GAAG,IAAA,wBAAS,EAAC,CAAC,EAAE,QAAQ,CAAC;CACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const chatDescription: INodeProperties[];
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.chatDescription = void 0;
4
+ const descriptions_1 = require("../../shared/descriptions");
5
+ const showOnlyForChat = {
6
+ resource: ['chat'],
7
+ };
8
+ const conversationLocator = {
9
+ displayName: 'Conversation',
10
+ name: 'conversationId',
11
+ type: 'resourceLocator',
12
+ required: true,
13
+ default: { mode: 'list', value: '' },
14
+ description: 'The conversation to act on',
15
+ modes: [
16
+ {
17
+ displayName: 'From List',
18
+ name: 'list',
19
+ type: 'list',
20
+ typeOptions: {
21
+ searchListMethod: 'getConversations',
22
+ searchable: true,
23
+ },
24
+ },
25
+ {
26
+ displayName: 'By ID',
27
+ name: 'id',
28
+ type: 'string',
29
+ hint: 'The conversation ULID, as returned by Get Conversations',
30
+ placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
31
+ validation: [
32
+ {
33
+ type: 'regex',
34
+ properties: {
35
+ regex: '^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$',
36
+ errorMessage: 'A Kibi ID is 26 characters (a ULID) — this does not look like one',
37
+ },
38
+ },
39
+ ],
40
+ },
41
+ ],
42
+ };
43
+ exports.chatDescription = [
44
+ {
45
+ displayName: 'Operation',
46
+ name: 'operation',
47
+ type: 'options',
48
+ noDataExpression: true,
49
+ displayOptions: { show: showOnlyForChat },
50
+ options: [
51
+ {
52
+ name: 'Add Reaction',
53
+ value: 'addReaction',
54
+ action: 'Add a reaction to a message',
55
+ description: 'React to a message with an emoji',
56
+ routing: {
57
+ request: {
58
+ method: 'POST',
59
+ url: '=/chat/messages/{{$parameter.messageId}}/reactions',
60
+ },
61
+ output: { postReceive: descriptions_1.unwrapData },
62
+ },
63
+ },
64
+ {
65
+ name: 'Get Conversations',
66
+ value: 'getConversations',
67
+ action: 'Get many conversations',
68
+ description: 'List the conversations the token owner takes part in',
69
+ routing: {
70
+ request: { method: 'GET', url: '/chat/conversations' },
71
+ output: { postReceive: descriptions_1.unwrapData },
72
+ },
73
+ },
74
+ {
75
+ name: 'Get Messages',
76
+ value: 'getMessages',
77
+ action: 'Get many messages',
78
+ description: 'Read the messages of one conversation',
79
+ routing: {
80
+ request: {
81
+ method: 'GET',
82
+ url: '=/chat/conversations/{{$parameter.conversationId}}/messages',
83
+ },
84
+ output: { postReceive: descriptions_1.unwrapData },
85
+ },
86
+ },
87
+ {
88
+ name: 'Remove Reaction',
89
+ value: 'removeReaction',
90
+ action: 'Remove a reaction from a message',
91
+ description: "Take back a reaction the token owner's account left",
92
+ routing: {
93
+ request: {
94
+ method: 'DELETE',
95
+ url: '=/chat/messages/{{$parameter.messageId}}/reactions/{{encodeURIComponent($parameter.emoji)}}',
96
+ },
97
+ output: { postReceive: descriptions_1.unwrapData },
98
+ },
99
+ },
100
+ {
101
+ name: 'Send Direct Message',
102
+ value: 'sendDirect',
103
+ action: 'Send a direct message',
104
+ description: 'Message one person, opening the conversation if there is none yet',
105
+ routing: {
106
+ request: { method: 'POST', url: '/chat/direct' },
107
+ output: { postReceive: descriptions_1.unwrapData },
108
+ },
109
+ },
110
+ {
111
+ name: 'Send Message',
112
+ value: 'sendMessage',
113
+ action: 'Send a message to a conversation',
114
+ description: 'Post into an existing conversation',
115
+ routing: {
116
+ request: {
117
+ method: 'POST',
118
+ url: '=/chat/conversations/{{$parameter.conversationId}}/messages',
119
+ },
120
+ output: { postReceive: descriptions_1.unwrapData },
121
+ },
122
+ },
123
+ ],
124
+ default: 'sendDirect',
125
+ },
126
+ {
127
+ displayName: 'Messages are sent as the person the API token belongs to — there is no separate bot identity. Recipients see that account\'s name and picture, so a token minted from a personal account will look like that colleague wrote it. Ask an administrator for a dedicated service account if that matters.',
128
+ name: 'senderNotice',
129
+ type: 'notice',
130
+ default: '',
131
+ displayOptions: {
132
+ show: { ...showOnlyForChat, operation: ['sendMessage', 'sendDirect'] },
133
+ },
134
+ },
135
+ {
136
+ ...conversationLocator,
137
+ displayOptions: {
138
+ show: { ...showOnlyForChat, operation: ['getMessages', 'sendMessage'] },
139
+ },
140
+ },
141
+ {
142
+ displayName: 'Recipient',
143
+ name: 'recipientId',
144
+ type: 'resourceLocator',
145
+ required: true,
146
+ default: { mode: 'list', value: '' },
147
+ description: 'Who to message. A conversation is opened if none exists yet.',
148
+ displayOptions: { show: { ...showOnlyForChat, operation: ['sendDirect'] } },
149
+ modes: [
150
+ {
151
+ displayName: 'From List',
152
+ name: 'list',
153
+ type: 'list',
154
+ typeOptions: { searchListMethod: 'getUsers', searchable: true },
155
+ },
156
+ {
157
+ displayName: 'By ID',
158
+ name: 'id',
159
+ type: 'string',
160
+ hint: 'The user ULID from the employee directory',
161
+ placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
162
+ },
163
+ ],
164
+ routing: {
165
+ request: { body: { recipient_id: '={{ $value }}' } },
166
+ },
167
+ },
168
+ {
169
+ displayName: 'Message',
170
+ name: 'body',
171
+ type: 'string',
172
+ required: true,
173
+ default: '',
174
+ typeOptions: { rows: 4 },
175
+ description: 'The message text. Up to 10,000 characters.',
176
+ placeholder: 'The nightly import finished: 412 records, 3 skipped.',
177
+ displayOptions: {
178
+ show: { ...showOnlyForChat, operation: ['sendMessage', 'sendDirect'] },
179
+ },
180
+ routing: {
181
+ request: { body: { body: '={{ $value }}' } },
182
+ },
183
+ },
184
+ {
185
+ displayName: 'Message ID',
186
+ name: 'messageId',
187
+ type: 'string',
188
+ required: true,
189
+ default: '',
190
+ description: 'The numeric ID of the message to react to, as returned by Get Messages',
191
+ hint: 'Reactions address messages by their numeric ID, not by a ULID like everything else',
192
+ displayOptions: {
193
+ show: { ...showOnlyForChat, operation: ['addReaction', 'removeReaction'] },
194
+ },
195
+ },
196
+ {
197
+ displayName: 'Emoji',
198
+ name: 'emoji',
199
+ type: 'string',
200
+ required: true,
201
+ default: '',
202
+ placeholder: '👍',
203
+ description: 'The emoji character itself, not a shortcode such as :thumbsup:',
204
+ displayOptions: {
205
+ show: { ...showOnlyForChat, operation: ['addReaction', 'removeReaction'] },
206
+ },
207
+ routing: {
208
+ send: { type: 'body', property: 'emoji' },
209
+ },
210
+ },
211
+ {
212
+ displayName: 'End-to-end encrypted conversations are readable only by their participants. This node receives an opaque placeholder instead of the text for those, by design — a token cannot be handed the plaintext of a conversation it is not a member of.',
213
+ name: 'e2eNotice',
214
+ type: 'notice',
215
+ default: '',
216
+ displayOptions: { show: { ...showOnlyForChat, operation: ['getMessages'] } },
217
+ },
218
+ ...(0, descriptions_1.returnAll)('chat', 'getConversations'),
219
+ ...(0, descriptions_1.returnAll)('chat', 'getMessages'),
220
+ ];
221
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/KibiConnect/resources/chat/index.ts"],"names":[],"mappings":";;;AAEA,4DAAkE;AAElE,MAAM,eAAe,GAAG;IACvB,QAAQ,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC;AASF,MAAM,mBAAmB,GAAoB;IAC5C,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,iBAAiB;IACvB,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AS,EAAC,MAAM,EAAE,aAAa,CAAC;CACnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const notificationDescription: INodeProperties[];
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.notificationDescription = void 0;
4
+ const descriptions_1 = require("../../shared/descriptions");
5
+ const showOnlyForNotifications = {
6
+ resource: ['notification'],
7
+ };
8
+ exports.notificationDescription = [
9
+ {
10
+ displayName: 'Operation',
11
+ name: 'operation',
12
+ type: 'options',
13
+ noDataExpression: true,
14
+ displayOptions: { show: showOnlyForNotifications },
15
+ options: [
16
+ {
17
+ name: 'Get Many',
18
+ value: 'getAll',
19
+ action: 'Get many notifications',
20
+ description: "Read the token owner's own notifications",
21
+ routing: {
22
+ request: { method: 'GET', url: '/notifications' },
23
+ output: { postReceive: descriptions_1.unwrapData },
24
+ },
25
+ },
26
+ {
27
+ name: 'Mark All as Read',
28
+ value: 'markAllRead',
29
+ action: 'Mark all notifications as read',
30
+ description: "Clear the token owner's whole notification list",
31
+ routing: {
32
+ request: { method: 'PUT', url: '/notifications/read-all' },
33
+ output: { postReceive: descriptions_1.unwrapData },
34
+ },
35
+ },
36
+ {
37
+ name: 'Mark as Read',
38
+ value: 'markRead',
39
+ action: 'Mark a notification as read',
40
+ description: 'Mark one notification as read',
41
+ routing: {
42
+ request: {
43
+ method: 'PUT',
44
+ url: '=/notifications/{{$parameter.notificationId}}/read',
45
+ },
46
+ output: { postReceive: descriptions_1.unwrapData },
47
+ },
48
+ },
49
+ {
50
+ name: 'Send',
51
+ value: 'send',
52
+ action: 'Send a notification',
53
+ description: 'Notify people, respecting their delivery settings',
54
+ routing: {
55
+ request: { method: 'POST', url: '/notifications' },
56
+ output: { postReceive: descriptions_1.unwrapData },
57
+ },
58
+ },
59
+ ],
60
+ default: 'send',
61
+ },
62
+ {
63
+ displayName: 'Kibi decides when and how this reaches people: do-not-disturb, quiet hours and each person\'s own push settings all apply. A notification sent at 23:00 to somebody with quiet hours is not lost, but it does not arrive at 23:00 either. Use Chat instead if you need something to land immediately.',
64
+ name: 'deliveryNotice',
65
+ type: 'notice',
66
+ default: '',
67
+ displayOptions: { show: { ...showOnlyForNotifications, operation: ['send'] } },
68
+ },
69
+ {
70
+ displayName: 'Title',
71
+ name: 'title',
72
+ type: 'string',
73
+ required: true,
74
+ default: '',
75
+ placeholder: 'Nightly import finished',
76
+ description: 'The headline. Shown in the notification list and on the push message.',
77
+ displayOptions: { show: { ...showOnlyForNotifications, operation: ['send'] } },
78
+ routing: { request: { body: { title: '={{ $value }}' } } },
79
+ },
80
+ {
81
+ displayName: 'Message',
82
+ name: 'body',
83
+ type: 'string',
84
+ typeOptions: { rows: 3 },
85
+ required: true,
86
+ default: '',
87
+ placeholder: '412 records imported, 3 skipped.',
88
+ description: 'The notification text',
89
+ displayOptions: { show: { ...showOnlyForNotifications, operation: ['send'] } },
90
+ routing: { request: { body: { body: '={{ $value }}' } } },
91
+ },
92
+ {
93
+ displayName: 'Recipients',
94
+ name: 'recipientIds',
95
+ type: 'string',
96
+ required: true,
97
+ default: '',
98
+ placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC,01J8ZQ2M4XB7Y9C1D3E5F7G9HJ',
99
+ description: 'Who to notify, as a comma-separated list of user IDs. Take them from a Get Many on the User resource rather than typing them.',
100
+ hint: 'One ID per recipient, separated by commas — an expression returning an array works too.',
101
+ displayOptions: { show: { ...showOnlyForNotifications, operation: ['send'] } },
102
+ routing: {
103
+ request: {
104
+ body: {
105
+ recipient_ids: '={{ Array.isArray($value) ? $value : String($value).split(",").map(s => s.trim()).filter(Boolean) }}',
106
+ },
107
+ },
108
+ },
109
+ },
110
+ {
111
+ displayName: 'Link',
112
+ name: 'url',
113
+ type: 'string',
114
+ default: '',
115
+ placeholder: 'https://acme.kibi.de/wiki/01J8ZP9K7QW3X2YB5M4N6R8TVC',
116
+ description: 'Where clicking the notification takes the reader. Optional.',
117
+ displayOptions: { show: { ...showOnlyForNotifications, operation: ['send'] } },
118
+ routing: { request: { body: { url: '={{ $value || undefined }}' } } },
119
+ },
120
+ {
121
+ displayName: 'Notification ID',
122
+ name: 'notificationId',
123
+ type: 'string',
124
+ required: true,
125
+ default: '',
126
+ description: 'The notification to mark as read, as returned by Get Many',
127
+ displayOptions: { show: { ...showOnlyForNotifications, operation: ['markRead'] } },
128
+ },
129
+ ...(0, descriptions_1.returnAll)('notification', 'getAll'),
130
+ ];
131
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/KibiConnect/resources/notification/index.ts"],"names":[],"mappings":";;;AAEA,4DAAkE;AAElE,MAAM,wBAAwB,GAAG;IAChC,QAAQ,EAAE,CAAC,cAAc,CAAC;CAC1B,CAAC;AAEW,QAAA,uBAAuB,GAAsB;IACzD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;QAClD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,wBAAwB;gBAChC,WAAW,EAAE,0CAA0C;gBACvD,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE;oBACjD,MAAM,EAAE,EAAE,WAAW,EAAE,yBAAU,EAAE;iBACnC;aACD;YACD;gBACC,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,gCAAgC;gBACxC,WAAW,EAAE,iDAAiD;gBAC9D,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,yBAAyB,EAAE;oBAC1D,MAAM,EAAE,EAAE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