n8n-nodes-basevn-timeoff 0.1.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.
- package/LICENSE.md +21 -0
- package/README.md +38 -0
- package/dist/credentials/TimeoffApi.credentials.d.ts +11 -0
- package/dist/credentials/TimeoffApi.credentials.d.ts.map +1 -0
- package/dist/credentials/TimeoffApi.credentials.js +49 -0
- package/dist/credentials/TimeoffApi.credentials.js.map +1 -0
- package/dist/icons/timeoff.svg +4 -0
- package/dist/nodes/Timeoff/Timeoff.node.d.ts +6 -0
- package/dist/nodes/Timeoff/Timeoff.node.d.ts.map +1 -0
- package/dist/nodes/Timeoff/Timeoff.node.js +161 -0
- package/dist/nodes/Timeoff/Timeoff.node.js.map +1 -0
- package/dist/nodes/Timeoff/resources/group/get.d.ts +4 -0
- package/dist/nodes/Timeoff/resources/group/get.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/group/get.js +32 -0
- package/dist/nodes/Timeoff/resources/group/get.js.map +1 -0
- package/dist/nodes/Timeoff/resources/group/index.d.ts +5 -0
- package/dist/nodes/Timeoff/resources/group/index.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/group/index.js +42 -0
- package/dist/nodes/Timeoff/resources/group/index.js.map +1 -0
- package/dist/nodes/Timeoff/resources/group/list.d.ts +4 -0
- package/dist/nodes/Timeoff/resources/group/list.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/group/list.js +31 -0
- package/dist/nodes/Timeoff/resources/group/list.js.map +1 -0
- package/dist/nodes/Timeoff/resources/index.d.ts +5 -0
- package/dist/nodes/Timeoff/resources/index.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/index.js +57 -0
- package/dist/nodes/Timeoff/resources/index.js.map +1 -0
- package/dist/nodes/Timeoff/resources/timeoff/get.d.ts +4 -0
- package/dist/nodes/Timeoff/resources/timeoff/get.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/timeoff/get.js +32 -0
- package/dist/nodes/Timeoff/resources/timeoff/get.js.map +1 -0
- package/dist/nodes/Timeoff/resources/timeoff/index.d.ts +5 -0
- package/dist/nodes/Timeoff/resources/timeoff/index.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/timeoff/index.js +42 -0
- package/dist/nodes/Timeoff/resources/timeoff/index.js.map +1 -0
- package/dist/nodes/Timeoff/resources/timeoff/list.d.ts +4 -0
- package/dist/nodes/Timeoff/resources/timeoff/list.d.ts.map +1 -0
- package/dist/nodes/Timeoff/resources/timeoff/list.js +119 -0
- package/dist/nodes/Timeoff/resources/timeoff/list.js.map +1 -0
- package/dist/nodes/Timeoff/shared/transport.d.ts +3 -0
- package/dist/nodes/Timeoff/shared/transport.d.ts.map +1 -0
- package/dist/nodes/Timeoff/shared/transport.js +23 -0
- package/dist/nodes/Timeoff/shared/transport.js.map +1 -0
- package/dist/nodes/Timeoff/shared/utils.d.ts +5 -0
- package/dist/nodes/Timeoff/shared/utils.d.ts.map +1 -0
- package/dist/nodes/Timeoff/shared/utils.js +27 -0
- package/dist/nodes/Timeoff/shared/utils.js.map +1 -0
- package/dist/timeoff.svg +4 -0
- package/package.json +45 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 QuangChinh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# n8n-nodes-basevn-timeoff
|
|
2
|
+
|
|
3
|
+
This is an n8n community node for BaseVN Timeoff API integration.
|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
10
|
+
|
|
11
|
+
## Operations
|
|
12
|
+
|
|
13
|
+
### Timeoff
|
|
14
|
+
- **List Timeoffs**: Get paginated list of timeoff records with filtering
|
|
15
|
+
- **Get Timeoff**: Get detailed information of a specific timeoff request
|
|
16
|
+
|
|
17
|
+
### Group
|
|
18
|
+
- **List Groups**: Get all groups in the Timeoff system
|
|
19
|
+
- **Get Group**: Get detailed information of a specific group
|
|
20
|
+
|
|
21
|
+
## Credentials
|
|
22
|
+
|
|
23
|
+
Configure the following credentials:
|
|
24
|
+
- **Domain**: Your BaseVN domain (e.g., `company.base.vn`)
|
|
25
|
+
- **Access Token**: Your Timeoff API access token
|
|
26
|
+
|
|
27
|
+
## Compatibility
|
|
28
|
+
|
|
29
|
+
Tested with n8n version 1.0+
|
|
30
|
+
|
|
31
|
+
## Resources
|
|
32
|
+
|
|
33
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
34
|
+
- [BaseVN Timeoff API Documentation](https://timeoff.base.vn)
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
[MIT](LICENSE.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, Icon, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TimeoffApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=TimeoffApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeoffApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/TimeoffApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,IAAI,EACJ,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,UAAW,YAAW,eAAe;IACjD,IAAI,SAAgB;IAEpB,WAAW,SAAiB;IAE5B,IAAI,EAAE,IAAI,CAA+B;IAEzC,gBAAgB,SAA6B;IAE7C,UAAU,EAAE,eAAe,EAAE,CAiB3B;IAEF,YAAY,EAAE,oBAAoB,CAGhC;IAEF,IAAI,EAAE,sBAAsB,CAa1B;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeoffApi = void 0;
|
|
4
|
+
class TimeoffApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'timeoffApi';
|
|
7
|
+
this.displayName = 'Timeoff API';
|
|
8
|
+
this.icon = 'file:../icons/timeoff.svg';
|
|
9
|
+
this.documentationUrl = 'https://timeoff.base.vn';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Domain',
|
|
13
|
+
name: 'domain',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
placeholder: 'company.base.vn',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Access Token',
|
|
21
|
+
name: 'accessToken',
|
|
22
|
+
type: 'string',
|
|
23
|
+
typeOptions: { password: true },
|
|
24
|
+
default: '',
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
this.authenticate = {
|
|
29
|
+
type: 'generic',
|
|
30
|
+
properties: {},
|
|
31
|
+
};
|
|
32
|
+
this.test = {
|
|
33
|
+
request: {
|
|
34
|
+
baseURL: '=https://timeoff.{{$credentials.domain}}/extapi/v1',
|
|
35
|
+
url: '/group/list',
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: {
|
|
38
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
39
|
+
},
|
|
40
|
+
body: {
|
|
41
|
+
access_token: '={{$credentials.accessToken}}',
|
|
42
|
+
page: 0,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.TimeoffApi = TimeoffApi;
|
|
49
|
+
//# sourceMappingURL=TimeoffApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeoffApi.credentials.js","sourceRoot":"","sources":["../../credentials/TimeoffApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QAEpB,gBAAW,GAAG,aAAa,CAAC;QAE5B,SAAI,GAAS,2BAA2B,CAAC;QAEzC,qBAAgB,GAAG,yBAAyB,CAAC;QAE7C,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iBAAiB;gBAC9B,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,oDAAoD;gBAC7D,GAAG,EAAE,aAAa;gBAClB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACR,cAAc,EAAE,mCAAmC;iBACnD;gBACD,IAAI,EAAE;oBACL,YAAY,EAAE,+BAA+B;oBAC7C,IAAI,EAAE,CAAC;iBACP;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA/CD,gCA+CC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="64" height="64">
|
|
3
|
+
<path d="M0 0 C8.04071716 5.46768767 14.35713546 11.78672485 16.953125 21.328125 C17.97008074 32.73931439 17.08780568 41.52074309 9.640625 50.578125 C3.75028057 56.89640044 -1.9995096 60.87830798 -10.81640625 61.6640625 C-22.23808647 61.92046185 -29.76998744 60.10045244 -38.2578125 52.1875 C-45.41707366 44.7468705 -47.46537447 37.63799487 -47.41040039 27.37304688 C-47.154444 17.46241552 -43.06295379 11.07888989 -36.046875 4.328125 C-26.55128048 -3.80505814 -11.27874483 -6.1129075 0 0 Z M-15.046875 9.328125 C-15.33409424 9.84721436 -15.62131348 10.36630371 -15.91723633 10.90112305 C-17.2303724 13.27312887 -18.54486179 15.64438211 -19.859375 18.015625 C-20.53709961 19.24055664 -20.53709961 19.24055664 -21.22851562 20.49023438 C-23.05984871 23.79198089 -24.88836473 27.07118222 -26.87109375 30.28515625 C-28.21314619 32.22416882 -28.21314619 32.22416882 -28.046875 34.328125 C-24.086875 34.328125 -20.126875 34.328125 -16.046875 34.328125 C-16.046875 39.278125 -16.046875 44.228125 -16.046875 49.328125 C-13.44249044 46.72374044 -12.08063912 44.88183145 -10.34765625 41.73046875 C-9.86103516 40.84681641 -9.37441406 39.96316406 -8.87304688 39.05273438 C-8.37353516 38.13298828 -7.87402344 37.21324219 -7.359375 36.265625 C-6.84826172 35.34201172 -6.33714844 34.41839844 -5.81054688 33.46679688 C-3.11780521 29.13403596 -3.11780521 29.13403596 -2.046875 24.328125 C-6.006875 24.328125 -9.966875 24.328125 -14.046875 24.328125 C-14.046875 19.378125 -14.046875 14.428125 -14.046875 9.328125 C-14.376875 9.328125 -14.706875 9.328125 -15.046875 9.328125 Z " fill="#E45038" transform="translate(47.046875,2.671875)"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class Timeoff implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Timeoff.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeoff.node.d.ts","sourceRoot":"","sources":["../../../nodes/Timeoff/Timeoff.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAItB,qBAAa,OAAQ,YAAW,SAAS;IACxC,WAAW,EAAE,oBAAoB,CA6E/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA4CvE"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Timeoff = void 0;
|
|
37
|
+
const resources = __importStar(require("./resources"));
|
|
38
|
+
class Timeoff {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.description = {
|
|
41
|
+
displayName: 'BaseVN - App Timeoff',
|
|
42
|
+
name: 'timeoff',
|
|
43
|
+
icon: 'file:../../icons/timeoff.svg',
|
|
44
|
+
group: ['transform'],
|
|
45
|
+
version: 1,
|
|
46
|
+
usableAsTool: true,
|
|
47
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
48
|
+
description: 'Interact with BaseVN Timeoff API',
|
|
49
|
+
defaults: {
|
|
50
|
+
name: 'BaseVN - App Timeoff',
|
|
51
|
+
},
|
|
52
|
+
inputs: ['main'],
|
|
53
|
+
outputs: ['main'],
|
|
54
|
+
credentials: [
|
|
55
|
+
{
|
|
56
|
+
name: 'timeoffApi',
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
properties: [
|
|
61
|
+
...resources.description,
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Operation',
|
|
64
|
+
name: 'operation',
|
|
65
|
+
type: 'options',
|
|
66
|
+
noDataExpression: true,
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: {
|
|
69
|
+
resource: ['timeoff'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
name: 'Get Timeoff',
|
|
75
|
+
value: 'get',
|
|
76
|
+
description: 'Get detailed information of a timeoff request',
|
|
77
|
+
action: 'Get a timeoff',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'List Timeoffs',
|
|
81
|
+
value: 'list',
|
|
82
|
+
description: 'Get paginated list of timeoff records',
|
|
83
|
+
action: 'List timeoffs',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
default: 'list',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Operation',
|
|
90
|
+
name: 'operation',
|
|
91
|
+
type: 'options',
|
|
92
|
+
noDataExpression: true,
|
|
93
|
+
displayOptions: {
|
|
94
|
+
show: {
|
|
95
|
+
resource: ['group'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
options: [
|
|
99
|
+
{
|
|
100
|
+
name: 'Get Group',
|
|
101
|
+
value: 'get',
|
|
102
|
+
description: 'Get detailed information of a group',
|
|
103
|
+
action: 'Get a group',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'List Groups',
|
|
107
|
+
value: 'list',
|
|
108
|
+
description: 'Get all groups in the system',
|
|
109
|
+
action: 'List groups',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
default: 'list',
|
|
113
|
+
},
|
|
114
|
+
...resources.timeoff.description,
|
|
115
|
+
...resources.group.description,
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async execute() {
|
|
120
|
+
const items = this.getInputData();
|
|
121
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
122
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
123
|
+
let responseData;
|
|
124
|
+
const returnData = [];
|
|
125
|
+
for (let i = 0; i < items.length; i++) {
|
|
126
|
+
try {
|
|
127
|
+
if (resource === 'timeoff') {
|
|
128
|
+
if (operation === 'list') {
|
|
129
|
+
responseData = await resources.timeoff.list.execute.call(this, i);
|
|
130
|
+
}
|
|
131
|
+
else if (operation === 'get') {
|
|
132
|
+
responseData = await resources.timeoff.get.execute.call(this, i);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (resource === 'group') {
|
|
136
|
+
if (operation === 'list') {
|
|
137
|
+
responseData = await resources.group.list.execute.call(this, i);
|
|
138
|
+
}
|
|
139
|
+
else if (operation === 'get') {
|
|
140
|
+
responseData = await resources.group.get.execute.call(this, i);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (responseData) {
|
|
144
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
145
|
+
returnData.push(...executionData);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
if (this.continueOnFail()) {
|
|
150
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
151
|
+
returnData.push({ json: { error: message } });
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return [returnData];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.Timeoff = Timeoff;
|
|
161
|
+
//# sourceMappingURL=Timeoff.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeoff.node.js","sourceRoot":"","sources":["../../../nodes/Timeoff/Timeoff.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,uDAAyC;AAEzC,MAAa,OAAO;IAApB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,8BAA8B;YACpC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE;gBACT,IAAI,EAAE,sBAAsB;aAC5B;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX,GAAG,SAAS,CAAC,WAAW;gBACxB;oBACC,WAAW,EAAE,WAAW;oBACxB,IAA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,EAAE,CACzB,CAAC;oBAEF,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;gBACnC,CAAC;YACF,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACzB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;oBACzE,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;oBAC9C,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA5HD,0BA4HC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: INodeProperties[];
|
|
3
|
+
export declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
|
|
4
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/group/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI3F,eAAO,MAAM,WAAW,EAAE,eAAe,EAexC,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAWnG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../shared/transport");
|
|
6
|
+
const utils_1 = require("../../shared/utils");
|
|
7
|
+
exports.description = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Group ID',
|
|
10
|
+
name: 'groupId',
|
|
11
|
+
type: 'number',
|
|
12
|
+
required: true,
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['group'],
|
|
16
|
+
operation: ['get'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
default: 0,
|
|
20
|
+
description: 'ID of the group',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
async function execute(index) {
|
|
24
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
25
|
+
const body = {
|
|
26
|
+
id: groupId,
|
|
27
|
+
};
|
|
28
|
+
const response = await transport_1.timeoffApiRequest.call(this, 'POST', '/group/get', body);
|
|
29
|
+
const data = (0, utils_1.processResponse)(response);
|
|
30
|
+
return [{ json: Array.isArray(data) ? data[0] : data }];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/group/get.ts"],"names":[],"mappings":";;;AAqBA,0BAWC;AA/BD,sDAA2D;AAC3D,8CAAqD;AAExC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;gBACnB,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,iBAAiB;KAC9B;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAA0B,KAAa;IACnE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAW,CAAC;IAElE,MAAM,IAAI,GAAG;QACZ,EAAE,EAAE,OAAO;KACX,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAChF,MAAM,IAAI,GAAG,IAAA,uBAAe,EAAC,QAAQ,CAAC,CAAC;IAEvC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/group/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAErB,eAAO,MAAM,WAAW,0CAA4C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.list = exports.get = void 0;
|
|
37
|
+
const get = __importStar(require("./get"));
|
|
38
|
+
exports.get = get;
|
|
39
|
+
const list = __importStar(require("./list"));
|
|
40
|
+
exports.list = list;
|
|
41
|
+
exports.description = [...list.description, ...get.description];
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAGpB,kBAAG;AAFZ,6CAA+B;AAEjB,oBAAI;AAEL,QAAA,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: INodeProperties[];
|
|
3
|
+
export declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
|
|
4
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/group/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI3F,eAAO,MAAM,WAAW,EAAE,eAAe,EAcxC,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAWnG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../shared/transport");
|
|
6
|
+
const utils_1 = require("../../shared/utils");
|
|
7
|
+
exports.description = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Page',
|
|
10
|
+
name: 'page',
|
|
11
|
+
type: 'number',
|
|
12
|
+
displayOptions: {
|
|
13
|
+
show: {
|
|
14
|
+
resource: ['group'],
|
|
15
|
+
operation: ['list'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
default: 0,
|
|
19
|
+
description: 'Page number (default 20 items per page)',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
async function execute(index) {
|
|
23
|
+
const page = this.getNodeParameter('page', index, 0);
|
|
24
|
+
const body = {
|
|
25
|
+
page,
|
|
26
|
+
};
|
|
27
|
+
const response = await transport_1.timeoffApiRequest.call(this, 'POST', '/group/list', body);
|
|
28
|
+
const data = (0, utils_1.processResponse)(response);
|
|
29
|
+
return Array.isArray(data) ? data.map((item) => ({ json: item })) : [{ json: data }];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/group/list.ts"],"names":[],"mappings":";;;AAoBA,0BAWC;AA9BD,sDAA2D;AAC3D,8CAAqD;AAExC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;gBACnB,SAAS,EAAE,CAAC,MAAM,CAAC;aACnB;SACD;QACD,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,yCAAyC;KACtD;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAA0B,KAAa;IACnE,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAW,CAAC;IAE/D,MAAM,IAAI,GAAG;QACZ,IAAI;KACJ,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IACjF,MAAM,IAAI,GAAG,IAAA,uBAAe,EAAC,QAAQ,CAAC,CAAC;IAEvC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../nodes/Timeoff/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAoBrC,eAAO,MAAM,WAAW,EAAE,eAAe,EAA0B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.timeoff = exports.group = void 0;
|
|
37
|
+
exports.group = __importStar(require("./group"));
|
|
38
|
+
exports.timeoff = __importStar(require("./timeoff"));
|
|
39
|
+
const resourceDescription = {
|
|
40
|
+
displayName: 'Resource',
|
|
41
|
+
name: 'resource',
|
|
42
|
+
type: 'options',
|
|
43
|
+
noDataExpression: true,
|
|
44
|
+
options: [
|
|
45
|
+
{
|
|
46
|
+
name: 'Group',
|
|
47
|
+
value: 'group',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Timeoff',
|
|
51
|
+
value: 'timeoff',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
default: 'timeoff',
|
|
55
|
+
};
|
|
56
|
+
exports.description = [resourceDescription];
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/Timeoff/resources/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAiC;AACjC,qDAAqC;AAErC,MAAM,mBAAmB,GAAoB;IAC5C,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE;QACR;YACC,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO;SACd;QACD;YACC,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SAChB;KACD;IACD,OAAO,EAAE,SAAS;CAClB,CAAC;AAEW,QAAA,WAAW,GAAsB,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: INodeProperties[];
|
|
3
|
+
export declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
|
|
4
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/timeoff/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI3F,eAAO,MAAM,WAAW,EAAE,eAAe,EAexC,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAWnG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../shared/transport");
|
|
6
|
+
const utils_1 = require("../../shared/utils");
|
|
7
|
+
exports.description = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Timeoff ID',
|
|
10
|
+
name: 'timeoffId',
|
|
11
|
+
type: 'number',
|
|
12
|
+
required: true,
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['timeoff'],
|
|
16
|
+
operation: ['get'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
default: 0,
|
|
20
|
+
description: 'ID of the timeoff request',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
async function execute(index) {
|
|
24
|
+
const timeoffId = this.getNodeParameter('timeoffId', index);
|
|
25
|
+
const body = {
|
|
26
|
+
id: timeoffId,
|
|
27
|
+
};
|
|
28
|
+
const response = await transport_1.timeoffApiRequest.call(this, 'POST', '/timeoff/get', body);
|
|
29
|
+
const data = (0, utils_1.processResponse)(response);
|
|
30
|
+
return [{ json: Array.isArray(data) ? data[0] : data }];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/timeoff/get.ts"],"names":[],"mappings":";;;AAqBA,0BAWC;AA/BD,sDAA2D;AAC3D,8CAAqD;AAExC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,2BAA2B;KACxC;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAA0B,KAAa;IACnE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAW,CAAC;IAEtE,MAAM,IAAI,GAAG;QACZ,EAAE,EAAE,SAAS;KACb,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAClF,MAAM,IAAI,GAAG,IAAA,uBAAe,EAAC,QAAQ,CAAC,CAAC;IAEvC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/timeoff/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAErB,eAAO,MAAM,WAAW,0CAA4C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.list = exports.get = void 0;
|
|
37
|
+
const get = __importStar(require("./get"));
|
|
38
|
+
exports.get = get;
|
|
39
|
+
const list = __importStar(require("./list"));
|
|
40
|
+
exports.list = list;
|
|
41
|
+
exports.description = [...list.description, ...get.description];
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/timeoff/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAGpB,kBAAG;AAFZ,6CAA+B;AAEjB,oBAAI;AAEL,QAAA,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: INodeProperties[];
|
|
3
|
+
export declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
|
|
4
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/timeoff/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIxG,eAAO,MAAM,WAAW,EAAE,eAAe,EAkGxC,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAenG"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../shared/transport");
|
|
6
|
+
const utils_1 = require("../../shared/utils");
|
|
7
|
+
exports.description = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Users',
|
|
10
|
+
name: 'users',
|
|
11
|
+
type: 'string',
|
|
12
|
+
displayOptions: {
|
|
13
|
+
show: {
|
|
14
|
+
resource: ['timeoff'],
|
|
15
|
+
operation: ['list'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
default: '',
|
|
19
|
+
description: 'Filter by creator username (comma-separated)',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Page',
|
|
23
|
+
name: 'page',
|
|
24
|
+
type: 'number',
|
|
25
|
+
displayOptions: {
|
|
26
|
+
show: {
|
|
27
|
+
resource: ['timeoff'],
|
|
28
|
+
operation: ['list'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
default: 0,
|
|
32
|
+
description: 'Page index (start from 0)',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Additional Fields',
|
|
36
|
+
name: 'additionalFields',
|
|
37
|
+
type: 'collection',
|
|
38
|
+
placeholder: 'Add Field',
|
|
39
|
+
default: {},
|
|
40
|
+
displayOptions: {
|
|
41
|
+
show: {
|
|
42
|
+
resource: ['timeoff'],
|
|
43
|
+
operation: ['list'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
options: [
|
|
47
|
+
{
|
|
48
|
+
displayName: 'End Date From',
|
|
49
|
+
name: 'end_date_from',
|
|
50
|
+
type: 'string',
|
|
51
|
+
default: '',
|
|
52
|
+
placeholder: '01/01/2024',
|
|
53
|
+
description: 'End date from (DD/MM/YYYY)',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
displayName: 'End Date To',
|
|
57
|
+
name: 'end_date_to',
|
|
58
|
+
type: 'string',
|
|
59
|
+
default: '',
|
|
60
|
+
placeholder: '31/12/2024',
|
|
61
|
+
description: 'End date to (DD/MM/YYYY)',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Search Query',
|
|
65
|
+
name: 'q',
|
|
66
|
+
type: 'string',
|
|
67
|
+
default: '',
|
|
68
|
+
description: 'Search by name',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Start Date From',
|
|
72
|
+
name: 'start_date_from',
|
|
73
|
+
type: 'string',
|
|
74
|
+
default: '',
|
|
75
|
+
placeholder: '01/01/2024',
|
|
76
|
+
description: 'Start date from (DD/MM/YYYY)',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Start Date To',
|
|
80
|
+
name: 'start_date_to',
|
|
81
|
+
type: 'string',
|
|
82
|
+
default: '',
|
|
83
|
+
placeholder: '31/12/2024',
|
|
84
|
+
description: 'Start date to (DD/MM/YYYY)',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Status',
|
|
88
|
+
name: 's',
|
|
89
|
+
type: 'options',
|
|
90
|
+
default: 'approved',
|
|
91
|
+
options: [
|
|
92
|
+
{ name: 'Approved', value: 'approved' },
|
|
93
|
+
{ name: 'Canceled', value: 'canceled' },
|
|
94
|
+
{ name: 'Confirmed', value: 'confirmed' },
|
|
95
|
+
{ name: 'Overdue', value: 'overdue' },
|
|
96
|
+
{ name: 'Pending', value: 'pending' },
|
|
97
|
+
{ name: 'Rejected', value: 'rejected' },
|
|
98
|
+
{ name: 'Unconfirmed', value: 'unconfirmed' },
|
|
99
|
+
{ name: 'Warning', value: 'warning' },
|
|
100
|
+
],
|
|
101
|
+
description: 'Filter by status',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
async function execute(index) {
|
|
107
|
+
const users = this.getNodeParameter('users', index, '');
|
|
108
|
+
const page = this.getNodeParameter('page', index, 0);
|
|
109
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
110
|
+
const body = (0, utils_1.cleanBody)({
|
|
111
|
+
users,
|
|
112
|
+
page,
|
|
113
|
+
...additionalFields,
|
|
114
|
+
});
|
|
115
|
+
const response = await transport_1.timeoffApiRequest.call(this, 'POST', '/timeoff/list', body);
|
|
116
|
+
const data = (0, utils_1.processResponse)(response);
|
|
117
|
+
return Array.isArray(data) ? data.map((item) => ({ json: item })) : [{ json: data }];
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../nodes/Timeoff/resources/timeoff/list.ts"],"names":[],"mappings":";;;AAwGA,0BAeC;AAtHD,sDAA2D;AAC3D,8CAAgE;AAEnD,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,MAAM,CAAC;aACnB;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8CAA8C;KAC3D;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,MAAM,CAAC;aACnB;SACD;QACD,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,2BAA2B;KACxC;IACD;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QAC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
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IExecuteFunctions, IHttpRequestMethods, IDataObject } from 'n8n-workflow';
|
|
2
|
+
export declare function timeoffApiRequest(this: IExecuteFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject): Promise<IDataObject>;
|
|
3
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../nodes/Timeoff/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAExF,wBAAsB,iBAAiB,CACtC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,WAAgB,GACpB,OAAO,CAAC,WAAW,CAAC,CAsBtB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.timeoffApiRequest = timeoffApiRequest;
|
|
4
|
+
async function timeoffApiRequest(method, endpoint, body = {}) {
|
|
5
|
+
const credentials = await this.getCredentials('timeoffApi');
|
|
6
|
+
const domain = credentials.domain;
|
|
7
|
+
const accessToken = credentials.accessToken;
|
|
8
|
+
const url = `https://timeoff.${domain}/extapi/v1${endpoint}`;
|
|
9
|
+
const requestBody = {
|
|
10
|
+
access_token: accessToken,
|
|
11
|
+
...body,
|
|
12
|
+
};
|
|
13
|
+
const options = {
|
|
14
|
+
method,
|
|
15
|
+
url,
|
|
16
|
+
headers: {
|
|
17
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
18
|
+
},
|
|
19
|
+
body: requestBody,
|
|
20
|
+
};
|
|
21
|
+
return await this.helpers.httpRequest(options);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../../nodes/Timeoff/shared/transport.ts"],"names":[],"mappings":";;AAEA,8CA2BC;AA3BM,KAAK,UAAU,iBAAiB,CAEtC,MAA2B,EAC3B,QAAgB,EAChB,OAAoB,EAAE;IAEtB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC;IAC5C,MAAM,WAAW,GAAG,WAAW,CAAC,WAAqB,CAAC;IAEtD,MAAM,GAAG,GAAG,mBAAmB,MAAM,aAAa,QAAQ,EAAE,CAAC;IAE7D,MAAM,WAAW,GAAG;QACnB,YAAY,EAAE,WAAW;QACzB,GAAG,IAAI;KACP,CAAC;IAEF,MAAM,OAAO,GAAG;QACf,MAAM;QACN,GAAG;QACH,OAAO,EAAE;YACR,cAAc,EAAE,mCAAmC;SACnD;QACD,IAAI,EAAE,WAAW;KACjB,CAAC;IAEF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IDataObject } from 'n8n-workflow';
|
|
2
|
+
export declare function cleanBody(body: IDataObject): IDataObject;
|
|
3
|
+
export declare function processResponse(response: IDataObject): IDataObject | IDataObject[];
|
|
4
|
+
export declare function wrapData(data: IDataObject | IDataObject[]): IDataObject[];
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../nodes/Timeoff/shared/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAQxD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,EAAE,CAKlF;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,WAAW,EAAE,CAKzE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanBody = cleanBody;
|
|
4
|
+
exports.processResponse = processResponse;
|
|
5
|
+
exports.wrapData = wrapData;
|
|
6
|
+
function cleanBody(body) {
|
|
7
|
+
const cleaned = {};
|
|
8
|
+
for (const key in body) {
|
|
9
|
+
if (body[key] !== undefined && body[key] !== null && body[key] !== '') {
|
|
10
|
+
cleaned[key] = body[key];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return cleaned;
|
|
14
|
+
}
|
|
15
|
+
function processResponse(response) {
|
|
16
|
+
if (response.code === 1 && response.data) {
|
|
17
|
+
return response.data;
|
|
18
|
+
}
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
function wrapData(data) {
|
|
22
|
+
if (Array.isArray(data)) {
|
|
23
|
+
return data.map((item) => ({ json: item }));
|
|
24
|
+
}
|
|
25
|
+
return [{ json: data }];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../nodes/Timeoff/shared/utils.ts"],"names":[],"mappings":";;AAEA,8BAQC;AAED,0CAKC;AAED,4BAKC;AAtBD,SAAgB,SAAS,CAAC,IAAiB;IAC1C,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC;YACvE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAgB,eAAe,CAAC,QAAqB;IACpD,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC1C,OAAO,QAAQ,CAAC,IAAmC,CAAC;IACrD,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,SAAgB,QAAQ,CAAC,IAAiC;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACzB,CAAC"}
|
package/dist/timeoff.svg
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="64" height="64">
|
|
3
|
+
<path d="M0 0 C8.04071716 5.46768767 14.35713546 11.78672485 16.953125 21.328125 C17.97008074 32.73931439 17.08780568 41.52074309 9.640625 50.578125 C3.75028057 56.89640044 -1.9995096 60.87830798 -10.81640625 61.6640625 C-22.23808647 61.92046185 -29.76998744 60.10045244 -38.2578125 52.1875 C-45.41707366 44.7468705 -47.46537447 37.63799487 -47.41040039 27.37304688 C-47.154444 17.46241552 -43.06295379 11.07888989 -36.046875 4.328125 C-26.55128048 -3.80505814 -11.27874483 -6.1129075 0 0 Z M-15.046875 9.328125 C-15.33409424 9.84721436 -15.62131348 10.36630371 -15.91723633 10.90112305 C-17.2303724 13.27312887 -18.54486179 15.64438211 -19.859375 18.015625 C-20.53709961 19.24055664 -20.53709961 19.24055664 -21.22851562 20.49023438 C-23.05984871 23.79198089 -24.88836473 27.07118222 -26.87109375 30.28515625 C-28.21314619 32.22416882 -28.21314619 32.22416882 -28.046875 34.328125 C-24.086875 34.328125 -20.126875 34.328125 -16.046875 34.328125 C-16.046875 39.278125 -16.046875 44.228125 -16.046875 49.328125 C-13.44249044 46.72374044 -12.08063912 44.88183145 -10.34765625 41.73046875 C-9.86103516 40.84681641 -9.37441406 39.96316406 -8.87304688 39.05273438 C-8.37353516 38.13298828 -7.87402344 37.21324219 -7.359375 36.265625 C-6.84826172 35.34201172 -6.33714844 34.41839844 -5.81054688 33.46679688 C-3.11780521 29.13403596 -3.11780521 29.13403596 -2.046875 24.328125 C-6.006875 24.328125 -9.966875 24.328125 -14.046875 24.328125 C-14.046875 19.378125 -14.046875 14.428125 -14.046875 9.328125 C-14.376875 9.328125 -14.706875 9.328125 -15.046875 9.328125 Z " fill="#E45038" transform="translate(47.046875,2.671875)"/>
|
|
4
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-basevn-timeoff",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "n8n node for BaseVN Timeoff API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"basevn",
|
|
8
|
+
"timeoff"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://github.com/QuangChinhDE/n8n-nodes-basevn-timeoff",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "QuangChinh",
|
|
14
|
+
"email": "quangchinh.dev@gmail.com"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/QuangChinhDE/n8n-nodes-basevn-timeoff.git"
|
|
19
|
+
},
|
|
20
|
+
"main": "index.js",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "n8n-node build",
|
|
23
|
+
"lint": "n8n-node lint",
|
|
24
|
+
"release": "n8n-node release",
|
|
25
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"n8n": {
|
|
31
|
+
"n8nNodesApiVersion": 1,
|
|
32
|
+
"credentials": [
|
|
33
|
+
"dist/credentials/TimeoffApi.credentials.js"
|
|
34
|
+
],
|
|
35
|
+
"nodes": [
|
|
36
|
+
"dist/nodes/Timeoff/Timeoff.node.js"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@n8n/node-cli": "^0.19.0",
|
|
41
|
+
"@types/node": "^22.10.5",
|
|
42
|
+
"n8n-workflow": "^1.76.0",
|
|
43
|
+
"typescript": "~5.9.2"
|
|
44
|
+
}
|
|
45
|
+
}
|