@logto/connector-google 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 +11 -1
- package/lib/types.d.ts +4 -4
- 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
|
const authorizationEndpoint = 'https://accounts.google.com/o/oauth2/v2/auth';
|
|
@@ -37,7 +47,7 @@ const defaultMetadata = {
|
|
|
37
47
|
en: 'Google is a principal search engine technology and email service provider.',
|
|
38
48
|
'zh-CN': 'Google 是全球性的搜索引擎和邮件服务提供商。',
|
|
39
49
|
'tr-TR': 'Google, en büyük arama motoru teknolojisi ve e-posta servis sağlayıcısıdır.',
|
|
40
|
-
ko: 'Google은 가장 큰 검색 엔진 기술과 이메일 서비스 제공자입니다.',
|
|
50
|
+
ko: 'Google은 가장 큰 검색 엔진 기술과 이메일 서비스 제공자입니다.',
|
|
41
51
|
},
|
|
42
52
|
readme: './README.md',
|
|
43
53
|
formItems: [
|
package/lib/types.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ export declare const googleConfigGuard: 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 GoogleConfig = z.infer<typeof googleConfigGuard>;
|
|
16
16
|
export declare const accessTokenResponseGuard: z.ZodObject<{
|
|
@@ -37,6 +37,7 @@ export declare const userInfoResponseGuard: z.ZodObject<{
|
|
|
37
37
|
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
38
38
|
locale: z.ZodOptional<z.ZodString>;
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
sub: string;
|
|
40
41
|
name?: string | undefined;
|
|
41
42
|
given_name?: string | undefined;
|
|
42
43
|
family_name?: string | undefined;
|
|
@@ -44,8 +45,8 @@ export declare const userInfoResponseGuard: z.ZodObject<{
|
|
|
44
45
|
email?: string | undefined;
|
|
45
46
|
email_verified?: boolean | undefined;
|
|
46
47
|
locale?: string | undefined;
|
|
47
|
-
sub: string;
|
|
48
48
|
}, {
|
|
49
|
+
sub: string;
|
|
49
50
|
name?: string | undefined;
|
|
50
51
|
given_name?: string | undefined;
|
|
51
52
|
family_name?: string | undefined;
|
|
@@ -53,7 +54,6 @@ export declare const userInfoResponseGuard: z.ZodObject<{
|
|
|
53
54
|
email?: string | undefined;
|
|
54
55
|
email_verified?: boolean | undefined;
|
|
55
56
|
locale?: string | undefined;
|
|
56
|
-
sub: string;
|
|
57
57
|
}>;
|
|
58
58
|
export type UserInfoResponse = z.infer<typeof userInfoResponseGuard>;
|
|
59
59
|
export declare const authResponseGuard: z.ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/connector-google",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Google web connector implementation.",
|
|
5
5
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
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",
|