@adobe/helix-onedrive-support 8.2.1 → 8.2.4
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 +21 -0
- package/package.json +6 -6
- package/src/OneDriveMock.js +27 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [8.2.4](https://github.com/adobe/helix-onedrive-support/compare/v8.2.3...v8.2.4) (2022-08-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add proper table in mock's addTable ([#292](https://github.com/adobe/helix-onedrive-support/issues/292)) ([6c470ef](https://github.com/adobe/helix-onedrive-support/commit/6c470efa4e923440458e9459aab2e1c57346ba06))
|
|
7
|
+
|
|
8
|
+
## [8.2.3](https://github.com/adobe/helix-onedrive-support/compare/v8.2.2...v8.2.3) (2022-08-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/helix-fetch to v3.1.2 ([9fe7df9](https://github.com/adobe/helix-onedrive-support/commit/9fe7df9d5cc3e86e15241090cd0ada45ed8e7494))
|
|
14
|
+
|
|
15
|
+
## [8.2.2](https://github.com/adobe/helix-onedrive-support/compare/v8.2.1...v8.2.2) (2022-08-06)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **deps:** update external fixes ([5b33492](https://github.com/adobe/helix-onedrive-support/commit/5b3349220d499fa65415ed150eabae01fb0df391))
|
|
21
|
+
|
|
1
22
|
## [8.2.1](https://github.com/adobe/helix-onedrive-support/compare/v8.2.0...v8.2.1) (2022-07-30)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-onedrive-support",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.4",
|
|
4
4
|
"description": "Helix OneDrive Support",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/adobe/helix-onedrive-support#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@adobe/helix-fetch": "3.1.
|
|
32
|
-
"@aws-sdk/client-s3": "3.
|
|
33
|
-
"@azure/msal-node": "1.12.
|
|
31
|
+
"@adobe/helix-fetch": "3.1.2",
|
|
32
|
+
"@aws-sdk/client-s3": "3.142.0",
|
|
33
|
+
"@azure/msal-node": "1.12.1",
|
|
34
34
|
"jose": "4.8.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"c8": "7.12.0",
|
|
42
42
|
"codecov": "3.8.3",
|
|
43
43
|
"dotenv": "16.0.1",
|
|
44
|
-
"eslint": "8.
|
|
44
|
+
"eslint": "8.21.0",
|
|
45
45
|
"eslint-plugin-header": "3.1.1",
|
|
46
46
|
"eslint-plugin-import": "2.26.0",
|
|
47
47
|
"husky": "8.0.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"mocha": "10.0.0",
|
|
54
54
|
"mocha-multi-reporters": "1.5.1",
|
|
55
55
|
"nock": "13.2.9",
|
|
56
|
-
"npm": "8.
|
|
56
|
+
"npm": "8.16.0",
|
|
57
57
|
"semantic-release": "19.0.3"
|
|
58
58
|
},
|
|
59
59
|
"lint-staged": {
|
package/src/OneDriveMock.js
CHANGED
|
@@ -53,24 +53,44 @@ function handleNamedItems(sheet, segs, method, body) {
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Handle the `table` operation on a workbook / worksheet
|
|
56
|
-
* @param {object}
|
|
56
|
+
* @param {object} container The mock data
|
|
57
57
|
* @param {string[]} segs Array of path segments
|
|
58
58
|
* @param {string} method Request method
|
|
59
59
|
* @param {object} body Request body
|
|
60
60
|
* @returns {object} The response value
|
|
61
61
|
*/
|
|
62
|
-
function handleTable(
|
|
62
|
+
function handleTable(container, segs, method, body) {
|
|
63
63
|
const first = segs.shift();
|
|
64
64
|
if (!first) {
|
|
65
|
-
return { value:
|
|
65
|
+
return { value: container.tables.map((table) => ({ name: table.name })) };
|
|
66
66
|
}
|
|
67
67
|
if (first === 'add') {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
let sheet = container;
|
|
69
|
+
|
|
70
|
+
const { address } = body;
|
|
71
|
+
const sep = address.indexOf('!');
|
|
72
|
+
if (sep !== -1) {
|
|
73
|
+
sheet = container.sheets.find((s) => s.name === address.substring(0, sep));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const { values } = sheet.usedRange;
|
|
77
|
+
const headerNames = [];
|
|
78
|
+
const rows = [];
|
|
79
|
+
|
|
80
|
+
if (body.hasHeaders) {
|
|
81
|
+
headerNames.push(...values[0]);
|
|
82
|
+
rows.push(...values.slice(1));
|
|
83
|
+
} else {
|
|
84
|
+
rows.push(...values);
|
|
85
|
+
}
|
|
86
|
+
const len = container.tables.push({
|
|
87
|
+
name: `Table${container.tables.length + 1}`,
|
|
88
|
+
headerNames,
|
|
89
|
+
rows,
|
|
70
90
|
});
|
|
71
|
-
return
|
|
91
|
+
return container.tables[len - 1];
|
|
72
92
|
}
|
|
73
|
-
const table =
|
|
93
|
+
const table = container.tables.find((t) => t.name === first);
|
|
74
94
|
if (!table) {
|
|
75
95
|
throw new StatusCodeError(first, 404);
|
|
76
96
|
}
|