pwa-auth 2.0.8 → 3.0.1

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 (188) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +37 -18
  3. package/demonstration/compiled/pwa-auth.js +880 -0
  4. package/{demo → demonstration}/index.html +1 -1
  5. package/package.json +8 -7
  6. package/pwa-auth.js +4 -3
  7. package/{website → src}/THIRD_PARTY_LICENSES.txt +56 -56
  8. package/src/compiled/pwa-auth.js +880 -0
  9. package/src-typescript/css/toggle.ts +9 -0
  10. package/src-typescript/development/junk/firebase-object.ts +49 -0
  11. package/src-typescript/development/junk/notes.md +96 -0
  12. package/src-typescript/development/junk/phone.ts +146 -0
  13. package/src-typescript/development/junk/photo.ts +440 -0
  14. package/src-typescript/development/junk/telephone.ts +282 -0
  15. package/{source/firebase/firebase-login.ts → src-typescript/development/login.ts} +1 -1
  16. package/{source/firebase/firebase.ts → src-typescript/development/object.ts} +1 -1
  17. package/src-typescript/firebase/authentication.ts +11 -0
  18. package/{source/firebase/start.ts → src-typescript/firebase/interface.ts} +35 -64
  19. package/{source/custom-elements → src-typescript/webcomponents}/drawer/drawer.ts +1 -1
  20. package/{source/custom-elements → src-typescript/webcomponents}/drawer/input/forgot.ts +1 -1
  21. package/{source/custom-elements → src-typescript/webcomponents}/drawer/input/login.ts +1 -1
  22. package/{source/custom-elements → src-typescript/webcomponents}/drawer/input/sign-up.ts +2 -1
  23. package/{deploy/custom-elements/icon/css/icon.js → src-typescript/webcomponents/icon/css/icon.ts} +4 -3
  24. package/{source/custom-elements → src-typescript/webcomponents}/icon/icon.ts +2 -21
  25. package/{source/custom-elements → src-typescript/webcomponents}/settings/input/delete.ts +1 -1
  26. package/{source/custom-elements → src-typescript/webcomponents}/settings/input/email.ts +1 -1
  27. package/{source/custom-elements → src-typescript/webcomponents}/settings/input/images.ts +1 -1
  28. package/{source/custom-elements → src-typescript/webcomponents}/settings/input/name.ts +1 -1
  29. package/{source/custom-elements → src-typescript/webcomponents}/settings/input/password.ts +1 -1
  30. package/{source/custom-elements → src-typescript/webcomponents}/settings/input/uploader.ts +1 -1
  31. package/{source/custom-elements → src-typescript/webcomponents}/settings/settings.ts +2 -2
  32. package/deploy/css/default.d.ts +0 -5
  33. package/deploy/css/default.d.ts.map +0 -1
  34. package/deploy/css/default.js +0 -99
  35. package/deploy/css/font.d.ts +0 -2
  36. package/deploy/css/font.d.ts.map +0 -1
  37. package/deploy/css/font.js +0 -16
  38. package/deploy/css/form/button.d.ts +0 -3
  39. package/deploy/css/form/button.d.ts.map +0 -1
  40. package/deploy/css/form/button.js +0 -54
  41. package/deploy/css/form/input.d.ts +0 -3
  42. package/deploy/css/form/input.d.ts.map +0 -1
  43. package/deploy/css/form/input.js +0 -24
  44. package/deploy/css/form/label.d.ts +0 -3
  45. package/deploy/css/form/label.d.ts.map +0 -1
  46. package/deploy/css/form/label.js +0 -22
  47. package/deploy/css/form/list.d.ts +0 -3
  48. package/deploy/css/form/list.d.ts.map +0 -1
  49. package/deploy/css/form/list.js +0 -22
  50. package/deploy/css/svg.d.ts +0 -4
  51. package/deploy/css/svg.d.ts.map +0 -1
  52. package/deploy/css/svg.js +0 -4
  53. package/deploy/css/toggle.d.ts +0 -2
  54. package/deploy/css/toggle.d.ts.map +0 -1
  55. package/deploy/css/toggle.js +0 -8
  56. package/deploy/custom-elements/drawer/css/drawer.d.ts +0 -3
  57. package/deploy/custom-elements/drawer/css/drawer.d.ts.map +0 -1
  58. package/deploy/custom-elements/drawer/css/drawer.js +0 -55
  59. package/deploy/custom-elements/drawer/css/exit.d.ts +0 -3
  60. package/deploy/custom-elements/drawer/css/exit.d.ts.map +0 -1
  61. package/deploy/custom-elements/drawer/css/exit.js +0 -48
  62. package/deploy/custom-elements/drawer/css/link.d.ts +0 -3
  63. package/deploy/custom-elements/drawer/css/link.d.ts.map +0 -1
  64. package/deploy/custom-elements/drawer/css/link.js +0 -12
  65. package/deploy/custom-elements/drawer/css/paragraph.d.ts +0 -3
  66. package/deploy/custom-elements/drawer/css/paragraph.d.ts.map +0 -1
  67. package/deploy/custom-elements/drawer/css/paragraph.js +0 -10
  68. package/deploy/custom-elements/drawer/css/toggle.d.ts +0 -3
  69. package/deploy/custom-elements/drawer/css/toggle.d.ts.map +0 -1
  70. package/deploy/custom-elements/drawer/css/toggle.js +0 -18
  71. package/deploy/custom-elements/drawer/drawer.d.ts +0 -37
  72. package/deploy/custom-elements/drawer/drawer.d.ts.map +0 -1
  73. package/deploy/custom-elements/drawer/drawer.js +0 -128
  74. package/deploy/custom-elements/drawer/input/forgot.d.ts +0 -16
  75. package/deploy/custom-elements/drawer/input/forgot.d.ts.map +0 -1
  76. package/deploy/custom-elements/drawer/input/forgot.js +0 -60
  77. package/deploy/custom-elements/drawer/input/login.d.ts +0 -20
  78. package/deploy/custom-elements/drawer/input/login.d.ts.map +0 -1
  79. package/deploy/custom-elements/drawer/input/login.js +0 -128
  80. package/deploy/custom-elements/drawer/input/sign-up.d.ts +0 -20
  81. package/deploy/custom-elements/drawer/input/sign-up.d.ts.map +0 -1
  82. package/deploy/custom-elements/drawer/input/sign-up.js +0 -137
  83. package/deploy/custom-elements/icon/css/icon.d.ts +0 -2
  84. package/deploy/custom-elements/icon/css/icon.d.ts.map +0 -1
  85. package/deploy/custom-elements/icon/icon.d.ts +0 -33
  86. package/deploy/custom-elements/icon/icon.d.ts.map +0 -1
  87. package/deploy/custom-elements/icon/icon.js +0 -72
  88. package/deploy/custom-elements/settings/css/navigation.d.ts +0 -2
  89. package/deploy/custom-elements/settings/css/navigation.d.ts.map +0 -1
  90. package/deploy/custom-elements/settings/css/navigation.js +0 -51
  91. package/deploy/custom-elements/settings/input/delete.d.ts +0 -34
  92. package/deploy/custom-elements/settings/input/delete.d.ts.map +0 -1
  93. package/deploy/custom-elements/settings/input/delete.js +0 -87
  94. package/deploy/custom-elements/settings/input/email.d.ts +0 -34
  95. package/deploy/custom-elements/settings/input/email.d.ts.map +0 -1
  96. package/deploy/custom-elements/settings/input/email.js +0 -98
  97. package/deploy/custom-elements/settings/input/images.d.ts +0 -2
  98. package/deploy/custom-elements/settings/input/images.d.ts.map +0 -1
  99. package/deploy/custom-elements/settings/input/images.js +0 -22
  100. package/deploy/custom-elements/settings/input/name.d.ts +0 -33
  101. package/deploy/custom-elements/settings/input/name.d.ts.map +0 -1
  102. package/deploy/custom-elements/settings/input/name.js +0 -90
  103. package/deploy/custom-elements/settings/input/password.d.ts +0 -36
  104. package/deploy/custom-elements/settings/input/password.d.ts.map +0 -1
  105. package/deploy/custom-elements/settings/input/password.js +0 -145
  106. package/deploy/custom-elements/settings/input/uploader.d.ts +0 -37
  107. package/deploy/custom-elements/settings/input/uploader.d.ts.map +0 -1
  108. package/deploy/custom-elements/settings/input/uploader.js +0 -225
  109. package/deploy/custom-elements/settings/settings.d.ts +0 -37
  110. package/deploy/custom-elements/settings/settings.d.ts.map +0 -1
  111. package/deploy/custom-elements/settings/settings.js +0 -197
  112. package/deploy/firebase/firebase-login.d.ts +0 -21
  113. package/deploy/firebase/firebase-login.d.ts.map +0 -1
  114. package/deploy/firebase/firebase-login.js +0 -85
  115. package/deploy/firebase/firebase.d.ts +0 -20
  116. package/deploy/firebase/firebase.d.ts.map +0 -1
  117. package/deploy/firebase/firebase.js +0 -76
  118. package/deploy/firebase/start.d.ts +0 -14
  119. package/deploy/firebase/start.d.ts.map +0 -1
  120. package/deploy/firebase/start.js +0 -86
  121. package/deploy/lazy-loader.d.ts +0 -11
  122. package/deploy/lazy-loader.d.ts.map +0 -1
  123. package/deploy/lazy-loader.js +0 -20
  124. package/deploy/redux/backend.d.ts +0 -16
  125. package/deploy/redux/backend.d.ts.map +0 -1
  126. package/deploy/redux/backend.js +0 -43
  127. package/deploy/redux/drawer.d.ts +0 -18
  128. package/deploy/redux/drawer.d.ts.map +0 -1
  129. package/deploy/redux/drawer.js +0 -21
  130. package/deploy/redux/frontend.d.ts +0 -17
  131. package/deploy/redux/frontend.d.ts.map +0 -1
  132. package/deploy/redux/frontend.js +0 -67
  133. package/deploy/redux/object.d.ts +0 -24
  134. package/deploy/redux/object.d.ts.map +0 -1
  135. package/deploy/redux/object.js +0 -1
  136. package/deploy/store.d.ts +0 -19
  137. package/deploy/store.d.ts.map +0 -1
  138. package/deploy/store.js +0 -13
  139. package/npm/THIRD_PARTY_LICENSES.txt +0 -303
  140. package/npm/pwa-auth.js +0 -306
  141. package/source/css/toggle.ts +0 -9
  142. package/source/custom-elements/icon/css/icon.ts +0 -70
  143. package/website/404.html +0 -33
  144. package/website/css/pwa-styles.css +0 -36
  145. package/website/css/styles.css +0 -48
  146. package/website/images/empty.jpg +0 -0
  147. package/website/images/favicon.ico +0 -0
  148. package/website/images/manifest/logo-144.png +0 -0
  149. package/website/images/manifest/logo-192.png +0 -0
  150. package/website/images/manifest/logo-48.png +0 -0
  151. package/website/images/manifest/logo-512.png +0 -0
  152. package/website/images/manifest/logo-72.png +0 -0
  153. package/website/images/manifest/logo-96.png +0 -0
  154. package/website/images/manifest/maskable_icon_x128.png +0 -0
  155. package/website/images/manifest/maskable_icon_x192.png +0 -0
  156. package/website/images/manifest/maskable_icon_x384.png +0 -0
  157. package/website/images/manifest/maskable_icon_x48.png +0 -0
  158. package/website/images/manifest/maskable_icon_x512.png +0 -0
  159. package/website/images/manifest/maskable_icon_x72.png +0 -0
  160. package/website/images/manifest/maskable_icon_x96.png +0 -0
  161. package/website/index.html +0 -69
  162. package/website/js/images/empty.jpg +0 -0
  163. package/website/js/pwa-auth.js +0 -306
  164. package/website/sitemap.xml +0 -11
  165. /package/{demo → demonstration}/css/pwa-styles.css +0 -0
  166. /package/{demo → demonstration}/css/styles.css +0 -0
  167. /package/{demo → demonstration}/images/empty.jpg +0 -0
  168. /package/{npm → src}/empty.jpg +0 -0
  169. /package/{npm → src}/pwa-styles.css +0 -0
  170. /package/{source → src-typescript}/css/default.ts +0 -0
  171. /package/{source → src-typescript}/css/font.ts +0 -0
  172. /package/{source → src-typescript}/css/form/button.ts +0 -0
  173. /package/{source → src-typescript}/css/form/input.ts +0 -0
  174. /package/{source → src-typescript}/css/form/label.ts +0 -0
  175. /package/{source → src-typescript}/css/form/list.ts +0 -0
  176. /package/{source → src-typescript}/css/svg.ts +0 -0
  177. /package/{source → src-typescript}/lazy-loader.ts +0 -0
  178. /package/{source → src-typescript}/redux/backend.ts +0 -0
  179. /package/{source → src-typescript}/redux/drawer.ts +0 -0
  180. /package/{source → src-typescript}/redux/frontend.ts +0 -0
  181. /package/{source → src-typescript}/redux/object.ts +0 -0
  182. /package/{source → src-typescript}/store.ts +0 -0
  183. /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/drawer.ts +0 -0
  184. /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/exit.ts +0 -0
  185. /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/link.ts +0 -0
  186. /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/paragraph.ts +0 -0
  187. /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/toggle.ts +0 -0
  188. /package/{source/custom-elements → src-typescript/webcomponents}/settings/css/navigation.ts +0 -0
@@ -1,197 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { css, html, LitElement } from 'lit';
8
- import { state, customElement, property } from 'lit/decorators.js';
9
- import { connect } from 'pwa-helpers/connect-mixin.js';
10
- import { store } from '../../store';
11
- import { navigateAuth } from '../../redux/frontend';
12
- import { navigation } from './css/navigation';
13
- import './input/uploader';
14
- import './input/name';
15
- import './input/email';
16
- import './input/password';
17
- import './input/delete';
18
- import { listStyle } from '../../css/form/list';
19
- let UserSettings = class UserSettings extends connect(store)(LitElement) {
20
- constructor() {
21
- super();
22
- this.emptyArtwork = '';
23
- this.profileTopic = '';
24
- this.name = '';
25
- }
26
- firstUpdated() {
27
- const forms = this.querySelectorAll('form');
28
- forms.forEach(item => {
29
- item.preventDefault();
30
- });
31
- this.shadowRoot.querySelector('button[value=profile]').addEventListener('click', () => {
32
- store.dispatch(navigateAuth('profile'));
33
- });
34
- this.shadowRoot.querySelector('button[value=verification]').addEventListener('click', () => {
35
- store.dispatch(navigateAuth('verification'));
36
- });
37
- this.shadowRoot.querySelector('button[value=password]').addEventListener('click', () => {
38
- store.dispatch(navigateAuth('password'));
39
- });
40
- this.shadowRoot.querySelector('button[value=delete]').addEventListener('click', () => {
41
- store.dispatch(navigateAuth('delete'));
42
- });
43
- }
44
- stateChanged(state) {
45
- this.profileTopic = state.frontend.settings;
46
- this.name = state.backend.name;
47
- }
48
- static get styles() {
49
- return [
50
- navigation,
51
- listStyle,
52
- css `
53
-
54
- /* Button Padding for Border Outline */
55
- :host {
56
- display: grid;
57
- background-color: var(--pwa_settings_background, white);
58
- }
59
-
60
- /* Page Form */
61
- form {
62
- box-sizing: border-box;
63
- display: grid;
64
- border: 0;
65
- }
66
-
67
- /* Page Title */
68
- .pageTitle { margin: 0; }
69
-
70
- h2 {
71
- color: var(--pwa_section_header, black);
72
- text-align: center;
73
- text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
74
-
75
- border-top: 2px solid var(--pwa_divider, black);
76
- border-bottom: 2px solid var(--pwa_divider, black);
77
-
78
- margin: 0;
79
- padding: 8px 0;
80
- }
81
-
82
- /* up to 576 pixels */
83
- @media only screen and (max-width: 576px) {
84
- h2 {
85
- font-size: medium;
86
- }
87
- }
88
-
89
- `
90
- ];
91
- }
92
- render() {
93
- return html `
94
-
95
- <!-- Page Menu -->
96
- <nav>
97
-
98
- <ul>
99
-
100
- <li>
101
- <button
102
- value="profile"
103
- ?on="${this.profileTopic === 'profile'}">Icon
104
- </button>
105
- </li>
106
-
107
- <li>
108
- <button
109
- value="verification"
110
- ?on="${this.profileTopic === 'verification'}">Profile
111
- </button>
112
- </li>
113
-
114
- <li>
115
- <button
116
- value="password"
117
- ?on="${this.profileTopic === 'password'}">Password
118
- </button>
119
- </li>
120
-
121
- <li>
122
- <button
123
- value="delete"
124
- ?on="${this.profileTopic === 'delete'}">Delete
125
- </button>
126
- </li>
127
-
128
- </ul>
129
-
130
- </nav>
131
-
132
- <!-- Page 1: Profile -->
133
- <section ?on="${this.profileTopic === 'profile'}">
134
-
135
- <!-- Display Username -->
136
- <h2>${this.name}</h2>
137
-
138
- <!-- Custom Image Element - Display / Upload -->
139
- <contact-photo emptyArtwork="${this.emptyArtwork}"></contact-photo>
140
-
141
- </section>
142
-
143
- <!-- Page 2: Verification -->
144
- <section ?on="${this.profileTopic === 'verification'}">
145
-
146
- <!-- Page Title -->
147
- <h2>Contact Information</h2>
148
-
149
- <!-- Custom - Username -->
150
- <input-name></input-name>
151
-
152
- <!-- Custom - Email -->
153
- <contact-email></contact-email>
154
-
155
- <!-- Indicator - Verified -->
156
- <div class="verified"></div>
157
-
158
- </section>
159
-
160
- <!-- Page 3: Password -->
161
- <section ?on="${this.profileTopic === 'password'}">
162
-
163
- <!-- Page Title -->
164
- <h2>Password</h2>
165
-
166
- <!-- Custom - Password -->
167
- <input-password></input-password>
168
-
169
- </section>
170
-
171
- <!-- Page 4: Delete -->
172
- <section ?on="${this.profileTopic === 'delete'}">
173
-
174
- <!-- Page Title -->
175
- <h2>Delete Account</h2>
176
-
177
- <!-- Custom - Delete -->
178
- <delete-user></delete-user>
179
-
180
- </section>
181
-
182
- `;
183
- }
184
- };
185
- __decorate([
186
- property({ type: String, reflect: true })
187
- ], UserSettings.prototype, "emptyArtwork", void 0);
188
- __decorate([
189
- state()
190
- ], UserSettings.prototype, "profileTopic", void 0);
191
- __decorate([
192
- state()
193
- ], UserSettings.prototype, "name", void 0);
194
- UserSettings = __decorate([
195
- customElement('user-settings')
196
- ], UserSettings);
197
- export { UserSettings };
@@ -1,21 +0,0 @@
1
- interface baseVerify {
2
- verifyPasswordResetCode: any;
3
- emailVerification: any;
4
- }
5
- interface baseLogin {
6
- signOut: any;
7
- isSignInWithEmailLink: any;
8
- signInWithEmailAndPassword: any;
9
- signInWithPopup: any;
10
- signInWithRedirect: any;
11
- signInAnonymously: any;
12
- signInWithCustomToken: any;
13
- signInWithEmailLink: any;
14
- signInWithPhoneNumber: any;
15
- signInWithCredential: any;
16
- updateCurrentUser: any;
17
- }
18
- export declare const authVerify: baseVerify;
19
- export declare const authLogin: baseLogin;
20
- export {};
21
- //# sourceMappingURL=firebase-login.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firebase-login.d.ts","sourceRoot":"","sources":["../../source/firebase/firebase-login.ts"],"names":[],"mappings":"AAkBA,UAAU,UAAU;IAClB,uBAAuB,EAAG,GAAG,CAAC;IAC9B,iBAAiB,EAAE,GAAG,CAAA;CACvB;AAED,UAAU,SAAS;IACjB,OAAO,EAAG,GAAG,CAAC;IACd,qBAAqB,EAAG,GAAG,CAAC;IAC5B,0BAA0B,EAAG,GAAG,CAAC;IACjC,eAAe,EAAG,GAAG,CAAC;IACtB,kBAAkB,EAAG,GAAG,CAAC;IACzB,iBAAiB,EAAG,GAAG,CAAC;IACxB,qBAAqB,EAAG,GAAG,CAAC;IAC5B,mBAAmB,EAAG,GAAG,CAAC;IAC1B,qBAAqB,EAAG,GAAG,CAAC;IAC5B,oBAAoB,EAAG,GAAG,CAAC;IAC3B,iBAAiB,EAAG,GAAG,CAAA;CACxB;AAED,eAAO,MAAM,UAAU,EAAG,UAiBzB,CAAA;AACD,eAAO,MAAM,SAAS,EAAG,SAwExB,CAAA"}
@@ -1,85 +0,0 @@
1
- import { isSignInWithEmailLink, signInAnonymously, signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, signInWithEmailLink, signInWithPhoneNumber, signInWithPopup, signInWithRedirect, signOut, updateCurrentUser, verifyPasswordResetCode, sendEmailVerification } from "firebase/auth";
2
- import { auth, user } from "./start";
3
- export const authVerify = {
4
- verifyPasswordResetCode: {
5
- description: "Verifies a password reset code sent to the user.",
6
- action: (code) => verifyPasswordResetCode(auth, code)
7
- .then(email => ({ email }))
8
- .catch(error => ({ error: error.code, message: error.message }))
9
- },
10
- emailVerification: {
11
- description: "Sends an email verification to the current user.",
12
- action: () => {
13
- if (user) {
14
- sendEmailVerification(user)
15
- .then(() => ({ success: true }))
16
- .catch((error) => ({ error: error.code, message: error.message }));
17
- }
18
- }
19
- }
20
- };
21
- export const authLogin = {
22
- isSignInWithEmailLink: {
23
- description: "Checks if a link is a valid sign-in with email link.",
24
- action: (link) => isSignInWithEmailLink(auth, link)
25
- },
26
- signInWithEmailAndPassword: {
27
- description: "Signs in a user with email and password.",
28
- action: (email, password) => signInWithEmailAndPassword(auth, email, password)
29
- .then(userCredential => ({ user: userCredential.user }))
30
- .catch(error => ({ error: error.code, message: error.message }))
31
- },
32
- signInWithPopup: {
33
- description: "Signs in a user via a popup with a federated provider (e.g., Google, Facebook).",
34
- action: (provider) => signInWithPopup(auth, provider)
35
- .then(result => ({ user: result.user }))
36
- .catch(error => ({ error: error.code, message: error.message }))
37
- },
38
- signInWithRedirect: {
39
- description: "Signs in a user via redirect with a federated provider.",
40
- action: (provider) => signInWithRedirect(auth, provider)
41
- .catch(error => ({ error: error.code, message: error.message }))
42
- },
43
- signInAnonymously: {
44
- description: "Signs in a user anonymously without credentials.",
45
- action: () => signInAnonymously(auth)
46
- .then(userCredential => ({ user: userCredential.user }))
47
- .catch(error => ({ error: error.code, message: error.message }))
48
- },
49
- signInWithCustomToken: {
50
- description: "Signs in a user with a custom token from an external auth system.",
51
- action: (token) => signInWithCustomToken(auth, token)
52
- .then(userCredential => ({ user: userCredential.user }))
53
- .catch(error => ({ error: error.code, message: error.message }))
54
- },
55
- signInWithEmailLink: {
56
- description: "Signs in a user with an email link.",
57
- action: (email, link) => signInWithEmailLink(auth, email, link)
58
- .then(userCredential => ({ user: userCredential.user }))
59
- .catch(error => ({ error: error.code, message: error.message }))
60
- },
61
- signInWithPhoneNumber: {
62
- description: "Signs in a user with a phone number and verification code.",
63
- action: (phoneNumber, appVerifier) => signInWithPhoneNumber(auth, phoneNumber, appVerifier)
64
- .then(confirmationResult => ({ confirmationResult }))
65
- .catch(error => ({ error: error.code, message: error.message }))
66
- },
67
- signInWithCredential: {
68
- description: "Signs in a user with a credential object (e.g., from OAuth).",
69
- action: (credential) => signInWithCredential(auth, credential)
70
- .then(userCredential => ({ user: userCredential.user }))
71
- .catch(error => ({ error: error.code, message: error.message }))
72
- },
73
- updateCurrentUser: {
74
- description: "Updates the current user with a new User object.",
75
- action: () => updateCurrentUser(auth, user)
76
- .then(() => ({ success: true }))
77
- .catch(error => ({ error: error.code, message: error.message }))
78
- },
79
- signOut: {
80
- description: "Signs out the current user.",
81
- action: () => signOut(auth)
82
- .then(() => ({ success: true }))
83
- .catch(error => ({ error: error.code, message: error.message }))
84
- }
85
- };
@@ -1,20 +0,0 @@
1
- interface base {
2
- applyActionCode: any;
3
- checkActionCode: any;
4
- beforeAuthStateChanged: any;
5
- confirmPasswordReset: any;
6
- sendPasswordResetEmail: any;
7
- connectAuthEmulator: any;
8
- createUserWithEmailAndPassword: any;
9
- fetchSignInMethodsForEmail: any;
10
- getMultiFactorResolver: any;
11
- getRedirectResult: any;
12
- initializeRecaptchaConfig: any;
13
- onAuthStateChanged: any;
14
- onIdTokenChanged: any;
15
- revokeAccessToken: any;
16
- }
17
- export declare const authFunctions: base;
18
- export declare const recoverEmail: (actionCode: any) => void;
19
- export {};
20
- //# sourceMappingURL=firebase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firebase.d.ts","sourceRoot":"","sources":["../../source/firebase/firebase.ts"],"names":[],"mappings":"AAiBA,UAAU,IAAI;IACZ,eAAe,EAAG,GAAG,CAAC;IACtB,eAAe,EAAG,GAAG,CAAC;IACtB,sBAAsB,EAAG,GAAG,CAAC;IAC7B,oBAAoB,EAAG,GAAG,CAAC;IAC3B,sBAAsB,EAAG,GAAG,CAAC;IAC7B,mBAAmB,EAAG,GAAG,CAAC;IAC1B,8BAA8B,EAAG,GAAG,CAAC;IACrC,0BAA0B,EAAG,GAAG,CAAC;IACjC,sBAAsB,EAAG,GAAG,CAAC;IAC7B,iBAAiB,EAAG,GAAG,CAAC;IACxB,yBAAyB,EAAG,GAAG,CAAC;IAChC,kBAAkB,EAAG,GAAG,CAAC;IACzB,gBAAgB,EAAG,GAAG,CAAC;IACvB,iBAAiB,EAAG,GAAG,CAAA;CACxB;AAGD,eAAO,MAAM,aAAa,EAAG,IAqF5B,CAAC;AAKF,eAAO,MAAM,YAAY,GAAc,YAAW,GAAG,SA6BpD,CAAA"}
@@ -1,76 +0,0 @@
1
- import { applyActionCode, beforeAuthStateChanged, checkActionCode, confirmPasswordReset, createUserWithEmailAndPassword, fetchSignInMethodsForEmail, getRedirectResult, onAuthStateChanged, onIdTokenChanged, sendPasswordResetEmail } from "firebase/auth";
2
- import { auth } from "./start";
3
- export const authFunctions = {
4
- applyActionCode: {
5
- description: "Applies an out-of-band verification code (e.g., email verification).",
6
- action: (oobCode) => applyActionCode(auth, oobCode)
7
- .then(() => ({ success: true }))
8
- .catch((error) => ({ error: error.code, message: error.message }))
9
- },
10
- checkActionCode: {
11
- description: "Checks the metadata of an out-of-band verification code.",
12
- action: (code) => checkActionCode(auth, code)
13
- .then((info) => ({ info }))
14
- .catch((error) => ({ error: error.code, message: error.message }))
15
- },
16
- beforeAuthStateChanged: {
17
- description: 'Adds a blocking callback that runs before an auth state change sets a new user.',
18
- code: (callback, onAbort) => beforeAuthStateChanged(auth, callback, onAbort)
19
- },
20
- confirmPasswordReset: {
21
- description: "Completes the password reset process with a code and new password.",
22
- action: (code, newPassword) => confirmPasswordReset(auth, code, newPassword)
23
- .then(() => ({ success: true }))
24
- .catch((error) => ({ error: error.code, message: error.message }))
25
- },
26
- sendPasswordResetEmail: {
27
- description: "Sends a password reset email to the user.",
28
- action: (email) => sendPasswordResetEmail(auth, email)
29
- .then(() => ({ success: true }))
30
- .catch(error => ({ error: error.code, message: error.message }))
31
- },
32
- connectAuthEmulator: {},
33
- createUserWithEmailAndPassword: {
34
- description: "Creates a new user account with email and password, and signs them in.",
35
- action: (email, password) => createUserWithEmailAndPassword(auth, email, password)
36
- .then((userCredential) => ({ user: userCredential.user }))
37
- .catch((error) => ({ error: error.code, message: error.message }))
38
- },
39
- fetchSignInMethodsForEmail: {
40
- description: "Gets the list of sign-in methods for a given email.",
41
- action: (email) => fetchSignInMethodsForEmail(auth, email)
42
- .then((methods) => ({ methods }))
43
- .catch((error) => ({ error: error.code, message: error.message }))
44
- },
45
- getMultiFactorResolver: {},
46
- getRedirectResult: {
47
- description: "Retrieves the result of a redirect-based sign-in flow.",
48
- action: () => getRedirectResult(auth)
49
- .then((result) => ({ user: result.user }))
50
- .catch((error) => ({ error: error.code, message: error.message }))
51
- },
52
- initializeRecaptchaConfig: {},
53
- onAuthStateChanged: {
54
- description: "Listens for changes in the authentication state.",
55
- action: (callback) => onAuthStateChanged(auth, callback)
56
- },
57
- onIdTokenChanged: {
58
- description: "Listens for changes in the ID token.",
59
- action: (callback) => onIdTokenChanged(auth, callback)
60
- },
61
- revokeAccessToken: {}
62
- };
63
- export const recoverEmail = (actionCode) => {
64
- let restoredEmail = null;
65
- checkActionCode(auth, actionCode).then((info) => {
66
- restoredEmail = info['data']['email'];
67
- return applyActionCode(auth, actionCode);
68
- }).then(() => {
69
- sendPasswordResetEmail(auth, restoredEmail).then(() => {
70
- }).catch((error) => {
71
- console.log(error);
72
- });
73
- }).catch((error) => {
74
- console.log(error);
75
- });
76
- };
@@ -1,14 +0,0 @@
1
- import { FirebaseApp } from 'firebase/app';
2
- import { Auth, User } from 'firebase/auth';
3
- import { Firestore } from "firebase/firestore";
4
- import { FirebaseStorage } from "@firebase/storage";
5
- export declare const application: FirebaseApp;
6
- export declare const db: Firestore;
7
- export declare const storage: FirebaseStorage;
8
- export declare const auth: Auth;
9
- export declare const user: User | null;
10
- export declare const logOut: () => Promise<void>;
11
- export declare const logAccount: () => Promise<void>;
12
- export declare const logAccountDelete: () => Promise<void>;
13
- export declare const deleteDocument: (collect: string, item: string) => Promise<void>;
14
- //# sourceMappingURL=start.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../source/firebase/start.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAiB,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAA+D,MAAM,eAAe,CAAC;AAGxG,OAAO,EAAgB,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EAAc,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAiBhE,eAAO,MAAM,WAAW,EAAM,WAAiD,CAAC;AAChF,eAAO,MAAM,EAAE,EAAe,SAA6C,CAAC;AAC5E,eAAO,MAAM,OAAO,EAAU,eAA2C,CAAC;AAC1E,eAAO,MAAM,IAAI,EAAa,IAAwC,CAAC;AACvE,eAAO,MAAM,IAAI,EAAa,IAAI,GAAG,IAA6B,CAAC;AA+HnE,eAAO,MAAM,MAAM,qBAAoD,CAAC;AACxE,eAAO,MAAM,UAAU,qBAAiE,CAAC;AACzF,eAAO,MAAM,gBAAgB,qBAA2D,CAAC;AACzF,eAAO,MAAM,cAAc,GAAc,SAAQ,MAAM,EAAE,MAAK,MAAM,kBAInE,CAAC"}
@@ -1,86 +0,0 @@
1
- import { store } from '../store';
2
- import { closeSign, iconAuth, nameAuth, userAuth } from '../redux/frontend';
3
- import { accID, accEmail, accImage, accName } from '../redux/backend';
4
- import { initializeApp } from 'firebase/app';
5
- import { getAuth, onAuthStateChanged, sendEmailVerification, signOut } from 'firebase/auth';
6
- import { getFirestore, doc, deleteDoc } from "firebase/firestore";
7
- import { getStorage } from "@firebase/storage";
8
- import { getAnalytics, logEvent } from "firebase/analytics";
9
- import { isSupported } from "firebase/messaging";
10
- const firebaseConfig = JSON.parse(process.env.FIREBASE_CONFIG || "{}");
11
- export const application = initializeApp(firebaseConfig);
12
- export const db = getFirestore(application);
13
- export const storage = getStorage(application);
14
- export const auth = getAuth(application);
15
- export const user = auth.currentUser;
16
- getAuth().useDeviceLanguage();
17
- let analytics;
18
- (async () => {
19
- if (await isSupported()) {
20
- console.log('Firebase Analytics Supported');
21
- analytics = getAnalytics(application);
22
- }
23
- else {
24
- console.log("Firebase Analytics is not supported in this environment.");
25
- }
26
- })();
27
- if ('serviceWorker' in navigator) {
28
- console.log('Service Worker is supported');
29
- }
30
- else {
31
- console.log('Service Worker is not supported');
32
- }
33
- if ('PushManager' in window) {
34
- console.log('Push API is supported');
35
- }
36
- else {
37
- console.log('Push API is not supported');
38
- }
39
- let pendingEmailVerification = false;
40
- window.addEventListener("userEmailChanged", () => {
41
- pendingEmailVerification = true;
42
- });
43
- onAuthStateChanged(auth, (user) => {
44
- if (user) {
45
- store.dispatch(userAuth(true));
46
- store.dispatch(closeSign());
47
- store.dispatch(accID(user.uid));
48
- store.dispatch(accName(user.displayName || 'John Doe'));
49
- store.dispatch(accEmail(user.email || ''));
50
- store.dispatch(accImage(user.photoURL || ''));
51
- store.dispatch(nameAuth(user.displayName || 'John Doe'));
52
- store.dispatch(iconAuth(user.photoURL || ''));
53
- if (pendingEmailVerification && !user.emailVerified) {
54
- sendEmailVerification(user)
55
- .then(() => {
56
- console.log("Verification email sent to:");
57
- pendingEmailVerification = false;
58
- })
59
- .catch((error) => {
60
- console.error("Error sending verification email:", error.message);
61
- pendingEmailVerification = false;
62
- });
63
- }
64
- else if (user.emailVerified) {
65
- console.log("User's email is already verified:");
66
- }
67
- else {
68
- console.log("User signed in, no email verification pending:");
69
- }
70
- }
71
- else {
72
- store.dispatch(userAuth(false));
73
- store.dispatch(accID(''));
74
- store.dispatch(accName('John Doe'));
75
- store.dispatch(accEmail(''));
76
- store.dispatch(accImage(''));
77
- store.dispatch(nameAuth('John Doe'));
78
- store.dispatch(iconAuth(''));
79
- }
80
- });
81
- export const logOut = async () => { return signOut(auth); };
82
- export const logAccount = async () => { logEvent(analytics, 'create_account'); };
83
- export const logAccountDelete = async () => { logEvent(analytics, 'delete_account'); };
84
- export const deleteDocument = async (collect, item) => {
85
- await deleteDoc(doc(db, collect, item));
86
- };
@@ -1,11 +0,0 @@
1
- import { LitElement } from 'lit';
2
- export declare class LazyLoader extends LitElement {
3
- active: boolean;
4
- shouldUpdate(): boolean;
5
- }
6
- declare global {
7
- interface HTMLElementTagNameMap {
8
- 'lazy-loader': LazyLoader;
9
- }
10
- }
11
- //# sourceMappingURL=lazy-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lazy-loader.d.ts","sourceRoot":"","sources":["../source/lazy-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,qBAAa,UAAW,SAAQ,UAAU;IAGN,MAAM,EAAG,OAAO,CAAS;IAE3D,YAAY;CAIb;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -1,20 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { LitElement } from 'lit';
8
- import { property } from 'lit/decorators.js';
9
- export class LazyLoader extends LitElement {
10
- constructor() {
11
- super(...arguments);
12
- this.active = false;
13
- }
14
- shouldUpdate() {
15
- return this.active;
16
- }
17
- }
18
- __decorate([
19
- property({ type: Boolean })
20
- ], LazyLoader.prototype, "active", void 0);
@@ -1,16 +0,0 @@
1
- import { PayloadAction } from "@reduxjs/toolkit";
2
- import { backendAuth } from "./object";
3
- export declare const accountSlice: import("@reduxjs/toolkit").Slice<backendAuth, {
4
- accVerified: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<boolean>) => void;
5
- accAnon: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<boolean>) => void;
6
- accID: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<string>) => void;
7
- accName: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<string>) => void;
8
- accPhone: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<string>) => void;
9
- accEmail: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<string>) => void;
10
- accImage: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<string>) => void;
11
- messageId: (state: import("immer").WritableDraft<backendAuth>, action: PayloadAction<string>) => void;
12
- }, "backend", "backend", import("@reduxjs/toolkit").SliceSelectors<backendAuth>>;
13
- export declare const accVerified: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "backend/accVerified">, accID: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "backend/accID">, accName: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "backend/accName">, accPhone: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "backend/accPhone">, accEmail: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "backend/accEmail">, accImage: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "backend/accImage">, accAnon: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "backend/accAnon">, messageId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "backend/messageId">;
14
- declare const _default: import("redux").Reducer<backendAuth>;
15
- export default _default;
16
- //# sourceMappingURL=backend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../source/redux/backend.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,aAAa,EAAE,MAAS,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBvC,eAAO,MAAM,YAAY;6EAMU,aAAa,CAAC,OAAO,CAAC;yEAK1B,aAAa,CAAC,OAAO,CAAC;uEAKxB,aAAa,CAAC,MAAM,CAAC;yEAKnB,aAAa,CAAC,MAAM,CAAC;0EAKpB,aAAa,CAAC,MAAM,CAAC;0EAKrB,aAAa,CAAC,MAAM,CAAC;0EAKrB,aAAa,CAAC,MAAM,CAAC;2EAKpB,aAAa,CAAC,MAAM,CAAC;gFAKpD,CAAC;AAEH,eAAO,MAAQ,WAAW,uFAAE,KAAK,gFAAE,OAAO,kFAAE,QAAQ,mFAAE,QAAQ,mFAAE,QAAQ,mFAAE,OAAO,mFAAE,SAAS,kFAAyB,CAAC;;AAEtH,wBAAoC"}
@@ -1,43 +0,0 @@
1
- import { createSlice } from "@reduxjs/toolkit";
2
- const initialState = {
3
- verified: false,
4
- anon: false,
5
- userId: '',
6
- name: 'John Doe',
7
- email: '',
8
- photoURL: '',
9
- phone: '',
10
- msgToken: ''
11
- };
12
- export const accountSlice = createSlice({
13
- name: 'backend',
14
- initialState,
15
- reducers: {
16
- accVerified: (state, action) => {
17
- state.verified = action.payload;
18
- },
19
- accAnon: (state, action) => {
20
- state.anon = action.payload;
21
- },
22
- accID: (state, action) => {
23
- state.userId = action.payload;
24
- },
25
- accName: (state, action) => {
26
- state.name = action.payload;
27
- },
28
- accPhone: (state, action) => {
29
- state.phone = action.payload;
30
- },
31
- accEmail: (state, action) => {
32
- state.email = action.payload;
33
- },
34
- accImage: (state, action) => {
35
- state.photoURL = action.payload;
36
- },
37
- messageId: (state, action) => {
38
- state.msgToken = action.payload;
39
- },
40
- }
41
- });
42
- export const { accVerified, accID, accName, accPhone, accEmail, accImage, accAnon, messageId } = accountSlice.actions;
43
- export default accountSlice.reducer;
@@ -1,18 +0,0 @@
1
- export declare const drawerSlice: import("@reduxjs/toolkit").Slice<{
2
- drawer: boolean;
3
- }, {
4
- setDrawer: (state: import("immer").WritableDraft<{
5
- drawer: boolean;
6
- }>) => void;
7
- closeDrawer: (state: import("immer").WritableDraft<{
8
- drawer: boolean;
9
- }>) => void;
10
- }, "drawers", "drawers", import("@reduxjs/toolkit").SliceSelectors<{
11
- drawer: boolean;
12
- }>>;
13
- export declare const setDrawer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"drawers/setDrawer">, closeDrawer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"drawers/closeDrawer">;
14
- declare const _default: import("redux").Reducer<{
15
- drawer: boolean;
16
- }>;
17
- export default _default;
18
- //# sourceMappingURL=drawer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../source/redux/drawer.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;;;;GA0BtB,CAAC;AAEH,eAAO,MAAQ,SAAS,+EAAE,WAAW,+EAAwB,CAAC;;;;AAE9D,wBAAmC"}
@@ -1,21 +0,0 @@
1
- import { createSlice } from "@reduxjs/toolkit";
2
- const initialState = { drawer: false };
3
- export const drawerSlice = createSlice({
4
- name: 'drawers',
5
- initialState,
6
- reducers: {
7
- setDrawer: (state) => {
8
- if (state.drawer === false) {
9
- state.drawer = true;
10
- }
11
- else {
12
- state.drawer = false;
13
- }
14
- },
15
- closeDrawer: (state) => {
16
- state.drawer = false;
17
- }
18
- }
19
- });
20
- export const { setDrawer, closeDrawer } = drawerSlice.actions;
21
- export default drawerSlice.reducer;