@limetech/n8n-nodes-lime 2.6.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/credentials/index.ts +0 -1
- package/dist/credentials/index.d.ts +0 -1
- package/dist/credentials/index.js +0 -1
- package/dist/credentials/index.js.map +1 -1
- package/dist/nodes/index.d.ts +0 -1
- package/dist/nodes/index.js +0 -1
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/lime-forms/LimeFormsTrigger.node.js +3 -3
- package/dist/nodes/lime-forms/LimeFormsTrigger.node.js.map +1 -1
- package/dist/nodes/lime-forms/assets/lime-crm.svg +1 -0
- package/dist/package.json +0 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/nodes/index.ts +0 -1
- package/nodes/lime-forms/LimeFormsTrigger.node.ts +3 -3
- package/nodes/lime-forms/assets/lime-crm.svg +1 -0
- package/package.json +1 -9
- package/credentials/FortnoxApi.credentials.ts +0 -61
- package/dist/credentials/FortnoxApi.credentials.d.ts +0 -9
- package/dist/credentials/FortnoxApi.credentials.js +0 -57
- package/dist/credentials/FortnoxApi.credentials.js.map +0 -1
- package/dist/nodes/fortnox/Fortnox.node.d.ts +0 -5
- package/dist/nodes/fortnox/Fortnox.node.js +0 -95
- package/dist/nodes/fortnox/Fortnox.node.js.map +0 -1
- package/dist/nodes/fortnox/Fortnox.node.json +0 -18
- package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +0 -5
- package/dist/nodes/fortnox/FortnoxTrigger.node.js +0 -155
- package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +0 -1
- package/dist/nodes/fortnox/FortnoxTrigger.node.json +0 -18
- package/dist/nodes/fortnox/commons.d.ts +0 -25
- package/dist/nodes/fortnox/commons.js +0 -44
- package/dist/nodes/fortnox/commons.js.map +0 -1
- package/dist/nodes/fortnox/fortnoxLogo.svg +0 -15
- package/dist/nodes/fortnox/index.d.ts +0 -6
- package/dist/nodes/fortnox/index.js +0 -23
- package/dist/nodes/fortnox/index.js.map +0 -1
- package/dist/nodes/fortnox/model.d.ts +0 -20
- package/dist/nodes/fortnox/model.js +0 -3
- package/dist/nodes/fortnox/model.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/customers/filterParameters.js +0 -31
- package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/index.d.ts +0 -7
- package/dist/nodes/fortnox/resources/customers/index.js +0 -85
- package/dist/nodes/fortnox/resources/customers/index.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/model.d.ts +0 -99
- package/dist/nodes/fortnox/resources/customers/model.js +0 -3
- package/dist/nodes/fortnox/resources/customers/model.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +0 -281
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +0 -9
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +0 -38
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +0 -38
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +0 -68
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/index.d.ts +0 -5
- package/dist/nodes/fortnox/resources/customers/operations/index.js +0 -42
- package/dist/nodes/fortnox/resources/customers/operations/index.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +0 -261
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/customers/sortParameters.js +0 -30
- package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js +0 -72
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/index.d.ts +0 -7
- package/dist/nodes/fortnox/resources/invoice/index.js +0 -81
- package/dist/nodes/fortnox/resources/invoice/index.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +0 -193
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/model.d.ts +0 -147
- package/dist/nodes/fortnox/resources/invoice/model.js +0 -3
- package/dist/nodes/fortnox/resources/invoice/model.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +0 -64
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +0 -37
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +0 -92
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/index.d.ts +0 -4
- package/dist/nodes/fortnox/resources/invoice/operations/index.js +0 -41
- package/dist/nodes/fortnox/resources/invoice/operations/index.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +0 -64
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +0 -1
- package/dist/nodes/fortnox/transport/errorCodes.d.ts +0 -1
- package/dist/nodes/fortnox/transport/errorCodes.js +0 -50
- package/dist/nodes/fortnox/transport/errorCodes.js.map +0 -1
- package/dist/nodes/fortnox/transport/index.d.ts +0 -3
- package/dist/nodes/fortnox/transport/index.js +0 -76
- package/dist/nodes/fortnox/transport/index.js.map +0 -1
- package/dist/nodes/lime-forms/lime-forms.svg +0 -6
- package/nodes/fortnox/Fortnox.node.json +0 -18
- package/nodes/fortnox/Fortnox.node.ts +0 -102
- package/nodes/fortnox/FortnoxTrigger.node.json +0 -18
- package/nodes/fortnox/FortnoxTrigger.node.ts +0 -196
- package/nodes/fortnox/commons.ts +0 -94
- package/nodes/fortnox/fortnoxLogo.svg +0 -15
- package/nodes/fortnox/index.ts +0 -6
- package/nodes/fortnox/model.ts +0 -25
- package/nodes/fortnox/resources/customers/filterParameters.ts +0 -47
- package/nodes/fortnox/resources/customers/index.ts +0 -53
- package/nodes/fortnox/resources/customers/model.ts +0 -107
- package/nodes/fortnox/resources/customers/operations/create.operation.ts +0 -307
- package/nodes/fortnox/resources/customers/operations/delete.operation.ts +0 -49
- package/nodes/fortnox/resources/customers/operations/get.operation.ts +0 -50
- package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +0 -79
- package/nodes/fortnox/resources/customers/operations/index.ts +0 -5
- package/nodes/fortnox/resources/customers/operations/update.operation.ts +0 -288
- package/nodes/fortnox/resources/customers/sortParameters.ts +0 -32
- package/nodes/fortnox/resources/invoice/filterParameters.ts +0 -88
- package/nodes/fortnox/resources/invoice/index.ts +0 -49
- package/nodes/fortnox/resources/invoice/invoiceParameters.ts +0 -214
- package/nodes/fortnox/resources/invoice/model.ts +0 -156
- package/nodes/fortnox/resources/invoice/operations/create.operation.ts +0 -71
- package/nodes/fortnox/resources/invoice/operations/get.operation.ts +0 -50
- package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +0 -100
- package/nodes/fortnox/resources/invoice/operations/index.ts +0 -4
- package/nodes/fortnox/resources/invoice/operations/update.operation.ts +0 -79
- package/nodes/fortnox/transport/errorCodes.ts +0 -62
- package/nodes/fortnox/transport/index.ts +0 -106
- package/nodes/lime-forms/lime-forms.svg +0 -6
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.properties = exports.description = void 0;
|
|
4
|
-
exports.execute = execute;
|
|
5
|
-
const transport_1 = require("../../../transport");
|
|
6
|
-
const filterParameters_1 = require("../filterParameters");
|
|
7
|
-
exports.description = {
|
|
8
|
-
name: 'Get Many',
|
|
9
|
-
value: 'getAll',
|
|
10
|
-
description: 'Retrieve a list of invoices',
|
|
11
|
-
action: 'Get list of documents',
|
|
12
|
-
};
|
|
13
|
-
exports.properties = [
|
|
14
|
-
{
|
|
15
|
-
displayName: 'Filter By',
|
|
16
|
-
name: 'filterParameters',
|
|
17
|
-
type: 'collection',
|
|
18
|
-
placeholder: 'Add Parameter',
|
|
19
|
-
default: {},
|
|
20
|
-
displayOptions: {
|
|
21
|
-
show: {
|
|
22
|
-
resource: ['invoice'],
|
|
23
|
-
operation: ['getAll'],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
options: filterParameters_1.filterParameters,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
displayName: 'Sort By',
|
|
30
|
-
name: 'sortParameters',
|
|
31
|
-
type: 'options',
|
|
32
|
-
default: '',
|
|
33
|
-
displayOptions: {
|
|
34
|
-
show: {
|
|
35
|
-
resource: ['invoice'],
|
|
36
|
-
operation: ['getAll'],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
options: [
|
|
40
|
-
{
|
|
41
|
-
name: '',
|
|
42
|
-
value: '',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'Customer Name',
|
|
46
|
-
value: 'customername',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'Customer Number',
|
|
50
|
-
value: 'customernumber',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Document Number',
|
|
54
|
-
value: 'documentnumber',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'Invoice Date',
|
|
58
|
-
value: 'invoicedate',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'OCR',
|
|
62
|
-
value: 'ocr',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'Total',
|
|
66
|
-
value: 'total',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
|
-
async function execute(i) {
|
|
72
|
-
const filterParameters = this.getNodeParameter('filterParameters', i, {});
|
|
73
|
-
const sortParameters = this.getNodeParameter('sortParameters', i, '');
|
|
74
|
-
const qs = {};
|
|
75
|
-
if (filterParameters) {
|
|
76
|
-
for (const [key, value] of Object.entries(filterParameters)) {
|
|
77
|
-
if (value !== '' && value !== undefined && value !== null) {
|
|
78
|
-
qs[key] = value;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (sortParameters) {
|
|
83
|
-
qs['sortby'] = sortParameters;
|
|
84
|
-
}
|
|
85
|
-
const endpoint = 'invoices';
|
|
86
|
-
return await (0, transport_1.apiRequest)(this, {
|
|
87
|
-
method: 'GET',
|
|
88
|
-
endpoint: endpoint,
|
|
89
|
-
qs: qs,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=getAll.operation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAll.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox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EK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEtE,MAAM,EAAE,GAAgB,EAAE,CAAC;IAE3B,IAAI,gBAAgB,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1D,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACxD,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACpB,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,cAAc,EAAE,CAAC;QACjB,EAAE,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC;IAClC,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC;IAE5B,OAAO,MAAM,IAAA,sBAAU,EAAyB,IAAI,EAAE;QAClD,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,QAAQ;QAClB,EAAE,EAAE,EAAE;KACT,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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.updateSingleInvoice = exports.getManyInvoices = exports.getSingleInvoice = exports.createSingleInvoice = void 0;
|
|
37
|
-
exports.createSingleInvoice = __importStar(require("./create.operation"));
|
|
38
|
-
exports.getSingleInvoice = __importStar(require("./get.operation"));
|
|
39
|
-
exports.getManyInvoices = __importStar(require("./getAll.operation"));
|
|
40
|
-
exports.updateSingleInvoice = __importStar(require("./update.operation"));
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/invoice/operations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA0D;AAC1D,oEAAoD;AACpD,sEAAsD;AACtD,0EAA0D"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { CreateInvoiceResponse } from '../model';
|
|
3
|
-
export declare const description: {
|
|
4
|
-
name: string;
|
|
5
|
-
value: string;
|
|
6
|
-
description: string;
|
|
7
|
-
action: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const properties: INodeProperties[];
|
|
10
|
-
export declare function execute(this: IExecuteFunctions, i: number): Promise<CreateInvoiceResponse>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.properties = exports.description = void 0;
|
|
4
|
-
exports.execute = execute;
|
|
5
|
-
const transport_1 = require("../../../transport");
|
|
6
|
-
const invoiceParameters_1 = require("../invoiceParameters");
|
|
7
|
-
exports.description = {
|
|
8
|
-
name: 'Update',
|
|
9
|
-
value: 'update',
|
|
10
|
-
description: 'Update the invoice',
|
|
11
|
-
action: 'Update the document',
|
|
12
|
-
};
|
|
13
|
-
exports.properties = [
|
|
14
|
-
{
|
|
15
|
-
displayName: 'Document Number',
|
|
16
|
-
name: 'documentNumber',
|
|
17
|
-
type: 'string',
|
|
18
|
-
required: true,
|
|
19
|
-
default: '',
|
|
20
|
-
displayOptions: {
|
|
21
|
-
show: {
|
|
22
|
-
resource: ['invoice'],
|
|
23
|
-
operation: ['update'],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
displayName: 'Add Parameters',
|
|
29
|
-
name: 'createParameters',
|
|
30
|
-
type: 'collection',
|
|
31
|
-
placeholder: 'Add Parameter',
|
|
32
|
-
default: {},
|
|
33
|
-
displayOptions: {
|
|
34
|
-
show: {
|
|
35
|
-
resource: ['invoice'],
|
|
36
|
-
operation: ['update'],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
options: invoiceParameters_1.invoiceParameters,
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
async function execute(i) {
|
|
43
|
-
const documentNumber = this.getNodeParameter('documentNumber', i, {});
|
|
44
|
-
const updateParameters = this.getNodeParameter('invoiceParameters', i, {});
|
|
45
|
-
const body = {
|
|
46
|
-
Invoice: {},
|
|
47
|
-
};
|
|
48
|
-
if (updateParameters) {
|
|
49
|
-
for (const [key, value] of Object.entries(updateParameters)) {
|
|
50
|
-
if (value !== '' && value !== undefined && value !== null) {
|
|
51
|
-
body['Invoice'][key] = value;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const endpoint = `invoices/${encodeURIComponent(documentNumber)}`;
|
|
56
|
-
return await (0, transport_1.apiRequest)(this, {
|
|
57
|
-
method: 'PUT',
|
|
58
|
-
endpoint: endpoint,
|
|
59
|
-
body: body,
|
|
60
|
-
}, {
|
|
61
|
-
id: documentNumber,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=update.operation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/invoice/operations/update.operation.ts"],"names":[],"mappings":";;;AA0CA,0BAoCC;AA7ED,kDAAgD;AAEhD,4DAAyD;AAE5C,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,oBAAoB;IACjC,MAAM,EAAE,qBAAqB;CAChC,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAA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0 @@
|
|
|
1
|
-
export declare function translateErrorCode(errorCode: number): string;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.translateErrorCode = translateErrorCode;
|
|
4
|
-
const errorMessages = {
|
|
5
|
-
1000003: 'System exception: Something went wrong on our end, please contact our support',
|
|
6
|
-
1000030: 'Invalid response type: The provided response type(Accept) was invalid.',
|
|
7
|
-
1000031: 'Invalid content type: The provided content type was invalid.',
|
|
8
|
-
2000106: 'The value needs to be alphanumeric.',
|
|
9
|
-
2000108: 'The value needs to be numeric.',
|
|
10
|
-
2000134: 'The value needs to be boolean',
|
|
11
|
-
2000310: 'The Client-Secret or the Access-Token is either missing or is incorrect.',
|
|
12
|
-
2000311: 'The Client-Secret or the Access-Token is either missing or is incorrect.',
|
|
13
|
-
2000359: 'The value contains invalid characters.',
|
|
14
|
-
2000588: 'A parameter is invalid. Read more about parameters in the Parameters page.',
|
|
15
|
-
2000637: 'Customer number 1 is/has already been used and is reserved even if it has been deleted.',
|
|
16
|
-
2000729: 'A valid identifier was not provided.',
|
|
17
|
-
2001103: 'The requested Fortnox account does not have a license to use the API.',
|
|
18
|
-
2001392: 'The request body was empty or contained incorrect data.',
|
|
19
|
-
2001740: 'The XML object contained an error.',
|
|
20
|
-
2002115: 'The JSON object contained an error.',
|
|
21
|
-
2001304: 'Could not find Account used in the request/attached to an element.',
|
|
22
|
-
2001399: 'Invalid Field name',
|
|
23
|
-
2001101: 'There is no active licens for the desired scope.',
|
|
24
|
-
2000663: 'No access to the current scope.',
|
|
25
|
-
2003095: 'Account is missing for Purchase SE reversed tax liability, in predefined accounts.',
|
|
26
|
-
2000755: 'Supplier invoice debit and credit does not balance',
|
|
27
|
-
2003115: 'Tax Rows for VAT type REVERSE must be marked with CODE',
|
|
28
|
-
2003124: 'Only order that has been delivered can be marked as warehouseready',
|
|
29
|
-
2003125: 'A document that has been set to warehouseready can not be modified.',
|
|
30
|
-
2003126: 'Delviered date can not be later than todays date.',
|
|
31
|
-
2003241: 'Migration has allready been started or finished.',
|
|
32
|
-
2003275: 'Not authorized',
|
|
33
|
-
2003277: 'Was not found in the warehouse module.',
|
|
34
|
-
2003399: 'The document is voided in the warehouse module',
|
|
35
|
-
2003127: 'An error has occured in the warehouse module',
|
|
36
|
-
2000204: 'The customer in the request is not available in the customer resource.',
|
|
37
|
-
2000433: 'The customer in the request is not available in the customer resource.',
|
|
38
|
-
2001302: 'Could not find article used in request',
|
|
39
|
-
2000428: 'Could not find article used in request',
|
|
40
|
-
2000865: 'An incorrect sort field has been used.',
|
|
41
|
-
2000587: 'An invalid filter has been used.',
|
|
42
|
-
2001422: 'Invalid currency.',
|
|
43
|
-
2004195: 'VAT number must be entered for selected VAT type.',
|
|
44
|
-
2004194: 'Invalid VAT number.',
|
|
45
|
-
2001314: 'Invalid cost center.',
|
|
46
|
-
};
|
|
47
|
-
function translateErrorCode(errorCode) {
|
|
48
|
-
return errorMessages[errorCode] || 'Unknown error code';
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=errorCodes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorCodes.js","sourceRoot":"","sources":["../../../../nodes/fortnox/transport/errorCodes.ts"],"names":[],"mappings":";;AA2DA,gDAEC;AA3DD,MAAM,aAAa,GAA8B;IAC7C,OAAO,EACH,+EAA+E;IACnF,OAAO,EACH,wEAAwE;IAC5E,OAAO,EAAE,8DAA8D;IACvE,OAAO,EAAE,qCAAqC;IAC9C,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,+BAA+B;IACxC,OAAO,EACH,0EAA0E;IAC9E,OAAO,EACH,0EAA0E;IAC9E,OAAO,EAAE,wCAAwC;IACjD,OAAO,EACH,4EAA4E;IAChF,OAAO,EACH,yFAAyF;IAC7F,OAAO,EAAE,sCAAsC;IAC/C,OAAO,EACH,uEAAuE;IAC3E,OAAO,EAAE,yDAAyD;IAClE,OAAO,EAAE,oCAAoC;IAC7C,OAAO,EAAE,qCAAqC;IAC9C,OAAO,EACH,oEAAoE;IACxE,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EACH,oFAAoF;IACxF,OAAO,EAAE,oDAAoD;IAC7D,OAAO,EAAE,wDAAwD;IACjE,OAAO,EACH,oEAAoE;IACxE,OAAO,EACH,qEAAqE;IACzE,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,8CAA8C;IACvD,OAAO,EACH,wEAAwE;IAC5E,OAAO,EACH,wEAAwE;IAC5E,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,sBAAsB;CAClC,CAAC;AAEF,SAAgB,kBAAkB,CAAC,SAAiB;IAChD,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,oBAAoB,CAAC;AAC5D,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
|
|
2
|
-
export declare const FORTNOX_BASE_URL = "https://api.fortnox.se/3/";
|
|
3
|
-
export declare function apiRequest<T>(nodeContext: IExecuteFunctions | ILoadOptionsFunctions, options: IDataObject, errorMetadata?: Record<string, unknown>): Promise<T>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FORTNOX_BASE_URL = void 0;
|
|
4
|
-
exports.apiRequest = apiRequest;
|
|
5
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
-
const errorCodes_1 = require("./errorCodes");
|
|
7
|
-
const commons_1 = require("../commons");
|
|
8
|
-
exports.FORTNOX_BASE_URL = 'https://api.fortnox.se/3/';
|
|
9
|
-
async function apiRequest(nodeContext, options, errorMetadata) {
|
|
10
|
-
var _a;
|
|
11
|
-
const endpoint = options.endpoint;
|
|
12
|
-
const method = options.method;
|
|
13
|
-
const credentials = await nodeContext.getCredentials(commons_1.FORTNOX_API_CREDENTIAL_KEY);
|
|
14
|
-
const requestOptions = {
|
|
15
|
-
method: method,
|
|
16
|
-
uri: `${exports.FORTNOX_BASE_URL}${endpoint}`,
|
|
17
|
-
json: true,
|
|
18
|
-
headers: {
|
|
19
|
-
Authorization: `Bearer ${credentials.token}`,
|
|
20
|
-
Accept: 'application/json',
|
|
21
|
-
'Content-Type': 'application/json',
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
if (options.qs && Object.keys(options.qs).length > 0) {
|
|
25
|
-
requestOptions.qs = options.qs;
|
|
26
|
-
}
|
|
27
|
-
if (options.body) {
|
|
28
|
-
requestOptions.body = options.body;
|
|
29
|
-
}
|
|
30
|
-
if (options.timeout) {
|
|
31
|
-
requestOptions.timeout = options.timeout;
|
|
32
|
-
}
|
|
33
|
-
const fullUrl = `${requestOptions.uri}${requestOptions.qs ? '?' + new URLSearchParams(requestOptions.qs).toString() : ''}`;
|
|
34
|
-
n8n_workflow_1.LoggerProxy.info(`URL: ${fullUrl}`);
|
|
35
|
-
try {
|
|
36
|
-
return await nodeContext.helpers.request.call(nodeContext, commons_1.FORTNOX_API_CREDENTIAL_KEY, requestOptions);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
const errorResponse = error.error || {
|
|
40
|
-
ErrorInformation: {},
|
|
41
|
-
};
|
|
42
|
-
const errorInformation = (errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.ErrorInformation) && {
|
|
43
|
-
error: errorResponse.ErrorInformation.error ||
|
|
44
|
-
errorResponse.ErrorInformation.Error,
|
|
45
|
-
message: errorResponse.ErrorInformation.message ||
|
|
46
|
-
errorResponse.ErrorInformation.Message,
|
|
47
|
-
code: errorResponse.ErrorInformation.code ||
|
|
48
|
-
errorResponse.ErrorInformation.Code,
|
|
49
|
-
};
|
|
50
|
-
let message;
|
|
51
|
-
if (errorInformation) {
|
|
52
|
-
message = `API request failed [URL: ${fullUrl}][Method: ${method}]\n
|
|
53
|
-
[Error Information:\n
|
|
54
|
-
- Error: ${errorInformation.error || 'Unknown error'}\n
|
|
55
|
-
- Message: ${errorInformation.message || 'No message provided'}\n
|
|
56
|
-
- Code: ${errorInformation.code || 'No code provided'}\n
|
|
57
|
-
- Code Translation: ${(0, errorCodes_1.translateErrorCode)(errorInformation.code) || 'No translation available'}\n
|
|
58
|
-
]`;
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
message = `API request failed [URL: ${fullUrl}][Method: ${method}]: ${error.message}`;
|
|
62
|
-
}
|
|
63
|
-
const errorContext = {
|
|
64
|
-
error: message,
|
|
65
|
-
status: (_a = error === null || error === void 0 ? void 0 : error.cause) === null || _a === void 0 ? void 0 : _a.status,
|
|
66
|
-
metadata: {
|
|
67
|
-
qs: options === null || options === void 0 ? void 0 : options.qs,
|
|
68
|
-
body: options === null || options === void 0 ? void 0 : options.body,
|
|
69
|
-
timeout: options === null || options === void 0 ? void 0 : options.timeout,
|
|
70
|
-
...errorMetadata,
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
throw new n8n_workflow_1.NodeOperationError(nodeContext.getNode(), JSON.stringify(errorContext));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/fortnox/transport/index.ts"],"names":[],"mappings":";;;AAeA,gCA0FC;AAzGD,+CAQsB;A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,OAAO,uBAAP,OAAO,CAAE,EAAE;gBACf,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI;gBACnB,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;gBACzB,GAAG,aAAa;aACnB;SACJ,CAAC;QACF,MAAM,IAAI,iCAAkB,CACxB,WAAW,CAAC,OAAO,EAAE,EACrB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAC/B,CAAC;IACN,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 1025 1025" xmlns="http://www.w3.org/2000/svg" xml:space="preserve"><clipPath id="a"><path d="M.067.03h1024v1024H.067z"/></clipPath>
|
|
2
|
-
<g clip-path="url(#a)"><path d="M92.466 480.888c0-257.059 208.718-465.779 465.78-465.779 257.101 0 465.821 208.72 465.821 465.779 0 133.713-55.806 271.139-193.404 385.355-166.779 138.45-390.389 157.35-736.149 134.525-102.653-6.785-117.502-24.319-64.469-63.444C196.74 814.277 92.466 720.157 92.466 480.888Z" style="fill:#a6efff"/>
|
|
3
|
-
<clipPath id="b"><path d="M92.466 480.888c0-257.059 208.718-465.779 465.78-465.779 257.101 0 465.821 208.72 465.821 465.779 0 133.713-55.806 271.139-193.404 385.355-166.779 138.45-390.389 157.35-736.149 134.525-102.653-6.785-117.502-24.319-64.469-63.444C196.74 814.277 92.466 720.157 92.466 480.888Z"/></clipPath>
|
|
4
|
-
<g clip-path="url(#b)"><path d="M-810.991 1517.47c-520.197-174.655 602.109-1999.19 1122.31-1824.54 520.198 174.652 347.26 364.038 243.982 791.188-103.277 427.149-846.091 1208-1366.29 1033.35Z" style="fill:#ffa6ea;filter:blur(200px)"/></g>
|
|
5
|
-
<path d="M415.273 301.267c-40.49 0-73.342 32.894-73.342 73.385 0 40.489 32.852 73.342 73.342 73.342 40.489 0 73.384-32.853 73.384-73.342 0-40.491-32.895-73.385-73.384-73.385Zm168.017 96.552h175.653c12.8 0 23.168-10.368 23.168-23.167 0-12.801-10.368-23.168-23.168-23.168H583.29c-12.8 0-23.168 10.367-23.168 23.168 0 12.799 10.368 23.167 23.168 23.167Zm0 212.345h175.653c12.8 0 23.168-10.367 23.168-23.167 0-12.756-10.368-23.166-23.168-23.166H583.29c-12.8 0-23.168 10.41-23.168 23.166 0 12.8 10.368 23.167 23.168 23.167Zm-168.017-96.509c-40.49 0-73.342 32.853-73.342 73.342 0 40.49 32.852 73.385 73.342 73.385 40.489 0 73.384-32.895 73.384-73.385 0-40.489-32.895-73.342-73.384-73.342Z"
|
|
6
|
-
style="fill:#fff"/></g></svg>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"node": "n8n-nodes-base.fortnox",
|
|
3
|
-
"nodeVersion": "1.0",
|
|
4
|
-
"codexVersion": "1.0",
|
|
5
|
-
"categories": ["Finance & Accounting"],
|
|
6
|
-
"resources": {
|
|
7
|
-
"credentialDocumentation": [
|
|
8
|
-
{
|
|
9
|
-
"url": "https://api.fortnox.se/developer/authorization"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"primaryDocumentation": [
|
|
13
|
-
{
|
|
14
|
-
"url": "https://api.fortnox.se/apidocs"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IDataObject,
|
|
3
|
-
IExecuteFunctions,
|
|
4
|
-
INodeExecutionData,
|
|
5
|
-
INodeProperties,
|
|
6
|
-
INodeType,
|
|
7
|
-
INodeTypeDescription,
|
|
8
|
-
NodeConnectionTypes,
|
|
9
|
-
NodeOperationError,
|
|
10
|
-
NodePropertyTypes,
|
|
11
|
-
} from 'n8n-workflow';
|
|
12
|
-
|
|
13
|
-
import { invoiceProperties, invoiceOperations } from './resources/invoice';
|
|
14
|
-
import { FORTNOX_API_CREDENTIAL_KEY } from './commons';
|
|
15
|
-
import { customerProperties, customerOperations } from './resources/customers';
|
|
16
|
-
|
|
17
|
-
export class Fortnox implements INodeType {
|
|
18
|
-
description: INodeTypeDescription = {
|
|
19
|
-
displayName: 'Fortnox',
|
|
20
|
-
name: 'fortnox',
|
|
21
|
-
icon: 'file:fortnoxLogo.svg',
|
|
22
|
-
group: ['transform'],
|
|
23
|
-
version: 1,
|
|
24
|
-
subtitle:
|
|
25
|
-
'={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
26
|
-
description: 'Consume the Fortnox API',
|
|
27
|
-
defaults: {
|
|
28
|
-
name: 'Fortnox',
|
|
29
|
-
},
|
|
30
|
-
inputs: [NodeConnectionTypes.Main],
|
|
31
|
-
outputs: [NodeConnectionTypes.Main],
|
|
32
|
-
credentials: [
|
|
33
|
-
{
|
|
34
|
-
name: FORTNOX_API_CREDENTIAL_KEY,
|
|
35
|
-
required: true,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
properties: [
|
|
39
|
-
{
|
|
40
|
-
displayName: 'Resource',
|
|
41
|
-
name: 'resource',
|
|
42
|
-
type: 'options' as NodePropertyTypes,
|
|
43
|
-
noDataExpression: true,
|
|
44
|
-
options: [
|
|
45
|
-
{
|
|
46
|
-
name: 'Customer',
|
|
47
|
-
value: 'customer',
|
|
48
|
-
description: 'Work with customers',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'Invoice',
|
|
52
|
-
value: 'invoice',
|
|
53
|
-
description: 'Work with invoices',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
default: 'customer',
|
|
57
|
-
},
|
|
58
|
-
...(customerProperties as INodeProperties[]),
|
|
59
|
-
...(invoiceProperties as INodeProperties[]),
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
64
|
-
const items = this.getInputData();
|
|
65
|
-
const returnData = [];
|
|
66
|
-
let responseData;
|
|
67
|
-
|
|
68
|
-
const resource = this.getNodeParameter('resource', 0) as string;
|
|
69
|
-
const operation = this.getNodeParameter('operation', 0) as string;
|
|
70
|
-
|
|
71
|
-
for (let i = 0; i < items.length; i++) {
|
|
72
|
-
if (resource === 'customer') {
|
|
73
|
-
responseData = await customerOperations.call(this, {
|
|
74
|
-
operation,
|
|
75
|
-
i,
|
|
76
|
-
});
|
|
77
|
-
} else if (resource === 'invoice') {
|
|
78
|
-
responseData = await invoiceOperations.call(this, {
|
|
79
|
-
operation,
|
|
80
|
-
i,
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
const errorLog = `The resource "${resource}" is not supported!`;
|
|
84
|
-
if (this.continueOnFail()) {
|
|
85
|
-
returnData.push({
|
|
86
|
-
error: errorLog,
|
|
87
|
-
json: { error: errorLog },
|
|
88
|
-
});
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
throw new NodeOperationError(this.getNode(), errorLog);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (Array.isArray(responseData)) {
|
|
95
|
-
returnData.push(...responseData);
|
|
96
|
-
} else if (responseData !== undefined && responseData !== null) {
|
|
97
|
-
returnData.push(responseData);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return [this.helpers.returnJsonArray(returnData as IDataObject[])];
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"node": "n8n-nodes-base.fortnoxTrigger",
|
|
3
|
-
"nodeVersion": "1.0",
|
|
4
|
-
"codexVersion": "1.0",
|
|
5
|
-
"categories": ["Finance & Accounting"],
|
|
6
|
-
"resources": {
|
|
7
|
-
"credentialDocumentation": [
|
|
8
|
-
{
|
|
9
|
-
"url": "https://api.fortnox.se/developer/authorization"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"primaryDocumentation": [
|
|
13
|
-
{
|
|
14
|
-
"url": "https://www.fortnox.se/developer/guides-and-good-to-know/websockets"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|