bexio 0.7.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +20 -119
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +146 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/jest-html-reporters-attach/index.js +58 -0
- package/jest-html-reporters-attach/result.js +1 -0
- package/jest_html_reporters.html +1 -0
- package/junit.xml +155 -0
- package/lib/index.d.ts +9 -103
- package/lib/index.js +55 -237
- package/lib/index.js.map +1 -1
- package/lib/interfaces/BillsStatic.js +1 -0
- package/lib/interfaces/BillsStatic.js.map +1 -1
- package/lib/interfaces/BusinessActivitiesStatic.js +1 -0
- package/lib/interfaces/BusinessActivitiesStatic.js.map +1 -1
- package/lib/interfaces/CalendarStatic.js +1 -0
- package/lib/interfaces/CalendarStatic.js.map +1 -1
- package/lib/interfaces/ContactGroupsStatic.js +1 -0
- package/lib/interfaces/ContactGroupsStatic.js.map +1 -1
- package/lib/interfaces/ContactRelationsStatic.js +1 -0
- package/lib/interfaces/ContactRelationsStatic.js.map +1 -1
- package/lib/interfaces/ContactSectorsStatic.js +1 -0
- package/lib/interfaces/ContactSectorsStatic.js.map +1 -1
- package/lib/interfaces/ContactTypesStatic.js +1 -0
- package/lib/interfaces/ContactTypesStatic.js.map +1 -1
- package/lib/interfaces/ContactsStatic.js +1 -0
- package/lib/interfaces/ContactsStatic.js.map +1 -1
- package/lib/interfaces/ExpensesStatic.js +1 -0
- package/lib/interfaces/ExpensesStatic.js.map +1 -1
- package/lib/interfaces/InvoicesStatic.d.ts +100 -0
- package/lib/interfaces/InvoicesStatic.js +25 -0
- package/lib/interfaces/InvoicesStatic.js.map +1 -0
- package/lib/interfaces/ItemsStatic.d.ts +120 -0
- package/lib/interfaces/ItemsStatic.js +47 -0
- package/lib/interfaces/ItemsStatic.js.map +1 -0
- package/lib/interfaces/NotesStatic.js +1 -0
- package/lib/interfaces/NotesStatic.js.map +1 -1
- package/lib/interfaces/OrdersStatic.js +1 -0
- package/lib/interfaces/OrdersStatic.js.map +1 -1
- package/lib/interfaces/PositionStatic.d.ts +35 -0
- package/lib/interfaces/PositionStatic.js +3 -0
- package/lib/interfaces/PositionStatic.js.map +1 -0
- package/lib/interfaces/ProjectStatusesStatic.js +1 -0
- package/lib/interfaces/ProjectStatusesStatic.js.map +1 -1
- package/lib/interfaces/ProjectTypesStatic.js +1 -0
- package/lib/interfaces/ProjectTypesStatic.js.map +1 -1
- package/lib/interfaces/ProjectsStatic.js +1 -0
- package/lib/interfaces/ProjectsStatic.js.map +1 -1
- package/lib/interfaces/SalesOrderManagementStatic.js +1 -0
- package/lib/interfaces/SalesOrderManagementStatic.js.map +1 -1
- package/lib/interfaces/TimetrackingStatusesStatic.js +1 -0
- package/lib/interfaces/TimetrackingStatusesStatic.js.map +1 -1
- package/lib/interfaces/TimetrackingsStatic.js +1 -0
- package/lib/interfaces/TimetrackingsStatic.js.map +1 -1
- package/lib/interfaces/UsersStatic.js +1 -0
- package/lib/interfaces/UsersStatic.js.map +1 -1
- package/lib/resources/BaseCrud.d.ts +13 -24
- package/lib/resources/BaseCrud.js +37 -44
- package/lib/resources/BaseCrud.js.map +1 -1
- package/lib/resources/Bills.d.ts +5 -6
- package/lib/resources/Bills.js +14 -17
- package/lib/resources/Bills.js.map +1 -1
- package/lib/resources/BusinessActivities.d.ts +1 -2
- package/lib/resources/BusinessActivities.js +2 -3
- package/lib/resources/BusinessActivities.js.map +1 -1
- package/lib/resources/ContactGroups.d.ts +1 -2
- package/lib/resources/ContactGroups.js +3 -4
- package/lib/resources/ContactGroups.js.map +1 -1
- package/lib/resources/ContactRelations.d.ts +1 -2
- package/lib/resources/ContactRelations.js +2 -3
- package/lib/resources/ContactRelations.js.map +1 -1
- package/lib/resources/ContactSectors.d.ts +1 -2
- package/lib/resources/ContactSectors.js +6 -7
- package/lib/resources/ContactSectors.js.map +1 -1
- package/lib/resources/ContactTypes.d.ts +1 -2
- package/lib/resources/ContactTypes.js +6 -7
- package/lib/resources/ContactTypes.js.map +1 -1
- package/lib/resources/Contacts.d.ts +1 -2
- package/lib/resources/Contacts.js +2 -3
- package/lib/resources/Contacts.js.map +1 -1
- package/lib/resources/Expenses.d.ts +2 -3
- package/lib/resources/Expenses.js +4 -5
- package/lib/resources/Expenses.js.map +1 -1
- package/lib/resources/Invoices.d.ts +6 -0
- package/lib/resources/Invoices.js +27 -0
- package/lib/resources/Invoices.js.map +1 -0
- package/lib/resources/Items.d.ts +5 -0
- package/lib/resources/Items.js +13 -0
- package/lib/resources/Items.js.map +1 -0
- package/lib/resources/Orders.d.ts +1 -2
- package/lib/resources/Orders.js +2 -3
- package/lib/resources/Orders.js.map +1 -1
- package/lib/resources/Payments.d.ts +1 -2
- package/lib/resources/Payments.js +2 -11
- package/lib/resources/Payments.js.map +1 -1
- package/lib/resources/ProjectStatuses.d.ts +1 -2
- package/lib/resources/ProjectStatuses.js +2 -3
- package/lib/resources/ProjectStatuses.js.map +1 -1
- package/lib/resources/ProjectTypes.d.ts +1 -2
- package/lib/resources/ProjectTypes.js +6 -7
- package/lib/resources/ProjectTypes.js.map +1 -1
- package/lib/resources/Projects.d.ts +1 -2
- package/lib/resources/Projects.js +2 -3
- package/lib/resources/Projects.js.map +1 -1
- package/lib/resources/TimetrackingStatuses.d.ts +1 -2
- package/lib/resources/TimetrackingStatuses.js +2 -3
- package/lib/resources/TimetrackingStatuses.js.map +1 -1
- package/lib/resources/Timetrackings.d.ts +1 -2
- package/lib/resources/Timetrackings.js +2 -3
- package/lib/resources/Timetrackings.js.map +1 -1
- package/lib/resources/Users.d.ts +1 -2
- package/lib/resources/Users.js +2 -3
- package/lib/resources/Users.js.map +1 -1
- package/lib/tests/BaseCrud.test.js +290 -0
- package/lib/tests/BaseCrud.test.js.map +1 -0
- package/lib/tests/Bills.test.js +93 -143
- package/lib/tests/Bills.test.js.map +1 -1
- package/lib/tests/BusinessActivities.test.js +14 -85
- package/lib/tests/BusinessActivities.test.js.map +1 -1
- package/lib/tests/ContactGroups.test.js +14 -92
- package/lib/tests/ContactGroups.test.js.map +1 -1
- package/lib/tests/ContactRelations.test.js +14 -87
- package/lib/tests/ContactRelations.test.js.map +1 -1
- package/lib/tests/ContactSectors.test.js +14 -124
- package/lib/tests/ContactSectors.test.js.map +1 -1
- package/lib/tests/ContactTypes.test.js +14 -118
- package/lib/tests/ContactTypes.test.js.map +1 -1
- package/lib/tests/Contacts.test.js +23 -0
- package/lib/tests/Contacts.test.js.map +1 -0
- package/lib/tests/Expenses.test.js +14 -98
- package/lib/tests/Expenses.test.js.map +1 -1
- package/lib/tests/Invoices.test.d.ts +1 -0
- package/lib/tests/Invoices.test.js +23 -0
- package/lib/tests/Invoices.test.js.map +1 -0
- package/lib/tests/Items.test.d.ts +1 -0
- package/lib/tests/Items.test.js +23 -0
- package/lib/tests/Items.test.js.map +1 -0
- package/lib/tests/Orders.test.js +14 -127
- package/lib/tests/Orders.test.js.map +1 -1
- package/lib/tests/Payments.test.js +15 -90
- package/lib/tests/Payments.test.js.map +1 -1
- package/lib/tests/ProjectStatuses.test.js +14 -123
- package/lib/tests/ProjectStatuses.test.js.map +1 -1
- package/lib/tests/ProjectTypes.test.js +14 -119
- package/lib/tests/ProjectTypes.test.js.map +1 -1
- package/lib/tests/Projects.test.js +14 -91
- package/lib/tests/Projects.test.js.map +1 -1
- package/lib/tests/TimetrackingStatuses.test.js +14 -123
- package/lib/tests/TimetrackingStatuses.test.js.map +1 -1
- package/lib/tests/Timetrackings.test.js +14 -102
- package/lib/tests/Timetrackings.test.js.map +1 -1
- package/lib/tests/Users.test.js +14 -125
- package/lib/tests/Users.test.js.map +1 -1
- package/package.json +45 -29
- package/lib/constants/Scopes.d.ts +0 -32
- package/lib/constants/Scopes.js +0 -36
- package/lib/constants/Scopes.js.map +0 -1
- package/lib/libs/OAuth2.d.ts +0 -122
- package/lib/libs/OAuth2.js +0 -202
- package/lib/libs/OAuth2.js.map +0 -1
- package/lib/tests/Authentication.test.js +0 -83
- package/lib/tests/Authentication.test.js.map +0 -1
- package/lib/tests/Contact.test.js +0 -103
- package/lib/tests/Contact.test.js.map +0 -1
- /package/lib/tests/{Authentication.test.d.ts → BaseCrud.test.d.ts} +0 -0
- /package/lib/tests/{Contact.test.d.ts → Contacts.test.d.ts} +0 -0
package/lib/tests/Users.test.js
CHANGED
|
@@ -1,134 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
12
|
-
if (mod && mod.__esModule) return mod;
|
|
13
|
-
var result = {};
|
|
14
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
15
|
-
result["default"] = mod;
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
4
|
};
|
|
21
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
25
|
-
const UsersStatic_1 = require("../interfaces/UsersStatic");
|
|
6
|
+
const BaseCrud_1 = __importDefault(require("../resources/BaseCrud"));
|
|
7
|
+
const utils_1 = require("ts-jest/utils");
|
|
26
8
|
const Users_1 = __importDefault(require("../resources/Users"));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
!BEXIO_USERNAME ||
|
|
40
|
-
!BEXIO_PASSWORD)
|
|
41
|
-
throw new Error("not all necessary variables defined");
|
|
42
|
-
api = new __1.default(BEXIO_CLIENTID, BEXIO_CLIENTSECRET, `http://${HOSTNAME}/callback`, [__1.Scopes.GENERAL, __1.Scopes.GENERAL]);
|
|
43
|
-
yield api.fakeLogin(BEXIO_USERNAME, BEXIO_PASSWORD);
|
|
44
|
-
}));
|
|
45
|
-
it("init user", () => {
|
|
46
|
-
moduleToTest = new Users_1.default(api["bexioAuth"]);
|
|
9
|
+
const chance_1 = __importDefault(require("chance"));
|
|
10
|
+
jest.mock("../resources/BaseCrud");
|
|
11
|
+
const mockedBase = (0, utils_1.mocked)(BaseCrud_1.default, true);
|
|
12
|
+
const seedgenerator = new chance_1.default();
|
|
13
|
+
const seed = seedgenerator.hash();
|
|
14
|
+
console.log(`using chance seed ${seed}`);
|
|
15
|
+
const chance = new chance_1.default(seed);
|
|
16
|
+
describe("Users", () => {
|
|
17
|
+
it("Should use init the base correctly", () => {
|
|
18
|
+
const token = chance.string();
|
|
19
|
+
new Users_1.default(token);
|
|
20
|
+
expect(mockedBase).toHaveBeenCalledWith(token, `/user`);
|
|
47
21
|
});
|
|
48
|
-
it.skip("create new user (not implemented by Bexio yet)", () => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
user = yield moduleToTest.create({
|
|
50
|
-
name: "test"
|
|
51
|
-
});
|
|
52
|
-
}));
|
|
53
|
-
it("should return a not implemented error on creation", () => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
user = {
|
|
55
|
-
id: 1,
|
|
56
|
-
firstname: "Mathias",
|
|
57
|
-
lastname: "Scherer",
|
|
58
|
-
is_superadmin: false,
|
|
59
|
-
color: "#ff00ff"
|
|
60
|
-
};
|
|
61
|
-
try {
|
|
62
|
-
yield moduleToTest.create({
|
|
63
|
-
name: "test"
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
chai_1.expect(err.message).to.be.eq("not implemented by Bexio yet");
|
|
68
|
-
}
|
|
69
|
-
}));
|
|
70
|
-
it("list users", () => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
const list = yield moduleToTest.list({});
|
|
72
|
-
chai_1.expect(list.map(el => el.id)).includes(user.id);
|
|
73
|
-
}));
|
|
74
|
-
it("search users", () => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const searchResult = yield moduleToTest.search({}, [
|
|
76
|
-
{
|
|
77
|
-
field: UsersStatic_1.UsersStatic.UsersSearchparameters.firstname,
|
|
78
|
-
value: user.firstname,
|
|
79
|
-
criteria: "="
|
|
80
|
-
}
|
|
81
|
-
]);
|
|
82
|
-
chai_1.expect(searchResult.length).to.be.greaterThan(0);
|
|
83
|
-
chai_1.expect(searchResult[0].id).to.be.eq(user.id);
|
|
84
|
-
}));
|
|
85
|
-
it("show user", () => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const showedUser = yield moduleToTest.show({}, user.id);
|
|
87
|
-
chai_1.expect(showedUser.lastname).to.be.eq(user.lastname);
|
|
88
|
-
}));
|
|
89
|
-
it.skip("overwrite a user (not implemented by Bexio yet)", () => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const overwritten = yield moduleToTest.overwrite(user.id, {
|
|
91
|
-
name: "test"
|
|
92
|
-
});
|
|
93
|
-
chai_1.expect(overwritten.lastname).to.be.eq("test");
|
|
94
|
-
}));
|
|
95
|
-
it("should return a not implemented error on overwrite", () => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
try {
|
|
97
|
-
yield moduleToTest.overwrite(user.id, {
|
|
98
|
-
name: "test"
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
catch (err) {
|
|
102
|
-
chai_1.expect(err.message).to.be.eq("not implemented by Bexio yet");
|
|
103
|
-
}
|
|
104
|
-
}));
|
|
105
|
-
it.skip("edit user (not implemented by Bexio yet)", () => __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
const edited = yield moduleToTest.edit(user.id, {
|
|
107
|
-
name: "test"
|
|
108
|
-
});
|
|
109
|
-
chai_1.expect(edited.lastname).to.be.eq("test");
|
|
110
|
-
}));
|
|
111
|
-
it("should return a not implemented error on edit", () => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
try {
|
|
113
|
-
yield moduleToTest.edit(user.id, {
|
|
114
|
-
name: "test"
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
catch (err) {
|
|
118
|
-
chai_1.expect(err.message).to.be.eq("not implemented by Bexio yet");
|
|
119
|
-
}
|
|
120
|
-
}));
|
|
121
|
-
it.skip("delete user (not implemented by Bexio yet)", () => __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
const result = yield moduleToTest.delete(user.id);
|
|
123
|
-
chai_1.expect(result).to.be.true;
|
|
124
|
-
}));
|
|
125
|
-
it("should return a not implemented error on deletion", () => __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
try {
|
|
127
|
-
yield moduleToTest.delete(user.id);
|
|
128
|
-
}
|
|
129
|
-
catch (err) {
|
|
130
|
-
chai_1.expect(err.message).to.be.eq("not implemented by Bexio yet");
|
|
131
|
-
}
|
|
132
|
-
}));
|
|
133
22
|
});
|
|
134
23
|
//# sourceMappingURL=Users.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Users.test.js","sourceRoot":"","sources":["../../src/tests/Users.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Users.test.js","sourceRoot":"","sources":["../../src/tests/Users.test.ts"],"names":[],"mappings":";;;;;AAAA,qEAA6C;AAC7C,yCAAuC;AACvC,+DAAuC;AACvC,oDAA4B;AAE5B,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,kBAAQ,EAAE,IAAI,CAAC,CAAC;AAE1C,MAAM,aAAa,GAAG,IAAI,gBAAM,EAAE,CAAC;AACnC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;AAClC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;AACzC,MAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,IAAI,CAAC,CAAC;AAEhC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,eAAK,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bexio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "NPM Package for the api of bexio.com",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,24 +11,13 @@
|
|
|
11
11
|
"office.bexio.com"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"test": "
|
|
15
|
-
"report": "
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"report": "./node_modules/.bin/codecov",
|
|
16
16
|
"build": "./node_modules/.bin/tsc",
|
|
17
17
|
"prepare": "npm run build",
|
|
18
18
|
"version": "git add -A src",
|
|
19
19
|
"postversion": "git push && git push --tags"
|
|
20
20
|
},
|
|
21
|
-
"nyc": {
|
|
22
|
-
"extends": "@istanbuljs/nyc-config-typescript",
|
|
23
|
-
"exclude": [
|
|
24
|
-
"src/interfaces/**",
|
|
25
|
-
"src/constants/**",
|
|
26
|
-
"src/tests/**",
|
|
27
|
-
"lib/tests/**"
|
|
28
|
-
],
|
|
29
|
-
"all": true,
|
|
30
|
-
"check-coverage": true
|
|
31
|
-
},
|
|
32
21
|
"repository": {
|
|
33
22
|
"type": "git",
|
|
34
23
|
"url": "git+https://github.com/mathewmeconry/bexio.git"
|
|
@@ -40,25 +29,52 @@
|
|
|
40
29
|
},
|
|
41
30
|
"homepage": "https://github.com/mathewmeconry/bexio#readme",
|
|
42
31
|
"dependencies": {
|
|
43
|
-
"
|
|
44
|
-
"request-promise-native": "^1.0.5"
|
|
32
|
+
"axios": "^0.21.1"
|
|
45
33
|
},
|
|
46
34
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@types/chai": "^4.1.7",
|
|
35
|
+
"@types/chance": "^1.1.0",
|
|
49
36
|
"@types/dotenv": "^6.1.1",
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/nock": "^10.0.3",
|
|
37
|
+
"@types/jest": "^26.0.10",
|
|
52
38
|
"@types/node": "^12.6.2",
|
|
53
|
-
"
|
|
54
|
-
"@types/request-promise-native": "^1.0.15",
|
|
55
|
-
"chai": "^4.2.0",
|
|
39
|
+
"chance": "^1.1.7",
|
|
56
40
|
"codecov": "^3.6.1",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
41
|
+
"jest": "^26.4.2",
|
|
42
|
+
"jest-html-reporters": "^2.0.3",
|
|
43
|
+
"jest-junit": "^11.1.0",
|
|
44
|
+
"ts-jest": "^26.3.0",
|
|
45
|
+
"typescript": "^4.0.2"
|
|
46
|
+
},
|
|
47
|
+
"jest": {
|
|
48
|
+
"collectCoverage": true,
|
|
49
|
+
"transform": {
|
|
50
|
+
".(ts|tsx)": "ts-jest"
|
|
51
|
+
},
|
|
52
|
+
"testMatch": [
|
|
53
|
+
"**/*.test.ts"
|
|
54
|
+
],
|
|
55
|
+
"moduleFileExtensions": [
|
|
56
|
+
"ts",
|
|
57
|
+
"tsx",
|
|
58
|
+
"js",
|
|
59
|
+
"jsx",
|
|
60
|
+
"feature"
|
|
61
|
+
],
|
|
62
|
+
"reporters": [
|
|
63
|
+
"default",
|
|
64
|
+
"jest-html-reporters",
|
|
65
|
+
"jest-junit"
|
|
66
|
+
],
|
|
67
|
+
"coverageDirectory": "coverage",
|
|
68
|
+
"coverageReporters": [
|
|
69
|
+
"html"
|
|
70
|
+
],
|
|
71
|
+
"collectCoverageFrom": [
|
|
72
|
+
"src/**/*.{ts,tsx}",
|
|
73
|
+
"!**/node_modules/**",
|
|
74
|
+
"!**/coverage/**"
|
|
75
|
+
],
|
|
76
|
+
"roots": [
|
|
77
|
+
"./src"
|
|
78
|
+
]
|
|
63
79
|
}
|
|
64
80
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare enum Scopes {
|
|
2
|
-
ARTICLE_SHOW = "article_show",
|
|
3
|
-
ARTICLE_EDIT = "article_edit",
|
|
4
|
-
CALENDAR_SHOW = "calendar_show",
|
|
5
|
-
CALENDAR_EDIT = "calendar_edit",
|
|
6
|
-
CONTACT_SHOW = "contact_show",
|
|
7
|
-
CONTACT_EDIT = "contact_edit",
|
|
8
|
-
KB_INVOICE_SHOW = "kb_invoice_show",
|
|
9
|
-
KB_INVOICE_EDIT = "kb_invoice_edit",
|
|
10
|
-
KB_OFFER_SHOW = "kb_offer_show",
|
|
11
|
-
KB_OFFER_EDIT = "kb_offer_edit",
|
|
12
|
-
KB_ORDER_SHOW = "kb_order_show",
|
|
13
|
-
KB_ORDER_EDIT = "kb_order_edit",
|
|
14
|
-
KB_BILL_SHOW = "kb_bill_show",
|
|
15
|
-
KB_BILL_EDIT = "kb_bill_edit",
|
|
16
|
-
KB_CREDIT_VOUCHER_SHOW = "kb_credit_voucher_show",
|
|
17
|
-
KB_CREDIT_VOUCHER_EDIT = "kb_credit_voucher_edit",
|
|
18
|
-
KB_EXPENSE_SHOW = "kb_expense_show",
|
|
19
|
-
KB_EXPENSE_EDIT = "kb_expense_edit",
|
|
20
|
-
LEAD_SHOW = "lead_show",
|
|
21
|
-
LEAD_EDIT = "lead_edit",
|
|
22
|
-
MONITORING_SHOW = "monitoring_show",
|
|
23
|
-
MONITORING_EDIT = "monitoring_edit",
|
|
24
|
-
NOTE_SHOW = "note_show",
|
|
25
|
-
NOTE_EDIT = "note_edit",
|
|
26
|
-
PROJECT_SHOW = "project_show",
|
|
27
|
-
PROJECT_EDIT = "project_edit",
|
|
28
|
-
TASK_SHOW = "task_show",
|
|
29
|
-
TASK_EDIT = "task_edit",
|
|
30
|
-
GENERAL = "general"
|
|
31
|
-
}
|
|
32
|
-
export default Scopes;
|
package/lib/constants/Scopes.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var Scopes;
|
|
4
|
-
(function (Scopes) {
|
|
5
|
-
Scopes["ARTICLE_SHOW"] = "article_show";
|
|
6
|
-
Scopes["ARTICLE_EDIT"] = "article_edit";
|
|
7
|
-
Scopes["CALENDAR_SHOW"] = "calendar_show";
|
|
8
|
-
Scopes["CALENDAR_EDIT"] = "calendar_edit";
|
|
9
|
-
Scopes["CONTACT_SHOW"] = "contact_show";
|
|
10
|
-
Scopes["CONTACT_EDIT"] = "contact_edit";
|
|
11
|
-
Scopes["KB_INVOICE_SHOW"] = "kb_invoice_show";
|
|
12
|
-
Scopes["KB_INVOICE_EDIT"] = "kb_invoice_edit";
|
|
13
|
-
Scopes["KB_OFFER_SHOW"] = "kb_offer_show";
|
|
14
|
-
Scopes["KB_OFFER_EDIT"] = "kb_offer_edit";
|
|
15
|
-
Scopes["KB_ORDER_SHOW"] = "kb_order_show";
|
|
16
|
-
Scopes["KB_ORDER_EDIT"] = "kb_order_edit";
|
|
17
|
-
Scopes["KB_BILL_SHOW"] = "kb_bill_show";
|
|
18
|
-
Scopes["KB_BILL_EDIT"] = "kb_bill_edit";
|
|
19
|
-
Scopes["KB_CREDIT_VOUCHER_SHOW"] = "kb_credit_voucher_show";
|
|
20
|
-
Scopes["KB_CREDIT_VOUCHER_EDIT"] = "kb_credit_voucher_edit";
|
|
21
|
-
Scopes["KB_EXPENSE_SHOW"] = "kb_expense_show";
|
|
22
|
-
Scopes["KB_EXPENSE_EDIT"] = "kb_expense_edit";
|
|
23
|
-
Scopes["LEAD_SHOW"] = "lead_show";
|
|
24
|
-
Scopes["LEAD_EDIT"] = "lead_edit";
|
|
25
|
-
Scopes["MONITORING_SHOW"] = "monitoring_show";
|
|
26
|
-
Scopes["MONITORING_EDIT"] = "monitoring_edit";
|
|
27
|
-
Scopes["NOTE_SHOW"] = "note_show";
|
|
28
|
-
Scopes["NOTE_EDIT"] = "note_edit";
|
|
29
|
-
Scopes["PROJECT_SHOW"] = "project_show";
|
|
30
|
-
Scopes["PROJECT_EDIT"] = "project_edit";
|
|
31
|
-
Scopes["TASK_SHOW"] = "task_show";
|
|
32
|
-
Scopes["TASK_EDIT"] = "task_edit";
|
|
33
|
-
Scopes["GENERAL"] = "general";
|
|
34
|
-
})(Scopes || (Scopes = {}));
|
|
35
|
-
exports.default = Scopes;
|
|
36
|
-
//# sourceMappingURL=Scopes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Scopes.js","sourceRoot":"","sources":["../../src/constants/Scopes.ts"],"names":[],"mappings":";;AAAA,IAAK,MA8BJ;AA9BD,WAAK,MAAM;IACP,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,yCAA+B,CAAA;IAC/B,yCAA+B,CAAA;IAC/B,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,6CAAmC,CAAA;IACnC,6CAAmC,CAAA;IACnC,yCAA+B,CAAA;IAC/B,yCAA+B,CAAA;IAC/B,yCAA+B,CAAA;IAC/B,yCAA+B,CAAA;IAC/B,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,2DAAiD,CAAA;IACjD,2DAAiD,CAAA;IACjD,6CAAmC,CAAA;IACnC,6CAAmC,CAAA;IACnC,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,6CAAmC,CAAA;IACnC,6CAAmC,CAAA;IACnC,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,6BAAmB,CAAA;AACvB,CAAC,EA9BI,MAAM,KAAN,MAAM,QA8BV;AAED,kBAAe,MAAM,CAAA"}
|
package/lib/libs/OAuth2.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import Scopes from "../constants/Scopes";
|
|
2
|
-
export interface AuthorizationResponse {
|
|
3
|
-
code: string;
|
|
4
|
-
state: string;
|
|
5
|
-
}
|
|
6
|
-
export default class OAuth2 {
|
|
7
|
-
private client_id;
|
|
8
|
-
private client_secret;
|
|
9
|
-
private redirect_uri;
|
|
10
|
-
private scope;
|
|
11
|
-
private authorization_uri;
|
|
12
|
-
private access_token_uri;
|
|
13
|
-
private refresh_token_uri;
|
|
14
|
-
private api_url;
|
|
15
|
-
private last_state?;
|
|
16
|
-
private access_token?;
|
|
17
|
-
private expires_in?;
|
|
18
|
-
private valid_until?;
|
|
19
|
-
private refresh_token?;
|
|
20
|
-
private org?;
|
|
21
|
-
private user_id?;
|
|
22
|
-
constructor(client_id: string, client_secret: string, redirect_uri: string, scope: Array<Scopes>);
|
|
23
|
-
/**
|
|
24
|
-
* Generates the authorization url to redirect the client to
|
|
25
|
-
*
|
|
26
|
-
* @returns {string}
|
|
27
|
-
* @memberof OAuth2
|
|
28
|
-
*/
|
|
29
|
-
getAuthorizationUrl(): string;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the initial access_token of the service
|
|
32
|
-
*
|
|
33
|
-
* @param {AuthorizationResponse} response
|
|
34
|
-
* @returns {Promise<{
|
|
35
|
-
* access_token: string,
|
|
36
|
-
* expires_in: number,
|
|
37
|
-
* refresh_token: string,
|
|
38
|
-
* org: string,
|
|
39
|
-
* user_id: number,
|
|
40
|
-
* valid_until: Date
|
|
41
|
-
* }>}
|
|
42
|
-
* @memberof OAuth2
|
|
43
|
-
*/
|
|
44
|
-
generateAccessToken(response: AuthorizationResponse): Promise<{
|
|
45
|
-
access_token: string;
|
|
46
|
-
expires_in: number;
|
|
47
|
-
refresh_token: string;
|
|
48
|
-
org: string;
|
|
49
|
-
user_id: number;
|
|
50
|
-
valid_until: Date;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Generates the base API url
|
|
54
|
-
*
|
|
55
|
-
* @returns {string}
|
|
56
|
-
* @memberof OAuth2
|
|
57
|
-
*/
|
|
58
|
-
getApiUrl(): string;
|
|
59
|
-
/**
|
|
60
|
-
* Returns the bearer header entry to sign the request
|
|
61
|
-
*
|
|
62
|
-
* @returns {Promise<string>}
|
|
63
|
-
* @memberof OAuth2
|
|
64
|
-
*/
|
|
65
|
-
getBearerHeader(): Promise<string>;
|
|
66
|
-
/**
|
|
67
|
-
* Returns if it is initlized
|
|
68
|
-
*
|
|
69
|
-
* @returns {boolean}
|
|
70
|
-
* @memberof OAuth2
|
|
71
|
-
*/
|
|
72
|
-
isInitialized(): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Checks if the provided scope is also requested at the api
|
|
75
|
-
*
|
|
76
|
-
* @param {Scopes} scope
|
|
77
|
-
* @returns {boolean}
|
|
78
|
-
* @memberof OAuth2
|
|
79
|
-
*/
|
|
80
|
-
checkScope(scope: Scopes): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* checks if the access token is expired or not
|
|
83
|
-
*
|
|
84
|
-
* @private
|
|
85
|
-
* @returns {boolean}
|
|
86
|
-
* @memberof OAuth2
|
|
87
|
-
*/
|
|
88
|
-
private isAccessTokenStillValid;
|
|
89
|
-
/**
|
|
90
|
-
* checks if the refresh token is expired or not
|
|
91
|
-
*
|
|
92
|
-
* @private
|
|
93
|
-
* @returns {boolean}
|
|
94
|
-
* @memberof OAuth2
|
|
95
|
-
*/
|
|
96
|
-
private isRefreshTokenStillValid;
|
|
97
|
-
/**
|
|
98
|
-
* refreshs the access token with the refresh token
|
|
99
|
-
*
|
|
100
|
-
* @private
|
|
101
|
-
* @returns {Promise<void>}
|
|
102
|
-
* @memberof OAuth2
|
|
103
|
-
*/
|
|
104
|
-
private refreshToken;
|
|
105
|
-
/**
|
|
106
|
-
* Generates a new state and stores it for later verification
|
|
107
|
-
*
|
|
108
|
-
* @private
|
|
109
|
-
* @returns {string}
|
|
110
|
-
* @memberof OAuth2
|
|
111
|
-
*/
|
|
112
|
-
private getNewState;
|
|
113
|
-
/**
|
|
114
|
-
* Verifies if the response state is the same as the last sent one
|
|
115
|
-
*
|
|
116
|
-
* @private
|
|
117
|
-
* @param {string} state
|
|
118
|
-
* @returns {boolean}
|
|
119
|
-
* @memberof OAuth2
|
|
120
|
-
*/
|
|
121
|
-
private verifyState;
|
|
122
|
-
}
|
package/lib/libs/OAuth2.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const request_promise_native_1 = __importDefault(require("request-promise-native"));
|
|
16
|
-
class OAuth2 {
|
|
17
|
-
constructor(client_id, client_secret, redirect_uri, scope) {
|
|
18
|
-
this.authorization_uri = "https://office.bexio.com/oauth/authorize";
|
|
19
|
-
this.access_token_uri = "https://office.bexio.com/oauth/access_token";
|
|
20
|
-
this.refresh_token_uri = "https://office.bexio.com/oauth/refresh_token";
|
|
21
|
-
this.api_url = "https://office.bexio.com/api2.php/";
|
|
22
|
-
this.client_id = client_id;
|
|
23
|
-
this.client_secret = client_secret;
|
|
24
|
-
this.redirect_uri = redirect_uri;
|
|
25
|
-
this.scope = scope;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Generates the authorization url to redirect the client to
|
|
29
|
-
*
|
|
30
|
-
* @returns {string}
|
|
31
|
-
* @memberof OAuth2
|
|
32
|
-
*/
|
|
33
|
-
getAuthorizationUrl() {
|
|
34
|
-
let url = new URL(this.authorization_uri);
|
|
35
|
-
url.searchParams.append("client_id", this.client_id);
|
|
36
|
-
url.searchParams.append("redirect_uri", this.redirect_uri);
|
|
37
|
-
url.searchParams.append("scope", this.scope.join(" "));
|
|
38
|
-
url.searchParams.append("state", this.getNewState());
|
|
39
|
-
return url.toString();
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Gets the initial access_token of the service
|
|
43
|
-
*
|
|
44
|
-
* @param {AuthorizationResponse} response
|
|
45
|
-
* @returns {Promise<{
|
|
46
|
-
* access_token: string,
|
|
47
|
-
* expires_in: number,
|
|
48
|
-
* refresh_token: string,
|
|
49
|
-
* org: string,
|
|
50
|
-
* user_id: number,
|
|
51
|
-
* valid_until: Date
|
|
52
|
-
* }>}
|
|
53
|
-
* @memberof OAuth2
|
|
54
|
-
*/
|
|
55
|
-
generateAccessToken(response) {
|
|
56
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
if (!this.verifyState(response.state)) {
|
|
58
|
-
throw new Error("Invalid state");
|
|
59
|
-
}
|
|
60
|
-
let res = yield request_promise_native_1.default({
|
|
61
|
-
method: "POST",
|
|
62
|
-
url: this.access_token_uri,
|
|
63
|
-
formData: {
|
|
64
|
-
client_id: this.client_id,
|
|
65
|
-
client_secret: this.client_secret,
|
|
66
|
-
redirect_uri: this.redirect_uri,
|
|
67
|
-
code: response.code
|
|
68
|
-
},
|
|
69
|
-
json: true
|
|
70
|
-
});
|
|
71
|
-
this.access_token = res.access_token;
|
|
72
|
-
this.expires_in = res.expires_in;
|
|
73
|
-
this.refresh_token = res.refresh_token;
|
|
74
|
-
this.org = res.org;
|
|
75
|
-
this.user_id = res.user_id;
|
|
76
|
-
this.valid_until = new Date();
|
|
77
|
-
this.valid_until.setSeconds(this.valid_until.getSeconds() + (this.expires_in || 0));
|
|
78
|
-
return Object.assign(res, {
|
|
79
|
-
valid_until: this.valid_until
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Generates the base API url
|
|
85
|
-
*
|
|
86
|
-
* @returns {string}
|
|
87
|
-
* @memberof OAuth2
|
|
88
|
-
*/
|
|
89
|
-
getApiUrl() {
|
|
90
|
-
return this.api_url + "/" + this.org;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Returns the bearer header entry to sign the request
|
|
94
|
-
*
|
|
95
|
-
* @returns {Promise<string>}
|
|
96
|
-
* @memberof OAuth2
|
|
97
|
-
*/
|
|
98
|
-
getBearerHeader() {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
if (!this.isAccessTokenStillValid()) {
|
|
101
|
-
yield this.refreshToken();
|
|
102
|
-
}
|
|
103
|
-
return "Bearer " + this.access_token;
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Returns if it is initlized
|
|
108
|
-
*
|
|
109
|
-
* @returns {boolean}
|
|
110
|
-
* @memberof OAuth2
|
|
111
|
-
*/
|
|
112
|
-
isInitialized() {
|
|
113
|
-
return this.isAccessTokenStillValid() || this.isRefreshTokenStillValid();
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Checks if the provided scope is also requested at the api
|
|
117
|
-
*
|
|
118
|
-
* @param {Scopes} scope
|
|
119
|
-
* @returns {boolean}
|
|
120
|
-
* @memberof OAuth2
|
|
121
|
-
*/
|
|
122
|
-
checkScope(scope) {
|
|
123
|
-
return this.scope.indexOf(scope) > -1;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* checks if the access token is expired or not
|
|
127
|
-
*
|
|
128
|
-
* @private
|
|
129
|
-
* @returns {boolean}
|
|
130
|
-
* @memberof OAuth2
|
|
131
|
-
*/
|
|
132
|
-
isAccessTokenStillValid() {
|
|
133
|
-
return new Date() < (this.valid_until || 0);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* checks if the refresh token is expired or not
|
|
137
|
-
*
|
|
138
|
-
* @private
|
|
139
|
-
* @returns {boolean}
|
|
140
|
-
* @memberof OAuth2
|
|
141
|
-
*/
|
|
142
|
-
isRefreshTokenStillValid() {
|
|
143
|
-
let refresh_valid_until = new Date(this.valid_until || 0);
|
|
144
|
-
refresh_valid_until.setHours(refresh_valid_until.getHours() + 7 * 24);
|
|
145
|
-
return new Date() < refresh_valid_until;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* refreshs the access token with the refresh token
|
|
149
|
-
*
|
|
150
|
-
* @private
|
|
151
|
-
* @returns {Promise<void>}
|
|
152
|
-
* @memberof OAuth2
|
|
153
|
-
*/
|
|
154
|
-
refreshToken() {
|
|
155
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
-
if (!this.isRefreshTokenStillValid()) {
|
|
157
|
-
throw new Error("Refresh failed: Refresh token not valid anymore");
|
|
158
|
-
}
|
|
159
|
-
let response = yield request_promise_native_1.default({
|
|
160
|
-
method: "POST",
|
|
161
|
-
json: true,
|
|
162
|
-
url: this.refresh_token_uri,
|
|
163
|
-
formData: {
|
|
164
|
-
client_id: this.client_id,
|
|
165
|
-
client_secret: this.client_secret,
|
|
166
|
-
refresh_token: this.refresh_token
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
this.access_token = response.access_token;
|
|
170
|
-
this.expires_in = response.expires_in;
|
|
171
|
-
this.refresh_token = response.refresh_token;
|
|
172
|
-
this.org = response.org;
|
|
173
|
-
this.user_id = response.user_id;
|
|
174
|
-
this.valid_until = new Date();
|
|
175
|
-
this.valid_until.setSeconds(this.valid_until.getSeconds() + (this.expires_in || 0));
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Generates a new state and stores it for later verification
|
|
180
|
-
*
|
|
181
|
-
* @private
|
|
182
|
-
* @returns {string}
|
|
183
|
-
* @memberof OAuth2
|
|
184
|
-
*/
|
|
185
|
-
getNewState() {
|
|
186
|
-
this.last_state = Math.random().toString();
|
|
187
|
-
return this.last_state;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Verifies if the response state is the same as the last sent one
|
|
191
|
-
*
|
|
192
|
-
* @private
|
|
193
|
-
* @param {string} state
|
|
194
|
-
* @returns {boolean}
|
|
195
|
-
* @memberof OAuth2
|
|
196
|
-
*/
|
|
197
|
-
verifyState(state) {
|
|
198
|
-
return this.last_state === state;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
exports.default = OAuth2;
|
|
202
|
-
//# sourceMappingURL=OAuth2.js.map
|
package/lib/libs/OAuth2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"O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