@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.
- package/LICENSE.md +22 -0
- package/README.md +38 -0
- package/dist/credentials/KibiConnectApi.credentials.d.ts +10 -0
- package/dist/credentials/KibiConnectApi.credentials.js +85 -0
- package/dist/credentials/KibiConnectApi.credentials.js.map +1 -0
- package/dist/icons/kibiConnect.dark.svg +37 -0
- package/dist/icons/kibiConnect.svg +37 -0
- package/dist/nodes/KibiConnect/KibiConnect.node.d.ts +12 -0
- package/dist/nodes/KibiConnect/KibiConnect.node.js +109 -0
- package/dist/nodes/KibiConnect/KibiConnect.node.js.map +1 -0
- package/dist/nodes/KibiConnect/KibiConnect.node.json +18 -0
- package/dist/nodes/KibiConnect/listSearch/getConversations.d.ts +2 -0
- package/dist/nodes/KibiConnect/listSearch/getConversations.js +33 -0
- package/dist/nodes/KibiConnect/listSearch/getConversations.js.map +1 -0
- package/dist/nodes/KibiConnect/listSearch/getUsers.d.ts +2 -0
- package/dist/nodes/KibiConnect/listSearch/getUsers.js +26 -0
- package/dist/nodes/KibiConnect/listSearch/getUsers.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/calendarEvent/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/calendarEvent/index.js +236 -0
- package/dist/nodes/KibiConnect/resources/calendarEvent/index.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/chat/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/chat/index.js +221 -0
- package/dist/nodes/KibiConnect/resources/chat/index.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/notification/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/notification/index.js +131 -0
- package/dist/nodes/KibiConnect/resources/notification/index.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/post/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/post/index.js +176 -0
- package/dist/nodes/KibiConnect/resources/post/index.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/task/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/task/index.js +229 -0
- package/dist/nodes/KibiConnect/resources/task/index.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/user/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/user/index.js +91 -0
- package/dist/nodes/KibiConnect/resources/user/index.js.map +1 -0
- package/dist/nodes/KibiConnect/resources/wiki/index.d.ts +2 -0
- package/dist/nodes/KibiConnect/resources/wiki/index.js +167 -0
- package/dist/nodes/KibiConnect/resources/wiki/index.js.map +1 -0
- package/dist/nodes/KibiConnect/shared/descriptions.d.ts +3 -0
- package/dist/nodes/KibiConnect/shared/descriptions.js +52 -0
- package/dist/nodes/KibiConnect/shared/descriptions.js.map +1 -0
- package/dist/nodes/KibiConnect/shared/errors.d.ts +6 -0
- package/dist/nodes/KibiConnect/shared/errors.js +42 -0
- package/dist/nodes/KibiConnect/shared/errors.js.map +1 -0
- package/dist/nodes/KibiConnect/shared/fields.d.ts +7 -0
- package/dist/nodes/KibiConnect/shared/fields.js +120 -0
- package/dist/nodes/KibiConnect/shared/fields.js.map +1 -0
- package/dist/nodes/KibiConnect/shared/transport.d.ts +13 -0
- package/dist/nodes/KibiConnect/shared/transport.js +39 -0
- package/dist/nodes/KibiConnect/shared/transport.js.map +1 -0
- package/dist/package.json +66 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postDescription = void 0;
|
|
4
|
+
const descriptions_1 = require("../../shared/descriptions");
|
|
5
|
+
const fields_1 = require("../../shared/fields");
|
|
6
|
+
const R = 'post';
|
|
7
|
+
const show = { resource: [R] };
|
|
8
|
+
const writeOps = ['create', 'update', 'upsertByExternalId'];
|
|
9
|
+
exports.postDescription = [
|
|
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 post',
|
|
21
|
+
description: 'Publish to the feed. Calling this twice publishes twice.',
|
|
22
|
+
routing: {
|
|
23
|
+
request: { method: 'POST', url: '/posts' },
|
|
24
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Delete',
|
|
29
|
+
value: 'delete',
|
|
30
|
+
action: 'Delete a post',
|
|
31
|
+
description: 'Move a post to the bin',
|
|
32
|
+
routing: {
|
|
33
|
+
request: { method: 'DELETE', url: '=/posts/{{$parameter.postId}}' },
|
|
34
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Delete External Ref',
|
|
39
|
+
value: 'deleteExternalRef',
|
|
40
|
+
action: 'Unlink a post from its external ID',
|
|
41
|
+
description: 'Release the external ID without touching the post itself',
|
|
42
|
+
routing: {
|
|
43
|
+
request: { method: 'DELETE', url: '=/posts/{{$parameter.postId}}/external-ref' },
|
|
44
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Get',
|
|
49
|
+
value: 'get',
|
|
50
|
+
action: 'Get a post',
|
|
51
|
+
description: 'Read one post',
|
|
52
|
+
routing: {
|
|
53
|
+
request: { method: 'GET', url: '=/posts/{{$parameter.postId}}' },
|
|
54
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Get Many',
|
|
59
|
+
value: 'getAll',
|
|
60
|
+
action: 'Get many posts',
|
|
61
|
+
description: 'Read the published posts visible to the token owner',
|
|
62
|
+
routing: {
|
|
63
|
+
request: { method: 'GET', url: '/posts' },
|
|
64
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'Update',
|
|
69
|
+
value: 'update',
|
|
70
|
+
action: 'Update a post',
|
|
71
|
+
description: 'Change an existing post',
|
|
72
|
+
routing: {
|
|
73
|
+
request: { method: 'PUT', url: '=/posts/{{$parameter.postId}}' },
|
|
74
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Upsert by External ID',
|
|
79
|
+
value: 'upsertByExternalId',
|
|
80
|
+
action: 'Create or update a post by external ID',
|
|
81
|
+
description: 'Create the post, or update the one already mapped to this ID',
|
|
82
|
+
routing: {
|
|
83
|
+
request: { method: 'PUT', url: '/posts/by-external-id' },
|
|
84
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
default: 'upsertByExternalId',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Use Upsert by External ID for anything that runs repeatedly. Create has no memory: run the same workflow twice and the feed carries the same announcement twice.',
|
|
92
|
+
name: 'upsertNotice',
|
|
93
|
+
type: 'notice',
|
|
94
|
+
default: '',
|
|
95
|
+
displayOptions: { show: { ...show, operation: ['create'] } },
|
|
96
|
+
},
|
|
97
|
+
(0, fields_1.ulidField)('Post ID', 'postId', R, ['get', 'update', 'delete', 'deleteExternalRef'], 'The post to act on.'),
|
|
98
|
+
(0, fields_1.externalIdField)(R, ['upsertByExternalId']),
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Title',
|
|
101
|
+
name: 'title',
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true,
|
|
104
|
+
default: '',
|
|
105
|
+
placeholder: 'New canteen opening hours',
|
|
106
|
+
description: 'The headline of the post',
|
|
107
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
108
|
+
routing: { request: { body: { title: '={{ $value }}' } } },
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
displayName: 'Body',
|
|
112
|
+
name: 'body',
|
|
113
|
+
type: 'string',
|
|
114
|
+
typeOptions: { rows: 6 },
|
|
115
|
+
default: '',
|
|
116
|
+
description: 'The post content. Rich text — set Content Format to say how it is written. On an upsert, leaving this empty keeps the existing body.',
|
|
117
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
118
|
+
routing: { request: { body: { body: '={{ $value || undefined }}' } } },
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Status',
|
|
122
|
+
name: 'status',
|
|
123
|
+
type: 'options',
|
|
124
|
+
default: 'published',
|
|
125
|
+
description: 'Whether the post goes live or stays a draft',
|
|
126
|
+
options: [
|
|
127
|
+
{ name: 'Draft', value: 'draft' },
|
|
128
|
+
{ name: 'Published', value: 'published' },
|
|
129
|
+
],
|
|
130
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
131
|
+
routing: { request: { body: { status: '={{ $value }}' } } },
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
displayName: 'Group ID',
|
|
135
|
+
name: 'groupId',
|
|
136
|
+
type: 'string',
|
|
137
|
+
default: '',
|
|
138
|
+
placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
|
|
139
|
+
description: 'Publish into one group rather than the whole tenant. On an upsert this is only read when the post is created — it will not move an existing post.',
|
|
140
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
141
|
+
routing: { request: { body: { group_id: '={{ $value || undefined }}' } } },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
displayName: 'Announce',
|
|
145
|
+
name: 'notify',
|
|
146
|
+
type: 'boolean',
|
|
147
|
+
default: true,
|
|
148
|
+
description: 'Whether to announce the post to everyone it reaches. Turn this off for a bulk import — otherwise the first run notifies the entire tenant once per post.',
|
|
149
|
+
displayOptions: { show: { ...show, operation: ['upsertByExternalId'] } },
|
|
150
|
+
routing: { request: { body: { notify: '={{ $value }}' } } },
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
displayName: 'Search',
|
|
154
|
+
name: 'search',
|
|
155
|
+
type: 'string',
|
|
156
|
+
default: '',
|
|
157
|
+
description: 'Filter posts by title or body, case-insensitively',
|
|
158
|
+
displayOptions: { show: { ...show, operation: ['getAll'] } },
|
|
159
|
+
routing: { request: { qs: { search: '={{ $value || undefined }}' } } },
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Filter by External ID',
|
|
163
|
+
name: 'filterExternalId',
|
|
164
|
+
type: 'string',
|
|
165
|
+
default: '',
|
|
166
|
+
description: 'Return only the post mapped to this external ID. The answer stays a list holding one entry or none — an unknown ID is an empty list, not an error.',
|
|
167
|
+
displayOptions: { show: { ...show, operation: ['getAll'] } },
|
|
168
|
+
routing: { request: { qs: { external_id: '={{ $value || undefined }}' } } },
|
|
169
|
+
},
|
|
170
|
+
(0, fields_1.contentFormatField)(R, writeOps),
|
|
171
|
+
(0, fields_1.readFormatField)(R, ['get', 'getAll']),
|
|
172
|
+
(0, fields_1.conditionalWriteField)(R, ['update', 'upsertByExternalId']),
|
|
173
|
+
...(0, fields_1.changeScanFields)(R, 'getAll'),
|
|
174
|
+
...(0, descriptions_1.returnAll)(R, 'getAll'),
|
|
175
|
+
];
|
|
176
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/KibiConnect/resources/post/index.ts"],"names":[],"mappings":";;;AAEA,4DAAkE;AAClE,gDAO6B;AAE7B,MAAM,CAAC,GAAG,MAAM,CAAC;AACjB,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAE/B,MAAM,QAAQ,GAAG,CAAC,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AI,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,2BAAkB,EAAC,CAAC,EAAE,QAAQ,CAAC;IAC/B,IAAA,wBAAe,EAAC,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrC,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,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taskDescription = void 0;
|
|
4
|
+
const descriptions_1 = require("../../shared/descriptions");
|
|
5
|
+
const fields_1 = require("../../shared/fields");
|
|
6
|
+
const R = 'task';
|
|
7
|
+
const show = { resource: [R] };
|
|
8
|
+
const writeOps = ['create', 'update', 'upsertByExternalId'];
|
|
9
|
+
const STATUS_OPTIONS = [
|
|
10
|
+
{ name: 'At Work', value: 'at_work' },
|
|
11
|
+
{ name: 'Completed', value: 'completed' },
|
|
12
|
+
{ name: 'Open', value: 'open' },
|
|
13
|
+
];
|
|
14
|
+
exports.taskDescription = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Operation',
|
|
17
|
+
name: 'operation',
|
|
18
|
+
type: 'options',
|
|
19
|
+
noDataExpression: true,
|
|
20
|
+
displayOptions: { show },
|
|
21
|
+
options: [
|
|
22
|
+
{
|
|
23
|
+
name: 'Create',
|
|
24
|
+
value: 'create',
|
|
25
|
+
action: 'Create a task',
|
|
26
|
+
description: 'Add a task. Calling this twice creates two tasks.',
|
|
27
|
+
routing: {
|
|
28
|
+
request: { method: 'POST', url: '/tasks' },
|
|
29
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Delete',
|
|
34
|
+
value: 'delete',
|
|
35
|
+
action: 'Delete a task',
|
|
36
|
+
description: 'Move a task to the bin',
|
|
37
|
+
routing: {
|
|
38
|
+
request: { method: 'DELETE', url: '=/tasks/{{$parameter.taskId}}' },
|
|
39
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Delete External Ref',
|
|
44
|
+
value: 'deleteExternalRef',
|
|
45
|
+
action: 'Unlink a task from its external ID',
|
|
46
|
+
description: 'Release the external ID without touching the task itself',
|
|
47
|
+
routing: {
|
|
48
|
+
request: { method: 'DELETE', url: '=/tasks/{{$parameter.taskId}}/external-ref' },
|
|
49
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Get',
|
|
54
|
+
value: 'get',
|
|
55
|
+
action: 'Get a task',
|
|
56
|
+
description: 'Read one task',
|
|
57
|
+
routing: {
|
|
58
|
+
request: { method: 'GET', url: '=/tasks/{{$parameter.taskId}}' },
|
|
59
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Get Many',
|
|
64
|
+
value: 'getAll',
|
|
65
|
+
action: 'Get many tasks',
|
|
66
|
+
description: 'Read the tasks the token owner created or was assigned',
|
|
67
|
+
routing: {
|
|
68
|
+
request: { method: 'GET', url: '/tasks' },
|
|
69
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Update',
|
|
74
|
+
value: 'update',
|
|
75
|
+
action: 'Update a task',
|
|
76
|
+
description: 'Change an existing task',
|
|
77
|
+
routing: {
|
|
78
|
+
request: { method: 'PUT', url: '=/tasks/{{$parameter.taskId}}' },
|
|
79
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Upsert by External ID',
|
|
84
|
+
value: 'upsertByExternalId',
|
|
85
|
+
action: 'Create or update a task by external ID',
|
|
86
|
+
description: 'Create the task, or update the one already mapped to this ID',
|
|
87
|
+
routing: {
|
|
88
|
+
request: { method: 'PUT', url: '/tasks/by-external-id' },
|
|
89
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
default: 'upsertByExternalId',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Use Upsert by External ID for anything that runs repeatedly. Create has no memory: run the same workflow twice and you get two tasks, not one updated one.',
|
|
97
|
+
name: 'upsertNotice',
|
|
98
|
+
type: 'notice',
|
|
99
|
+
default: '',
|
|
100
|
+
displayOptions: { show: { ...show, operation: ['create'] } },
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
displayName: 'Get Many returns the tasks the token owner created or is assigned to — not every task in the tenant. A service account therefore sees only what was created through it or handed to it.',
|
|
104
|
+
name: 'scopeNotice',
|
|
105
|
+
type: 'notice',
|
|
106
|
+
default: '',
|
|
107
|
+
displayOptions: { show: { ...show, operation: ['getAll'] } },
|
|
108
|
+
},
|
|
109
|
+
(0, fields_1.ulidField)('Task ID', 'taskId', R, ['get', 'update', 'delete', 'deleteExternalRef'], 'The task to act on.'),
|
|
110
|
+
(0, fields_1.externalIdField)(R, ['upsertByExternalId']),
|
|
111
|
+
{
|
|
112
|
+
displayName: 'Title',
|
|
113
|
+
name: 'title',
|
|
114
|
+
type: 'string',
|
|
115
|
+
required: true,
|
|
116
|
+
default: '',
|
|
117
|
+
placeholder: 'Review the Q3 figures',
|
|
118
|
+
description: 'The task title',
|
|
119
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
120
|
+
routing: { request: { body: { title: '={{ $value }}' } } },
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: 'Description',
|
|
124
|
+
name: 'description',
|
|
125
|
+
type: 'string',
|
|
126
|
+
typeOptions: { rows: 4 },
|
|
127
|
+
default: '',
|
|
128
|
+
description: 'The task description. Rich text — set Content Format to say how it is written.',
|
|
129
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
130
|
+
routing: { request: { body: { description: '={{ $value || undefined }}' } } },
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
displayName: 'Status',
|
|
134
|
+
name: 'status',
|
|
135
|
+
type: 'options',
|
|
136
|
+
default: 'open',
|
|
137
|
+
description: 'Where the task sits on its board',
|
|
138
|
+
options: STATUS_OPTIONS,
|
|
139
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
140
|
+
routing: { request: { body: { status: '={{ $value }}' } } },
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
displayName: 'Priority',
|
|
144
|
+
name: 'priority',
|
|
145
|
+
type: 'options',
|
|
146
|
+
default: 'medium',
|
|
147
|
+
description: 'How urgent the task is',
|
|
148
|
+
options: [
|
|
149
|
+
{ name: 'High', value: 'high' },
|
|
150
|
+
{ name: 'Low', value: 'low' },
|
|
151
|
+
{ name: 'Medium', value: 'medium' },
|
|
152
|
+
{ name: 'Urgent', value: 'urgent' },
|
|
153
|
+
],
|
|
154
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
155
|
+
routing: { request: { body: { priority: '={{ $value }}' } } },
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
displayName: 'Assignee',
|
|
159
|
+
name: 'assigneeId',
|
|
160
|
+
type: 'resourceLocator',
|
|
161
|
+
default: { mode: 'list', value: '' },
|
|
162
|
+
description: 'Who the task is for. Leave empty to leave it unassigned.',
|
|
163
|
+
displayOptions: { show: { ...show, operation: ['create', 'update'] } },
|
|
164
|
+
modes: [
|
|
165
|
+
{
|
|
166
|
+
displayName: 'From List',
|
|
167
|
+
name: 'list',
|
|
168
|
+
type: 'list',
|
|
169
|
+
typeOptions: { searchListMethod: 'getUsers', searchable: true },
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
displayName: 'By ID',
|
|
173
|
+
name: 'id',
|
|
174
|
+
type: 'string',
|
|
175
|
+
hint: 'The user ULID from the employee directory.',
|
|
176
|
+
placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
routing: { request: { body: { assignee_id: '={{ $value || undefined }}' } } },
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
displayName: 'Due Date',
|
|
183
|
+
name: 'dueDate',
|
|
184
|
+
type: 'dateTime',
|
|
185
|
+
default: '',
|
|
186
|
+
description: 'When the task is due',
|
|
187
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
188
|
+
routing: {
|
|
189
|
+
request: {
|
|
190
|
+
body: { due_date: '={{ $value ? new Date($value).toISOString().slice(0, 10) : undefined }}' },
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
displayName: 'Group ID',
|
|
196
|
+
name: 'groupId',
|
|
197
|
+
type: 'string',
|
|
198
|
+
default: '',
|
|
199
|
+
placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
|
|
200
|
+
description: 'The group whose board the task belongs to. A task without one is visible to its creator and assignees only.',
|
|
201
|
+
displayOptions: { show: { ...show, operation: writeOps } },
|
|
202
|
+
routing: { request: { body: { group_id: '={{ $value || undefined }}' } } },
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
displayName: 'Filter by Status',
|
|
206
|
+
name: 'filterStatus',
|
|
207
|
+
type: 'options',
|
|
208
|
+
default: '',
|
|
209
|
+
description: 'Return only tasks in this state',
|
|
210
|
+
options: [{ name: 'Any', value: '' }, ...STATUS_OPTIONS],
|
|
211
|
+
displayOptions: { show: { ...show, operation: ['getAll'] } },
|
|
212
|
+
routing: { request: { qs: { status: '={{ $value || undefined }}' } } },
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
displayName: 'Filter by External ID',
|
|
216
|
+
name: 'filterExternalId',
|
|
217
|
+
type: 'string',
|
|
218
|
+
default: '',
|
|
219
|
+
description: 'Return only the task mapped to this external ID. The answer stays a list holding one entry or none.',
|
|
220
|
+
displayOptions: { show: { ...show, operation: ['getAll'] } },
|
|
221
|
+
routing: { request: { qs: { external_id: '={{ $value || undefined }}' } } },
|
|
222
|
+
},
|
|
223
|
+
(0, fields_1.contentFormatField)(R, writeOps),
|
|
224
|
+
(0, fields_1.readFormatField)(R, ['get', 'getAll']),
|
|
225
|
+
(0, fields_1.conditionalWriteField)(R, ['update', 'upsertByExternalId']),
|
|
226
|
+
...(0, fields_1.changeScanFields)(R, 'getAll'),
|
|
227
|
+
...(0, descriptions_1.returnAll)(R, 'getAll'),
|
|
228
|
+
];
|
|
229
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/KibiConnect/resources/task/index.ts"],"names":[],"mappings":";;;AAEA,4DAAkE;AAClE,gDAO6B;AAE7B,MAAM,CAAC,GAAG,MAAM,CAAC;AACjB,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAE/B,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;AAE5D,MAAM,cAAc,GAAG;IACtB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACzC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,M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,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,4BAA4B,EAAE,EAAE,EAAE;KACtE;IAED;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EACV,qGAAqG;QACtG,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,2BAAkB,EAAC,CAAC,EAAE,QAAQ,CAAC;IAC/B,IAAA,wBAAe,EAAC,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrC,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,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userDescription = void 0;
|
|
4
|
+
const descriptions_1 = require("../../shared/descriptions");
|
|
5
|
+
const showOnlyForUsers = {
|
|
6
|
+
resource: ['user'],
|
|
7
|
+
};
|
|
8
|
+
exports.userDescription = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions: { show: showOnlyForUsers },
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Get',
|
|
18
|
+
value: 'get',
|
|
19
|
+
action: 'Get a user',
|
|
20
|
+
description: 'Retrieve one entry from the employee directory',
|
|
21
|
+
routing: {
|
|
22
|
+
request: { method: 'GET', url: '=/users/{{$parameter.userId}}' },
|
|
23
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get Many',
|
|
28
|
+
value: 'getAll',
|
|
29
|
+
action: 'Get many users',
|
|
30
|
+
description: 'Retrieve the employee directory',
|
|
31
|
+
routing: {
|
|
32
|
+
request: { method: 'GET', url: '/users' },
|
|
33
|
+
output: { postReceive: descriptions_1.unwrapData },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
default: 'getAll',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'User',
|
|
41
|
+
name: 'userId',
|
|
42
|
+
type: 'resourceLocator',
|
|
43
|
+
required: true,
|
|
44
|
+
default: { mode: 'list', value: '' },
|
|
45
|
+
description: 'Whose directory entry to read',
|
|
46
|
+
displayOptions: { show: { ...showOnlyForUsers, operation: ['get'] } },
|
|
47
|
+
modes: [
|
|
48
|
+
{
|
|
49
|
+
displayName: 'From List',
|
|
50
|
+
name: 'list',
|
|
51
|
+
type: 'list',
|
|
52
|
+
typeOptions: { searchListMethod: 'getUsers', searchable: true },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'By ID',
|
|
56
|
+
name: 'id',
|
|
57
|
+
type: 'string',
|
|
58
|
+
hint: 'The user ULID — 26 characters',
|
|
59
|
+
placeholder: '01J8ZP9K7QW3X2YB5M4N6R8TVC',
|
|
60
|
+
validation: [
|
|
61
|
+
{
|
|
62
|
+
type: 'regex',
|
|
63
|
+
properties: {
|
|
64
|
+
regex: '^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$',
|
|
65
|
+
errorMessage: 'A Kibi ID is 26 characters (a ULID) — this does not look like one',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Search',
|
|
74
|
+
name: 'search',
|
|
75
|
+
type: 'string',
|
|
76
|
+
default: '',
|
|
77
|
+
placeholder: 'Müller',
|
|
78
|
+
description: 'Filter the directory by name, case-insensitively',
|
|
79
|
+
displayOptions: { show: { ...showOnlyForUsers, operation: ['getAll'] } },
|
|
80
|
+
routing: { request: { qs: { search: '={{ $value }}' } } },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'This is the public employee directory: name, department, position and picture. It never carries private data such as a home address or a date of birth, whatever the token\'s scopes are.',
|
|
84
|
+
name: 'directoryNotice',
|
|
85
|
+
type: 'notice',
|
|
86
|
+
default: '',
|
|
87
|
+
displayOptions: { show: showOnlyForUsers },
|
|
88
|
+
},
|
|
89
|
+
...(0, descriptions_1.returnAll)('user', 'getAll'),
|
|
90
|
+
];
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/KibiConnect/resources/user/index.ts"],"names":[],"mappings":";;;AAEA,4DAAkE;AAElE,MAAM,gBAAgB,GAAG;IACxB,QAAQ,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC;AAEW,QAAA,eAAe,GAAsB;IACjD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;QAC1C,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,YAAY;gBACpB,WAAW,EAAE,gDAAgD;gBAC7D,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,+BA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