@anmiles/google-api-wrapper 18.0.1 → 18.0.3
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/CHANGELOG.md +8 -0
- package/dist/lib/renderer.d.ts +2 -0
- package/dist/lib/renderer.d.ts.map +1 -1
- package/dist/lib/renderer.js +5 -2
- package/dist/lib/renderer.js.map +1 -1
- package/dist/templates/index.html +12 -0
- package/package.json +9 -10
- package/src/lib/__tests__/renderer.test.ts +3 -2
- package/src/lib/renderer.ts +5 -2
- package/src/templates/index.html +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [18.0.3](../../tags/v18.0.3) - 2024-04-03
|
|
9
|
+
### Changed
|
|
10
|
+
- Restructuring * reorganize HTML
|
|
11
|
+
|
|
12
|
+
## [18.0.2](../../tags/v18.0.2) - 2024-03-20
|
|
13
|
+
### Changed
|
|
14
|
+
- Update dependencies
|
|
15
|
+
|
|
8
16
|
## [18.0.1](../../tags/v18.0.1) - 2024-03-16
|
|
9
17
|
### Changed
|
|
10
18
|
- Fix inferring type by getItems
|
package/dist/lib/renderer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const templates: {
|
|
2
|
+
readonly index: readonly ["page"];
|
|
2
3
|
readonly page: readonly ["css", "content"];
|
|
3
4
|
readonly css: readonly [];
|
|
4
5
|
readonly auth: readonly ["profile", "authUrl", "scopesList"];
|
|
@@ -19,6 +20,7 @@ declare function getTemplate(templateName: TemplateName): string;
|
|
|
19
20
|
export { templates, renderAuth, renderDone };
|
|
20
21
|
declare const _default: {
|
|
21
22
|
templates: {
|
|
23
|
+
readonly index: readonly ["page"];
|
|
22
24
|
readonly page: readonly ["css", "content"];
|
|
23
25
|
readonly css: readonly [];
|
|
24
26
|
readonly auth: readonly ["profile", "authUrl", "scopesList"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/lib/renderer.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/lib/renderer.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,SAAS;;;;;;;CAOL,CAAC;AAEX,KAAK,YAAY,GAAG,MAAM,OAAO,SAAS,CAAC;AAI3C,iBAAS,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAG,MAAM,CAAC;IAAC,OAAO,EAAG,MAAM,CAAC;IAAC,KAAK,EAAG,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAWjH;AAED,iBAAS,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAG,MAAM,CAAA;CAAE,GAAG,MAAM,CAK7D;AAGD,iBAAS,MAAM,CAAC,CAAC,SAAS,YAAY,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAUhI;AAED,iBAAS,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAQvD;AAED,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;;;;;;;;;;;;;;;AAC7C,wBAA0E"}
|
package/dist/lib/renderer.js
CHANGED
|
@@ -8,6 +8,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const renderer_1 = __importDefault(require("./renderer"));
|
|
9
9
|
const paths_1 = require("./paths");
|
|
10
10
|
const templates = {
|
|
11
|
+
index: ['page'],
|
|
11
12
|
page: ['css', 'content'],
|
|
12
13
|
css: [],
|
|
13
14
|
auth: ['profile', 'authUrl', 'scopesList'],
|
|
@@ -24,13 +25,15 @@ function renderAuth({ profile, authUrl, scope }) {
|
|
|
24
25
|
})).join('\n');
|
|
25
26
|
const css = render('css', {});
|
|
26
27
|
const content = render('auth', { profile, authUrl, scopesList });
|
|
27
|
-
|
|
28
|
+
const page = render('page', { css, content });
|
|
29
|
+
return render('index', { page });
|
|
28
30
|
}
|
|
29
31
|
exports.renderAuth = renderAuth;
|
|
30
32
|
function renderDone({ profile }) {
|
|
31
33
|
const css = render('css', {});
|
|
32
34
|
const content = render('done', { profile });
|
|
33
|
-
|
|
35
|
+
const page = render('page', { css, content });
|
|
36
|
+
return render('index', { page });
|
|
34
37
|
}
|
|
35
38
|
exports.renderDone = renderDone;
|
|
36
39
|
// TODO: Use react
|
package/dist/lib/renderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/lib/renderer.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,0DAAkC;AAClC,mCAA0C;AAE1C,MAAM,SAAS,GAAG;IACjB,IAAI,EAAI,CAAE,KAAK,EAAE,SAAS,CAAW;IACrC,GAAG,EAAK,EAAY;IACpB,IAAI,EAAI,CAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAE;IAC9C,KAAK,EAAG,CAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAW;IAC5C,IAAI,EAAI,CAAE,SAAS,CAAW;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/lib/renderer.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,0DAAkC;AAClC,mCAA0C;AAE1C,MAAM,SAAS,GAAG;IACjB,KAAK,EAAG,CAAE,MAAM,CAAW;IAC3B,IAAI,EAAI,CAAE,KAAK,EAAE,SAAS,CAAW;IACrC,GAAG,EAAK,EAAY;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
+
"version": "18.0.3",
|
|
4
4
|
"description": "Wrapper around googleapis for getting data shortly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"google",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "rimraf dist && tsc -p ./tsconfig.build.json && copyfiles -u 1 src/templates/* dist/",
|
|
20
|
-
"build:ci": "tsc -noEmit -p ./tsconfig.build.json",
|
|
21
20
|
"lint": "eslint .",
|
|
22
21
|
"lint:fix": "npm run lint -- --fix",
|
|
23
22
|
"test": "jest --verbose",
|
|
@@ -28,9 +27,9 @@
|
|
|
28
27
|
"test:report:coverage": "nyc report --nycrc-path ./coverage.config.js -t ./coverage --report-dir ./coverage"
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@anmiles/logger": "^7.0.
|
|
32
|
-
"@anmiles/prototypes": "^10.0.
|
|
33
|
-
"@anmiles/sleep": "^4.0.
|
|
30
|
+
"@anmiles/logger": "^7.0.2",
|
|
31
|
+
"@anmiles/prototypes": "^10.0.4",
|
|
32
|
+
"@anmiles/sleep": "^4.0.1",
|
|
34
33
|
"out-url": "^1.2.2",
|
|
35
34
|
"server-destroy": "^1.0.1"
|
|
36
35
|
},
|
|
@@ -38,21 +37,21 @@
|
|
|
38
37
|
"googleapis": "^130.0.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"@anmiles/eslint-config": "^7.
|
|
42
|
-
"@anmiles/tsconfig": "^
|
|
40
|
+
"@anmiles/eslint-config": "^7.1.1",
|
|
41
|
+
"@anmiles/tsconfig": "^3.0.1",
|
|
43
42
|
"@stylistic/eslint-plugin": "^1.7.0",
|
|
44
43
|
"@types/event-emitter": "^0.3.5",
|
|
45
44
|
"@types/jest": "^29.5.12",
|
|
46
45
|
"@types/server-destroy": "^1.0.3",
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
48
|
-
"@typescript-eslint/parser": "^7.
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
47
|
+
"@typescript-eslint/parser": "^7.3.1",
|
|
49
48
|
"copyfiles": "^2.4.1",
|
|
50
49
|
"eslint": "^8.57.0",
|
|
51
50
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
52
51
|
"eslint-plugin-align-assignments": "^1.1.2",
|
|
53
52
|
"eslint-plugin-import": "^2.29.1",
|
|
54
53
|
"eslint-plugin-jest": "^27.9.0",
|
|
55
|
-
"eslint-plugin-jsonc": "^2.
|
|
54
|
+
"eslint-plugin-jsonc": "^2.14.1",
|
|
56
55
|
"eslint-plugin-n": "^16.6.2",
|
|
57
56
|
"eslint-plugin-promise": "^6.1.1",
|
|
58
57
|
"event-emitter": "^0.3.5",
|
|
@@ -36,6 +36,7 @@ jest.mock<Partial<typeof paths>>('../paths', () => ({
|
|
|
36
36
|
}));
|
|
37
37
|
|
|
38
38
|
const mockTemplates: Record<TemplateName, string> = {
|
|
39
|
+
index : 'index page = (${page})',
|
|
39
40
|
page : 'page css = (${css}) content = (${content})',
|
|
40
41
|
css : 'css',
|
|
41
42
|
auth : 'auth profile = (${profile}) authUrl = (${authUrl}) scopesList = (${scopesList})',
|
|
@@ -51,14 +52,14 @@ describe('src/lib/renderer', () => {
|
|
|
51
52
|
describe('renderAuth', () => {
|
|
52
53
|
it('should return auth page', () => {
|
|
53
54
|
const result = original.renderAuth({ authUrl, profile, scope });
|
|
54
|
-
expect(result).toEqual('page css = (css) content = (auth profile = (username) authUrl = (https://authUrl) scopesList = (scope type = (readonly) title = (Readonly (cannot change or delete your data)) name = (scope1.readonly)\nscope type = () title = (Writable (can change or delete your data)) name = (scope2)))');
|
|
55
|
+
expect(result).toEqual('index page = (page css = (css) content = (auth profile = (username) authUrl = (https://authUrl) scopesList = (scope type = (readonly) title = (Readonly (cannot change or delete your data)) name = (scope1.readonly)\nscope type = () title = (Writable (can change or delete your data)) name = (scope2))))');
|
|
55
56
|
});
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
describe('renderDone', () => {
|
|
59
60
|
it('should return done page', () => {
|
|
60
61
|
const result = original.renderDone({ profile });
|
|
61
|
-
expect(result).toEqual('page css = (css) content = (done profile = (username))');
|
|
62
|
+
expect(result).toEqual('index page = (page css = (css) content = (done profile = (username)))');
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
65
|
|
package/src/lib/renderer.ts
CHANGED
|
@@ -3,6 +3,7 @@ import renderer from './renderer';
|
|
|
3
3
|
import { getTemplateFile } from './paths';
|
|
4
4
|
|
|
5
5
|
const templates = {
|
|
6
|
+
index : [ 'page' ] as const,
|
|
6
7
|
page : [ 'css', 'content' ] as const,
|
|
7
8
|
css : [ ] as const,
|
|
8
9
|
auth : [ 'profile', 'authUrl', 'scopesList' ],
|
|
@@ -23,13 +24,15 @@ function renderAuth({ profile, authUrl, scope }: { profile : string; authUrl : s
|
|
|
23
24
|
|
|
24
25
|
const css = render('css', {});
|
|
25
26
|
const content = render('auth', { profile, authUrl, scopesList });
|
|
26
|
-
|
|
27
|
+
const page = render('page', { css, content });
|
|
28
|
+
return render('index', { page });
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
function renderDone({ profile }: { profile : string }): string {
|
|
30
32
|
const css = render('css', {});
|
|
31
33
|
const content = render('done', { profile });
|
|
32
|
-
|
|
34
|
+
const page = render('page', { css, content });
|
|
35
|
+
return render('index', { page });
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
// TODO: Use react
|