@kubun/provider-google 0.10.0 → 0.12.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.
Files changed (2) hide show
  1. package/lib/index.js +20 -1
  2. package/package.json +10 -10
package/lib/index.js CHANGED
@@ -1 +1,20 @@
1
- export function createGoogleProvider(e){if(!e.clientID)throw Error("Google provider requires a non-empty clientID");if(!e.clientSecret)throw Error("Google provider requires a non-empty clientSecret");return{name:"google",authorizationEndpoint:"https://accounts.google.com/o/oauth2/v2/auth",tokenEndpoint:"https://oauth2.googleapis.com/token",baseScopes:["openid","profile","email"],clientID:e.clientID,clientSecret:e.clientSecret}}
1
+ export function createGoogleProvider(params) {
2
+ if (!params.clientID) {
3
+ throw new Error('Google provider requires a non-empty clientID');
4
+ }
5
+ if (!params.clientSecret) {
6
+ throw new Error('Google provider requires a non-empty clientSecret');
7
+ }
8
+ return {
9
+ name: 'google',
10
+ authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
11
+ tokenEndpoint: 'https://oauth2.googleapis.com/token',
12
+ baseScopes: [
13
+ 'openid',
14
+ 'profile',
15
+ 'email'
16
+ ],
17
+ clientID: params.clientID,
18
+ clientSecret: params.clientSecret
19
+ };
20
+ }
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "@kubun/provider-google",
3
- "version": "0.10.0",
4
- "license": "see LICENSE.md",
3
+ "version": "0.12.0",
5
4
  "keywords": [],
5
+ "license": "see LICENSE.md",
6
+ "sideEffects": false,
6
7
  "type": "module",
7
- "main": "lib/index.js",
8
- "types": "lib/index.d.ts",
9
8
  "exports": {
10
9
  ".": "./lib/index.js"
11
10
  },
11
+ "main": "lib/index.js",
12
+ "types": "lib/index.d.ts",
12
13
  "files": [
13
14
  "lib/*",
14
15
  "LICENSE.md"
15
16
  ],
16
- "sideEffects": false,
17
17
  "dependencies": {
18
- "@kubun/connector": "^0.10.0"
18
+ "@kubun/connector": "^0.12.0"
19
19
  },
20
20
  "scripts": {
21
+ "build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
21
22
  "build:clean": "del lib",
22
- "build:js": "swc src -d ./lib --config-file ../../swc.json --strip-leading-paths",
23
+ "build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
23
24
  "build:types": "tsc --emitDeclarationOnly --skipLibCheck",
24
25
  "build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
25
- "build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
26
+ "test": "pnpm run test:types && pnpm run test:unit",
26
27
  "test:types": "tsc --noEmit -p tsconfig.test.json",
27
- "test:unit": "vitest run",
28
- "test": "pnpm run test:types && pnpm run test:unit"
28
+ "test:unit": "vitest run"
29
29
  }
30
30
  }