@logto/connector-discord 1.1.0 → 1.2.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/LICENSE +0 -6
- package/lib/index.js +10 -0
- package/lib/types.d.ts +8 -8
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
Portions of this software are licensed as follows:
|
|
2
|
-
|
|
3
|
-
* All content that resides under the "packages/cloud" directory of this repository, if that directory exists, is licensed under the license defined in "packages/cloud/LICENSE" (Elastic-2.0).
|
|
4
|
-
* All third party components incorporated into this software are licensed under the original license provided by the owner of the applicable component.
|
|
5
|
-
* Content outside of the above mentioned directories or restrictions above is available under the "MPL-2.0" license as defined below.
|
|
6
|
-
|
|
7
1
|
Mozilla Public License Version 2.0
|
|
8
2
|
==================================
|
|
9
3
|
|
package/lib/index.js
CHANGED
|
@@ -15,6 +15,16 @@ const assert = (value, error) => {
|
|
|
15
15
|
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
|
|
16
16
|
const notFalsy = (value) => Boolean(value);
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Conditional return the expression result when it's not {@link Falsy};
|
|
20
|
+
* otherwise return `undefined`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* conditional(1 && '2') // '2'
|
|
25
|
+
* conditional(false && '1') // undefined
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
18
28
|
const conditional = (exp) => (notFalsy(exp) ? exp : undefined);
|
|
19
29
|
|
|
20
30
|
/**
|
package/lib/types.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ export declare const discordConfigGuard: z.ZodObject<{
|
|
|
4
4
|
clientSecret: z.ZodString;
|
|
5
5
|
scope: z.ZodOptional<z.ZodString>;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
scope?: string | undefined;
|
|
8
7
|
clientId: string;
|
|
9
8
|
clientSecret: string;
|
|
10
|
-
}, {
|
|
11
9
|
scope?: string | undefined;
|
|
10
|
+
}, {
|
|
12
11
|
clientId: string;
|
|
13
12
|
clientSecret: string;
|
|
13
|
+
scope?: string | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
export type DiscordConfig = z.infer<typeof discordConfigGuard>;
|
|
16
16
|
export declare const accessTokenResponseGuard: z.ZodObject<{
|
|
@@ -32,22 +32,22 @@ export declare const accessTokenResponseGuard: z.ZodObject<{
|
|
|
32
32
|
export type AccessTokenResponse = z.infer<typeof accessTokenResponseGuard>;
|
|
33
33
|
export declare const userInfoResponseGuard: z.ZodObject<{
|
|
34
34
|
id: z.ZodString;
|
|
35
|
-
username: z.ZodEffects<z.
|
|
36
|
-
avatar: z.ZodEffects<z.
|
|
37
|
-
email: z.ZodEffects<z.
|
|
38
|
-
verified: z.ZodEffects<z.
|
|
35
|
+
username: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
36
|
+
avatar: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
37
|
+
email: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
38
|
+
verified: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, boolean | undefined, boolean | null | undefined>;
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
id: string;
|
|
40
41
|
username?: string | undefined;
|
|
41
42
|
avatar?: string | undefined;
|
|
42
43
|
email?: string | undefined;
|
|
43
44
|
verified?: boolean | undefined;
|
|
44
|
-
id: string;
|
|
45
45
|
}, {
|
|
46
|
+
id: string;
|
|
46
47
|
username?: string | null | undefined;
|
|
47
48
|
avatar?: string | null | undefined;
|
|
48
49
|
email?: string | null | undefined;
|
|
49
50
|
verified?: boolean | null | undefined;
|
|
50
|
-
id: string;
|
|
51
51
|
}>;
|
|
52
52
|
export type UserInfoResponse = z.infer<typeof userInfoResponseGuard>;
|
|
53
53
|
export declare const authorizationCallbackErrorGuard: z.ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/connector-discord",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
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": "^2.1.0"
|
|
8
8
|
},
|
|
9
9
|
"main": "./lib/index.js",
|
|
10
10
|
"module": "./lib/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"logo-dark.svg"
|
|
19
19
|
],
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": "^
|
|
21
|
+
"node": "^20.9.0"
|
|
22
22
|
},
|
|
23
23
|
"eslintConfig": {
|
|
24
24
|
"extends": "@silverhand",
|