@weslink/n8n-nodes-kibi-connect 0.1.2 → 1.0.1

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 (79) hide show
  1. package/README.md +250 -18
  2. package/dist/nodes/KibiConnect/KibiConnect.node.d.ts +6 -0
  3. package/dist/nodes/KibiConnect/KibiConnect.node.js +89 -1
  4. package/dist/nodes/KibiConnect/KibiConnect.node.js.map +1 -1
  5. package/dist/nodes/KibiConnect/loadOptions/getAbsenceTypes.d.ts +2 -0
  6. package/dist/nodes/KibiConnect/loadOptions/getAbsenceTypes.js +13 -0
  7. package/dist/nodes/KibiConnect/loadOptions/getAbsenceTypes.js.map +1 -0
  8. package/dist/nodes/KibiConnect/loadOptions/getGroupTypes.d.ts +2 -0
  9. package/dist/nodes/KibiConnect/loadOptions/getGroupTypes.js +13 -0
  10. package/dist/nodes/KibiConnect/loadOptions/getGroupTypes.js.map +1 -0
  11. package/dist/nodes/KibiConnect/resources/callLink/index.d.ts +2 -0
  12. package/dist/nodes/KibiConnect/resources/callLink/index.js +279 -0
  13. package/dist/nodes/KibiConnect/resources/callLink/index.js.map +1 -0
  14. package/dist/nodes/KibiConnect/resources/document/index.d.ts +2 -0
  15. package/dist/nodes/KibiConnect/resources/document/index.js +238 -0
  16. package/dist/nodes/KibiConnect/resources/document/index.js.map +1 -0
  17. package/dist/nodes/KibiConnect/resources/file/index.d.ts +2 -0
  18. package/dist/nodes/KibiConnect/resources/file/index.js +616 -0
  19. package/dist/nodes/KibiConnect/resources/file/index.js.map +1 -0
  20. package/dist/nodes/KibiConnect/resources/file/shared.d.ts +3 -0
  21. package/dist/nodes/KibiConnect/resources/file/shared.js +87 -0
  22. package/dist/nodes/KibiConnect/resources/file/shared.js.map +1 -0
  23. package/dist/nodes/KibiConnect/resources/folder/index.d.ts +2 -0
  24. package/dist/nodes/KibiConnect/resources/folder/index.js +278 -0
  25. package/dist/nodes/KibiConnect/resources/folder/index.js.map +1 -0
  26. package/dist/nodes/KibiConnect/resources/group/index.d.ts +2 -0
  27. package/dist/nodes/KibiConnect/resources/group/index.js +227 -0
  28. package/dist/nodes/KibiConnect/resources/group/index.js.map +1 -0
  29. package/dist/nodes/KibiConnect/resources/media/index.d.ts +2 -0
  30. package/dist/nodes/KibiConnect/resources/media/index.js +56 -0
  31. package/dist/nodes/KibiConnect/resources/media/index.js.map +1 -0
  32. package/dist/nodes/KibiConnect/resources/search/index.d.ts +2 -0
  33. package/dist/nodes/KibiConnect/resources/search/index.js +65 -0
  34. package/dist/nodes/KibiConnect/resources/search/index.js.map +1 -0
  35. package/dist/nodes/KibiConnect/resources/shareLink/index.d.ts +2 -0
  36. package/dist/nodes/KibiConnect/resources/shareLink/index.js +228 -0
  37. package/dist/nodes/KibiConnect/resources/shareLink/index.js.map +1 -0
  38. package/dist/nodes/KibiConnect/resources/sharedWiki/index.d.ts +2 -0
  39. package/dist/nodes/KibiConnect/resources/sharedWiki/index.js +66 -0
  40. package/dist/nodes/KibiConnect/resources/sharedWiki/index.js.map +1 -0
  41. package/dist/nodes/KibiConnect/resources/survey/index.d.ts +2 -0
  42. package/dist/nodes/KibiConnect/resources/survey/index.js +49 -0
  43. package/dist/nodes/KibiConnect/resources/survey/index.js.map +1 -0
  44. package/dist/nodes/KibiConnect/resources/timeTracking/index.d.ts +2 -0
  45. package/dist/nodes/KibiConnect/resources/timeTracking/index.js +642 -0
  46. package/dist/nodes/KibiConnect/resources/timeTracking/index.js.map +1 -0
  47. package/dist/nodes/KibiConnect/shared/binary.d.ts +4 -0
  48. package/dist/nodes/KibiConnect/shared/binary.js +57 -0
  49. package/dist/nodes/KibiConnect/shared/binary.js.map +1 -0
  50. package/dist/nodes/KibiConnect/shared/descriptions.d.ts +3 -0
  51. package/dist/nodes/KibiConnect/shared/descriptions.js +17 -16
  52. package/dist/nodes/KibiConnect/shared/descriptions.js.map +1 -1
  53. package/dist/nodes/KibiConnect/shared/fields.js +3 -3
  54. package/dist/nodes/KibiConnect/shared/fields.js.map +1 -1
  55. package/dist/nodes/KibiConnect/shared/routing.d.ts +2 -0
  56. package/dist/nodes/KibiConnect/shared/routing.js +47 -0
  57. package/dist/nodes/KibiConnect/shared/routing.js.map +1 -0
  58. package/dist/nodes/KibiConnect/shared/transport.d.ts +8 -1
  59. package/dist/nodes/KibiConnect/shared/transport.js +72 -14
  60. package/dist/nodes/KibiConnect/shared/transport.js.map +1 -1
  61. package/dist/nodes/KibiConnectTrigger/KibiConnectTrigger.node.d.ts +18 -0
  62. package/dist/nodes/KibiConnectTrigger/KibiConnectTrigger.node.js +237 -0
  63. package/dist/nodes/KibiConnectTrigger/KibiConnectTrigger.node.js.map +1 -0
  64. package/dist/nodes/KibiConnectTrigger/KibiConnectTrigger.node.json +18 -0
  65. package/dist/nodes/KibiConnectTrigger/filter.d.ts +8 -0
  66. package/dist/nodes/KibiConnectTrigger/filter.js +15 -0
  67. package/dist/nodes/KibiConnectTrigger/filter.js.map +1 -0
  68. package/dist/nodes/KibiConnectTrigger/loadOptions/getWebhookEvents.d.ts +4 -0
  69. package/dist/nodes/KibiConnectTrigger/loadOptions/getWebhookEvents.js +42 -0
  70. package/dist/nodes/KibiConnectTrigger/loadOptions/getWebhookEvents.js.map +1 -0
  71. package/dist/nodes/KibiConnectTrigger/registration.d.ts +4 -0
  72. package/dist/nodes/KibiConnectTrigger/registration.js +31 -0
  73. package/dist/nodes/KibiConnectTrigger/registration.js.map +1 -0
  74. package/dist/nodes/KibiConnectTrigger/verify.d.ts +1 -0
  75. package/dist/nodes/KibiConnectTrigger/verify.js +27 -0
  76. package/dist/nodes/KibiConnectTrigger/verify.js.map +1 -0
  77. package/dist/package.json +6 -4
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +6 -4
package/README.md CHANGED
@@ -1,37 +1,269 @@
1
- # @weslink/n8n-nodes-kibi-connect
1
+ # Kibi Connect for n8n
2
2
 
3
- An [n8n](https://n8n.io) community node for [Kibi Connect](https://kibi.de) — the European
4
- workplace collaboration platform, made in Germany. Chat, feed, wiki, tasks, calendar, files
5
- and time tracking, with data kept in the EU.
3
+ `@weslink/n8n-nodes-kibi-connect` — an [n8n](https://n8n.io) community node package for
4
+ [Kibi Connect](https://kibi-connect.eu).
6
5
 
7
- > **Early release.** The package currently ships the credential and the resources
8
- > Calendar Event, Chat, Notification, Post, Task, User and Wiki. Documents, time
9
- > tracking and the webhook trigger are being added.
6
+ Kibi Connect is a workplace collaboration platform for companies whose people are mostly not
7
+ at a desk: production, logistics, care, trades, retail. Chat, feed, wiki, tasks, calendar,
8
+ groups, files and documents, time tracking and video calls live in one platform, hosted in the
9
+ EU. This package lets n8n read from and write to a Kibi Connect tenant, and start workflows
10
+ when something happens there.
11
+
12
+ ## What is in the package
13
+
14
+ **Kibi Connect** — the action node. 18 resources, 129 operations, one per endpoint of the
15
+ REST API. Every list operation offers *Return All* with automatic paging, every ID field
16
+ validates the 26-character Kibi ID before a request goes out, and the pickers for people,
17
+ conversations, group types and absence types load their options from your tenant.
18
+
19
+ | Resource | What it covers |
20
+ |---|---|
21
+ | Calendar Event | Create, read, update and delete events; upsert by external ID |
22
+ | Call Link | Meeting links that guests open without a Kibi account; create, reschedule, deactivate |
23
+ | Chat | Send messages to a conversation or directly to a person, read messages, react |
24
+ | Document | The document management system: upload, download, list with filters, fulltext search, inbox, folder structure |
25
+ | File | The file manager: upload, download, versions, search, star, trash and restore, share links, PDF conversion |
26
+ | Folder | Folders of the file manager: create, update, tree, items, share links |
27
+ | Group | Teams, departments and projects with their posts, members, files and folders; create and map to an external ID |
28
+ | Media | Upload images for wiki pages |
29
+ | Notification | Send notifications through Kibi's own delivery rules, read and mark them |
30
+ | Post | News and announcements in the feed; upsert by external ID |
31
+ | Search | Search posts, wiki pages and people in one call |
32
+ | Share Link | Public links to files and folders: send, update, revoke, read the access log |
33
+ | Shared Wiki | Wiki subtrees published for the outside world, including their images |
34
+ | Survey | Published surveys and their answer options (read-only) |
35
+ | Task | Work items on a board; upsert by external ID |
36
+ | Time Tracking | Clock in and out, time entries, absences, balances, absence types, work schedules |
37
+ | User | The employee directory (no private data) |
38
+ | Wiki Page | Knowledge base pages; upsert by external ID |
39
+
40
+ **Kibi Connect Trigger** — the trigger node. Starts a workflow when Kibi delivers a webhook:
41
+ a post was created, a task completed, a file uploaded, and so on. It registers its own
42
+ endpoint in Kibi if you let it, verifies every delivery's signature, and drops the echoes of
43
+ its own writes so that a two-way sync cannot loop.
10
44
 
11
45
  ## Installation
12
46
 
13
- Follow the [community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/)
14
- and enter `@weslink/n8n-nodes-kibi-connect` as the package name.
47
+ **Verified node** (n8n Cloud and self-hosted): open **Settings > Community Nodes**, choose
48
+ *Install*, enter `@weslink/n8n-nodes-kibi-connect` and confirm.
49
+
50
+ **Self-hosted, by hand**: the same dialog works. Alternatively run
51
+ `npm install @weslink/n8n-nodes-kibi-connect` in your n8n custom directory
52
+ (`~/.n8n/custom` by default) and restart n8n. See the
53
+ [community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/)
54
+ for the details of either path.
15
55
 
16
56
  ## Credentials
17
57
 
18
- Create an API token in Kibi under **My Profile > Integrations** and grant it the scopes the
19
- operations you plan to use need. Tokens cannot be edited afterwards — a missing scope means
20
- issuing a new token.
58
+ Both nodes use one credential, **Kibi Connect API**.
21
59
 
22
- The credential takes three fields:
60
+ 1. The tenant's REST API has to be switched on: a system administrator does that under
61
+ **Administration > API**. The same page holds the IP allow list, if your tenant uses one.
62
+ 2. Create a token in Kibi under **My Profile > Integrations**. Grant it the scopes the
63
+ operations you plan to use need (table below). Tokens cannot be edited afterwards — a
64
+ missing scope means issuing a new token.
65
+ 3. If the token is meant for the trigger node or for anything that maps records to your own
66
+ IDs, give it an **integration slug** when you create it. The slug cannot be added later.
23
67
 
24
68
  | Field | Notes |
25
69
  |---|---|
26
- | Base URL | Your tenant's address, e.g. `https://acme.kibi.de`. No trailing slash, no `/api`. |
27
- | API Token | The token itself. |
28
- | Integration Slug | Only the trigger node needs it. Chosen when the token is created and immutable afterwards. |
70
+ | Base URL | Your tenant's address, e.g. `https://acme.kibi.de`. No trailing slash, no `/api` — the node appends the API path itself. |
71
+ | API Token | The token, as shown once when it was created. |
72
+ | Integration Slug | The slug chosen at token creation. Needed by the trigger node (to register its endpoint and to recognise its own writes) and by the upsert-by-external-ID operations. Leave empty if the token has none. |
73
+
74
+ ### Scopes per resource
75
+
76
+ Scope names and descriptions as Kibi lists them on the token form.
77
+
78
+ | Resource | Scope | What the scope grants |
79
+ |---|---|---|
80
+ | Calendar Event | `calendar:read` | Read calendar events |
81
+ | | `calendar:write` | Create, update, and delete calendar events |
82
+ | Call Link | `calls:read` | Read meeting links created through this integration |
83
+ | | `calls:write` | Create and manage meeting links, including on behalf of another user (for booking systems that own the appointment) |
84
+ | Chat | `chat:read` | Read conversations and messages |
85
+ | | `chat:write` | Send messages (for bots and automations) |
86
+ | Document | `files:read` | Read folders, items, versions and the sync change-feed |
87
+ | | `files:write` | Create, update, move, delete and restore folders and items |
88
+ | File, Folder, Share Link | `files:read` | Read folders, items, versions and the sync change-feed |
89
+ | | `files:write` | Create, update, move, delete and restore folders and items |
90
+ | Group | `groups:read` | Read public groups, members, posts and files |
91
+ | | `groups:write` | Create groups and link them to objects in an external system (never changes an existing group) |
92
+ | Media | `wiki:write` | Create and update wiki pages |
93
+ | Notification | `notifications:read` | Read user notifications |
94
+ | | `notifications:write` | Send notifications to users (incl. push) |
95
+ | Post | `posts:read` | Read published posts and announcements |
96
+ | | `posts:write` | Create, update, and delete posts |
97
+ | Search | `search` | Cross-entity search |
98
+ | Shared Wiki | `wiki:read` | Read wiki pages and documentation (Get Media needs no scope at all — it is a public image proxy) |
99
+ | Survey | `surveys:read` | Read surveys and results |
100
+ | Task | `tasks:read` | Read tasks assigned to or created by token creator |
101
+ | | `tasks:write` | Create and update tasks |
102
+ | Time Tracking | `time-tracking:read` | Read time entries, absences, balances and work schedules |
103
+ | | `time-tracking:write` | Clock in and out, create and update time entries and absences |
104
+ | User | `users:read` | Read public user directory (no private data) |
105
+ | Wiki Page | `wiki:read` | Read wiki pages and documentation |
106
+ | | `wiki:write` | Create and update wiki pages |
107
+ | Trigger (automatic mode) | `webhooks:read` | List the webhook endpoints this integration owns, and the events they can subscribe to |
108
+ | | `webhooks:write` | Create, update and delete webhook endpoints owned by this integration. Only takes effect for a token whose owner is a system administrator |
109
+
110
+ Two resources also need a module installed in the tenant, on top of the scope: **Document**
111
+ needs the Document Management module, **Time Tracking** needs the Time Tracking module. Kibi
112
+ answers 404 for every route of a module that is not installed — the same answer an unknown ID
113
+ gets, on purpose — and the node says so in its error message.
114
+
115
+ A token acts as the person it belongs to. Messages, posts and time entries are attributed to
116
+ that account, and the token sees only what that account may see. For anything that writes,
117
+ ask an administrator for a dedicated service account rather than using a personal one.
118
+
119
+ ## The trigger node
120
+
121
+ The **Kibi Connect Trigger** node has two ways of getting its webhook endpoint into Kibi.
122
+
123
+ ### Automatic mode (default)
124
+
125
+ With *Register Webhook Automatically* switched on, activating the workflow creates the endpoint
126
+ in Kibi, deactivating it removes it again, and switching between test and production URLs
127
+ updates it. Nothing to click in Kibi. Three things are required of the token:
128
+
129
+ - the scopes `webhooks:read` and `webhooks:write`,
130
+ - an **integration slug** — endpoints are owned by an integration, and a token without a
131
+ slug cannot own one,
132
+ - a **system administrator** as the token's owner. The scope alone is not enough; Kibi
133
+ refuses the registration with 403 otherwise.
134
+
135
+ The signing secret that Kibi hands out once, at creation, is stored in the workflow's static
136
+ data. If it is ever lost, the node reports the endpoint as missing and re-creates it on the
137
+ next activation.
138
+
139
+ ### Manual mode
140
+
141
+ Switch *Register Webhook Automatically* off when the token cannot meet the requirements
142
+ above, or when an administrator wants to keep endpoint management in Kibi. Then:
143
+
144
+ 1. Copy the node's webhook URL from the n8n editor.
145
+ 2. In Kibi, go to **Administration > Webhook endpoints**, create an endpoint with that URL and
146
+ the events you want.
147
+ 3. Paste the signing secret Kibi shows once into the node's *Webhook Secret* field.
148
+
149
+ Manual mode works with any Kibi Connect version that has outgoing webhooks.
150
+
151
+ ### Events, verification and output
152
+
153
+ The events to react to are chosen in the node; the list is loaded from your tenant. In
154
+ automatic mode the endpoint is subscribed to exactly those events. In either mode the node
155
+ also filters locally, so an endpoint that somebody widened in Kibi's administration still
156
+ starts the workflow only for the events its author picked. An empty selection means every
157
+ event.
158
+
159
+ Every delivery is verified against the `X-Kibi-Signature` header, an HMAC-SHA256 over the raw
160
+ request body with the endpoint's secret. A delivery that fails the check is answered with 401
161
+ and does not start the workflow — the webhook URL is not a secret, and this is what keeps a
162
+ stranger who found it from starting your workflows.
163
+
164
+ The output item is Kibi's delivery envelope plus two header values:
165
+
166
+ | Field | Content |
167
+ |---|---|
168
+ | `event` | The event name, e.g. `post.created` |
169
+ | `timestamp` | When the event happened |
170
+ | `tenant_id` | The tenant it happened in |
171
+ | `data` | The record itself, plus `origin` (see below) |
172
+ | `deliveryId` | Kibi's ID for this delivery, from `X-Kibi-Delivery-Id`; useful for de-duplication |
173
+ | `deliveredAt` | When Kibi sent it, from `X-Kibi-Timestamp` |
174
+
175
+ ## Breaking sync loops
176
+
177
+ A workflow that both listens to Kibi and writes to Kibi is one step away from a loop: the
178
+ write triggers the webhook, the webhook triggers the write, and so on until somebody notices.
179
+
180
+ Every webhook payload carries `data.origin`:
181
+
182
+ - `origin.source` is `api` when the change came through the REST API with a token, and `ui`
183
+ for anything a person or a background job did.
184
+ - `origin.integration` is the integration slug of the token that made the change, or `null`
185
+ when the token has none.
186
+
187
+ The trigger node's *Ignore Own Writes* option drops every delivery whose `origin.integration`
188
+ equals the **integration slug in the credential**. It is on by default, because a workflow
189
+ that writes nothing loses nothing by it, and a workflow that does write is protected from the
190
+ start. Two consequences worth knowing:
191
+
192
+ - The comparison is against the slug in the credential. A trigger with a credential whose
193
+ token has no slug cannot recognise anything as its own, so the option has no effect there.
194
+ - Two workflows sharing one integration slug ignore each other's writes too. Give each
195
+ integration its own slug if that is not what you want.
196
+
197
+ For workflows that need finer control, switch the option off and branch on
198
+ `{{ $json.data.origin.source }}` and `{{ $json.data.origin.integration }}` yourself.
199
+
200
+ ## Examples
201
+
202
+ Two ready-made workflows live in the `examples/` directory of the repository. Import one via
203
+ **Workflow > Import from File**, then select your Kibi Connect credential in each node.
204
+
205
+ ### Announce new posts in a chat channel
206
+
207
+ `examples/announce-new-posts-in-chat.json`
208
+
209
+ A **Kibi Connect Trigger** listens for `post.created`. For every delivery, a **Kibi Connect**
210
+ node (Chat > Send Message) posts a short announcement with the title and a link into a
211
+ conversation — a team channel, say — so that people who live in chat do not miss what was
212
+ published in the feed. The token needs `chat:write`, and for automatic endpoint registration
213
+ `webhooks:read`, `webhooks:write`, an integration slug and a system administrator as owner;
214
+ `posts:read` is not required, because the delivery already carries the post.
215
+ Adapt the *Conversation* in the Send Message node (pick it from the list) and the message
216
+ text, which is an expression over `$json.data`.
217
+
218
+ ### File invoices from a mailbox into the DMS
219
+
220
+ `examples/file-invoices-from-email-into-the-dms.json`
221
+
222
+ An **Email Trigger (IMAP)** watches a mailbox and hands over each mail with its attachments.
223
+ A **Kibi Connect** node (Document > Create) uploads every PDF attachment into the document
224
+ management system, where Kibi's document intelligence extracts the metadata and files it. A
225
+ second **Kibi Connect** node (Chat > Send Message) then tells the accounting conversation
226
+ which documents arrived. The token needs `files:write` for the upload and `chat:write` for the
227
+ message; the tenant needs the Document Management module. A small Code node in between turns
228
+ the mail's attachments (`attachment_0`, `attachment_1`, ...) into one item per PDF with the
229
+ file in `data`, so the upload needs no adapting. Adapt the IMAP credential and folder, the
230
+ target *Folder ID* if the documents should not land in the DMS root, and the *Conversation*
231
+ for the summary.
232
+
233
+ ## Binary data
234
+
235
+ - **Uploads** (Document > Create, File > Upload, Media > Upload) read the binary property named
236
+ in *Input Binary Field* — `data` by default, which is what most n8n nodes produce. The file
237
+ name and MIME type travel with it.
238
+ - The Files API accepts a single-shot upload of up to **64 MiB**. Larger files need the
239
+ chunked upload flow, which this package does not implement.
240
+ - **Downloads** (Document > Download, File > Download, File > Download Version, Shared Wiki >
241
+ Get Media) produce a binary property `data`, and put `fileName`, `mimeType` and `fileSize`
242
+ into the item's JSON. The file name is taken from Kibi's `Content-Disposition` header,
243
+ umlauts included.
244
+ - File > Download streams the bytes through the authenticated endpoint rather than following a
245
+ redirect to object storage, so the token never leaves your tenant's domain. File > Get
246
+ Access URL mints a short-lived direct URL for consumers that cannot send the token.
247
+
248
+ ## Rich text
29
249
 
30
- The REST API also has to be switched on for the tenant, under **Administration > API**.
250
+ Posts, wiki pages, task descriptions and calendar event descriptions are rich text. The node
251
+ defaults to **HTML** on both the way in (*Content Format*) and the way out (*Read Format*).
252
+ **Markdown** and **JSON** (Kibi's document tree, the only exact representation) are available
253
+ on the same fields. HTML and Markdown are converted at the boundary, and anything Kibi has no
254
+ element for is dropped in that conversion — a round trip does not have to give back exactly
255
+ what it was handed.
31
256
 
32
257
  ## Compatibility
33
258
 
34
- Requires n8n 1.x and a Kibi Connect tenant with the REST API enabled.
259
+ - n8n 1.x.
260
+ - A Kibi Connect tenant with the REST API enabled (**Administration > API**).
261
+ - Automatic webhook registration requires Kibi Connect **6.8.0** or newer — the
262
+ `/api/v1/webhook-endpoints` routes ship with that release. Manual mode works with any
263
+ version that has outgoing webhooks.
264
+ - The File, Folder and Share Link resources, and the Document resource's fulltext search,
265
+ recent, inbox and doc-type reads, need a Kibi Connect version with the Files API V2 (6.x).
266
+ - The Document and Time Tracking resources need their module installed in the tenant.
35
267
 
36
268
  ## License
37
269
 
@@ -1,6 +1,8 @@
1
1
  import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
2
2
  import { getConversations } from './listSearch/getConversations';
3
3
  import { getUsers } from './listSearch/getUsers';
4
+ import { getAbsenceTypes } from './loadOptions/getAbsenceTypes';
5
+ import { getGroupTypes } from './loadOptions/getGroupTypes';
4
6
  export declare class KibiConnect implements INodeType {
5
7
  description: INodeTypeDescription;
6
8
  methods: {
@@ -8,5 +10,9 @@ export declare class KibiConnect implements INodeType {
8
10
  getUsers: typeof getUsers;
9
11
  getConversations: typeof getConversations;
10
12
  };
13
+ loadOptions: {
14
+ getAbsenceTypes: typeof getAbsenceTypes;
15
+ getGroupTypes: typeof getGroupTypes;
16
+ };
11
17
  };
12
18
  }
@@ -4,13 +4,27 @@ exports.KibiConnect = void 0;
4
4
  const n8n_workflow_1 = require("n8n-workflow");
5
5
  const getConversations_1 = require("./listSearch/getConversations");
6
6
  const getUsers_1 = require("./listSearch/getUsers");
7
+ const getAbsenceTypes_1 = require("./loadOptions/getAbsenceTypes");
8
+ const getGroupTypes_1 = require("./loadOptions/getGroupTypes");
7
9
  const calendarEvent_1 = require("./resources/calendarEvent");
10
+ const callLink_1 = require("./resources/callLink");
8
11
  const chat_1 = require("./resources/chat");
12
+ const document_1 = require("./resources/document");
13
+ const file_1 = require("./resources/file");
14
+ const folder_1 = require("./resources/folder");
15
+ const group_1 = require("./resources/group");
16
+ const media_1 = require("./resources/media");
9
17
  const notification_1 = require("./resources/notification");
10
18
  const post_1 = require("./resources/post");
19
+ const search_1 = require("./resources/search");
20
+ const shareLink_1 = require("./resources/shareLink");
21
+ const sharedWiki_1 = require("./resources/sharedWiki");
22
+ const survey_1 = require("./resources/survey");
11
23
  const task_1 = require("./resources/task");
24
+ const timeTracking_1 = require("./resources/timeTracking");
12
25
  const user_1 = require("./resources/user");
13
26
  const wiki_1 = require("./resources/wiki");
27
+ const routing_1 = require("./shared/routing");
14
28
  class KibiConnect {
15
29
  constructor() {
16
30
  this.description = {
@@ -23,7 +37,7 @@ class KibiConnect {
23
37
  group: ['input'],
24
38
  version: 1,
25
39
  subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
26
- description: 'Read and write chat, posts, wiki pages, tasks and calendar events in Kibi Connect',
40
+ description: 'Read and write chat, posts, wiki pages, tasks, calendar events, groups, files, documents and time tracking in Kibi Connect',
27
41
  defaults: {
28
42
  name: 'Kibi Connect',
29
43
  },
@@ -43,23 +57,57 @@ class KibiConnect {
43
57
  'Content-Type': 'application/json',
44
58
  },
45
59
  },
60
+ requestOperations: {
61
+ pagination: routing_1.kibiRoutingRequest,
62
+ },
46
63
  properties: [
47
64
  {
48
65
  displayName: 'Resource',
49
66
  name: 'resource',
50
67
  type: 'options',
51
68
  noDataExpression: true,
69
+ routing: { send: { paginate: true } },
52
70
  options: [
53
71
  {
54
72
  name: 'Calendar Event',
55
73
  value: 'calendarEvent',
56
74
  description: 'Appointments and meetings',
57
75
  },
76
+ {
77
+ name: 'Call Link',
78
+ value: 'callLink',
79
+ description: 'Meeting links that guests open without a Kibi account',
80
+ },
58
81
  {
59
82
  name: 'Chat',
60
83
  value: 'chat',
61
84
  description: 'Send and read messages, react to them',
62
85
  },
86
+ {
87
+ name: 'Document',
88
+ value: 'document',
89
+ description: 'Files in the document management system. Requires the Document Management module — Kibi answers 404 for every DMS route when the module is not installed.',
90
+ },
91
+ {
92
+ name: 'File',
93
+ value: 'file',
94
+ description: 'Files in the file manager — needs the files:read / files:write scopes',
95
+ },
96
+ {
97
+ name: 'Folder',
98
+ value: 'folder',
99
+ description: 'Folders of the file manager — needs the files:read / files:write scopes',
100
+ },
101
+ {
102
+ name: 'Group',
103
+ value: 'group',
104
+ description: 'Teams, departments and projects, with their posts, members and files',
105
+ },
106
+ {
107
+ name: 'Media',
108
+ value: 'media',
109
+ description: 'Upload images for wiki pages',
110
+ },
63
111
  {
64
112
  name: 'Notification',
65
113
  value: 'notification',
@@ -70,11 +118,36 @@ class KibiConnect {
70
118
  value: 'post',
71
119
  description: 'News and announcements in the feed',
72
120
  },
121
+ {
122
+ name: 'Search',
123
+ value: 'search',
124
+ description: 'Search posts, wiki pages and people in one go',
125
+ },
126
+ {
127
+ name: 'Share Link',
128
+ value: 'shareLink',
129
+ description: 'Public links to files and folders — needs the files:read / files:write scopes',
130
+ },
131
+ {
132
+ name: 'Shared Wiki',
133
+ value: 'sharedWiki',
134
+ description: 'Wiki subtrees published for the outside world',
135
+ },
136
+ {
137
+ name: 'Survey',
138
+ value: 'survey',
139
+ description: 'Published surveys and their answer options',
140
+ },
73
141
  {
74
142
  name: 'Task',
75
143
  value: 'task',
76
144
  description: 'Work items on a board',
77
145
  },
146
+ {
147
+ name: 'Time Tracking',
148
+ value: 'timeTracking',
149
+ description: 'Clock in and out, time entries, absences and balances. Requires the Time Tracking module — Kibi answers 404 for every route when the module is not installed.',
150
+ },
78
151
  {
79
152
  name: 'User',
80
153
  value: 'user',
@@ -89,10 +162,21 @@ class KibiConnect {
89
162
  default: 'chat',
90
163
  },
91
164
  ...calendarEvent_1.calendarEventDescription,
165
+ ...callLink_1.callLinkDescription,
92
166
  ...chat_1.chatDescription,
167
+ ...document_1.documentDescription,
168
+ ...file_1.fileDescription,
169
+ ...folder_1.folderDescription,
170
+ ...group_1.groupDescription,
171
+ ...media_1.mediaDescription,
93
172
  ...notification_1.notificationDescription,
94
173
  ...post_1.postDescription,
174
+ ...search_1.searchDescription,
175
+ ...shareLink_1.shareLinkDescription,
176
+ ...sharedWiki_1.sharedWikiDescription,
177
+ ...survey_1.surveyDescription,
95
178
  ...task_1.taskDescription,
179
+ ...timeTracking_1.timeTrackingDescription,
96
180
  ...user_1.userDescription,
97
181
  ...wiki_1.wikiDescription,
98
182
  ],
@@ -102,6 +186,10 @@ class KibiConnect {
102
186
  getUsers: getUsers_1.getUsers,
103
187
  getConversations: getConversations_1.getConversations,
104
188
  },
189
+ loadOptions: {
190
+ getAbsenceTypes: getAbsenceTypes_1.getAbsenceTypes,
191
+ getGroupTypes: getGroupTypes_1.getGroupTypes,
192
+ },
105
193
  };
106
194
  }
107
195
  }
@@ -1 +1 @@
1
- {"version":3,"file":"KibiConnect.node.js","sourceRoot":"","sources":["../../../nodes/KibiConnect/KibiConnect.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAE9F,oEAAiE;AACjE,oDAAiD;AACjD,6DAAqE;AACrE,2CAAmD;AACnD,2DAAmE;AACnE,2CAAmD;AACnD,2CAAmD;AACnD,2C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MAAM;4BACZ,KAAK,EAAE,MAAM;4BACb,WAAW,EAAE,uBAAuB;yBACpC;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;4BACb,WAAW,EAAE,0CAA0C;yBACvD;wBACD;4BACC,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,MAAM;4BACb,WAAW,EAAE,sBAAsB;yBACnC;qBACD;oBACD,OAAO,EAAE,MAAM;iBACf;gBACD,GAAG,wCAAwB;gBAC3B,GAAG,sBAAe;gBAClB,GAAG,sCAAuB;gBAC1B,GAAG,sBAAe;gBAClB,GAAG,sBAAe;gBAClB,GAAG,sBAAe;gBAClB,GAAG,sBAAe;aAClB;SACD,CAAC;QAKF,YAAO,GAAG;YACT,UAAU,EAAE;gBACX,QAAQ,EAAR,mBAAQ;gBACR,gBAAgB,EAAhB,mCAAgB;aAChB;SACD,CAAC;IACH,CAAC;CAAA;AAjGD,kCAiGC"}
1
+ {"version":3,"file":"KibiConnect.node.js","sourceRoot":"","sources":["../../../nodes/KibiConnect/KibiConnect.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAE9F,oEAAiE;AACjE,oDAAiD;AACjD,mEAAgE;AAChE,+DAA4D;AAC5D,6DAAqE;AACrE,mDAA2D;AAC3D,2CAAmD;AACnD,mDAA2D;AAC3D,2CAAmD;AACnD,+CAAuD;AACvD,6CAAqD;AACrD,6CAAqD;AACrD,2DAAmE;AACnE,2CAAmD;AACnD,+CAAuD;AACvD,qDAA6D;AAC7D,uDAA+D;AAC/D,+CAAuD;AACvD,2CAAmD;AACnD,2DAAmE;AACnE,2CAAmD;AACnD,2CAAmD;AACnD,8CAAsD;AAEtD,MAAa,WAAW;IAAxB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE;gBACL,KAAK,EAAE,kCAAkC;gBACzC,IAAI,EAAE,uCAAuC;aAC7C;YACD,KAAK,EAAE,CAAC,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GAAG,sBAAe;gBAClB,GAAG,8BAAmB;gBACtB,GAAG,sBAAe;gBAClB,GAAG,0BAAiB;gBACpB,GAAG,wBAAgB;gBACnB,GAAG,wBAAgB;gBACnB,GAAG,sCAAuB;gBAC1B,GAAG,sBAAe;gBAClB,GAAG,0BAAiB;gBACpB,GAAG,gCAAoB;gBACvB,GAAG,kCAAqB;gBACxB,GAAG,0BAAiB;gBACpB,GAAG,sBAAe;gBAClB,GAAG,sCAAuB;gBAC1B,GAAG,sBAAe;gBAClB,GAAG,sBAAe;aAClB;SACD,CAAC;QAMF,YAAO,GAAG;YACT,UAAU,EAAE;gBACX,QAAQ,EAAR,mBAAQ;gBACR,gBAAgB,EAAhB,mCAAgB;aAChB;YACD,WAAW,EAAE;gBACZ,eAAe,EAAf,iCAAe;gBACf,aAAa,EAAb,6BAAa;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAnLD,kCAmLC"}
@@ -0,0 +1,2 @@
1
+ import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare function getAbsenceTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAbsenceTypes = getAbsenceTypes;
4
+ const transport_1 = require("../shared/transport");
5
+ async function getAbsenceTypes() {
6
+ const response = (await transport_1.kibiApiRequest.call(this, 'GET', '/time-tracking/absence-types'));
7
+ return response.data.map((type) => ({
8
+ name: type.name,
9
+ value: type.id,
10
+ description: type.requires_approval === false ? 'Approved on the spot' : 'Waits for approval',
11
+ }));
12
+ }
13
+ //# sourceMappingURL=getAbsenceTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAbsenceTypes.js","sourceRoot":"","sources":["../../../../nodes/KibiConnect/loadOptions/getAbsenceTypes.ts"],"names":[],"mappings":";;AAmBA,0CAeC;AA/BD,mDAAqD;AAgB9C,KAAK,UAAU,eAAe;IACpC,MAAM,QAAQ,GAAG,CAAC,MAAM,0BAAc,CAAC,IAAI,CAC1C,IAAI,EACJ,KAAK,EACL,8BAA8B,CAC9B,CAAmC,CAAC;IAErC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnC,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,KAAK,EAAE,IAAI,CAAC,EAAE;QAGd,WAAW,EACV,IAAI,CAAC,iBAAiB,KAAK,KAAK,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,oBAAoB;KACjF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare function getGroupTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGroupTypes = getGroupTypes;
4
+ const transport_1 = require("../shared/transport");
5
+ async function getGroupTypes() {
6
+ const response = (await transport_1.kibiApiRequest.call(this, 'GET', '/groups/types'));
7
+ return response.data.map((type) => ({
8
+ name: type.label,
9
+ value: type.value,
10
+ description: type.standard ? 'Standard type' : 'Defined by this tenant',
11
+ }));
12
+ }
13
+ //# sourceMappingURL=getGroupTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGroupTypes.js","sourceRoot":"","sources":["../../../../nodes/KibiConnect/loadOptions/getGroupTypes.ts"],"names":[],"mappings":";;AAmBA,sCAYC;AA5BD,mDAAqD;AAgB9C,KAAK,UAAU,aAAa;IAClC,MAAM,QAAQ,GAAG,CAAC,MAAM,0BAAc,CAAC,IAAI,CAC1C,IAAI,EACJ,KAAK,EACL,eAAe,CACf,CAAiC,CAAC;IAEnC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnC,IAAI,EAAE,IAAI,CAAC,KAAK;QAChB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,wBAAwB;KACvE,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const callLinkDescription: INodeProperties[];