@anmiles/google-api-wrapper 18.0.3 → 19.0.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/.nycrc.json +27 -0
- package/CHANGELOG.md +28 -21
- package/README.md +1 -1
- package/cspell.json +22 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api.d.ts +5 -11
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +5 -6
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/auth.d.ts +2 -9
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +3 -23
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/credentials/generator.d.ts +4 -0
- package/dist/lib/credentials/generator.d.ts.map +1 -0
- package/dist/lib/credentials/generator.js +60 -0
- package/dist/lib/credentials/generator.js.map +1 -0
- package/dist/lib/credentials/index.d.ts +5 -0
- package/dist/lib/credentials/index.d.ts.map +1 -0
- package/dist/lib/credentials/index.js +41 -0
- package/dist/lib/credentials/index.js.map +1 -0
- package/dist/lib/credentials/validator.d.ts +6 -0
- package/dist/lib/credentials/validator.d.ts.map +1 -0
- package/dist/lib/credentials/validator.js +21 -0
- package/dist/lib/credentials/validator.js.map +1 -0
- package/dist/lib/login.d.ts +3 -0
- package/dist/lib/login.d.ts.map +1 -0
- package/dist/lib/login.js +19 -0
- package/dist/lib/login.js.map +1 -0
- package/dist/lib/profiles.d.ts +4 -12
- package/dist/lib/profiles.d.ts.map +1 -1
- package/dist/lib/profiles.js +8 -11
- package/dist/lib/profiles.js.map +1 -1
- package/dist/lib/renderer.d.ts +7 -25
- package/dist/lib/renderer.d.ts.map +1 -1
- package/dist/lib/renderer.js +26 -23
- package/dist/lib/renderer.js.map +1 -1
- package/dist/lib/scopes.d.ts +2 -0
- package/dist/lib/scopes.d.ts.map +1 -0
- package/dist/lib/scopes.js +22 -0
- package/dist/lib/scopes.js.map +1 -0
- package/dist/lib/secrets.d.ts +2 -28
- package/dist/lib/secrets.d.ts.map +1 -1
- package/dist/lib/secrets.js +11 -112
- package/dist/lib/secrets.js.map +1 -1
- package/dist/lib/utils/paths.d.ts +7 -0
- package/dist/lib/utils/paths.d.ts.map +1 -0
- package/dist/lib/{paths.js → utils/paths.js} +6 -8
- package/dist/lib/utils/paths.js.map +1 -0
- package/dist/templates/auth.html +1 -1
- package/dist/templates/index.html +6 -1
- package/dist/templates/page.html +1 -2
- package/dist/templates/script.html +0 -0
- package/{src/templates/css.html → dist/templates/style.html} +2 -2
- package/dist/types/options.d.ts +2 -3
- package/dist/types/options.d.ts.map +1 -1
- package/dist/types/secrets.d.ts +1 -2
- package/dist/types/secrets.d.ts.map +1 -1
- package/eslint.config.mts +43 -0
- package/jest.config.js +9 -9
- package/package.json +40 -30
- package/src/index.ts +3 -2
- package/src/lib/__tests__/__snapshots__/renderer.test.ts.snap +273 -0
- package/src/lib/__tests__/__snapshots__/scopes.test.ts.snap +6 -0
- package/src/lib/__tests__/__snapshots__/secrets.test.ts.snap +38 -0
- package/src/lib/__tests__/api.test.ts +72 -74
- package/src/lib/__tests__/auth.test.ts +38 -114
- package/src/lib/__tests__/login.test.ts +71 -0
- package/src/lib/__tests__/profiles.test.ts +50 -93
- package/src/lib/__tests__/renderer.test.ts +16 -89
- package/src/lib/__tests__/scopes.test.ts +41 -0
- package/src/lib/__tests__/secrets.test.ts +47 -541
- package/src/lib/api.ts +19 -21
- package/src/lib/auth.ts +5 -25
- package/src/lib/credentials/__tests__/generator.test.ts +249 -0
- package/src/lib/credentials/__tests__/index.test.ts +213 -0
- package/src/lib/credentials/__tests__/validator.test.ts +34 -0
- package/src/lib/credentials/generator.ts +70 -0
- package/src/lib/credentials/index.ts +49 -0
- package/src/lib/credentials/validator.ts +24 -0
- package/src/lib/login.ts +22 -0
- package/src/lib/profiles.ts +9 -12
- package/src/lib/renderer.ts +32 -27
- package/src/lib/scopes.ts +18 -0
- package/src/lib/secrets.ts +17 -139
- package/src/lib/utils/paths.ts +30 -0
- package/src/templates/auth.html +1 -1
- package/src/templates/index.html +6 -1
- package/src/templates/page.html +1 -2
- package/src/templates/script.html +0 -0
- package/{dist/templates/css.html → src/templates/style.html} +2 -2
- package/src/types/options.ts +5 -7
- package/src/types/secrets.ts +8 -10
- package/tsconfig.build.json +6 -0
- package/tsconfig.json +0 -5
- package/tsconfig.test.json +1 -1
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -30
- package/.vscode/settings.json +0 -9
- package/coverage.config.js +0 -8
- package/dist/lib/paths.d.ts +0 -16
- package/dist/lib/paths.d.ts.map +0 -1
- package/dist/lib/paths.js.map +0 -1
- package/src/lib/__tests__/paths.test.ts +0 -77
- package/src/lib/paths.ts +0 -32
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { configs } from '@anmiles/eslint-config';
|
|
2
|
+
import type { Linter } from 'eslint';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
...configs.base,
|
|
6
|
+
...configs.ts,
|
|
7
|
+
...configs.jest,
|
|
8
|
+
|
|
9
|
+
{
|
|
10
|
+
ignores: [
|
|
11
|
+
'coverage/*',
|
|
12
|
+
'dist/*',
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
languageOptions: {
|
|
18
|
+
globals: {
|
|
19
|
+
NodeJS: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
{
|
|
25
|
+
rules: {
|
|
26
|
+
camelcase: [ 'error', { allow: [
|
|
27
|
+
'access_token',
|
|
28
|
+
'access_type',
|
|
29
|
+
'auth_provider_x509_cert_url',
|
|
30
|
+
'auth_uri',
|
|
31
|
+
'calendar_v3',
|
|
32
|
+
'client_id',
|
|
33
|
+
'client_secret',
|
|
34
|
+
'expiry_date',
|
|
35
|
+
'project_id',
|
|
36
|
+
'redirect_uris',
|
|
37
|
+
'refresh_token',
|
|
38
|
+
'token_uri',
|
|
39
|
+
] } ],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
] as Linter.Config[];
|
|
43
|
+
|
package/jest.config.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
preset
|
|
3
|
-
transform
|
|
4
|
-
'^.+\\.tsx?$'
|
|
5
|
-
|
|
6
|
-
tsconfig : './tsconfig.test.json',
|
|
2
|
+
preset : 'ts-jest',
|
|
3
|
+
transform: {
|
|
4
|
+
'^.+\\.tsx?$': [ 'ts-jest', {
|
|
5
|
+
tsconfig: './tsconfig.test.json',
|
|
7
6
|
} ],
|
|
8
7
|
},
|
|
9
8
|
|
|
10
|
-
clearMocks
|
|
9
|
+
clearMocks: true,
|
|
11
10
|
|
|
12
|
-
roots
|
|
13
|
-
testMatch
|
|
11
|
+
roots : [ '<rootDir>/src' ],
|
|
12
|
+
testMatch: [ '<rootDir>/src/**/__tests__/*.test.{ts,tsx}' ],
|
|
14
13
|
|
|
15
|
-
collectCoverageFrom
|
|
14
|
+
collectCoverageFrom: [
|
|
16
15
|
'<rootDir>/src/**/*.{ts,tsx}',
|
|
17
16
|
'!<rootDir>/src/**/__tests__/**',
|
|
17
|
+
'!<rootDir>/src/**/__mocks__/**',
|
|
18
18
|
],
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anmiles/google-api-wrapper",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"description": "Wrapper around googleapis for getting data shortly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"google",
|
|
@@ -12,53 +12,63 @@
|
|
|
12
12
|
"repository": "github:anmiles/google-api-wrapper",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=20.19.0"
|
|
16
16
|
},
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"spellcheck": "cspell .",
|
|
20
|
+
"prebuild": "rimraf dist",
|
|
21
|
+
"build": "tsc -p ./tsconfig.build.json",
|
|
22
|
+
"postbuild": "copyfiles -u 1 src/templates/* dist/",
|
|
23
|
+
"lint": "eslint",
|
|
24
|
+
"lint:fix": "eslint --fix",
|
|
22
25
|
"test": "jest --verbose",
|
|
23
26
|
"test:coverage": "npm test -- --coverage",
|
|
24
27
|
"test:ci": "npm test -- --ci --coverage",
|
|
25
28
|
"test:watch": "npm test -- --watch",
|
|
26
29
|
"test:watch:coverage": "npm test -- --watch --coverage",
|
|
27
|
-
"test:report:coverage": "nyc report
|
|
30
|
+
"test:report:coverage": "nyc report"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@anmiles/logger": "^
|
|
31
|
-
"@anmiles/prototypes": "^
|
|
32
|
-
"@anmiles/sleep": "^
|
|
33
|
+
"@anmiles/logger": "^8.0.0",
|
|
34
|
+
"@anmiles/prototypes": "^11.0.0",
|
|
35
|
+
"@anmiles/sleep": "^5.0.0",
|
|
33
36
|
"out-url": "^1.2.2",
|
|
34
37
|
"server-destroy": "^1.0.1"
|
|
35
38
|
},
|
|
36
39
|
"peerDependencies": {
|
|
37
|
-
"googleapis": "^
|
|
40
|
+
"googleapis": "^148.0.0"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
40
|
-
"@anmiles/eslint-config": "^
|
|
41
|
-
"@anmiles/tsconfig": "^
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
43
|
+
"@anmiles/eslint-config": "^9.0.0",
|
|
44
|
+
"@anmiles/tsconfig": "^4.0.0",
|
|
45
|
+
"@eslint/compat": "^1.2.9",
|
|
46
|
+
"@eslint/css": "^0.8.1",
|
|
47
|
+
"@eslint/js": "^9.27.0",
|
|
48
|
+
"@eslint/json": "^0.12.0",
|
|
49
|
+
"@eslint/markdown": "^6.4.0",
|
|
50
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
51
|
+
"@types/jest": "^29.5.14",
|
|
52
|
+
"@types/mock-fs": "^4.13.4",
|
|
53
|
+
"@types/server-destroy": "^1.0.4",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
55
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
48
56
|
"copyfiles": "^2.4.1",
|
|
49
|
-
"
|
|
50
|
-
"eslint
|
|
57
|
+
"cspell": "^9.0.1",
|
|
58
|
+
"eslint": "^9.27.0",
|
|
59
|
+
"eslint-import-resolver-typescript": "^4.3.5",
|
|
51
60
|
"eslint-plugin-align-assignments": "^1.1.2",
|
|
52
|
-
"eslint-plugin-
|
|
53
|
-
"eslint-plugin-
|
|
54
|
-
"eslint-plugin-
|
|
55
|
-
"eslint-plugin-n": "^
|
|
56
|
-
"eslint-plugin-promise": "^
|
|
57
|
-
"event-emitter": "^0.3.5",
|
|
61
|
+
"eslint-plugin-i18next": "^6.1.1",
|
|
62
|
+
"eslint-plugin-import": "^2.31.0",
|
|
63
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
64
|
+
"eslint-plugin-n": "^17.18.0",
|
|
65
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
58
66
|
"jest": "^29.7.0",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
67
|
+
"jiti": "^2.4.2",
|
|
68
|
+
"mock-fs": "^5.5.0",
|
|
69
|
+
"nyc": "^17.1.0",
|
|
70
|
+
"rimraf": "^6.0.1",
|
|
71
|
+
"ts-jest": "^29.3.4",
|
|
72
|
+
"typescript": "^5.8.3"
|
|
63
73
|
}
|
|
64
74
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* istanbul ignore file */
|
|
2
2
|
|
|
3
3
|
export { getAPI } from './lib/api';
|
|
4
|
-
export { createProfile,
|
|
5
|
-
export {
|
|
4
|
+
export { createProfile, filterProfiles, getProfiles } from './lib/profiles';
|
|
5
|
+
export { getAuth } from './lib/auth';
|
|
6
|
+
export { login } from './lib/login';
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`src/lib/renderer renderAuth should return auth page 1`] = `
|
|
4
|
+
"<!DOCTYPE html>
|
|
5
|
+
<html>
|
|
6
|
+
<head>
|
|
7
|
+
<title>Google API sign-in'</title>
|
|
8
|
+
<meta charset="utf-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
|
|
13
|
+
<style type="text/css">
|
|
14
|
+
* {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
html, body {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
font-family: "Segoe UI", "Roboto", "Helvetica", sans-serif;
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
padding: 30px 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.box {
|
|
35
|
+
width: 450px;
|
|
36
|
+
min-height: 500px;
|
|
37
|
+
max-height: 100%;
|
|
38
|
+
padding: 82px 40px 28px 40px;
|
|
39
|
+
margin: 1em;
|
|
40
|
+
border: 1px solid #dadce0;
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
position: relative;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.box:before {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 34px;
|
|
51
|
+
border-bottom: 1px solid #dadce0;
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0;
|
|
54
|
+
display: block;
|
|
55
|
+
content: '';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
h1 {
|
|
59
|
+
font-size: 24px;
|
|
60
|
+
line-height: 40px;
|
|
61
|
+
font-weight: normal;
|
|
62
|
+
margin: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
p {
|
|
66
|
+
line-height: 32px;
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ul {
|
|
71
|
+
width: 100%;
|
|
72
|
+
margin: 18px 0 30px 0;
|
|
73
|
+
padding-left: 0;
|
|
74
|
+
border-top: 1px solid #dadce0;
|
|
75
|
+
list-style-type: none;
|
|
76
|
+
overflow: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
li {
|
|
80
|
+
line-height: 48px;
|
|
81
|
+
color: brown;
|
|
82
|
+
border-bottom: 1px solid #dadce0;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
li:before {
|
|
88
|
+
content: 'W';
|
|
89
|
+
width: 28px;
|
|
90
|
+
height: 28px;
|
|
91
|
+
border-radius: 50%;
|
|
92
|
+
border: 2px solid currentColor;
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
margin-right: 10px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
li.readonly {
|
|
101
|
+
color: darkgreen;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
li.readonly:before {
|
|
105
|
+
content: 'R';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
a {
|
|
109
|
+
width: 50%;
|
|
110
|
+
padding: 0 24px;
|
|
111
|
+
line-height: 36px;
|
|
112
|
+
margin: auto;
|
|
113
|
+
color: #ffffff;
|
|
114
|
+
background: #1a73e8;
|
|
115
|
+
border-radius: 4px;
|
|
116
|
+
outline: none;
|
|
117
|
+
display: block;
|
|
118
|
+
text-align: center;
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
font-weight: bold;
|
|
121
|
+
font-size: 15px;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
124
|
+
|
|
125
|
+
<div class="box">
|
|
126
|
+
<h1>Welcome username!</h1>
|
|
127
|
+
<p>Please authorize:</p>
|
|
128
|
+
<ul>
|
|
129
|
+
<li class="readonly" title="Readonly (cannot change or delete your data)">scope1.readonly</li>
|
|
130
|
+
<li class="" title="Writable (can change or delete your data)">scope2</li>
|
|
131
|
+
</ul>
|
|
132
|
+
<a id="button" href="https://authUrl">Continue</a>
|
|
133
|
+
<script type="text/javascript">document.addEventListener('DOMContentLoaded', function(){ document.getElementById('button').focus(); });</script>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
</body>
|
|
139
|
+
</html>"
|
|
140
|
+
`;
|
|
141
|
+
|
|
142
|
+
exports[`src/lib/renderer renderDone should return done page 1`] = `
|
|
143
|
+
"<!DOCTYPE html>
|
|
144
|
+
<html>
|
|
145
|
+
<head>
|
|
146
|
+
<title>Google API sign-in'</title>
|
|
147
|
+
<meta charset="utf-8">
|
|
148
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
|
149
|
+
</head>
|
|
150
|
+
<body>
|
|
151
|
+
|
|
152
|
+
<style type="text/css">
|
|
153
|
+
* {
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
html, body {
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 100%;
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
body {
|
|
165
|
+
font-family: "Segoe UI", "Roboto", "Helvetica", sans-serif;
|
|
166
|
+
font-size: 16px;
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
padding: 30px 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.box {
|
|
174
|
+
width: 450px;
|
|
175
|
+
min-height: 500px;
|
|
176
|
+
max-height: 100%;
|
|
177
|
+
padding: 82px 40px 28px 40px;
|
|
178
|
+
margin: 1em;
|
|
179
|
+
border: 1px solid #dadce0;
|
|
180
|
+
border-radius: 8px;
|
|
181
|
+
position: relative;
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
align-items: center;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.box:before {
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 34px;
|
|
190
|
+
border-bottom: 1px solid #dadce0;
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: 0;
|
|
193
|
+
display: block;
|
|
194
|
+
content: '';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
h1 {
|
|
198
|
+
font-size: 24px;
|
|
199
|
+
line-height: 40px;
|
|
200
|
+
font-weight: normal;
|
|
201
|
+
margin: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
p {
|
|
205
|
+
line-height: 32px;
|
|
206
|
+
margin: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
ul {
|
|
210
|
+
width: 100%;
|
|
211
|
+
margin: 18px 0 30px 0;
|
|
212
|
+
padding-left: 0;
|
|
213
|
+
border-top: 1px solid #dadce0;
|
|
214
|
+
list-style-type: none;
|
|
215
|
+
overflow: auto;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
li {
|
|
219
|
+
line-height: 48px;
|
|
220
|
+
color: brown;
|
|
221
|
+
border-bottom: 1px solid #dadce0;
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
li:before {
|
|
227
|
+
content: 'W';
|
|
228
|
+
width: 28px;
|
|
229
|
+
height: 28px;
|
|
230
|
+
border-radius: 50%;
|
|
231
|
+
border: 2px solid currentColor;
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
margin-right: 10px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
li.readonly {
|
|
240
|
+
color: darkgreen;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
li.readonly:before {
|
|
244
|
+
content: 'R';
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
a {
|
|
248
|
+
width: 50%;
|
|
249
|
+
padding: 0 24px;
|
|
250
|
+
line-height: 36px;
|
|
251
|
+
margin: auto;
|
|
252
|
+
color: #ffffff;
|
|
253
|
+
background: #1a73e8;
|
|
254
|
+
border-radius: 4px;
|
|
255
|
+
outline: none;
|
|
256
|
+
display: block;
|
|
257
|
+
text-align: center;
|
|
258
|
+
text-decoration: none;
|
|
259
|
+
font-weight: bold;
|
|
260
|
+
font-size: 15px;
|
|
261
|
+
}
|
|
262
|
+
</style>
|
|
263
|
+
|
|
264
|
+
<div class="box">
|
|
265
|
+
<h1>Welcome username!</h1>
|
|
266
|
+
<p>Please close this page and return to application.</p>
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
</body>
|
|
272
|
+
</html>"
|
|
273
|
+
`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`src/lib/secrets getSecrets should throw if callbackURI is incorrect 1`] = `"Error in credentials file: redirect URI should be http://localhost:6006/oauthcallback"`;
|
|
4
|
+
|
|
5
|
+
exports[`src/lib/secrets getSecrets should throw if no secrets file 1`] = `
|
|
6
|
+
"File secrets\\username1.json not found!
|
|
7
|
+
Here is how to obtain it:
|
|
8
|
+
Go to https://console.cloud.google.com/projectcreate
|
|
9
|
+
Choose project name
|
|
10
|
+
Click "CREATE" and wait for project to become created
|
|
11
|
+
Go to https://console.cloud.google.com/apis/dashboard
|
|
12
|
+
Select just created project in the top left dropdown list
|
|
13
|
+
Click "ENABLE APIS AND SERVICES"
|
|
14
|
+
Click API you need
|
|
15
|
+
Click "ENABLE" and wait for API to become enabled
|
|
16
|
+
Click "Credentials" tab on the left sidebar
|
|
17
|
+
Click "CONFIGURE CONSENT SCREEN" on the right
|
|
18
|
+
Choose "External"
|
|
19
|
+
Click "CREATE"
|
|
20
|
+
Choose app name, i.e. "NodeJS"
|
|
21
|
+
Specify your email as user support email and as developer contact information on the very bottom
|
|
22
|
+
Click "Save and continue"
|
|
23
|
+
Click "Add or remove scopes"
|
|
24
|
+
Add scopes: scope1,scope2
|
|
25
|
+
Click "Save and continue"
|
|
26
|
+
Click "Add users"
|
|
27
|
+
Add your email
|
|
28
|
+
Click "Save and continue"
|
|
29
|
+
Click "Back to dashboard" on the very bottom
|
|
30
|
+
Click "Credentials" on the left sidebar
|
|
31
|
+
Click "CREATE CREDENTIALS" and choose "OAuth client ID"
|
|
32
|
+
Select application type "Web application"
|
|
33
|
+
Specify app name, i.e. "NodeJS"
|
|
34
|
+
Add authorized redirect URI: http://localhost:6006/oauthcallback
|
|
35
|
+
Click "CREATE"
|
|
36
|
+
Click "DOWNLOAD JSON" and download credentials to ./secrets/username1.json
|
|
37
|
+
Then start this script again"
|
|
38
|
+
`;
|