@anmiles/google-api-wrapper 15.0.0 → 15.1.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/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ 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
+ ## [15.1.0](../../tags/v15.1.0) - 2023-09-11
9
+ ### Changed
10
+ - Visual improvements for auth page
11
+ - Update dependencies (non-breaking)
12
+
8
13
  ## [15.0.0](../../tags/v15.0.0) - 2023-09-11
9
14
  ### Changed
10
15
  - Update dependencies
@@ -2,7 +2,7 @@ export { templates, renderAuth, renderDone };
2
2
  declare const templates: {
3
3
  readonly page: readonly ["content"];
4
4
  readonly auth: readonly ["profile", "authUrl", "scopesList"];
5
- readonly scope: readonly ["type", "name"];
5
+ readonly scope: readonly ["type", "title", "name"];
6
6
  readonly done: readonly ["profile"];
7
7
  };
8
8
  type TemplateName = keyof typeof templates;
@@ -20,7 +20,7 @@ declare const _default: {
20
20
  templates: {
21
21
  readonly page: readonly ["content"];
22
22
  readonly auth: readonly ["profile", "authUrl", "scopesList"];
23
- readonly scope: readonly ["type", "name"];
23
+ readonly scope: readonly ["type", "title", "name"];
24
24
  readonly done: readonly ["profile"];
25
25
  };
26
26
  render: typeof render;
@@ -10,7 +10,7 @@ const paths_1 = require("./paths");
10
10
  const templates = {
11
11
  page: ['content'],
12
12
  auth: ['profile', 'authUrl', 'scopesList'],
13
- scope: ['type', 'name'],
13
+ scope: ['type', 'title', 'name'],
14
14
  done: ['profile'],
15
15
  };
16
16
  exports.templates = templates;
@@ -18,6 +18,7 @@ const allHTML = {};
18
18
  function renderAuth({ profile, authUrl, scope }) {
19
19
  const scopesList = scope.map((s) => render('scope', {
20
20
  name: s.split('/').pop(),
21
+ title: s.endsWith('.readonly') ? 'Readonly (cannot change or delete your data)' : 'Writable (can change or delete your data)',
21
22
  type: s.endsWith('.readonly') ? 'readonly' : '',
22
23
  })).join('\n');
23
24
  const content = render('auth', { profile, authUrl, scopesList });
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/lib/renderer.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,0DAAkC;AAClC,mCAA0C;AAI1C,MAAM,SAAS,GAAG;IACjB,IAAI,EAAI,CAAE,SAAS,CAAW;IAC9B,IAAI,EAAI,CAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAE;IAC9C,KAAK,EAAG,CAAE,MAAM,EAAE,MAAM,CAAW;IACnC,IAAI,EAAI,CAAE,SAAS,CAAW;CACrB,CAAC;AAPF,8BAAS;AAWlB,MAAM,OAAO,GAAG,EAAkC,CAAC;AAEnD,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAyD;IACrG,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE;QACnD,IAAI,EAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY;QACnC,IAAI,EAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;KAChD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEf,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AACpC,CAAC;AArBmB,gCAAU;AAuB9B,SAAS,UAAU,CAAC,EAAE,OAAO,EAAuB;IACnD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,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EnF,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE;QAC/C,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,GAAU,IAAI,CAAC,OAAO,CAAC,MAAM,QAAQ,GAAG,EAAE,KAAK,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,WAAW,CAAC,YAA0B;IAC9C,IAAI,CAAC,CAAC,YAAY,IAAI,OAAO,CAAC,EAAE;QAC/B,MAAM,IAAI,GAAc,IAAA,uBAAe,EAAC,YAAY,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAU,YAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzD,OAAO,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC;KACjC;IAED,OAAO,OAAO,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC;AAED,kBAAe,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
@@ -23,7 +23,7 @@
23
23
  width: 450px;
24
24
  min-height: 500px;
25
25
  max-height: 100%;
26
- padding: 78px 40px 28px 40px;
26
+ padding: 82px 40px 28px 40px;
27
27
  margin: 1em;
28
28
  border: 1px solid #dadce0;
29
29
  border-radius: 8px;
@@ -43,10 +43,23 @@
43
43
  content: '';
44
44
  }
45
45
 
46
+ h1 {
47
+ font-size: 24px;
48
+ line-height: 40px;
49
+ font-weight: normal;
50
+ margin: 0;
51
+ }
52
+
53
+ p {
54
+ line-height: 32px;
55
+ margin: 0;
56
+ }
57
+
46
58
  ul {
47
59
  width: 100%;
48
- margin: 23px 0 30px 0;
60
+ margin: 18px 0 30px 0;
49
61
  padding-left: 0;
62
+ border-top: 1px solid #dadce0;
50
63
  list-style-type: none;
51
64
  overflow: auto;
52
65
  }
@@ -82,7 +95,7 @@
82
95
 
83
96
  a {
84
97
  width: 50%;
85
- line-height: 2em;
98
+ line-height: 42px;
86
99
  margin: auto;
87
100
  color: #ffffff;
88
101
  background: #0057e7;
@@ -91,18 +104,6 @@
91
104
  text-align: center;
92
105
  text-decoration: none;
93
106
  }
94
-
95
- h1 {
96
- font-size: 24px;
97
- line-height: 48px;
98
- font-weight: normal;
99
- margin: 0;
100
- }
101
-
102
- p {
103
- line-height: 24px;
104
- margin: 0;
105
- }
106
107
  </style>
107
108
  <div class="box">
108
109
  ${content}
@@ -1 +1 @@
1
- <li class="${type}">${name}</li>
1
+ <li class="${type}" title="${title}">${name}</li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmiles/google-api-wrapper",
3
- "version": "15.0.0",
3
+ "version": "15.1.0",
4
4
  "description": "Provides quick interface for getting google API data",
5
5
  "keywords": [
6
6
  "google",
@@ -43,8 +43,8 @@
43
43
  "@types/event-emitter": "^0.3.3",
44
44
  "@types/jest": "^29.5.4",
45
45
  "@types/server-destroy": "^1.0.1",
46
- "@typescript-eslint/eslint-plugin": "^6.6.0",
47
- "@typescript-eslint/parser": "^6.6.0",
46
+ "@typescript-eslint/eslint-plugin": "^6.7.0",
47
+ "@typescript-eslint/parser": "^6.7.0",
48
48
  "copyfiles": "^2.4.1",
49
49
  "eslint": "^8.49.0",
50
50
  "eslint-plugin-align-assignments": "^1.1.2",
@@ -38,7 +38,7 @@ jest.mock<Partial<typeof paths>>('../paths', () => ({
38
38
  const mockTemplates: Record<TemplateName, string> = {
39
39
  page : 'page content = (${content})',
40
40
  auth : 'auth profile = (${profile}) authUrl = (${authUrl}) scopesList = (${scopesList})',
41
- scope : 'scope type = (${type}) name = (${name})',
41
+ scope : 'scope type = (${type}) title = (${title}) name = (${name})',
42
42
  done : 'done profile = (${profile})',
43
43
  };
44
44
 
@@ -50,7 +50,7 @@ describe('src/lib/renderer', () => {
50
50
  describe('renderAuth', () => {
51
51
  it('should return auth page', () => {
52
52
  const result = original.renderAuth({ authUrl, profile, scope });
53
- expect(result).toEqual('page content = (auth profile = (username) authUrl = (https://authUrl) scopesList = (scope type = (readonly) name = (scope1.readonly)\nscope type = () name = (scope2)))');
53
+ expect(result).toEqual('page 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)))');
54
54
  });
55
55
  });
56
56
 
@@ -63,11 +63,11 @@ describe('src/lib/renderer', () => {
63
63
 
64
64
  describe('render', () => {
65
65
  it('should replace all template variables with their values', () => {
66
- const values = { type : 'readonly', name : 'scope.readonly' };
66
+ const values = { type : 'readonly', title : 'Readonly scope', name : 'scope.readonly' };
67
67
 
68
68
  const result = original.render('scope', values);
69
69
 
70
- expect(result).toEqual('scope type = (readonly) name = (scope.readonly)');
70
+ expect(result).toEqual('scope type = (readonly) title = (Readonly scope) name = (scope.readonly)');
71
71
  });
72
72
 
73
73
  it('should replace non-existing template variable with empty string', () => {
@@ -75,7 +75,7 @@ describe('src/lib/renderer', () => {
75
75
 
76
76
  const result = original.render('scope', values as any);
77
77
 
78
- expect(result).toEqual('scope type = () name = (scope.readonly)');
78
+ expect(result).toEqual('scope type = () title = () name = (scope.readonly)');
79
79
  });
80
80
  });
81
81
 
@@ -7,7 +7,7 @@ export { templates, renderAuth, renderDone };
7
7
  const templates = {
8
8
  page : [ 'content' ] as const,
9
9
  auth : [ 'profile', 'authUrl', 'scopesList' ],
10
- scope : [ 'type', 'name' ] as const,
10
+ scope : [ 'type', 'title', 'name' ] as const,
11
11
  done : [ 'profile' ] as const,
12
12
  } as const;
13
13
 
@@ -17,8 +17,9 @@ const allHTML = {} as Record<TemplateName, string>;
17
17
 
18
18
  function renderAuth({ profile, authUrl, scope }: { profile: string, authUrl: string, scope: string[] }) {
19
19
  const scopesList = scope.map((s) => render('scope', {
20
- name : s.split('/').pop() as string,
21
- type : s.endsWith('.readonly') ? 'readonly' : '',
20
+ name : s.split('/').pop() as string,
21
+ title : s.endsWith('.readonly') ? 'Readonly (cannot change or delete your data)' : 'Writable (can change or delete your data)',
22
+ type : s.endsWith('.readonly') ? 'readonly' : '',
22
23
  })).join('\n');
23
24
 
24
25
  const content = render('auth', { profile, authUrl, scopesList });
@@ -23,7 +23,7 @@
23
23
  width: 450px;
24
24
  min-height: 500px;
25
25
  max-height: 100%;
26
- padding: 78px 40px 28px 40px;
26
+ padding: 82px 40px 28px 40px;
27
27
  margin: 1em;
28
28
  border: 1px solid #dadce0;
29
29
  border-radius: 8px;
@@ -43,10 +43,23 @@
43
43
  content: '';
44
44
  }
45
45
 
46
+ h1 {
47
+ font-size: 24px;
48
+ line-height: 40px;
49
+ font-weight: normal;
50
+ margin: 0;
51
+ }
52
+
53
+ p {
54
+ line-height: 32px;
55
+ margin: 0;
56
+ }
57
+
46
58
  ul {
47
59
  width: 100%;
48
- margin: 23px 0 30px 0;
60
+ margin: 18px 0 30px 0;
49
61
  padding-left: 0;
62
+ border-top: 1px solid #dadce0;
50
63
  list-style-type: none;
51
64
  overflow: auto;
52
65
  }
@@ -82,7 +95,7 @@
82
95
 
83
96
  a {
84
97
  width: 50%;
85
- line-height: 2em;
98
+ line-height: 42px;
86
99
  margin: auto;
87
100
  color: #ffffff;
88
101
  background: #0057e7;
@@ -91,18 +104,6 @@
91
104
  text-align: center;
92
105
  text-decoration: none;
93
106
  }
94
-
95
- h1 {
96
- font-size: 24px;
97
- line-height: 48px;
98
- font-weight: normal;
99
- margin: 0;
100
- }
101
-
102
- p {
103
- line-height: 24px;
104
- margin: 0;
105
- }
106
107
  </style>
107
108
  <div class="box">
108
109
  ${content}
@@ -1 +1 @@
1
- <li class="${type}">${name}</li>
1
+ <li class="${type}" title="${title}">${name}</li>