@vroskus/library-social 1.0.18 → 1.0.20
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/dist/index.js +3 -2
- package/dist/mocks.js +1 -1
- package/package.json +14 -23
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ const socialPayloadSchema = () => library_validator_1.Validator.object().keys({
|
|
|
44
44
|
PictureUrl: library_validator_1.Validator.string().allow(null),
|
|
45
45
|
Uid: library_validator_1.Validator.string().required(),
|
|
46
46
|
});
|
|
47
|
+
const successStatus = 200;
|
|
47
48
|
class Social {
|
|
48
49
|
constructor({ mock, timeout, }) {
|
|
49
50
|
_Social_instances.add(this);
|
|
@@ -104,11 +105,11 @@ _Social_instances = new WeakSet(), _Social_setupMock = function _Social_setupMoc
|
|
|
104
105
|
const mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
105
106
|
mock.onGet('https://graph.facebook.com/v9.0/me').reply(() => {
|
|
106
107
|
const responseBody = mocks_1.facebookMock;
|
|
107
|
-
return [
|
|
108
|
+
return [successStatus, responseBody];
|
|
108
109
|
});
|
|
109
110
|
mock.onGet(/https:\/\/www.googleapis.com\/oauth2\/v2\/userinfo/).reply(() => {
|
|
110
111
|
const responseBody = mocks_1.googleMock;
|
|
111
|
-
return [
|
|
112
|
+
return [successStatus, responseBody];
|
|
112
113
|
});
|
|
113
114
|
};
|
|
114
115
|
exports.default = Social;
|
package/dist/mocks.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.socialPayloadMock = exports.googleMock = exports.facebookMock = void 0;
|
|
|
4
4
|
const id = '123';
|
|
5
5
|
const name = 'user';
|
|
6
6
|
const email = 'user@email.com';
|
|
7
|
-
const picture = '
|
|
7
|
+
const picture = 'https://picture.url';
|
|
8
8
|
exports.facebookMock = {
|
|
9
9
|
email,
|
|
10
10
|
id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vroskus/library-social",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "Social",
|
|
5
5
|
"author": "Vilius Roškus <vilius@regattas.eu>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,31 +22,22 @@
|
|
|
22
22
|
"test:e2e:post": "jest-coverage-thresholds-bumper"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@vroskus/library-validator": "^1.0.
|
|
26
|
-
"axios": "^1.
|
|
27
|
-
"axios-mock-adapter": "^1.
|
|
25
|
+
"@vroskus/library-validator": "^1.0.25",
|
|
26
|
+
"axios": "^1.7.9",
|
|
27
|
+
"axios-mock-adapter": "^2.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/axios": "^0.14.
|
|
31
|
-
"@types/jest": "^29.5.
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"eslint": "^8.57.0",
|
|
37
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
38
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
39
|
-
"eslint-config-problems": "^8.0.0",
|
|
40
|
-
"eslint-plugin-import": "^2.29.1",
|
|
41
|
-
"eslint-plugin-import-newlines": "^1.4.0",
|
|
42
|
-
"eslint-plugin-perfectionist": "^2.10.0",
|
|
43
|
-
"eslint-plugin-react": "^7.34.1",
|
|
44
|
-
"express": "^4.19.2",
|
|
30
|
+
"@types/axios": "^0.14.4",
|
|
31
|
+
"@types/jest": "^29.5.14",
|
|
32
|
+
"@types/node": "^22.10.2",
|
|
33
|
+
"@vroskus/eslint-config": "^1.0.19",
|
|
34
|
+
"body-parser": "^1.20.3",
|
|
35
|
+
"express": "^4.21.2",
|
|
45
36
|
"jest": "^29.7.0",
|
|
46
37
|
"jest-coverage-thresholds-bumper": "^1.1.0",
|
|
47
38
|
"supertest": "^7.0.0",
|
|
48
|
-
"ts-jest": "^29.
|
|
49
|
-
"typescript": "^5.
|
|
39
|
+
"ts-jest": "^29.2.5",
|
|
40
|
+
"typescript": "^5.7.2"
|
|
50
41
|
},
|
|
51
42
|
"jest": {
|
|
52
43
|
"preset": "ts-jest",
|
|
@@ -63,8 +54,8 @@
|
|
|
63
54
|
"global": {
|
|
64
55
|
"branches": 50.76,
|
|
65
56
|
"functions": 77.27,
|
|
66
|
-
"lines": 88.
|
|
67
|
-
"statements": 76.
|
|
57
|
+
"lines": 88.23,
|
|
58
|
+
"statements": 76.54
|
|
68
59
|
}
|
|
69
60
|
}
|
|
70
61
|
}
|