@logto/connector-discord 1.2.0 → 1.3.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/lib/index.js +3 -2
- package/package.json +28 -5
package/lib/index.js
CHANGED
|
@@ -166,7 +166,8 @@ const getUserInfo = (getConfig) => async (data) => {
|
|
|
166
166
|
},
|
|
167
167
|
timeout: { request: defaultTimeout },
|
|
168
168
|
});
|
|
169
|
-
const
|
|
169
|
+
const rawData = parseJson(httpResponse.body);
|
|
170
|
+
const result = userInfoResponseGuard.safeParse(rawData);
|
|
170
171
|
if (!result.success) {
|
|
171
172
|
throw new ConnectorError(ConnectorErrorCodes.InvalidResponse, result.error);
|
|
172
173
|
}
|
|
@@ -181,7 +182,7 @@ const getUserInfo = (getConfig) => async (data) => {
|
|
|
181
182
|
if (!userInfoResult.success) {
|
|
182
183
|
throw new ConnectorError(ConnectorErrorCodes.InvalidResponse, userInfoResult.error);
|
|
183
184
|
}
|
|
184
|
-
return userInfoResult.data;
|
|
185
|
+
return { ...userInfoResult.data, rawData };
|
|
185
186
|
}
|
|
186
187
|
catch (error) {
|
|
187
188
|
if (error instanceof HTTPError) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/connector-discord",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Discord connector implementation.",
|
|
5
5
|
"author": "ZR3SYSTEMS. <https://github.com/FlurryNight>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@logto/connector-kit": "^
|
|
7
|
+
"@logto/connector-kit": "^4.0.0",
|
|
8
|
+
"@silverhand/essentials": "^2.9.1",
|
|
9
|
+
"got": "^14.0.0",
|
|
10
|
+
"snakecase-keys": "^8.0.0",
|
|
11
|
+
"zod": "^3.22.4"
|
|
8
12
|
},
|
|
9
13
|
"main": "./lib/index.js",
|
|
10
14
|
"module": "./lib/index.js",
|
|
@@ -36,6 +40,26 @@
|
|
|
36
40
|
"publishConfig": {
|
|
37
41
|
"access": "public"
|
|
38
42
|
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@rollup/plugin-commonjs": "^26.0.0",
|
|
45
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
46
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
47
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
48
|
+
"@silverhand/eslint-config": "6.0.1",
|
|
49
|
+
"@silverhand/ts-config": "6.0.0",
|
|
50
|
+
"@types/node": "^20.11.20",
|
|
51
|
+
"@types/supertest": "^6.0.2",
|
|
52
|
+
"@vitest/coverage-v8": "^1.4.0",
|
|
53
|
+
"eslint": "^8.56.0",
|
|
54
|
+
"lint-staged": "^15.0.2",
|
|
55
|
+
"nock": "^13.3.1",
|
|
56
|
+
"prettier": "^3.0.0",
|
|
57
|
+
"rollup": "^4.12.0",
|
|
58
|
+
"rollup-plugin-output-size": "^1.3.0",
|
|
59
|
+
"supertest": "^7.0.0",
|
|
60
|
+
"typescript": "^5.3.3",
|
|
61
|
+
"vitest": "^1.4.0"
|
|
62
|
+
},
|
|
39
63
|
"scripts": {
|
|
40
64
|
"precommit": "lint-staged",
|
|
41
65
|
"build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
|
|
@@ -43,8 +67,7 @@
|
|
|
43
67
|
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental",
|
|
44
68
|
"lint": "eslint --ext .ts src",
|
|
45
69
|
"lint:report": "pnpm lint --format json --output-file report.json",
|
|
46
|
-
"test
|
|
47
|
-
"test": "pnpm
|
|
48
|
-
"test:ci": "pnpm test:only --silent --coverage"
|
|
70
|
+
"test": "vitest src",
|
|
71
|
+
"test:ci": "pnpm run test --silent --coverage"
|
|
49
72
|
}
|
|
50
73
|
}
|