@nu-art/user-account-frontend 0.500.0 → 0.500.6

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.
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import './ATS_AccountEditor.scss';
3
3
  import { Component_AccountEditor } from '../../account-editor/Component_AccountEditor.js';
4
4
  import { generateUUID } from '@nu-art/ts-common';
5
- import { ModuleFE_Account } from '../../_entity/account/index.js';
5
+ import { ModuleFE_Account } from '../../_entity/account/ModuleFE_Account.js';
6
6
  import { ComponentSync, LL_H_C, TS_PropRenderer } from '@nu-art/thunder-widgets';
7
7
  import { Button, LL_V_L } from '@nu-art/thunder-widgets/v3';
8
8
  import { _className } from '@nu-art/thunder-core';
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { __stringify } from '@nu-art/ts-common';
3
- import { ModuleFE_Account } from '../_entity/account/index.js';
3
+ import { ModuleFE_Account } from '../_entity/account/ModuleFE_Account.js';
4
4
  import { ComponentSync, LL_V_L, TS_Input, TS_TextArea } from '@nu-art/thunder-widgets';
5
5
  export class ATS_SessionData extends ComponentSync {
6
6
  static screen = { name: `SessionData`, renderer: this, group: 'Permissions' };
@@ -35,6 +35,7 @@ declare class ModuleFE_Account_Class extends ModuleFE_BaseApi<DatabaseDef_Accoun
35
35
  loginSaml(params: API_SAML['loginSaml']['Params']): Promise<API_SAML['loginSaml']['Response']>;
36
36
  assertSAML(body: API_SAML['assertSAML']['Body']): Promise<API_SAML['assertSAML']['Response']>;
37
37
  getPasswordAssertionConfig(_params?: API_UserAccount['getPasswordAssertionConfig']['Params']): Promise<API_UserAccount['getPasswordAssertionConfig']['Response']>;
38
+ deleteAccount(params: API_UserAccount['deleteAccount']['Params']): Promise<API_UserAccount['deleteAccount']['Response']>;
38
39
  protected init(): void;
39
40
  getAccounts(): UI_Account[];
40
41
  getLoggedStatus: () => LoggedStatus;
@@ -51,6 +52,7 @@ declare class ModuleFE_Account_Class extends ModuleFE_BaseApi<DatabaseDef_Accoun
51
52
  private onThumbnailChanged;
52
53
  private onLoginCompletedSAML;
53
54
  private onPasswordAssertionConfig;
55
+ private onAccountDeleted;
54
56
  }
55
57
  export declare const ModuleFE_Account: ModuleFE_Account_Class;
56
58
  export {};
@@ -67,6 +67,7 @@ let ModuleFE_Account_Class = (() => {
67
67
  let _loginSaml_decorators;
68
68
  let _assertSAML_decorators;
69
69
  let _getPasswordAssertionConfig_decorators;
70
+ let _deleteAccount_decorators;
70
71
  return class ModuleFE_Account_Class extends _classSuper {
71
72
  static {
72
73
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
@@ -83,6 +84,7 @@ let ModuleFE_Account_Class = (() => {
83
84
  _loginSaml_decorators = [ApiCaller(ApiDef_SAML.loginSaml, { onComplete: (m, ctx) => m.onLoginCompletedSAML(ctx) })];
84
85
  _assertSAML_decorators = [ApiCaller(ApiDef_SAML.assertSAML)];
85
86
  _getPasswordAssertionConfig_decorators = [ApiCaller(ApiDef_UserAccount.getPasswordAssertionConfig, { onComplete: (m, ctx) => m.onPasswordAssertionConfig(ctx) })];
87
+ _deleteAccount_decorators = [ApiCaller(ApiDef_UserAccount.deleteAccount, { onComplete: (m, ctx) => m.onAccountDeleted(ctx) })];
86
88
  __esDecorate(this, null, _refreshSession_decorators, { kind: "method", name: "refreshSession", static: false, private: false, access: { has: obj => "refreshSession" in obj, get: obj => obj.refreshSession }, metadata: _metadata }, null, _instanceExtraInitializers);
87
89
  __esDecorate(this, null, _registerAccount_decorators, { kind: "method", name: "registerAccount", static: false, private: false, access: { has: obj => "registerAccount" in obj, get: obj => obj.registerAccount }, metadata: _metadata }, null, _instanceExtraInitializers);
88
90
  __esDecorate(this, null, _createAccount_decorators, { kind: "method", name: "createAccount", static: false, private: false, access: { has: obj => "createAccount" in obj, get: obj => obj.createAccount }, metadata: _metadata }, null, _instanceExtraInitializers);
@@ -96,6 +98,7 @@ let ModuleFE_Account_Class = (() => {
96
98
  __esDecorate(this, null, _loginSaml_decorators, { kind: "method", name: "loginSaml", static: false, private: false, access: { has: obj => "loginSaml" in obj, get: obj => obj.loginSaml }, metadata: _metadata }, null, _instanceExtraInitializers);
97
99
  __esDecorate(this, null, _assertSAML_decorators, { kind: "method", name: "assertSAML", static: false, private: false, access: { has: obj => "assertSAML" in obj, get: obj => obj.assertSAML }, metadata: _metadata }, null, _instanceExtraInitializers);
98
100
  __esDecorate(this, null, _getPasswordAssertionConfig_decorators, { kind: "method", name: "getPasswordAssertionConfig", static: false, private: false, access: { has: obj => "getPasswordAssertionConfig" in obj, get: obj => obj.getPasswordAssertionConfig }, metadata: _metadata }, null, _instanceExtraInitializers);
101
+ __esDecorate(this, null, _deleteAccount_decorators, { kind: "method", name: "deleteAccount", static: false, private: false, access: { has: obj => "deleteAccount" in obj, get: obj => obj.deleteAccount }, metadata: _metadata }, null, _instanceExtraInitializers);
99
102
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
100
103
  }
101
104
  status = (__runInitializers(this, _instanceExtraInitializers), LoggedStatus.LOGGED_OUT);
@@ -159,6 +162,10 @@ let ModuleFE_Account_Class = (() => {
159
162
  async getPasswordAssertionConfig(_params) {
160
163
  return undefined;
161
164
  }
165
+ async deleteAccount(params) {
166
+ void params;
167
+ return undefined;
168
+ }
162
169
  init() {
163
170
  super.init();
164
171
  let defaultTabId = StorageKey_TabId.get();
@@ -257,6 +264,9 @@ let ModuleFE_Account_Class = (() => {
257
264
  onPasswordAssertionConfig = async (ctx) => {
258
265
  StorageKey_PasswordAssertionConfig.set(ctx.response.config);
259
266
  };
267
+ onAccountDeleted = async (ctx) => {
268
+ await this.onEntryDeleted(ctx.response.account);
269
+ };
260
270
  };
261
271
  })();
262
272
  export const ModuleFE_Account = new ModuleFE_Account_Class();
@@ -42,6 +42,13 @@ class ModuleFE_Session_Class extends Module {
42
42
  return '';
43
43
  return `Bearer ${sessionJWT}`;
44
44
  });
45
+ HttpClient.default.setDefaultOnError(async (httpException) => {
46
+ if (httpException.responseCode === 401) {
47
+ this.logWarning('Received 401 — clearing session');
48
+ this.StorageKey_SessionId.delete();
49
+ StorageKey_SessionTimeoutTimestamp.set(currentTimeMillis());
50
+ }
51
+ });
45
52
  HttpClient.default.setDefaultOnComplete(async (__, _, request) => {
46
53
  if (!request.getUrl().startsWith(HttpClient.default.getOrigin()))
47
54
  return;
@@ -5,7 +5,7 @@ import { Button, ComponentSync, Grid, LL_H_C, LL_V_L, ModuleFE_Clipboard, Module
5
5
  import { capitalizeFirstLetter, DateTimeFormat_yyyyMMDDTHHmmss, JwtTools, Year } from '@nu-art/ts-common';
6
6
  import './Component_AccountEditor.scss';
7
7
  import { TS_Icons } from '@nu-art/ts-styles';
8
- import { ModuleFE_Account } from '../_entity.js';
8
+ import { ModuleFE_Account } from '../_entity/account/ModuleFE_Account.js';
9
9
  import { TS_Input } from '@nu-art/thunder-widgets/v3';
10
10
  import { _className } from '@nu-art/thunder-core';
11
11
  export class Component_AccountEditor extends ComponentSync {
package/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- export * from './_entity.js';
2
- export * from './module-pack.js';
1
+ export * from './_entity/session/ModuleFE_Session.js';
3
2
  export * from './_entity/account/ModuleFE_Account.js';
3
+ export * from './_entity/account/module-pack.js';
4
+ export * from './_entity/account/consts.js';
5
+ export * from './module-pack.js';
4
6
  export * from './ui/Component_Login/Component_Login.js';
5
7
  export * from './ui/Component_Register.js';
6
8
  export * from './ui/Component_GoogleSAMLLogin/Component_GoogleSAMLLogin.js';
package/index.js CHANGED
@@ -15,9 +15,11 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- export * from './_entity.js';
19
- export * from './module-pack.js';
18
+ export * from './_entity/session/ModuleFE_Session.js';
20
19
  export * from './_entity/account/ModuleFE_Account.js';
20
+ export * from './_entity/account/module-pack.js';
21
+ export * from './_entity/account/consts.js';
22
+ export * from './module-pack.js';
21
23
  export * from './ui/Component_Login/Component_Login.js';
22
24
  export * from './ui/Component_Register.js';
23
25
  export * from './ui/Component_GoogleSAMLLogin/Component_GoogleSAMLLogin.js';
package/module-pack.js CHANGED
@@ -15,7 +15,7 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- import { ModulePackFE_AccountDB } from './_entity.js';
18
+ import { ModulePackFE_AccountDB } from './_entity/account/module-pack.js';
19
19
  export const ModulePackFE_Accounts = [
20
20
  ...ModulePackFE_AccountDB,
21
21
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/user-account-frontend",
3
- "version": "0.500.0",
3
+ "version": "0.500.6",
4
4
  "description": "User Account Frontend",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -34,22 +34,22 @@
34
34
  "test": "ts-mocha -w -p src/test/tsconfig.json --timeout 0 --inspect=8107 --watch-files 'src/test/**/*.test.ts' src/test/**/*.test.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@nu-art/db-api-frontend": "0.500.0",
38
- "@nu-art/db-api-shared": "0.500.0",
39
- "@nu-art/http-client": "{{THUNDERSTORM_VERSION}}",
40
- "@nu-art/thunder-mouse-interactivity-frontend": "{{THUNDERSTORM_VERSION}}",
41
- "@nu-art/user-account-shared": "0.500.0",
42
- "@nu-art/firebase-frontend": "0.500.0",
43
- "@nu-art/firebase-shared": "0.500.0",
44
- "@nu-art/slack-frontend": "0.500.0",
45
- "@nu-art/slack-shared": "0.500.0",
46
- "@nu-art/thunder-widgets": "{{THUNDERSTORM_VERSION}}",
47
- "@nu-art/thunder-routing": "{{THUNDERSTORM_VERSION}}",
48
- "@nu-art/thunder-core": "{{THUNDERSTORM_VERSION}}",
49
- "@nu-art/thunder-ui-modules": "{{THUNDERSTORM_VERSION}}",
50
- "@nu-art/api-types": "{{THUNDERSTORM_VERSION}}",
51
- "@nu-art/ts-common": "0.500.0",
52
- "@nu-art/ts-styles": "0.500.0",
37
+ "@nu-art/db-api-frontend": "0.500.6",
38
+ "@nu-art/db-api-shared": "0.500.6",
39
+ "@nu-art/http-client": "0.500.6",
40
+ "@nu-art/thunder-mouse-interactivity-frontend": "0.500.6",
41
+ "@nu-art/user-account-shared": "0.500.6",
42
+ "@nu-art/firebase-frontend": "0.500.6",
43
+ "@nu-art/firebase-shared": "0.500.6",
44
+ "@nu-art/slack-frontend": "0.500.6",
45
+ "@nu-art/slack-shared": "0.500.6",
46
+ "@nu-art/thunder-widgets": "0.500.6",
47
+ "@nu-art/thunder-routing": "0.500.6",
48
+ "@nu-art/thunder-core": "0.500.6",
49
+ "@nu-art/thunder-ui-modules": "0.500.6",
50
+ "@nu-art/api-types": "0.500.6",
51
+ "@nu-art/ts-common": "0.500.6",
52
+ "@nu-art/ts-styles": "0.500.6",
53
53
  "express": "^4.18.2",
54
54
  "firebase": "^11.9.0",
55
55
  "firebase-admin": "13.4.0",
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ResolvableContent, UniqueId } from '@nu-art/ts-common';
3
- import { OnAccountsUpdated } from '../../_entity/account/index.js';
3
+ import { OnAccountsUpdated } from '../../_entity/account/ModuleFE_Account.js';
4
4
  import { DB_Account } from '@nu-art/user-account-shared';
5
5
  import './Component_AccountThumbnail.scss';
6
6
  import { ApiCallerEventType } from '@nu-art/db-api-shared';
@@ -1,6 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cloneObj, MUSTNeverHappenException, resolveContent } from '@nu-art/ts-common';
3
- import { ModuleFE_Account } from '../../_entity/account/index.js';
3
+ import { ModuleFE_Account } from '../../_entity/account/ModuleFE_Account.js';
4
4
  import { TS_Icons } from '@nu-art/ts-styles';
5
5
  import './Component_AccountThumbnail.scss';
6
6
  import { ComponentSync, TS_ErrorBoundary } from '@nu-art/thunder-widgets';
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button, ComponentSync, LL_V_L, TS_Input, TS_PropRenderer } from '@nu-art/thunder-widgets';
3
3
  import { ThisShouldNotHappenException } from '@nu-art/ts-common';
4
- import { ModuleFE_Account, SessionKeyFE_Account } from '../../_entity.js';
4
+ import { ModuleFE_Account } from '../../_entity/account/ModuleFE_Account.js';
5
+ import { SessionKeyFE_Account } from '../../_entity/account/consts.js';
5
6
  export class Component_ChangePassword extends ComponentSync {
6
7
  deriveStateFromProps(nextProps, state) {
7
8
  const account = SessionKeyFE_Account.get();
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { TS_Icons } from '@nu-art/ts-styles';
3
3
  import './Component_GoogleSAMLLogin.scss';
4
- import { ModuleFE_Account, StorageKey_DeviceId } from '../../_entity.js';
4
+ import { ModuleFE_Account } from '../../_entity/account/ModuleFE_Account.js';
5
+ import { StorageKey_DeviceId } from '../../_entity/account/consts.js';
5
6
  import { MUSTNeverHappenException } from '@nu-art/ts-common';
6
7
  import { Button } from '@nu-art/thunder-widgets/v3';
7
8
  export const Component_GoogleSAMLLogin = (props) => {
@@ -20,7 +20,8 @@ import { _keys, exists, formatTimestamp } from '@nu-art/ts-common';
20
20
  import { ErrorType_LoginBlocked } from '@nu-art/user-account-shared';
21
21
  import './Component_Login.scss';
22
22
  import { Button, ComponentSync, LL_H_C, LL_V_C, ModuleFE_Toaster, TS_PropRenderer } from '@nu-art/thunder-widgets';
23
- import { ModuleFE_Account, StorageKey_DeviceId } from '../../_entity.js';
23
+ import { ModuleFE_Account } from '../../_entity/account/ModuleFE_Account.js';
24
+ import { StorageKey_DeviceId } from '../../_entity/account/consts.js';
24
25
  import { Component_LoginBlocked } from '../Component_LoginBlocked/Component_LoginBlocked.js';
25
26
  import { TS_Input } from '@nu-art/thunder-widgets/v3';
26
27
  const form = {
@@ -99,7 +100,7 @@ export class Component_Login extends ComponentSync {
99
100
  }, onAccept: (value) => {
100
101
  this.onValueChanged(value, key, true);
101
102
  } }) }, i);
102
- }), _jsx(LL_H_C, { className: 'ts-account__error-container', children: this.errorRenderer() }), _jsx(Button, { variant: 'tertiary', className: `ts-account__action-button`, actionInProgress: this.state.submitting, disabled: exists(this.state.blockedUntil), onClick: this.login, children: "Login" })] });
103
+ }), _jsx(LL_H_C, { className: 'ts-account__error-container', children: this.errorRenderer() }), _jsx(Button, { variant: 'primary', className: `ts-account__action-button`, actionInProgress: this.state.submitting, disabled: exists(this.state.blockedUntil), onClick: this.login, children: "Login" })] });
103
104
  }
104
105
  renderErrorMessages = () => {
105
106
  if (!this.state.errorMessages?.length)
@@ -19,7 +19,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  import { Button, ComponentSync, Grid, LL_H_C, LL_V_C, TS_PropRenderer } from '@nu-art/thunder-widgets';
20
20
  import { _keys, addItemToArray, filterInstances } from '@nu-art/ts-common';
21
21
  import { assertPasswordRules, PasswordAssertionType_LowerCaseLetters, PasswordAssertionType_MaxLength, PasswordAssertionType_MinLength, PasswordAssertionType_Numbers, PasswordAssertionType_SpecialChars } from '@nu-art/user-account-shared';
22
- import { ModuleFE_Account, StorageKey_DeviceId } from '../_entity.js';
22
+ import { ModuleFE_Account } from '../_entity/account/ModuleFE_Account.js';
23
+ import { StorageKey_DeviceId } from '../_entity/account/consts.js';
23
24
  import { TS_Icons } from '@nu-art/ts-styles';
24
25
  import { TS_Input } from '@nu-art/thunder-widgets/v3';
25
26
  import { _className } from '@nu-art/thunder-core';
@@ -126,7 +127,7 @@ export class Component_Register extends ComponentSync {
126
127
  return _jsxs(LL_V_C, { className: "ts-account__authenticate", children: [_keys(form).map((key, i) => {
127
128
  const field = form[key];
128
129
  return _jsxs(TS_PropRenderer.Vertical, { label: field.label, children: [_jsx(TS_Input, { id: key, value: data[key], type: field.type, allowAccept: true, onChange: (data) => this.onValueChanged(data, key), onAccept: (data) => this.onValueChanged(data, key, true) }), key === 'password' && this.renderPasswordRules()] }, i);
129
- }), this.renderErrorMessages(), _jsx(Button, { onClick: this.registerClicked, actionInProgress: this.state.submitting, className: `clickable ts-account__action-button`, disabled: !!this.state.passwordFailureReport, children: "Register" })] });
130
+ }), this.renderErrorMessages(), _jsx(Button, { variant: 'primary', onClick: this.registerClicked, actionInProgress: this.state.submitting, className: `ts-account__action-button`, disabled: !!this.state.passwordFailureReport, children: "Register" })] });
130
131
  }
131
132
  renderErrorMessages = () => {
132
133
  if (!this.state.errorMessages?.length)
@@ -3,7 +3,7 @@ import { Button, ComponentSync, Grid, LL_H_C, LL_V_C, LL_V_L, TS_ComponentTransi
3
3
  import { resolveContent, RuntimeVersion } from '@nu-art/ts-common';
4
4
  import './PopUp_AccountMenu.scss';
5
5
  import { Component_ChangePassword } from '../Component_ChangePassword/Component_ChangePassword.js';
6
- import { ModuleFE_Account } from '../../_entity/account/index.js';
6
+ import { ModuleFE_Account } from '../../_entity/account/ModuleFE_Account.js';
7
7
  import { _className, openUrl } from '@nu-art/thunder-core';
8
8
  import { Component_AccountThumbnail } from '../Component_AccountThumbnail/Component_AccountThumbnail.js';
9
9
  import { getElementCenterPos, ModuleFE_MouseInteractivity, mouseInteractivity_PopUp } from '@nu-art/thunder-mouse-interactivity-frontend';
@@ -1,3 +0,0 @@
1
- export * from './ModuleFE_Account.js';
2
- export * from './module-pack.js';
3
- export * from './consts.js';
@@ -1,3 +0,0 @@
1
- export * from './ModuleFE_Account.js';
2
- export * from './module-pack.js';
3
- export * from './consts.js';
package/_entity.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './_entity/session/ModuleFE_Session.js';
2
- export * from './_entity/account/index.js';
3
- export * from './_entity/account/index.js';
package/_entity.js DELETED
@@ -1,3 +0,0 @@
1
- export * from './_entity/session/ModuleFE_Session.js';
2
- export * from './_entity/account/index.js';
3
- export * from './_entity/account/index.js';
@@ -1 +0,0 @@
1
- export * from './Component_Login.js';
@@ -1,18 +0,0 @@
1
- /*
2
- * User secured registration and login management system..
3
- *
4
- * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- export * from './Component_Login.js';